RESOLVED FIXED 124610
[ASAN] WebKitLauncher: Include libasancrashreporter.dylib in DYLD_INSERT_LIBRARIES if it exists
https://bugs.webkit.org/show_bug.cgi?id=124610
Summary [ASAN] WebKitLauncher: Include libasancrashreporter.dylib in DYLD_INSERT_LIBR...
David Farler
Reported 2013-11-19 15:11:38 PST
libasancrashreporter.dylib automatically attaches the Address Sanitizer’s output to the crash report by dynamically registering with compiler-rt’s __asan_set_error_report_callback. We should look for this library and also add it to DYLD_INSERT_LIBRARIES.
Attachments
Patch (4.20 KB, patch)
2013-11-19 17:44 PST, David Farler
mrowe: review+
David Farler
Comment 1 2013-11-19 15:12:33 PST
I thought I might just set this in LSEnvironment and have the WebKitLauncher only append to DYLD_INSERT_LIBRARIES but it looks like it’s getting explicitly unset. Mark, do you know why that is? Should I just check to see if the dylib is in the bundle and add it to the list?
Mark Rowe (bdash)
Comment 2 2013-11-19 15:22:31 PST
Doing things via LSEnvironment isn't a good idea since it is not used when the binary is launched directly. If you're asking about the unsetenv("DYLD_INSERT_LIBRARIES"); call in WebKitNightlyEnabler.m, then that's to prevent the WebKitNightlyEnabler dylib from being injected in to all processes spawned by WebKit.app / Safari.app.
David Farler
Comment 3 2013-11-19 17:44:08 PST
Mark Rowe (bdash)
Comment 4 2013-11-19 18:37:49 PST
Comment on attachment 217365 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=217365&action=review r=me assuming that the scenarios I mentioned work correctly. > Tools/WebKitLauncher/WebKitNightlyEnabler.m:195 > + if (pathToASanCrashReporterLib) > + setenv("DYLD_INSERT_LIBRARIES", [pathToASanCrashReporterLib UTF8String], 1); This will result in the library being injected in to any subprocess launched by Safari. Back in the day that would include applications launched via LaunchServices calls that Safari happened to make (e.g., double-clicking on a file in the Downloads popover). It'd be worth confirming that this doesn't cause any problems. Have you confirmed that this is sufficient to have the dylib be injected in to the XPC services that WebKit2 launches (e.g., both the web and network processes)? > Tools/WebKitLauncher/main.m:245 > + dyldInsertLibraries = [@[pathToASanCrashReporterLib, pathToEnablerLib] componentsJoinedByString:@":"]; Our style calls for spaces inside array literal: @[ foo, bar ].
David Kilzer (:ddkilzer)
Comment 5 2013-11-19 20:17:44 PST
David Farler
Comment 6 2013-12-16 10:14:00 PST
Note You need to log in before you can comment on or make changes to this bug.