Bug 116682 - Move posix_spawn onto a zero delay timer
Summary: Move posix_spawn onto a zero delay timer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-23 10:52 PDT by Gavin Barraclough
Modified: 2013-05-23 15:01 PDT (History)
0 users

See Also:


Attachments
Fix (6.41 KB, patch)
2013-05-23 10:56 PDT, Gavin Barraclough
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2013-05-23 10:52:39 PDT
<rdar://problem/13973468>
Comment 1 Gavin Barraclough 2013-05-23 10:56:43 PDT
Created attachment 202728 [details]
Fix
Comment 2 Gavin Barraclough 2013-05-23 11:02:46 PDT
Fixed in r150595
Comment 3 Geoffrey Garen 2013-05-23 11:27:24 PDT
Comment on attachment 202728 [details]
Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=202728&action=review

> Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:119
> +                CFRunLoopTimerContext context = { 0, info, NULL, NULL, NULL };
> +                CFRunLoopTimerRef timer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent(), 0, 0, 0, reexecCallBack, &context);
> +                CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes);

Aren't you leaking this timer?
Comment 4 Darin Adler 2013-05-23 11:31:46 PDT
Comment on attachment 202728 [details]
Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=202728&action=review

> Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:79
> +    posix_spawnattr_destroy(&attr);

I don’t understand our approach on memory allocation. We are deallocating this, but not info, info->environment, the strings in info->environment, or timer. Why deallocate anything? Why not deallocate everything?
Comment 5 Gavin Barraclough 2013-05-23 15:01:51 PDT
This code was already leaky – it always immediately calls posix_spawn with flags to perform an execv – so the process is going to be be completely replaced (or will exit).