hanging in kdialog

Jos van den Oever jos at vandenoever.info
Fri Jul 28 09:50:51 BST 2017


Hi all,

KDialog can get stuck waiting for some dbus reply in certain setups. Here is a 
short command-line that demonstrates this.

docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -ti --rm 
kdeneon/plasma:dev-unstable kdialog --msgbox 'wait for it'

This runs kdialog in a docker environment. Some services are not available 
there. The hang is due to a KNotification as you can see from the backtrace.

I've also attached the output from dbus-monitor with an indication of where 
the hang starts.

Not all arguments to kdialog have this problem. Only the ones that try to 
start org.freedesktop.Notifications.

Shouldn't that call fail faster?

Cheers,
Jos

neon at fecce5c790e0:~$ gdb /usr/bin/kdialog
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/kdialog...(no debugging symbols found)...done.
(gdb) run --msgbox hi
Starting program: /usr/bin/kdialog --msgbox hi
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7f2e96ec8700 (LWP 166)]
[New Thread 0x7f2e8f5a9700 (LWP 167)]
^Z
Thread 1 "kdialog" received signal SIGTSTP, Stopped (user).
pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/
pthread_cond_wait.S:185
185     ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: No such file or 
directory.
(gdb) back
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/
pthread_cond_wait.S:185
#1  0x00007f2ea54cf8eb in QWaitCondition::wait(QMutex*, unsigned long) () from 
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007f2ea8375e54 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#3  0x00007f2ea8331aa1 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#4  0x00007f2ea831e6cb in QDBusConnection::call(QDBusMessage const&, 
QDBus::CallMode, int) const () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#5  0x00007f2ea833c862 in 
QDBusAbstractInterface::callWithArgumentList(QDBus::CallMode, QString const&, 
QList<QVariant> const&) () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#6  0x00007f2ea833d0e6 in QDBusAbstractInterface::call(QDBus::CallMode, 
QString const&, QVariant const&, QVariant const&, QVariant const&, QVariant 
const&, QVariant const&, QVariant const&, QVariant const&, QVariant const&) () 
from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007f2ea833d2f1 in QDBusAbstractInterface::call(QString const&, 
QVariant const&, QVariant const&, QVariant const&, QVariant const&, QVariant 
const&, QVariant const&, QVariant const&, QVariant const&) () from /usr/lib/
x86_64-linux-gnu/libQt5DBus.so.5
#8  0x00007f2ea83230dc in QDBusConnectionInterface::startService(QString 
const&) () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#9  0x00007f2ea7d24f34 in ?? () from /usr/lib/x86_64-linux-gnu/
libKF5Notifications.so.5
#10 0x00007f2ea7d109d2 in ?? () from /usr/lib/x86_64-linux-gnu/
libKF5Notifications.so.5
#11 0x00007f2ea7d111f1 in ?? () from /usr/lib/x86_64-linux-gnu/
libKF5Notifications.so.5
#12 0x00007f2ea7d0efc5 in KNotification::sendEvent() () from /usr/lib/x86_64-
linux-gnu/libKF5Notifications.so.5
#13 0x00007f2ea56cfc59 in QObject::event(QEvent*) () from /usr/lib/x86_64-
linux-gnu/libQt5Core.so.5
#14 0x00007f2ea64f83fc in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007f2ea64ffe07 in QApplication::notify(QObject*, QEvent*) () from /
usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007f2ea56a2798 in QCoreApplication::notifyInternal2(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007f2ea56a4f7b in QCoreApplicationPrivate::sendPostedEvents(QObject*, 
int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007f2ea56f8323 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007f2ea064e197 in g_main_context_dispatch () from /lib/x86_64-linux-
gnu/libglib-2.0.so.0
#20 0x00007f2ea064e3f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007f2ea064e49c in g_main_context_iteration () from /lib/x86_64-linux-
gnu/libglib-2.0.so.0
#22 0x00007f2ea56f792f in 
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () 
from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007f2ea56a07ca in 
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/
x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007f2ea6727aa7 in QDialog::exec() () from /usr/lib/x86_64-linux-gnu/
libQt5Widgets.so.5
#25 0x00007f2ea6d04a8d in KMessageBox::createKMessageBox(QDialog*, 
QDialogButtonBox*, QIcon const&, QString const&, QStringList const&, QString 
const&, bool*, QFlags<KMessageBox::Option>, QString const&, QMessageBox::Icon) 
() from /usr/lib/x86_64-linux-gnu/libKF5WidgetsAddons.so.5
#26 0x00007f2ea6d05517 in KMessageBox::createKMessageBox(QDialog*, 
QDialogButtonBox*, QMessageBox::Icon, QString const&, QStringList const&, 
QString const&, bool*, QFlags<KMessageBox::Option>, QString const&) () from /
usr/lib/x86_64-linux-gnu/libKF5WidgetsAddons.so.5
#27 0x00007f2ea6d09070 in ?? () from /usr/lib/x86_64-linux-gnu/
libKF5WidgetsAddons.so.5
#28 0x00007f2ea6d095ef in ?? () from /usr/lib/x86_64-linux-gnu/
libKF5WidgetsAddons.so.5
#29 0x000000000040ca2c in ?? ()
#30 0x00007f2ea4cf4830 in __libc_start_main (main=0x409520, argc=3, 
argv=0x7fffffffecc8, init=<optimized out>, fini=<optimized out>, 
rtld_fini=<optimized out>, stack_end=0x7fffffffecb8)
    at ../csu/libc-start.c:291


