Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)

2020-07-13 Thread Dmitry Shachnev
Hi, sorry for the late reply too.

On Mon, Jul 06, 2020 at 02:56:04PM +0800, pengzon...@uniontech.com wrote:
> Hi!
>
> Sorry for my late reply. I preload libGLX_mesa.so.0 , and then run  the code
> on the arm machine is ok.
> I tried to debug it, and then I found something different. The parameter of
> __glXLookupVendorByName is NVIDIA instead of mesa, it will dlopen
> libGLX_nvidia.so.0, but my Graphics Card is AMD, only IibGLX_mesa.so.0 can
> be found locally, so __glXLookupVendorByName failed.

It looks like for some reason your X server returns "nvidia" in response
to glXQueryServerString request.

I would suggest you to try writing a minimal test case that would call
glXQueryServerString (e.g. via libxcb and xcb_glx_query_server_string),
and check what happens. If the value is wrong then maybe open a bug against
the X server.

Exporting __GLX_VENDOR_LIBRARY_NAME=mesa (or whatever) env variable should
override it.

P.S. The glibc patch was accepted upstream, so it will land in Debian packages
sooner or later.

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)【请注意,邮件由mity...@gmail.com代发】

2020-07-05 Thread pengzon...@uniontech.com
Hi!

Sorry for my late reply. I preload libGLX_mesa.so.0 , and then run  the code on 
the arm machine is ok.
I tried to debug it, and then I found something different. The parameter of 
__glXLookupVendorByName is NVIDIA instead of mesa, it will dlopen 
libGLX_nvidia.so.0,
but my Graphics Card is AMD, only IibGLX_mesa.so.0 can be found locally, so 
__glXLookupVendorByName failed.

(gdb) b libglxmapping.c:574
Breakpoint 4 at 0xf3a993d0: file ../../../src/GLX/libglxmapping.c, line 574.
(gdb) r
[...]
Thread 1 "python" hit Breakpoint 4, __glXLookupVendorByScreen 
(dpy=dpy@entry=0xab1f8de0, screen=screen@entry=0) at 
../../../src/GLX/libglxmapping.c:574
(gdb) p name
$11 = 0xe0006330 "nvidia"

(gdb) b libglxmapping.c:430
Breakpoint 5 at 0xf3a97f74: file ../../../src/GLX/libglxmapping.c, line 430.
(gdb) r
[...]
Thread 1 "python" hit Breakpoint 5, __glXLookupVendorByName 
(vendorName=0xe0006110 "nvidia") at ../../../src/GLX/libglxmapping.c:430
(gdb) p filename
$12 = 0xab1ecc40 "libGLX_nvidia.so.0"
(gdb) 

I tried to continue debug, but I didn't find why filename is nvidia. 
 If you could please shed some light on this topic, I would really appreciate 
it.
Thank you in advance.

BRs
//Zongli


Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)

2020-07-01 Thread Dmitry Shachnev
On Wed, Jul 01, 2020 at 11:29:39AM +0800, pengzon...@uniontech.com wrote:
> Hi!
>
> Some information on this, it look like  the same issue as #963709.
>
> (gdb) r PnsAppWebX.py 
> Starting program: /usr/bin/python PnsAppWebX.py
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
> [New Thread 0xe6bc41e0 (LWP 21532)]
> 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) b libglxmapping.c:432
> No source file named libglxmapping.c.
> Make breakpoint pending on future shared library load? (y or [n]) y
> Breakpoint 1 (libglxmapping.c:432) pending.
> (gdb) p vendor->dlhandle
> No symbol "vendor" in current context.
> (gdb) p (char *)dlerror()
> $1 = 0xab233500 "/lib/aarch64-linux-gnu/libglapi.so.0: cannot allocate 
> memory in static TLS block"
> (gdb) 
>
> Now, is this the only  way we can fix this issue?and is there any way to
> fix this issue fundamentally?
> Thank you for letting me know.

As I said in that bug, there is a glibc patch currently under review,
which is *maybe* related:

https://sourceware.org/pipermail/libc-alpha/2020-May/114247.html

But I have not tested it.

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)【请注意,邮件由mity...@gmail.com代发】

2020-06-30 Thread pengzon...@uniontech.com
Hi!

