Bug 140175 - [Mac] Secondary WebKit processes get re-exec'ed twice when running under ASan
Summary: [Mac] Secondary WebKit processes get re-exec'ed twice when running under ASan
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-01-06 23:52 PST by Alexey Proskuryakov
Modified: 2015-01-09 14:54 PST (History)
5 users (show)

See Also:


Attachments
proposed fix (2.49 KB, patch)
2015-01-07 00:03 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
proposed fix (2.52 KB, patch)
2015-01-07 00:06 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
proposed fix (2.93 KB, patch)
2015-01-07 11:08 PST, Alexey Proskuryakov
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>