Bug 67676 - kopete crashs when clicking on own name in icq chat window
Summary: kopete crashs when clicking on own name in icq chat window
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 68168 70689 71513 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-09 17:48 UTC by Heinrich Wendel
Modified: 2008-07-01 19:39 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch (3.03 KB, patch)
2003-12-29 17:07 UTC, Olivier Goffart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heinrich Wendel 2003-11-09 17:48:11 UTC
Version:            (using KDE KDE 3.1.93)
Installed from:    Gentoo Packages
Compiler:          gcc-3.3 
OS:          Linux

The topic says it all, and to get a valid long description i'm writing some more random stuff here.
Comment 1 Heinrich Wendel 2003-11-09 17:48:35 UTC
haven't compiled with debug so no backtrace, if you need one, i'll recompile
Comment 2 Matt Rogers 2003-11-09 17:51:10 UTC
while you say the summary says it all, I don't understand what you mean. we have to have a set of steps to reproduce this if it's going to be looked into.
Comment 3 Heinrich Wendel 2003-11-09 18:02:10 UTC
-start kopete
-connect to icq
-open a chat window with a icq contact
-left click on your name on the right side of the chat window
-> kopete crashes
Comment 4 Stefan Gehn 2003-11-09 19:04:29 UTC
LOL, it allows opening a chat with myself(), who invented that? =)
Comment 5 Matt Rogers 2003-11-10 03:57:05 UTC
hehe, don't have a clue. Here's a good backtrace for those interested:

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 32055)]
0x41c60998 in waitpid () from /lib/libpthread.so.0
#0  0x41c60998 in waitpid () from /lib/libpthread.so.0
#1  0x411ab390 in __JCR_LIST__ () from /usr/kde/cvs/lib/libkdecore.so.4
#2  0x410e8428 in KCrash::defaultCrashHandler(int) (sig=11)
    at /home/cvs/kde/kdelibs/kdecore/kcrash.cpp:246
#3  0x41c5f645 in __pthread_sighandler () from /lib/libpthread.so.0
#4  <signal handler called>
#5  0x400c6922 in KopetePluginDataObject::pluginData(KopetePlugin*, QString const&) const (this=0x0, plugin=0x82dd190, key=@0xbfffdff0)
    at /home/cvs/kde/kdenetwork/kopete/libkopete/kopeteplugindataobject.cpp:73
#6  0x428281b7 in ChatView::createMembersList() (this=0x84b8000)
    at /home/cvs/kde/kdenetwork/kopete/kopete/chatwindow/chatview.cpp:427
#7  0x42826a1f in ChatView (this=0x84b8000, mgr=0x84b6380, name=0x0)
    at /home/cvs/kde/kdenetwork/kopete/kopete/chatwindow/chatview.cpp:194
#8  0x4280e86c in KopeteViewManager::view(KopeteMessageManager*, bool, KopeteMessage::MessageType) (this=0x822dd08, manager=0x84b6380, type=Chat)
    at /home/cvs/kde/kdenetwork/kopete/kopete/chatwindow/kopeteviewmanager.cpp:118
#9  0x4280f453 in KopeteViewManager::slotRequestView(KopeteView*&, KopeteMessageManager*, KopeteMessage::MessageType) (this=0x822dd08, v=@0xbfffe39c, 
    kmm=0x84b6380, type=Chat)
    at /home/cvs/kde/kdenetwork/kopete/kopete/chatwindow/kopeteviewmanager.cpp:307
#10 0x4280f7ea in KopeteViewManager::qt_invoke(int, QUObject*) (
    this=0x822dd08, _id=11, _o=0xbfffe2e0) at kopeteviewmanager.moc:136
#11 0x415427e7 in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x81daeb0, clist=0x8230b50, o=0xbfffe2e0) at kernel/qobject.cpp:2333
#12 0x400ac0c9 in KopeteMessageManagerFactory::requestView(KopeteView*&, KopeteMessageManager*, KopeteMessage::MessageType) (this=0x81daeb0, t0=@0xbfffe39c, 
    t1=0x84b6380, t2=Chat) at kopetemessagemanagerfactory.moc:243
