Hitsuki
Hitsuki

Reputation: 41

Segmentation fault when exiting QApplication

Tested on:

When exiting my application, I got an address boundary error.

GDB output:

...
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff7d0ae59 in _PyObject_GC_NewVar () from /usr/lib/libpython3.9.so.1.0
(gdb) bt
#0  0x00007ffff7d0ae59 in _PyObject_GC_NewVar () at /usr/lib/libpython3.9.so.1.0
#1  0x00007ffff7d0e2d8 in PyTuple_Pack () at /usr/lib/libpython3.9.so.1.0
#2  0x00007ffff7dd82d1 in _PyErr_SetKeyError () at /usr/lib/libpython3.9.so.1.0
#3  0x00007ffff7d1655a in _PyDict_DelItem_KnownHash () at /usr/lib/libpython3.9.so.1.0
#4  0x00007ffff7d088e1 in  () at /usr/lib/libpython3.9.so.1.0
#5  0x00007ffff6c1e260 in Shiboken::String::finalizeStaticStrings() () at /home/sati/.local/lib/python3.9/site-packages/shiboken2/libshiboken2.abi3.so.5.15
#6  0x00007ffff7c89016 in  () at /usr/lib/libpython3.9.so.1.0
#7  0x00007ffff7df4cfa in Py_RunMain () at /usr/lib/libpython3.9.so.1.0
#8  0x00007ffff7dc5ab9 in Py_BytesMain () at /usr/lib/libpython3.9.so.1.0
#9  0x00007ffff7a50b25 in __libc_start_main () at /usr/lib/libc.so.6
#10 0x000055555555504e in _start ()

Example code

from PySide2.QtWidgets import QApplication, QWidget
import sys


class Window(QWidget):
    def __init__(self):
        super().__init__()


myApp = QApplication(sys.argv)

window = Window()
window.show()
window.resize(600,400)

myApp.exec_()
sys.exit(0)

Upvotes: 1

Views: 739

Answers (1)

Hitsuki
Hitsuki

Reputation: 41

As @ekhumoro said, the problem was in shiboken2 from Pip. I removed packages and installed ones from Arch Linux repositories.

pip uninstall shiboken2
pip uninstall PySide2
sudo pacman -Sy pyside2 shiboken2

Upvotes: 1

Related Questions