Summary: | [feature] proper exit after SIGHUP | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | RJVB <rjvbertin> |
Component: | Session support | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED LATER | ||
Severity: | wishlist | CC: | |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | All | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
RJVB
2018-10-07 07:38:40 UTC
Huh? Just send it the default SIGTERM. That causes the application (like almost every application on your desktop, btw) to exit normally, like closing the window. No, it doesn't, not when running remotely in any case (or when the remote server has become unavailable). Possibly idem when a local server is going down hard, but that's a bit of a corner case. You're right that a normal exit results when the application is running normally and locally, under X11 at least. But it's not like closing a window AFAICT which probably goes through Q*Application; Qt doesn't catch the HUP signal so the OS default HUP handler takes over. I presume that leads to calling exit(), while in the situation I describe one should probably be calling _exit() instead (after doing a custom save-what-you-can call). Reopening because the fact a normal exit happens in response to a SIGHUP under a local session is apparently a coincidence. Citing the Qt "interest" ML:
>> > Exiting with exit() is not expected to work with Qt. Normal exit must
>> > return from main(), so you should simply ask the QCoreApplication main
>> > event loop to exit (quit() slot).
>>
>> A KDE dev told me a SIGHUP should already work (contrary to my experience).
>> So I tried it on a complex app running locally and it turns out that it
>> indeed went through its regular shut-down cycle. Including unsaved file
>> alerts.
>
> That might be a KF5 add-on. Qt doesn't do that by itself.
I have yet to find any evidence that anything in KDevelop's dependencies installs a SIGHUP handler that does anything other than the default handler.
Either way, let me reiterate that my feature suggestion concerns a proper, non-interactive exit. It should probably just close a number of resources that would otherwise be marked dirty, and then call _exit() to avoid activating any dtors that might make blocking calls to the X server.
I said SIGTERM, not SIGHUP. Now you wrote like 2 pages of text to at least 3 people before simply trying that out locally ... Erm, indeed, I saw that be then remained stuck on using SIGHUP, probably because of the added "like almost every other application on your desktop"). Not that it matters, fgrep 'signal(' shows kdevelop-git/kdevplatform/shell/core.cpp: std::signal(SIGHUP, shutdownGracefully); kdevelop-git/kdevplatform/shell/core.cpp: std::signal(SIGINT, shutdownGracefully); kdevelop-git/kdevplatform/shell/core.cpp: std::signal(SIGTERM, shutdownGracefully); SIG{HUP,INT,TERM} are all handled equally by the same handler (and thus NOT like almost every other application). Testing with the one or the other doesn't make a difference. But as I wrote in those "like 2 pages", this is not appropriate for the situations I have in mind. The shutdownGracefully() function should probably not be called from a signal handler either; there's a good chance that it will do things that are illegal in that context. Instead you should, according to the same ML source: Open a pipe or an eventfd, then install your signal handler. In that signal handler, write anything to the writing end or write uint64_t(1) the eventfd. Create a QSocketNotifier on the reading end of the pipe or on the eventfd, connect its activation signal to a slot that does what you want. To get this back to a hopefully more constructive state (and ignoring for the moment whether or not calling Qt API from a signal handler is an issue or not): what would be the best way to make the exit procedure as least block-prone and non-interactive as possible? Would it be enough to shunt the KSaveSelectDialog? And before I get in too deep: is there a reason behind the selection of signals currently connected to a graceful exit, IOW, are any of these sent in a context where it would NOT be OK to discard unsaved changes? Synthetic demonstration of unwanted behaviour:
> Xnest :1 &
> env DISPLAY=:1 kdevelop5 &
> killall -STOP %1 # suspend Xnest
> kill -HUP %2 # send SIGHUP to KDevelop
As expected this causes KDevelop to block:
(lldb) bt all
* thread #1, name = 'kdevelop', stop reason = signal SIGSTOP
* frame #0: 0x00007f9cab47e404 libpthread.so.0`__pthread_cond_wait at pthread_cond_wait.S:185
frame #1: 0x00007f9ca75b1db9 libxcb.so.1`___lldb_unnamed_symbol4$$libxcb.so.1 + 745
frame #2: 0x00007f9ca75b33ff libxcb.so.1`___lldb_unnamed_symbol18$$libxcb.so.1 + 191
frame #3: 0x00007f9ca75b3512 libxcb.so.1`xcb_wait_for_reply + 98
frame #4: 0x00007f9c9e8783d7 libQt5XcbQpa.so.5`QXcbCursor::queryPointer(QXcbConnection*, QXcbVirtualDesktop**, QPoint*, int*) at qxcbcursor.cpp:636
frame #5: 0x00007f9c9e87855f libQt5XcbQpa.so.5`QXcbCursor::pos(this=<unavailable>) const at qxcbcursor.cpp:661
frame #6: 0x00007f9cb1400444 libQt5Gui.so.5`QCursor::pos(screen=<unavailable>) at qcursor.cpp:190
frame #7: 0x00007f9cb1bec781 libQt5Widgets.so.5`QApplicationPrivate::sendSyntheticEnterLeave(this=<unavailable>, widget=0x0000000003d97d40) at qapplication.cpp:2762
frame #8: 0x00007f9cb1c21122 libQt5Widgets.so.5`QWidgetPrivate::hideChildren(this=<unavailable>, spontaneous=false) at qwidget.cpp:8463
frame #9: 0x00007f9cb1c212cf libQt5Widgets.so.5`QWidgetPrivate::hide_helper(this=0x0000000003d97790) at qwidget.cpp:8178
frame #10: 0x00007f9cb1c26368 libQt5Widgets.so.5`QWidget::setVisible(this=0x0000000003d97400, visible=<unavailable>) at qwidget.cpp:8369
frame #11: 0x00007f9cb1c09ea4 libQt5Widgets.so.5`QStackedLayout::takeAt(this=<unavailable>, index=<unavailable>) at qstackedlayout.cpp:282
frame #12: 0x00007f9cb1c0468e libQt5Widgets.so.5`QLayout::removeWidget(this=0x0000000004491f30, widget=0x0000000003d97400) at qlayout.cpp:1367
frame #13: 0x00007f9cb6b0736e libKDevPlatformSublime.so.53`Sublime::Container::removeWidget(this=0x000000000448ce00, w=0x0000000003d97400) at container.cpp:549
frame #14: 0x00007f9cb6b17c4f libKDevPlatformSublime.so.53`Sublime::MainWindowPrivate::aboutToRemoveView(this=<unavailable>, index=<unavailable>, view=0x0000000003ec5bb0) at mainwindow_p.cpp:619
frame #15: 0x00007f9cb0e720f0 libQt5Core.so.5`QMetaObject::activate(QObject*, int, int, void**) at qobject_impl.h:101
frame #16: 0x00007f9cb6b261fe libKDevPlatformSublime.so.53`Sublime::Area::aboutToRemoveView(this=<unavailable>, _t1=<unavailable>, _t2=<unavailable>) at moc_area.cpp:284
frame #17: 0x00007f9cb6afeb34 libKDevPlatformSublime.so.53`Sublime::Area::removeView(this=0x0000000001100300, view=0x0000000003ec5bb0) at area.cpp:208
frame #18: 0x00007f9cb6b0f0f0 libKDevPlatformSublime.so.53`Sublime::Document::closeViews(this=0x0000000003dd2fc0) at document.cpp:140
frame #19: 0x00007f9cb92c0bd3 libKDevPlatformShell.so.53`KDevelop::PartDocument::close(this=0x0000000003dd2fc0, mode=<unavailable>) at partdocument.cpp:150
frame #20: 0x00007f9cb92c6d1e libKDevPlatformShell.so.53`KDevelop::DocumentController::cleanup(this=<unavailable>) at documentcontroller.cpp:579
frame #21: 0x00007f9cb92a22c6 libKDevPlatformShell.so.53`KDevelop::Core::cleanup(this=0x0000000000f06610) at core.cpp:419
frame #22: 0x00007f9cb92a1edb libKDevPlatformShell.so.53`KDevelop::Core::shutdown(this=0x0000000000f06610) at core.cpp:385
frame #23: 0x00007f9cb9285af6 libKDevPlatformShell.so.53`KDevelop::MainWindow::~MainWindow(this=0x00000000012071a0, vtt=0x00007f9cb9596990) at mainwindow.cpp:159
frame #24: 0x00007f9cb9285c96 libKDevPlatformShell.so.53`KDevelop::MainWindow::~MainWindow() [inlined] KDevelop::MainWindow::~MainWindow(this=0x00000000012071a0) at mainwindow.cpp:156
frame #25: 0x00007f9cb9285c87 libKDevPlatformShell.so.53`KDevelop::MainWindow::~MainWindow(this=0x00000000012071a0) at mainwindow.cpp:156
frame #26: 0x00007f9cb0e72928 libQt5Core.so.5`QObject::event(QEvent*) at qobject.cpp:1243
frame #27: 0x00007f9cb1c269ab libQt5Widgets.so.5`QWidget::event(this=0x00000000012071a0, event=0x0000000005620910) at qwidget.cpp:9346
frame #28: 0x00007f9cb1d465cb libQt5Widgets.so.5`QMainWindow::event(this=0x00000000012071a0, event=0x0000000005620910) at qmainwindow.cpp:1563
frame #29: 0x00007f9cb557790c libKF5XmlGui.so.5`KMainWindow::event(this=0x00000000012071a0, ev=0x0000000005620910) at kmainwindow.cpp:865
frame #30: 0x00007f9cb55afee3 libKF5XmlGui.so.5`KXmlGuiWindow::event(this=0x00000000012071a0, ev=0x0000000005620910) at kxmlguiwindow.cpp:119
frame #31: 0x00007f9cb1be41a1 libQt5Widgets.so.5`QApplicationPrivate::notify_helper(this=<unavailable>, receiver=0x00000000012071a0, e=0x0000000005620910) at qapplication.cpp:3722
frame #32: 0x00007f9cb1bec9f0 libQt5Widgets.so.5`QApplication::notify(this=0x00007ffed3d55e48, receiver=0x00000000012071a0, e=0x0000000005620910) at qapplication.cpp:3481
frame #33: 0x00007f9cb0e47609 libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) at qcoreapplication.cpp:1031
frame #34: 0x00007f9cb0e4a0ab libQt5Core.so.5`QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) at qcoreapplication.h:233
frame #35: 0x00007f9cb0e9c4b3 libQt5Core.so.5`::postEventSourceDispatch(s=0x0000000000894830, (null)=<unavailable>, (null)=<unavailable>) at qeventdispatcher_glib.cpp:276
frame #36: 0x00007f9ca892bd37 libglib-2.0.so.0`g_main_context_dispatch at gmain.c:3165
frame #37: 0x00007f9ca892bc4c libglib-2.0.so.0`g_main_context_dispatch(context=0x00007f9c980016f0) at gmain.c:3818
frame #38: 0x00007f9ca89676a8 libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138(context=0x00007f9c980016f0, block=<unavailable>, dispatch=1) at gmain.c:3891
frame #39: 0x00007f9ca892ddfc libglib-2.0.so.0`g_main_context_iteration(context=0x00007f9c980016f0, may_block=1) at gmain.c:3952
frame #40: 0x00007f9cb0e9baa3 libQt5Core.so.5`QEventDispatcherGlib::processEvents(this=0x0000000000937a00, flags=<unavailable>) at qeventdispatcher_glib.cpp:423
frame #41: 0x00007f9cb0e45d8b libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) at qeventloop.cpp:212
frame #42: 0x00007f9cb0e4ea4e libQt5Core.so.5`QCoreApplication::exec() at qcoreapplication.cpp:1304
frame #43: 0x000000000041418e kdevelop`main(argc=<unavailable>, argv=<unavailable>) at main.cpp:1000
frame #44: 0x00007f9caffb5f45 libc.so.6`__libc_start_main(main=(kdevelop`main at main.cpp:440), argc=2, argv=0x00007ffed3d55fa8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007ffed3d55f98) at libc-start.c:287
frame #45: 0x00000000004067c4 kdevelop`_start + 41
thread #2, name = 'QXcbEventReader', stop reason = signal SIGSTOP
frame #0: 0x00007f9cb0084c9d libc.so.6`__GI___poll at syscall-template.S:81
frame #1: 0x00007f9ca75b1b72 libxcb.so.1`___lldb_unnamed_symbol4$$libxcb.so.1 + 162
frame #2: 0x00007f9ca75b364f libxcb.so.1`xcb_wait_for_event + 63
frame #3: 0x00007f9c9e852019 libQt5XcbQpa.so.5`QXcbEventReader::run(this=0x0000000000867280) at qxcbconnection.cpp:1330
frame #4: 0x00007f9cb0c61e2a libQt5Core.so.5`QThreadPrivate::start(void*) at qthread_unix.cpp:368
frame #5: 0x00007f9cab47a184 libpthread.so.0`start_thread(arg=0x00007f9c9c908700) at pthread_create.c:312
frame #6: 0x00007f9cb009203d libc.so.6`__clone at clone.S:111
thread #3, name = 'QDBusConnection', stop reason = signal SIGSTOP
frame #0: 0x00007f9cb0084c9d libc.so.6`__GI___poll at syscall-template.S:81
frame #1: 0x00007f9ca8967611 libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138 at gmain.c:4192
frame #2: 0x00007f9ca89675ed libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138(context=0x00007f9c88000990, block=<unavailable>, dispatch=1) at gmain.c:3886
frame #3: 0x00007f9ca892ddfc libglib-2.0.so.0`g_main_context_iteration(context=0x00007f9c88000990, may_block=1) at gmain.c:3952
frame #4: 0x00007f9cb0e9baa3 libQt5Core.so.5`QEventDispatcherGlib::processEvents(this=0x00007f9c880008c0, flags=<unavailable>) at qeventdispatcher_glib.cpp:423
frame #5: 0x00007f9cb0e45d8b libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) at qeventloop.cpp:212
frame #6: 0x00007f9cb0c5cf16 libQt5Core.so.5`QThread::exec() at qthread.cpp:515
frame #7: 0x00007f9cb3c901b5 libQt5DBus.so.5`QDBusConnectionManager::run(this=0x00007f9cb3f0a400) at qdbusconnection.cpp:178
frame #8: 0x00007f9cb0c61e2a libQt5Core.so.5`QThreadPrivate::start(void*) at qthread_unix.cpp:368
frame #9: 0x00007f9cab47a184 libpthread.so.0`start_thread(arg=0x00007f9c8f738700) at pthread_create.c:312
frame #10: 0x00007f9cb009203d libc.so.6`__clone at clone.S:111
thread #4, name = 'QThread', stop reason = signal SIGSTOP
frame #0: 0x00007f9cb0084c9d libc.so.6`__GI___poll at syscall-template.S:81
frame #1: 0x00007f9ca8967611 libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138 at gmain.c:4192
frame #2: 0x00007f9ca89675ed libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138(context=0x00007f9c80000990, block=<unavailable>, dispatch=1) at gmain.c:3886
frame #3: 0x00007f9ca892ddfc libglib-2.0.so.0`g_main_context_iteration(context=0x00007f9c80000990, may_block=1) at gmain.c:3952
frame #4: 0x00007f9cb0e9baa3 libQt5Core.so.5`QEventDispatcherGlib::processEvents(this=0x00007f9c800008c0, flags=<unavailable>) at qeventdispatcher_glib.cpp:423
frame #5: 0x00007f9cb0e45d8b libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) at qeventloop.cpp:212
frame #6: 0x00007f9cb0c5cf16 libQt5Core.so.5`QThread::exec() at qthread.cpp:515
frame #7: 0x00007f9cb7e5fd8e libKDevPlatformLanguage.so.53`KDevelop::DUChainPrivate::CleanupThread::run(this=0x0000000002541850) at duchain.cpp:286
frame #8: 0x00007f9cb0c61e2a libQt5Core.so.5`QThreadPrivate::start(void*) at qthread_unix.cpp:368
frame #9: 0x00007f9cab47a184 libpthread.so.0`start_thread(arg=0x00007f9c86616700) at pthread_create.c:312
frame #10: 0x00007f9cb009203d libc.so.6`__clone at clone.S:111
thread #5, name = 'OutputFilterThr', stop reason = signal SIGSTOP
frame #0: 0x00007f9cb0084c9d libc.so.6`__GI___poll at syscall-template.S:81
frame #1: 0x00007f9ca8967611 libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138 at gmain.c:4192
frame #2: 0x00007f9ca89675ed libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138(context=0x00007f9c78000990, block=<unavailable>, dispatch=1) at gmain.c:3886
frame #3: 0x00007f9ca892ddfc libglib-2.0.so.0`g_main_context_iteration(context=0x00007f9c78000990, may_block=1) at gmain.c:3952
frame #4: 0x00007f9cb0e9baa3 libQt5Core.so.5`QEventDispatcherGlib::processEvents(this=0x00007f9c780008c0, flags=<unavailable>) at qeventdispatcher_glib.cpp:423
frame #5: 0x00007f9cb0e45d8b libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) at qeventloop.cpp:212
frame #6: 0x00007f9cb0c5cf16 libQt5Core.so.5`QThread::exec() at qthread.cpp:515
frame #7: 0x00007f9cb0c61e2a libQt5Core.so.5`QThreadPrivate::start(void*) at qthread_unix.cpp:368
frame #8: 0x00007f9cab47a184 libpthread.so.0`start_thread(arg=0x00007f9c7d442700) at pthread_create.c:312
frame #9: 0x00007f9cb009203d libc.so.6`__clone at clone.S:111
thread #6, name = 'Qt bearer threa', stop reason = signal SIGSTOP
frame #0: 0x00007f9cb0084c9d libc.so.6`__GI___poll at syscall-template.S:81
frame #1: 0x00007f9ca8967611 libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138 at gmain.c:4192
frame #2: 0x00007f9ca89675ed libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138(context=0x00007f9c70000990, block=<unavailable>, dispatch=1) at gmain.c:3886
frame #3: 0x00007f9ca892ddfc libglib-2.0.so.0`g_main_context_iteration(context=0x00007f9c70000990, may_block=1) at gmain.c:3952
frame #4: 0x00007f9cb0e9baa3 libQt5Core.so.5`QEventDispatcherGlib::processEvents(this=0x00007f9c700008c0, flags=<unavailable>) at qeventdispatcher_glib.cpp:423
frame #5: 0x00007f9cb0e45d8b libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) at qeventloop.cpp:212
frame #6: 0x00007f9cb0c5cf16 libQt5Core.so.5`QThread::exec() at qthread.cpp:515
frame #7: 0x00007f9cb0c61e2a libQt5Core.so.5`QThreadPrivate::start(void*) at qthread_unix.cpp:368
frame #8: 0x00007f9cab47a184 libpthread.so.0`start_thread(arg=0x00007f9c77fff700) at pthread_create.c:312
frame #9: 0x00007f9cb009203d libc.so.6`__clone at clone.S:111
thread #7, name = 'KDevelop::Compl', stop reason = signal SIGSTOP
frame #0: 0x00007f9cb0084c9d libc.so.6`__GI___poll at syscall-template.S:81
frame #1: 0x00007f9ca8967611 libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138 at gmain.c:4192
frame #2: 0x00007f9ca89675ed libglib-2.0.so.0`g_main_context_iterate.isra.31.lto_priv.138(context=0x00007f9c6c5e1130, block=<unavailable>, dispatch=1) at gmain.c:3886
frame #3: 0x00007f9ca892ddfc libglib-2.0.so.0`g_main_context_iteration(context=0x00007f9c6c5e1130, may_block=1) at gmain.c:3952
frame #4: 0x00007f9cb0e9baa3 libQt5Core.so.5`QEventDispatcherGlib::processEvents(this=0x00007f9c6c0c44e0, flags=<unavailable>) at qeventdispatcher_glib.cpp:423
frame #5: 0x00007f9cb0e45d8b libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) at qeventloop.cpp:212
frame #6: 0x00007f9cb0c5cf16 libQt5Core.so.5`QThread::exec() at qthread.cpp:515
frame #7: 0x00007f9cb7f4f306 libKDevPlatformLanguage.so.53`KDevelop::CompletionWorkerThread::run(this=0x0000000003b64500) at codecompletionmodel.cpp:79
frame #8: 0x00007f9cb0c61e2a libQt5Core.so.5`QThreadPrivate::start(void*) at qthread_unix.cpp:368
frame #9: 0x00007f9cab47a184 libpthread.so.0`start_thread(arg=0x00007f9c76423700) at pthread_create.c:312
frame #10: 0x00007f9cb009203d libc.so.6`__clone at clone.S:111
thread #8, name = 'Queue(0x14ace50', stop reason = signal SIGSTOP
frame #0: 0x00007f9cab47e404 libpthread.so.0`__pthread_cond_wait at pthread_cond_wait.S:185
frame #1: 0x00007f9cb0c62723 libQt5Core.so.5`QWaitCondition::wait(QMutex*, unsigned long) at qwaitcondition_unix.cpp:143
frame #2: 0x00007f9cb0c62718 libQt5Core.so.5`QWaitCondition::wait(this=<unavailable>, mutex=0x000000000153a530, time=18446744073709551615) at qwaitcondition_unix.cpp:215
frame #3: 0x00007f9cb7b8e37d libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::blockThreadUntilJobsAreBeingAssigned(ThreadWeaver::Thread*) [inlined] ThreadWeaver::Weaver::blockThreadUntilJobsAreBeingAssigned_locked(this=<unavailable>, th=<unavailable>) at weaver.cpp:594
frame #4: 0x00007f9cb7b8e348 libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::blockThreadUntilJobsAreBeingAssigned(this=0x00000000014ace50, th=0x0000000003d62b80) at weaver.cpp:581
frame #5: 0x00007f9cb7b92622 libKF5ThreadWeaver.so.5`ThreadWeaver::SuspendingState::applyForWork(this=0x000000000154e5c0, th=0x0000000003d62b80, wasBusy=<unavailable>) at suspendingstate.cpp:61
frame #6: 0x00007f9cb7b92670 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::SuspendingState::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=<unavailable>) at suspendingstate.cpp:0
frame #7: 0x00007f9cb7b8e27e libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=false) at weaver.cpp:568
frame #8: 0x00007f9cb7b92403 libKF5ThreadWeaver.so.5`ThreadWeaver::WorkingHardState::applyForWork(this=0x000000000154b840, th=0x0000000003d62b80, wasBusy=<unavailable>) at workinghardstate.cpp:73
frame #9: 0x00007f9cb7b924a0 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::WorkingHardState::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=<unavailable>) at workinghardstate.cpp:0
frame #10: 0x00007f9cb7b8e27e libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=false) at weaver.cpp:568
frame #11: 0x00007f9cb7b92403 libKF5ThreadWeaver.so.5`ThreadWeaver::WorkingHardState::applyForWork(this=0x000000000154b840, th=0x0000000003d62b80, wasBusy=<unavailable>) at workinghardstate.cpp:73
frame #12: 0x00007f9cb7b924a0 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::WorkingHardState::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=<unavailable>) at workinghardstate.cpp:0
frame #13: 0x00007f9cb7b8e27e libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=false) at weaver.cpp:568
frame #14: 0x00007f9cb7b92403 libKF5ThreadWeaver.so.5`ThreadWeaver::WorkingHardState::applyForWork(this=0x000000000154b840, th=0x0000000003d62b80, wasBusy=<unavailable>) at workinghardstate.cpp:73
frame #15: 0x00007f9cb7b924a0 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::WorkingHardState::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=<unavailable>) at workinghardstate.cpp:0
frame #16: 0x00007f9cb7b8e27e libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=true) at weaver.cpp:568
frame #17: 0x00007f9cb7b904e1 libKF5ThreadWeaver.so.5`ThreadWeaver::Thread::run(this=0x0000000003d62b80) at thread.cpp:103
frame #18: 0x00007f9cb0c61e2a libQt5Core.so.5`QThreadPrivate::start(void*) at qthread_unix.cpp:368
frame #19: 0x00007f9cab47a184 libpthread.so.0`start_thread(arg=0x00007f9c528f9700) at pthread_create.c:312
frame #20: 0x00007f9cb009203d libc.so.6`__clone at clone.S:111
thread #9, name = 'Queue(0x14ace50', stop reason = signal SIGSTOP
frame #0: 0x00007f9cab47e404 libpthread.so.0`__pthread_cond_wait at pthread_cond_wait.S:185
frame #1: 0x00007f9cb0c62723 libQt5Core.so.5`QWaitCondition::wait(QMutex*, unsigned long) at qwaitcondition_unix.cpp:143
frame #2: 0x00007f9cb0c62718 libQt5Core.so.5`QWaitCondition::wait(this=<unavailable>, mutex=0x000000000153a530, time=18446744073709551615) at qwaitcondition_unix.cpp:215
frame #3: 0x00007f9cb7b8e37d libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::blockThreadUntilJobsAreBeingAssigned(ThreadWeaver::Thread*) [inlined] ThreadWeaver::Weaver::blockThreadUntilJobsAreBeingAssigned_locked(this=<unavailable>, th=<unavailable>) at weaver.cpp:594
frame #4: 0x00007f9cb7b8e348 libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::blockThreadUntilJobsAreBeingAssigned(this=0x00000000014ace50, th=0x00007f9c68462480) at weaver.cpp:581
frame #5: 0x00007f9cb7b927d4 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::SuspendedState::applyForWork(ThreadWeaver::Thread*, bool) [inlined] ThreadWeaver::SuspendedState::applyForWork(this=0x000000000154dbf0, th=0x00007f9c68462480) at suspendedstate.cpp:56
frame #6: 0x00007f9cb7b927b8 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::SuspendedState::applyForWork(this=0x000000000154dbf0, th=0x00007f9c68462480, wasBusy=false) at suspendedstate.cpp:0
frame #7: 0x00007f9cb7b8e27e libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=false) at weaver.cpp:568
frame #8: 0x00007f9cb7b92403 libKF5ThreadWeaver.so.5`ThreadWeaver::WorkingHardState::applyForWork(this=0x000000000154b840, th=0x00007f9c68462480, wasBusy=<unavailable>) at workinghardstate.cpp:73
frame #9: 0x00007f9cb7b924a0 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::WorkingHardState::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=<unavailable>) at workinghardstate.cpp:0
frame #10: 0x00007f9cb7b8e27e libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=true) at weaver.cpp:568
frame #11: 0x00007f9cb7b904e1 libKF5ThreadWeaver.so.5`ThreadWeaver::Thread::run(this=0x00007f9c68462480) at thread.cpp:103
frame #12: 0x00007f9cb0c61e2a libQt5Core.so.5`QThreadPrivate::start(void*) at qthread_unix.cpp:368
frame #13: 0x00007f9cab47a184 libpthread.so.0`start_thread(arg=0x00007f9c59422700) at pthread_create.c:312
frame #14: 0x00007f9cb009203d libc.so.6`__clone at clone.S:111
thread #10, name = 'Queue(0x14ace50', stop reason = signal SIGSTOP
frame #0: 0x00007f9cab47e404 libpthread.so.0`__pthread_cond_wait at pthread_cond_wait.S:185
frame #1: 0x00007f9cb0c62723 libQt5Core.so.5`QWaitCondition::wait(QMutex*, unsigned long) at qwaitcondition_unix.cpp:143
frame #2: 0x00007f9cb0c62718 libQt5Core.so.5`QWaitCondition::wait(this=<unavailable>, mutex=0x000000000153a530, time=18446744073709551615) at qwaitcondition_unix.cpp:215
frame #3: 0x00007f9cb7b8e37d libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::blockThreadUntilJobsAreBeingAssigned(ThreadWeaver::Thread*) [inlined] ThreadWeaver::Weaver::blockThreadUntilJobsAreBeingAssigned_locked(this=<unavailable>, th=<unavailable>) at weaver.cpp:594
frame #4: 0x00007f9cb7b8e348 libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::blockThreadUntilJobsAreBeingAssigned(this=0x00000000014ace50, th=0x00007f9c4003d840) at weaver.cpp:581
frame #5: 0x00007f9cb7b927d4 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::SuspendedState::applyForWork(ThreadWeaver::Thread*, bool) [inlined] ThreadWeaver::SuspendedState::applyForWork(this=0x000000000154dbf0, th=0x00007f9c4003d840) at suspendedstate.cpp:56
frame #6: 0x00007f9cb7b927b8 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::SuspendedState::applyForWork(this=0x000000000154dbf0, th=0x00007f9c4003d840, wasBusy=false) at suspendedstate.cpp:0
frame #7: 0x00007f9cb7b8e27e libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=false) at weaver.cpp:568
frame #8: 0x00007f9cb7b92403 libKF5ThreadWeaver.so.5`ThreadWeaver::WorkingHardState::applyForWork(this=0x000000000154b840, th=0x00007f9c4003d840, wasBusy=<unavailable>) at workinghardstate.cpp:73
frame #9: 0x00007f9cb7b924a0 libKF5ThreadWeaver.so.5`non-virtual thunk to ThreadWeaver::WorkingHardState::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=<unavailable>) at workinghardstate.cpp:0
frame #10: 0x00007f9cb7b8e27e libKF5ThreadWeaver.so.5`ThreadWeaver::Weaver::applyForWork(this=<unavailable>, th=<unavailable>, wasBusy=true) at weaver.cpp:568
frame #11: 0x00007f9cb7b904e1 libKF5ThreadWeaver.so.5`ThreadWeaver::Thread::run(this=0x00007f9c4003d840) at thread.cpp:103
frame #12: 0x00007f9cb0c61e2a libQt5Core.so.5`QThreadPrivate::start(void*) at qthread_unix.cpp:368
frame #13: 0x00007f9cab47a184 libpthread.so.0`start_thread(arg=0x00007f9c530fa700) at pthread_create.c:312
frame #14: 0x00007f9cb009203d libc.so.6`__clone at clone.S:111
So the application can't exit when it cannot talk to the X server. I don't care. I don't think anyone else does, either. If you really need this, please fix it in a private branch. KDevelop has so many visible, important issues, let's please focus on those. I guess if you don't care then you also don't care if I submit a fix. I happen to find this important enough to spend time on it and I think no one would mind if this kind of situation did NOT lead to a corrupted cache at the next start. I'll fix the signal handler too at the same time, because that one does have a bug which is waiting to manifest itself (confirmed on the Qt interest ML). I don't care about the fix for "application can exit when X does not respond", no, and unless it simplifies the code involved I would vote against merging it. The signal handler thing in contrast does sound like an actual issue, that would be nice to have fixed. Turns out a non-blocking and clean-enough exit can be achieved simply by calling Core::shutdown() before the actual exit so that's easy enough. Quick question: the current code puts the actual signal handler installation in #ifdef SIGFOO blocks. I'm guessing that's for platforms like MS Windows that don't have POSIX style signal handling? Most probably, yes. |