Bug 157102 - crash when deleting contact while chat window is open
Summary: crash when deleting contact while chat window is open
Alias: None
Product: kopete
Classification: Applications
Component: general (show other bugs)
Version: 0.50.0
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Kopete Developers
: 158655 (view as bug list)
Depends on:
Reported: 2008-02-01 21:19 UTC by Oliver Putz
Modified: 2008-03-12 23:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:

konsole output while kopete crashes on bug #157102 (347.74 KB, text/plain)
2008-03-10 20:57 UTC, Oliver Putz
More debug (1.73 KB, patch)
2008-03-10 22:15 UTC, Roman Jarosz
Crash fix (530 bytes, patch)
2008-03-11 19:36 UTC, Roman Jarosz
More debug 2 (3.20 KB, patch)
2008-03-12 14:40 UTC, Roman Jarosz

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Putz 2008-02-01 21:19:36 UTC
Version:           0.50.0 (using 4.00.60 (KDE 4.0.60 >= 20080129), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc
OS:                Linux (i686) release 2.6.23-gentoo-r3

Steps to reproduce:

1) Create two ICQ accounts and log into both accounts (same kopete)
2) Start chat between the two accounts
3) Delete one of the accounts from the contact list
4) See kopete crash

Note: This also works with MSN acconts, Jabber accounts and I guess with all other accounts...

Backtrace for ICQ:
Application: Kopete (kopete), signal SIGABRT
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 0xb5cd86d0 (LWP 20516)]
[New Thread 0xb3aaeb90 (LWP 16033)]
[KCrash handler]
#6  0xffffe410 in __kernel_vsyscall ()
#7  0xb5f701f1 in *__GI_raise (sig=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#8  0xb5f719b8 in *__GI_abort () at abort.c:88
#9  0xb7d64265 in qt_message_output (msgType=QtFatalMsg, 
    buf=0xbfd21dbc "ASSERT: \"!isEmpty()\" in file /usr/include/qt4/QtCore/qlist.h, line 243") at global/qglobal.cpp:2160
#10 0xb7d6432a in qFatal (msg=0xb7e6b87c "ASSERT: \"%s\" in file %s, line %d")
    at global/qglobal.cpp:2392
#11 0xb7d64555 in qt_assert (assertion=0xb428a580 "!isEmpty()", 
    file=0xb4289dc0 "/usr/include/qt4/QtCore/qlist.h", line=243)
    at global/qglobal.cpp:1917
#12 0xb427460a in QList<Kopete::Contact*>::first (this=0x8685d88)
    at /usr/include/qt4/QtCore/qlist.h:243
#13 0xb426d812 in ChatMessagePart::formatStyleKeywords (this=0x86fe7e8, 
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/kopete/chatwindow/chatmessagepart.cpp:985
#14 0xb42711f4 in ChatMessagePart::writeTemplate (this=0x86fe7e8)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/kopete/chatwindow/chatmessagepart.cpp:1189
#15 0xb427207c in ChatMessagePart::changeStyle (this=0x86fe7e8)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/kopete/chatwindow/chatmessagepart.cpp:1125
#16 0xb4272e02 in ChatMessagePart::qt_metacall (this=0x86fe7e8, 
    _c=QMetaObject::InvokeMetaMethod, _id=130, _a=0xbfd24524)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork_build/kopete/kopete/chatwindow/chatmessagepart.moc:131
#17 0xb7e4a1f4 in QMetaObject::activate (sender=0x8255e80, 
    from_signal_index=4, to_signal_index=4, argv=<value optimized out>)
    at kernel/qobject.cpp:3081
#18 0xb7e4ad94 in QMetaObject::activate (sender=0x8255e80, m=0xb7ee8c64, 
    local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3140
#19 0xb7e533c3 in QSingleShotTimer::timeout (this=0x8255e80)
    at .moc/debug-shared/qtimer.moc:73
#20 0xb7e5340c in QSingleShotTimer::timerEvent (this=0x8255e80)
    at kernel/qtimer.cpp:296
#21 0xb7e48269 in QObject::event (this=0x8255e80, e=0x5024)
    at kernel/qobject.cpp:1086
#22 0xb6dade8a in QApplicationPrivate::notify_helper (this=0x80bd208, 
    receiver=0x8255e80, e=0xbfd24a58) at kernel/qapplication.cpp:3556
