Skip to contentSkip to conversation

recipes-qt: add fix for QWSLock on qt4e

PATCH In review Eric Nelson 3 participants 7 messages Aug 24, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 recipes-qt: add fix for QWSLock on qt4e

This patch adds a patch for Qt-Embedded to only
destroy semaphores in the process which created
them.

Original patch by Neil Jerram for the OpenMoko project:

	http://lists.openmoko.org/pipermail/community/2012-November/067806.html

See also Bug 31254:
https://bugreports.qt-project.org/browse/QTBUG-31254

---
 meta/recipes-qt/qt4/qt4-4.8.5.inc                  |  1 +
 ...-Only-destroy-semaphores-in-process-owner.patch | 77 ++++++++++++++++++++++
 2 files changed, 78 insertions(+)
 create mode 100644 meta/recipes-qt/qt4/qt4-4.8.5/0028-QWSLock-Only-destroy-semaphores-in-process-owner.patch
meta/recipes-qt/qt4/qt4-4.8.5.inc +1 -0
index 95a14f3..be16bff 100644
@@ -24,6 +24,7 @@ SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-ever
            file://0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch \
            file://0023-QHttpMultiPart-fix-data-corruption-in-readData-metho.patch \
            file://0027-tools.pro-disable-qmeegographicssystemhelper.patch \
+           file://0028-QWSLock-Only-destroy-semaphores-in-process-owner.patch \
            file://g++.conf \
            file://linux.conf \
            "
meta/recipes-qt/qt4/qt4-4.8.5/0028-QWSLock-Only-destroy-semaphores-in-process-owner.patch new file +77 -0

77 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 11 lines · Eric Nelson

This patch adds a patch for Qt-Embedded to only
destroy semaphores in the process which created
them.

Original patch by Neil Jerram for the OpenMoko project:

	http://lists.openmoko.org/pipermail/community/2012-November/067806.html

See also Bug 31254:
https://bugreports.qt-project.org/browse/QTBUG-31254

Besides this, we need an Upstream-Status: Tag, this is either a Backport or Submitted maybe?

Sau!

Quoted 102 lines
---
  meta/recipes-qt/qt4/qt4-4.8.5.inc                  |  1 +
  ...-Only-destroy-semaphores-in-process-owner.patch | 77 ++++++++++++++++++++++
  2 files changed, 78 insertions(+)

create mode 100644 meta/recipes-qt/qt4/qt4-4.8.5/0028-QWSLock-Only-destroy-semaphores-in-process-owner.patch

meta/recipes-qt/qt4/qt4-4.8.5.inc +1 -0
index 95a14f3..be16bff 100644
@@ -24,6 +24,7 @@ SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-ever
             file://0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch \
             file://0023-QHttpMultiPart-fix-data-corruption-in-readData-metho.patch \
             file://0027-tools.pro-disable-qmeegographicssystemhelper.patch \
+           file://0028-QWSLock-Only-destroy-semaphores-in-process-owner.patch \
             file://g++.conf \
             file://linux.conf \
             "