Some information on this, it look like  the same issue as #963709.

(gdb) r PnsAppWebX.py 
Starting program: /usr/bin/python PnsAppWebX.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
[New Thread 0xe6bc41e0 (LWP 21532)]
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) b libglxmapping.c:432
No source file named libglxmapping.c.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (libglxmapping.c:432) pending.
(gdb) p vendor->dlhandle
No symbol "vendor" in current context.
(gdb) p (char *)dlerror()
$1 = 0xab233500 "/lib/aarch64-linux-gnu/libglapi.so.0: cannot allocate 
memory in static TLS block"
(gdb) 

Now, is this the only  way we can fix this issue?and is there any way to fix 
this issue fundamentally?
Thank you for letting me know.

BRs
//Zongli


Processed: Re: Bug#960073: Package:python-pyqt5 Run the example code with Trace?? and crash (SIGABRT)

2020-06-28 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 -moreinfo
Bug #960073 [python-pyqt5] Package:python-pyqt5 Run the example code with Trace 
and crash (SIGABRT)
Removed tag(s) moreinfo.

-- 
960073: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=960073
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#960073: Package:python-pyqt5 Run the example code with Trace?? and crash (SIGABRT)

2020-06-28 Thread Dmitry Shachnev
Control: tags -1 -moreinfo

On Sun, Jun 28, 2020 at 06:01:51PM +0800, pengzon...@uniontech.com wrote:
> Hi!
>
> I add  this code on top of the python file and it works now.
> I read this https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=963709#39 ,
> but I don’t understand why this is effective.
> Thank you very much for your  help .

As I understand it, after loading QtWebEngine there is not enough memory
for libglapi.so.0's TLS (thread-local storage) block, so loading that library
fails. Loading it before QtWebEngine fixes it.

This is a workaround, not a proper fix yet.

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)【请注意,邮件由mity...@gmail.com代发】

2020-06-28 Thread pengzon...@uniontech.com
Hi!

I add  this code on top of the python file and it works now. I read this 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=963709#39 , but I don’t 
understand why this is effective.
Thank you very much for your  help .

BRs
//Zongli


Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)

2020-06-28 Thread Dmitry Shachnev
Hi again,

On Fri, Jun 12, 2020 at 06:16:05PM +0800, pengzon...@uniontech.com wrote:
> Hi!
>
> I tried to verify the local opengl/glx, they are normal. It is no problem
> to write QT code directly to call qtwebengine. So I suspect that the
> problem is caused by pyqt.
> Looking forward to hearing from you soon.

Please try adding this on top of your Python file, *before* importing
PyQt:

import ctypes
ctypes.CDLL('libGLX_mesa.so.0', ctypes.RTLD_GLOBAL)

Alternatively, run your code with LD_PRELOAD=libGLX_mesa.so.0 environment
variable.

Please see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=963709#39
for details.

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)

2020-06-12 Thread Dmitry Shachnev
Hi!

On Thu, Jun 11, 2020 at 02:57:22PM +0800, pengzon...@uniontech.com wrote:
> Hi!
>
> Sorry for my late reply.
> I tried to exporting QT_XCB_GL_INTEGRATION=xcb_egl  and it still reported
> an error. libglvnd-dev  package was originally installed.

I have never seen this issue, so it's hard to tell anything about it.

I may suggest you to try debugging further and try to find out why Python
and C++ programs behave differently.

Also, you may try to contact upstream PyQt [1] or Qt [2].

[1]: https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[2]: https://bugreports.qt.io/

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#960073: Re: Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)【请注意,邮件由mity...@gmail.com代发】

2020-06-12 Thread pengzon...@uniontech.com
Hi!

I tried to verify the local opengl/glx, they are normal. It is no problem to 
write QT code directly to call qtwebengine. So I suspect that the problem is 
caused by pyqt.
Looking forward to hearing from you soon.
Thanks.

BRs
//Zongli


testwebengine.cpp
Description: Binary data


Bug#960073: Re: Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)【请注意,邮件由mity...@gmail.com代发】

2020-06-11 Thread pengzon...@uniontech.com
Hi!

Sorry for my late reply.
I tried to exporting QT_XCB_GL_INTEGRATION=xcb_egl  and it still reported an 
error. libglvnd-dev  package was originally installed.
Do you need other information?

