[PyQt] Application crash on exit under Linux

Xinkai yeled.nova at gmail.com
Tue Aug 12 10:26:58 BST 2014


Hello,

A PyQt program can sometimes crash when exit. The program can be as
simple as this one.

```
#!/usr/bin/python3
# -*- coding: utf-8 -*-

from PyQt5.QtWidgets import QApplication, QMainWindow
import sys


class DummyApp(QApplication):
    def __init__(self, *args):
        super().__init__(*args)
        self.w = QMainWindow(None)
        self.w.show()

if __name__ == "__main__":
    app = DummyApp([])
    sys.exit(app.exec())
```

dmesg shows:
[Aug12 17:12] QXcbEventReader[12528]: segfault at 7fd2cd05eb19 ip
00007fd2cd05eb19 sp 00007fd2ca624ee0 error 14

gdb python core.dump shows:
Core was generated by `/usr/bin/python3 ./issue25.py'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fd2cd05eb19 in ?? ()
(gdb) bt
#0  0x00007fd2cd05eb19 in ?? ()
#1  0x00007fd2ca624f10 in ?? ()
#2  0x00000000011a5f10 in ?? ()
#3  0x00007fd2ca624f50 in ?? ()
#4  0x00000000011a6270 in ?? ()
#5  0x00007fd2ca625700 in ?? ()
#6  0x00007fd2d61354fe in ?? () from /usr/lib/libQt5Core.so.5
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

The dmesg and coredump info above were made on an Arch x64, with Python
3.4.1 and PyQt 5.3.2-snapshot-dcc21846e00f. Similar crashes can also
happen to Ubuntu 14.04(PyQt 5.2.x).

I don't know if these information is enough. I compiled PyQt with Arch
Build System. I specified "options=(debug !strip)" and added "--debug"
in the "configure.py" line. Still I am getting these not-so-intuitive
backtrace. Maybe someone can tell me how to generate a more detailed
backtrace?


Kind wishes,

Xinkai

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140812/b837bca0/attachment.html>


More information about the PyQt mailing list