[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#433031: marked as done (qt4-x11: broken threading on alpha, hangs uselessly on startup)



Your message dated Wed, 18 Jul 2007 00:03:27 +0000
with message-id <E1IAx0p-0007vS-Kz@ries.debian.org>
and subject line Bug#433031: fixed in qt4-x11 4.3.0-4
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: qt4-x11
Version: 4.3.0-2
Severity: serious

qt4-x11 is completely broken on alpha right now; any qt4 apps hang
indefinitely on startup.  This can be seen in any recent build logs for
qt4-using packages.

- QMutex::lock() is called, which in turn calls
  QBasicAtomic::fetchAndAddAcquire(1).
- fetchAndAddAcquire() wraps an architecture-specific
  q_atomic_fetch_and_add_acquire_int() call.
- the alpha implementation of this call is broken: it returns 1 on success
  because the retval is (old != -1), which should always be true.
- as a result, fetchAndAddAcquire() returns true on alpha, but
  QMutex::lock() expects a successful call to return 0 rather than 1 and
  treats this as a failure.
- QMutex::lock() falls through to a pthread-based wait for the lock
  (pthread_cond_wait()), which never returns because there are no other
  threads anywhere to signal the current thread.

I believe that the attached patch fixes this problem; however, I am
including debian-alpha on X-Debbugs-Cc because I'm not confident I
understand the original reason for the (old != -1) check and would like some
additional eyeballs on it.  Applying this patch makes Qt apps work again for
me, but these are all simple single-thread applications, so getting the
locking semantics wrong would cause no problems here but would cause
significant (and hard-to-debug) problems later.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon@debian.org                                   http://www.debian.org/
diff -u qt4-x11-4.3.0/debian/changelog qt4-x11-4.3.0/debian/changelog
--- qt4-x11-4.3.0/debian/changelog
+++ qt4-x11-4.3.0/debian/changelog
@@ -1,3 +1,14 @@
+qt4-x11 (4.3.0-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix apparent cut-n-paste error in the newly added atomic APIs on alpha,
+    as the sign of the check seems to be the opposite of what it should be
+    and as a result all qt4 now hang indefinitely waiting for non-existent
+    other threads.
+  * Fix duplicate call to d->self().
+
+ -- Steve Langasek <vorlon@debian.org>  Fri, 13 Jul 2007 00:57:33 -0700
+
 qt4-x11 (4.3.0-2) unstable; urgency=low
 
   [Brian Nelson]
only in patch2:
unchanged:
--- qt4-x11-4.3.0.orig/src/corelib/arch/qatomic_alpha.h
+++ qt4-x11-4.3.0/src/corelib/arch/qatomic_alpha.h
@@ -208,7 +208,7 @@
                  : "=&r" (old), "=&r" (tmp), "+m"(*ptr)
                  : "r" (value)
                  : "memory");
-    return old != -1;
+    return old == -1;
 }
 
 inline int q_atomic_fetch_and_add_release_int(volatile int *ptr, int value)
@@ -226,7 +226,7 @@
                  : "=&r" (old), "=&r" (tmp), "+m"(*ptr)
                  : "r" (value)
                  : "memory");
-    return old != -1;
+    return old == -1;
 }
 
 #else // !Q_CC_GNU
only in patch2:
unchanged:
--- qt4-x11-4.3.0.orig/src/corelib/thread/qmutex.cpp
+++ qt4-x11-4.3.0/src/corelib/thread/qmutex.cpp
@@ -175,9 +175,6 @@
 void QMutex::lock()
 {
     ulong self = 0;
-#ifndef QT_NO_DEBUG
-    self = d->self();
-#endif
     if (d->recursive) {
         self = d->self();
         if (d->owner == self) {
@@ -186,6 +183,10 @@
             return;
         }
     }
+#ifndef QT_NO_DEBUG
+    else
+        self = d->self();
+#endif
     
     bool isLocked = d->contenders.fetchAndAddAcquire(1) == 0;
     if (!isLocked) {

--- End Message ---
--- Begin Message ---
Source: qt4-x11
Source-Version: 4.3.0-4

We believe that the bug you reported is fixed in the latest version of
qt4-x11, which is due to be installed in the Debian FTP archive:

libqt4-core_4.3.0-4_i386.deb
  to pool/main/q/qt4-x11/libqt4-core_4.3.0-4_i386.deb
libqt4-debug_4.3.0-4_i386.deb
  to pool/main/q/qt4-x11/libqt4-debug_4.3.0-4_i386.deb
libqt4-dev_4.3.0-4_i386.deb
  to pool/main/q/qt4-x11/libqt4-dev_4.3.0-4_i386.deb
libqt4-gui_4.3.0-4_i386.deb
  to pool/main/q/qt4-x11/libqt4-gui_4.3.0-4_i386.deb
libqt4-qt3support_4.3.0-4_i386.deb
  to pool/main/q/qt4-x11/libqt4-qt3support_4.3.0-4_i386.deb
libqt4-sql_4.3.0-4_i386.deb
  to pool/main/q/qt4-x11/libqt4-sql_4.3.0-4_i386.deb
qt4-designer_4.3.0-4_i386.deb
  to pool/main/q/qt4-x11/qt4-designer_4.3.0-4_i386.deb
qt4-dev-tools_4.3.0-4_i386.deb
  to pool/main/q/qt4-x11/qt4-dev-tools_4.3.0-4_i386.deb
qt4-doc_4.3.0-4_all.deb
  to pool/main/q/qt4-x11/qt4-doc_4.3.0-4_all.deb
qt4-qtconfig_4.3.0-4_i386.deb
  to pool/main/q/qt4-x11/qt4-qtconfig_4.3.0-4_i386.deb
qt4-x11_4.3.0-4.diff.gz
  to pool/main/q/qt4-x11/qt4-x11_4.3.0-4.diff.gz
qt4-x11_4.3.0-4.dsc
  to pool/main/q/qt4-x11/qt4-x11_4.3.0-4.dsc



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 433031@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Fathi Boudra <fboudra@free.fr> (supplier of updated qt4-x11 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 16 Jul 2007 21:32:01 +0200
Source: qt4-x11
Binary: libqt4-sql libqt4-core qt4-doc libqt4-debug libqt4-qt3support qt4-designer libqt4-dev qt4-dev-tools libqt4-gui qt4-qtconfig
Architecture: source i386 all
Version: 4.3.0-4
Distribution: unstable
Urgency: low
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Changed-By: Fathi Boudra <fboudra@free.fr>
Description: 
 libqt4-core - Qt 4 core non-GUI functionality runtime library
 libqt4-debug - Qt 4 library debugging symbols
 libqt4-dev - Qt 4 development files
 libqt4-gui - Qt 4 core GUI functionality runtime library
 libqt4-qt3support - Qt 3 compatibility library for Qt 4
 libqt4-sql - Qt 4 SQL database module
 qt4-designer - Qt 4 Designer
 qt4-dev-tools - Qt 4 development tools
 qt4-doc    - Qt 4 API documentation
 qt4-qtconfig - Qt 4 configuration tool
Closes: 433031 433548
Changes: 
 qt4-x11 (4.3.0-4) unstable; urgency=low
 .
   [Fathi Boudra]
   * Add 42_alpha_fetch_and_add patch to fix broken threading on alpha, hangs
     uselessly on startup. fetch-and-add is supposed to return the original
     value before the addition. Thanks to Steve Langasek and Bradley Hughes.
     (Closes: #433031)
   * Update control: Replace ${source:Version} by ${binary:Version}.
     Make the package binNMU safe. Thanks to Lior Kaplan. (Closes: #433548)
Files: 
 07cd7d67e82fd88f1abc861d856b4f73 1535 libs optional qt4-x11_4.3.0-4.dsc
 6839ecf702c0d24176417364553bfbbb 43718 libs optional qt4-x11_4.3.0-4.diff.gz
 eadf4e2faae66761139a0f8abbabd744 24185700 doc optional qt4-doc_4.3.0-4_all.deb
 5fc9a39baa70d6b3c3cd56d53ca7660d 4380856 libdevel optional libqt4-dev_4.3.0-4_i386.deb
 76f8616ee06475e185d471626a4e0558 1673622 libs optional libqt4-core_4.3.0-4_i386.deb
 18931533dd67a9a99201bf9c8083d44b 4889832 libs optional libqt4-gui_4.3.0-4_i386.deb
 58be971b638a52d8b6ea90b0cf160de4 156912 libs optional libqt4-sql_4.3.0-4_i386.deb
 2a40d1248c84b9e9d8a2a118a244a141 1037732 libs optional libqt4-qt3support_4.3.0-4_i386.deb
 d2e939f2d4ec57634d59abefd64cf49e 588666 devel optional qt4-designer_4.3.0-4_i386.deb
 fff57d24bb2e5cb8968336885bead2a9 78533086 libs optional libqt4-debug_4.3.0-4_i386.deb
 b5ff29fc60dcc64c25141ace900f4a39 715410 devel optional qt4-dev-tools_4.3.0-4_i386.deb
 edbb5b11aa5c9f32e27732b8d56b5db1 112286 x11 optional qt4-qtconfig_4.3.0-4_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Signed by Ana Guerrero

iD8DBQFGnUOen3j4POjENGERAqIXAJkBzwMjuUTil71fDA7U7nzs8kUuCQCdHuZz
BYSiuc0kdiu9WPk6m2wxfdQ=
=J8vH
-----END PGP SIGNATURE-----


--- End Message ---

Reply to: