| Summary: | crash accepting a webcam in yahoo protocol | ||
|---|---|---|---|
| Product: | [Unmaintained] kopete | Reporter: | fredi |
| Component: | Yahoo Plugin | Assignee: | Kopete Developers <kopete-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | aezekowitz, thmkik |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | debug log of the cam session on yahoo | ||
|
Description
fredi
2005-09-27 15:56:14 UTC
Exactly the same thing happened this morning. Ok, i gave another try to the cam support (only recieving, i dont have a webcam) for yahoo's protocol. This time i recieved immages but after some seconds the immage stopped. The normal IM functionality keept functioning for some other seconds then i got disconnected from yahoo. Then i restarted kopete. I saw no code changes from my first try till now, so seems the crash is not that easy to reproduce. But this time i started kopete from console so i have the debugging messages of the session described. For obvious reasons i changed the accounts and IM messages in the debug log, substituted them with xxx or such. Except some messages that were not personal, ex. when i asked the other to start the cam and when the immage stopped. Hope it helps. I'll put the log as attachment. Created attachment 12764 [details]
debug log of the cam session on yahoo
You can see all the activity, before i begin to recieve cam immages, when the
immage stops (read the IM messages i left in the debug) till after i get
disconnected from yahoo.
Hi, Are you sure that your libyahoo2 was recompiled (was changed on Aug 29)? The symptoms are the same as the random disconnects i got when yahoo introduced their new client version and decided to doom YMSG10 clients. Yes, the checkout was done some days before the crash. *** Bug 117274 has been marked as a duplicate of this bug. *** SVN commit 485011 by duffeck:
Fix Webcam disconnects/crashes.
BUG:113439
M +51 -24 kyahoo.cpp
M +4 -4 kyahoo.h
--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/kyahoo.cpp #485010:485011
@@ -88,27 +88,26 @@
{
}
-void YahooConnectionManager::addConnection( KStreamSocket* socket )
+void YahooConnectionManager::addConnection( QPair< KStreamSocket*, void *> *connection )
{
- kdDebug(14181) << k_funcinfo << "Adding socket with fd " << socket->socketDevice()->socket() << endl;
+ kdDebug(14181) << k_funcinfo << "Adding socket with fd " << connection->first->socketDevice()->socket() << endl;
- m_connectionList.append( socket );
+ m_connectionList.append( connection );
}
-KStreamSocket* YahooConnectionManager::connectionForFD( int fd )
+QPair< KStreamSocket*, void *> *YahooConnectionManager::connectionForFD( int fd )
{
//kdDebug(14181) << k_funcinfo << "Looking for socket with fd " << fd << endl;
- QValueList<KStreamSocket*>::const_iterator it, ycEnd = m_connectionList.constEnd();
+ QValueList< QPair< KStreamSocket*, void *> *>::const_iterator it, ycEnd = m_connectionList.constEnd();
KSocketDevice *dev;
for ( it = m_connectionList.begin(); it != ycEnd; ++it )
{
- dev = ( *it )->socketDevice();
+ dev = ( *it )->first->socketDevice();
if ( dev->socket() == fd )
{
//kdDebug(14181) << k_funcinfo << "Found socket" << endl;
- KStreamSocket* socket = ( *it );
- return socket;
+ return *it;
}
}
@@ -117,11 +116,11 @@
void YahooConnectionManager::remove( KStreamSocket* socket )
{
- QValueList<KStreamSocket*>::iterator it, ycEnd = m_connectionList.end();
+ QValueList< QPair< KStreamSocket*, void *> *>::iterator it, ycEnd = m_connectionList.end();
for ( it = m_connectionList.begin(); it != ycEnd; it++ )
{
- if ( ( *it ) == socket )
+ if ( ( *it )->first == socket )
{
socket->reset();
m_connectionList.remove( it );
@@ -133,11 +132,11 @@
void YahooConnectionManager::reset()
{
- QValueList<KStreamSocket*>::iterator it, ycEnd = m_connectionList.end();
+ QValueList< QPair< KStreamSocket*, void *> *>::iterator it, ycEnd = m_connectionList.end();
for ( it = m_connectionList.begin(); it != ycEnd; it++ )
{
- KStreamSocket *socket = ( *it );
+ KStreamSocket *socket = ( *it )->first;
socket->reset();
it = m_connectionList.remove( it );
delete socket;
@@ -1072,7 +1071,11 @@
void YahooSession::slotTransmitFile( int fd, YahooUploadData *uploadData )
{
- KStreamSocket* socket = m_connManager.connectionForFD( fd );
+ QPair< KStreamSocket*, void *> *connection = m_connManager.connectionForFD( fd );
+ if( !connection )
+ return;
+
+ KStreamSocket* socket = connection->first;
if( !socket )
return;
@@ -1160,9 +1163,15 @@
KMessageBox::error(Kopete::UI::Global::mainWidget(), i18n( "An error occurred when trying to download the file." ), i18n("Error") );
return;
}
+ QPair< KStreamSocket*, void *> *connection = m_connManager.connectionForFD( fd );
+ if( !connection )
+ {
+ kdDebug(14181) << k_funcinfo << "No connection found for fd." << endl;
+ return;
+ }
- KStreamSocket* socket = m_connManager.connectionForFD( fd );
- if ( !socket )
+ KStreamSocket* socket = connection->first;
+ if( !socket )
{
kdDebug(14181) << k_funcinfo << "No existing socket for connection found. We're screwed" << endl;
return;
@@ -1423,21 +1432,23 @@
{
//kdDebug(14181) << k_funcinfo << " " << m_connId << " Socket: " << fd << endl;
- m_data = data;
if ( fd == -1 )
{
kdDebug(14181) << k_funcinfo << "why is fd -1?" << endl;
return -1;
}
- KStreamSocket* socket = m_connManager.connectionForFD( fd );
- if ( !socket )
+ QPair< KStreamSocket*, void *> *connection = m_connManager.connectionForFD( fd );
+ if ( !connection )
{
kdDebug(14181) << k_funcinfo << "No existing socket for connection found. We're screwed"
<< endl;
return -1;
}
+ KStreamSocket *socket = connection->first;
+ connection->second = data;
+
/* This works ONLY IF (YAHOO_INPUT_READ==1 && YAHOO_INPUT_WRITE==2) */
int tag = 0;
if ( cond == YAHOO_INPUT_READ )
@@ -1468,13 +1479,14 @@
if ( tag == 0 )
return;
- KStreamSocket* socket = m_connManager.connectionForFD( (tag-1)/2 );
- if ( !socket )
+ QPair< KStreamSocket*, void *> *connection = m_connManager.connectionForFD( (tag-1)/2 );
+ if ( !connection )
{
kdDebug(14181) << k_funcinfo << "No existing socket for connection found. We're screwed"
<< endl;
return;
}
+ KStreamSocket *socket = connection->first;
/* This works ONLY IF (YAHOO_INPUT_READ==1 && YAHOO_INPUT_WRITE==2) */
if( tag % 2 == YAHOO_INPUT_READ ) {
//kdDebug(14181) << k_funcinfo << " read off" << endl;
@@ -1522,7 +1534,8 @@
{
KStreamSocket* socket = const_cast<KStreamSocket*>( dynamic_cast<const KStreamSocket*>( sender() ) );
kdDebug(14181) << k_funcinfo << " Connected! fd "<< socket->socketDevice()->socket() << endl;
- m_connManager.addConnection( socket );
+ QPair< KStreamSocket*, void * > *connection = new QPair< KStreamSocket*, void * >( socket, 0L );
+ m_connManager.addConnection( connection );
disconnect( socket, SIGNAL( connected( const KResolverEntry& ) ), this, SLOT( slotAsyncConnectSucceeded() ) );
disconnect( socket, SIGNAL( gotError(int) ), this, SLOT( slotAsyncConnectFailed(int) ) );
@@ -1623,7 +1636,14 @@
int fd = socket->socketDevice()->socket();
//kdDebug(14181) << k_funcinfo << "Socket FD: " << fd << endl;
- ret = yahoo_read_ready( m_connId , fd, m_data );
+ QPair< KStreamSocket*, void *> *connection = m_connManager.connectionForFD( fd );
+ if ( !connection )
+ {
+ kdDebug(14181) << k_funcinfo << "No connection found for socket!" << endl;
+ return;
+ }
+
+ ret = yahoo_read_ready( m_connId , fd, connection->second );
if ( ret == -1 )
kdDebug(14181) << k_funcinfo << "Read Error (" << errno << ": " << strerror(errno) << endl;
@@ -1646,9 +1666,16 @@
int fd = socket->socketDevice()->socket();
//kdDebug(14181) << k_funcinfo << "Socket FD: " << fd << endl;
+
+ QPair< KStreamSocket*, void *> *connection = m_connManager.connectionForFD( fd );
+ if ( !connection )
+ {
+ kdDebug(14181) << k_funcinfo << "No connection found for socket!" << endl;
+ return;
+ }
+
+ ret = yahoo_write_ready( m_connId , fd, connection->second );
- ret = yahoo_write_ready( m_connId , fd, m_data );
-
if ( ret == -1 )
kdDebug(14181) << k_funcinfo << "Read Error (" << errno << ": " << strerror(errno) << endl;
else if ( ret == 0 )
--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/kyahoo.h #485010:485011
@@ -25,6 +25,7 @@
#include <qmap.h>
#include <qpixmap.h>
#include <qbuffer.h>
+#include <qpair.h>
#include "libyahoo2/yahoo2.h"
#include "libyahoo2/yahoo2_callbacks.h"
@@ -70,12 +71,12 @@
* from the connection manager and a new connection of that type is expected
* to be created.
*/
- void addConnection( KStreamSocket* socket );
+ void addConnection( QPair< KStreamSocket*, void * > *connection );
/**
* Get the connection by its file descriptor
*/
- KStreamSocket* connectionForFD( int fd );
+ QPair< KStreamSocket*, void *> *connectionForFD( int fd );
/**
* Remove a connection from the manager
@@ -89,7 +90,7 @@
void reset();
private:
- QValueList<KStreamSocket*> m_connectionList;
+ QValueList< QPair< KStreamSocket*, void *> *> m_connectionList;
};
@@ -339,7 +340,6 @@
struct connect_callback_data *m_ccd;
YahooConnectionManager m_connManager;
- void *m_data;
Kopete::Contact* m_contact;
Kopete::Transfer* m_kopeteTransfer;
(no debugging symbols found) Using host libthread_db library "/lib/i686/libthread_db.so.1". (no debugging symbols found) `shared object read from target memory' has disappeared; keeping its symbols. (no debugging symbols found)......................... ..................................................... (no debugging symbols found) [KCrash handler] #7 0x00000000 in ?? () #8 0xa5ec3cdc in yahoo_read_ready () from /usr/lib/kde3/kopete_yahoo.so #9 0xa5ea2347 in YahooSession::slotReadReady () from /usr/lib/kde3/kopete_yahoo.so #10 0xa5ea3e3d in YahooSession::qt_invoke () from /usr/lib/kde3/kopete_yahoo.so #11 0xa6a93317 in QObject::activate_signal () from /usr/lib/qt3/lib/libqt-mt.so.3 #12 0xa6a93113 in QObject::activate_signal () from /usr/lib/qt3/lib/libqt-mt.so.3 #13 0xa715b6f8 in KNetwork::KClientSocketBase::readyRead () from /usr/lib/libkdecore.so.4 #14 0xa715af5f in KNetwork::KClientSocketBase::slotReadActivity () from /usr/lib/libkdecore.so.4 #15 0xa715b790 in KNetwork::KClientSocketBase::qt_invoke () from /usr/lib/libkdecore.so.4 #16 0xa715ccc2 in KNetwork::KStreamSocket::qt_invoke () from /usr/lib/libkdecore.so.4 #17 0xa6a93317 in QObject::activate_signal () from /usr/lib/qt3/lib/libqt-mt.so.3 #18 0xa6a9340e in QObject::activate_signal () from /usr/lib/qt3/lib/libqt-mt.so.3 #19 0xa6d84fb8 in QSocketNotifier::activated () from /usr/lib/qt3/lib/libqt-mt.so.3 #20 0xa6aad881 in QSocketNotifier::event () from /usr/lib/qt3/lib/libqt-mt.so.3 #21 0xa6a39b9f in QApplication::internalNotify () from /usr/lib/qt3/lib/libqt-mt.so.3 #22 0xa6a39137 in QApplication::notify () from /usr/lib/qt3/lib/libqt-mt.so.3 #23 0xa701b19b in KApplication::notify () from /usr/lib/libkdecore.so.4 #24 0xa6a2994e in QEventLoop::activateSocketNotifiers () from /usr/lib/qt3/lib/libqt-mt.so.3 #25 0xa69e4877 in QEventLoop::processEvents () from /usr/lib/qt3/lib/libqt-mt.so.3 #26 0xa6a4a2ea in QEventLoop::enterLoop () from /usr/lib/qt3/lib/libqt-mt.so.3 #27 0xa6a4a1d4 in QEventLoop::exec () from /usr/lib/qt3/lib/libqt-mt.so.3 #28 0xa6a39db0 in QApplication::exec () from /usr/lib/qt3/lib/libqt-mt.so.3 #29 0x0806d7bb in ?? () #30 0xafbc0610 in ?? () #31 0xafbc05f0 in ?? () #32 0xafbc0758 in ?? () #33 0x0806d764 in ?? () #34 0xa6e821e0 in vtable for QGArray () from /usr/lib/qt3/lib/libqt-mt.so.3 #35 0x0829f150 in ?? () #36 0xafbc0628 in ?? () #37 0xa634b37e in operator new () from /usr/lib/libstdc++.so.5 #38 0xa6172c57 in __libc_start_main () from /lib/i686/libc.so.6 #39 0x0806d221 in ?? () What's your kopete version? That was fixed in KDE 3.5.1 *** Bug 124334 has been marked as a duplicate of this bug. *** |