You are not logged in.

#1 2015-08-20 07:50:37

Inso
Member
Registered: 2009-11-10
Posts: 13

PyQt5 : SIGABRT with unhandled python exceptions

Hello,

Since last arch update, all my PyQt5 programs are crashing if a python exception is thrown. It does not happen with PyQt4 implementations.

Using GDB, for example with the quamash project (https://github.com/harvimt/quamash/) and running py.test :

================================================== test session starts ===================================================
platform linux -- Python 3.4.3 -- py-1.4.30 -- pytest-2.7.2
rootdir: /home/inso/code/quamash, inifile: tox.ini
collected 47 items 

quamash/__init__.py ..[New Thread 0x7fffd605d700 (LWP 11766)]
[New Thread 0x7fffe49b3700 (LWP 11760)]

Program received signal SIGABRT, Aborted.
0x00007ffff73b95f8 in raise () from /usr/lib/libc.so.6
(gdb) back
#0  0x00007ffff73b95f8 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff73baa7a in abort () from /usr/lib/libc.so.6
#2  0x00007ffff14b7f31 in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/libQt5Core.so.5
#3  0x00007ffff1d22421 in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#4  0x00007ffff1d280cd in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#5  0x00007ffff1d289a7 in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#6  0x00007ffff16d91a0 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#7  0x00007ffff1d2486e in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#8  0x00007ffff7a5df73 in call_function (oparg=<optimized out>, pp_stack=0x7fffffff7670) at Python/ceval.c:4237
#9  PyEval_EvalFrameEx (f=0x7ffff32f9d30, throwflag=<optimized out>) at Python/ceval.c:2838
#10 0x00007ffff7a5e947 in PyEval_EvalCodeEx (_co=0x2deb, globals=0x2deb, locals=0x6, locals@entry=0x0, 
    args=0x7fffe7831840, argcount=-134542992, argcount@entry=1, kws=0x7ffff7faf700, kwcount=-221967072, defs=0x0, 
    defcount=0, kwdefs=0x0, closure=0x7fffe77f7860) at Python/ceval.c:3588

It's getting really annoying because I can't work anymore on my projects...

Any idea ?

Can you try to reproduce it on your arch installation, to check if this is an arch bug or if it's my installation which is broken ?

Just clone quamash and run py.test :
QUAMASH_QTIMPL=PyQt5 py.test

Thanks in advance

Last edited by Inso (2015-08-20 08:32:25)

Offline

#2 2015-08-21 08:15:51

Inso
Member
Registered: 2009-11-10
Posts: 13

Re: PyQt5 : SIGABRT with unhandled python exceptions

Ok so I come with a simple piece of code which reproduces the error :

import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtCore import QTimer, pyqtSlot

class testWidget(QWidget):
    def __init__(self):
        super().__init__()
        print("Timer except")
        QTimer.singleShot(1, self.test_except)
        print("Timer exit")
        QTimer.singleShot(3000, self.test_exit)

    @pyqtSlot()
    def test_except(self):
        print("Async except")
        raise RuntimeError("Test error")

    @pyqtSlot()
    def test_exit(self):
        print("Exit app")
        QApplication.exit(0)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    widget = testWidget()
    app.exec_()
    sys.exit()

Does it crash with a SIGABRT (error code 134) on your station too ? Does the exceptions gets printed ?

Hopefully someone can try to reproduce it...

EDIT : Ok solved. It's a new PyQt5 feature + a pycharm bug.

Last edited by Inso (2015-08-21 08:45:48)

Offline

Board footer

Powered by FluxBB