#23 0xb6daf77a in QApplication::notify (this=0xbfd24cd8, receiver=0x8255e80, 
    e=0xbfd24a58) at kernel/qapplication.cpp:3115
#24 0xb78dfc03 in KApplication::notify (this=0xbfd24cd8, receiver=0x8255e80, 
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kdeui/kernel/kapplication.cpp:311
#25 0xb7e36d7b in QCoreApplication::notifyInternal (this=0xbfd24cd8, 
    receiver=0x8255e80, event=0xbfd24a58) at kernel/qcoreapplication.cpp:530
#26 0xb7e5fefb in QTimerInfoList::activateTimers (this=0x80be544)
    at kernel/qcoreapplication.h:200
#27 0xb7e5ffd1 in QEventDispatcherUNIX::activateTimers (this=0x80c4e38)
    at kernel/qeventdispatcher_unix.cpp:828
#28 0xb7e609ab in QEventDispatcherUNIX::processEvents (this=0x80c4e38, 
    flags=@0xbfd24bd8) at kernel/qeventdispatcher_unix.cpp:890
#29 0xb6e37cce in QEventDispatcherX11::processEvents (this=0x80c4e38, 
    flags=@0xbfd24c04) at kernel/qeventdispatcher_x11.cpp:145
#30 0xb7e36191 in QEventLoop::processEvents (this=0xbfd24c70, 
    flags=@0xbfd24c38) at kernel/qeventloop.cpp:140
#31 0xb7e3629a in QEventLoop::exec (this=0xbfd24c70, flags=@0xbfd24c78)
    at kernel/qeventloop.cpp:186
#32 0xb7e38626 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:759
#33 0xb6dad487 in QApplication::exec () at kernel/qapplication.cpp:3053
#34 0x080891ec in main (argc=)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/kopete/main.cpp:102
#35 0xb5f5cfdc in __libc_start_main (main=0x8087250 <main>, argc=1, 
    ubp_av=0xbfd250c4, init=0x80986f0 <__libc_csu_init>, 
    fini=0x80986e0 <__libc_csu_fini>, rtld_fini=0xb7efa100 <_dl_fini>, 
    stack_end=0xbfd250bc) at libc-start.c:229
#36 0x08064411 in _start ()
#0  0xffffe410 in __kernel_vsyscall ()

Backtrace for Jabber:
Application: Kopete (kopete), signal SIGABRT
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 0xb5d8c6d0 (LWP 27673)]
[KCrash handler]
#6  0xffffe410 in __kernel_vsyscall ()
#7  0xb60241f1 in *__GI_raise (sig=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#8  0xb60259b8 in *__GI_abort () at abort.c:88
#9  0xb7e18265 in qt_message_output (msgType=QtFatalMsg, 
    buf=0xbfe6937c "ASSERT: \"!isEmpty()\" in file /usr/include/qt4/QtCore/qlist.h, line 243") at global/qglobal.cpp:2160
#10 0xb7e1832a in qFatal (msg=0xb7f1f87c "ASSERT: \"%s\" in file %s, line %d")
    at global/qglobal.cpp:2392
#11 0xb7e18555 in qt_assert (assertion=0xb46407f9 "!isEmpty()", 
    file=0xb463d380 "/usr/include/qt4/QtCore/qlist.h", line=243)
    at global/qglobal.cpp:1917
#12 0xb4626eda in QList<Kopete::Contact*>::first (this=0x82e2178)
    at /usr/include/qt4/QtCore/qlist.h:243
#13 0xb46258b2 in JabberChatSession::sendNotification (this=0x82e40e0, 
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/protocols/jabber/jabberchatsession.cpp:261
#14 0xb462641b in ~JabberChatSession (this=0x82e40e0)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/protocols/jabber/jabberchatsession.cpp:107
#15 0xb7efbfd7 in QObject::event (this=0x82e40e0, e=0x6c19)
    at kernel/qobject.cpp:1105
#16 0xb6e61e8a in QApplicationPrivate::notify_helper (this=0x80bd208, 
    receiver=0x82e40e0, e=0x830bbe0) at kernel/qapplication.cpp:3556
#17 0xb6e6377a in QApplication::notify (this=0xbfe6bc58, receiver=0x82e40e0, 
    e=0x830bbe0) at kernel/qapplication.cpp:3115
