Bug 55385 - Chat open (click on contact) crashes if protocol offline
Summary: Chat open (click on contact) crashes if protocol offline
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: libkopete (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 55392 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-01 19:40 UTC by Boyd Faulkner
Modified: 2004-05-16 17:25 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 Boyd Faulkner 2003-03-01 19:40:11 UTC
Version:           CVS (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) 
OS:          Linux

If you click on a contact for a protocol that you have not brought online, kopete crashes with the following backtrace.  It happens with OSCAR and Jabber but not with MSN.  OSCAR and Jabber fail every time.  

Eliminating all plugins but, say, OSCAR does not improve the situation.

[New Thread 8192 (LWP 20617)]
0x420ae169 in wait4 () from /lib/i686/libc.so.6
#0  0x420ae169 in wait4 () from /lib/i686/libc.so.6
#1  0x4212a2d0 in __DTOR_END__ () from /lib/i686/libc.so.6
#2  0x414c8c63 in waitpid () from /lib/i686/libpthread.so.0
#3  0x40b5a655 in KCrash::defaultCrashHandler(int) ()
   from /usr/local/kde3/lib/libkdecore.so.4
#4  <signal handler called>
#5  0x4005b6c6 in KopeteContact::metaContact() const ()
   from /usr/local/kde3/lib/libkopete.so.1
#6  0x400b5c5d in Kopete::ChatView::slotContactAdded(KopeteContact const*, bool) () from /usr/local/kde3/lib/libkopete.so.1
#7  0x400b4328 in Kopete::ChatView::createMembersList() ()
   from /usr/local/kde3/lib/libkopete.so.1
#8  0x400b2261 in Kopete::ChatView::ChatView(KopeteMessageManager*, KopeteChatWindow*, QPixmap&, QWidget*, char const*) ()
   from /usr/local/kde3/lib/libkopete.so.1
#9  0x400aca91 in KopeteChatWindow::addChatView(KopeteMessageManager*) ()
   from /usr/local/kde3/lib/libkopete.so.1
#10 0x4008e24d in KopeteViewManager::view(KopeteMessageManager*, bool, KopeteMessage::MessageType) () from /usr/local/kde3/lib/libkopete.so.1
#11 0x4008f173 in KopeteViewManager::launchWindow(KopeteMessageManager*, KopeteMessage::MessageType) () from /usr/local/kde3/lib/libkopete.so.1
#12 0x4005b378 in KopeteContact::startChat() ()
   from /usr/local/kde3/lib/libkopete.so.1
#13 0x4005b3f9 in KopeteContact::execute() ()
   from /usr/local/kde3/lib/libkopete.so.1
#14 0x0806bb76 in KopeteContactListView::slotExecuted(QListViewItem*, QPoint const&, int) ()
#15 0x0806d1d6 in KopeteContactListView::qt_invoke(int, QUObject*) ()
#16 0x40f41e10 in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x8115728, clist=0x811c600, o=0xbfffda80) at kernel/qobject.cpp:2212
#17 0x409446ae in KListView::executed(QListViewItem*, QPoint const&, int) ()
   from /usr/local/kde3/lib/libkdeui.so.4
#18 0x4093ec30 in KListView::emitExecute(QListViewItem*, QPoint const&, int) ()
   from /usr/local/kde3/lib/libkdeui.so.4
#19 0x4093f6c3 in KListView::slotMouseButtonClicked(int, QListViewItem*, QPoint const&, int) () from /usr/local/kde3/lib/libkdeui.so.4
#20 0x409451da in KListView::qt_invoke(int, QUObject*) ()
   from /usr/local/kde3/lib/libkdeui.so.4
#21 0x0806d2a9 in KopeteContactListView::qt_invoke(int, QUObject*) ()
#22 0x40f41e10 in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x8115728, clist=0x811bf60, o=0xbfffdc50) at kernel/qobject.cpp:2212
#23 0x41252b49 in QListView::mouseButtonClicked(int, QListViewItem*, QPoint const&, int) (this=0x8115728, t0=1, t1=0x8224fa8, t2=@0xbfffdd48, t3=0)
    at .moc/debug-shared-mt/moc_qlistview.cpp:469
#24 0x4101b3ef in QListView::contentsMouseReleaseEventEx(QMouseEvent*) (
    this=0x8115728, e=0xbfffde70) at widgets/qlistview.cpp:4346
#25 0x4101ac5d in QListView::contentsMouseReleaseEvent(QMouseEvent*) (
    this=0x8115728, e=0xbfffde70) at widgets/qlistview.cpp:4287
#26 0x4093f39c in KListView::contentsMouseReleaseEvent(QMouseEvent*) ()
   from /usr/local/kde3/lib/libkdeui.so.4
#27 0x4104c5e1 in QScrollView::viewportMouseReleaseEvent(QMouseEvent*) (
    this=0x8115728, e=0xbfffe310) at widgets/qscrollview.cpp:1731
#28 0x4104bcbe in QScrollView::eventFilter(QObject*, QEvent*) (this=0x8115728,
    obj=0x8115e48, e=0xbfffe310) at widgets/qscrollview.cpp:1487
