Bug 246324 - qt4: segfaults on ppc64
qt4: segfaults on ppc64
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: qt4 (Show other bugs)
7
ppc64 Linux
medium Severity medium
: ---
: ---
Assigned To: Rex Dieter
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: FE-ExcludeArch-ppc64/F-ExcludeArch-ppc64 247152
  Show dependency treegraph
 
Reported: 2007-06-30 05:19 EDT by Enrico Scholz
Modified: 2007-11-30 17:12 EST (History)
5 users (show)

See Also:
Fixed In Version: 4.3.2-1.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-15 17:30:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
proposed patch based on comment #5 (527 bytes, patch)
2007-08-23 04:50 EDT, markusr815
no flags Details | Diff

  None (edit)
Description Enrico Scholz 2007-06-30 05:19:31 EDT
Description of problem:

Compiling xca on ppc64 fails with

| make[1]: Entering directory `/builddir/build/BUILD/xca-0.6.3/lang'
| /usr/lib64/qt4/bin/lrelease xca_de.ts -qm xca_de.qm
| /usr/lib64/qt4/bin/lrelease xca_es.ts -qm xca_es.qm
| make[1]: *** [xca_de.qm] Segmentation fault
| make[1]: *** Waiting for unfinished jobs....
| make[1]: *** [xca_es.qm] Segmentation fault
  [see http://koji.fedoraproject.org/koji/getfile?taskID=52767&name=build.log]

Works fine i386, x86_64 and ppc.


Version-Release number of selected component (if applicable):

4.3.0-2.fc7


How reproducible:

100%
Comment 1 Rex Dieter 2007-08-22 11:57:41 EDT
It's worse than that, testing on ppc64/rawhide (thanks dwmw!), pretty much any
qt4-related binary segfaults (immediately), it's easier to list those that do
*not* seg fault: qmake, moc, rcc, uic

ugh.
Comment 2 Rex Dieter 2007-08-22 12:23:33 EDT
Looks like we'll have to ExcluceArch this for now, it's fundamentally broken,
and I can't find anything simple or obvious that's wrong.
Comment 3 Rex Dieter 2007-08-22 12:54:48 EDT
Glad to know we're not the only ones seeing this:
http://bugs.gentoo.org/show_bug.cgi?id=178779
:)
Comment 4 Rex Dieter 2007-08-22 13:37:39 EDT
Reported issue upstream to Trolltech, will supply reference details when/if I
get a reply.
Comment 5 Hans de Goede 2007-08-22 14:44:02 EDT
I think I might have found the issue, __might__

In /usr/include/Qt[Core]/qatomic_powerpc.h

There is the following code:

#ifdef __64BIT__
#  define LPARX "ldarx"
#  define CMPP  "cmpd"
#  define STPCX "stdcx."
#else
#  define LPARX "lwarx"  
#  define CMPP  "cmpw"
#  define STPCX "stwcx."   
#endif

However __64BIT__ doesn't get defined in any QT header, and is not a standard
gcc define, compiling this on my x86_64:

#include <stdio.h>

int main(void)
{
#ifdef __64BIT__
    printf("64 bit\n");
#else
    printf("32 bit\n");
#endif
    return 0;
}

Results in an output of "32 bit", changing the "#ifdef __64BIT__ to
"#ifdef __powerpc64__" thus would be a very good idea and _might_ fix the issues
you are seeing.
Comment 6 Hans de Goede 2007-08-22 14:46:24 EDT
I forgot, you might want to check for __64BIT__ in the sources too, I only
checked the headers to see if there was something fishy there and found this.
Comment 7 markusr815 2007-08-23 04:50:50 EDT
Created attachment 168244 [details]
proposed patch based on comment #5

Hello,

I'm the Gentoo developer, who has opened the bug mentioned in comment #3 and I
have just finished compiling qt 4.3.1 with the attached patch, which is based
on the findings in comment #5.

as you can see qt does now run on my ppc64 machine:
http://www.unixforces.net/~markus/screenshots/screenshot-2007-08-23.png

I've been in contact with upstream and they've opened this public bug on their
tracker:

http://trolltech.com/developer/task-tracker/index_html?id=133870&method=entry

unfortunately there is neither much information nor a way to submit patches in
their tracker, so I'll email it directly to the developer I've been in contact
with (all credits to Hans de Goede of cause ;-) ).

Regards,

-markus

P.S.: I feel dumb not having this fixed months ago ;-)
Comment 8 Hans de Goede 2007-08-23 05:30:31 EDT
(In reply to comment #7)
> Created an attachment (id=168244) [edit]
> proposed patch based on comment #5
> 
> Hello,
> 
> I'm the Gentoo developer, who has opened the bug mentioned in comment #3 and I
> have just finished compiling qt 4.3.1 with the attached patch, which is based
> on the findings in comment #5.
> 
> as you can see qt does now run on my ppc64 machine:
> http://www.unixforces.net/~markus/screenshots/screenshot-2007-08-23.png
> 

Wow, so you mean my little "instinctive" grep through the headers found the bug :)

Glad to hear that, I guess thats experience with lots of ppc 64 compile errors
paying off. Since Fedora is building for powerpc64 I've had many of my packages
failing, because often they don't check for __powerpc64__ but only for
__powerpc__ and __x86_64__. So I though that qt would probably have something
like a config.h with some arch specific defines and that I should compare the
x86_64, ppc and ppc64 versions of that file, so I started grepping through the
includes as shipped on ppc64 and thats how I found this.

Anyways I'm glad to hear that my little investment of time has actually resulted
in a fix for this.
Comment 9 Rex Dieter 2007-08-23 08:00:37 EDT
I opted for this instead:
-#ifdef __64BIT__
+#if defined(__64BIT__) || defined(__powerpc64__)
there may be some reason Trolltech wanted the check for __64BIT__ in there (some
other platform(s)?
Comment 10 Rex Dieter 2007-08-23 08:01:51 EDT
Oh, and many thanks Markus!
Comment 11 markusr815 2007-08-23 09:09:48 EDT
(In reply to comment #8)
> Wow, so you mean my little "instinctive" grep through the headers found the bug :)

I wish I had your instinct :-)

(In reply to comment #9)
> I opted for this instead:
> -#ifdef __64BIT__
> +#if defined(__64BIT__) || defined(__powerpc64__)
> there may be some reason Trolltech wanted the check for __64BIT__ in there (some
> other platform(s)?

I'll let upstream decide that. But as there are _no_ other references for __64BIT__ I would think it's save 
to nuke that.
Comment 12 Rex Dieter 2007-08-23 10:34:23 EDT
After reporting upstream, and told this would be assigned issue #176132, it
seems not to be available (yet), on
http://trolltech.com/developer/task-tracker

but I *did* find an old, pretty much identical report:
http://trolltech.com/developer/task-tracker/index_html?method=entry&id=133870
Comment 13 Fedora Update System 2007-08-24 01:45:32 EDT
qt4-4.3.1-3.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 14 Douglas E. Warner 2007-09-27 15:40:42 EDT
Has this update been pushed into rawhide?  I'm still having problems building 
qgis on ppc64:

http://koji.fedoraproject.org/koji/getfile?taskID=177033

[ 96%] /usr/bin/cmake -E 
cmake_progress_report /builddir/build/BUILD/qgis-0.9.0/CMakeFiles 
[ 96%] [ 96%] [ 96%] Generating qgis_pt_BR.qm
cd /builddir/build/BUILD/qgis-0.9.0/i18n 
&& /usr/lib64/qt4/bin/lrelease -verbose /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_pt_BR.ts -qm /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_pt_BR.qm
Generating qgis_vi.qm
cd /builddir/build/BUILD/qgis-0.9.0/i18n 
&& /usr/lib64/qt4/bin/lrelease -verbose /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_vi.ts -qm /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_vi.qm
Generating qgis_sk.qm
cd /builddir/build/BUILD/qgis-0.9.0/i18n 
&& /usr/lib64/qt4/bin/lrelease -verbose /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_sk.ts -qm /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_sk.qm
Generating qgis_it.qm
cd /builddir/build/BUILD/qgis-0.9.0/i18n 
&& /usr/lib64/qt4/bin/lrelease -verbose /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_it.ts -qm /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_it.qm
/bin/sh: line 1: 19609 Segmentation 
fault      /usr/lib64/qt4/bin/lrelease -verbose /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_pt_BR.ts -qm /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_pt_BR.qm
make[2]: *** [i18n/qgis_pt_BR.qm] Error 139
make[2]: *** Waiting for unfinished jobs....
/bin/sh: line 1: 19611 Segmentation 
fault      /usr/lib64/qt4/bin/lrelease -verbose /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_vi.ts -qm /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_vi.qm
make[2]: *** [i18n/qgis_vi.qm] Error 139
/bin/sh: line 1: 19613 Segmentation 
fault      /usr/lib64/qt4/bin/lrelease -verbose /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_sk.ts -qm /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_sk.qm
make[2]: *** [i18n/qgis_sk.qm] Error 139
/bin/sh: line 1: 19615 Segmentation 
fault      /usr/lib64/qt4/bin/lrelease -verbose /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_it.ts -qm /builddir/build/BUILD/qgis-0.9.0/i18n/qgis_it.qm
make[2]: *** [i18n/qgis_it.qm] Error 139
make[2]: Leaving directory `/builddir/build/BUILD/qgis-0.9.0'
make[1]: *** [i18n/CMakeFiles/translations.dir/all] Error 2
make[1]: Leaving directory `/builddir/build/BUILD/qgis-0.9.0'
make: *** [all] Error 2
Comment 15 Rex Dieter 2007-09-27 15:46:54 EDT
Yes, since 4.3.1-3, and updated for s390x in 4.3.1-4, changelog:

* Thu Sep 13 2007 Than Ngo <than@redhat.com> -  4.3.1-4
...
- fixed bz249242, designer4 - segmentation fault on s390x

* Wed Aug 23 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 4.3.1-3
- ppc64 patch (#246324)

Can't access koji atm.

Is the failure repeatable?  (I've seen a build fail, then resubmit, and then it
works... ??)
Comment 16 Douglas E. Warner 2007-09-27 15:54:47 EDT
(In reply to comment #15)
> Is the failure repeatable?  (I've seen a build fail, then resubmit, and then 
it
> works... ??)

I'll resubmit the build and report the results.
Comment 17 Douglas E. Warner 2007-09-27 17:07:08 EDT
Same build error again:
http://koji.fedoraproject.org/koji/taskinfo?taskID=177088
Comment 18 Rex Dieter 2007-10-04 11:21:55 EDT
Arg, recent qt4 (rawhide) builds inadvertantly omitted the ppc64/64bit patch,
spinning qt4-4.3.2 now with this fix is upstreamed.
Comment 19 Rex Dieter 2007-10-04 13:08:33 EDT
* Thu Oct 04 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 4.3.2-1
- qt-4.3.2
- (re)fix ppc64 segfaults, ppc64 fix upstreamed (previous patch was
  inadvertantly not applied) (#246324)
Comment 20 Fedora Update System 2007-10-08 10:57:57 EDT
qt4-4.3.2-1.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update qt4'
Comment 21 Fedora Update System 2007-10-15 17:30:18 EDT
qt4-4.3.2-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.