[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Making applications exit if they can't connect to the session bus
From:       Thiago Macieira <thiago () kde ! org>
Date:       2008-03-07 18:37:45
Message-ID: 200803071937.52273.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


I don't understand why, but r635466 had this patch in it:
   if (!QDBusConnection::sessionBus().isConnected() || !(bus = 
QDBusConnection::sessionBus().interface())) {
-      kFatal(101) << "Session bus not found" << endl;
-      ::exit(125);
   }

It looks to me that Coolo committed some testing code of his. In any case, the 
effect is now that, if QtDBus cannot connect to the session bus, applications 
(not unique applications) will crash in bizarre ways later on. For instance, 
konqueror crashes trying to contact klauncher, due to a null-pointer 
dereference.

Does anyone mind if I commit the attached patch, restoring the code that was 
there?

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["0001-Do-exit-if-you-couldn-t-connect-to-the-session-bus.patch" (text/x-diff)]

From 508742692798696895100dab5a318c329b354770 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@trolltech.com>
Date: Fri, 7 Mar 2008 19:32:32 +0100
Subject: [PATCH] Do exit if you couldn't connect to the session bus

---
 kdeui/kernel/kapplication.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kdeui/kernel/kapplication.cpp b/kdeui/kernel/kapplication.cpp
index 85e58fb..5a3885d 100644
--- a/kdeui/kernel/kapplication.cpp
+++ b/kdeui/kernel/kapplication.cpp
@@ -534,6 +534,8 @@ void KApplicationPrivate::init(bool GUIenabled)
   qDBusBindToApplication();
   QDBusConnectionInterface *bus = 0;
   if (!QDBusConnection::sessionBus().isConnected() || !(bus = \
QDBusConnection::sessionBus().interface())) { +      kFatal(101) << "Session bus not \
found" << endl; +      ::exit(125);
   }
 
   extern bool s_kuniqueapplication_startCalled;
-- 
1.5.4.rc4.25.g81cc


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic