run-webkit-tests supports the argument --guard-malloc on OS X to inject libgmalloc into Safari/WebProcess. run-safari and debug-safari and friends should support this as well, for convenience. I have a patch.
Created attachment 141563 [details] patch If need be (if whoever reviews this wants) we can make a gdb script that we call (-x) that turns gmalloc on only for the child process and not for gdb itself. It's kind of annoying that there doesn't seem to be a way to hand it commands right on the command line...
Comment on attachment 141563 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=141563&action=review > Tools/Scripts/webkitdirs.pm:1387 > +sub setupGuardMallocIfNeeded This should use the verb “set up” and therefore a capital U. > Tools/Scripts/webkitdirs.pm:1398 > + $ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib"; This will get overwritten by $ENV{DYLD_INSERT_LIBRARIES} = $webProcessShimPath; in the shouldTargetWebProcess() branch of execMacWebKitAppForDebugging(). Please change that function so that it will work with the new option.
Created attachment 141583 [details] patch + mitzification
Comment on attachment 141583 [details] patch + mitzification View in context: https://bugs.webkit.org/attachment.cgi?id=141583&action=review > Tools/Scripts/webkitdirs.pm:2514 > + --guard-malloc Enable malloc guard (Mac OS X only) I’ve never seen this called “malloc guard”. Is this what it’s called in run-webkit-tests? The man pages seem to call it Guard Malloc.
(In reply to comment #4) > (From update of attachment 141583 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=141583&action=review > > > Tools/Scripts/webkitdirs.pm:2514 > > + --guard-malloc Enable malloc guard (Mac OS X only) > > I’ve never seen this called “malloc guard”. Is this what it’s called in run-webkit-tests? The man pages seem to call it Guard Malloc. I stole the help message from run-webkit-tests, I agree it sounds a little weird. Maybe we should change it in both places?
> I stole the help message from run-webkit-tests, I agree it sounds a little weird. Maybe we should change it in both places? Good idea.
Landed in http://trac.webkit.org/changeset/116859 Thanks, Dan!