gecko-dev/mozglue
Yannis Juglaret 8c54dbd6c0 Bug 1840164 - Pre-commit stack pages on background hang monitor thread. r=mhowell
When a first hang is detected, the BHMgr Monitor thread needs to commit
5 more pages of stack to run profiler_suspend_and_sample_thread, which
contains big stack variables. If that occurs while we are low on memory,
failure to commit stack pages can crash the process.

In bug 1716727, we have added delays on failed allocations to try
to avoid crashing the main process under low memory condition. These
delays could trigger the background hang monitor, which could in
turn crash the process, as they occur in a low memory condition where we
will likely fail to commit.

We can pre-commit the 5 pages of stack at thread initialization to
ensure that they will already be commited when we later need them. Or at
least, we can try to see if that works.

We do that with a wrapper for the __chkstk function. We add a new test
in the NativeNt cppunit test, to ensure that our wrapper function
behaves as expected.

Differential Revision: https://phabricator.services.mozilla.com/D182582
2023-09-12 12:27:46 +00:00
..
android Bug 1839762 - Cast scoped enums to their underlying type when printing them. r=media-playback-reviewers,necko-reviewers,application-update-reviewers,geckoview-reviewers,handyman,emilio,valentin,bytesized,owlish,karlt 2023-06-24 20:14:31 +00:00
baseprofiler Bug 1838497 - Add a profiler feature to record the clock frequency of every core while sampling, r=canaltinova. 2023-08-10 10:27:14 +00:00
build Bug 1786490 - reformat the tree using black 23.3.0 r=sylvestre,webdriver-reviewers,taskgraph-reviewers,whimboo,jmaher,ahal,perftest-reviewers,geckoview-reviewers,afinder,m_kato 2023-09-06 16:14:30 +00:00
interposers Bug 1851154 - Provide our own implementation of C's getline for Android r=jld 2023-09-04 07:00:31 +00:00
linker Bug 1824518 - Make mozglue/linker/tests buildable outside of a unified build environment r=andi 2023-03-30 13:48:34 +00:00
misc Bug 1840164 - Pre-commit stack pages on background hang monitor thread. r=mhowell 2023-09-12 12:27:46 +00:00
static Bug 1841905 - Update builders to rustc 1.72. r=firefox-build-system-reviewers,andi 2023-08-28 21:02:47 +00:00
tests Bug 1840164 - Pre-commit stack pages on background hang monitor thread. r=mhowell 2023-09-12 12:27:46 +00:00
moz.build Bug 1836478 - Disable mozglue interposers for snapshot fuzzing. r=gsvelto 2023-06-02 16:17:14 +00:00