Start a new topic

Android build segfaults when creating a thread?

My Wikitude-built app is crashing. I have very little information except for this logcat: 

09-08 11:57:55.864 17613 17613 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-08 11:57:55.864 17613 17613 F DEBUG : Build fingerprint: 'Verizon/zerofltevzw/zerofltevzw:7.0/NRD90M/G920VVRS4DQH1:user/release-keys'
09-08 11:57:55.864 17613 17613 F DEBUG : Revision: '10'
09-08 11:57:55.864 17613 17613 F DEBUG : ABI: 'arm'
09-08 11:57:55.865 17613 17613 F DEBUG : pid: 16160, tid: 16781, name: UnityMain >>> com.wikitude.unityexample <<<
09-08 11:57:55.865 17613 17613 F DEBUG : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xc9287380
09-08 11:57:55.865 17613 17613 F DEBUG : r0 c0c39380 r1 02193800 r2 f7474623 r3 f7474622
09-08 11:57:55.865 17613 17613 F DEBUG : r4 c8fd8180 r5 00000000 r6 c859c8f0 r7 c8b7e528
09-08 11:57:55.865 17613 17613 F DEBUG : r8 00000001 r9 cfad4800 sl c5f7df80 fp c8b7e5f4
09-08 11:57:55.865 17613 17613 F DEBUG : ip 00000000 sp c8b7e4f0 lr c437953b pc c4379552 cpsr 80030030
09-08 11:57:55.878 17613 17613 F DEBUG :
09-08 11:57:55.878 17613 17613 F DEBUG : backtrace:
09-08 11:57:55.879 17613 17613 F DEBUG : #00 pc 003d5552 /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZNK5flann27HierarchicalClusteringIndexINS_13HammingPopcntIhEEE6findNNILb0EEEvPNS3_4NodeERNS_9ResultSetIiEEPKhRiiPNS_4HeapINS_12BranchStructIS6_iEEEERNS_13DynamicBitsetE+309)
09-08 11:57:55.879 17613 17613 F DEBUG : #01 pc 003d5653 /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZNK5flann27HierarchicalClusteringIndexINS_13HammingPopcntIhEEE6findNNILb0EEEvPNS3_4NodeERNS_9ResultSetIiEEPKhRiiPNS_4HeapINS_12BranchStructIS6_iEEEERNS_13DynamicBitsetE+566)
09-08 11:57:55.879 17613 17613 F DEBUG : #02 pc 003d4c5f /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZNK5flann27HierarchicalClusteringIndexINS_13HammingPopcntIhEEE24findNeighborsWithRemovedILb0EEEvRNS_9ResultSetIiEEPKhRKNS_12SearchParamsE+90)
09-08 11:57:55.879 17613 17613 F DEBUG : #03 pc 003d853f /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZNK5flann7NNIndexINS_13HammingPopcntIhEEE9knnSearchERKNS_6MatrixIhEERNSt6__ndk16vectorINS9_IjNS8_9allocatorIjEEEENSA_ISC_EEEERNS9_INS9_IiNSA_IiEEEENSA_ISH_EEEEjRKNS_12SearchParamsE+454)
09-08 11:57:55.879 17613 17613 F DEBUG : #04 pc 003cd9bf /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZN6aramis9FlannTree16classifyMapPointEPhiib+102)
09-08 11:57:55.879 17613 17613 F DEBUG : #05 pc 003c1ca1 /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZN6aramis15FlannTreeReader16classifyMapPointEPhiib+22)
09-08 11:57:55.879 17613 17613 F DEBUG : #06 pc 0038877b /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZN6aramis11MapExpander25AddKeyFrameFromTopOfQueueEi+1858)
09-08 11:57:55.879 17613 17613 F DEBUG : #07 pc 00387ed7 /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZN6aramis11MapExpander12fetchCommandEv+238)
09-08 11:57:55.879 17613 17613 F DEBUG : #08 pc 00387dd3 /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZN6aramis11MapExpander19internalThreadEntryEv+10)
09-08 11:57:55.879 17613 17613 F DEBUG : #09 pc 0030249b /data/app/com.wikitude.unityexample-1/lib/arm/libnativesdk.so (_ZNSt6__ndk114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN6aramis13ThreadedClass19startInternalThreadEvEUlvE_EEEEEPvSB_+26)
09-08 11:57:55.879 17613 17613 F DEBUG : #10 pc 00047493 /system/lib/libc.so (_ZL15__pthread_startPv+22)
09-08 11:57:55.879 17613 17613 F DEBUG : #11 pc 00019f6d /system/lib/libc.so (__start_thread+6)

 

My build process is quite the Frankenstein: I have a bunch of C++ code I compile with Android Studio into a native library called by C# code from Unity as a Wikitude plugin. However, it looks like the error is mostly traced back to Wikitude code, so I thought I could ask an expert to see where to go.


Mark


Hello Mark,

Could you please provide some further details on the issue:
  • Which version of the SDK are you using?
  • What device does this happen with (os Version and model)?
  • In order for us to be able to investigate further you need to send the exact steps to reproduce this issue and explain the use case of your app. 
Thanks
Eva

I found that by commenting out different parts of my code, the error regularly would or wouldn't happen. I'm pretty sure I'm doing something with my unmanaged C++ code that corrupts memory. It's not a Wikitude issue.


Thanks,

Mark

Login or Signup to post a comment