mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 12:20:56 +00:00

We currently fail to guarantee that OnEndDllLoad is called on the same gLoaderObserver as OnBeginDllLoad. We must implement additional synchronization to prevent a race condition where a call to LoaderPrivateAPIImp::SetObserver would come in between the two and change gLoaderObserver. This has led to issues when using MOZ_PROFILER_STARTUP=1 where we would have sStackWalkSuppressions reach (size_t)-1 instead of 0, later resulting in deadlock or missing stacks. See bug 1687510 comment 10 for extra details. Depends on D181436 Differential Revision: https://phabricator.services.mozilla.com/D181437