Yannis Juglaret 9361f6d10e Bug 1836225 - Prevent stack walking deadlock with MOZ_PROFILER_STARTUP=1. r=handyman
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
2023-09-13 14:32:51 +00:00
..