Bug 177302 - Chat session destroyed before finalizing crypto job
Summary: Chat session destroyed before finalizing crypto job
Status: RESOLVED WORKSFORME
Alias: None
Product: kopete
Classification: Applications
Component: Cryptography Plugin (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 255827 255876 284660 297855 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-09 14:03 UTC by Jaroslav Reznik
Modified: 2018-12-01 03:45 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Workaround? (1.01 KB, patch)
2008-12-09 14:04 UTC, Jaroslav Reznik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Reznik 2008-12-09 14:03:00 UTC
Version:           1.3.0-kde4.1.3 (using KDE 4.1.3)
OS:                Linux
Installed from:    Fedora RPMs

Chat session is destroyed before finalizing crypto job and Kopete crashes on appending message to it.

How to reproduce:
Send encrypted message to some (Jabber) contact with no chat session established.
Result:
Kopete crashes
Expected result:
Kopete do not crash
Workaround:
Use msg.manager()->setCanBeDeleted( false ) when starting crypto job and set it to true after job is finalized.
Comment 1 Jaroslav Reznik 2008-12-09 14:04:35 UTC
Created attachment 29175 [details]
Workaround?
Comment 2 Alan Jones 2008-12-28 23:57:10 UTC
Hi Jaroslav,

I've been attempting repro on this and not managed. The sessions are automatically establishing here. If there's any additional information you could provide, or ideally a backtrace. That would be great. If you can manage a backtrace please post it in the comment as attachment contents aren't searchable. 

Cheers,

Alan.
Comment 3 Jaroslav Reznik 2009-01-06 12:52:19 UTC
Hi Alan,
message manager is deleted too early, so in finalizeMessage does not exists and Crypto plugin crashes. Preventing deletion of message manager with setCanBeDeleted helps - see my patch. What's your Kopete version?.

Backtrace:
[KCrash handler]
#5  Kopete::ChatSession::myself (this=0x0)
    at /home/jreznik/Download/kdenetwork-4.1.3/kopete/libkopete/kopetechatsession.cpp:188
#6  0x0000003371699963 in Kopete::ChatSession::appendMessage (
    this=<value optimized out>, msg=<value optimized out>)
    at /home/jreznik/Download/kdenetwork-4.1.3/kopete/libkopete/kopetechatsession.cpp:279
#7  0x00007f79e1b74dfe in CryptographyPlugin::finalizeMessage (
    this=<value optimized out>, msg=@0x7ffff32fd010, 
    intendedBody=<value optimized out>, verificationResult=@0x7ffff32fcfe0, 
    encrypted=true)
    at /home/jreznik/Download/kopete-cryptography-1.3.0-kde4.1.3/cryptographyplugin.cpp:266
#8  0x00007f79e1b75993 in CryptographyPlugin::slotIncomingEncryptedMessageContinued (this=0x13a1800, decryptionResult=@0x7ffff32fd190, 
    plainText=@0x7ffff32fd1b0)
    at /home/jreznik/Download/kopete-cryptography-1.3.0-kde4.1.3/cryptographyplugin.cpp:199
#9  0x00007f79e1b760e8 in CryptographyPlugin::qt_metacall (this=0x13a1800, 
    _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, 
    _a=0x7ffff32fd150)
    at /home/jreznik/Download/kopete-cryptography-1.3.0-kde4.1.3/build/cryptographyplugin.moc:94
#10 0x00000038c1d56764 in QMetaObject::activate ()
   from /usr/lib64/libQtCore.so.4
#11 0x00007f79e187dea1 in Kleo::DecryptJob::result ()
   from /usr/lib64/libkleo.so.4
#12 0x00007f79e18ccea5 in ?? () from /usr/lib64/libkleo.so.4
#13 0x00000038c1d56764 in QMetaObject::activate ()
   from /usr/lib64/libQtCore.so.4
#14 0x00000038c1c4b657 in QFutureWatcherBasePrivate::sendCallOutEvent ()
   from /usr/lib64/libQtCore.so.4
#15 0x00000038c1c4ba5d in QFutureWatcherBase::event ()
   from /usr/lib64/libQtCore.so.4
#16 0x000000336bb8281d in QApplicationPrivate::notify_helper ()
   from /usr/lib64/libQtGui.so.4
#17 0x000000336bb8a5ca in QApplication::notify () from /usr/lib64/libQtGui.so.4
#18 0x000000336d1fb46b in KApplication::notify () from /usr/lib64/libkdeui.so.5
#19 0x00000038c1d42391 in QCoreApplication::notifyInternal ()
   from /usr/lib64/libQtCore.so.4
#20 0x00000038c1d4302a in QCoreApplicationPrivate::sendPostedEvents ()
   from /usr/lib64/libQtCore.so.4
#21 0x00000038c1d6ab13 in ?? () from /usr/lib64/libQtCore.so.4
#22 0x00000038b903779b in g_main_context_dispatch ()
   from /lib64/libglib-2.0.so.0
#23 0x00000038b903af6d in ?? () from /lib64/libglib-2.0.so.0
#24 0x00000038b903b12b in g_main_context_iteration ()
   from /lib64/libglib-2.0.so.0