#13 0x400ab62b in KopeteMessageManagerFactory::createView(KopeteMessageManager*, KopeteMessage::MessageType) (this=0x81daeb0, kmm=0x84b6380, type=Chat)
    at /home/cvs/kde/kdenetwork/kopete/libkopete/kopetemessagemanagerfactory.cpp:154
#14 0x400a880d in KopeteMessageManager::view(bool, KopeteMessage::MessageType)
    (this=0x84b6380, canCreate=true, type=Chat)
    at /home/cvs/kde/kdenetwork/kopete/libkopete/kopetemessagemanager.cpp:346
#15 0x4009a1d8 in KopeteContact::startChat() (this=0x8371800)
    at /home/cvs/kde/kdenetwork/kopete/libkopete/kopetecontact.cpp:437
#16 0x4009a2ad in KopeteContact::execute() (this=0x8371800)
    at /home/cvs/kde/kdenetwork/kopete/libkopete/kopetecontact.cpp:459
#17 0x4282e25d in KopeteContactLVI::slotExecute(QListViewItem*) (
    this=0x8429050, item=0x8429078)
    at /home/cvs/kde/kdenetwork/kopete/kopete/chatwindow/chatview.cpp:1478
#18 0x4282e4f3 in KopeteContactLVI::qt_invoke(int, QUObject*) (this=0x8429050, 
    _id=4, _o=0xbfffe4f0) at chatview.moc:102
#19 0x41542921 in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x8422b20, clist=0x8428ac0, o=0xbfffe4f0) at kernel/qobject.cpp:2357
#20 0x40e19771 in KListView::executed(QListViewItem*) (this=0x8422b20, 
    t0=0x8429078) at klistview.moc:341
#21 0x40e13595 in KListView::emitExecute(QListViewItem*, QPoint const&, int) (
    this=0x8422b20, item=0x8429078, pos=@0xbfffe768, c=1)
    at /home/cvs/kde/kdelibs/kdeui/klistview.cpp:675
#22 0x40e14248 in KListView::slotMouseButtonClicked(int, QListViewItem*, QPoint const&, int) (this=0x8422b20, btn=1, item=0x8429078, pos=@0xbfffe768, c=1)
    at /home/cvs/kde/kdelibs/kdeui/klistview.cpp:879
#23 0x40e1aad2 in KListView::qt_invoke(int, QUObject*) (this=0x8422b20, 
    _id=93, _o=0xbfffe670) at klistview.moc:552
#24 0x415427e7 in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x8422b20, clist=0x8428530, o=0xbfffe670) at kernel/qobject.cpp:2333
#25 0x418a1059 in QListView::mouseButtonClicked(int, QListViewItem*, QPoint const&, int) (this=0x8422b20, t0=1, t1=0x8429078, t2=@0xbfffe768, t3=1)
    at .moc/debug-shared-mt/moc_qlistview.cpp:498
#26 0x416306d4 in QListView::contentsMouseReleaseEventEx(QMouseEvent*) (
    this=0x8422b20, e=0xbfffe930) at widgets/qlistview.cpp:4482
#27 0x4162fb1a in QListView::contentsMouseReleaseEvent(QMouseEvent*) (
    this=0x8422b20, e=0xbfffe930) at widgets/qlistview.cpp:4379
#28 0x40e140c5 in KListView::contentsMouseReleaseEvent(QMouseEvent*) (
    this=0x8422b20, e=0xbfffe930)
    at /home/cvs/kde/kdelibs/kdeui/klistview.cpp:853
#29 0x41664fcc in QScrollView::viewportMouseReleaseEvent(QMouseEvent*) (
    this=0x8422b20, e=0xbfffee70) at widgets/qscrollview.cpp:1746
#30 0x4166464b in QScrollView::eventFilter(QObject*, QEvent*) (this=0x8422b20, 
    obj=0x84258e0, e=0xbfffee70) at widgets/qscrollview.cpp:1502
