[Twisted-Python] catching twisted pyqt segmentation fault
![](https://secure.gravatar.com/avatar/a07b6d294d96567cea15ae7ff55df0be.jpg?s=120&d=mm&r=g)
I have a long running twisted pyqt process which occasionally throws a Received signal 11. I believe it's in the underlying QtWebEngineView since the twisted process continues to run. Whatever the reason I would like to figure out a way to catch this and stop the reactor either in process, or by another process monitor. Any suggestions either twisted or otherwise would be greatly appreciated. Below is a bit of the stack trace dumped to /var/log/syslog 0x7fd855447a8f Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 2 0x7fd855447c74 Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 3 0x7fd8555d6a82 Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 4 0x7fd8556ababd Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 5 0x7fd8556af2f6 Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 6 0x7fd85586e52d Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 7 0x7fd85586f511 Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 8 0x7fd85570dbc3 Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 9 0x7fd85570dd92 Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 10 0x7fd855516c0c Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 11 0x7fd85551dacd Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 12 0x7fd85596c5d3 Feb 25 22:01:32 ip-10-0-0-116 python[1836]: 13 0x35946920c1fb Feb 25 22:01:32 ip-10-0-0-116 python[1836]: Received signal 11 SEGV_MAPERR 0000fbadbeef Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #0 0x7fd856d5ca2e <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #1 0x7fd856d5cdeb <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #2 0x7fd8526d3390 <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #3 0x7fd858404408 <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #4 0x7fd855447a8f <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #5 0x7fd855447c74 <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #6 0x7fd8555d6a82 <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #7 0x7fd8556ababd <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #8 0x7fd8556af2f6 <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #9 0x7fd85586e52d <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #10 0x7fd85586f511 <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #11 0x7fd85570dbc3 <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #12 0x7fd85570dd92 <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #13 0x7fd855516c0c <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #14 0x7fd85551dacd <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #15 0x7fd85596c5d3 <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: #16 0x35946920c1fb <unknown> Feb 25 22:01:32 ip-10-0-0-116 python[1836]: r8: 00007fd85a2f38c0 r9: 0000000000000013 r10: 0000000000000000 r11: Feb 25 22:01:32 ip-10-0-0-116 python[1836]: r12: 00007fd858aa25c8 r13: 00007fd858ab91ee r14: 00007fd85a0c9848 r15: Feb 25 22:01:32 ip-10-0-0-116 python[1836]: di: 0000000000000000 si: 0000000000000013 bp: 00007fd858ab91ee bx: Feb 25 22:01:32 ip-10-0-0-116 python[1836]: dx: 00007fd851e1d770 ax: 00000000fbadbeef cx: 00007fd851b4e6fd sp: Feb 25 22:01:32 ip-10-0-0-116 python[1836]: ip: 00007fd858404408 efl: 0000000000010246 cgf: 0000000000000033 erf: Feb 25 22:01:32 ip-10-0-0-116 python[1836]: trp: 000000000000000e msk: 0000000000000000 cr2: 00000000fbadbeef Feb 25 22:01:32 ip-10-0-0-116 python[1836]: [end of stack trace]
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Presumably the QtWebEngineView is running a subprocess, then? This is really a Qt question rather than a Twisted question, because the QtWebEngineView should be emitting some kind of signal when its rendering process crashes. (If it doesn't I imagine you're just out of luck here and you should report a bug to the Qt developers...) -glyph
![](https://secure.gravatar.com/avatar/a07b6d294d96567cea15ae7ff55df0be.jpg?s=120&d=mm&r=g)
Thanks glyph - really appreciate all the times you've answered my questions! QtWebEngineView is running a subprocess. /home/ubuntu/Qt5.8.0/5.8/gcc_64/libexec/QtWebEngineProcess --type=renderer --disable-accelerated-video-decode --disable-gpu-memory-buffer-video-frames --enable-threaded-compositing --use-gl=desktop --disable-webrtc-hw-encoding --primordial-pipe-token=032B94B57A61DAE34BD0F90551F9ABB6 --lang=en-US --enable-pinch --num-raster-threads=2 --content-image-texture-target=3553 QT can sometimes be helpful, but bug resolution can take a while. Any suggestions outside of twisted for detecting segfaults? I'm thinking just to monitor /var/log/syslog On Sat, Feb 25, 2017 at 11:59 PM, Glyph Lefkowitz <glyph@twistedmatrix.com> wrote:
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
In general, detecting segfaults in arbitrary processes on the system probably isn't possible. Specifically, I looked up the docs for you ;). Attach a handler to the QWebEngineView::renderProcessTerminated signal :). https://doc.qt.io/qt-5/qwebengineview.html#renderProcessTerminated <https://doc.qt.io/qt-5/qwebengineview.html#renderProcessTerminated> Hope this helps, -glyph
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Presumably the QtWebEngineView is running a subprocess, then? This is really a Qt question rather than a Twisted question, because the QtWebEngineView should be emitting some kind of signal when its rendering process crashes. (If it doesn't I imagine you're just out of luck here and you should report a bug to the Qt developers...) -glyph
![](https://secure.gravatar.com/avatar/a07b6d294d96567cea15ae7ff55df0be.jpg?s=120&d=mm&r=g)
Thanks glyph - really appreciate all the times you've answered my questions! QtWebEngineView is running a subprocess. /home/ubuntu/Qt5.8.0/5.8/gcc_64/libexec/QtWebEngineProcess --type=renderer --disable-accelerated-video-decode --disable-gpu-memory-buffer-video-frames --enable-threaded-compositing --use-gl=desktop --disable-webrtc-hw-encoding --primordial-pipe-token=032B94B57A61DAE34BD0F90551F9ABB6 --lang=en-US --enable-pinch --num-raster-threads=2 --content-image-texture-target=3553 QT can sometimes be helpful, but bug resolution can take a while. Any suggestions outside of twisted for detecting segfaults? I'm thinking just to monitor /var/log/syslog On Sat, Feb 25, 2017 at 11:59 PM, Glyph Lefkowitz <glyph@twistedmatrix.com> wrote:
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
In general, detecting segfaults in arbitrary processes on the system probably isn't possible. Specifically, I looked up the docs for you ;). Attach a handler to the QWebEngineView::renderProcessTerminated signal :). https://doc.qt.io/qt-5/qwebengineview.html#renderProcessTerminated <https://doc.qt.io/qt-5/qwebengineview.html#renderProcessTerminated> Hope this helps, -glyph
participants (2)
-
Glyph Lefkowitz
-
Kevin Mcintyre