зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1354611: Acquire the stack walk lock in Win64's LdrLoadDll. r=aklotz
This will prevent the profiler from suspending a target thread while that thread holds the RtlLookupFunctionEntry lock, which the profiler itself also wants to use.
This commit is contained in:
Родитель
c4a6792abb
Коммит
3b7255411e
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "nsWindowsDllInterceptor.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StackWalk_windows.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/WindowsVersion.h"
|
||||
#include "nsWindowsHelpers.h"
|
||||
|
@ -703,7 +704,13 @@ continue_loading:
|
|||
printf_stderr("LdrLoadDll: continuing load... ('%S')\n", moduleFileName->Buffer);
|
||||
#endif
|
||||
|
||||
return stub_LdrLoadDll(filePath, flags, moduleFileName, handle);
|
||||
// Prevent the stack walker from suspending this thread when LdrLoadDll
|
||||
// holds the RtlLookupFunctionEntry lock.
|
||||
AcquireStackWalkWorkaroundLock();
|
||||
NTSTATUS ret = stub_LdrLoadDll(filePath, flags, moduleFileName, handle);
|
||||
ReleaseStackWalkWorkaroundLock();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
WindowsDllInterceptor NtDllIntercept;
|
||||
|
|
Загрузка…
Ссылка в новой задаче