#31 0x4162e57b in QListView::eventFilter(QObject*, QEvent*) (this=0x8422b20, 
    o=0x84258e0, e=0xbfffee70) at widgets/qlistview.cpp:3797
#32 0x41540295 in QObject::activate_filters(QEvent*) (this=0x84258e0, 
    e=0xbfffee70) at kernel/qobject.cpp:902
#33 0x41540113 in QObject::event(QEvent*) (this=0x84258e0, e=0xbfffee70)
    at kernel/qobject.cpp:735
#34 0x4157a055 in QWidget::event(QEvent*) (this=0x84258e0, e=0xbfffee70)
    at kernel/qwidget.cpp:4401
#35 0x414dfa73 in QApplication::internalNotify(QObject*, QEvent*) (
    this=0xbffff2b0, receiver=0x84258e0, e=0xbfffee70)
    at kernel/qapplication.cpp:2582
#36 0x414df29b in QApplication::notify(QObject*, QEvent*) (this=0xbffff2b0, 
    receiver=0x84258e0, e=0xbfffee70) at kernel/qapplication.cpp:2368
#37 0x41057a13 in KApplication::notify(QObject*, QEvent*) (this=0xbffff2b0, 
    receiver=0x84258e0, event=0xbfffee70)
    at /home/cvs/kde/kdelibs/kdecore/kapplication.cpp:509
#38 0x4147554a in QApplication::sendSpontaneousEvent(QObject*, QEvent*) (
    receiver=0x84258e0, event=0xbfffee70) at qapplication.h:493
#39 0x4146ebe3 in QETWidget::translateMouseEvent(_XEvent const*) (
    this=0x84258e0, event=0xbffff1b0) at kernel/qapplication_x11.cpp:4428
#40 0x4146c8bb in QApplication::x11ProcessEvent(_XEvent*) (this=0xbffff2b0, 
    event=0xbffff1b0) at kernel/qapplication_x11.cpp:3603
#41 0x41486c13 in QEventLoop::processEvents(unsigned) (this=0x8152f00, flags=4)
    at kernel/qeventloop_x11.cpp:192
#42 0x414f57a9 in QEventLoop::enterLoop() (this=0x8152f00)
    at kernel/qeventloop.cpp:198
#43 0x414f56c2 in QEventLoop::exec() (this=0x8152f00)
    at kernel/qeventloop.cpp:145
#44 0x414dfbdf in QApplication::exec() (this=0xbffff2b0)
    at kernel/qapplication.cpp:2705
#45 0x080648f2 in main (argc=1, argv=0xbffff434)
    at /home/cvs/kde/kdenetwork/kopete/kopete/main.cpp:95
Comment 6 Matt Rogers 2003-11-10 04:44:54 UTC
I have a fix locally in libkopete (where I think it should be). Waiting for feedback.
Comment 7 Matt Rogers 2003-11-10 16:52:26 UTC
Subject: kdenetwork/kopete/libkopete

CVS commit by mattr: 

Fix bug 67676 by disallowing chats to the myself() contact, which is the
way it should be. Why would you want to chat with yourself anyways? ;)

CCMAIL: 67676-done@bugs.kde.org


  M +3 -0      kopetecontact.cpp   1.161


--- kdenetwork/kopete/libkopete/kopetecontact.cpp  #1.160:1.161
@@ -449,4 +449,7 @@ void KopeteContact::sendMessage()
 void KopeteContact::execute()
 {
+        if (d->account->myself() == this)
+                return;
+
         switch( KopetePrefs::prefs()->interfacePreference() )
         {


Comment 8 Matt Rogers 2003-11-10 21:12:07 UTC
current fix is deemed insufficent by various other people and has been reverted.
Comment 9 Matt Rogers 2003-11-14 03:55:57 UTC
*** Bug 68168 has been marked as a duplicate of this bug. ***
Comment 10 Olivier Goffart 2003-12-29 17:03:16 UTC
*** Bug 70689 has been marked as a duplicate of this bug. ***
Comment 11 Olivier Goffart 2003-12-29 17:07:41 UTC
Created attachment 3874 [details]
Patch

Matt, why did you reverse your commit? chatting to myself is totaly stupid...

Anyway, there is a more complicated patch:
1) it forbied to chat to myslef (if there is reason to don't fordied it, just
speek)
2) It remove the crash even if you chat to myself (or any contact without
metacontact)

Ok to commit??
Comment 12 Martijn Klingens 2003-12-29 17:18:53 UTC
Subject: Re: [Kopete-devel]  kopete crashs when clicking on own name in icq chat window

On Monday 29 December 2003 17:07, Olivier Goffart wrote:
> Matt, why did you reverse your commit? chatting to myself is totaly
> stupid...

IIRC Matt's patch blocked chatting to myself in the GUI, where it doesn't 
belong. Even with your approach, in KopeteContact, it's technically still 
possible to start a chat with the self contact. The blocking should be done 
when creating a KMM -- either myself should be silently removed from the KMM 
or no KMM should be created at all. That's the place where it's impossible to 
circumvent the check, anywhere else it's still technically possible.

Also we *really* need to give myself a meta contact, all these checks for 
metaContact() are getting ridiculous and exactly what I wanted to avoid with 
the KMC API.

Comment 13 Casey Allen Shobe 2003-12-29 17:19:29 UTC
Subject: Re: [Kopete-devel]  kopete crashs when clicking on own name in icq chat window

Olivier Goffart (Monday 29 December 2003 11:07)
> Matt, why did you reverse your commit? chatting to myself is totaly
> stupid...

NO!  You can do this with every other client.  It's useful for testing, 
previewing an HTML message, trying a new chat style, boredom, lots of 
things...

It needs to work!

Vertu s
Comment 14 Olivier Goffart 2003-12-29 17:37:24 UTC
Ok, so i will commit only the 2nd part of my patch....
Ok?

