Bug 360105 - Doesn't start with Qt 5.6
Summary: Doesn't start with Qt 5.6
Status: RESOLVED FIXED
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR grave
Target Milestone: ---
Assignee: Evan Teran
URL:
Keywords:
: 361594 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-05 07:57 UTC by Antonio Rojas
Modified: 2016-05-05 21:57 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 16.04.1
Sentry Crash Report:


Attachments
Rex Dieter's patch : kcalc don't set a zero minimum size (396 bytes, patch)
2016-03-19 17:09 UTC, Bob Wya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2016-03-05 07:57:36 UTC
kcalc doesn't start with Qt 5.6. No significant error is printed on the command line or the journal. Also, the gdb backtrace is exactly the same as with Qt 5.5, the window simply doesn't come up. The -v and --help commands display the information correctly, but never exit.

Reproducible: Always
Comment 1 Raymond Wooninck 2016-03-07 10:02:56 UTC
I see exactly the same behavior on my system with Qt 5.6 and git master for Plasma, Frameworks and Apps.
Comment 2 Rex Dieter 2016-03-08 03:39:28 UTC
marking confirmed (here too)
Comment 3 Robin 2016-03-08 10:20:39 UTC
Confirming here too QT 5.6, Plasma 5.5.5, Frameworks 5.18
Same behaviour for all users (including a newly created user) - no discernible errors in in output or logs
Comment 4 Rex Dieter 2016-03-08 17:58:11 UTC
Fwiw, while apparently hung, here's a backtrace ,

While apparently hung, gdb reports:

Thread 3 (Thread 0x7f8118e42700 (LWP 28639)):
#0  0x00007f81316f0fdd in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f812f651272 in _xcb_conn_wait (__timeout=-1, __nfds=1, __fds=0x7f8118e41b80) at /usr/include/bits/poll2.h:46
#2  0x00007f812f651272 in _xcb_conn_wait (c=c@entry=0x5569a8b12b20, cond=cond@entry=0x5569a8b12b60, vector=vector@entry=0x0, count=count@entry=0x0) at xcb_conn.c:459
#3  0x00007f812f652ee7 in xcb_wait_for_event (c=0x5569a8b12b20) at xcb_in.c:693
#4  0x00007f811b2a3349 in QXcbEventReader::run() (this=0x5569a8b1d2f0) at qxcbconnection.cpp:1313
#5  0x00007f813257ae18 in QThreadPrivate::start(void*) (arg=0x5569a8b1d2f0) at thread/qthread_unix.cpp:340
#6  0x00007f812f43160a in start_thread (arg=0x7f8118e42700) at pthread_create.c:334
#7  0x00007f81316fca4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7f8112870700 (LWP 28640)):
#0  0x00007f81316f0fdd in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f812eee916c in g_main_context_iterate (priority=2147483647, n_fds=3, fds=0x7f810c003020, timeout=<optimized out>, context=0x7f810c000990) at gmain.c:4135
#2  0x00007f812eee916c in g_main_context_iterate (context=context@entry=0x7f810c000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3835
#3  0x00007f812eee927c in g_main_context_iteration (context=0x7f810c000990, may_block=may_block@entry=1) at gmain.c:3901
#4  0x00007f81327a3cef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7f810c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:417
#5  0x00007f813274c6ea in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7f811286fc50, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f8132576004 in QThread::exec() (this=this@entry=0x7f813550b040 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:503
#7  0x00007f8135497445 in QDBusConnectionManager::run() (this=0x7f813550b040 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:181
#8  0x00007f813257ae18 in QThreadPrivate::start(void*) (arg=0x7f813550b040 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:340
#9  0x00007f812f43160a in start_thread (arg=0x7f8112870700) at pthread_create.c:334
#10 0x00007f81316fca4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f812274e940 (LWP 28635)):
#0  0x00007f81316f0fdd in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f812eee916c in g_main_context_iterate (priority=2147483647, n_fds=2, fds=0x5569a8f48200, timeout=<optimized out>, context=0x7f81140016f0) at gmain.c:4135
#2  0x00007f812eee916c in g_main_context_iterate (context=context@entry=0x7f81140016f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3835
#3  0x00007f812eee927c in g_main_context_iteration (context=0x7f81140016f0, may_block=may_block@entry=1) at gmain.c:3901
#4  0x00007f81327a3cef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5569a8b3db60, flags=...) at kernel/qeventdispatcher_glib.cpp:417
#5  0x00007f813274c6ea in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffdb31f6a10, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f8132754ddc in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1285
#7  0x00007f8132f950dc in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1598
#8  0x00007f813357ec35 in QApplication::exec() () at kernel/qapplication.cpp:2973
#9  0x00007f81350f4871 in kdemain(int, char**) (argc=1, argv=<optimized out>) at /usr/src/debug/kcalc-15.12.1/kcalc.cpp:2324
#10 0x00007f813161a580 in __libc_start_main (main=
    0x5569a768a9a0 <main(int, char**)>, argc=1, argv=0x7ffdb31f6d68, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffdb31f6d58)
    at libc-start.c:289
#11 0x00005569a768a9d9 in _start ()
Comment 5 Rex Dieter 2016-03-08 18:01:03 UTC
hrm, to rule out glib event loop, here's when running with QT_NO_GLIB=1

Thread 3 (Thread 0x7fd75967f700 (LWP 28730)):
#0  0x00007fd771f31fdd in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fd76fe92272 in _xcb_conn_wait (__timeout=-1, __nfds=1, __fds=0x7fd75967eb80) at /usr/include/bits/poll2.h:46
#2  0x00007fd76fe92272 in _xcb_conn_wait (c=c@entry=0x563176076b20, cond=cond@entry=0x563176076b60, vector=vector@entry=0x0, count=count@entry=0x0) at xcb_conn.c:459
#3  0x00007fd76fe93ee7 in xcb_wait_for_event (c=0x563176076b20) at xcb_in.c:693
#4  0x00007fd75bae0349 in QXcbEventReader::run() (this=0x5631760812f0) at qxcbconnection.cpp:1313
#5  0x00007fd772dbbe18 in QThreadPrivate::start(void*) (arg=0x5631760812f0) at thread/qthread_unix.cpp:340
#6  0x00007fd76fc7260a in start_thread (arg=0x7fd75967f700) at pthread_create.c:334
#7  0x00007fd771f3da4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7fd75320c700 (LWP 28731)):
#0  0x00007fd771f33d63 in select () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fd772fe055f in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timespec const*) (nfds=10, fdread=fdread@entry=0x7fd74c000a78, fdwrite=fdwrite@entry=0x7fd74c000d08, fdexcept=fdexcept@entry=0x7fd74c000f98, orig_timeout=orig_timeout@entry=0x0) at kernel/qcore_unix.cpp:75
#2  0x00007fd772fe1f9e in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timespec*) (timeout=0x0, exceptfds=0x7fd74c000f98, writefds=0x7fd74c000d08, readfds=0x7fd74c000a78, nfds=<optimized out>, this=0x7fd74c0008c0) at kernel/qeventdispatcher_unix.cpp:320
#3  0x00007fd772fe1f9e in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timespec*) (this=this@entry=0x7fd74c0008e0, flags=..., 
    flags@entry=..., timeout=timeout@entry=0x0) at kernel/qeventdispatcher_unix.cpp:196
#4  0x00007fd772fe24b2 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7fd74c0008c0, flags=...) at kernel/qeventdispatcher_unix.cpp:607
#5  0x00007fd772f8d6ea in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fd75320bc50, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007fd772db7004 in QThread::exec() (this=this@entry=0x7fd775d48040 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:503
#7  0x00007fd775cd4445 in QDBusConnectionManager::run() (this=0x7fd775d48040 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:181
#8  0x00007fd772dbbe18 in QThreadPrivate::start(void*) (arg=0x7fd775d48040 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:340
#9  0x00007fd76fc7260a in start_thread (arg=0x7fd75320c700) at pthread_create.c:334
#10 0x00007fd771f3da4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7fd762f8b940 (LWP 28726)):
#0  0x00007fd771f33d63 in select () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fd772fe055f in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timespec const*) (nfds=7, fdread=fdread@entry=0x5631760bc988, fdwrite=fdwrite@entry=0x5631760bcc18, fdexcept=fdexcept@entry=0x5631760bcea8, orig_timeout=orig_timeout@entry=0x0) at kernel/qcore_unix.cpp:75
#2  0x00007fd772fe1f9e in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timespec*) (timeout=0x0, exceptfds=0x5631760bcea8, writefds=0x5631760bcc18, readfds=0x5631760bc988, nfds=<optimized out>, this=0x5631760af5b0) at kernel/qeventdispatcher_unix.cpp:320
#3  0x00007fd772fe1f9e in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timespec*) (this=this@entry=0x5631760bc7f0, flags=..., 
    flags@entry=..., timeout=timeout@entry=0x0) at kernel/qeventdispatcher_unix.cpp:196
#4  0x00007fd772fe24b2 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5631760af5b0, flags=flags@entry=...)
    at kernel/qeventdispatcher_unix.cpp:607
#5  0x00007fd75bb5260d in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...)
    at eventdispatchers/qunixeventdispatcher.cpp:62
