# Fmod crashes on Android suspend/interrrupt

**URL:** https://qa.fmod.com/t/fmod-crashes-on-android-suspend-interrrupt/15198
**Category:** FMOD Engine
**Created:** [November 8, 2019, 2:05pm UTC](https://qa.fmod.com/t/fmod-crashes-on-android-suspend-interrrupt/15198 "2019-11-08T14:05:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ipetcu](https://avatars.discourse-cdn.com/v4/letter/i/9f8e36/32.png) [@ipetcu](https://qa.fmod.com/u/ipetcu)
#### Post date: [November 8, 2019, 2:05pm UTC](https://qa.fmod.com/t/fmod-crashes-on-android-suspend-interrrupt/15198/1 "2019-11-08T14:05:23Z")

</div>

Hi,

I’m using FMOD for an android application. Everything was OK until I’ve recently updated the Fmod to the latest version and 64 bit support

The application crashes when an interrupt is detected (incoming call or application is sent to background).  
I’ve tried to use those functions FMOD\_System\_MixerSuspend()/FMOD\_System\_MixerResume() (from FMOD library ) on OnPause()/OnResume() methods,  
but the application crashes because is trying to call some pure virtual functions: (crash in \_\_cxa\_pure\_virtual())

I’ve tried to completely destroy and recreate FMOD on every interrupt using OnResume()/OnPause() functions but the application crashes :

2019-10-31 05:13:34.368 3438-6460/? D/GameManagerService: identifyGamePackage. com.sec.android.app.launcher  
2019-10-31 05:13:34.368 3438-6460/? D/GamePkgDataHelper: getGamePkgData(). com.sec.android.app.launcher  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: Abort message: ‘Pure virtual function called!’  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: x0 0000000000000000 x1 0000000000001ec5 x2 0000000000000006 x3 0000000000000008  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: x4 fefeff7ed0df753f x5 fefeff7ed0df753f x6 fefeff7ed0df753f x7 7f7f7f7fffff7f7f  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: x8 0000000000000083 x9 179a14dad5798b82 x10 0000000000000000 x11 0000000000000001  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: x12 ffffffffffffffff x13 0000000000000001 x14 0000000000000000 x15 00122a4e7a12f224  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: x16 0000007cea09d2f8 x17 0000007cea03e408 x18 0000000000000000 x19 0000000000001ec5  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: x20 0000000000001ec5 x21 00000000ffffffc8 x22 0000007fd1e07bf0 x23 0000007cea09f988  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: x24 0000007fd1e07ac0 x25 0000007fd1e07b00 x26 0000007fd1e07b28 x27 0000000000000000  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: x28 0000000000000000 x29 0000007fd1e07a30 x30 0000007ce9ff0bd4  
2019-10-31 05:13:34.370 7967-7967/? A/DEBUG: sp 0000007fd1e079f0 pc 0000007cea03e410 pstate 0000000060000000  
2019-10-31 05:13:34.370 3438-10109/? D/Notification: allPendingIntents  
2019-10-31 05:13:34.371 3438-10109/? I/chatty: uid=1000(system) Binder:3438\_1E identical 2 lines  
2019-10-31 05:13:34.371 3438-10109/? D/Notification: allPendingIntents  
2019-10-31 05:13:34.371 23310-23310/? I/WorkerManager: New handler created for worker [service] (manager: c38d7ac, handler: f26c75)  
2019-10-31 05:13:34.372 3438-10109/? D/Notification: allPendingIntents  
2019-10-31 05:13:34.373 3438-10109/? I/chatty: uid=1000(system) Binder:3438\_1E identical 2 lines  
2019-10-31 05:13:34.373 3438-10109/? D/Notification: allPendingIntents  
2019-10-31 05:13:34.373 3018-3299/? V/APM\_AudioPolicyManager: getAudioPolicyConfig: audioParam;outDevice  
2019-10-31 05:13:34.373 23310-23310/? I/WorkerHandler: New state for worker [service]: e (handler: f26c75)  
2019-10-31 05:13:34.373 3018-3299/? V/APM\_AudioPolicyManager: getNewOutputDevice() selected device 0  
2019-10-31 05:13:34.373 3018-3299/? V/APM\_AudioPolicyManager: ### curdevice : 2  
2019-10-31 05:13:34.374 7967-7967/? A/DEBUG: backtrace:  
2019-10-31 05:13:34.374 7967-7967/? A/DEBUG: #00 pc 000000000006b410 /system/lib64/libc.so (tgkill+8)  
2019-10-31 05:13:34.374 7967-7967/? A/DEBUG: #01 pc 000000000001dbd0 /system/lib64/libc.so (abort+88)  
2019-10-31 05:13:34.374 7967-7967/? A/DEBUG: #02 pc 0000000000043510 /system/lib64/libc++.so (abort\_message+244)  
2019-10-31 05:13:34.374 7967-7967/? A/DEBUG: #03 pc 0000000000067d48 /system/lib64/libc++.so (\_\_cxa\_pure\_virtual+16)  
2019-10-31 05:13:34.374 7967-7967/? A/DEBUG: #04 pc 00000000000c7c98 /data/app/com.myapp-yvDHz59oyC9FTJThz9eU9A==/lib/arm64/libfmod.so

Those crashes are on 32 and 64 bit version of the application.

Thanks.

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [November 12, 2019, 4:14am UTC](https://qa.fmod.com/t/fmod-crashes-on-android-suspend-interrrupt/15198/2 "2019-11-12T04:14:54Z")

</div>

Using the logging libraries (eg. libfmodL.so) will provide more information from FMOD.

What version were you previously using and what version did you update to?

---

<div class="post-metadata">

### Author: ![ipetcu](https://avatars.discourse-cdn.com/v4/letter/i/9f8e36/32.png) [@ipetcu](https://qa.fmod.com/u/ipetcu)
#### Post date: [November 18, 2019, 4:23pm UTC](https://qa.fmod.com/t/fmod-crashes-on-android-suspend-interrrupt/15198/3 "2019-11-18T16:23:15Z")

</div>

I’m using 2.00.05 library. I’ve tried old libraries and the issue is the same.

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [November 20, 2019, 12:33am UTC](https://qa.fmod.com/t/fmod-crashes-on-android-suspend-interrrupt/15198/4 "2019-11-20T00:33:56Z")

</div>

Did the logging libraries provide any new information on the cause?

---

<div class="post-metadata">

### Author: ![ipetcu](https://avatars.discourse-cdn.com/v4/letter/i/9f8e36/32.png) [@ipetcu](https://qa.fmod.com/u/ipetcu)
#### Post date: [November 25, 2019, 3:44pm UTC](https://qa.fmod.com/t/fmod-crashes-on-android-suspend-interrrupt/15198/5 "2019-11-25T15:44:08Z")

</div>

The issue was resolved after changing the initialization way

FROM  
FmodSfx::FmodSfx(FMOD\_SYSTEM\* pSystem, FileStream\* pFileStream, FMOD\_SOUND\_FORMAT format, bool bIsStream)  
{  
m\_pSound = NULL;

```
FMOD_RESULT result;

```

#ifdef TARGET\_ANDROID  
char pPath[1000] = {0};  
sprintf(pPath, “file:///android\_asset/%s”, “sound1”);

```
	result = FMOD_System_CreateSound(pSystem, pPath, FMOD_LOOP_NORMAL | FMOD_CREATESTREAM, 0, &m_pSound);

```

#else  
result = FMOD\_System\_CreateSound(pSystem, pFileStream-\>GetFilePath(), FMOD\_CREATESTREAM | FMOD\_LOOP\_NORMAL, 0, &m\_pSound);  
#endif  
}

TO  
FmodSfx::FmodSfx(FMOD::System\* pSystem, FileStream\* pFileStream, FMOD\_SOUND\_FORMAT format, bool bIsStream)  
{  
m\_pSound = NULL;

```
FMOD_RESULT result;

```

#ifdef TARGET\_ANDROID  
char pPath[1000] = {0};  
sprintf(pPath, “file:///android\_asset/%s”, “sound1”);

```
	result = pSystem->createSound(pPath, FMOD_DEFAULT | FMOD_LOOP_NORMAL, 0, &m_pSound);

```

#else  
result = pSystem-\>createSound(pFileStream-\>GetFilePath(), FMOD\_DEFAULT | FMOD\_LOOP\_NORMAL, 0, &m\_pSound);  
#endif  
}
