No windows displayed since version 5.1.0 on linux.
-
Hi,
I'm not new to QT, I wrote some small apps with it several years ago, and have just come back to it. My issue here is that 5.0.2 is the last version where anything at all works, in 5.1.0 and later nothing does. I mean when I run the the app, no window appears, no error messages, just nothing. In 5.0.2 everything just works normally. This behaviour happens with everything from the smallest analogclock demo to the assistant & designer apps.
A GDB backtrace shows this:
(gdb) bt
#0 0x00007ffff616a9dd in poll () from /lib64/libc.so.6
#1 0x00007ffff4ff7f04 in ?? () from /usr/lib64/libglib-2.0.so.0
#2 0x00007ffff4ff8024 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3 0x00007ffff739be54 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /opt/Qt5.1.0/5.1.0/gcc_64/lib/libQt5Core.so.5
#4 0x00007ffff735082b in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /opt/Qt5.1.0/5.1.0/gcc_64/lib/libQt5Core.so.5
#5 0x00007ffff73548f0 in QCoreApplication::exec() () from /opt/Qt5.1.0/5.1.0/gcc_64/lib/libQt5Core.so.5
#6 0x0000000000402e00 in main ()but that's basically identical to a backtrace from 5.0.2 which has displayed the window. I've also tried stracing it, but the strace shows it running, reading and writing data to X Windows, same as in 5.0.2.
Anyone seen this issue before, or have any advice about how to troubleshoot it further?
Thanks,
ldarby -
I have not encountered that. In my experience, Qt keeps improving.
Which distribution are we talking about? Have you compiled Qt yourself?
-
Are you running the applications from a terminal? Sometimes messages appear on the terminal that you wouldn't see if you ran it from a window/file manager or other GUI type run system.
Anyway, try running it from the terminal and see if there are any messages.
Also, if you built Qt yourself, did you make sure you had X11/GUI support? It's kinda hard to exclude support for these things so if you didn't explicitly disable them you should be good on that front.
-
Alright, here's what I've been doing for the past week: I rebuilt 5.0.2 (had to downgrade gcc to 4.5.2 for this, 4.8 gives compile errors) with debugging enabled, and stepped through it until I found what's causing the window to appear:
qt-everywhere-opensource-src-5.0.2/qtbase/src/plugins/platforms/xcb/qxcbwindow.cpp:583
xcb_flush(xcb_connection());
Stepping over that function causes a blank rectangle to appear.
Then I found that place in 5.3.1 (line 710), but that doesn't call xcb_flush(). hmm... I tried adding xcb_flush() back in but that didn't fix the problem.Then I realised it could be a window manager problem (I use icewm), so I killed that (i.e. no session management, just bare X running), and that made the window appear! And it also gave this error on STDERR:
QXcbConnection: XCB error: 3 (BadWindow), sequence: 170, resource id: 113246225,
major code: 20 (GetProperty), minor code: 0Interestingly when I restarted icewm the clock window then vanished. Searching for that error finds a few QT bugs, so it seems icewm is just more sensitive about what windows it will display than other WMs (like new gcc versions are more sensitive about what code they'll compile...)
-
Well that is interesting.. I use kde and sometimes gnome myself, but it shouldn't matter. It seems like it's a problem with X11 and Qt. Are you using Xorg or some other X11 system?
The fact that even in a raw X11 there was the XCB error. That shows there is definitely a problem.
Also, I've never had a problem with gcc/qt. However my version of gcc is 4.7.3 and I rarely build Qt with debug info. Even in release only mode it has info for backtraces so I find I don't need to go deeper than that. That makes it not worth the build time or space required for debug versions of Qt. But release build Qt always builds great with any gcc for me (again havent tried 4.8 though).
There is definitely a problem with your system somewhere. I would lean towards X11. You may want to try to reinstall your X11 system and XCB. That may help.
-
Seriously, just upgrade gcc to 4.8 and try to recompile 5.0.2, it will fail with
g++ -c -include .pch/debug-shared/Qt5Core -m64 -pipe -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DELF_INTERPRETER="/lib64/ld-linux-x86-64.so.2" -DQT_USE_ICU -DPCRE_HAVE_CONFIG_H -DHB_EXPORT=Q_CORE_EXPORT -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++-64 -I. -I../../include -I../../include/QtCore -I../../include/QtCore/5.0.2 -I../../include/QtCore/5.0.2/QtCore -Iglobal -I../3rdparty/pcre -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/debug-shared -o .obj/debug-shared/qsharedmemory_unix.o kernel/qsharedmemory_unix.cpp
kernel/qtimerinfo_unix.cpp:98:30: error: redeclaration 'constexpr T qAbs(const T&) [with T = timeval]' differs in 'constexpr'
timeval qAbs(const timeval &t)
^
In file included from ../../include/QtCore/qglobal.h:1:0,
from global/qt_pch.h:58:
../../include/QtCore/../../src/corelib/global/qglobal.h:483:27: error: from previous declaration 'constexpr T qAbs(const T&) [with T = timeval]'
Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
^
kernel/qtimerinfo_unix.cpp: In function 'constexpr T qAbs(const T&) [with T = timeval]':
kernel/qtimerinfo_unix.cpp:109:1: error: body of constexpr function 'constexpr T qAbs(const T&) [with T = timeval]' not a return-statement
}
^
In file included from ../../include/QtCore/qglobal.h:1:0,
from global/qt_pch.h:58:
../../include/QtCore/../../src/corelib/global/qglobal.h: In instantiation of 'constexpr T qAbs(const T&) [with T = timeval]':
kernel/qtimerinfo_unix.cpp:147:44: required from here
../../include/QtCore/../../src/corelib/global/qglobal.h:483:55: error: no match for 'operator>=' (operand types are 'const timeval' and 'int')
Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }Older versions compile it fine. 4.8.3 compiles 5.3.1 fine. I just seem to be having a hard time convincing anyone here that problems can actually exist and they can get fixed.
-
found it... the icewm developer already fixed this months ago and failed to actually tell anyone about it...
https://bugreports.qt-project.org/browse/QTBUG-32269
http://sourceforge.net/p/icewm/git/ci/395cfbb56a4adaee7028cfcbe6177ec0b94c181d/ -
Good to know it was an icewm problem rather than a Qt one.
I didn't mean to sound like I didn't believe you about the Qt build with gcc 4.8. I just haven't experienced problems. However I'm not using 4.8 yet and I rarely go back and build older Qt versions. So I absolutely believe you that there were problems. :)