#6  0x00007fd772f8d6ea in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffc58ff92f0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#7  0x00007fd772f95ddc in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1285
---Type <return> to continue, or q <return> to quit---
#8  0x00007fd7737d60dc in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1598
#9  0x00007fd773dbfc35 in QApplication::exec() () at kernel/qapplication.cpp:2973
#10 0x00007fd775935871 in kdemain(int, char**) (argc=1, argv=<optimized out>) at /usr/src/debug/kcalc-15.12.1/kcalc.cpp:2324
#11 0x00007fd771e5b580 in __libc_start_main (main=
    0x56317486b9a0 <main(int, char**)>, argc=1, argv=0x7ffc58ff9648, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc58ff9638)
    at libc-start.c:289
#12 0x000056317486b9d9 in _start ()
Comment 6 Niels Ole Salscheider 2016-03-12 10:22:06 UTC
It seems that kcalc polls on a socket in "/tmp/.ICE-unix/". The relevant output from strace is:

[...]
socket(PF_LOCAL, SOCK_STREAM, 0)        = 6
getsockopt(6, SOL_SOCKET, SO_SNDBUF, [212992], [4]) = 0
uname({sysname="Linux", nodename="OleDesktop", ...}) = 0
connect(6, {sa_family=AF_LOCAL, sun_path=@"/tmp/.ICE-unix/1317"}, 22) = 0
fcntl(6, F_SETFD, FD_CLOEXEC)           = 0
[...]
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}], 2, -1) = 1 ([{fd=5, revents=POLLIN}])
read(5, "\1\0\0\0\0\0\0\0", 16)         = 8

And then the last two lines are repeated.
Comment 7 Niels Ole Salscheider 2016-03-12 16:33:41 UTC
Please ignore what I said. The real problem is that the window is not visible because of
setFixedSize(minimumSize());
where minimumSize() returns (0, 0).
Comment 8 Rex Dieter 2016-03-16 13:26:12 UTC
Here's a hack/workaround to use in the meantime (until Qt's minimumSize behaves itself):

diff -up kcalc-15.12.3/kcalc.cpp.qt56 kcalc-15.12.3/kcalc.cpp
--- kcalc-15.12.3/kcalc.cpp.qt56        2016-03-09 17:12:50.000000000 -0600
+++ kcalc-15.12.3/kcalc.cpp     2016-03-16 08:18:05.635713639 -0500
@@ -123,7 +123,7 @@ KCalculator::KCalculator(QWidget *parent
 
        updateGeometry();
 
-       setFixedSize(minimumSize());
+       if ( ! minimumSize().isEmpty() ) setFixedSize(minimumSize());
 
        updateDisplay(UPDATE_FROM_CORE);
Comment 9 Heiko Becker 2016-03-16 14:50:21 UTC
(In reply to Rex Dieter from comment #8)
> Here's a hack/workaround to use in the meantime (until Qt's minimumSize
> behaves itself):

Is there a Qt bug report  to track this?
Comment 10 Rex Dieter 2016-03-16 14:56:07 UTC
None that I'm aware of (yet)
Comment 11 Bob Wya 2016-03-19 17:09:08 UTC
Created attachment 97973 [details]
Rex Dieter's patch : kcalc don't set a zero minimum size

Thanks Rex.

The Attachment button (cough) it's a thing... :-)
Comment 12 Christoph Feck 2016-04-11 02:51:35 UTC
*** Bug 361594 has been marked as a duplicate of this bug. ***
Comment 13 AE 2016-04-11 22:43:46 UTC
Fix works for me (coming from bug #361594), thanks!
Comment 14 Elvis Angelaccio 2016-05-05 15:28:10 UTC
Fix in https://git.reviewboard.kde.org/r/127847/

Please test it as soon as possible (deadline for 16.04.1 bugfixes is 23:59 UTC of today).
Comment 15 Antonio Rojas 2016-05-05 15:39:51 UTC
Patch works fine here. It seems to create some excessive margin to the left of the buttons, but no big deal.
Comment 16 Elvis Angelaccio 2016-05-05 15:58:44 UTC
(In reply to Antonio Rojas from comment #15)
> Patch works fine here. It seems to create some excessive margin to the left
> of the buttons, but no big deal.

Yeah, there was an unnecessary horizontal spacer in the layout. I updated the patch, should be fixed now.
Comment 17 Elvis Angelaccio 2016-05-05 21:57:06 UTC
Git commit 2678cb9c7a07381e3ffb8a2107946cec53bf5909 by Elvis Angelaccio.
Committed on 05/05/2016 at 21:47.
Pushed by elvisangelaccio into branch 'Applications/16.04'.

Fix invisible main window with Qt 5.6

Since Qt 5.6, the minimum size property seems to default to an empty size,
so it can't be used to set a fixed size for the main window.

A better approach is to tell the layout() to use a fixed size.

This change also exposed a redundant horizontal spacer in the .ui code, which
is now removed.
FIXED-IN: 16.04.1
REVIEW: 127847

M  +1    -1    kcalc.cpp
M  +0    -13   kcalc.ui

http://commits.kde.org/kcalc/2678cb9c7a07381e3ffb8a2107946cec53bf5909