Bug 72517 - Kontact crashes if you do Alt+F2 "kmail"
Summary: Kontact crashes if you do Alt+F2 "kmail"
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: SVN
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-12 22:56 UTC by Ingo Klöcker
Modified: 2004-01-15 00:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ingo Klöcker 2004-01-12 22:56:40 UTC
Version:           unknown (using KDE 3.1.94 (CVS >= 20031206), compiled sources)
Compiler:          gcc version 3.3 20030226 (prerelease) (SuSE Linux)
OS:          Linux (i686) release 2.4.20-4GB

Start Kontact with the Mail component (I haven't check whether that really matters). Then press Alt+F2, enter "kmail", press Return and watch Kontact crash.

Backtrace:
[New Thread 16384 (LWP 3152)]
0x41697387 in waitpid () from /lib/libpthread.so.0
#0  0x41697387 in waitpid () from /lib/libpthread.so.0
#1  0x409d5193 in KCrash::defaultCrashHandler(int) (sig=11)
    at /home/ingo/cvs/kde/head/kdelibs/kdecore/kcrash.cpp:246
#2  0x416961ec in __pthread_sighandler () from /lib/libpthread.so.0
#3  <signal handler called>
#4  0x00740065 in ?? ()
#5  0x40a06b72 in QPtrList<KCmdLineArgs>::clear() (this=0x8078c60)
    at qptrlist.h:93
#6  0x40a05471 in KCmdLineArgs::reset() ()
    at /home/ingo/cvs/kde/head/kdelibs/kdecore/kcmdlineargs.cpp:1009
#7  0x400f78fe in Kontact::UniqueAppHandler::process(QCString const&, QMemArray<char> const&, QCString&, QMemArray<char>&) (this=0x8159740, fun=@0xbfffe950, 
    data=@0xbfffe960, replyType=@0xbfffe910, replyData=@0xbfffe900)
    at /home/ingo/cvs/kde/head/kdepim/kontact/interfaces/uniqueapphandler.cpp:91
#8  0x40ac1e48 in DCOPClient::receive(QCString const&, QCString const&, QCString const&, QMemArray<char> const&, QCString&, QMemArray<char>&) (this=0x8162af8, 
    objId=@0xbfffe940, fun=@0xbfffe950, data=@0xbfffe960, 
    replyType=@0xbfffe910, replyData=@0xbfffe900)
    at /home/ingo/cvs/kde/head/kdelibs/dcop/dcopclient.cpp:1566
#9  0x40abc396 in DCOPProcessInternal (d=0x8146058, opcode=2, key=2, 
    dataReceived=@0xbfffea60, canPost=true)
    at /home/ingo/cvs/kde/head/kdelibs/dcop/dcopclient.cpp:507
#10 0x40abbcfa in DCOPProcessMessage (iceConn=0x8162a70, 
    clientObject=0x8146058, opcode=2, length=124, replyWait=0x0, 
    replyWaitRet=0xbfffeadc)
    at /home/ingo/cvs/kde/head/kdelibs/dcop/dcopclient.cpp:418
#11 0x40acec39 in KDE_IceProcessMessages (iceConn=0x8162a70, replyWait=0x0, 
    replyReadyRet=0x0)
    at /home/ingo/cvs/kde/head/kdelibs/dcop/KDE-ICE/process.c:325
#12 0x40ac316e in DCOPClient::processSocketData(int) (this=0x8162af8, fd=11)
    at /home/ingo/cvs/kde/head/kdelibs/dcop/dcopclient.cpp:1909
#13 0x40ac482b in DCOPClient::qt_invoke(int, QUObject*) (this=0x8162af8, 
    _id=2, _o=0xbfffec50) at dcopclient.moc:174
#14 0x40e2f8e1 in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x814bdb8, clist=0x8126c08, o=0xbfffec50)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qobject.cpp:2333
#15 0x40e2fc53 in QObject::activate_signal(int, int) (this=0x814bdb8, 
    signal=2, param=11)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qobject.cpp:2426