#18 0xb7993c03 in KApplication::notify (this=0xbfe6bc58, receiver=0x82e40e0, 
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kdeui/kernel/kapplication.cpp:311
#19 0xb7eead7b in QCoreApplication::notifyInternal (this=0xbfe6bc58, 
    receiver=0x82e40e0, event=0x830bbe0) at kernel/qcoreapplication.cpp:530
#20 0xb7eec21a in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, 
    event_type=0, data=0x80a7f50) at kernel/qcoreapplication.h:200
#21 0xb7f14905 in QEventDispatcherUNIX::processEvents (this=0x80c4ed8, 
    flags=@0xbfe6bb58) at kernel/qeventdispatcher_unix.cpp:858
#22 0xb6eebcce in QEventDispatcherX11::processEvents (this=0x80c4ed8, 
    flags=@0xbfe6bb84) at kernel/qeventdispatcher_x11.cpp:145
#23 0xb7eea191 in QEventLoop::processEvents (this=0xbfe6bbf0, 
    flags=@0xbfe6bbb8) at kernel/qeventloop.cpp:140
#24 0xb7eea29a in QEventLoop::exec (this=0xbfe6bbf0, flags=@0xbfe6bbf8)
    at kernel/qeventloop.cpp:186
#25 0xb7eec626 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:759
#26 0xb6e61487 in QApplication::exec () at kernel/qapplication.cpp:3053
#27 0x080891ec in main (argc=)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/kopete/main.cpp:102
#28 0xb6010fdc in __libc_start_main (main=0x8087250 <main>, argc=1, 
    ubp_av=0xbfe6c044, init=0x80986f0 <__libc_csu_init>, 
    fini=0x80986e0 <__libc_csu_fini>, rtld_fini=0xb7fae100 <_dl_fini>, 
    stack_end=0xbfe6c03c) at libc-start.c:229
#29 0x08064411 in _start ()
#0  0xffffe410 in __kernel_vsyscall ()
Comment 1 Roman Jarosz 2008-02-02 14:07:33 UTC
SVN commit 769935 by rjarosz:

Fix bug 157102: crash when deleting contact while chat window is open.
We can't call the first() function in QList when a list is empty.

BUG: 157102

 M  +4 -3      kopete/chatwindow/chatmessagepart.cpp  
 M  +2 -2      protocols/jabber/jabberchatsession.cpp  
 M  +2 -2      protocols/msn/msnchatsession.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=769935
Comment 2 Roman Jarosz 2008-02-02 14:11:36 UTC
SVN commit 769942 by rjarosz:

Backport fix for bug 157102: crash when deleting contact while chat window is open.
We can't call the first() function in QList when a list is empty.

CCBUG: 157102

 M  +4 -3      kopete/chatwindow/chatmessagepart.cpp  
 M  +2 -2      protocols/jabber/jabberchatsession.cpp  
 M  +2 -2      protocols/msn/msnchatsession.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=769942
Comment 3 Roman Jarosz 2008-03-02 15:55:57 UTC
*** Bug 158655 has been marked as a duplicate of this bug. ***
Comment 4 Oliver Putz 2008-03-10 02:45:49 UTC
Roman, thanks first of all for fixing this bug. However, in the commit 769935 you regrettably only fixed the msn and jabber plugin. The bug in the ICQ plugin is still not fixed as the following backtrace shows:

Application: Kopete (kopete), signal SIGSEGV
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 0xb5a566d0 (LWP 5747)]
[New Thread 0xb308bb90 (LWP 7389)]
[KCrash handler]
#6  0xb6b2d7ca in Kopete::Contact::account (this=0xbf9b34b4)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/libkopete/kopetecontact.cpp:465
#7  0xb6b65e8c in Kopete::ChatSessionMembersListModel::data (this=0x8770558, 
    index=@0xbf9b38d4, role=1)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/libkopete/chatsessionmemberslistmodel.cpp:92
#8  0xb72ef18c in QStyledItemDelegate::initStyleOption (this=0x84b2400, 
    option=0xbf9b3644, index=@0xbf9b38d4)
    at ../../include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:373
#9  0xb72f0277 in QStyledItemDelegate::sizeHint (this=0x84b2400, 
    option=@0xbf9b3834, index=@0xbf9b38d4)
    at itemviews/qstyleditemdelegate.cpp:437
