Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-59288

Random segfaults in QAbstractSocketPrivate::canReadNotification

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.9.0 Beta 1
    • WebEngine
    • None
    • Archlinux, PyQt5 5.8

      With a Qt 5.8 with https://codereview.qt-project.org/#/c/176113/ applied on top, I get segfaults here:

      #0  0x00007f7a0da00f5f in raise () at /usr/lib/libpthread.so.0
      #1  0x00007f7a0da01080 in <signal handler called> () at /usr/lib/libpthread.so.0
      #2  0x00007f7a0b5d37b1 in QMetaObject::activate(QObject*, int, int, void**) (sender=0x276d848, signalOffset=3, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc35fbd250) at kernel/qobject.cpp:3612
      #3  0x00007f7a0b5d46d7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7f7a0b9f3ec0 <QIODevice::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc35fbd250) at kernel/qobject.cpp:3602
      #4  0x00007f7a0b64a201 in QIODevice::channelReadyRead(int) (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qiodevice.cpp:193
      #5  0x00007f79fd842b7c in QAbstractSocketPrivate::canReadNotification() (this=0x1b748e0) at socket/qabstractsocket.cpp:733
      #6  0x00007f79fd84e131 in QReadNotifier::event(QEvent*) (this=<optimized out>, e=<optimized out>) at socket/qnativesocketengine.cpp:1241
      #7  0x00007f79f5d753dc in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x1b68830, e=0x7ffc35fbd520)
          at kernel/qapplication.cpp:3745
      #8  0x00007f79f5d7cbf1 in QApplication::notify(QObject*, QEvent*) (this=0x14fa0b0, receiver=0x1b68830, e=0x7ffc35fbd520) at kernel/qapplication.cpp:3502
      #9  0x00007f79f65f42ce in sipQApplication::notify(QObject*, QEvent*) (this=0x14fa0b0, a0=0x1b68830, a1=0x7ffc35fbd520) at sipQtWidgetsQApplication.cpp:232
      #10 0x00007f7a0b5a84b0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x1b68830, event=event@entry=0x7ffc35fbd520)
          at kernel/qcoreapplication.cpp:988
      #11 0x00007f7a0b5fd56d in QCoreApplication::sendEvent(QObject*, QEvent*) (event=0x7ffc35fbd520, receiver=<optimized out>)
          at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
      #12 0x00007f7a0b5fd56d in socketNotifierSourceDispatch(GSource*, GSourceFunc, gpointer) (source=0x152e1d0) at kernel/qeventdispatcher_glib.cpp:106
      #13 0x00007f7a07e7d5a7 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
      #14 0x00007f7a07e7d810 in  () at /usr/lib/libglib-2.0.so.0
      #15 0x00007f7a07e7d8bc in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
      #16 0x00007f7a0b5fd0bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x152f240, flags=...)
          at kernel/qeventdispatcher_glib.cpp:423
      #17 0x00007f7a0b5a690a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffc35fbd740, flags=..., flags@entry=...)
          at kernel/qeventloop.cpp:212
      #18 0x00007f7a0b5aee54 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1261
      

      I've actually seen the same when calling QApplication::processEvents() in my code. Adding QEventLoop::ExcludeSocketNotifiers makes things a lot better, though I've still seen some segfaults with it (in the same place).

      They mostly happen when doing QtNetwork downloads (with a QNAM), while QtWebEngine is initialized.

      Note that I'm using PyQt, so a few funky things could be going on regarding memory management - however, I've never seen it happen with an unpatched Qt 5.8 (when avoiding processEvents at least), and without QtWebEngine code involved.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt_webengine_team Qt WebEngine Team
            the compiler Florian Bruhin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes