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

Re: kde4libs vs qt4



Hi Sune,

attached is the latest draft of my patch against qt4-X11.

It successfully ran both of the tests you mentioned (although I had to replace the "load(qttest_p4)" by "CONFIG += qtestlib"):
http://chaos.troll.no/~bhughes/qatomicint/
http://chaos.troll.no/~bhughes/qatomicpointer/

Although everything seems good so far, I still ran into a problem where I might need your help. Maybe you have seen it already or have an idea?

The problem is, that during dpkg-buildpackage the build just stops.
Here is the log:
...
dh_installdirs -plibqtcore4
/mnt/sdb4/cvs/qt4-3/qt4-x11-4.4.0/bin/lrelease-qt4 debian/translations/qt_ca.ts \ -qm /mnt/sdb4/cvs/qt4-3/qt4-x11-4.4.0/debian/tmp//usr/share/qt4/translations/qt_ca.qm Updating '/mnt/sdb4/cvs/qt4-3/qt4-x11-4.4.0/debian/tmp//usr/share/qt4/translations/qt_ca.qm'...


The build hangs when running this program:
/mnt/sdb4/cvs/qt4-3/qt4-x11-4.4.0/bin/lrelease-qt4 debian/translations/qt_ca.ts -qm /mnt/sdb4/cvs/qt4-3/qt4-x1
1-4.4.0/debian/tmp//usr/share/qt4/translations/qt_ca.qm


I then attached to it with gdb and got this backtrace:

#0 0x40625d0c in q_atomic_lock (lock=0x5d300) at arch/parisc/qatomic_parisc.cpp:97
#1  0x407cf8d4 in QEventDispatcherGlib::wakeUp (this=<value optimized out>)
at ../../include/QtCore/../../src/corelib/arch/qatomic_parisc.h:115
#2 0x4078b954 in QCoreApplication::postEvent (receiver=0x781e0, event=0x5f140, priority=0)
at kernel/qcoreapplication.cpp:1020
#3 0x40797e84 in QMetaObject::invokeMethod (obj=0x781e0, member=<value optimized out>, type=Qt::QueuedConnect
ion, ret=
{<QGenericArgument> = {_data = 0x0, _name = 0x0}, <No data fields>}, val0={_data = 0x0, _name = 0x0}, val1= {_data = 0x0, _name = 0x0}, val2={_data = 0x0, _name = 0x0}, val3={_data = 0x0, _name = 0x0}, val4= {_data = 0x0, _name = 0x0}, val5={_data = 0x0, _name = 0x0}, val6={_data = 0x0, _name = 0x0}, val7= {_data = 0x0, _name = 0x0}, val8={_data = 0x0, _name = 0x0}, val9={_data = 0x0, _name = 0x0})
              at kernel/qmetaobject.cpp:1009
#4 0x406d18fc in QBuffer::writeData (this=0x5d300, data=0xfb676a58 "\003gj\b", len=1)
at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs.h:371
#5 0x406f3be8 in QIODevice::write (this=0x781e0, data=0xfb676a58 "\003gj\b", maxSize=1) at io/qiodevice.cpp:1
265
#6 0x406f3fbc in QIODevicePrivate::putCharHelper (this=<value optimized out>, c=3 '\003') at io/qiodevice.cpp
:1327
#7 0x406f0514 in QIODevice::putChar (this=<value optimized out>, c=0 '\0') at io/qiodevice.cpp:1319 #8 0x406d2db8 in QDataStream::operator<< (this=0xfb676804, i=0 '\0') at io/qdatastream.cpp:912 #9 0x000272ec in TranslatorMessage::write (this=0x72e30, stream=@0xfb676804, strip=false, prefix=TranslatorMe
ssage::Hash)
at ../../../include/QtCore/../../src/corelib/io/qdatastream.h:219
#10 0x00028c7c in Translator::squeeze (this=0xfb6765e4, mode=Translator::Everything) at ../shared/translator.c
pp:240
#11 0x000294d4 in Translator::save (this=0x5d300, iod=0xfb6764cc, mode=Translator::Everything)
  at ../shared/translator.cpp:165
#12 0x00021238 in MetaTranslator::release (this=0xfb676324, iod=0xfb6764cc, verbose=false, ignoreUnfinished=
false,
      mode=Translator::Everything) at ../shared/metatranslator.cpp:601

So, it's hanging in my new parisc-specific function "q_atomic_lock()", and I found, that the lock was in "Locked" state.

My question are:
- Have you seen something similar before? Does another platform maybe had similar problems?

- HPPA/PARISC is specific, which means, that locks are locked when the lock-variable is zero, while they are unlocked when it's "-1" (or non-zero). For me it seems that this specific lock (I don't even know yet which one) has not been initially initialized with "-1" and as such the lock starts in locked-state, which is why the build then hangs from the beginning.

Any ideas?

Best regards,
Helge
diff -up ./debian/patches/series.org ./debian/patches/series
--- ./debian/patches/series.org	2008-06-14 16:54:47.000000000 +0200
+++ ./debian/patches/series	2008-06-14 16:55:47.000000000 +0200
@@ -33,7 +33,8 @@
 41_disable_opengl_visibility.diff
 50_kfreebsd_build_fix.diff
 60_m68k_inotify_fix.diff
-70_hppa_ldcw_fix.diff
+#70_hppa_ldcw_fix.diff
+70_hppa_ldcw_fix_2.diff
 71_hppa_unaligned_access_fix_458133.diff
 72_generic_arch_atomic_header_fix.diff
 73_from4.4.1_no_AAAA_when_ipv6_disabled.diff
diff -up ./debian/patches/07_trust_dpkg-arch_over_uname-m.diff.org ./debian/patches/07_trust_dpkg-arch_over_uname-m.diff
--- ./debian/patches/07_trust_dpkg-arch_over_uname-m.diff.org	2008-06-14 17:19:35.000000000 +0200
+++ ./debian/patches/07_trust_dpkg-arch_over_uname-m.diff	2008-06-14 17:21:22.000000000 +0200
@@ -54,3 +54,16 @@ Reported to trolltech as N180631 - and t
  UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
  UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+@@ -2385,6 +2385,12 @@ if [ -z "${HOST_ARCH}" ]; then
+         fi
+         HOST_ARCH=sparc
+         ;;
++    Linux:*:parisc*)
++        if [ "$OPT_VERBOSE" = "yes" ]; then
++            echo "    Linux on HPPA (HP-PARISC)"
++        fi
++        HOST_ARCH=parisc
++        ;;
+     *:*:*)
+         if [ "$OPT_VERBOSE" = "yes" ]; then
+             echo "    Trying '$UNAME_MACHINE'..."
diff -up ./debian/patches/70_hppa_ldcw_fix_2.diff.org ./debian/patches/70_hppa_ldcw_fix_2.diff
--- ./debian/patches/70_hppa_ldcw_fix_2.diff.org	2008-06-14 17:27:09.000000000 +0200
+++ ./debian/patches/70_hppa_ldcw_fix_2.diff	2008-06-14 17:27:03.000000000 +0200
@@ -0,0 +1,46 @@
+diff -up ./src/corelib/arch/parisc/arch.pri.org ./src/corelib/arch/parisc/arch.pri
+--- ./src/corelib/arch/parisc/arch.pri.org	2008-06-14 16:55:10.000000000 +0200
++++ ./src/corelib/arch/parisc/arch.pri	2008-06-14 17:00:15.000000000 +0200
+@@ -1,5 +1,6 @@
+ #
+ # HP PA-RISC architecture
+ #
+-SOURCES += $$QT_ARCH_CPP/q_ldcw.s \
+-	   $$QT_ARCH_CPP/qatomic_parisc.cpp
++hpux*:	   SOURCES += $$QT_ARCH_CPP/q_ldcw.s
++
++SOURCES += $$QT_ARCH_CPP/qatomic_parisc.cpp
+diff -up ./src/corelib/arch/parisc/qatomic_parisc.cpp.org ./src/corelib/arch/parisc/qatomic_parisc.cpp
+--- ./src/corelib/arch/parisc/qatomic_parisc.cpp.org	2008-06-14 16:55:23.000000000 +0200
++++ ./src/corelib/arch/parisc/qatomic_parisc.cpp	2008-06-14 16:57:03.000000000 +0200
+@@ -72,14 +72,29 @@ static int *align16(int *lock)
+ 
+ extern "C" {
+ 
++#if defined(Q_OS_LINUX)
++    #if defined(__LP64__)
++	#define __LDCW  "ldcw,co"
++    #else
++	#define __LDCW  "ldcw"
++    #endif
++    #define q_ldcw(addr) ({					\
++	unsigned __ret;						\
++	__asm__ __volatile__(__LDCW " 0(%2),%0"			\
++				: "=r" (__ret), "=m" (*(addr))	\
++				: "r" (addr), "m" (*(addr)) );	\
++	__ret;							\
++	})
++#else /* for HP/UX */
+     int q_ldcw(volatile int *addr);
++#endif
+ 
+     void q_atomic_lock(int *lock)
+     {
+         // ldcw requires a 16-byte aligned address
+         volatile int *x = align16(lock);
+         while (q_ldcw(x) == 0)
+-	    ;
++	    while (*x == 0) ;
+     }
+ 
+     void q_atomic_unlock(int *lock)

Reply to: