Bug 1842860: Increase stack size in WifiMonitor on MacOS r=haik,necko-reviewers,kershaw

We have been seeing the stack issue from bug 1776210, but on MacOS 10.12 Sierra.  We are increasing stack size for all versions.

Differential Revision: https://phabricator.services.mozilla.com/D183611
This commit is contained in:
David Parks 2023-07-20 22:11:27 +00:00
parent c77fcb8d11
commit a1bb9d5a19
2 changed files with 5 additions and 7 deletions

View File

@ -248,14 +248,12 @@ nsresult nsWifiMonitor::DispatchScanToBackgroundThread(uint64_t aPollingId,
#else
// If this ASSERT fails, we've increased our default stack size and
// may no longer need to special-case the stack size on macOS.
static_assert(kMacOS13MonitorStackSize >
static_assert(kMacOSWifiMonitorStackSize >
nsIThreadManager::DEFAULT_STACK_SIZE);
// Mac needs a stack size larger than the default for CoreWLAN.
nsIThreadManager::ThreadCreationOptions options = {
.stackSize = nsCocoaFeatures::OnVenturaOrLater()
? kMacOS13MonitorStackSize
: nsIThreadManager::DEFAULT_STACK_SIZE};
.stackSize = kMacOSWifiMonitorStackSize};
#endif
nsresult rv = NS_NewNamedThread("Wifi Monitor", getter_AddRefs(mThread),

View File

@ -33,9 +33,9 @@ class nsWifiAccessPoint;
#define WIFI_SCAN_INTERVAL_MS_PREF "network.wifi.scanning_period"
#ifdef XP_MACOSX
// Use a larger stack size for the monitor thread on macOS 13+
// to accommodate Core WLAN making large stack allocations.
# define kMacOS13MonitorStackSize (512 * 1024)
// Use a larger stack size for the wifi monitor thread of macOS, to
// accommodate Core WLAN making large stack allocations.
# define kMacOSWifiMonitorStackSize (512 * 1024)
#endif
struct WifiListenerHolder {