gecko-dev/mozglue
Jim Chen f61f04949b Bug 1451891 - Fix race conditions in __wrap_dlerror; r=glandium
__wrap_dlerror uses a single pointer for all threads, which means one
thread could get the dlerror result from another thread. Normally this
wouldn't cause crashes. However, because dlerror results come from a
per-thread buffer, if a thread exits and our saved dlerror result came
from that thread, the saved pointer could then refer to invalid memory.

The proper way to fix this is to use TLS and have a per-thread pointer
for __wrap_dlerror. However, instead of using up a TLS slot, this patch
keeps the single pointer for custom messages, and fallback to per-thread
dlerror call for system messages. While the race condition still exists,
I think the risk is acceptable. Even when races occur, they should no
longer cause crashes.

MozReview-Commit-ID: 4hGksidjiVz

--HG--
extra : rebase_source : 373000686c426b81ffd7cee88264e89b7a733957
2018-07-25 13:59:30 -04:00
..
android Bug 1471025: Part 3c - Also pass the shared preference map handle to Android content processes. r=jld 2018-07-13 11:06:58 -07:00
build Bug 1478143 - Adjust default malloc_context_size for ASan builds. r=froydnj 2018-07-24 23:01:21 +02:00
linker Bug 1451891 - Fix race conditions in __wrap_dlerror; r=glandium 2018-07-25 13:59:30 -04:00
misc Bug 1465452 Part 1 - Allow platform mutexes to specify whether they are recorded, r=froydnj. 2018-07-21 14:28:21 +00:00
tests Bug 1467798: Fix problems with inlining and paths in TestDllInterceptorCrossProcess; r=handyman 2018-07-04 14:12:36 -06:00
moz.build Bug 1407468 - Replace multiple !JS_STANDALONE with MOZ_WIDGET_TOOLKIT. r=mshal 2017-10-05 14:50:01 +09:00