Bug 140175

Summary: [Mac] Secondary WebKit processes get re-exec'ed twice when running under ASan
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebKit2Assignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, commit-queue, dburkart, mrowe, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=140316
Attachments:
Description Flags
proposed fix
none
proposed fix
none
proposed fix sam: review+

Description Alexey Proskuryakov 2015-01-06 23:52:12 PST
ASan needs to have its dynamic library inserted using DYLD_INSERT_LIBRARIES. When an ASanified binary is loaded and notices that this hasn't been done, it re-execs the process with environment updated.

We already do a re-exec in Development builds of WebKit processes, pretty much for the same reason. Getting two re-execs it very annoying in debugging, because the debugger stops on exec. So if you wait to attach to com.apple.WebKit.WebContent.Development, you need to hit continue twice when it launches.
Comment 1 Alexey Proskuryakov 2015-01-07 00:03:10 PST
Created attachment 244143 [details]
proposed fix

As a separate fix, we'll also need to insert the library into the main process in run-webkit-tests and in run-safari. Having an extra re-exec in secondary process is the more annoying problem, because various IPC timeouts can pass while one resumes the process.
Comment 2 Alexey Proskuryakov 2015-01-07 00:06:41 PST
Created attachment 244144 [details]
proposed fix

Better behavior for release builds in the theoretical case where ASan library name becomes different.

It's not a big problem to re-exec in release build, because it's probably not being debugged. So it doesn't have to be fatal if we can't find the library.
Comment 3 Alexey Proskuryakov 2015-01-07 11:08:05 PST
Created attachment 244167 [details]
proposed fix

Structured it slightly nicer.
Comment 4 WebKit Commit Bot 2015-01-07 11:10:42 PST
Attachment 244167 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm:97:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Alexey Proskuryakov 2015-01-07 11:49:34 PST
Committed <http://trac.webkit.org/r178043>, build fix in <http://trac.webkit.org/r178044>.
Comment 6 Alexey Proskuryakov 2015-01-09 14:54:49 PST
<rdar://problem/19431848>