neon at be52b1fd30c6:~$ kdialog --msgbox 'wait for it'
method call time=1501231696.069342 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=Hello
method return time=1501231696.069357 sender=org.freedesktop.DBus -> 
destination=:1.3 serial=1 reply_serial=1
   string ":1.3"
signal time=1501231696.069368 sender=org.freedesktop.DBus -> destination=(null 
destination) serial=9 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.3"
   string ""
   string ":1.3"
signal time=1501231696.069379 sender=org.freedesktop.DBus -> destination=:1.3 
serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; 
member=NameAcquired
   string ":1.3"
method call time=1501231696.069658 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',path='/
BreezeStyle',interface='org.kde.Breeze.Style',member='reparseConfiguration'"
method call time=1501231696.069828 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',path='/
BreezeDecoration',interface='org.kde.Breeze.Style',member='reparseConfiguration'"
method call time=1501231696.072801 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=4 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',path='/
KIconLoader',interface='org.kde.KIconLoader',member='iconChanged'"
method call time=1501231696.080759 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=5 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string 
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.a11y.Bus',arg1=''"
method call time=1501231696.080887 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=6 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=NameHasOwner
   string "org.a11y.Bus"
method return time=1501231696.080921 sender=org.freedesktop.DBus -> 
destination=:1.3 serial=3 reply_serial=6
   boolean false
method call time=1501231696.131050 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=7 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',path='/
KDEPlatformTheme',interface='org.kde.KDEPlatformTheme',member='refreshFonts'"
method call time=1501231696.131211 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=8 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',path='/
KToolBar',interface='org.kde.KToolBar',member='styleChanged'"
method call time=1501231696.131225 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=9 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',path='/
KGlobalSettings',interface='org.kde.KGlobalSettings',member='notifyChange'"
method call time=1501231696.131523 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=10 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=NameHasOwner
   string "org.freedesktop.Notifications"
method return time=1501231696.131636 sender=org.freedesktop.DBus -> 
destination=:1.3 serial=4 reply_serial=10
   boolean false
method call time=1501231696.131715 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=11 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string 
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.Notifications'"
method call time=1501231696.131845 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=12 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=ListActivatableNames
method return time=1501231696.131855 sender=org.freedesktop.DBus -> 
destination=:1.3 serial=5 reply_serial=12
   array [
      string "org.freedesktop.DBus"
      string "org.freedesktop.Notifications"
      string "org.kde.kpasswdserver"
      string "org.kde.kded5"
      string "org.kde.fontinst"
      string "org.gnome.evolution.dataserver.AddressBook9"
      string "org.gnome.GConf"
      string "org.gnome.evolution.dataserver.Calendar7"
      string "org.gnome.evolution.dataserver.Sources5"
      string "org.freedesktop.systemd1"
      string "org.a11y.Bus"
      string "org.kde.kiod5"
      string "org.kde.kglobalaccel"
      string "org.kde.kuiserver"
      string "org.freedesktop.FileManager1"
      string "org.kde.Spectacle"
      string "org.kde.kwalletd5"
      string "org.freedesktop.ColorHelper"
      string "org.kde.kdeconnect"
      string "org.kde.KScreen"
      string "org.kde.kwalletd"
      string "org.gtk.GLib.PACRunner"
      string "org.kde.kcookiejar5"
      string "org.kde.kssld5"
      string "org.kde.kioexecd"
      string "ca.desrt.dconf"
      string "org.bluez.obex"
      string "org.gnome.evolution.dataserver.UserPrompter0"
      string "org.kde.krunner"
   ]
method call time=1501231696.132133 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=13 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=StartServiceByName
   string "org.freedesktop.Notifications"
   uint32 0

HANGING