(but i'm still not agree with the fact it's usefull, since nothing works (you are of course unable to send a single message, the protocol does not allow that)
Comment 15 Martijn Klingens 2003-12-29 17:58:53 UTC
Subject: Re: [Kopete-devel]  kopete crashs when clicking on own name in icq chat window

On Monday 29 December 2003 17:37, Olivier Goffart wrote:
> Ok, so i will commit only the 2nd part of my patch....

You mean the changes to the chatwindow/ folder? Yes, those are ok (with the 
current API, but now is not the time to change the API to make myself part of 
a metacontact... maybe add a FIXME though so we can remove it after myself is 
a KMC)

> (but i'm still not agree with the fact it's usefull, since nothing works
> (you are of course unable to send a single message, the protocol does not
> allow that)

Yes, it would require tons of hacks to get it working with most protocols. 
It's really ugly to do this, also because we can't shortwire it to always 
bypass the server or you would get duplicate messages on IRC channels. :(

I really don't like this "feature" from a code/API point of view.

Comment 16 Olivier Goffart 2003-12-29 18:15:18 UTC
Subject: kdenetwork/kopete/kopete/chatwindow

CVS commit by ogoffart: 

Do not crash anymore when trying to chat with myslef

CCMAIL: 67676-done@bugs.kde.org


  M +4 -3      chatview.cpp   1.107
  M +2 -2      kopetechatwindow.cpp   1.60


--- kdenetwork/kopete/kopete/chatwindow/chatview.cpp  #1.106:1.107
@@ -427,7 +427,7 @@ void ChatView::createMembersList(void)
 
                 KopeteContactPtrList members = m_manager->members();
-                membersStatus = static_cast<MembersListPolicy>(
+                membersStatus = members.first()->metaContact() ?  static_cast<MembersListPolicy>(
                         members.first()->metaContact()->pluginData( m_manager->protocol(),
-                                QString::fromLatin1("MembersListPolicy") ).toInt() );
+                                QString::fromLatin1("MembersListPolicy") ).toInt() )        : Smart;
 
                 if( membersStatus == Smart )
@@ -452,4 +452,5 @@ void ChatView::toggleMembersVisibility()
                 placeMembersList( membersDockPosition );
                 KopeteContactPtrList members = m_manager->members();
+                if(members.first()->metaContact())
                 members.first()->metaContact()->setPluginData( m_manager->protocol(),
                                 QString::fromLatin1("MembersListPolicy"), QString::number(membersStatus) );

--- kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp  #1.59:1.60
@@ -91,6 +91,6 @@ KopeteChatWindow *KopeteChatWindow::wind
         KopeteMetaContact *m = members.first()->metaContact();
 
-        //Don't do group by group for temporary contacts
-        if( !m->isTemporary() )
+        //Don't do group by group for temporary contacts  //Why not? -Olivier
+        if(m && !m->isTemporary() )
         {
                 KopeteGroupList gList = m->groups();


Comment 17 Casey Allen Shobe 2003-12-30 03:23:07 UTC
Subject: Re: [Kopete-devel]  kopete crashs when clicking on own name in icq chat window

Monday 29 December 2003 11:37
> the protocol does not allow that

Well then nevermind for that protocol :).  But on most protocols it is allowed 
and does work, and Kopete should therefore allow it.

Vertu s
Comment 18 Martijn Klingens 2003-12-30 12:06:55 UTC
Subject: Re: [Kopete-devel]  kopete crashs when clicking on own name in icq chat window

On Tuesday 30 December 2003 03:23, Casey Allen Shobe wrote:
> Well then nevermind for that protocol :).  But on most protocols it is
> allowed and does work, and Kopete should therefore allow it.

Actually, AFAIK neither MSN nor ICQ nor AIM support it in the protocol and all 
the respective clients have local hacks to "allow" it. As such we would have 
to code three of these hacks as opposed to one, like the official client.

And it gets even messier with group chats. With MSN a chat can turn into a 
group chat if you invite another person. That means that if you were chatting 
with yourself and add me you have a group chat. However, MSN doesn't support 
talking to self, so instead of setting up a switchboard socket Kopete would 
fake one and keep all the communications internally.

I don't think I have to explain the mess it would give if the group chat 
forces Kopete to set up a real switch board (at a point where the code 
doesn't expect it).

And this is just only one example.

And there are similar issues with putting yourself on your own contact list, 
which is equally braindead from the coding side of things.

Really, all these hacks are IMO nice if we reach a stable 1.0 version but for 
now I'd simply disable talking to self or putting self on the contact list 
and concentrate on more serious issues. If I had to prioritize this it would 
fall in the category 'nice gimmick' and there are plenty of issues more 
urgent than that left.

Comment 19 Olivier Goffart 2003-12-30 21:04:43 UTC
*** Bug 71513 has been marked as a duplicate of this bug. ***
Comment 20 Christoph Pache 2008-07-01 19:39:38 UTC
I insert my backtrace too. I hope it could help: Anwendung: Kopete (kopete), Signal SIGSEGV
[?1034h(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0xb5d406d0 (LWP 4809)]
[New Thread 0xb3858b90 (LWP 4814)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[KCrash handler]
#6  0xb40cc87d in ?? () from /usr/lib/kde4/kopete_privacy.so
#7  0xb40c8d6c in ?? () from /usr/lib/kde4/kopete_privacy.so
#8  0xb40caf0c in ?? () from /usr/lib/kde4/kopete_privacy.so
#9  0xb70f845a in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#10 0xb70f89d2 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#11 0xb7fdc583 in Kopete::ChatSessionManager::viewCreated ()
   from /usr/lib/libkopete.so.4
#12 0xb7fdc988 in Kopete::ChatSessionManager::createView ()
   from /usr/lib/libkopete.so.4
#13 0xb7fd8f44 in Kopete::ChatSession::view () from /usr/lib/libkopete.so.4
#14 0xb7fe87a0 in Kopete::Contact::execute () from /usr/lib/libkopete.so.4
#15 0xb7fffea3 in Kopete::MetaContact::execute () from /usr/lib/libkopete.so.4
#16 0x08064b23 in _start ()
#0  0xffffe430 in __kernel_vsyscall ()