#16 0x41173635 in QSocketNotifier::activated(int) (this=0x814bdb8, t0=11)
    at /home/ingo/cvs/kde/qt-copy/src/.moc/debug-shared-mt/moc_qsocketnotifier.cpp:85
#17 0x40e4f5c4 in QSocketNotifier::event(QEvent*) (this=0x814bdb8, 
    e=0xbfffeec0)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qsocketnotifier.cpp:271
#18 0x40dccb05 in QApplication::internalNotify(QObject*, QEvent*) (
    this=0xbffff0a0, receiver=0x814bdb8, e=0xbfffeec0)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qapplication.cpp:2582
#19 0x40dcbfc2 in QApplication::notify(QObject*, QEvent*) (this=0xbffff0a0, 
    receiver=0x814bdb8, e=0xbfffeec0)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qapplication.cpp:2305
#20 0x4094c209 in KApplication::notify(QObject*, QEvent*) (this=0xbffff0a0, 
    receiver=0x814bdb8, event=0xbfffeec0)
    at /home/ingo/cvs/kde/head/kdelibs/kdecore/kapplication.cpp:503
#21 0x4012f1bf in QApplication::sendEvent(QObject*, QEvent*) (
    receiver=0x814bdb8, event=0xbfffeec0) at qapplication.h:492
#22 0x40dbac9c in QEventLoop::activateSocketNotifiers() (this=0x80d60b8)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qeventloop_unix.cpp:579
#23 0x40d753e3 in QEventLoop::processEvents(unsigned) (this=0x80d60b8, flags=4)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qeventloop_x11.cpp:340
#24 0x40de25fa in QEventLoop::enterLoop() (this=0x80d60b8)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qeventloop.cpp:198
#25 0x40de2516 in QEventLoop::exec() (this=0x80d60b8)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qeventloop.cpp:145
#26 0x40dccc85 in QApplication::exec() (this=0xbffff0a0)
    at /home/ingo/cvs/kde/qt-copy/src/kernel/qapplication.cpp:2705
#27 0x0805b3f6 in main (argc=2, argv=0xbffff244)
    at /home/ingo/cvs/kde/head/kdepim/kontact/src/main.cpp:113
#28 0x417da857 in __libc_start_main () from /lib/libc.so.6

===========================================

I'd say the setAutoDelete( true ) (see below and compare to what is done in the d'tor) is wrong. Why? Because 'this' is a member of the list. So this will be deleted -> Boom.

void
KCmdLineArgs::reset()
{
   if ( argsList ) {
      argsList->setAutoDelete( true );
      argsList->clear();
      delete argsList;
      argsList = 0;
   }
   parsed = false;
}

KCmdLineArgs::~KCmdLineArgs()
{
  delete parsedOptionList;
  delete parsedArgList;
  if (argsList)
  {
     argsList->removeRef(this);
     if (argsList->count() == 0)
     {
        delete argsList;
        argsList = 0;
     }
  }
}
Comment 1 Ingo Klöcker 2004-01-12 23:01:14 UTC
Kontact also crashes if the KMail button in Kicker is clicked while Kontact is already running with the Mail component. I'd say this qualifies as showstopper, but it should be easy to fix by someone who knows a bit better than me what's going on in KCmdLineArgs.
Comment 2 Ingo Klöcker 2004-01-13 02:20:46 UTC
I just found out that Kontact only crashes if it was started with the --nofork option. So this bug isn't that severe (although it should be fixed nevertheless).
Comment 3 Waldo Bastian 2004-01-15 00:23:02 UTC
Subject: kdelibs/kdecore

CVS commit by waba: 

Don't crash in KCmdLineArgs::reset() (BR72517)
CCMAIL: 72517-done@bugs.kde.org


  M +0 -7      kcmdlineargs.cpp   1.90


--- kdelibs/kdecore/kcmdlineargs.cpp  #1.89:1.90
@@ -983,12 +983,5 @@ KCmdLineArgs::~KCmdLineArgs()
   delete parsedArgList;
   if (argsList)
-  {
      argsList->removeRef(this);
-     if (argsList->count() == 0)
-     {
-        delete argsList;
-        argsList = 0;
-     }
-  }
 }