debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[Bug] Debugger crashes on socket error [sf#328]

Open openMSX-import opened this issue 10 years ago • 2 comments

Reported by mfeingol on 2009-03-23 04:57 UTC Repro: compile openMSX such that it closes accepted sockets in the CliServer's mainLoop. Then run it and attach the debugger.

The debugger will attempt to connect and fail with a socket error. The code ends up in OpenMSXConnection::cancelPending, which calls Cancel() on a queue of Command objects. Eventually, we end up in ConnectDialog::connectionBad(), which deletes the OpenMSXConnection object. Once we return to OpenMSXConnection::cancelPending, we're operating on deleted memory and (if we're lucky) we'll crash.

See the attached stack trace for more details.

openMSX-import avatar Jun 24 '15 12:06 openMSX-import

Commented by mfeingol on 2009-03-23 04:57 UTC

Attached file stack.txt:

    openmsx-debugger.exe!OpenMSXConnection::~OpenMSXConnection()  Line 108  C++
    openmsx-debugger.exe!OpenMSXConnection::`scalar deleting destructor'()  + 0x31 bytes    C++
    openmsx-debugger.exe!ConnectDialog::connectionBad(OpenMSXConnection & connection={...})  Line 365 + 0x46 bytes  C++
    openmsx-debugger.exe!ConnectionInfoRequest::cancel()  Line 245  C++
    openmsx-debugger.exe!OpenMSXConnection::cancelPending()  Line 154   C++
    openmsx-debugger.exe!OpenMSXConnection::cleanup()  Line 145 C++
    openmsx-debugger.exe!OpenMSXConnection::socketError(QAbstractSocket::SocketError __formal=RemoteHostClosedError)  Line 167  C++
    openmsx-debugger.exe!OpenMSXConnection::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=5, void * * _a=0x0000000000125450)  Line 85  C++
    QtCored4.dll!QMetaObject::activate(QObject * sender=0x00000000038e0e70, int from_signal_index=12, int to_signal_index=12, void * * argv=0x0000000000125450)  Line 3022 + 0x4f bytes C++
    QtCored4.dll!QMetaObject::activate(QObject * sender=0x00000000038e0e70, const QMetaObject * m=0x000000006410d9e8, int local_signal_index=4, void * * argv=0x0000000000125450)  Line 3093    C++
    QtNetworkd4.dll!QAbstractSocket::error(QAbstractSocket::SocketError _t1=RemoteHostClosedError)  Line 147    C++
    QtNetworkd4.dll!QAbstractSocketPrivate::readFromSocket()  Line 989  C++

openMSX-import avatar Jun 24 '15 12:06 openMSX-import

Updated by mfeingol on 2009-03-23 04:57 UTC

  • summary: Debugger crashes socket error --> Debugger crashes on socket error

openMSX-import avatar Jun 24 '15 12:06 openMSX-import