# Libfmod.so exports unwinder symbols which leads to crashes on arm32

**URL:** https://qa.fmod.com/t/libfmod-so-exports-unwinder-symbols-which-leads-to-crashes-on-arm32/20294
**Category:** FMOD Engine
**Tags:** android, cpp
**Created:** [June 8, 2023, 3:54am UTC](https://qa.fmod.com/t/libfmod-so-exports-unwinder-symbols-which-leads-to-crashes-on-arm32/20294 "2023-06-08T03:54:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![JIukaviy](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jiukaviy/32/5089_2.png) [@JIukaviy](https://qa.fmod.com/u/JIukaviy)
#### Post date: [June 8, 2023, 3:54am UTC](https://qa.fmod.com/t/libfmod-so-exports-unwinder-symbols-which-leads-to-crashes-on-arm32/20294/1 "2023-06-08T03:54:12Z")

</div>

libfmod.so on the latest version 2.02.15 for Android armeabi-v7 exports unwinder symbols.

```auto
readelf -sW libfmod.so | grep _Unwind
   116: 00000000 0 FUNC GLOBAL DEFAULT UND __gnu_Unwind_Find_exidx
   204: 000da9d5 616 FUNC GLOBAL DEFAULT 13 _Unwind_VRS_Interpret
   560: 000db0ed 104 FUNC GLOBAL DEFAULT 13 _Unwind_Resume
   583: 000db0e9 2 FUNC GLOBAL DEFAULT 13 _Unwind_Complete
   642: 000dace9 176 FUNC GLOBAL DEFAULT 13 _Unwind_VRS_Set
   841: 000db189 52 FUNC GLOBAL DEFAULT 13 _Unwind_GetRegionStart
   990: 000daf31 160 FUNC GLOBAL DEFAULT 13 _Unwind_RaiseException
  1235: 000dac3d 172 FUNC GLOBAL DEFAULT 13 _Unwind_VRS_Get
  1266: 000db155 52 FUNC GLOBAL DEFAULT 13 _Unwind_GetLanguageSpecificData
  1385: 000dad99 336 FUNC GLOBAL DEFAULT 13 _Unwind_VRS_Pop
  1427: 000db1bd 12 FUNC GLOBAL DEFAULT 13 _Unwind_DeleteException

```

Unfortunately that leads to crashes on arm32 devices when throwing exceptions.

> <https://github.com/android/ndk/issues/289#issuecomment-408553976>
>
> \#### Description
> 
> The setup is slightly complicated but I am using command lin…e CMake (Android Studio not involved) to compile a native library that I need to then test. For simplicity sake, and since CMake already outputs a native test runner executable anyway, I simply upload it to an arbitrary directory and run it via \`adb shell\`. However, some of the unit tests will try and catch exceptions. On arm and arm64 this causes the process to abort instead of throwing an exception which is then caught. This sounds like exceptions are disabled, but I have confirmed many times that \`-fexceptions\` is present during compilation. Furthermore the \`\_\_cpp\_exceptions\` compiler directive is present. This only seems to happen when using clang and libc++ (Which we must use for other reasons). libstdc++ does not exhibit the same behavior, and neither does NDK r11c. The output from the test runner is as follows:
> 
> \> FAILED:
> due to a fatal error condition:
> SIGABRT - Abort (abnormal termination) signal
> 
> vs. on x86
> 
> \> All tests passed (5 assertions in 1 test case)
> 
> The build is as follows:
> Several static libs are linked together into one shared lib, which is linked to libsqlite3.so (which is also built to comply with new Android rules) and then an executable is built which links to both of those
> 
> The big shared lib has a C interface which will catch any exceptions before they bubble past it and store the details into an error variable or ignore them and return a generic error state. This is where the exception is thrown (and supposed to be caught) during the crashing test runner.
> 
> The source for the shared library being built is \[here\](https://github.com/couchbase/couchbase-lite-core) and the unit test runner in question is \[here\](https://github.com/couchbase/couchbase-lite-core/tree/master/C/tests). The latest commit as of this writing is \` 3aeb671\`.
> 
> Here are the build artifacts for armv7 zipped -\> \[C4Tests.zip\](https://github.com/android-ndk/ndk/files/736612/C4Tests.zip) and the steps to reproduce are:
> 
> 1. \`adb mkdir -p /data/local/tmp/LiteCore\`
> 2. \`adb push \*.so C4Tests /data/local/tmp/LiteCore\`
> 3. \`adb shell\`
> 4. \`cd /data/local/tmp/LiteCore\`
> 5. \`export TMPDIR=/data/local/tmp\`
> 6. \`export LD\_LIBRARY\_PATH=/data/local/tmp/LiteCore\`
> 7. \`./C4Tests "parse invalid blob keys"\`
> 
> 
> \#### Environment Details
> 
> Not all of these will be relevant to every bug, but please provide as much
> information as you can.
> 
> \* NDK Version: 13.1.3345770
> \* Build system: CMake 3.7.2 command line
> \* Host OS: Noticed in both Ubuntu 16.0.4 and macOS Sierra
> \* Compiler: clang
> \* ABI: armeabi-v7a or arm64-v8a (x86 does not have this problem)
> \* STL: c++\_static
> \* NDK API level: 16 (32-bit) 21(64-bit)
> \* Device API level: 24

[https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Unwinding](https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Unwinding)

I saw a similar issue was fixed in  
**01/11/17 1.10.01 - Studio API minor release (build 91339)**

- Core API - Android - Fixed exported symbols to avoid issues with unwinder.

But unwinder symbols are still there.

For now in my project I reordered libraries so that libfmod.so is going last in linker command, and manually put Clang’s libunwind before it. That fixed the crashes.

But it would be great if unwinder symbols would be excluded from libfmod.so when building.

---

<div class="post-metadata">

### Author: ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)
#### Post date: [June 14, 2023, 2:20am UTC](https://qa.fmod.com/t/libfmod-so-exports-unwinder-symbols-which-leads-to-crashes-on-arm32/20294/2 "2023-06-14T02:20:39Z")

</div>

Thanks for letting us know, and for sharing your workaround!  
I have notified the dev team and they will look into removing the unwinder symbols.
