Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 518262

Summary: [qt overlay] dev-qt/qtcore:5 sessionmanager support is unconditionally disabled
Product: Gentoo Linux Reporter: Michael Palimaka (kensington) <kensington>
Component: [OLD] DevelopmentAssignee: Qt Bug Alias <qt>
Status: RESOLVED FIXED    
Severity: critical CC: franz.trischberger, josef64, lil_tux, mschiff, nforce25, uwelk
Priority: Highest    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 454132    
Attachments: /usr/include/qt5/QtCore/qconfig.h
/usr/include/qt5/Gentoo/gentoo-qconfig.h

Description Michael Palimaka (kensington) gentoo-dev 2014-07-26 17:04:42 UTC
Since the configure changes, qtcore is passed -no-sm unconditionally by the eclass. This breaks build of kde-frameworks/kconfig because it detects QT_NO_SESSIONMANAGER.
Comment 1 Davide Pesavento gentoo-dev 2014-07-27 01:43:56 UTC
Fixed in commit 0dcd1c34ef0b6a8c39675716491434efbcfc0bac

Note that qtbase unconditionally disables X11 session management because it doesn't use it; qtgui[xcb] should enable it.
Comment 2 Franz Trischberger 2014-07-27 07:40:58 UTC
I emerged qtgui and now many Qt5-apps just crash:
qpdfview, for example:
#0  0x00007ffff70675d8 in QWidget::show() () from /usr/lib64/libQt5Widgets.so.5
#1  0x00007ffff712bfcb in QDockWidgetLayout::setWidgetForRole(QDockWidgetLayout::Role, QWidget*) ()
   from /usr/lib64/libQt5Widgets.so.5
#2  0x00007ffff712c1c9 in QDockWidgetPrivate::init() () from /usr/lib64/libQt5Widgets.so.5
#3  0x00007ffff712c520 in QDockWidget::QDockWidget(QString const&, QWidget*, QFlags<Qt::WindowType>) ()
   from /usr/lib64/libQt5Widgets.so.5
#4  0x000000000045d215 in qpdfview::MainWindow::createDock (this=this@entry=0x7177c0, text=..., objectName=..., 
    toggleViewShortcut=...) at sources/mainwindow.cpp:2204
#5  0x000000000045d421 in qpdfview::MainWindow::createDocks (this=this@entry=0x7177c0) at sources/mainwindow.cpp:2224
#6  0x00000000004651f7 in qpdfview::MainWindow::MainWindow (this=0x7177c0, parent=<optimized out>)
    at sources/mainwindow.cpp:146
#7  0x000000000041fa7f in activateUniqueInstance () at sources/main.cpp:422
#8  main (argc=1, argv=<optimized out>) at sources/main.cpp:476

Or TEA-editor (compiled manually):
#0  0x00007ffff6610c16 in QAccessible::isActive() () from /usr/lib64/libQt5Gui.so.5
#1  0x00007ffff6ef5e66 in QTabBar::setCurrentIndex(int) () from /usr/lib64/libQt5Widgets.so.5
#2  0x00007ffff6efaee4 in QTabBar::insertTab(int, QIcon const&, QString const&) () from /usr/lib64/libQt5Widgets.so.5
#3  0x00007ffff6efe9fe in QTabWidget::insertTab(int, QWidget*, QIcon const&, QString const&) ()
   from /usr/lib64/libQt5Widgets.so.5
#4  0x00007ffff6efea84 in QTabWidget::insertTab(int, QWidget*, QString const&) () from /usr/lib64/libQt5Widgets.so.5
#5  0x000000000041f5d0 in rvln::create_main_widget() ()
#6  0x00000000004585d4 in rvln::rvln() ()
#7  0x000000000041e0ac in main ()

Even after reinstalling all deps one after the other...
Comment 3 Franz Trischberger 2014-07-27 14:28:45 UTC
Seems to be related to QT5_CONFIG rework.
git reset --hard  48f6e4a && emerge -1 --nodeps qtcore qtgui qtwidgets
and tea-editor does not crash anymore
git pull && emerge -1 --nodeps qtcore qtgui qtwidgets
and tea-editor crashes, even after rebuilding.

