Stack-walking may cause deadlocks during calls to patched LdrLoadDll's
Categories
(Core :: Gecko Profiler, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox106 | --- | fixed |
People
(Reporter: mozbugz, Assigned: mozbugz)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
|
Bug 1788859 - Suppress stack-walking while calling LdrLoadDll in WindowsDllBlocklist.cpp - r?florian
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
Backed out changeset 2676d5d34684 (Bug 1788859) because it is no longer required. r=handyman,florian
48 bytes,
text/x-phabricator-request
|
Details | Review |
Spawned from bug 1687510 comment 7:
I think I just got the deadlock (win10/x64 local build). I attached a debugger, the main thread was stuck in the interceptor while patched_LdrLoadDll was calling stub_LdrLoadDll().
We could add AutoSuppressStackWalking in these patched_... functions. It may not fix the suppression-check race, but it would help remove places where it could happen.
I'm leaving bug 1687510 open, as it shows some potential race (see bug 1687510 comment 5) that should probably be handled there.
| Assignee | ||
Comment 1•3 years ago
|
||
Stack-walking during some Windows API calls result in deadlocks, see details in StackWalk.cpp.
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
Comment 3•3 years ago
|
||
| bugherder | ||
Comment 4•2 years ago
|
||
This changeset from bug 1788859 was an attempt at mitigating bug
1687510. With the proper fix coming in bug 1836225, this changeset is no
longer required. The stack walk suppressions that this changeset
adds are already on a stack walk suppressed path, as guarded by the
scope of the surrounding glue::ModuleLoadFrame. Indeed:
-
the constructor for glue::ModuleLoadFrame calls
sLoaderAPI->ConstructAndNotifyBeginDllLoad; -
LoaderPrivateAPIImp::ConstructAndNotifyBeginDllLoad and
FallbackLoaderAPI::ConstructAndNotifyBeginDllLoad both end up calling
gLoaderObserver->OnBeginDllLoad or mLoaderObserver->OnBeginDllLoad; -
in both cases, the LoaderObserver is gMozglueLoaderObserver, as is
guaranteed by the call to glue::ModuleLoadFrame::StaticInit in
DllBlocklist_Initialize (which is the function that sets up this
fallback patched_LdrLoadDll hook in case the launcher process failed
to set up the freestanding patched_LdrLoadDll hook).
Depends on D181437
Comment 5•2 years ago
|
||
A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)
Comment 7•2 years ago
•
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/f6a41bd11965
Normally we reopen backed out bugs but given this was fixed in 106 branch maybe you got other plans and will leave this for you to decide.
Comment 8•2 years ago
|
||
Maybe I should not have used a backout to remove that code, but the situation is under control, the patches in bug 1836225 fix the issue that was observed here. Resolving as duplicate which is maybe the best way to express that.
Description
•