Skip to content

"hs_circuitmap_init: Assertion !the_hs_circuitmap failed" when repeating failed tests on Android

When repeated running the Android TorService test suite from https://gitlab.com/eighthave/tor-android, I occasionally received this crash:

      main  src/feature/hs/hs_circuitmap.c:598: hs_circuitmap_init: Assertion !the_hs_circuitmap failed; aborting.
TorService  Bug: Tor 0.4.2.5 (git-7e55ab23311d00b6): Assertion !the_hs_circuitmap failed in hs_circuitmap_init at src/feature/hs/hs_circuitmap.c:598: . (Stack trace not available) (on Tor 0.4.2.5 7e55ab23311d00b6)
      libc  Fatal signal 6 (SIGABRT), code -6 in tid 862 (tor), pid 836 (oid.binary.test)
TorService  ⇠ run [1425ms]
     DEBUG  #00 pc 00000af0  [vdso:f319a000] (__kernel_vsyscall+16)
            #01 pc 0001edf8  /system/lib/libc.so (syscall+40)
            #02 pc 0001f073  /system/lib/libc.so (abort+115)
            #03 pc 0025ab6e  /data/app/org.torproject.android.binary.test-FWLW5957oXEttHq4Pbyz4w==/lib/x86/libtor.so (tor_raw_abort_+31)
            #04 pc 0025673e  /data/app/org.torproject.android.binary.test-FWLW5957oXEttHq4Pbyz4w==/lib/x86/libtor.so (tor_abort_+31)
            #05 pc 0014df1d  /data/app/org.torproject.android.binary.test-FWLW5957oXEttHq4Pbyz4w==/lib/x86/libtor.so (hs_circuitmap_init+146)
            #06 pc 00154110  /data/app/org.torproject.android.binary.test-FWLW5957oXEttHq4Pbyz4w==/lib/x86/libtor.so (hs_init+39)
            #07 pc 000b17ac  /data/app/org.torproject.android.binary.test-FWLW5957oXEttHq4Pbyz4w==/lib/x86/libtor.so (tor_init+132)
            #08 pc 000b2033  /data/app/org.torproject.android.binary.test-FWLW5957oXEttHq4Pbyz4w==/lib/x86/libtor.so (tor_run_main+243)
            #09 pc 000b0933  /data/app/org.torproject.android.binary.test-FWLW5957oXEttHq4Pbyz4w==/lib/x86/libtor.so (Java_org_torproject_jni_TorService_runMain+59)
            #10 pc 000085c8  /data/app/org.torproject.android.binary.test-FWLW5957oXEttHq4Pbyz4w==/oat/x86/base.odex (offset 0x8000)
            #11 pc 000091ff  [anon:libc_malloc:e6980000]
            #12 pc 01114457  /dev/ashmem/dalvik-main space (region space) (deleted)
            #13 pc 80e30d65  <unknown>

nickm said:

So there are at least two possibilities:

  1. tor is busted and is calling hs_circuitmap_init() more than it should
  2. tor is busted and is calling hs_circuitmap_free_all() less than it should there are probably more, like:
  3. there is a problem in the android harness, and it is trying to restart tor before it has shut down
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information