Bug 1193044 - Qt linked with gold crash on startup
Summary: Qt linked with gold crash on startup
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-16 13:02 UTC by Rex Dieter
Modified: 2015-12-06 14:56 UTC (History)
10 users (show)

Fixed In Version: 2.25-13.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-27 17:57:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 65057 0 None None None Never
Sourceware 16992 0 None None None Never

Description Rex Dieter 2015-02-16 13:02:02 UTC
Joy, I think now I've even hit a gcc bug?

Program received signal SIGSEGV, Segmentation fault.
(gdb) bt
#0  0x00007ffff69120ce in QMetaObject::activate(QObject*, int, int, void**) (sender=0x0, signalOffset=8, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffd560) at kernel/qobject.cpp:3592
#1  0x00007ffff6913067 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7ffff703c280 <QGuiApplication::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffd560) at kernel/qobject.cpp:3582
#2  0x00007ffff6bfa8e2 in QGuiApplication::screenAdded(QScreen*) (this=<optimized out>, _t1=0x66caf0) at .moc/moc_qguiapplication.cpp:321

==> See below, "this" is actually 0x0 here

#3  0x00007ffff6bf15c5 in QPlatformIntegration::screenAdded(QPlatformScreen*, bool) (this=<optimized out>, ps=ps@entry=0x66cb10, isPrimary=isPrimary@entry=true) at kernel/qplatformintegration.cpp:447
[...]
#13 0x00007ffff68e6f6f in QCoreApplication::init() (this=this@entry=0x650450) at kernel/qcoreapplication.cpp:726

==> QCoreApplication::self has already been set at this point (QCoreApplication::self = this;)

#14 0x00007ffff71aba87 in QApplication::QApplication(int&, char**, int) (this=0x650450, argc=@0x7fffffffdc3c: 1, argv=0x7fffffffde28, _internal=328704)
    at kernel/qapplication.cpp:565
[...]



(gdb) break qplatformintegration.cpp:447
Breakpoint 1, QPlatformIntegration::screenAdded (this=<optimized out>, ps=ps@entry=0x66cb10, isPrimary=isPrimary@entry=true)
[...]
447         emit qGuiApp->screenAdded(screen);
(gdb) s
QGuiApplication::screenAdded (this=0x0, _t1=0x66caf0) at .moc/moc_qguiapplication.cpp:319
(gdb) print QGuiApplication::self
$4 = (QCoreApplication *) 0x650450

qGuiApp is
#define qGuiApp (static_cast<QGuiApplication *>(QCoreApplication::instance()))
with QCoreApplication::instance() returning QGuiApplication::self


==> So "emit qGuiApp->screenAdded(screen);" results in screenAdded being called on a NULL QGuiApplication, but at the same time QGuiApplication::self should be perfectly okay.

--- Additional comment from Sandro Mani on 2015-02-13 11:34:25 EST ---



--- Additional comment from Sandro Mani on 2015-02-16 05:40:38 EST ---

Concerning comment 19: as posted on -devel, this is indeed a GCC bug (specifically, with the gold linker). Workaround is to build qt5 passing -no-use-gold-linker to configure. Filed as [1], but turns out it was a known issue where not much is being done about it.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65057

Comment 1 Rex Dieter 2015-02-16 13:07:58 UTC
See upstream bug
https://sourceware.org/bugzilla/show_bug.cgi?id=16992

We can workaround this by not using gold in Qt builds (on f22+) until it is fixed

Comment 2 Rex Dieter 2015-02-16 13:08:38 UTC
(fyi, initial comments were copied from bug #1083664)

Comment 3 Rex Dieter 2015-02-17 15:32:32 UTC
(hopefully) temporary workaround in qt5-qtbase builds:

%changelog
* Mon Feb 16 2015 Rex Dieter <rdieter> 5.4.0-13
- -no-use-gold-linker (f22+, #1193044)

Comment 4 Rex Dieter 2015-02-27 14:15:33 UTC
removing as blocker while I we have a workaround.

Looks like there is an upstream fix available, could you consider backporting the fix into fedora's packaging?

Comment 5 Daniel Vrátil 2015-02-27 16:07:36 UTC
Looks like upstream fix is available now: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e9c1bdad269c0c3352eebcc9481ed65144001b0b

Comment 6 Rex Dieter 2015-07-18 15:43:53 UTC
Ping, any reason(s) not to use the upstream patch?

I'd be happy to help apply it to fedora's packaging if there are no objections.

Comment 7 Nick Clifton 2015-07-24 10:53:32 UTC
Hi Rex,

> Ping, any reason(s) not to use the upstream patch?
> 
> I'd be happy to help apply it to fedora's packaging if there are no
> objections.

None from me.  Please go ahead.

Cheers
  Nick

Comment 8 Rex Dieter 2015-08-06 15:39:24 UTC
It would appear that f22 and subsequent branches (f23/master) are tracking different versions currently:
f22 2.25
f23+ 2.25.1

I'll make the change to master, probably merge back to f23.

How would you prefer to handle f22?  merge (and upgrade 2.25 -> 2.25.1) or cherry-pick?

Comment 9 Nick Clifton 2015-08-24 14:19:18 UTC
Hi Rex,

  Cherry pick please.  Upgrading to 2.25, whilst a nice idea, is likely to introduce more problems than it fixes.

Cheers
  Nick

Comment 10 Fedora Update System 2015-08-25 13:01:19 UTC
binutils-2.25-13.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14227

Comment 11 Fedora Update System 2015-08-26 04:25:18 UTC
binutils-2.25-13.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update binutils'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14227

Comment 12 Fedora Update System 2015-08-27 17:57:09 UTC
binutils-2.25-13.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Rex Dieter 2015-12-06 14:56:07 UTC
fyi, matching f22 update for posterity,

https://bodhi.fedoraproject.org/updates/FEDORA-2015-14243


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