I'm using a shared library that creates worker threads during initialization. The app is linked with uClibc. When it returns from main() it crashes in __pthread_cond_wait()
or similar from a worker thread that the shared lib doesn't properly stop from its cleanup() code. The main() thread stack when it crashes is:
#0 _dl_munmap from uClibc.so
#1 _dl_fini
#2 __GI_exit
#3 __uClibc_main
Since I don't have source for the shared library I can't fix the worker cleanup code, but my question is:
Why are threads still running (crashing) once uClibc starts unloading shared libs ? I assume it's unloading them from the _dl_munmap
stack entry above. Is there a way to make sure all threads are paused/stopped when main() exits ?