mousebird-consulting-inc / WhirlyGlobe

WhirlyGlobe Development
Other
830 stars 255 forks source link

FORTIFY: pthread_mutex_lock called on a destroyed mutex (Android) #1596

Open ivan-avalos opened 1 year ago

ivan-avalos commented 1 year ago

Hey! I'm getting crashes, apparently after initializing and de-initializing multiple times a fragment in the app that contains a map. I'm not getting very useful information from Android Studio, only the following logs before the app crashes:

libc  FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xb400d26bd84434c8)
libc  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 23219 (External Maply ), pid 22965 (rmap.****)

...

DEBUG  Cmdline: com.****.****
DEBUG  pid: 22965, tid: 23219, name: External Maply  >>> com.****.**** <<<

I tried to make sure I was de-initializing the map correctly, and I wasn't, so I added this:

override fun onDestroyView() {
    super.onDestroyView()
    loader?.shutdown()
    loader = null
}

But no luck. Still getting random crashes. How do I get more debug information?

sjg-wdw commented 1 year ago

That's the kind of error you get without a proper shutdown. There should be a teardown or shutdown on the map controller. Make sure that's getting called in the course of tearing down the fragment.

ivan-avalos commented 1 year ago

That's the kind of error you get without a proper shutdown. There should be a teardown or shutdown on the map controller. Make sure that's getting called in the course of tearing down the fragment.

override fun onDestroyView() {
    super.onDestroyView()
    loader?.shutdown()
    loader = null
}