[Interest] Remote Inspector Crash due to Q_ASSERT(m_tcpConnection)

Amogh Kudari amogh.kudari5 at gmail.com
Fri May 2 10:24:16 CEST 2014


Hi ,

      I am using qt webkit. I have a webview application(QApplication with
QWebView) which is hosted as a Plugin in chrome. I can debug the html
applications launched in webview by using remote inspector which is
launched in new chrome tab with the following URL
"*http://127.0.0.1:9999/webkit/inspector/inspector.html?page=1
<http://127.0.0.1:9999/webkit/inspector/inspector.html?page=1>*".

         But when I close this tab having remote inspector, my webview
application crashes. On debugging this issue, I am able to see that It is
asserting on m_tcpConnection, in *InspectorServerQt.cpp  *

void InspectorServerRequestHandlerQt::webSocketReadyRead()
{
    *Q_ASSERT(m_tcpConnection);*
.........................

}

I also found that when I close the chrome tab with remote inspector,
the *disconnected
*signal is emitted first, where the slot tcpConnectionDisconnected() is
executed.
void InspectorServerRequestHandlerQt::tcpConnectionDisconnected()
{
    if (m_inspectorClient)
        m_inspectorClient->detachRemoteFrontend();
    m_tcpConnection->deleteLater();
    m_tcpConnection = 0;
}

And after that It emits a  *ReadyRead *signal, where the slot
webSocketReadyRead() is executed. In this slot it checks if m_tcpConnection
is alive. Since it is already deleted and made NULL in
tcpConnectionDisconnected() , there is an assertion in webSocketReadyRead().
void InspectorServerRequestHandlerQt::webSocketReadyRead()
{
    *Q_ASSERT(m_tcpConnection);*
.........................

}

I wanted to know, Why is it emitting a ReadyRead signal after disconnected
signal on that same TCP Connection? And how to fix it? Will flushing the
data before deleting the m_tcpConnection help.
void InspectorServerRequestHandlerQt::tcpConnectionDisconnected()
{
     ..........
   * m_tcpConnection->flush();*
    m_tcpConnection->deleteLater();
    m_tcpConnection = 0;
}


Regards,
Amogh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140502/8d4f2828/attachment.html>


More information about the Interest mailing list