sorry, we can’t repreduce the crash. do you know the function of "0009d7c7 /data/app/com.xxxxx.xxxx-OKRBsnJLXmPeKd63U6TkIg==/lib/arm/libfmod.so "? may be it can help.
I’ve been looking into your crash call stack, I can see it’s coming from our File I/O routines that deal with opening Android assets packaged into the APK. I can see a potential issue internally however I am unable to reproduce the problem here.
Can you verify that you call org.fmod.FMOD.init(this) in your activity onCreate for the activity and org.fmod.FMOD.close() in the onDestroy? As per the documentation here.
When you call into our init function we cache the Activity context and use it to access the asset manager from our native code. Our examples follow the pattern of initializing the FMOD Java then creating the native FMOD System, mirrored with shutting down the native FMOD System and closing the FMOD Java. Can you check that your application follows that pattern?
we use Unity Integration to access FMOD.
we find the code we init FMOD, can’t find close in Unity Integation.
The code is here.
static RuntimeManager Instance
{
get
{
if (initException != null)
{
throw initException;
}
if (instance == null)
{
FMOD.RESULT initResult = FMOD.RESULT.OK; // Initialize can return an error code if it falls back to NO_SOUND, throw it as a non-cached exception
var existing = FindObjectsOfType(typeof(RuntimeManager)) as RuntimeManager[];
foreach (var iter in existing)
{
if (existing != null)
{
// Older versions of the integration may have leaked the runtime manager game object into the scene,
// which was then serialized. It won't have valid pointers so don't use it.
if (iter.cachedPointers[0] != 0)
{
instance = iter;
instance.studioSystem.handle = ((IntPtr)instance.cachedPointers[0]);
instance.coreSystem.handle = ((IntPtr)instance.cachedPointers[1]);
}
DestroyImmediate(iter);
}
}
var gameObject = new GameObject("FMOD.UnityIntegration.RuntimeManager");
instance = gameObject.AddComponent<RuntimeManager>();
if (Application.isPlaying) // This class is used in edit mode by the Timeline auditioning system
{
DontDestroyOnLoad(gameObject);
}
gameObject.hideFlags = HideFlags.HideAndDontSave;
try
{
#if UNITY_ANDROID && !UNITY_EDITOR
// First, obtain the current activity context
AndroidJavaObject activity = null;
using (var activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
activity = activityClass.GetStatic<AndroidJavaObject>("currentActivity");
}
using (var fmodJava = new AndroidJavaClass("org.fmod.FMOD"))
{
if (fmodJava != null)
{
fmodJava.CallStatic("init", activity);
}
else
{
UnityEngine.Debug.LogWarning("[FMOD] Cannot initialize Java wrapper");
}
}
#endif
RuntimeUtils.EnforceLibraryOrder();
initResult = instance.Initialize();
}
catch (Exception e)
{
initException = e as SystemNotInitializedException;
if (initException == null)
{
initException = new SystemNotInitializedException(e);
}
throw initException;
}
if (initResult != FMOD.RESULT.OK)
{
throw new SystemNotInitializedException(initResult, "Output forced to NO SOUND mode");
}
}
return instance;
}
}
void OnDestroy()
{
if (studioSystem.isValid())
{
studioSystem.release();
studioSystem.clearHandle();
}
initException = null;
instance = null;
}
We have similar crashes occurring in our Unity game using FMOD 2.00.08 – the offset into libfmod.so with version .08 is different but maybe this can correlate with the previous report using .07
We have not reproduced locally but it occurs with some frequency in the real world, with similar reports collected via Google Play, Unity Cloud, and Bugsnag.
It is sometimes corresponding with ad-viewing, although I am not able to say that with certainty. Many breadcrumb report state that an ad was viewed near the time of the crash. We use Unity Ads and IronSource if that matters. Unfortunately I don’t have any more information at this time.
Can you provide an ETA for 2.00.09? We could probably have that integrated and out in the world to many users very quickly.
Really hoping this is fixed in 2.00.09. We have found a case that repros 100% locally and have managed to capture a log with Logging library. There was no relevant output in logcat but this is possibly a more description stack trace. Captured with FMOD 2.00.08 Unity integration:
05-07 14:31:40.374 7596 7812 E CRASH : signal 6 (SIGABRT), code -6 (?), fault addr --------
05-07 14:31:40.374 7596 7812 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-07 14:31:40.374 7596 7812 E CRASH : Build type 'Development', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
05-07 14:31:40.374 7596 7812 E CRASH : Build fingerprint: 'samsung/jackpotltevl/jackpotltecan:9/PPR1.180610.011/A530WVLUACTB2:user/release-keys'
05-07 14:31:40.374 7596 7812 E CRASH : Revision: '7'
05-07 14:31:40.374 7596 7812 E CRASH : pid: 7596, tid: 7812, name: FMOD Studio sam >>> com.hotheadgames.android.free.hydrostone <<<
05-07 14:31:40.374 7596 7812 E CRASH : x0 0000000000000000 x1 0000000000001e84 x2 0000000000000006 x3 0000000000000008
05-07 14:31:40.374 7596 7812 E CRASH : x4 0000000000008080 x5 0000000000008080 x6 0000000000008080 x7 0000000000000038
05-07 14:31:40.374 7596 7812 E CRASH : x8 0000000000000083 x9 fef1652add54f8d9 x10 0000000000000000 x11 fffffffc7ffffbdf
05-07 14:31:40.374 7596 7812 E CRASH : x12 0000000000000001 x13 000000005eb47e3a x14 00353a14b95fd880 x15 00005726189c7e20
05-07 14:31:40.374 7596 7812 E CRASH : x16 0000006fbbdb32a0 x17 0000006fbbcf26c8 x18 0000000000000001 x19 0000000000001dac
05-07 14:31:40.374 7596 7812 E CRASH : x20 0000000000001e84 x21 0000006f20febe9e x22 0000006f09fec870 x23 0000000000000000
05-07 14:31:40.374 7596 7812 E CRASH : x24 0000000000000000 x25 0000006f06b56fc4 x26 0000006f13243588 x27 0000006f0d934c28
05-07 14:31:40.374 7596 7812 E CRASH : x28 0000000000000002 x29 0000006f13242e30 x30 0000006fbbce5ecc
05-07 14:31:40.374 7596 7812 E CRASH : sp 0000006f13242df0 pc 0000006fbbce5ef4 pstate 0000000060000000
05-07 14:31:40.374 7596 7812 E CRASH :
05-07 14:31:40.374 7596 7812 E CRASH : backtrace:
05-07 14:31:40.389 3603 3755 D InputReader: Input event(1): value=0 when=137046.465429
05-07 14:31:40.390 3603 3755 D InputReader: Input event(1): value=0 when=137046.465429
05-07 14:31:40.390 3603 3755 I InputReader: Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=137046.465429
05-07 14:31:40.421 7596 7812 E CRASH : #00 pc 000000000000068c [vdso] ()
05-07 14:31:40.421 7596 7812 E CRASH : #01 pc 0000000000021ef0 /system/lib64/libc.so (abort+112)
05-07 14:31:40.421 7596 7812 E CRASH : #02 pc 0000000000084cd4 /system/lib64/libc.so (_ZL15__fortify_fatalPKcz+120)
05-07 14:31:40.421 7596 7812 E CRASH : #03 pc 0000000000084390 /system/lib64/libc.so (_ZL25HandleUsingDestroyedMutexP15pthread_mutex_tPKc+52)
05-07 14:31:40.421 7596 7812 E CRASH : #04 pc 0000000000084240 /system/lib64/libc.so (pthread_mutex_lock+256)
05-07 14:31:40.421 7596 7812 E CRASH : #05 pc 0000000000099cb8 /system/lib64/libc++.so (_ZNSt3__15mutex4lockEv+8)
05-07 14:31:40.421 7596 7812 E CRASH : #06 pc 000000000000dca4 /system/lib64/libandroid.so (AAssetManager_open+64)
05-07 14:31:40.421 7596 7812 E CRASH : #07 pc 00000000000df1e0 /data/app/com.hotheadgames.android.free.hydrostone-E8WyZ8ZuF6eF0muGP5rNbg==/lib/arm64/libfmodL.so ()
05-07 14:31:40.421 7596 7812 E CRASH : #08 pc 00000000001777a8 /data/app/com.hotheadgames.android.free.hydrostone-E8WyZ8ZuF6eF0muGP5rNbg==/lib/arm64/libfmodstudioL.so ()
05-07 14:31:40.421 7596 7812 E CRASH : #09 pc 0000000000020294 /data/app/com.hotheadgames.android.free.hydrostone-E8WyZ8ZuF6eF0muGP5rNbg==/lib/arm64/libfmodstudioL.so ()
05-07 14:31:40.421 7596 7812 E CRASH : #10 pc 0000000000170448 /data/app/com.hotheadgames.android.free.hydrostone-E8WyZ8ZuF6eF0muGP5rNbg==/lib/arm64/libfmodstudioL.so ()
05-07 14:31:40.421 7596 7812 E CRASH : #11 pc 000000000016f7b0 /data/app/com.hotheadgames.android.free.hydrostone-E8WyZ8ZuF6eF0muGP5rNbg==/lib/arm64/libfmodstudioL.so ()
05-07 14:31:40.421 7596 7812 E CRASH : #12 pc 0000000000170330 /data/app/com.hotheadgames.android.free.hydrostone-E8WyZ8ZuF6eF0muGP5rNbg==/lib/arm64/libfmodstudioL.so ()
05-07 14:31:40.421 7596 7812 E CRASH : #13 pc 000000000016ed6c /data/app/com.hotheadgames.android.free.hydrostone-E8WyZ8ZuF6eF0muGP5rNbg==/lib/arm64/libfmodstudioL.so ()
05-07 14:31:40.421 7596 7812 E CRASH : #14 pc 0000000000179c34 /data/app/com.hotheadgames.android.free.hydrostone-E8WyZ8ZuF6eF0muGP5rNbg==/lib/arm64/libfmodstudioL.so ()
05-07 14:31:40.421 7596 7812 E CRASH : #15 pc 000000000017a8c0 /data/app/com.hotheadgames.android.free.hydrostone-E8WyZ8ZuF6eF0muGP5rNbg==/lib/arm64/libfmodstudioL.so ()
05-07 14:31:40.421 7596 7812 E CRASH : #16 pc 0000000000083650 /system/lib64/libc.so (_ZL15__pthread_startPv+196)
05-07 14:31:40.421 7596 7812 E CRASH : #17 pc 0000000000023b34 /system/lib64/libc.so (__start_thread+68)
I do see this near the crash:
05-07 14:31:38.931 7596 8195 F libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x6f3308ef40)
We have this same crash issue with Fmod 1.10.02 on Android 9 and 10 so really looking for if the 2.00.09 fixes the problem. Please if possible, keep posting your findings to this thread to keep us all with the same problem informed for possible fixes. Thank you all.