Crashes on Android with latest BASS

Started by elan,

elan

We just made a release with BASS v2.4.17.0 for Android, and I'm seeing a few of these crashes:

One stack of the crash is:

libc.so +0x4b6b8                                  __strncmp_aarch64
libbass.so +0x2dbc0                               0x773e13ebc4
2  split_config.arm64_v8a.apk!libbass.so +0x203d0    BASS_StreamCreateFileUser

Similar one is:

libc.so!libc.so +0x5adb8                          __strncmp_aarch64
libbass.so +0x2a59c                               0x75c0acd5a0
2  split_config.arm64_v8a.apk!libbass.so +0x29098    BASS_StreamCreateFile

Any ideas?

Ian @ un4seen

Do you happen to know what Android version those crashes were on? It looks like a bug that came up recently when trying to decode some unsupported files with Android media codecs (BASS_CONFIG_AM_DISABLE=0) on Android 15. That's fixed in this latest build:

    www.un4seen.com/stuff/bass-android.zip

elan

It seems to occur on Android 13, 13, and 15.

(We're not using BASS_CONFIG_AM_DISABLE here.)

Ian @ un4seen

Ah yes, I see Android 13/14 were also affected. Btw, the files that were found to trigger the problem were FLAC data in an MP4 container, so I guess that's what your users were trying to play when the crashing happened? Let me know if you need such a file for your own testing.

elan

It's funny you should mentioned that, I just had a user report an issue playing one of those rather strange files. It played file (on Linux), just took a little while to start after seeking around a ton.

I'm not sure what the media type was during the reported crashes, we haven't worked with a "live" user yet. To clarify, though, the issue you're talking about did occur on 13/14 too? We don't do anything with BASS_CONFIG_AM_DISABLE which I guess actually means it's 0 and could be implicated. What do you recommend for that setting generally?

Ian @ un4seen

The BASS_CONFIG_AM_DISABLE option is the Android equivalent to BASS_CONFIG_MF_DISABLE on Windows. Both enable/disable falling back to the OS's decoders whenever BASS and plugins (loaded via BASS_PluginLoad) are unable to decode a file. I would generally recommend leaving them enabled (the default) unless you know you never need to handle any formats that BASS and plugins don't support.

The issue in this case is that an Android codec function call is failing on certain files (FLAC in MP4 container) and BASS wasn't expecting/detecting that until the latest build. Regarding affected Android versions, to correct myself again, the test file that I have doesn't actually seem to be problematic on 13, only on 14 and 15. Are you sure the Android 13 crashes you've seen are the same issue with the same "strncmp" call stack as in the first post?