FMOD Crash on Android on first oneShot, FORTIFY: pthread_mutex_lock called on a destroyed mutex

It seems a bug I was only getting on Unity’s “Build and Run” has now become repeatable every run :frowning:
On the bright side it means I now have some logcat crash info, although no clue what it means, any suggestions? This crash happens the first time I try to play a oneshot. It seems FMod has initialized currectly as the background music is playing.

Blockquote
10-18 21:53:05.755 2589 2975 F libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x747b81be80)
10-18 21:53:05.759 2589 2896 I Unity : ContainerThemeLevels (2) resizeGridObject 1105 217
10-18 21:53:05.759 2589 2896 I Unity : UIGridObject:ResizeObject()
10-18 21:53:05.759 2589 2896 I Unity :
10-18 21:53:05.759 2589 2896 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
10-18 21:53:05.759 2589 2896 I Unity :
10-18 21:53:05.799 2589 2975 E CRASH : signal 6 (SIGABRT), code -6 (?), fault addr --------
10-18 21:53:05.799 2589 2975 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-18 21:53:05.799 2589 2975 E CRASH : Build type ‘Release’, Scripting Backend ‘il2cpp’, CPU ‘arm64-v8a’
10-18 21:53:05.799 2589 2975 E CRASH : Build fingerprint: ‘OnePlus/OnePlus3/OnePlus3T:9/PKQ1.181203.001/1907311932:user/release-keys’
10-18 21:53:05.799 2589 2975 E CRASH : Revision: ‘0’
10-18 21:53:05.799 2589 2975 E CRASH : pid: 2589, tid: 2975, name: FMOD Studio sam >>> com.aniode.gnarbiketrials2 <<<
10-18 21:53:05.799 2589 2975 E CRASH : x0 0000000000000000 x1 0000000000000b9f x2 0000000000000006 x3 0000000000000008
10-18 21:53:05.799 2589 2975 E CRASH : x4 0000000000008080 x5 0000000000008080 x6 0000000000008080 x7 0000000000000038
10-18 21:53:05.799 2589 2975 E CRASH : x8 0000000000000083 x9 5512dfc16e851a39 x10 fffffff87ffffbdf x11 5512dfc16e851a39
10-18 21:53:05.799 2589 2975 E CRASH : x12 5512dfc16e851a39 x13 fffffff87ffffbdf x14 000000005daa2631 x15 0000000000000008
10-18 21:53:05.799 2589 2975 E CRASH : x16 000000750c29f2b0 x17 000000750c1b1088 x18 5512dfc16e851a39 x19 0000000000000a1d
10-18 21:53:05.800 2589 2975 E CRASH : x20 0000000000000b9f x21 0000000000000083 x22 0000000000000000 x23 000000745cf61de0
10-18 21:53:05.800 2589 2975 E CRASH : x24 000000745cc51570 x25 0000007461d6e908 x26 000000745cc51588 x27 000000746b9e9588
10-18 21:53:05.800 2589 2975 E CRASH : x28 0000000000000000 x29 000000745cc50f10 x30 000000750c1a24d0
10-18 21:53:05.800 2589 2975 E CRASH : sp 000000745cc50ed0 pc 000000750c1a24f0 pstate 0000000060000000
10-18 21:53:05.800 2589 2975 E CRASH :
10-18 21:53:05.800 2589 2975 E CRASH : backtrace:
10-18 21:53:05.828 2589 2975 E CRASH : #00 pc 000000000000068c [vdso] ()
10-18 21:53:05.828 2589 2975 E CRASH : #01 pc 00000000000224ec /system/lib64/libc.so (abort+108)
10-18 21:53:05.828 2589 2975 E CRASH : #02 pc 000000000009b308 /system/lib64/libc.so (_ZL15__fortify_fatalPKcz+128)
10-18 21:53:05.828 2589 2975 E CRASH : #03 pc 000000000009a908 /system/lib64/libc.so (_ZL25HandleUsingDestroyedMutexP15pthread_mutex_tPKc+52)
10-18 21:53:05.828 2589 2975 E CRASH : #04 pc 000000000009a784 /system/lib64/libc.so (pthread_mutex_lock+228)
10-18 21:53:05.828 2589 2975 E CRASH : #05 pc 00000000000a4de0 /system/lib64/libc++.so (_ZNSt3__15mutex4lockEv+8)
10-18 21:53:05.828 2589 2975 E CRASH : #06 pc 000000000000da7c /system/lib64/libandroid.so (AAssetManager_open+64)
10-18 21:53:05.828 2589 2975 E CRASH : #07 pc 00000000000c726c /data/app/com.aniode.gnarbiketrials2-ogYNvTqyPju-08eWN6cxZA==/lib/arm64/libfmod.so ()
10-18 21:53:05.893 2589 2896 E CRASH : other thread is trapped; signum = 6
10-18 21:53:05.894 2589 2896 E MessageQueue: IdleHandler threw exception
10-18 21:53:05.894 2589 2896 E MessageQueue: java.lang.Error: signal 6 (SIGABRT), code -6 (?), fault addr --------
10-18 21:53:05.894 2589 2896 E MessageQueue: Build fingerprint: ‘OnePlus/OnePlus3/OnePlus3T:9/PKQ1.181203.001/1907311932:user/release-keys’
10-18 21:53:05.894 2589 2896 E MessageQueue: Revision: ‘0’
10-18 21:53:05.894 2589 2896 E MessageQueue: pid: 2589, tid: 2975, name: FMOD Studio sam >>> com.aniode.gnarbiketrials2 <<<
10-18 21:53:05.894 2589 2896 E MessageQueue: x0 0000000000000000 x1 0000000000000b9f x2 0000000000000006 x3 0000000000000008
10-18 21:53:05.894 2589 2896 E MessageQueue: x4 0000000000008080 x5 0000000000008080 x6 0000000000008080 x7 0000000000000038
10-18 21:53:05.894 2589 2896 E MessageQueue: x8 0000000000000083 x9 5512dfc16e851a39 x10 fffffff87ffffbdf x11 5512dfc16e851a39
10-18 21:53:05.894 2589 2896 E MessageQueue: x12 5512dfc16e851a39 x13 fffffff87ffffbdf x14 000000005daa2631 x15 0000000000000008
10-18 21:53:05.894 2589 2896 E MessageQueue: x16 000000750c29f2b0 x17 000000750c1b1088 x18 5512dfc16e851a39 x19 0000000000000a1d
10-18 21:53:05.894 2589 2896 E MessageQueue: x20 0000000000000b9f x21 0000000000000083 x22 0000000000000000 x23 000000745cf61de0
10-18 21:53:05.894 2589 2896 E MessageQueue: x24 000000745cc51570 x25 0000007461d6e908 x26 000000745cc51588 x27 000000746b9e9588
10-18 21:53:05.894 2589 2896 E MessageQueue: x28 0000000000000000 x29 000000745cc50f10 x30 000000750c1a24d0
10-18 21:53:05.894 2589 2896 E MessageQueue: sp 000000745cc50ed0 pc 000000750c1a24f0 pstate 0000000060000000
10-18 21:53:05.894 2589 2896 E MessageQueue:
10-18 21:53:05.894 2589 2896 E MessageQueue: at [vdso].(:0)
10-18 21:53:05.894 2589 2896 E MessageQueue: at libc.abort(abort:108)
10-18 21:53:05.894 2589 2896 E MessageQueue: at libc._ZL15__fortify_fatalPKcz(_ZL15__fortify_fatalPKcz:128)
10-18 21:53:05.894 2589 2896 E MessageQueue: at libc._ZL25HandleUsingDestroyedMutexP15pthread_mutex_tPKc(_ZL25HandleUsingDestroyedMutexP15pthread_mutex_tPKc:52)
10-18 21:53:05.894 2589 2896 E MessageQueue: at libc.pthread_mutex_lock(pthread_mutex_lock:228)
10-18 21:53:05.894 2589 2896 E MessageQueue: at libc++._ZNSt3__15mutex4lockEv(_ZNSt3__15mutex4lockEv:8)
10-18 21:53:05.894 2589 2896 E MessageQueue: at libandroid.AAssetManager_open(AAssetManager_open:64)
10-18 21:53:05.894 2589 2896 E MessageQueue: at libfmod.(:0)
10-18 21:53:08.578 18253 18276 D NetworkStateUtils: netWorkState=1
10-18 21:53:09.658 543 759 E qti_sensors_hal: processInd: pickup data: state: 1.000000 flag: 0.000000 SAM TS: 4250514994 HAL TS:129711414044421 elapsedRealtimeNano:129711436045440
10-18 21:53:09.697 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.698 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.698 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.726 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.727 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.743 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.743 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.760 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.760 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.776 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.776 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.793 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.793 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.810 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.810 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.827 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.827 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.844 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.844 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.860 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.861 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.877 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.877 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.894 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.894 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.910 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.910 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.925 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.925 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:09.925 2589 2589 E CRASH : main thread is trapped; signum = 6
10-18 21:53:09.925 2589 2589 E CRASH : other thread is trapped; signum = 6
10-18 21:53:10.086 1391 1683 D AutomaticBrightnessController: setAmbientLux(13.0)
10-18 21:53:11.428 2045 2045 D KeyguardIndication: onRefreshBatteryInfo: plugged:false, wasPluggedIn: false, charged:false, level:91, speed:-1, last speed:-1, visible:false
10-18 21:53:11.429 18253 18253 D WidgetViewService: ------BatteryReceiver------power=91
10-18 21:53:11.475 1391 1497 I ActivityManager: Start proc 3189:com.google.android.apps.turbo/u0a224 for broadcast com.google.android.apps.turbo/.nudges.broadcasts.BatteryStatusChangedReceiver
10-18 21:53:11.483 3189 3189 I roid.apps.turb: Late-enabling -Xcheck:jni
10-18 21:53:11.487 3189 3189 E roid.apps.turb: Not starting debugger since process cannot load the jdwp agent.
10-18 21:53:11.518 1391 3188 I ActivityManager: pid= 585 st.name = surfaceflinger cpuPercent = 20 st.rel_utime =7630 st.rel_stime =7780

On further troubleshooting it seems to be caused by the Unity Ads initialising. Initialising the Ads in a “SplashScreen” scene before loading the main game seems to have fixed the crash again for now. Hopefully it won’t come back to haunt me again…