kioclient5 crashes on exit due to ~QDBusConnectionManager

David Faure faure at kde.org
Sun May 11 08:26:01 UTC 2014


$ kioclient5 -v
kioclient 2.0
<crash>

#0  0x00007ffff47eee19 in QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=0x61dc40, receiver=0x67ead0, event=0x7fffffffcd00) at kernel/qcoreapplication.cpp:1012
#1  0x00007ffff5679080 in QApplicationPrivate::notify_helper (this=0x61dc40, receiver=0x67ead0, e=0x7fffffffcd00) at kernel/qapplication.cpp:3466
#2  0x00007ffff5676962 in QApplication::notify (this=0x7fffffffd2b0, receiver=0x67ead0, e=0x7fffffffcd00) at kernel/qapplication.cpp:2944
#3  0x00007ffff47eec1e in QCoreApplication::notifyInternal (this=0x7fffffffd2b0, receiver=0x67ead0, event=0x7fffffffcd00) at kernel/qcoreapplication.cpp:935
#4  0x00007ffff47f2907 in QCoreApplication::sendEvent (receiver=0x67ead0, event=0x7fffffffcd00) at kernel/qcoreapplication.h:237
#5  0x00007ffff482befd in QObjectPrivate::setParent_helper (this=0x6511e0, o=0x0) at kernel/qobject.cpp:1961
#6  0x00007ffff482a4b9 in QObject::~QObject (this=0x66fe90, __in_chrg=<optimized out>) at kernel/qobject.cpp:1033
#7  0x00007ffff483b941 in QSocketNotifier::~QSocketNotifier (this=0x66fe90, __in_chrg=<optimized out>) at kernel/qsocketnotifier.cpp:200
#8  0x00007ffff483b970 in QSocketNotifier::~QSocketNotifier (this=0x66fe90, __in_chrg=<optimized out>) at kernel/qsocketnotifier.cpp:203
#9  0x00007ffff7b53da1 in qDBusRemoveWatch (watch=0x680160, data=0x67ead0) at qdbusintegrator.cpp:306
#10 0x00007fffe7d7b233 in _dbus_watch_list_remove_watch (watch_list=0x67ae50, watch=0x680160) at dbus-watch.c:419
#11 0x00007fffe7d6219e in protected_change_watch (enabled=0, [...]) at dbus-connection.c:724
#12 _dbus_connection_remove_watch_unlocked (connection=<optimized out>, watch=<optimized out>) at dbus-connection.c:771
#13 0x00007fffe7d7999e in free_watches (transport=transport at entry=0x680070) at dbus-transport-socket.c:81
#14 0x00007fffe7d79a19 in socket_disconnect (transport=0x680070) at dbus-transport-socket.c:987
#15 0x00007fffe7d78ea7 in _dbus_transport_disconnect (transport=0x680070) at dbus-transport.c:509
#16 0x00007fffe7d64d82 in _dbus_connection_close_possibly_shared_and_unlock (connection=0x680610) at dbus-connection.c:2829
#17 0x00007ffff7b52234 in q_dbus_connection_close (connection=0x680610) at qdbus_symbols_p.h:113
#18 0x00007ffff7b5783a in QDBusConnectionPrivate::closeConnection (this=0x67ead0) at qdbusintegrator.cpp:1094
#19 0x00007ffff7b49960 in QDBusConnectionManager::~QDBusConnectionManager (this=0x7ffff7ddba80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>, __in_chrg=<optimized out>) at qdbusconnection.cpp:108
#20 0x00007ffff7b4970c in (anonymous namespace)::Q_QGS__q_manager::Holder::~Holder ([...]) at qdbusconnection.cpp:67
#21 0x00007ffff397b3d9 in __run_exit_handlers (status=0, listp=0x7ffff3cec5a8 <__exit_funcs>, run_list_atexit=run_list_atexit at entry=true) at exit.c:82
#22 0x00007ffff397b425 in __GI_exit (status=<optimized out>) at exit.c:104
#23 0x00007ffff45dd607 in QCommandLineParser::process (this=0x7fffffffd250, arguments=QStringList<QString> = {...}) at tools/qcommandlineparser.cpp:500
#24 0x00007ffff45dd79c in QCommandLineParser::process (this=0x7fffffffd250, app=...) at tools/qcommandlineparser.cpp:516
#25 0x0000000000407e5b in main (argc=2, argv=0x7fffffffd4c8) at /d/kde/src/5/kde/workspace/kde-cli-tools/kioclient/kioclient.cpp:167

Clearly this is ::exit(1) within QCLP destroying a global static in QDBus, but I'm not sure why it crashes exactly.

Valgrind doesn't help (Address 0x1c940360 is not stack'd, malloc'd or (recently) free'd)

I'm not sure how ::exit() works exactly: what happens to the stack in main()? Is the qapplication instance deleted,
or does it keep existing, as the stack trace would indicate?

BTW the app connects to DBus for the following reasons:
1) the IBus input context stuff within Qt:
2) oxygen connecting to dbus to be notified of config file changes
(kioclient5 is a gui app because it can create kio progress dialogs).
Well, we could change that to be a pure kiocore app nowadays, but we should probably
fix the crash first, it could happen to any other app AFAICS...

Thiago, any idea?

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list