#29 0x410194d2 in QListView::eventFilter(QObject*, QEvent*) (this=0x8115728,
    o=0x8115e48, e=0xbfffe310) at widgets/qlistview.cpp:3684
#30 0x40f3fc8c in QObject::activate_filters(QEvent*) (this=0x8115e48,
    e=0xbfffe310) at kernel/qobject.cpp:827
#31 0x40f3fafe in QObject::event(QEvent*) (this=0x8115e48, e=0xbfffe310)
    at kernel/qobject.cpp:660
#32 0x40f7831c in QWidget::event(QEvent*) (this=0x8115e48, e=0xbfffe310)
    at kernel/qwidget.cpp:4321
#33 0x40ede68c in QApplication::internalNotify(QObject*, QEvent*) (
    this=0xbfffe6d0, receiver=0x8115e48, e=0xbfffe310)
    at kernel/qapplication.cpp:2350
#34 0x40edde6e in QApplication::notify(QObject*, QEvent*) (this=0xbfffe6d0,
    receiver=0x8115e48, e=0xbfffe310) at kernel/qapplication.cpp:2159
#35 0x40ad13c4 in KApplication::notify(QObject*, QEvent*) ()
   from /usr/local/kde3/lib/libkdecore.so.4
#36 0x40e8490b in QApplication::sendSpontaneousEvent(QObject*, QEvent*) (
    receiver=0x8115e48, event=0xbfffe310) at kernel/qapplication.h:481
#37 0x40e7dee4 in QETWidget::translateMouseEvent(_XEvent const*) (
    this=0x8115e48, event=0xbfffe5c0) at kernel/qapplication_x11.cpp:4229
#38 0x40e7bc66 in QApplication::x11ProcessEvent(_XEvent*) (this=0xbfffe6d0,
    event=0xbfffe5c0) at kernel/qapplication_x11.cpp:3407
#39 0x40e93b3a in QEventLoop::processEvents(unsigned) (this=0x80e3b30, flags=4)
    at kernel/qeventloop_x11.cpp:169
#40 0x40ef4be6 in QEventLoop::enterLoop() (this=0x80e3b30)
    at kernel/qeventloop.cpp:191
#41 0x40ef4b02 in QEventLoop::exec() (this=0x80e3b30)
    at kernel/qeventloop.cpp:138
#42 0x40ede805 in QApplication::exec() (this=0xbfffe6d0)
    at kernel/qapplication.cpp:2471
#43 0x080609de in main ()
#44 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6
Comment 1 Till Gerken 2003-03-01 23:24:17 UTC
*** Bug 55392 has been marked as a duplicate of this bug. ***
Comment 2 Till Gerken 2003-03-02 01:31:42 UTC
Subject: kdenonbeta/kopete/protocols/jabber

CVS commit by gerken: 

Fixed crash for Jabber (does not fix other protocols in the CCed bug though)
CCMAIL: 55385@bugs.kde.org


  M +8 -0      jabberprotocol.cpp   1.165


--- kdenonbeta/kopete/protocols/jabber/jabberprotocol.cpp  #1.164:1.165
@@ -212,4 +212,12 @@ void JabberProtocol::init()
                 connect();
 
+        // create a contact instance for self
+        QString userId = KGlobal::config()->readEntry("UserID", "");
+        QString server = KGlobal::config()->readEntry("Server", "jabber.org");
+        myContact = new JabberContact(
+                                        QString("%1@%2").arg(userId, 1).arg(server, 2),
+                                        userId, QStringList(i18n("Unknown")),
+                                        this, 0L, QString::null);
+
 }
 


Comment 3 Boyd Faulkner 2003-03-02 02:34:24 UTC
Interesting.  I added the patch and now MSN will cause a crash, which it did not do before.  I added a 
contact for ICQ and it did not crash but given what just happened, I wonder if there is an ordering 
problem. 
Comment 4 Boyd Faulkner 2003-03-02 10:17:00 UTC
Well, I added an identity so I could connect and the crash went away again but MSN crashes until 
you add it. 
Comment 5 Olivier Goffart 2003-03-02 10:23:56 UTC
Subject: Re: [Kopete-devel]  Chat open (click on contact) crashes if protocol offline

Boyd Faulkner wrote:
> Well, I added an identity so I could connect and the crash went
> away again but MSN crashes until you add it.

This has nothing to do with the previous bug.

Identities are still in work. 
I am aware of this crash. I'm working on identities Api right now.

Comment 6 Boyd Faulkner 2003-03-02 18:54:32 UTC
If you mean, the original report in this bug, I must wonder as the stack traces of the original report 
and the MSN crash with no identity set are the same.  It looks like Till worked around it in Jabber, 
though.  I suspect it will all clear up when the identities work is done. 
 
Thanks to you both, 
Boyd 
Comment 7 Till Gerken 2003-03-02 19:24:09 UTC
This is all because most protocols use myself() as argument to the message manager 
when it requires a KopeteContact for the originator of the messages. When being 
offline, this value can be uninitialized and myself() returns a null pointer or invalid 
pointer, which causes a crash later on when the widget tries display messages with it. 
I guess this problem will arise again when Kopete is being ported to identities. :) 
Comment 8 Olivier Goffart 2003-04-18 20:02:23 UTC
With the account system it is fixed now