Probably something went wrong while fixing #510556?
(going to enable -ggdb again - how is #490254 going?)
Comment 4 Davide Pesavento gentoo-dev 2014-07-27 14:34:32 UTC
(In reply to Franz Fellner from comment #2)

Franz, please sync the overlay and try again. Rebuilding qtwidgets should be enough. I hope at least the qpdfview crash is fixed.
Comment 5 Franz Trischberger 2014-07-27 15:52:39 UTC
#0  0x00007ffff612008e in release (id=<optimized out>, this=<optimized out>)
    at ../../include/QtCore/5.3.1/QtCore/private/../../../../../src/corelib/tools/qfreelist_p.h:276
#1  QAbstractEventDispatcherPrivate::releaseTimerId (timerId=10261536) at kernel/qabstracteventdispatcher.cpp:103
#2  0x00007ffff61208e3 in QBasicTimer::start (this=this@entry=0x6bf238, msec=700, obj=obj@entry=0x7fffffffd810)
    at kernel/qbasictimer.cpp:127
#3  0x00007ffff7028089 in QApplication::notify (this=0x7fffffffd810, receiver=0x76f510, e=0x7fffffffcb50)
    at kernel/qapplication.cpp:3058
#4  0x00007ffff612318d in QCoreApplication::notifyInternal (this=0x7fffffffd810, receiver=receiver@entry=0x76f510, 
    event=event@entry=0x7fffffffcb50) at kernel/qcoreapplication.cpp:935
#5  0x00007ffff7026471 in sendSpontaneousEvent (event=0x7fffffffcb50, receiver=0x76f510)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:240
#6  QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x76f510, event=event@entry=0x7fffffffcb50, 
    alienWidget=alienWidget@entry=0x76f510, nativeWidget=0x782910, 
    buttonDown=buttonDown@entry=0x7ffff76e4330 <qt_button_down>, lastMouseReceiver=..., 
    spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:2562
#7  0x00007ffff707ad07 in QWidgetWindow::handleMouseEvent (this=this@entry=0x89f390, event=event@entry=0x7fffffffcfa0)
    at kernel/qwidgetwindow.cpp:507
#8  0x00007ffff707ce7b in QWidgetWindow::event (this=0x89f390, event=0x7fffffffcfa0) at kernel/qwidgetwindow.cpp:179
#9  0x00007ffff702256c in QApplicationPrivate::notify_helper (this=this@entry=0x6bf130, 
    receiver=receiver@entry=0x89f390, e=e@entry=0x7fffffffcfa0) at kernel/qapplication.cpp:3522
#10 0x00007ffff7027570 in QApplication::notify (this=0x7fffffffd810, receiver=0x89f390, e=0x7fffffffcfa0)
    at kernel/qapplication.cpp:3305
#11 0x00007ffff612318d in QCoreApplication::notifyInternal (this=0x7fffffffd810, receiver=receiver@entry=0x89f390, 
    event=event@entry=0x7fffffffcfa0) at kernel/qcoreapplication.cpp:935
#12 0x00007ffff66467cc in sendSpontaneousEvent (event=0x7fffffffcfa0, receiver=0x89f390)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:240
#13 QGuiApplicationPrivate::processMouseEvent (e=0x99cda0) at kernel/qguiapplication.cpp:1715
#14 0x00007ffff6647df5 in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0x99cda0)
    at kernel/qguiapplication.cpp:1516
#15 0x00007ffff662e488 in QWindowSystemInterface::sendWindowSystemEvents (flags=...)
    at kernel/qwindowsysteminterface.cpp:579
#16 0x00007fffeef7b860 in userEventSourceDispatch (source=<optimized out>)
    at eventdispatchers/qeventdispatcher_glib.cpp:78
#17 0x00007ffff32a1984 in g_main_dispatch (context=0x7fffe4001e00)
    at /var/tmp/portage/dev-libs/glib-2.40.0-r1/work/glib-2.40.0/glib/gmain.c:3064
#18 g_main_context_dispatch (context=context@entry=0x7fffe4001e00)
    at /var/tmp/portage/dev-libs/glib-2.40.0-r1/work/glib-2.40.0/glib/gmain.c:3663
#19 0x00007ffff32a1bc8 in g_main_context_iterate (context=context@entry=0x7fffe4001e00, block=block@entry=1, 
---Type <return> to continue, or q <return> to quit---
    dispatch=dispatch@entry=1, self=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.40.0-r1/work/glib-2.40.0/glib/gmain.c:3734
