RESOLVED FIXED Bug 214346
ASAN builds of WebKit should not freeze when an EXC_RESOURCE is delivered
https://bugs.webkit.org/show_bug.cgi?id=214346
Summary ASAN builds of WebKit should not freeze when an EXC_RESOURCE is delivered
Tuomas Karkkainen
Reported 2020-07-15 04:37:14 PDT
When a process instrumented with AddressSanitizer receives an EXC_RESOURCE, it is frozen for several minutes.
Attachments
proposed patch (3.11 KB, patch)
2020-07-15 05:06 PDT, Tuomas Karkkainen
mark.lam: review+
mark.lam: commit-queue-
proposed patch (3.13 KB, patch)
2020-07-16 01:22 PDT, Tuomas Karkkainen
no flags
Tuomas Karkkainen
Comment 1 2020-07-15 05:06:40 PDT
Created attachment 404332 [details] proposed patch
Mark Lam
Comment 2 2020-07-15 07:37:17 PDT
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?
Tuomas Karkkainen
Comment 3 2020-07-15 09:02:35 PDT
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.
Tuomas Karkkainen
Comment 4 2020-07-16 01:22:18 PDT
Created attachment 404429 [details] proposed patch wraps the code in #if ASAN_ENABLED as requested
EWS
Comment 5 2020-07-16 02:11:35 PDT
Committed r264450: <https://trac.webkit.org/changeset/264450> All reviewed patches have been landed. Closing bug and clearing flags on attachment 404429 [details].
Radar WebKit Bug Importer
Comment 6 2020-07-16 02:12:15 PDT
Note You need to log in before you can comment on or make changes to this bug.