#10 0xb725ce76 in QListViewPrivate::itemSize (this=0x87d9498, 
    option=@0xbf9b3834, index=@0xbf9b38d4) at itemviews/qlistview.cpp:2061
#11 0xb725ece7 in QStaticListViewBase::doStaticLayout (this=0x87d2ea8, 
    at ../../include/QtGui/private/../../../src/gui/itemviews/qlistview_p.h:420
#12 0xb725ef99 in QStaticListViewBase::doBatchedItemLayout (this=0x87d2ea8, 
    info=@0xbf9b3974, max=4005176) at itemviews/qlistview.cpp:2184
#13 0xb725f17a in QListViewPrivate::doItemsLayout (this=0x87d9498, 
    delta=4005177) at itemviews/qlistview.cpp:1983
#14 0xb725f29d in QListView::doItemsLayout (this=0x87d2b38)
    at itemviews/qlistview.cpp:1633
#15 0xb725f35c in QListView::timerEvent (this=0x87d2b38, e=0xbf9b4078)
    at itemviews/qlistview.cpp:830
#16 0xb7ec0107 in QObject::event (this=0x87d2b38, e=0xbf9b4078)
    at kernel/qobject.cpp:1096
#17 0xb6d75512 in QWidget::event (this=0x87d2b38, event=0xbf9b4078)
    at kernel/qwidget.cpp:7233
#18 0xb70f0903 in QFrame::event (this=0x87d2b38, e=0xbf9b4078)
    at widgets/qframe.cpp:657
#19 0xb71905ff in QAbstractScrollArea::event (this=0x87d2b38, e=0xbf9b4078)
    at widgets/qabstractscrollarea.cpp:894
#20 0xb7234bdc in QAbstractItemView::event (this=0x87d2b38, event=0xbf9b4078)
    at itemviews/qabstractitemview.cpp:1361
#21 0xb7254e54 in QListView::event (this=0x87d2b38, e=0xbf9b4078)
    at itemviews/qlistview.cpp:1882
#22 0xb6d1771f in QApplicationPrivate::notify_helper (this=0x80be750, 
    receiver=0x87d2b38, e=0xbf9b4078) at kernel/qapplication.cpp:3735
#23 0xb6d1925f in QApplication::notify (this=0xbf9b42f8, receiver=0x87d2b38, 
    e=0xbf9b4078) at kernel/qapplication.cpp:3329
#24 0xb7914c93 in KApplication::notify (this=0xbf9b42f8, receiver=0x87d2b38, 
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kdeui/kernel/kapplication.cpp:311
#25 0xb7eadcf7 in QCoreApplication::notifyInternal (this=0xbf9b42f8, 
    receiver=0x87d2b38, event=0xbf9b4078) at kernel/qcoreapplication.cpp:586
#26 0xb7ede67b in QTimerInfoList::activateTimers (this=0x80bfa5c)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#27 0xb7ede751 in QEventDispatcherUNIX::activateTimers (this=0x80c6d88)
    at kernel/qeventdispatcher_unix.cpp:837
#28 0xb7ede88b in QEventDispatcherUNIX::processEvents (this=0x80c6d88, 
    flags=@0xbf9b41f8) at kernel/qeventdispatcher_unix.cpp:899
#29 0xb6dafcfe in QEventDispatcherX11::processEvents (this=0x80c6d88, 
    flags=@0xbf9b4224) at kernel/qeventdispatcher_x11.cpp:154
#30 0xb7eace61 in QEventLoop::processEvents (this=0xbf9b4290, 
    flags=@0xbf9b4258) at kernel/qeventloop.cpp:146
#31 0xb7eacf8f in QEventLoop::exec (this=0xbf9b4290, flags=@0xbf9b4298)
    at kernel/qeventloop.cpp:197
#32 0xb7eaf476 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:838
#33 0xb6d16e37 in QApplication::exec () at kernel/qapplication.cpp:3267
#34 0x0808957c in main (argc=144244816, argv=0x8ab0c00)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/kopete/main.cpp:102
#35 0xb5e53fdc in __libc_start_main (main=0x80875e0 <main>, argc=3, 
    ubp_av=0xbf9b46e4, init=0x8099260 <__libc_csu_init>, 
    fini=0x8099250 <__libc_csu_fini>, rtld_fini=0xb7fad100 <_dl_fini>, 
    stack_end=0xbf9b46dc) at libc-start.c:229
#36 0x080646f1 in _start ()
#0  0xffffe410 in __kernel_vsyscall ()

P.S.: Roman, as you fixed the bugs in the MSN and jabber plugin, I added you to the CC list.
Comment 5 Roman Jarosz 2008-03-10 17:35:34 UTC
Hi, the backtrace you have added is different then the first one so this isn't the same crash. Anyway I can't reproduce this crash with current 4.0 and 4.1 svn Kopete versions. If you can reproduce the crash please tell me exactly what you are doing.

PS. Don't add me to CC list because I'm already subscribed to kopete-devel so I'll get this mail anyway.
Comment 6 Oliver Putz 2008-03-10 18:13:58 UTC

The procedure is pretty much the same as for the MSN and Jabber crash.

1) Create two ICQ Accounts
2) Use kopete to log into both accounts
3) Start a chat between the two (both accounts write one message)
4) Delete one of the accounts from the kopete contact list
5) Watch kopete crash

You can find a video showing the exact steps to reproduce the crash at http://oliver-putz.de/bugzilla/bug157102.ogg
Comment 7 Roman Jarosz 2008-03-10 19:36:21 UTC
Still can't make it crash :(, maybe some commit fix it already how old is your Kopete? :(

If update won't help or you are using the latest version could you run Kopete from konsole with this below command and send me the crash.log?

"valgrind kopete --nofork 2>&1 2>crash.log" 

this should catch more info btw Kopete will be really slow so be patient.
Comment 8 Oliver Putz 2008-03-10 20:29:37 UTC
Hi! My kdenetwork is revision 783794, so not really too old. Problem is: If I run kopete in valgrind, I cannot reproduce the crash any longer. (Running without valgrind, I can easily crash it.)
As I am banned from the ICQ network for several minutes for reconnecting too often right now anyways, I'll just recompile kdenetwork and see if the problem was fixed within the last 500 or so commits.
Comment 9 Oliver Putz 2008-03-10 20:57:22 UTC
Created attachment 23851 [details]
konsole output while kopete crashes on bug #157102

Hi, as I right now have some problems connecting to the svn server, I played a
little more with kopete.

I tried to get some konole output by running kopete &> konsoleOutputCrash1.txt.
Hover, I could delete (and re-add) the contact roughly three times before at
the fourth time kopete finally crashed. I'll attach the log for this. (warning,
I delete and add the contact roughly three times, so the upper part most likely
is unimportant)
Comment 10 Roman Jarosz 2008-03-10 22:15:31 UTC
Created attachment 23856 [details]
More debug

Hm I have no idea why it crashes and I can't reproduce this :(
I've attached a patch that should give me more info, please apply the patch
, compile it and run Kopete with "kopete --nofork 2>&1 2>crash.log"

Comment 11 Oliver Putz 2008-03-11 00:54:09 UTC
Ok, as expected, updating to the most recent version did not help.
Below you can find the backtrace for the patched version (differs slightly?)
You can find the log you requested at http://oliver-putz.de/bugzilla/crash.log
(It only crashed the second time, so I'll try to find out what exactly I do / don't do when it crashes / does not crash...)

Application: Kopete (kopete), signal SIGSEGV
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 0xb5a166d0 (LWP 2471)]
[New Thread 0xb3806b90 (LWP 2472)]
[KCrash handler]
#6  0xb7e854dd in operator<< (dbg=@0xbf94b7e0, o=0x86970e8)
    at kernel/qobject.cpp:3375
#7  0xb6b2651f in Kopete::ChatSessionMembersListModel::contactAt (
    this=0x8634ec0, index=@0xbf94bb24)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/libkopete/chatsessionmemberslistmodel.cpp:61
#8  0xb6b2663f in Kopete::ChatSessionMembersListModel::data (this=0x8634ec0, 
    index=@0xbf94bb24, role=13)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/libkopete/chatsessionmemberslistmodel.cpp:84
#9  0xb72b11f0 in QStyledItemDelegate::sizeHint (this=0x8177570, 
    option=@0xbf94ba84, index=@0xbf94bb24)
    at ../../include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:373
#10 0xb721de76 in QListViewPrivate::itemSize (this=0x8629678, 
    option=@0xbf94ba84, index=@0xbf94bb24) at itemviews/qlistview.cpp:2061
#11 0xb721fce7 in QStaticListViewBase::doStaticLayout (this=0x85f9c38, 
    at ../../include/QtGui/private/../../../src/gui/itemviews/qlistview_p.h:420
#12 0xb721ff99 in QStaticListViewBase::doBatchedItemLayout (this=0x85f9c38, 
    info=@0xbf94bbc4, max=1562704) at itemviews/qlistview.cpp:2184
#13 0xb722017a in QListViewPrivate::doItemsLayout (this=0x8629678, 
    delta=1562705) at itemviews/qlistview.cpp:1983
#14 0xb722029d in QListView::doItemsLayout (this=0x85e3a38)
    at itemviews/qlistview.cpp:1633
#15 0xb722035c in QListView::timerEvent (this=0x85e3a38, e=0xbf94c2c8)
    at itemviews/qlistview.cpp:830
#16 0xb7e82107 in QObject::event (this=0x85e3a38, e=0xbf94c2c8)
    at kernel/qobject.cpp:1096
#17 0xb6d36512 in QWidget::event (this=0x85e3a38, event=0xbf94c2c8)
    at kernel/qwidget.cpp:7233
#18 0xb70b1903 in QFrame::event (this=0x85e3a38, e=0xbf94c2c8)
    at widgets/qframe.cpp:657
#19 0xb71515ff in QAbstractScrollArea::event (this=0x85e3a38, e=0xbf94c2c8)
    at widgets/qabstractscrollarea.cpp:894
#20 0xb71f5bdc in QAbstractItemView::event (this=0x85e3a38, event=0xbf94c2c8)
    at itemviews/qabstractitemview.cpp:1361
#21 0xb7215e54 in QListView::event (this=0x85e3a38, e=0xbf94c2c8)
    at itemviews/qlistview.cpp:1882
#22 0xb6cd871f in QApplicationPrivate::notify_helper (this=0x80be390, 
    receiver=0x85e3a38, e=0xbf94c2c8) at kernel/qapplication.cpp:3735
#23 0xb6cda25f in QApplication::notify (this=0xbf94c548, receiver=0x85e3a38, 
    e=0xbf94c2c8) at kernel/qapplication.cpp:3329
#24 0xb78d5c93 in KApplication::notify (this=0xbf94c548, receiver=0x85e3a38, 
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kdeui/kernel/kapplication.cpp:311
#25 0xb7e6fcf7 in QCoreApplication::notifyInternal (this=0xbf94c548, 
    receiver=0x85e3a38, event=0xbf94c2c8) at kernel/qcoreapplication.cpp:586
#26 0xb7ea067b in QTimerInfoList::activateTimers (this=0x80bf74c)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#27 0xb7ea0751 in QEventDispatcherUNIX::activateTimers (this=0x80c6c90)
    at kernel/qeventdispatcher_unix.cpp:837
#28 0xb7ea088b in QEventDispatcherUNIX::processEvents (this=0x80c6c90, 
    flags=@0xbf94c448) at kernel/qeventdispatcher_unix.cpp:899
#29 0xb6d70cfe in QEventDispatcherX11::processEvents (this=0x80c6c90, 
    flags=@0xbf94c474) at kernel/qeventdispatcher_x11.cpp:154
#30 0xb7e6ee61 in QEventLoop::processEvents (this=0xbf94c4e0, 
    flags=@0xbf94c4a8) at kernel/qeventloop.cpp:146
#31 0xb7e6ef8f in QEventLoop::exec (this=0xbf94c4e0, flags=@0xbf94c4e8)
    at kernel/qeventloop.cpp:197
#32 0xb7e71476 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:838
#33 0xb6cd7e37 in QApplication::exec () at kernel/qapplication.cpp:3267
#34 0x0808957c in main (argc=138185664, argv=0x1)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/kopete/main.cpp:102
#35 0xb5e13fdc in __libc_start_main (main=0x80875e0 <main>, argc=1, 
    ubp_av=0xbf94c934, init=0x8099260 <__libc_csu_init>, 
    fini=0x8099250 <__libc_csu_fini>, rtld_fini=0xb7f6f100 <_dl_fini>, 
    stack_end=0xbf94c92c) at libc-start.c:229
#36 0x080646f1 in _start ()
#0  0xffffe410 in __kernel_vsyscall ()
Comment 12 Roman Jarosz 2008-03-11 19:36:17 UTC
Created attachment 23867 [details]
Crash fix

