Bug 128572 - O_CLOEXEC in shm_open does not work on FreeBSD
Summary: O_CLOEXEC in shm_open does not work on FreeBSD
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 128598
  Show dependency treegraph
 
Reported: 2014-02-10 18:49 PST by Ting-Wei Lan
Modified: 2014-02-11 08:09 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.40 KB, patch)
2014-02-11 00:00 PST, Alberto Garcia
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion (486.76 KB, application/zip)
2014-02-11 01:22 PST, Build Bot
no flags Details

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