Version: (using KDE 4.0.1) Installed from: FreeBSD Ports Compiler: GCC gcc (GCC) 3.4.6 [FreeBSD] 20060305 OS: FreeBSD klauncher crashes on FreeBSD with kdelibs 4.0.1 from time to time. I couldn't reproduce the exact situation yet when it happens. BACKTRACE ========= #0 0x28b9b5d4 in XSync (dpy=0x8049ca0, discard=1) at Sync.c:47 #1 0x28b74cb5 in XCloseDisplay (dpy=0x8049ca0) at ClDisplay.c:67 #2 0x2808218f in KLauncher::close (this=0xbfbfe750) at /usr/ports/x11/kdelibs4/work/kdelibs-4.0.1/kinit/klauncher.cpp:235 #3 0x280821ce in KLauncher::destruct (exit_code=255) at qcoreapplication.h:97 #4 0x280879d5 in KLauncher::slotKDEInitData (this=0x8073100) at /usr/ports/x11/kdelibs4/work/kdelibs-4.0.1/kinit/klauncher.cpp:318 #5 0x2808c331 in KLauncher::qt_metacall (this=0x8073100, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0xbfbfe1c8) at klauncher.moc:152 #6 0x290c8746 in QMetaObject::activate (sender=0x807c060, from_signal_index=4, to_signal_index=4, argv=0xbfbfe1c8) at kernel/qobject.cpp:3085 #7 0x290c8962 in QMetaObject::activate (sender=0x807c060, m=0x291374d0, local_signal_index=0, argv=0xbfbfe1c8) at kernel/qobject.cpp:3147 #8 0x290ecee0 in QSocketNotifier::activated (this=0x807c060, _t1=42) at .moc/release-shared/moc_qsocketnotifier.cpp:80 #9 0x290d0722 in QSocketNotifier::event (this=0x807c060, e=0xbfbfe360) at kernel/qsocketnotifier.cpp:324 #10 0x290b4418 in QCoreApplicationPrivate::notify_helper (this=0x805a480, receiver=0x807c060, event=0xbfbfe360) at kernel/qcoreapplication.cpp:641 #11 0x290b422a in QCoreApplication::notify (this=0xbfbfe750, receiver=0x807c060, event=0xbfbfe360) at kernel/qcoreapplication.cpp:599 #12 0x290b4134 in QCoreApplication::notifyInternal (this=0xbfbfe750, receiver=0x807c060, event=0xbfbfe360) at kernel/qcoreapplication.cpp:537 #13 0x290b6ec9 in QCoreApplication::sendEvent (receiver=0x807c060, event=0xbfbfe360) at qcoreapplication.h:207 #14 0x290dc534 in socketNotifierSourceDispatch (source=0x80568c0) at kernel/qeventdispatcher_glib.cpp:109 #15 0x29dfc504 in g_main_dispatch (context=0x805aa00) at gmain.c:2061 #16 0x29dfd919 in IA__g_main_context_dispatch (context=0x805aa00) at gmain.c:2613 #17 0x29dfde36 in g_main_context_iterate (context=0x805aa00, block=1, dispatch=1, self=0x8056800) at gmain.c:2694 #18 0x29dfe063 in IA__g_main_context_iteration (context=0x805aa00, may_block=1) at gmain.c:2753 #19 0x290dd6de in QEventDispatcherGlib::processEvents (this=0x804c930, flags={i = 20}) at kernel/qeventdispatcher_glib.cpp:345 #20 0x290b2387 in QEventLoop::processEvents (this=0xbfbfe660, flags={i = 20}) at kernel/qeventloop.cpp:147 #21 0x290b2471 in QEventLoop::exec (this=0xbfbfe660, flags={i = 0}) at kernel/qeventloop.cpp:189 #22 0x290b467a in QCoreApplication::exec () at kernel/qcoreapplication.cpp:766 #23 0x2808e2e9 in kdemain (argc=1, argv=0xbfbfe84c) at /usr/ports/x11/kdelibs4/work/kdelibs-4.0.1/kinit/klauncher_main.cpp:112 #24 0x080487e7 in main (argc=1, argv=0xbfbfe84c) at /usr/ports/x11/kdelibs4/work/kdelibs-4.0.1/build/kinit/klauncher_dummy.cpp:3
I tried to reproduce the crash. If I haven't run any kde4 program (so there is no kdeinit, kded, ...) and run 'kdeinit4' and kill it afterwards then klauncher will crash (with the backtrace above).
There is the following commit for klauncher on kde 3.5: http://websvn.kde.org/branches/KDE/3.5/kdelibs/kinit/klauncher.cpp?view=diff&r1=248080&r2=248081 I applied the same logic ("if defined Q_WS_X11 && ! defined K_WS_QTONLY") on klauncher in 4.0.1: --- klauncher.cpp.old 2008-03-03 17:46:20.000000000 +0100 +++ klauncher.cpp 2008-03-03 17:39:56.000000000 +0100 @@ -50,7 +50,7 @@ #include <kio/connection.h> #include <kio/slaveinterface.h> -#ifdef Q_WS_X11 +#if defined Q_WS_X11 && ! defined K_WS_QTONLY #include <kstartupinfo.h> #include <X11/Xlib.h> #endif @@ -229,7 +229,7 @@ void KLauncher::close() { -#ifdef Q_WS_X11 +#if define Q_WS_X11 && ! defined K_WS_QTONLY if( mCached_dpy != NULL ) XCloseDisplay( mCached_dpy ); #endif @@ -492,7 +492,7 @@ requestResult.error += ":\n" + request->errorMsg; requestResult.pid = 0; -#ifdef Q_WS_X11 +#if defined Q_WS_X11 && ! defined K_WS_QTONLY if (!request->startup_dpy.isEmpty()) { Display* dpy = NULL; @@ -783,7 +783,7 @@ KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr service, const QString& startup_id, const QStringList &envs ) { -#ifdef Q_WS_X11 +#if defined Q_WS_X11 && ! defined K_WS_QTONLY request->startup_id = "0"; if( startup_id == "0" ) return; @@ -836,7 +836,7 @@ KLauncher::cancel_service_startup_info( KLaunchRequest* request, const QString& startup_id, const QStringList &envs ) { -#ifdef Q_WS_X11 +#if defined Q_WS_X11 && ! defined K_WS_QTONLY if( request != NULL ) request->startup_id = "0"; if( !startup_id.isEmpty() && startup_id != "0" ) klauncher doesn't crash anymore (since XCloseDisplay is not being called).
The patch in the last post contains a type! It does not resolve the problem.
*** This bug has been marked as a duplicate of 157733 ***