Could you check if attached patch will fix the crash.
Comment 13 Oliver Putz 2008-03-12 01:14:08 UTC
Hi! I just tried the patch, but regrettably I can still crash kopete with the following backtrace:

Application: Kopete (kopete), signal SIGSEGV
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 0xb59d96d0 (LWP 21040)]
[New Thread 0xb37c9b90 (LWP 21047)]
[KCrash handler]
#6  0xb6ab08da in Kopete::Contact::account (this=0xbfb4fb84)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/libkopete/kopetecontact.cpp:465
#7  0xb6ae8f9c in Kopete::ChatSessionMembersListModel::data (this=0x85cc9d0, 
    index=@0xbfb4ffa4, role=1)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/libkopete/chatsessionmemberslistmodel.cpp:92
#8  0xb727218c in QStyledItemDelegate::initStyleOption (this=0x819ff60, 
    option=0xbfb4fd14, index=@0xbfb4ffa4)
    at ../../include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:373
#9  0xb7273277 in QStyledItemDelegate::sizeHint (this=0x819ff60, 
    option=@0xbfb4ff04, index=@0xbfb4ffa4)
    at itemviews/qstyleditemdelegate.cpp:437
#10 0xb71dfe76 in QListViewPrivate::itemSize (this=0x86b3680, 
    option=@0xbfb4ff04, index=@0xbfb4ffa4) at itemviews/qlistview.cpp:2061
#11 0xb71e1ce7 in QStaticListViewBase::doStaticLayout (this=0x846c958, 
    at ../../include/QtGui/private/../../../src/gui/itemviews/qlistview_p.h:420
#12 0xb71e1f99 in QStaticListViewBase::doBatchedItemLayout (this=0x846c958, 
    info=@0xbfb50044, max=4566344) at itemviews/qlistview.cpp:2184
#13 0xb71e217a in QListViewPrivate::doItemsLayout (this=0x86b3680, 
    delta=4566345) at itemviews/qlistview.cpp:1983
#14 0xb71e229d in QListView::doItemsLayout (this=0x8644528)
    at itemviews/qlistview.cpp:1633
#15 0xb71e235c in QListView::timerEvent (this=0x8644528, e=0xbfb50748)
    at itemviews/qlistview.cpp:830
#16 0xb7e44107 in QObject::event (this=0x8644528, e=0xbfb50748)
    at kernel/qobject.cpp:1096
#17 0xb6cf8512 in QWidget::event (this=0x8644528, event=0xbfb50748)
    at kernel/qwidget.cpp:7233
#18 0xb7073903 in QFrame::event (this=0x8644528, e=0xbfb50748)
    at widgets/qframe.cpp:657
#19 0xb71135ff in QAbstractScrollArea::event (this=0x8644528, e=0xbfb50748)
    at widgets/qabstractscrollarea.cpp:894
#20 0xb71b7bdc in QAbstractItemView::event (this=0x8644528, event=0xbfb50748)
    at itemviews/qabstractitemview.cpp:1361
#21 0xb71d7e54 in QListView::event (this=0x8644528, e=0xbfb50748)
    at itemviews/qlistview.cpp:1882
#22 0xb6c9a71f in QApplicationPrivate::notify_helper (this=0x80be388, 
    receiver=0x8644528, e=0xbfb50748) at kernel/qapplication.cpp:3735
#23 0xb6c9c25f in QApplication::notify (this=0xbfb509c8, receiver=0x8644528, 
    e=0xbfb50748) at kernel/qapplication.cpp:3329
#24 0xb7897c93 in KApplication::notify (this=0xbfb509c8, receiver=0x8644528, 
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kdeui/kernel/kapplication.cpp:311
#25 0xb7e31cf7 in QCoreApplication::notifyInternal (this=0xbfb509c8, 
    receiver=0x8644528, event=0xbfb50748) at kernel/qcoreapplication.cpp:586
#26 0xb7e6267b in QTimerInfoList::activateTimers (this=0x80bf744)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#27 0xb7e62751 in QEventDispatcherUNIX::activateTimers (this=0x80c72b8)
    at kernel/qeventdispatcher_unix.cpp:837
#28 0xb7e6288b in QEventDispatcherUNIX::processEvents (this=0x80c72b8, 
    flags=@0xbfb508c8) at kernel/qeventdispatcher_unix.cpp:899