meta/recipes-qt/qt4/qt4-4.8.5/0028-QWSLock-Only-destroy-semaphores-in-process-owner.patch new file +77 -0
new file mode 100644
index 0000000..d67a746
@@ -0,0 +1,77 @@
+From 9af565935d16ecf8a8c04b5ea850ddb34a7c1294 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <[email protected]>
+Date: Mon, 12 Aug 2013 11:54:05 -0700
+Subject: [PATCH] QWSLock: Only destroy semaphores in process owner
+
+This fixes the case when QT_POSIX_IPC is not defined.
+
+Original patch by Neil Jerram for the OpenMoko project:
+	http://lists.openmoko.org/pipermail/community/2012-November/067806.html
+
+See also Bug 31254:
+	https://bugreports.qt-project.org/browse/QTBUG-31254
+
+Signed-off-by: Eric Nelson <[email protected]>
+---
+ src/gui/embedded/qwslock.cpp | 13 +++++++++----
+ src/gui/embedded/qwslock_p.h |  2 +-
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/src/gui/embedded/qwslock.cpp b/src/gui/embedded/qwslock.cpp
+index 3f8f306..cd6a48d 100644
+--- a/src/gui/embedded/qwslock.cpp
++++ b/src/gui/embedded/qwslock.cpp
+@@ -83,9 +83,12 @@ QWSLock::QWSLock(int id) : semId(id)
+     QWSSignalHandler::instance()->addWSLock(this);
+ #endif
+
++    owned = false;
++
+ #ifndef QT_POSIX_IPC
+     if (semId == -1) {
+         semId = semget(IPC_PRIVATE, 3, IPC_CREAT | 0666);
++        owned = true;
+         if (semId == -1) {
+             perror("QWSLock::QWSLock");
+             qFatal("Unable to create semaphore");
+@@ -100,7 +103,6 @@ QWSLock::QWSLock(int id) : semId(id)
+     }
+ #else
+     sems[0] = sems[1] = sems[2] = SEM_FAILED;
+-    owned = false;
+
+     if (semId == -1) {
+         // ### generate really unique IDs
+@@ -134,9 +136,12 @@ QWSLock::~QWSLock()
+
+     if (semId != -1) {
+ #ifndef QT_POSIX_IPC
+-        qt_semun semval;
+-        semval.val = 0;
+-        semctl(semId, 0, IPC_RMID, semval);
++
++        if (owned) {
++            qt_semun semval;
++            semval.val = 0;
++            semctl(semId, 0, IPC_RMID, semval);
++        }
+         semId = -1;
+ #else
+         // emulate the SEM_UNDO behavior for the BackingStore lock
+diff --git a/src/gui/embedded/qwslock_p.h b/src/gui/embedded/qwslock_p.h
+index ead7b89..d16b3d5 100644
+--- a/src/gui/embedded/qwslock_p.h
++++ b/src/gui/embedded/qwslock_p.h
+@@ -86,8 +86,8 @@ private:
+     int lockCount[2];
+ #ifdef QT_POSIX_IPC
+     sem_t *sems[3];
+-    bool owned;
+ #endif
++    bool owned;
+ };
+
+ QT_END_NAMESPACE
+--
+1.8.1.2
+
#2 lore raw

This is strange. According to the bugtracker it should be in 4.8.5 already... and the recipe seems to be about 4.8.5. It needs more investigation.

Quoted 143 lines · Saul Wold
Quoted 4 lines · Eric Nelson

This patch adds a patch for Qt-Embedded to only
destroy semaphores in the process which created
them.

Quoted 10 lines

Original patch by Neil Jerram for the OpenMoko project:

        http://lists.openmoko.org/**pipermail/community/2012-**

November/067806.html<http://lists.openmoko.org/pipermail/community/2012-November/067806.html>

See also Bug 31254:
https://bugreports.qt-project.**org/browse/QTBUG-31254<https://bugreports.qt-project.org/browse/QTBUG-31254>

Quoted 1 line

Besides this, we need an Upstream-Status: Tag, this is either a Backport or Submitted maybe?

Sau!

---

Quoted 106 lines
  meta/recipes-qt/qt4/qt4-4.8.5.**inc                  |  1 +
  ...-Only-destroy-semaphores-**in-process-owner.patch | 77
++++++++++++++++++++++
  2 files changed, 78 insertions(+)

create mode 100644 meta/recipes-qt/qt4/qt4-4.8.5/**
0028-QWSLock-Only-destroy-**semaphores-in-process-owner.**patch

meta/recipes-qt/qt4/qt4-4.8.**5.inc +0 -0
index 95a14f3..be16bff 100644
@@ -24,6 +24,7 @@ SRC_URI = "http://download.qt-project.**

org/official_releases/qt/4.8/$**{PV}/qt-ever<http://download.qt-project.org/official_releases/qt/4.8/$%7BPV%7D/qt-ever>

             file://0022-Fix-drawing-of-0-**width-polylines-from-outside-
**the-de.patch \
             file://0023-QHttpMultiPart-**fix-data-corruption-in-**readData-metho.patch

\
file://0027-tools.pro-disable-**qmeegographicssystemhelper.*
*patch \
+ file://0028-QWSLock-Only-**destroy-semaphores-in-process-**owner.patch

\
             file://g++.conf \
             file://linux.conf \
             "
(quoted diff) +0 -0

semaphores-in-process-owner.**patch b/meta/recipes-qt/qt4/qt4-4.8.** 5/0028-QWSLock-Only-destroy-**semaphores-in-process-owner.**patch new file mode 100644
index 0000000..d67a746

meta/recipes-qt/qt4/qt4-4.8.**5/0028-QWSLock-Only-destroy-** new file +0 -0

semaphores-in-process-owner.**patch

meta/recipes-qt/qt4/qt4-4.8.**5/0028-QWSLock-Only-destroy-** new file +2 -0
@@ -0,0 +1,77 @@
+From 9af565935d16ecf8a8c04b5ea850dd**b34a7c1294 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <eric.nelson@boundarydevices.**com<[email protected]>
Quoted 1 line
meta/recipes-qt/qt4/qt4-4.8.**5/0028-QWSLock-Only-destroy-** new file +7 -0
+Date: Mon, 12 Aug 2013 11:54:05 -0700
+Subject: [PATCH] QWSLock: Only destroy semaphores in process owner
+
+This fixes the case when QT_POSIX_IPC is not defined.
+
+Original patch by Neil Jerram for the OpenMoko project:
+       http://lists.openmoko.org/**pipermail/community/2012-**

November/067806.html<http://lists.openmoko.org/pipermail/community/2012-November/067806.html>

meta/recipes-qt/qt4/qt4-4.8.**5/0028-QWSLock-Only-destroy-** new file +5 -0
+
+See also Bug 31254:
+       https://bugreports.qt-project.**org/browse/QTBUG-31254<https://bugreports.qt-project.org/browse/QTBUG-31254>
+
+Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.**com<[email protected]>
Quoted 1 line
+---
+ src/gui/embedded/qwslock.cpp | 13 +++++++++----
+ src/gui/embedded/qwslock_p.h |  2 +-

+ 2 files changed, 10 insertions(+), 5 deletions(-)

meta/recipes-qt/qt4/qt4-4.8.**5/0028-QWSLock-Only-destroy-** new file +51 -0
+
+diff --git a/src/gui/embedded/qwslock.cpp b/src/gui/embedded/qwslock.cpp
+index 3f8f306..cd6a48d 100644
+--- a/src/gui/embedded/qwslock.cpp
++++ b/src/gui/embedded/qwslock.cpp
+@@ -83,9 +83,12 @@ QWSLock::QWSLock(int id) : semId(id)
+     QWSSignalHandler::instance()->**addWSLock(this);
+ #endif
+
++    owned = false;
++
+ #ifndef QT_POSIX_IPC
+     if (semId == -1) {
+         semId = semget(IPC_PRIVATE, 3, IPC_CREAT | 0666);
++        owned = true;
+         if (semId == -1) {
+             perror("QWSLock::QWSLock");
+             qFatal("Unable to create semaphore");
+@@ -100,7 +103,6 @@ QWSLock::QWSLock(int id) : semId(id)
+     }
+ #else
+     sems[0] = sems[1] = sems[2] = SEM_FAILED;
+-    owned = false;
+
+     if (semId == -1) {
+         // ### generate really unique IDs
+@@ -134,9 +136,12 @@ QWSLock::~QWSLock()
+
+     if (semId != -1) {
+ #ifndef QT_POSIX_IPC
+-        qt_semun semval;
+-        semval.val = 0;
+-        semctl(semId, 0, IPC_RMID, semval);
++
++        if (owned) {
++            qt_semun semval;
++            semval.val = 0;
++            semctl(semId, 0, IPC_RMID, semval);
++        }
+         semId = -1;
+ #else
+         // emulate the SEM_UNDO behavior for the BackingStore lock
+diff --git a/src/gui/embedded/qwslock_p.h b/src/gui/embedded/qwslock_p.h
+index ead7b89..d16b3d5 100644
+--- a/src/gui/embedded/qwslock_p.h
++++ b/src/gui/embedded/qwslock_p.h
+@@ -86,8 +86,8 @@ private:
+     int lockCount[2];
+ #ifdef QT_POSIX_IPC
+     sem_t *sems[3];
+-    bool owned;

meta/recipes-qt/qt4/qt4-4.8.**5/0028-QWSLock-Only-destroy-**

Quoted 10 lines
meta/recipes-qt/qt4/qt4-4.8.**5/0028-QWSLock-Only-destroy-** new file +8 -0
+ #endif
++    bool owned;
+ };
+
+ QT_END_NAMESPACE
+--
+1.8.1.2
+
 
 ______________________________**_________________

Openembedded-core mailing list Openembedded-core@lists.**openembedded.org<[email protected]>
http://lists.openembedded.org/**mailman/listinfo/openembedded-**core<http://lists.openembedded.org/mailman/listinfo/openembedded-core>

#3 lore raw

Hi Laszlo,

Quoted 4 lines · Laszlo Papp

This is strange. According to the bugtracker it should be in 4.8.5 already... and the recipe seems to be about 4.8.5. It needs more investigation.

I saw this, but there's no evidence that any change was committed and I verified that the bug is still there (it's trivially easy to reproduce) and that this patch fixes it.

Quoted 18 lines

On Sat, Aug 24, 2013 at 8:13 PM, Saul Wold <[email protected] <mailto:[email protected]>> wrote:

On 08/24/2013 09:49 AM, Eric Nelson wrote:

This patch adds a patch for Qt-Embedded to only destroy semaphores in the process which created them.

Original patch by Neil Jerram for the OpenMoko project:
http://lists.openmoko.org/__pipermail/community/2012-__November/067806.html
<http://lists.openmoko.org/pipermail/community/2012-November/067806.html>

See also Bug 31254:
https://bugreports.qt-project.__org/browse/QTBUG-31254
<https://bugreports.qt-project.org/browse/QTBUG-31254>

Quoted 6 lines

<mailto:[email protected]>>

Besides this, we need an Upstream-Status: Tag, this is either a Backport or Submitted maybe?

I submitted a patch, but haven't received any feedback from the Qt'ers:

	https://codereview.qt-project.org/#change,62842

Should I re-send with Upstream-Status: tag and a reference?

Quoted 134 lines
    Sau!


        ---
           meta/recipes-qt/qt4/qt4-4.8.5.__inc                  |  1 +
           ...-Only-destroy-semaphores-__in-process-owner.patch | 77
        ++++++++++++++++++++++
           2 files changed, 78 insertions(+)
           create mode 100644
        meta/recipes-qt/qt4/qt4-4.8.5/__0028-QWSLock-Only-destroy-__semaphores-in-process-owner.__patch

        diff --git a/meta/recipes-qt/qt4/qt4-4.8.__5.inc
        b/meta/recipes-qt/qt4/qt4-4.8.__5.inc
        index 95a14f3..be16bff 100644
        --- a/meta/recipes-qt/qt4/qt4-4.8.__5.inc
        +++ b/meta/recipes-qt/qt4/qt4-4.8.__5.inc
        @@ -24,6 +24,7 @@ SRC_URI =
        "http://download.qt-project.__org/official_releases/qt/4.8/$__{PV}/qt-ever
        <http://download.qt-project.org/official_releases/qt/4.8/$%7BPV%7D/qt-ever>

          file://0022-Fix-drawing-of-0-__width-polylines-from-outside-__the-de.patch \

          file://0023-QHttpMultiPart-__fix-data-corruption-in-__readData-metho.patch \

          file://0027-tools.pro-disable-__qmeegographicssystemhelper.__patch \
        +
        file://0028-QWSLock-Only-__destroy-semaphores-in-process-__owner.patch
        \
                      file://g++.conf \
                      file://linux.conf \
                      "
        diff --git
        a/meta/recipes-qt/qt4/qt4-4.8.__5/0028-QWSLock-Only-destroy-__semaphores-in-process-owner.__patch
        b/meta/recipes-qt/qt4/qt4-4.8.__5/0028-QWSLock-Only-destroy-__semaphores-in-process-owner.__patch
        new file mode 100644
        index 0000000..d67a746
        --- /dev/null
        +++
        b/meta/recipes-qt/qt4/qt4-4.8.__5/0028-QWSLock-Only-destroy-__semaphores-in-process-owner.__patch
        @@ -0,0 +1,77 @@
        +From 9af565935d16ecf8a8c04b5ea850dd__b34a7c1294 Mon Sep 17
        00:00:00 2001
        +From: Eric Nelson <eric.nelson@boundarydevices.__com
        <mailto:[email protected]>>
        +Date: Mon, 12 Aug 2013 11:54:05 -0700
        +Subject: [PATCH] QWSLock: Only destroy semaphores in process owner
        +
        +This fixes the case when QT_POSIX_IPC is not defined.
        +
        +Original patch by Neil Jerram for the OpenMoko project:
        +
        http://lists.openmoko.org/__pipermail/community/2012-__November/067806.html
        <http://lists.openmoko.org/pipermail/community/2012-November/067806.html>
        +
        +See also Bug 31254:
        + https://bugreports.qt-project.__org/browse/QTBUG-31254
        <https://bugreports.qt-project.org/browse/QTBUG-31254>
        +
        +Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.__com
        <mailto:[email protected]>>
        +---
        + src/gui/embedded/qwslock.cpp | 13 +++++++++----
        + src/gui/embedded/qwslock_p.h |  2 +-
        + 2 files changed, 10 insertions(+), 5 deletions(-)
        +
        +diff --git a/src/gui/embedded/qwslock.cpp
        b/src/gui/embedded/qwslock.cpp
        +index 3f8f306..cd6a48d 100644
        +--- a/src/gui/embedded/qwslock.cpp
        ++++ b/src/gui/embedded/qwslock.cpp
        +@@ -83,9 +83,12 @@ QWSLock::QWSLock(int id) : semId(id)
        +     QWSSignalHandler::instance()->__addWSLock(this);
        + #endif
        +
        ++    owned = false;
        ++
        + #ifndef QT_POSIX_IPC
        +     if (semId == -1) {
        +         semId = semget(IPC_PRIVATE, 3, IPC_CREAT | 0666);
        ++        owned = true;
        +         if (semId == -1) {
        +             perror("QWSLock::QWSLock");
        +             qFatal("Unable to create semaphore");
        +@@ -100,7 +103,6 @@ QWSLock::QWSLock(int id) : semId(id)
        +     }
        + #else
        +     sems[0] = sems[1] = sems[2] = SEM_FAILED;
        +-    owned = false;
        +
        +     if (semId == -1) {
        +         // ### generate really unique IDs
        +@@ -134,9 +136,12 @@ QWSLock::~QWSLock()
        +
        +     if (semId != -1) {
        + #ifndef QT_POSIX_IPC
        +-        qt_semun semval;
        +-        semval.val = 0;
        +-        semctl(semId, 0, IPC_RMID, semval);
        ++
        ++        if (owned) {
        ++            qt_semun semval;
        ++            semval.val = 0;
        ++            semctl(semId, 0, IPC_RMID, semval);
        ++        }
        +         semId = -1;
        + #else
        +         // emulate the SEM_UNDO behavior for the BackingStore lock
        +diff --git a/src/gui/embedded/qwslock_p.h
        b/src/gui/embedded/qwslock_p.h
        +index ead7b89..d16b3d5 100644
        +--- a/src/gui/embedded/qwslock_p.h
        ++++ b/src/gui/embedded/qwslock_p.h
        +@@ -86,8 +86,8 @@ private:
        +     int lockCount[2];
        + #ifdef QT_POSIX_IPC
        +     sem_t *sems[3];
        +-    bool owned;
        + #endif
        ++    bool owned;
        + };
        +
        + QT_END_NAMESPACE
        +--
        +1.8.1.2
        +

    _________________________________________________
    Openembedded-core mailing list
    Openembedded-core@lists.__openembedded.org
    <mailto:[email protected]>
    http://lists.openembedded.org/__mailman/listinfo/openembedded-__core
    <http://lists.openembedded.org/mailman/listinfo/openembedded-core>
#4 lore raw

Well, you should ask upstream about it... maybe it ended up in a decision it is the wrong way, and something better went in, or being planned to go in. I think a change should not be integrated like this in grey area.

Quoted 217 lines · Eric Nelson

Hi Laszlo,

Quoted 5 lines · Laszlo Papp

This is strange. According to the bugtracker it should be in 4.8.5 already... and the recipe seems to be about 4.8.5. It needs more investigation.

I saw this, but there's no evidence that any change was committed and I verified that the bug is still there (it's trivially easy to reproduce) and that this patch fixes it.

Quoted 22 lines

On Sat, Aug 24, 2013 at 8:13 PM, Saul Wold <[email protected] <mailto:[email protected]>> wrote:

On 08/24/2013 09:49 AM, Eric Nelson wrote:

This patch adds a patch for Qt-Embedded to only destroy semaphores in the process which created them.

Original patch by Neil Jerram for the OpenMoko project:
http://lists.openmoko.org/__**pipermail/community/2012-__**
November/067806.html<http://lists.openmoko.org/__pipermail/community/2012-__November/067806.html>

        <http://lists.openmoko.org/**pipermail/community/2012-**

November/067806.html<http://lists.openmoko.org/pipermail/community/2012-November/067806.html>

Quoted 1 line
        See also Bug 31254:
        https://bugreports.qt-project.**__org/browse/QTBUG-31254
        <https://bugreports.qt-**project.org/browse/QTBUG-31254<https://bugreports.qt-project.org/browse/QTBUG-31254>

**>

Quoted 9 lines

<mailto:eric.nelson@**boundarydevices.com<[email protected]>

Quoted 1 line
Quoted 1 line

Besides this, we need an Upstream-Status: Tag, this is either a Backport or Submitted maybe?

I submitted a patch, but haven't received any feedback from the Qt'ers:

        https://codereview.qt-project.**org/#change,62842<https://codereview.qt-project.org/#change,62842>

Should I re-send with Upstream-Status: tag and a reference?

Sau!

Quoted 164 lines

        ---
           meta/recipes-qt/qt4/qt4-4.8.5.**__inc                  |  1 +
           ...-Only-destroy-semaphores-__**in-process-owner.patch | 77

        ++++++++++++++++++++++
           2 files changed, 78 insertions(+)
           create mode 100644
        meta/recipes-qt/qt4/qt4-4.8.5/**__0028-QWSLock-Only-destroy-__**

semaphores-in-process-owner.__**patch

        diff --git a/meta/recipes-qt/qt4/qt4-4.8.**__5.inc
        b/meta/recipes-qt/qt4/qt4-4.8.**__5.inc
        index 95a14f3..be16bff 100644
        --- a/meta/recipes-qt/qt4/qt4-4.8.**__5.inc
        +++ b/meta/recipes-qt/qt4/qt4-4.8.**__5.inc

        @@ -24,6 +24,7 @@ SRC_URI =
        "http://download.qt-project.__**org/official_releases/qt/4.8/$**
__{PV}/qt-ever
        <http://download.qt-project.**org/official_releases/qt/4.8/$**

%7BPV%7D/qt-ever<http://download.qt-project.org/official_releases/qt/4.8/$%7BPV%7D/qt-ever>

Quoted 1 line
          file://0022-Fix-drawing-of-0-_**_width-polylines-from-outside-*

*__the-de.patch \

          file://0023-QHttpMultiPart-__**fix-data-corruption-in-__**readData-metho.patch

\

          file://0027-tools.pro-disable-**__qmeegographicssystemhelper._*
*_patch \
        +
        file://0028-QWSLock-Only-__**destroy-semaphores-in-process-**

__owner.patch

        \
                      file://g++.conf \
                      file://linux.conf \
                      "
        diff --git
        a/meta/recipes-qt/qt4/qt4-4.8.**__5/0028-QWSLock-Only-destroy-**
__semaphores-in-process-owner.**__patch
        b/meta/recipes-qt/qt4/qt4-4.8.**__5/0028-QWSLock-Only-destroy-**

__semaphores-in-process-owner.**__patch

        new file mode 100644
        index 0000000..d67a746
        --- /dev/null
        +++
        b/meta/recipes-qt/qt4/qt4-4.8.**__5/0028-QWSLock-Only-destroy-**
__semaphores-in-process-owner.**__patch
        @@ -0,0 +1,77 @@
        +From 9af565935d16ecf8a8c04b5ea850dd**__b34a7c1294 Mon Sep 17
        00:00:00 2001
        +From: Eric Nelson <eric.nelson@boundarydevices._**_com
        <mailto:eric.nelson@**boundarydevices.com<[email protected]>
Quoted 1 line
Quoted 1 line

+Date: Mon, 12 Aug 2013 11:54:05 -0700
+Subject: [PATCH] QWSLock: Only destroy semaphores in process
owner

        +
        +This fixes the case when QT_POSIX_IPC is not defined.
        +
        +Original patch by Neil Jerram for the OpenMoko project:
        +
        http://lists.openmoko.org/__**pipermail/community/2012-__**

November/067806.html<http://lists.openmoko.org/__pipermail/community/2012-__November/067806.html>

        <http://lists.openmoko.org/**pipermail/community/2012-**

November/067806.html<http://lists.openmoko.org/pipermail/community/2012-November/067806.html>

Quoted 1 line
        +
        +See also Bug 31254:
        + https://bugreports.qt-project.**__org/browse/QTBUG-31254
        <https://bugreports.qt-**project.org/browse/QTBUG-31254<https://bugreports.qt-project.org/browse/QTBUG-31254>

**>
+
+Signed-off-by: Eric Nelson <eric.nelson@boundarydevices._**_com <mailto:eric.nelson@**boundarydevices.com<[email protected]>

Quoted 1 line
Quoted 1 line
        +---
        + src/gui/embedded/qwslock.cpp | 13 +++++++++----
        + src/gui/embedded/qwslock_p.h |  2 +-
        + 2 files changed, 10 insertions(+), 5 deletions(-)
        +
        +diff --git a/src/gui/embedded/qwslock.cpp
        b/src/gui/embedded/qwslock.cpp
        +index 3f8f306..cd6a48d 100644
        +--- a/src/gui/embedded/qwslock.cpp
        ++++ b/src/gui/embedded/qwslock.cpp
        +@@ -83,9 +83,12 @@ QWSLock::QWSLock(int id) : semId(id)
        +     QWSSignalHandler::instance()->**__addWSLock(this);

        + #endif
        +
        ++    owned = false;
        ++
        + #ifndef QT_POSIX_IPC
        +     if (semId == -1) {
        +         semId = semget(IPC_PRIVATE, 3, IPC_CREAT | 0666);
        ++        owned = true;
        +         if (semId == -1) {
        +             perror("QWSLock::QWSLock");
        +             qFatal("Unable to create semaphore");
        +@@ -100,7 +103,6 @@ QWSLock::QWSLock(int id) : semId(id)
        +     }
        + #else
        +     sems[0] = sems[1] = sems[2] = SEM_FAILED;
        +-    owned = false;
        +
        +     if (semId == -1) {
        +         // ### generate really unique IDs
        +@@ -134,9 +136,12 @@ QWSLock::~QWSLock()
        +
        +     if (semId != -1) {
        + #ifndef QT_POSIX_IPC
        +-        qt_semun semval;
        +-        semval.val = 0;
        +-        semctl(semId, 0, IPC_RMID, semval);
        ++
        ++        if (owned) {
        ++            qt_semun semval;
        ++            semval.val = 0;
        ++            semctl(semId, 0, IPC_RMID, semval);
        ++        }
        +         semId = -1;
        + #else
        +         // emulate the SEM_UNDO behavior for the BackingStore
lock
        +diff --git a/src/gui/embedded/qwslock_p.h
        b/src/gui/embedded/qwslock_p.h
        +index ead7b89..d16b3d5 100644
        +--- a/src/gui/embedded/qwslock_p.h
        ++++ b/src/gui/embedded/qwslock_p.h
        +@@ -86,8 +86,8 @@ private:
        +     int lockCount[2];
        + #ifdef QT_POSIX_IPC
        +     sem_t *sems[3];
        +-    bool owned;
        + #endif
        ++    bool owned;
        + };
        +
        + QT_END_NAMESPACE
        +--
        +1.8.1.2
        +

    ______________________________**___________________
    Openembedded-core mailing list
    Openembedded-core@lists.__open**embedded.org<http://openembedded.org>
    <mailto:Openembedded-core@**lists.openembedded.org<[email protected]>
Quoted 1 line
    http://lists.openembedded.org/**__mailman/listinfo/**

openembedded-__core<http://lists.openembedded.org/__mailman/listinfo/openembedded-__core>
<http://lists.openembedded.**org/mailman/listinfo/**openembedded-core<http://lists.openembedded.org/mailman/listinfo/openembedded-core>

Quoted 1 line
#5 lore raw

Thanks Laszlo,

Quoted 5 lines · Laszlo Papp

Well, you should ask upstream about it... maybe it ended up in a decision it is the wrong way, and something better went in, or being planned to go in. I think a change should not be integrated like this in grey area.

I just posted to [email protected]. Is that the right place?

#6 lore raw

I replied in there.

Quoted 14 lines · Eric Nelson

Thanks Laszlo,

Quoted 6 lines · Laszlo Papp

Well, you should ask upstream about it... maybe it ended up in a decision it is the wrong way, and something better went in, or being planned to go in. I think a change should not be integrated like this in grey area.

I just posted to [email protected]. Is that the right place?