#20 0x00007ffff32a1c6c in g_main_context_iteration (context=0x7fffe4001e00, may_block=1)
    at /var/tmp/portage/dev-libs/glib-2.40.0-r1/work/glib-2.40.0/glib/gmain.c:3795
#21 0x00007ffff617c27c in QEventDispatcherGlib::processEvents (this=0x707550, flags=...)
    at kernel/qeventdispatcher_glib.cpp:426
#22 0x00007ffff6120fcb in QEventLoop::exec (this=this@entry=0x7fffffffd380, flags=..., flags@entry=...)
    at kernel/qeventloop.cpp:212
#23 0x00007ffff61289df in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1188
#24 0x00007ffff663f2ac in QGuiApplication::exec () at kernel/qguiapplication.cpp:1450
#25 0x00007ffff7020c95 in QApplication::exec () at kernel/qapplication.cpp:2767
#26 0x000000000041fc1c in main (argc=1, argv=<optimized out>) at sources/main.cpp:493

after emerge --sync && emerge -1 qtwidgets (with enabled ggdb)
I also did another emerge -1 --nodeps qtcore qtgui qtwidgets - just to be sure to not miss any cange (qtgui was updated as well).

The crash happens as soon as the mouse enters the window (sometimes earlier). I have another issue with mouse interaction that renders every Qt5 application absolutely unusable. Since Qt-5.3.0, AFAIR. Going to report this right now.
Comment 6 Davide Pesavento gentoo-dev 2014-07-27 16:15:24 UTC
Please attach /usr/include/qt5/Gentoo/gentoo-qconfig.h and /usr/include/qt5/QtCore/qconfig.h
Comment 7 Franz Trischberger 2014-07-27 16:20:59 UTC
Created attachment 381656 [details]
/usr/include/qt5/QtCore/qconfig.h
Comment 8 Franz Trischberger 2014-07-27 16:21:58 UTC
Created attachment 381658 [details]
/usr/include/qt5/Gentoo/gentoo-qconfig.h
Comment 9 Heiko 2014-07-27 19:23:11 UTC
I've got a similar problem, though crashing in QHashData::free_helper(), but just turned up when syncing and rebuilding today.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5d5f621 in QHashData::free_helper (this=0x7ffff5f8d030 <QListData::shared_null>,
    node_delete=0x7ffff6401530 <QHash<QWindow*, QGuiApplicationPrivate::SynthesizedMouseData>::deleteNode2(QHashData::Node*)>) at tools/qhash.cpp:492
492     tools/qhash.cpp: No such file or directory.
(gdb) bt
#0  0x00007ffff5d5f621 in QHashData::free_helper (this=0x7ffff5f8d030 <QListData::shared_null>,
    node_delete=0x7ffff6401530 <QHash<QWindow*, QGuiApplicationPrivate::SynthesizedMouseData>::deleteNode2(QHashData::Node*)>) at tools/qhash.cpp:492
#1  0x00007ffff63f7920 in freeData (this=<optimized out>, x=<optimized out>)
    at ../../include/QtCore/../../src/corelib/tools/qhash.h:600
#2  ~QHash (this=0x602b40, __in_chrg=<optimized out>)
    at ../../include/QtCore/../../src/corelib/tools/qhash.h:310
#3  QGuiApplicationPrivate::~QGuiApplicationPrivate (this=0x602a40, __in_chrg=<optimized out>)
    at kernel/qguiapplication.cpp:1298
#4  0x00007ffff7715ab9 in QApplicationPrivate::~QApplicationPrivate (this=0x602a40,
    __in_chrg=<optimized out>) at kernel/qapplication.cpp:188
#5  0x00007ffff5f0ee00 in cleanup (pointer=<optimized out>)
    at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:62
#6  ~QScopedPointer (this=0x7fffffffd488, __in_chrg=<optimized out>)
    at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:109
#7  QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:880
#8  0x00007ffff7717302 in QApplication::~QApplication (this=0x7fffffffd480, __in_chrg=<optimized out>)
    at kernel/qapplication.cpp:711