method call time=1501231708.246641 sender=:1.2 -> 
destination=org.freedesktop.DBus serial=4 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string 
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.Notifications',arg1=''"
method call time=1501231708.246880 sender=:1.2 -> 
destination=org.freedesktop.DBus serial=5 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string 
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.DBus'"
error time=1501231708.246902 sender=org.freedesktop.DBus -> destination=:1.2 
error_name=org.freedesktop.DBus.Error.MatchRuleNotFound reply_serial=5
   string "The given match rule wasn't found and can't be removed"
signal time=1501231708.246911 sender=org.freedesktop.DBus -> destination=:1.2 
serial=10 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; 
member=NameLost
   string ":1.2"
signal time=1501231708.246920 sender=org.freedesktop.DBus -> destination=(null 
destination) serial=11 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.2"
   string ":1.2"
   string ""
error time=1501231708.248030 sender=org.freedesktop.DBus -> destination=:1.3 
error_name=org.freedesktop.DBus.Error.Spawn.ChildExited reply_serial=13
   string "Process org.freedesktop.Notifications exited with status 1"
method call time=1501231708.248344 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=14 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',path='/
Config',interface='org.kde.knotification',member='reparseConfiguration'"
method call time=1501231708.248979 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=15 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=AddMatch
   string 
"type='signal',interface='org.kde.Phonon.Factory',member='phononBackendChanged'"
signal time=1501231708.249916 sender=:1.3 -> destination=(null destination) 
serial=16 path=/AudioOutputs/0; interface=org.kde.Phonon.AudioOutput; 
member=newOutputAvailable
   string ":1.3"
   string "/AudioOutputs/0"
[00000000012792c8] pulse audio output error: PulseAudio server connection 
failure: Connection refused
[000000000127bd28] pulse audio output error: PulseAudio server connection 
failure: Connection refused
[000000000127bd28] core audio output error: no suitable audio output module
signal time=1501231708.348299 sender=:1.3 -> destination=(null destination) 
serial=17 path=/AudioOutputs/0; interface=org.kde.Phonon.AudioOutput; 
member=volumeChanged
   double -nan
signal time=1501231708.348332 sender=:1.3 -> destination=(null destination) 
serial=18 path=/AudioOutputs/0; interface=org.kde.Phonon.AudioOutput; 
member=volumeChanged
   double -nan
[00007f027801e178] pulse audio output error: PulseAudio server connection 
failure: Connection refused
[00007f027801e178] core audio output error: no suitable audio output module
[00007f02800247a8] core decoder error: failed to create audio output
method call time=1501231724.463927 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=19 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string 
"type='signal',interface='org.kde.Phonon.Factory',member='phononBackendChanged'"
method call time=1501231724.464062 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=20 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',path='/
BreezeDecoration',interface='org.kde.Breeze.Style',member='reparseConfiguration'"
method call time=1501231724.464085 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=21 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',path='/
BreezeStyle',interface='org.kde.Breeze.Style',member='reparseConfiguration'"
method call time=1501231724.464740 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=22 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',path='/
KDEPlatformTheme',interface='org.kde.KDEPlatformTheme',member='refreshFonts'"
method call time=1501231724.464931 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=23 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',path='/
KToolBar',interface='org.kde.KToolBar',member='styleChanged'"
method call time=1501231724.464943 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=24 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',path='/
KGlobalSettings',interface='org.kde.KGlobalSettings',member='notifyChange'"
method call time=1501231724.481407 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=25 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string 
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.a11y.Bus',arg1=''"
method call time=1501231724.481456 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=26 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string 
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.DBus'"
error time=1501231724.481473 sender=org.freedesktop.DBus -> destination=:1.3 
error_name=org.freedesktop.DBus.Error.MatchRuleNotFound reply_serial=26
   string "The given match rule wasn't found and can't be removed"
method call time=1501231724.481734 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=27 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',path='/
Config',interface='org.kde.knotification',member='reparseConfiguration'"
method call time=1501231724.481907 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=28 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string 
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.Notifications'"
signal time=1501231724.482106 sender=:1.3 -> destination=(null destination) 
serial=29 path=/AudioOutputs/0; interface=org.kde.Phonon.AudioOutput; 
member=outputDestroyed
method call time=1501231724.483055 sender=:1.3 -> 
destination=org.freedesktop.DBus serial=30 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',path='/
KIconLoader',interface='org.kde.KIconLoader',member='iconChanged'"
signal time=1501231724.483516 sender=org.freedesktop.DBus -> destination=:1.3 
serial=12 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; 
member=NameLost
   string ":1.3"
signal time=1501231724.483586 sender=org.freedesktop.DBus -> destination=(null 
destination) serial=13 path=/org/freedesktop/DBus; 
interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.3"
   string ":1.3"
   string ""
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20170728/9e70cdaa/attachment.sig>


More information about the kde-core-devel mailing list