Bug 1918596 - Assert one mozjemalloc arena on ForkServer process r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D222079
This commit is contained in:
Alexandre Lissy 2024-10-21 06:05:44 +00:00
parent b6c10eb16a
commit 0dcde54067

View File

@ -205,6 +205,13 @@ bool ForkServer::OnMessageReceived(UniquePtr<IPC::Message> message) {
return false;
}
#if defined(MOZ_MEMORY) && defined(DEBUG)
jemalloc_stats_t stats;
jemalloc_stats(&stats);
MOZ_ASSERT(stats.narenas == 1,
"ForkServer before fork()/clone() should have a single arena.");
#endif
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
mozilla::SandboxLaunch launcher;
if (!launcher.Prepare(&options)) {