#9  0x0000000000400787 in main ()
(gdb) list
490             int n = numBuckets;
491             while (n--) {
492                 Node *cur = *bucket++;
(gdb) p numBuckets
$2 = 1358980709


There's also an easy test case:

#include <QtWidgets/QApplication>

int main(int a, char **b)
{
    // g++ -o m m.cpp -I /usr/include/qt5 -fPIC -lQt5Core
    //QCoreApplication app(a, b); // works

    // g++ -o m m.cpp -I /usr/include/qt5 -fPIC -lQt5Widgets
    QApplication app(a, b); // crash

    return 0;
}
Comment 10 Heiko 2014-07-27 23:48:11 UTC
Using 4006a478609b993b6f1b8bf72840a2a29a0f2a12(In reply to Franz Fellner from comment #3)
> Seems to be related to QT5_CONFIG rework.
> git reset --hard  48f6e4a && emerge -1 --nodeps qtcore qtgui qtwidgets
> and tea-editor does not crash anymore
> git pull && emerge -1 --nodeps qtcore qtgui qtwidgets
> and tea-editor crashes, even after rebuilding.
> 
> Probably something went wrong while fixing #510556?
> (going to enable -ggdb again - how is #490254 going?)

Can confirm that 48f6e4a0 still works, and d81b3b00 is segfaulting through qtwidgets. Reverting the eclass back to 48f6e4a0 re remerging just qtwidgets removes the segfault. So I guess that disabling all isn't that perfect. Here's the diff in the elog's for qtwidget
--- 48f6e4a0
+++ d81b3b00
@@ -7,0 +8 @@
+double
@@ -11,0 +13 @@
+-iconv
@@ -12,0 +15 @@
+-largefile
@@ -14,0 +18,4 @@
+-no-alsa
+-no-compile-examples
+-no-cups
+-no-dbus
@@ -15,0 +23 @@
+-no-egl
@@ -16,0 +25,4 @@
+-no-evdev
+-no-fontconfig
+-no-freetype
+-no-glib
@@ -17,0 +30,3 @@
+-no-harfbuzz
+-no-icu
+-no-journald
@@ -18,0 +34,2 @@
+-no-libjpeg
+-no-libpng
@@ -21,0 +39,4 @@
+-no-mitshm
+-no-mtdev
+-no-opengl
+-no-openssl
@@ -22,0 +44 @@
+-no-pulseaudio
@@ -24,0 +47 @@
+-no-sm
@@ -36,0 +60,8 @@
+-no-xcb-xlib
+-no-xcursor
+-no-xfixes
+-no-xinerama
+-no-xinput
+-no-xinput2
+-no-xkb
+-no-xrandr
@@ -37,0 +69,3 @@
+-no-xshape
+-no-xsync
+-no-xvideo
@@ -41,0 +76 @@
+-process
@@ -42,0 +78 @@
+-qreal
@@ -47,2 +82,0 @@
--system-xcb
--system-xkbcommon
Comment 11 Davide Pesavento gentoo-dev 2014-07-28 00:11:24 UTC
Try this qtwidgets patch please.

diff --git a/dev-qt/qtwidgets/qtwidgets-5.3.1-r1.ebuild b/dev-qt/qtwidgets/qtwidgets-5.3.1-r1.ebuild
index 208edc0..e929a08 100644
--- a/dev-qt/qtwidgets/qtwidgets-5.3.1-r1.ebuild
+++ b/dev-qt/qtwidgets/qtwidgets-5.3.1-r1.ebuild
@@ -22,8 +22,8 @@ REQUIRED_USE="
 "

 DEPEND="
-	~dev-qt/qtcore-${PV}[debug=]
-	~dev-qt/qtgui-${PV}[debug=,gles2=,opengl=,png=]
+	~dev-qt/qtcore-${PV}[debug=,glib]
+	~dev-qt/qtgui-${PV}[debug=,gles2=,glib,opengl=,png=]
 "
 RDEPEND="${DEPEND}"

@@ -51,6 +51,7 @@ src_configure() {
 	fi

 	local myconf=(
+		-glib
 		${gl}
 		$(qt_use png libpng system)
 	)
Comment 12 Heiko 2014-07-28 07:22:30 UTC
(In reply to Davide Pesavento from comment #11)
> Try this qtwidgets patch please.
> 

Nope, doesn't change anything (except for -glib being on the configure option list)
Comment 13 Heiko 2014-07-28 11:05:40 UTC
Ok, think I got it... http://bpaste.net/show/515427/

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 16b5d93..173ce2e 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -545,7 +545,8 @@ qt5_base_configure() {
 
 		# disable undocumented X11-related flags, override in qtgui
 		# (not shown in ./configure -help output)
-		-no-sm -no-xkb -no-xrender
+		#-no-sm horribly breaks QtWidgets/QApplication
+		-no-xkb -no-xrender
 
 		# disable obsolete/unused X11-related flags
 		# (not shown in ./configure -help output)
Comment 14 Davide Pesavento gentoo-dev 2014-07-28 12:32:16 UTC
Yep, I just noticed that sm support is still broken in qtgui too, my previous fix (comment #4) was not complete.
Comment 15 Davide Pesavento gentoo-dev 2014-07-28 12:35:14 UTC
(In reply to Davide Pesavento from comment #1)
> Note that qtbase unconditionally disables X11 session management because it
> doesn't use it; qtgui[xcb] should enable it.

For future reference, enabling sm only when USE=xcb is enabled is wrong, because some core parts of qtgui also use qsessionmanager and test for QT_NO_SESSIONMANAGER.
Comment 16 Heiko 2014-07-29 07:55:06 UTC
Well, haven't tested your recent commits, but isn't it kinda the other way around? Qt5Gui including the xcb plugin had SM via -sm enabled, but the rest of qt did not. That's why I got crashes only through QtWidgets but not through QtGui directly.

You can disable the xcb platform plugin in favor of -platform minimal or -platform offscreen at runtime, which did still crash from QtWidgets. But handing QtWidgets the -sm option fixed the issue.

But maybe I'm not getting that new QT_CONFIG stuff right, and that option in QtGui gets propagated to QtWidgets as well? But then there are those recently to QtWidgets added USE flags which should get handled through the QT_CONFIG then?

As you can see I'm a bit puzzled and don't want to nuke my system again.

Btw. shouldn't QtGui and QtWidgets have a lot of the configure options in common?
Comment 17 Heiko 2014-07-29 07:58:24 UTC
Damn, I did it again. Used your qtgui updates, which didn't change much except for:

diff qtgui-qconfig.h.old qtgui-qconfig.h.new
13a14
> #define QT_XKB

But after recompiling qtwidgets... bang... segfaults again.

Fixable by: http://bpaste.net/show/520306/

diff --git a/dev-qt/qtwidgets/qtwidgets-5.3.1-r1.ebuild b/dev-qt/qtwidgets/qtwidgets-5.3.1-r1.ebuild
index 208edc0..b662cd5 100644
--- a/dev-qt/qtwidgets/qtwidgets-5.3.1-r1.ebuild
+++ b/dev-qt/qtwidgets/qtwidgets-5.3.1-r1.ebuild
@@ -53,6 +53,7 @@ src_configure() {
 	local myconf=(
 		${gl}
 		$(qt_use png libpng system)
+		-sm
 	)
 	qt5-build_src_configure
 }


As I said before, maybe qtgui and widgets need to share more configure options than opengl and png?
Comment 18 Franz Trischberger 2014-07-29 08:04:31 UTC
Yes, I already did the update today, which broke my system, again ;) I also added -sm to qtwidgets. (Currently also struggling with perl-update...)
I also would like to know if there is another possible breakage in other modules that may install qtwidgets - e.g. qtwebkit[widgets]. If they take a -no-sm code-path it might crash again, or am I wrong?
Comment 19 Malte E. 2014-07-29 10:39:27 UTC
As far as I can tell, only qtwidgets is affected. I started having the problem yesterday and recompiled all of qt5 in a desperate, but futile attempt to get my system working again. Found this bug today, reset to 48f6e4a and recompiled only qtwidgets - my system is working again as it used to. KWin crashes once on startup, but that happened before, alongside some other Plasma5 startup problems.
Comment 20 Davide Pesavento gentoo-dev 2014-07-29 12:16:05 UTC
Heh, guys, I didn't say those commits were supposed to fix this bug :P
In fact they are unrelated, except for 54a50878f160e4b9d77a2b97346a58f670910a62 which can be seen as an intermediate step towards resolution.
Comment 21 Davide Pesavento gentoo-dev 2014-07-29 21:52:59 UTC
sm is now enabled globally: https://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=4c7137e0bd7c261a323f4f8ae378ac59ba7a0a68

Let me know if that fixes the crashes please.
Comment 22 Malte E. 2014-07-29 22:21:39 UTC
I just recompiled qtwidgets with your changes and I don't have any crashes. I didn't recompile anything else though.
Comment 23 Davide Pesavento gentoo-dev 2014-07-29 22:31:58 UTC
Great, I'm closing then.

Thanks a lot everyone for reporting and testing.