Fix priority inversion with DLL unloading

This CL is fixing the issue with priority inversion related to the
LoaderLock. It has been fixed for the DLL loading but there is an issue
with DLL unloading in this case.


  crash/31e948b4e8495d0d

Thread 8 ThreadPoolBackgroundWorker (id: 0x0000370c) <<<has loader lock>>>
0x00007ffd8d98e4be(ntdll.dll + 0x000ae4be)RtlpFreeHeapInternal
0x00007ffd8d9076e0(ntdll.dll + 0x000276e0)RtlFreeHeap
0x00007ffd8c1fc6ab(msvcrt.dll + 0x0001c6ab)free
0x00007ffd74331227(netapi32.dll + 0x00001227)CRT_INIT
0x00007ffd743315af(netapi32.dll + 0x000015af)static  __DllMainCRTStartup()
0x00007ffd8d91ff56(ntdll.dll + 0x0003ff56)LdrpCallInitRoutine
0x00007ffd8d932c7e(ntdll.dll + 0x00052c7e)static  LdrpProcessDetachNode()
0x00007ffd8d93266e(ntdll.dll + 0x0005266e)LdrpUnloadNode
0x00007ffd8d93260e(ntdll.dll + 0x0005260e)LdrpDecrementModuleLoadCountEx
0x00007ffd8d91833b(ntdll.dll + 0x0003833b)LdrUnloadDll
0x00007ffd8ae099dd(KERNELBASE.dll + 0x000899dd)
0x00007ffcf35e4735(chrome.dll -callback.h:152)base::OnceCallback<void ()>::Run
0x00007ffcf35e4735(chrome.dll -callback_helpers.cc:32)base::ScopedClosureRunner::RunAndReset
0x00007ffcf35e4735(chrome.dll -callback_helpers.cc:27)base::ScopedClosureRunner::~ScopedClosureRunner
0x00007ffcf35e4735(chrome.dll -policy_loader_win.cc:179)policy::`anonymous namespace'::IsDomainJoined
0x00007ffcf35e4735(chrome.dll -policy_loader_win.cc:191)policy::`anonymous namespace'::CollectEnterpriseUMAs
0x00007ffcf35e4735(chrome.dll -policy_loader_win.cc:284)policy::PolicyLoaderWin::InitOnBackgroundThread()
0x00007ffcf2f5501c(chrome.dll -async_policy_loader.cc:161)policy::AsyncPolicyLoader::Init(scoped_refptr<base::SequencedTaskRunner>,base::RepeatingCallback<void > const &)
0x00007ffcf5bcd98c(chrome.dll -callback.h:152)base::OnceCallback<void ()>::Run
0x00007ffcf5bcd98c(chrome.dll -task_annotator.cc:186)base::TaskAnnotator::RunTaskImpl
0x00007ffcf5bcd98c(chrome.dll -task_annotator.h:89)base::TaskAnnotator::RunTask
0x00007ffcf5bcd98c(chrome.dll -task_tracker.cc:643)base::internal::TaskTracker::RunTaskImpl
0x00007ffcf5bcd98c(chrome.dll -task_tracker.cc:628)base::internal::TaskTracker::RunSkipOnShutdown(base::internal::Task &,base::TaskTraits const &,base::internal::TaskSource *,base::SequenceToken const &)
0x00007ffcf649990e(chrome.dll -task_tracker.cc:658)base::internal::TaskTracker::RunTaskWithShutdownBehavior
0x00007ffcf649990e(chrome.dll -task_tracker.cc:485)base::internal::TaskTracker::RunTask
0x00007ffcf649990e(chrome.dll -task_tracker.cc:400)base::internal::TaskTracker::RunAndPopNextTask
0x00007ffcf649990e(chrome.dll -worker_thread.cc:480)static void base::internal::WorkerThread::RunWorker()
0x00007ffcf1f3bf97(chrome.dll -worker_thread.cc:361)static void base::internal::WorkerThread::RunBackgroundPooledWorker()
0x00007ffcf1c9398b(chrome.dll -platform_thread_win.cc:133)static unsigned long base::`anonymous namespace'::ThreadFunc(void *)
0x00007ffd8c4b559f(KERNEL32.dll + 0x0001559f)BaseThreadInitThunk
0x00007ffd8d8e485a(ntdll.dll + 0x0000485a)RtlUserThreadStart


R=mad@chromium.org,grt@chromium.org,gab@chromium.org

Bug: 973868
Change-Id: I64636d9cf922aa699da3d03e3c1ff95109d46a91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4895025
Reviewed-by: Marc-André Decoste <mad@chromium.org>
Reviewed-by: Fabio Tirelo <ftirelo@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1201799}
1 file changed
tree: 237a11d65bff985e915c6801a98945537bd4d4d3
  1. android_webview/
  2. apps/
  3. ash/
  4. base/
  5. build/
  6. build_overrides/
  7. buildtools/
  8. cc/
  9. chrome/
  10. chromecast/
  11. chromeos/
  12. codelabs/
  13. components/
  14. content/
  15. courgette/
  16. crypto/
  17. dbus/
  18. device/
  19. docs/
  20. extensions/
  21. fuchsia_web/
  22. gin/
  23. google_apis/
  24. google_update/
  25. gpu/
  26. headless/
  27. infra/
  28. ios/
  29. ipc/
  30. media/
  31. mojo/
  32. native_client_sdk/
  33. net/
  34. pdf/
  35. ppapi/
  36. printing/
  37. remoting/
  38. rlz/
  39. sandbox/
  40. services/
  41. skia/
  42. sql/
  43. storage/
  44. styleguide/
  45. testing/
  46. third_party/
  47. tools/
  48. ui/
  49. url/
  50. webkit/
  51. .clang-format
  52. .clang-tidy
  53. .eslintrc.js
  54. .git-blame-ignore-revs
  55. .gitattributes
  56. .gitignore
  57. .gitmodules
  58. .gn
  59. .mailmap
  60. .rustfmt.toml
  61. .vpython3
  62. .yapfignore
  63. ATL_OWNERS
  64. AUTHORS
  65. BUILD.gn
  66. CODE_OF_CONDUCT.md
  67. codereview.settings
  68. DEPS
  69. DIR_METADATA
  70. LICENSE
  71. LICENSE.chromium_os
  72. OWNERS
  73. PRESUBMIT.py
  74. PRESUBMIT_test.py
  75. PRESUBMIT_test_mocks.py
  76. README.md
  77. WATCHLISTS
README.md

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure .

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.

If you found a bug, please file it at https://crbug.com/new.