Thank you in advance.

BRs
//Zongli


Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)

2020-05-21 Thread Dmitry Shachnev
Control: tags -1 moreinfo

Hi!

On Sat, May 09, 2020 at 10:48:42AM +0800, pengzongli wrote:
> When ever I run the example code on the arm machine, 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(Debian 8.3.0-6),
> there is no error.

This is because the OpenGL hardware/drivers are different on ARM and x86.

I think I have seen similar issues before with old Qt versions. Can you
please check the following two things:

- Whether installing libglvnd-dev package helps?
- Whether exporting QT_XCB_GL_INTEGRATION=xcb_egl environment variable helps?

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Processed: Re: Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)

2020-05-21 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 moreinfo
Bug #960073 [python-pyqt5] Package:python-pyqt5 Run the example code with Trace 
and crash (SIGABRT)
Added tag(s) moreinfo.

-- 
960073: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=960073
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#960073: Package:python-pyqt5 Run the example code with Trace and crash (SIGABRT)

2020-05-08 Thread pengzongli

Package:python-pyqt5
Version: 5.11.3+dfsg-1+b3_arm64
Severity: serious
Hi Experts,

Hope this email finds you well.
I am Peng Zongli, I'm sorry to bother you.
When ever I run the example code on the arm machine,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(Debian 8.3.0-6), 
there is no error.




Debian Release: (gcc version 9.2.1 20191102 (Debian 9.2.1-17))
Architecture: arm (64)
Kernel: Linux 4.19.34-2-arm64


python vesion 2.7.16
python-pyqt5-dbg (5.11.3+dfsg-1+b3)
python-pyqt5.qtwebengine-dbg (5.11.3+dfsg-1+b3)
Qt5 vesion 5.11.3
GLX version: 1.4
Sip vesion 4.19.14



the example code:

/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_())/

it gives a Python traceback and crash:


/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 
 
/

/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:/
/. 
/

/Find the GDB manual and other documentation resources online at:/
/    . 
/



/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 0xe5d541e0 (LWP 4622)]/
/[New Thread 0xe515e1e0 (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 0xf7d32714 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:50/

/#1 0xf7d208e8 in __GI_abort () at abort.c:79/
/#2 0xf5beff2c in qt_message_fatal (context=..., 
message=...) at global/qlogging.cpp:1840/
/#3 0xf5beff2c in QMessageLogger::fatal(char const*, ...) const 
(this=this@entry=0xd2d8, msg=msg@entry=0xe5540d38 "Could not 
initialize GLX") at global/qlogging.cpp:880/
/#4 0xe553e4cc in QGLXContext::init(QXcbScreen*, 
QPlatformOpenGLContext*) (this=0xe0006070, screen=0x7c8210, 
share=)/
/    at 
../../../../../../include/QtCore/../../src/corelib/global/qlogging.h:91/
/#5 0xe553bb20 in 
QXcbGlxIntegration::createPlatformOpenGLContext(QOpenGLContext*) const 
(this=, context=0xe00056c0) at 
qxcbglxintegration.cpp:186/
/#6 0xe5f870d0 in 
QXcbIntegration::createPlatformOpenGLContext(QOpenGLContext*) const 
(this=, context=0xe00056c0) at qxcbintegration.cpp:283/
/#7 0xf61cec08 in QOpenGLContext::create() (this=0xe00056c0) 
at 
../../include/QtGui/5.11.3/QtGui/private/../../../../../src/gui/kernel/qguiapplication_p.h:105/
/#8 0xef4e3af4 in QtWebEngineCore::initialize() () at 
/lib/aarch64-linux-gnu/libQt5WebEngineCore.so.5/
/#9 0xf5dd00f0 in qt_call_pre_routines () at 
../../include/QtCore/../../src/corelib/tools/qlist.h:540/
/#10 0xf5dd00f0 in QCoreApplicationPrivate::init() 
(this=this@entry=0x7cb3f0) at kernel/qcoreapplication.cpp:865/
/#11 0xf618b7e8 in QGuiApplicationPrivate::init() 
(this=this@entry=0x7cb3f0) at kernel/qguiapplication.cpp:1419/
/#12 0xf675d354 in QApplicationPrivate::init() (t