#25 0x00000038c1d6a79f in QEventDispatcherGlib::processEvents ()
   from /usr/lib64/libQtCore.so.4
#26 0x000000336bc1319f in ?? () from /usr/lib64/libQtGui.so.4
#27 0x00000038c1d40cb2 in QEventLoop::processEvents ()
   from /usr/lib64/libQtCore.so.4
#28 0x00000038c1d40e3d in QEventLoop::exec () from /usr/lib64/libQtCore.so.4
#29 0x00000038c1d432ed in QCoreApplication::exec ()
   from /usr/lib64/libQtCore.so.4
#30 0x00000000004429c1 in main (argc=1, argv=0x7ffff32fe8a8)
    at /home/jreznik/Download/kdenetwork-4.1.3/kopete/kopete/main.cpp:102

Debug output:
kopete(12169)/kopete (cryptography) CryptographyPlugin::slotIncomingMessage: processing  "-----BEGIN PGP MESSAGE-----

hQIOA2FabLXcNZkcEAgAyU5oRA45Gjta0GXJOa5bhc2v+hD1akreqmES8iYj+JYa
GvToG+/oDFzXFh5BAobo/mc9pWRR157H52sWJehHMUhMVTsggUgRATbkqCMCt1+2
q9OIR4f5hUHgTHuiZMWXDmrc4/X6BgpC9zmhMRNvdWIXQowlFFSDt7tyAx0u1rBC
MEa6PGPw0E1As80own/iyvHmwu4KR+65OJu3kcnBEqU7JA6hNBvebkEHP2YtTrlH
wyIqdbQK/1y87IK2ArNqCMH9jQ/AyAnhHKTXMtH0kSBx8/ttuhmNxXxL7cawW0gH
kyROpzgSTkSZzw2sjzTdvnZAm4zqkpgrp6Kco6o+0wgAl6GXLY+fDpF4T9vK2obP
EQmLvj0hlXI+oQ22L5v564hTX5zX4NuEnC5eGJmifeWRKo6qT+ioC5gUtaNChvuS
CqoFpIkQtRQ/yxMse3Xi/lxCPkVO1whRJ5uFWz6GbUrpbUtivdzVC5aRR7TVPQBC
9mFFhN3bIGdZXxIPP7R1kATVlGBb6EVBYIMNUUBrvAr9HEo0J+x+dwcY+hHpTUrI
NnBfwWRS+SdeodP89XCPhVDjbD7JAYkDBudHIIpnD3B2cMQuGXGFB0hODL8uksvn
OiDi0Lw/Tfu2Uez+VKjc/t6Iyq87Fgr3s/rHDiX0fuIMfC+gRmwlj1OLvppZ6MCt
AdJDAb1NFba4Ep3Z1cDt/bKjVU37eMaa4NlE2+7qQBtIu6IFFylWN107snutC5oO
s5mmCdm4sYCqWUbbWUIxQobxLFQflA==
=UTW9
-----END PGP MESSAGE-----
"
kopete(12169)/kopete (cryptography) CryptographyMessageHandler::handleMessage: MessageEvent destroyed!
kopete(12169)/kopete (jabber - raw protocol) JabberAccount::slotClientDebugMessage: "XML OUT: <message from="ales.beta@jabber.cz/Kopete" type="chat" to="rezza@jabber.cz/Kopete" id="aabca" >
<gone xmlns="http://jabber.org/protocol/chatstates"/>
</message>
"
kopete(12169)/libkopete Kopete::ChatSessionManager::removeSession:
kopete(12169)/kopete (jabber) JabberContact::slotChatSessionDeleted: Message manager deleted, collecting the pieces...
kopete(12169)/libkopete Kopete::MessageHandlerChain::~MessageHandlerChain:
QGpgMEProgressTokenMapper::map( "-&23" 63 )
QGpgMEProgressTokenMapper::map( "-&23" 63 )
QGpgMEProgressTokenMapper::map( "-&24" 63 )
QGpgMEProgressTokenMapper::map( "-&24" 63 )
kopete(12169)/kopete (cryptography) CryptographyPlugin::finalizeMessage: message was encrypted
KCrash: Application 'kopete' crashing...
Comment 4 Olivier Goffart 2009-04-12 11:40:19 UTC
Hi Jaroslav,  Thanks for your patch.
You should use ref()/deref()  instead of setCanBeDeleted.

You can send your patch on reviewboard.kde.org
Comment 5 Pino Toscano 2010-11-02 17:45:18 UTC
*** Bug 255827 has been marked as a duplicate of this bug. ***
Comment 6 Pino Toscano 2010-11-02 17:45:26 UTC
*** Bug 255876 has been marked as a duplicate of this bug. ***
Comment 7 Jekyll Wu 2012-10-05 12:56:36 UTC
*** Bug 284660 has been marked as a duplicate of this bug. ***
Comment 8 Jekyll Wu 2012-10-05 12:56:43 UTC
*** Bug 297855 has been marked as a duplicate of this bug. ***
Comment 9 Andrew Crouthamel 2018-11-01 13:45:11 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Bug Janitor Service 2018-11-16 11:30:20 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Bug Janitor Service 2018-12-01 03:45:02 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!