#29 0xb6d32cfe in QEventDispatcherX11::processEvents (this=0x80c72b8, 
    flags=@0xbfb508f4) at kernel/qeventdispatcher_x11.cpp:154
#30 0xb7e30e61 in QEventLoop::processEvents (this=0xbfb50960, 
    flags=@0xbfb50928) at kernel/qeventloop.cpp:146
#31 0xb7e30f8f in QEventLoop::exec (this=0xbfb50960, flags=@0xbfb50968)
    at kernel/qeventloop.cpp:197
#32 0xb7e33476 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:838
#33 0xb6c99e37 in QApplication::exec () at kernel/qapplication.cpp:3267
#34 0x0808957c in main (argc=140405576, argv=0x88cc640)
    at /var/tmp/portage/kde-base/kdenetwork-9999.4/work/kdenetwork-9999.4/kopete/kopete/main.cpp:102
#35 0xb5dd6fdc in __libc_start_main (main=0x80875e0 <main>, argc=1, 
    ubp_av=0xbfb50db4, init=0x8099260 <__libc_csu_init>, 
    fini=0x8099250 <__libc_csu_fini>, rtld_fini=0xb7f31100 <_dl_fini>, 
    stack_end=0xbfb50dac) at libc-start.c:229
#36 0x080646f1 in _start ()
#0  0xffffe410 in __kernel_vsyscall ()
Comment 14 Roman Jarosz 2008-03-12 14:40:12 UTC
Created attachment 23876 [details]
More debug 2

Hi, I still don't know why it crashes... the only thing that comes to my mind
right now is that your Kopete is miscompiled somehow. Which version of gcc do
you have?

Could you also apply the attached patch and run Kopete with
"kopete --nofork 2>&1 2>crash.log" and send me the crash.log and crash

Comment 15 Oliver Putz 2008-03-12 16:58:58 UTC
Hi! I am currently recompiling kopete. But until that is done, here some other information that you requested:

My gcc version is: gcc version 4.1.2 20070214 (  (gdc 0.24, using dmd 1.020)) (Gentoo 4.1.2 p1.0.2)

To be more precise:

kdesvn@Remus ~ $ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt--disable-libunwind-exceptions --disable-multilib --enable-libmudflap --disable-libssp --with-arch=i686 --enable-languages=c,c++,d,java,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 20070214 (  (gdc 0.24, using dmd 1.020)) (Gentoo 4.1.2 p1.0.2)

Other than that: I use Gentoo and compile all code with the following flags:

CFLAGS="-Os -march=pentium-m -ggdb"

I guess that really should not lead to problems with gcc over-optimizing any of the code :)
Comment 16 Oliver Putz 2008-03-12 18:00:17 UTC
Hey, I have a good news: I just played a little more with kopete and it seems that your first patch (the one where you used the QPointer) did fix the problem.

Apparently I just made some mistake patching the program back then :-/ (sorry for that...)

I'll play with it a little longer but it seems that this bug is now completely fixed! Thanks a lot! (and sorry for me applying the patch wrong)
Comment 17 Roman Jarosz 2008-03-12 20:03:20 UTC
SVN commit 784897 by rjarosz:

Fix bug 157102: crash when deleting contact while chat window is open
Disconnect old ChatSession connections when ChatSession was changed.

BUG: 157102

 M  +25 -10    chatsessionmemberslistmodel.cpp  
 M  +5 -0      chatsessionmemberslistmodel.h  

WebSVN link: http://websvn.kde.org/?view=rev&revision=784897
Comment 18 Roman Jarosz 2008-03-12 20:04:07 UTC
SVN commit 784898 by rjarosz:

Backport fix for bug 157102: crash when deleting contact while chat window is open
Disconnect old ChatSession connections when ChatSession was changed.

CCBUG: 157102

 M  +25 -10    chatsessionmemberslistmodel.cpp  
 M  +5 -0      chatsessionmemberslistmodel.h  

WebSVN link: http://websvn.kde.org/?view=rev&revision=784898
Comment 19 Roman Jarosz 2008-03-12 20:06:50 UTC
Oliver please test the fix that is now in svn, the fix is slightly different but the logic is the same.
Comment 20 Oliver Putz 2008-03-12 23:17:09 UTC
Hi, I just ran some tests one the new svn version (784945) and I can say that it works like a charm! Thanks once more for fixing it!