You are not logged in.

#1 2020-01-12 13:52:46

catastropeia
Member
Registered: 2016-12-05
Posts: 10

[SOLVED] pyqt5 applications crash with GLib-CRITICAL and seg fault

Since yesterday any pyqt5 application on my machine crashes with GLib-CRITICAL and segmentation fault.

I can reproduce this by running these three lines in a python console:

import sys
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)

The output is

(process:1947): GLib-CRITICAL **: 14:38:34.850: g_hash_table_contains: assertion 'hash_table != NULL' failed
(process:1947): GLib-CRITICAL **: 14:38:34.850: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
[1]    1947 segmentation fault (core dumped)  python

My arch install is up to date and freshly rebooted. Since the last time it worked (maybe 3 days ago), I can't remember doing anything to my system besides updating regularly. Currently I don't even know how to find out whether this is a bug in glib, pyqt5 or if something's wrong with my system.

Last edited by catastropeia (2020-01-17 19:39:46)

Offline

#2 2020-01-12 14:54:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,616

Re: [SOLVED] pyqt5 applications crash with GLib-CRITICAL and seg fault

glib errors in combination with qt can only really happen with some GTK qt5 theme, what are you using here? And if this is from the AUR make sure you rebuild your qt theme. Also look/post the contents of that dump: https://wiki.archlinux.org/index.php/Co … _core_dump

Do normal Qt5 applications work?

Offline

#3 2020-01-12 20:14:13

catastropeia
Member
Registered: 2016-12-05
Posts: 10

Re: [SOLVED] pyqt5 applications crash with GLib-CRITICAL and seg fault

V1del wrote:

glib errors in combination with qt can only really happen with some GTK qt5 theme, what are you using here? And if this is from the AUR make sure you rebuild your qt theme. Also look/post the contents of that dump: https://wiki.archlinux.org/index.php/Co … _core_dump

Do normal Qt5 applications work?

Thank you for your help. Qt5 applications (e.g. Qt Creator) do work. I do not use any custom theme. From the ones listed at https://wiki.archlinux.org/index.php/Un … plications, I have only Adwaita installed, so I guess this is the one. I just tried reinstalling it and rebooting, but that didn't help. Here is the core dump:

           PID: 4911 (python)
           UID: 1000 
           GID: 985 (users)
        Signal: 11 (SEGV)
     Timestamp: Sun 2020-01-12 20:55:18 CET (1min 25s ago)
  Command Line: python
    Executable: /usr/bin/python3.8
 Control Group: /user.slice/user-1000.slice/session-1.scope
          Unit: session-1.scope
         Slice: user-1000.slice
       Session: 1
     Owner UID: 1000 
       Storage: /var/lib/systemd/coredump/core.python.1000.ff94f2a42f2b47a5af4c11e614554985.4911.1578858918000000000000.lz4
       Message: Process 4911 (python) of user 1000 dumped core.
                
                Stack trace of thread 4911:
                #0  0x00007f0e39d35239 n/a (libglib-2.0.so.0 + 0x1c239)
                #1  0x00007f0e39d83ed1 n/a (libglib-2.0.so.0 + 0x6aed1)
                #2  0x00007f0e39d85776 g_source_attach (libglib-2.0.so.0 + 0x6c776)
                #3  0x00007f0e36ffbf24 _ZN19QXcbEventDispatcher21createEventDispatcherEP14QXcbConnection (libQt5XcbQpa.so.5 + 0x6bf24)
                #4  0x00007f0e3af58dd9 _ZN22QGuiApplicationPrivate21createEventDispatcherEv (libQt5Gui.so.5 + 0x12add9)
                #5  0x00007f0e3aba11e5 _ZN23QCoreApplicationPrivate4initEv (libQt5Core.so.5 + 0x2ab1e5)
                #6  0x00007f0e3af5bea0 _ZN22QGuiApplicationPrivate4initEv (libQt5Gui.so.5 + 0x12dea0)
                #7  0x00007f0e3b637eda _ZN19QApplicationPrivate4initEv (libQt5Widgets.so.5 + 0x161eda)
                #8  0x00007f0e3bee690a n/a (QtWidgets.abi3.so + 0x37090a)
                #9  0x00007f0e3bee69ea n/a (QtWidgets.abi3.so + 0x3709ea)
                #10 0x00007f0e3c18d660 n/a (sip.cpython-38-x86_64-linux-gnu.so + 0x17660)
                #11 0x00007f0e3ca701a4 _PyObject_MakeTpCall (libpython3.8.so.1.0 + 0x12c1a4)
                #12 0x00007f0e3cad949a _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x19549a)
                #13 0x00007f0e3caa509a _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x16109a)
                #14 0x00007f0e3caa5cca PyEval_EvalCodeEx (libpython3.8.so.1.0 + 0x161cca)
                #15 0x00007f0e3cb3173c PyEval_EvalCode (libpython3.8.so.1.0 + 0x1ed73c)
                #16 0x00007f0e3cb317ea n/a (libpython3.8.so.1.0 + 0x1ed7ea)
                #17 0x00007f0e3cb6d325 n/a (libpython3.8.so.1.0 + 0x229325)
                #18 0x00007f0e3ca4c816 n/a (libpython3.8.so.1.0 + 0x108816)
                #19 0x00007f0e3ca4ed83 PyRun_InteractiveLoopFlags (libpython3.8.so.1.0 + 0x10ad83)
                #20 0x00007f0e3ca4ee4e PyRun_AnyFileExFlags (libpython3.8.so.1.0 + 0x10ae4e)
                #21 0x00007f0e3ca508c7 n/a (libpython3.8.so.1.0 + 0x10c8c7)
                #22 0x00007f0e3cb70339 Py_BytesMain (libpython3.8.so.1.0 + 0x22c339)
                #23 0x00007f0e3cce3153 __libc_start_main (libc.so.6 + 0x27153)
                #24 0x000055ab90d6a05e _start (python3.8 + 0x105e)
                
                Stack trace of thread 4912:
                #0  0x00007f0e3cdb09ef __poll (libc.so.6 + 0xf49ef)
                #1  0x00007f0e37d11630 n/a (libxcb.so.1 + 0xc630)
                #2  0x00007f0e37d132db xcb_wait_for_event (libxcb.so.1 + 0xe2db)
                #3  0x00007f0e36ffabd0 _ZN14QXcbEventQueue3runEv (libQt5XcbQpa.so.5 + 0x6abd0)
                #4  0x00007f0e3a9bffd6 n/a (libQt5Core.so.5 + 0xc9fd6)
                #5  0x00007f0e3c92b4cf start_thread (libpthread.so.0 + 0x94cf)
                #6  0x00007f0e3cdbb2d3 __clone (libc.so.6 + 0xff2d3)

Offline

#4 2020-01-17 19:39:03

catastropeia
Member
Registered: 2016-12-05
Posts: 10

Re: [SOLVED] pyqt5 applications crash with GLib-CRITICAL and seg fault

Reinstalling pyqt5 solved the problem:

sudo pip install --upgrade --force-reinstall pyqt5

Offline

#5 2020-01-17 19:53:28

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 413
Website

Re: [SOLVED] pyqt5 applications crash with GLib-CRITICAL and seg fault

You shouldn't really be installing with `sudo pip` and instead should be using pacman to install any required packages that are required system wide. You can use pip to install for specific users/environments if you want as that will bypass any future issues with pacman updates. Your solution will invariably cause issues for you later down the line and is most likely the cause for your original issue to begin with.


"the wind-blown way, wanna win? don't play"

Offline

Board footer

Powered by FluxBB