Bug 74078 - [Qt] Shared memory should use SHM instead of tmpdir
Summary: [Qt] Shared memory should use SHM instead of tmpdir
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-08 05:13 PST by Allan Sandfeld Jensen
Modified: 2011-12-15 04:38 PST (History)
3 users (show)

See Also:


Attachments
Patch (3.39 KB, patch)
2011-12-08 05:31 PST, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff
Patch (3.48 KB, patch)
2011-12-08 06:08 PST, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Sandfeld Jensen 2011-12-08 05:13:51 PST
Originally seen as one of the causes of NB#240753

Shared memory uses tmpdir which causes a crash if the filesystem tmpdir resides in fills up. Switching the shared memory implementation from tmpdir to SHM provides a stability and performance improvement.
Comment 1 Allan Sandfeld Jensen 2011-12-08 05:31:41 PST
Created attachment 118370 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2011-12-08 05:38:22 PST
Comment on attachment 118370 [details]
Patch

Looks good
Comment 3 Allan Sandfeld Jensen 2011-12-08 06:08:22 PST
Created attachment 118377 [details]
Patch
Comment 4 WebKit Review Bot 2011-12-09 01:51:40 PST
Comment on attachment 118377 [details]
Patch

Rejecting attachment 118377 [details] from commit-queue.

sandfeld@kde.org does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.
Comment 5 WebKit Review Bot 2011-12-09 17:01:30 PST
Comment on attachment 118377 [details]
Patch

Clearing flags on attachment: 118377

Committed r102493: <http://trac.webkit.org/changeset/102493>
Comment 6 WebKit Review Bot 2011-12-09 17:01:34 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Viatcheslav Ostapenko 2011-12-12 16:15:03 PST
(In reply to comment #5)
> (From update of attachment 118377 [details])
> Clearing flags on attachment: 118377
> 
> Committed r102493: <http://trac.webkit.org/changeset/102493>

For me this works only if I add "LIBS += -lrt" to linux-g++* section of api.pri on Ubuntu 11.10 with qt5 11bdb40bfda68291b9767b7908a2ab7dc3b75786 (from last bot update).
Comment 8 Simon Hausmann 2011-12-15 00:30:10 PST
Comment on attachment 118377 [details]
Patch

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

> Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp:125
> +#if PLATFORM(QT)
> +    while ((fileDescriptor = shm_open(tempNameC, O_CREAT | O_CLOEXEC | O_RDWR, S_IRUSR | S_IWUSR)) == -1) {
> +        if (errno != EINTR)
> +            return 0;
> +    }
> +#else
>      while ((fileDescriptor = mkstemp(tempNameC)) == -1) {
>          if (errno != EINTR)
>              return 0;

It's kind of silly that Qt uses shm_open and the others use mkstemp - there is nothing Qt specific here. We should simply be using shm_open/shm_unlink for SharedMemoryUnix.cpp.
Comment 9 Allan Sandfeld Jensen 2011-12-15 00:36:57 PST
I agree. I only made it QT specific because I didn't have the setup to compile and test for GTK. It should be very easy for a GTK developer to remove the IFDEFs and join the code.
Comment 10 Simon Hausmann 2011-12-15 04:38:29 PST
(In reply to comment #9)
> I agree. I only made it QT specific because I didn't have the setup to compile and test for GTK. It should be very easy for a GTK developer to remove the IFDEFs and join the code.

I have filed bug #74602 for this. Will upload a patch soon.