Bug 128572

Summary: O_CLOEXEC in shm_open does not work on FreeBSD
Product: WebKit Reporter: Ting-Wei Lan <lantw44>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, buildbot, commit-queue, darin, rniwa, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Other   
Bug Depends on:    
Bug Blocks: 128598    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion none

Description Ting-Wei Lan 2014-02-10 18:49:13 PST
In Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp, line 110:
fileDescriptor = shm_open(tempName.data(), O_CREAT | O_CLOEXEC | O_RDWR, S_IRUSR | S_IWUSR);

The O_CLOEXEC flag causes the system call to fail with EINVAL (invalid arguments).

According to POSIX standard (http://pubs.opengroup.org/onlinepubs/9699919799/functions/shm_open.html), the O_CLOEXEC is not needed because the FD_CLOEXEC file descriptor flag is automatically set by shm_open.

I think we can just remove the O_CLOEXEC flag to fix the issue. This issue has caused all applications using WebKit2GTK+ on FreeBSD endlessly retrying shm_open.
Comment 1 Alberto Garcia 2014-02-11 00:00:07 PST
Created attachment 223820 [details]
Patch

I see, thanks for spotting this.
Comment 2 Sergio Villar Senin 2014-02-11 00:14:17 PST
Comment on attachment 223820 [details]
Patch

The change looks sensible to me. Let's go for it.
Comment 3 Build Bot 2014-02-11 01:22:47 PST
Comment on attachment 223820 [details]
Patch

Attachment 223820 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6477038114308096

New failing tests:
animations/stop-animation-on-suspend.html
Comment 4 Build Bot 2014-02-11 01:22:48 PST
Created attachment 223825 [details]
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-02  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 5 WebKit Commit Bot 2014-02-11 08:09:54 PST
Comment on attachment 223820 [details]
Patch

Clearing flags on attachment: 223820

Committed r163875: <http://trac.webkit.org/changeset/163875>
Comment 6 WebKit Commit Bot 2014-02-11 08:09:57 PST
All reviewed patches have been landed.  Closing bug.