<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello,<br>
<br>
A PyQt program can sometimes crash when exit. The program can be as
simple as this one.<br>
<br>
```<br>
#!/usr/bin/python3<br>
# -*- coding: utf-8 -*-<br>
<br>
from PyQt5.QtWidgets import QApplication, QMainWindow<br>
import sys<br>
<br>
<br>
class DummyApp(QApplication):<br>
def __init__(self, *args):<br>
super().__init__(*args)<br>
self.w = QMainWindow(None)<br>
self.w.show()<br>
<br>
if __name__ == "__main__":<br>
app = DummyApp([])<br>
sys.exit(app.exec())<br>
```<br>
<br>
dmesg shows: <br>
<font color="#006600">[Aug12 17:12] QXcbEventReader[12528]: segfault
at 7fd2cd05eb19 ip 00007fd2cd05eb19 sp 00007fd2ca624ee0 error 14</font><br>
<br>
gdb python core.dump shows:<br>
<font color="#006600">Core was generated by `/usr/bin/python3
./issue25.py'.<br>
Program terminated with signal SIGSEGV, Segmentation fault.<br>
#0 0x00007fd2cd05eb19 in ?? ()<br>
(gdb) bt<br>
#0 0x00007fd2cd05eb19 in ?? ()<br>
#1 0x00007fd2ca624f10 in ?? ()<br>
#2 0x00000000011a5f10 in ?? ()<br>
#3 0x00007fd2ca624f50 in ?? ()<br>
#4 0x00000000011a6270 in ?? ()<br>
#5 0x00007fd2ca625700 in ?? ()<br>
#6 0x00007fd2d61354fe in ?? () from /usr/lib/libQt5Core.so.5<br>
Backtrace stopped: previous frame inner to this frame (corrupt
stack?)</font><br>
<br>
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).<br>
<br>
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?<br>
<br>
<br>
Kind wishes,<br>
<br>
Xinkai<br>
<br>
</body>
</html>