Author Topic: pthread_mutex_unlock issue on BASS_ChannelPlay (Android)  (Read 133 times)

jnyang

  • Guest
Hi,
I am currently using BASS (latest version) for Android apps.
Recently, I received a lot of crash logs from Android users with the following stack traces:

Code: [Select]
backtrace:
  #00  pc 00000000000695f0  /system/lib64/libc.so (pthread_mutex_unlock+20)
  #00  pc 0000000000034d90  /data/app/(app identifier)/lib/arm64/libbass.so
  #00  pc 000000000003506c  /data/app/(app identifier)/lib/arm64/libbass.so
  #00  pc 0000000000033c0c  /data/app/(app identifier)/lib/arm64/libbass.so
  #00  pc 0000000000033c90  /data/app/(app identifier)/lib/arm64/libbass.so
  #00  pc 0000000000038b50  /data/app/(app identifier)/lib/arm64/libbass.so (BASS_ChannelPlay+328)
  #00  pc 0000000000038c0c  /data/app/(app identifier)/lib/arm64/libbass.so (Java_com_un4seen_bass_BASS_BASS_1ChannelPlay+16)
  #00  pc 000000000093cf7c  /data/app/(app identifier)/oat/arm64/base.odex (offset 0x926000)

Unfortunately, I could not reproduce this issue on my side.
To find out the cause of the problem, is it possible to explain what the "BASS_ChannelPlay+328" part does?

Here are some findings that I narrowed down.
- The issue happens only on Android 7.0, 8.0, 8.1, and 9.0. It seems that the other Android versions (e.g., Android 10.0, 6.0) do not have this issue.
- A notable change that I made recently was calling BASS_StreamCreateFile with a ParcelFileDescriptor obtained from ContentResolver.openFileDescriptor, instead of calling BASS_StreamCreateFile with a raw file path.

Thanks in advance for your help.

Ian @ un4seen

  • Administrator
  • Posts: 23377
Are you currently using the latest release version (2.4.15) or the latest "stuff" build? If the former, please try the latter, which you can get from here:

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

If it still crashes, please post the new backtrace. Also include register values if you have them.

jnyang

  • Guest
Thanks, Ian. I was using the latest stable version, not the stuff (beta) version.
Fortunately, as you suggested, after I changed the library files (libbass.so) to the latest "stuff" builds (Jan 19), this issue didn't happen anymore.

Have there been any code changes within the BASS library regarding the issue?

Thanks,

Ian @ un4seen

  • Administrator
  • Posts: 23377
Good to hear that the problem seems to be fixed in the latest build. Regarding what changed to affect the problem, the posted backtrace doesn't seem to match the arm64-v8a library in the BASS 2.4.15 release, so I'm unable to confirm what/where the problem was. Were you using an older release?

jnyang

  • Guest
Hmm, that's interesting. I was using the latest stable build (2.4.15 release). I am deploying my app on arm-v7a, arm64-v8a, and x86-64, and the reported crash cases may use the arm64-v8a binary.
The backtrace that I posted was obtained from the Google Play Console. Maybe the reported stack traces are incorrect due to some internal issues (e.g., corrupted heap)..

Anyway, thanks for checking the problem :)