Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Run the example code on the arm machine, PYQT will report an error.



  • When ever I run the example code on the arm machine, python vesion 2.7.16, Qt5 vesion 5.11.3, PyQt5 vesion 5.11.3, Sip vesion 4.19.14, It results in the error below:

    Could not initialize GLX
    Aborted (core dumped)
    

    but when I run the same example code on the x86 machine, there is no error.

    And when I uninstall python-pyqt5.qtwebengine(5.11.3.1-1+rebuild), the error disappears. Comparing the gdb log and only found the parameters of PyRun_FileExFlags: global and locals is missing a part:

    'app': <QApplication at remote 0xfffff2a89c30>. 
    

    On x86 machines, this part is there.

    I don't know if this is the cause of this problem in the end, and I don't understand why there is such a difference between arm and x86.
    I enclose gdb log and the example code for your reference.The hardware information is also attached.

    So far i havent't found any solution how to solve this issue. Could you help to investigate on this issue, thanks in advance!

    gdb:

    uos@uos-PC:~/Downloads$ gdb python
    GNU gdb (Debian 8.2.1-2+b1) 8.2.1
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "aarch64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    http://www.gnu.org/software/gdb/bugs/.
    Find the GDB manual and other documentation resources online at:
    http://www.gnu.org/software/gdb/documentation/.

    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from python...Reading symbols from /usr/lib/debug/.build-id/d2/abd686c8e3ff7962791dfefbc4ef85235040d3.debug...done.
    done.
    (gdb)
    (gdb) r testExample.py
    Starting program: /usr/bin/python testExample.py
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
    [New Thread 0xffffe5d541e0 (LWP 4622)]
    [New Thread 0xffffe515e1e0 (LWP 4623)]
    Could not initialize GLX

    Thread 1 "python" received signal SIGABRT, Aborted.
    __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    50 ../sysdeps/unix/sysv/linux/raise.c: 没有那个文件或目录.
    (gdb)
    (gdb) py-list
    4 #ifrom PyQt5.QtWebEngineWidgets import QWebEngineView
    5 #from sip import SIP_VERSION_STR
    6
    7 if name=='main':
    8 import sys

    9 app=QApplication(sys.argv)
    10 #print("Qt5 Version Number is: {0}".format(QT_VERSION_STR))
    11 #print("PyQt5 Version is: {}".format(PYQT_VERSION_STR))
    12 #print("Sip Version is: {}".format(SIP_VERSION_STR))
    13 print ("hello")
    14
    (gdb)
    (gdb) bt
    #0 0x0000fffff7d32714 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1 0x0000fffff7d208e8 in __GI_abort () at abort.c:79
    #2 0x0000fffff5beff2c in qt_message_fatal (context=..., message=<synthetic pointer>...) at global/qlogging.cpp:1840
    #3 0x0000fffff5beff2c in QMessageLogger::fatal(char const*, ...) const (this=this@entry=0xffffffffd2d8, msg=msg@entry=0xffffe5540d38 "Could not initialize GLX") at global/qlogging.cpp:880
    #4 0x0000ffffe553e4cc in QGLXContext::init(QXcbScreen*, QPlatformOpenGLContext*) (this=0xffffe0006070, screen=0x7c8210, share=<optimized out>)
    at ../../../../../../include/QtCore/../../src/corelib/global/qlogging.h:91
    #5 0x0000ffffe553bb20 in QXcbGlxIntegration::createPlatformOpenGLContext(QOpenGLContext*) const (this=<optimized out>, context=0xffffe00056c0) at qxcbglxintegration.cpp:186
    #6 0x0000ffffe5f870d0 in QXcbIntegration::createPlatformOpenGLContext(QOpenGLContext*) const (this=<optimized out>, context=0xffffe00056c0) at qxcbintegration.cpp:283
    #7 0x0000fffff61cec08 in QOpenGLContext::create() (this=0xffffe00056c0) at ../../include/QtGui/5.11.3/QtGui/private/../../../../../src/gui/kernel/qguiapplication_p.h:105
    #8 0x0000ffffef4e3af4 in QtWebEngineCore::initialize() () at /lib/aarch64-linux-gnu/libQt5WebEngineCore.so.5
    #9 0x0000fffff5dd00f0 in qt_call_pre_routines () at ../../include/QtCore/../../src/corelib/tools/qlist.h:540
    #10 0x0000fffff5dd00f0 in QCoreApplicationPrivate::init() (this=this@entry=0x7cb3f0) at kernel/qcoreapplication.cpp:865
    #11 0x0000fffff618b7e8 in QGuiApplicationPrivate::init() (this=this@entry=0x7cb3f0) at kernel/qguiapplication.cpp:1419
    #12 0x0000fffff675d354 in QApplicationPrivate::init() (this=0x7cb3f0) at kernel/qapplication.cpp:564
    #13 0x0000fffff7020d2c in sipQApplication::sipQApplication(int&, char**, int) (this=0xac5860, a0=<optimized out>, a1=<optimized out>, a2=<optimized out>) at ./build-2.7/QtWidgets/sipQtWidgetspart9.cpp:12868
    #14 0x0000fffff7020e1c in init_type_QApplication(sipSimpleWrapper*, PyObject*, PyObject*, PyObject**, PyObject**, PyObject**)
    (sipSelf=0xfffff2e1ad60, sipArgs=<optimized out>, sipKwds=<optimized out>, sipUnused=<optimized out>, sipParseErr=0xffffffffd7a0) at ./sip/QtWidgets/qapplication.sip:221
    #15 0x0000fffff31de53c in sipSimpleWrapper_init (self=0xfffff2e1ad60, args=(['testExample.py'],), kwds=0x0) at ./siplib/siplib.c:10542
    #16 0x00000000004609b8 in type_call (type=<optimized out>, args=(['testExample.py'],), kwds=0x0) at ../Objects/typeobject.c:1181
    #17 0x0000000000456310 in PyObject_Call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/abstract.c:2544
    #18 0x00000000004799ec in do_call (nk=<optimized out>, na=<optimized out>, pp_stack=0xffffffffd948, func=<optimized out>) at ../Python/ceval.c:4593
    #19 0x00000000004799ec in call_function (oparg=<optimized out>, pp_stack=0xffffffffd948) at ../Python/ceval.c:4398
    #20 0x00000000004799ec in PyEval_EvalFrameEx (f=<optimized out>, throwflag=<optimized out>) at ../Python/ceval.c:3013
    #21 0x0000000000471d08 in PyEval_EvalCodeEx
    (co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kws=<optimized out>, kwcount=<optimized out>, defs=<optimized out>, defcount=<optimized out>, closure=<optimized out>) at ../Python/ceval.c:3608
    #22 0x000000000047197c in PyEval_EvalCode (co=<optimized out>, globals=<optimized out>, locals=<optimized out>) at ../Python/ceval.c:669
    #23 0x00000000004a9798 in run_mod
    (mod=<optimized out>, filename=<optimized out>, globals={'PYQT_VERSION_STR': '5.11.3', 'QT_VERSION_STR': '5.11.3', 'builtins': <module at remote 0xfffff7cc0b08>, 'file': 'testExample.py', 'QApplication': <sip.wrappertype at remote 0x96c010>, 'package': None, 'sys': <module at remote 0xfffff7cc0bb0>, 'name': 'main', 'doc': None}, locals={'PYQT_VERSION_STR': '5.11.3', 'QT_VERSION_STR': '5.11.3', 'builtins': <module at remote 0xfffff7cc0b08>, 'file': 'testExample.py', 'QApplication': <sip.wrappertype at remote 0x96c010>, 'package': None, 'sys': <module at remote 0xfffff7cc0bb0>, 'name': 'main', 'doc': None}, flags=<optimized out>, arena=<optimized out>) at ../Python/pythonrun.c:1385
    #24 0x00000000004a4124 in PyRun_FileExFlags
    (fp=fp@entry=0x7a26f0, filename=filename@entry=0xffffffffe0c5 "testExample.py", start=start@entry=257, globals=globals@entry={'PYQT_VERSION_STR': '5.11.3', 'QT_VERSION_STR': '5.11.3', 'builtins': <module at remote 0xfffff7cc0b08>, 'file': 'testExample.py', 'QApplication': <sip.wrappertype at remote 0x96c010>, 'package': None, 'sys': <module at remote 0xfffff7cc0bb0>, 'name': 'main', 'doc': None}, locals=locals@entry={'PYQT_VERSION_STR': '5.11.3', 'QT_VERSION_STR': '5.11.3', 'builtins': <module at remote 0xfffff7cc0b08>, 'file': 'testExample.py', 'QApplication': <sip.wrappertype at remote 0x96c010>, 'package': None, 'sys': <module at remote 0xfffff7cc0bb0>, 'name': 'main', 'doc': None}, closeit=closeit@entry=1, flags=flags@entry=0xffffffffdbf8) at ../Python/pythonrun.c:1371
    #25 0x00000000004a3784 in PyRun_SimpleFileExFlags (fp=0x7a26f0, filename=0xffffffffe0c5 "testExample.py", closeit=1, flags=0xffffffffdbf8) at ../Python/pythonrun.c:957
    #26 0x000000000043db68 in Py_Main (argc=<optimized out>, argv=<optimized out>) at ../Modules/main.c:641
    #27 0x0000fffff7d20d24 in __libc_start_main (main=0x43d5d0 <main>, argc=2, argv=0xffffffffddc8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>)
    at ../csu/libc-start.c:308
    #28 0x000000000043d518 in _start () at ../Objects/bytearrayobject.c:18
    (gdb)

    after uninstall python-pyqt5.qtwebengine:

    uos@uos-PC:~/Downloads$ gdb python
    GNU gdb (Debian 8.2.1-2+b1) 8.2.1
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "aarch64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    http://www.gnu.org/software/gdb/bugs/.
    Find the GDB manual and other documentation resources online at:
    http://www.gnu.org/software/gdb/documentation/.

    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from python...Reading symbols from /usr/lib/debug/.build-id/d2/abd686c8e3ff7962791dfefbc4ef85235040d3.debug...done.
    done.
    (gdb)
    (gdb) r testExample.py
    Starting program: /usr/bin/python testExample.py
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
    [New Thread 0xfffff07af1e0 (LWP 24623)]
    [New Thread 0xffffef0271e0 (LWP 24624)]
    Qt5 Version Number is: 5.11.3
    PyQt5 Version is: 5.11.3
    Sip Version is: 4.19.14
    ^C
    Thread 1 "python" received signal SIGINT, Interrupt.
    0x0000fffff7dc62f0 in __GI___poll (fds=0xffffe8006310, nfds=2, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:41
    41 ../sysdeps/unix/sysv/linux/poll.c: 没有那个文件或目录.
    (gdb)
    (gdb) bt
    #0 0x0000fffff7dc62f0 in _GI___poll (fds=0xffffe8006310, nfds=2, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:41
    #1 0x0000fffff5150864 in () at /lib/aarch64-linux-gnu/libglib-2.0.so.0
    #2 0x0000fffff5150984 in g_main_context_iteration () at /lib/aarch64-linux-gnu/libglib-2.0.so.0
    #3 0x0000fffff5e1f104 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) (this=0xb4e760, flags=...) at kernel/qeventdispatcher_glib.cpp:422
    #4 0x0000fffff0cda6b0 in QPAEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) (this=0xb4e760, flags=...) at qeventdispatcher_glib.cpp:69
    #5 0x0000fffff5dc7f68 in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) (this=this@entry=0xffffffffd7b0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140
    #6 0x0000fffff5dd07ec in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:120
    #7 0x0000fffff6186d98 in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1762
    #8 0x0000fffff67583d4 in QApplication::exec() () at kernel/qapplication.cpp:2900
    #9 0x0000fffff7000a54 in meth_QApplication_exec
    (PyObject*, PyObject*) (sipArgs=<optimized out>) at ./build-2.7/QtWidgets/sipQtWidgetspart9.cpp:14177
    #10 0x0000000000474be0 in call_function (oparg=<optimized out>, pp_stack=0xffffffffd948) at ../Python/ceval.c:4376
    #11 0x0000000000474be0 in PyEval_EvalFrameEx (f=<optimized out>, throwflag=<optimized out>) at ../Python/ceval.c:3013
    #12 0x0000000000471d08 in PyEval_EvalCodeEx
    (co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kws=<optimized out>, kwcount=<optimized out>, defs=<optimized out>, defcount=<optimized out>, closure=<optimized out>) at ../Python/ceval.c:3608
    #13 0x000000000047197c in PyEval_EvalCode (co=<optimized out>, globals=<optimized out>, locals=<optimized out>) at ../Python/ceval.c:669
    #14 0x00000000004a9798 in run_mod
    (mod=<optimized out>, filename=<optimized out>, globals={'PYQT_VERSION_STR': '5.11.3', 'QT_VERSION_STR': '5.11.3', 'builtins': <module at remote 0xfffff7cc0b08>, 'file': 'testExample.py', 'SIP_VERSION_STR': '4.19.14', 'QApplication': <sip.wrappertype at remote 0x96c1d0>, 'package': None, 'sys': <module at remote 0xfffff7cc0bb0>, 'name': 'main', 'app': <QApplication at remote 0xfffff2a89c30>, 'doc': None}, locals={'PYQT_VERSION_STR': '5.11.3', 'QT_VERSION_STR': '5.11.3', 'builtins': <module at remote 0xfffff7cc0b08>, 'file': 'testExample.py', 'SIP_VERSION_STR': '4.19.14', 'QApplication': <sip.wrappertype at remote 0x96c1d0>, 'package': None, 'sys': <module at remote 0xfffff7cc0bb0>, 'name': 'main', 'app': <QApplication at remote 0xfffff2a89c30>, 'doc': None}, flags=<optimized out>, arena=<optimized out>) at ../Python/pythonrun.c:1385
    #15 0x00000000004a4124 in PyRun_FileExFlags
    (fp=fp@entry=0x7a26f0, filename=filename@entry=0xffffffffe0cc "testExample.py", start=start@entry=257, globals=globals@entry={'PYQT_VERSION_STR': '5.11.3', 'QT_VERSION_STR': '5.11.3', 'builtins': <module at remote 0xfffff7cc0b08>, 'file': 'testExample.py', 'SIP_VERSION_STR': '4.19.14', 'QApplication': <sip.wrappertype at remote 0x96c1d0>, 'package': None, 'sys': <module at remote 0xfffff7cc0bb0>, 'name': 'main', 'app': <QApplication at remote 0xfffff2a89c30>, 'doc': None}, locals=locals@entry={'PYQT_VERSION_STR': '5.11.3', 'QT_VERSION_STR': '5.11.3', 'builtins': <module at remote 0xfffff7cc0b08>, 'file': 'testExample.py', 'SIP_VERSION_STR': '4.19.14', 'QApplication': <sip.wrappertype at remote 0x96c1d0>, 'package': None, 'sys': <module at remote 0xfffff7cc0bb0>, 'name': 'main', 'app': <QApplication at remote 0xfffff2a89c30>, 'doc': None}, closeit=closeit@entry=1, flags=flags@entry=0xffffffffdbf8) at ../Python/pythonrun.c:1371
    #16 0x00000000004a3784 in PyRun_SimpleFileExFlags (fp=0x7a26f0, filename=0xffffffffe0cc "testExample.py", closeit=1, flags=0xffffffffdbf8) at ../Python/pythonrun.c:957
    #17 0x000000000043db68 in Py_Main (argc=<optimized out>, argv=<optimized out>) at ../Modules/main.c:641
    #18 0x0000fffff7d20d24 in __libc_start_main (main=0x43d5d0 <main>, argc=2, argv=0xffffffffddc8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>)
    at ../csu/libc-start.c:308
    #19 0x000000000043d518 in _start () at ../Objects/bytearrayobject.c:18
    (gdb)



  • testExample.py:
    from PyQt5.QtWidgets import QApplication
    from PyQt5.QtCore import QT_VERSION_STR
    from PyQt5.Qt import PYQT_VERSION_STR
    from sip import SIP_VERSION_STR

    if name=='main':
    import sys
    app=QApplication(sys.argv)
    print("Qt5 Version Number is: {0}".format(QT_VERSION_STR))
    print("PyQt5 Version is: {}".format(PYQT_VERSION_STR))
    print("Sip Version is: {}".format(SIP_VERSION_STR)
    sys.exit(app.exec_())



  • @bool said in Run the example code on the arm machine, PYQT will report an error.:

    python vesion 2.7.16, Qt5 vesion 5.11.3, PyQt5 vesion 5.11.3,

    Just a question: Do you have a version of PyQt 5.11 which supports Python version 2.7? Did you build it yourself? My understanding is that any wheel distribution of PyQt 5.11 will not work with Python 2.7. But you may say you have that working so it is not the issue here?


  • Banned

    No Qt5 and thus PyQt5 and PySide2 are not designed to work cleanly with Python2.7 and while there is a work around to do this the big question becomes just how stable is this cobbled version of Qt5. Personally I see absolutely no reason to try and shoe horn a size 14 foot into a size 12 shoe especially when Python2.7 was made obsolete as of January 2020. So it seems to make absolute sense to update to Python3.7 (the most stable version thus far) and leave these unnecessary issues behind. Sooner or later you are going to have to do this -- either after wasting a lot of time trying to get Qt5 to work in Python2.7 or now and get prepared for the newer Qt6 release coming up soon



  • @Denni-0
    Hi
    Thanks for your reply.
    I tried using python3, but there are still errors.

    *uos@uos-PC:~/Downloads$ /usr/bin/python3.7 testExample.py
    Could not initialize GLX
    Aborted (core dumped)

    The gdb log is the same as above.



  • @JonB
    Hi
    Thanks for your reply.
    I tried using python3, but there are still errors.
    python-pyqt5.qtwebengine-dbg Version: 5.11.3+dfsg-1+b3_arm64 , I downloaded from the debian.


  • Banned

    @bool you may have in installation issue -- as that occurs and some folks have to scrap the current install and reinstall it all from scratch -- sometimes something is done wrong during the initial install -- or something just happens and it does not install correctly -- especially if you have multiple version of python and/or python-qt on the same machine


Log in to reply