Commit 0d7f6cd
committed
jsc: do not unload the library, as a thread in its address space may run
A client app can call proxyres_global_cleanup(), continue to run and
crash in an unspecified thread, spawned by JSCoreGTK, running in the
address space of the unloaded library.
The forced call to the garbage collector does not fix crashes.
Before dlclose():
* thread #18, name = 'gtest_host'
* frame #0: 0x00007ffff2e98d71 libc.so.6`__GI___futex_abstimed_wait_cancelable64 [inlined] __futex_abstimed_wait_common64(private=<unavailable>, cancel=true, abstime=0x00007fff991e8730, op=393, expected=0, futex_word=0x00007fff6c00e810) at futex-internal.c:57:12
frame #1: 0x00007ffff2e98d47 libc.so.6`__GI___futex_abstimed_wait_cancelable64 [inlined] __futex_abstimed_wait_common(cancel=true, private=<unavailable>, abstime=0x00007fff991e8730, clockid=<unavailable>, expected=0, futex_word=0x00007fff6c00e810) at futex-internal.c:87:9
frame #2: 0x00007ffff2e98d20 libc.so.6`__GI___futex_abstimed_wait_cancelable64(futex_word=0x00007fff6c00e810, expected=0, clockid=<unavailable>, abstime=0x00007fff991e8730, private=<unavailable>) at futex-internal.c:139:10
frame #3: 0x00007ffff2e9bc8e libc.so.6`___pthread_cond_timedwait64 [inlined] __pthread_cond_wait_common(abstime=0x00007fff991e8730, clockid=0, mutex=0x00007fff6c00e7c0, cond=0x00007fff6c00e7e8) at pthread_cond_wait.c:503:10
frame #4: 0x00007ffff2e9bb98 libc.so.6`___pthread_cond_timedwait64(cond=0x00007fff6c00e7e8, mutex=0x00007fff6c00e7c0, abstime=0x00007fff991e8730) at pthread_cond_wait.c:652:10
frame #5: 0x00007fffa2a428a2 libjavascriptcoregtk-6.0.so.1`___lldb_unnamed_symbol43079 + 546
frame #6: 0x00007ffff2e9caa4 libc.so.6`start_thread(arg=<unavailable>) at pthread_create.c:447:8
frame #7: 0x00007ffff2f29c3c libc.so.6`__clone3 at clone3.S:78
After dlclose():
* thread #18, name = 'gtest_host'
* frame #0: 0x00007ffff2e98d71 libc.so.6`__GI___futex_abstimed_wait_cancelable64 [inlined] __futex_abstimed_wait_common64(private=<unavailable>, cancel=true, abstime=0x00007fff991e8730, op=393, expected=0, futex_word=0x00007fff6800e810) at futex-internal.c:57:12
frame #1: 0x00007ffff2e98d47 libc.so.6`__GI___futex_abstimed_wait_cancelable64 [inlined] __futex_abstimed_wait_common(cancel=true, private=<unavailable>, abstime=0x00007fff991e8730, clockid=<unavailable>, expected=0, futex_word=0x00007fff6800e810) at futex-internal.c:87:9
frame #2: 0x00007ffff2e98d20 libc.so.6`__GI___futex_abstimed_wait_cancelable64(futex_word=0x00007fff6800e810, expected=0, clockid=<unavailable>, abstime=0x00007fff991e8730, private=<unavailable>) at futex-internal.c:139:10
frame #3: 0x00007ffff2e9bc8e libc.so.6`___pthread_cond_timedwait64 [inlined] __pthread_cond_wait_common(abstime=0x00007fff991e8730, clockid=0, mutex=0x00007fff6800e7c0, cond=0x00007fff6800e7e8) at pthread_cond_wait.c:503:10
frame #4: 0x00007ffff2e9bb98 libc.so.6`___pthread_cond_timedwait64(cond=0x00007fff6800e7e8, mutex=0x00007fff6800e7c0, abstime=0x00007fff991e8730) at pthread_cond_wait.c:652:10
After a crash:
* thread #18, name = 'gtest_host', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x7fffa2a428a2)
* frame #0: 0x00007fffa2a428a2
frame #1: 0x00007fff991e8700
frame #2: 0x00007ffff2e9caa4 libc.so.6`start_thread(arg=<unavailable>) at pthread_create.c:447:8
frame #3: 0x00007ffff2f29c3c libc.so.6`__clone3 at clone3.S:781 parent cae97c1 commit 0d7f6cd
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
342 | 343 | | |
343 | 344 | | |
| 345 | + | |
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
| |||
0 commit comments