When a process instrumented with AddressSanitizer receives an EXC_RESOURCE, it is frozen for several minutes.
Created attachment 404332 [details] proposed patch
Comment on attachment 404332 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=404332&action=review r=me with fix. > Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:153 > + // EXC_RESOURCE on ASAN builds freezes the process for several minutes: rdar://65027596 > + if (char *disableFreezingOnExcResource = getenv("DISABLE_FREEZING_ON_EXC_RESOURCE")) { > + if (!strcasecmp(disableFreezingOnExcResource, "yes") || !strcasecmp(disableFreezingOnExcResource, "true") || !strcasecmp(disableFreezingOnExcResource, "1")) { > + int val = 1; > + int rc = sysctlbyname("debug.toggle_address_reuse", nullptr, 0, &val, sizeof(val)); > + if (rc < 0) > + WTFLogAlways("failed to set debug.toggle_address_reuse: %d\n", rc); > + else > + WTFLogAlways("debug.toggle_address_reuse is now 1.\n"); > + } > + } Can you guard this with #if ASAN_ENABLED? We don't need this for any other builds, right?
Ok, will do. I was thinking other sanitizers might be affected, but looking quickly at an UBSAN build, there are no giant mappings there, so limiting it to ASAN makes sense.
Created attachment 404429 [details] proposed patch wraps the code in #if ASAN_ENABLED as requested
Committed r264450: <https://trac.webkit.org/changeset/264450> All reviewed patches have been landed. Closing bug and clearing flags on attachment 404429 [details].
<rdar://problem/65653827>