<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">WebGL streaming only works for QtQuick widgets (<a href="https://www.qt.io/blog/2018/11/23/qt-quick-webgl-release-512">https://www.qt.io/blog/2018/11/23/qt-quick-webgl-release-512</a>).</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 16, 2024 at 2:26 AM Valentin Valls <<a href="mailto:valentin.valls@esrf.fr">valentin.valls@esrf.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p>Hi,</p>
<p>I try to take a look at PyQt with webgl platform plugin.</p>
<p>I have tested multiple version of PyQt but i always get the same segmentation fault.</p>
<p>My operating system is a Debian 10, and i have tried with python 3.9 and 3.10 (from conda).</p>
<p>Any idea if that could be a problem with PyQt or with my machine or env?</p>
<p><br></p>
<p>Here is my app.py</p>
<div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap">
<div><span style="font-family:terminal,monaco,monospace"><span style="color:rgb(197,134,192)">import</span><span style="color:rgb(212,212,212)"> sys</span></span></div>
<div><span style="font-family:terminal,monaco,monospace"><span style="color:rgb(197,134,192)">from</span><span style="color:rgb(212,212,212)"> PyQt5 </span><span style="color:rgb(197,134,192)">import</span><span style="color:rgb(212,212,212)"> Qt</span></span></div>
<span style="color:rgb(212,212,212);font-family:terminal,monaco,monospace">app = Qt.QApplication(sys.argv)</span>
<div><span style="color:rgb(212,212,212);font-family:terminal,monaco,monospace">w = Qt.QMainWindow()</span></div>
<div><span style="color:rgb(212,212,212);font-family:terminal,monaco,monospace">w.show()</span></div>
<div><span style="color:rgb(212,212,212);font-family:terminal,monaco,monospace">app.exec()</span></div>
</div>
<p>Here is the last PyQt version i have tested</p>
<div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap">
<p><span style="font-family:terminal,monaco,monospace">$ pip install pyqt5</span><br><br><span style="font-family:terminal,monaco,monospace">  Downloading PyQt5-5.15.10-cp37-abi3-manylinux_2_17_x86_64.whl.metadata (2.1 kB)</span><br><span style="font-family:terminal,monaco,monospace">  Downloading PyQt5_sip-12.13.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.metadata (504 bytes)</span><br><span style="font-family:terminal,monaco,monospace">  Downloading PyQt5_Qt5-5.15.2-py3-none-manylinux2014_x86_64.whl (59.9 MB)</span></p>
</div>
<p>Here is the execution</p>
<div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap">
<p><span style="font-family:terminal,monaco,monospace">$ export QSG_INFO=1</span><br><span style="font-family:terminal,monaco,monospace">$ export QT_QPA_EGLFS_DEBUG=1</span><br><span style="font-family:terminal,monaco,monospace">$ export QT_LOGGING_RULES=qt.qpa.*=true</span><br><span style="font-family:terminal,monaco,monospace">$ python app.py -platform webgl:port=8081</span><br><br><span style="font-family:terminal,monaco,monospace">Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.webgl: WebGL QPA Plugin created</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.input.methods.serialize: QIBusEngineDesc::fromDBusArgument() "(sa{sv}ssssssssussssssss)"</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.input.methods: socketWatcher.addPath "/home/valentin/.config/ibus/bus/ac70eafeeafc44c6af5896660704e451-unix-wayland-0"</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.webgl.httpserver: Listening in port 8081</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.webgl: Creating platform window for: 0x55d890722db0</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.webgl: WebGL QPA platform plugin: Raster surfaces are not supported</span><br><span style="font-family:terminal,monaco,monospace">Erreur de segmentation</span></p>
</div>
<p>And here is the backtrace</p>
<div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap">
<p><span style="font-family:terminal,monaco,monospace">$ gdb --args python app.py -platform webgl:port=8081</span><br><br><span style="font-family:terminal,monaco,monospace">GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git</span><br><span style="font-family:terminal,monaco,monospace">Copyright (C) 2021 Free Software Foundation, Inc.</span><br><span style="font-family:terminal,monaco,monospace">License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html" target="_blank">http://gnu.org/licenses/gpl.html</a>></span><br><span style="font-family:terminal,monaco,monospace">This is free software: you are free to change and redistribute it.</span><br><span style="font-family:terminal,monaco,monospace">There is NO WARRANTY, to the extent permitted by law.</span><br><span style="font-family:terminal,monaco,monospace">Type "show copying" and "show warranty" for details.</span><br><span style="font-family:terminal,monaco,monospace">This GDB was configured as "x86_64-linux-gnu".</span><br><span style="font-family:terminal,monaco,monospace">Type "show configuration" for configuration details.</span><br><span style="font-family:terminal,monaco,monospace">For bug reporting instructions, please see:</span><br><span style="font-family:terminal,monaco,monospace"><<a href="https://www.gnu.org/software/gdb/bugs/" target="_blank">https://www.gnu.org/software/gdb/bugs/</a>>.</span><br><span style="font-family:terminal,monaco,monospace">Find the GDB manual and other documentation resources online at:</span><br><span style="font-family:terminal,monaco,monospace">    <<a href="http://www.gnu.org/software/gdb/documentation/" target="_blank">http://www.gnu.org/software/gdb/documentation/</a>>.</span></p>
<p><span style="font-family:terminal,monaco,monospace">For help, type "help".</span><br><span style="font-family:terminal,monaco,monospace">Type "apropos word" to search for commands related to "word"...</span><br><span style="font-family:terminal,monaco,monospace">Reading symbols from python...</span><br><span style="font-family:terminal,monaco,monospace">(gdb) r</span><br><span style="font-family:terminal,monaco,monospace">Starting program: /home/valentin/Software/miniconda3/envs/qt/bin/python bbbb.py -platform webgl:port=8081</span><br><span style="font-family:terminal,monaco,monospace">[Thread debugging using libthread_db enabled]</span><br><span style="font-family:terminal,monaco,monospace">Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".</span><br><span style="font-family:terminal,monaco,monospace">Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.webgl: WebGL QPA Plugin created</span><br><span style="font-family:terminal,monaco,monospace">[New Thread 0x7fffea466700 (LWP 10315)]</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.input.methods.serialize: QIBusEngineDesc::fromDBusArgument() "(sa{sv}ssssssssussssssss)"</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.input.methods: socketWatcher.addPath "/home/valentin/.config/ibus/bus/ac70eafeeafc44c6af5896660704e451-unix-wayland-0"</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.webgl.httpserver: Listening in port 8081</span><br><span style="font-family:terminal,monaco,monospace">[New Thread 0x7fffe9c65700 (LWP 10317)]</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.webgl: Creating platform window for: 0x555555cefd80</span><br><span style="font-family:terminal,monaco,monospace">qt.qpa.webgl: WebGL QPA platform plugin: Raster surfaces are not supported</span></p>
<p><span style="font-family:terminal,monaco,monospace">Thread 1 "python" received signal SIGSEGV, Segmentation fault.</span><br><span style="font-family:terminal,monaco,monospace">0x00007ffff2e98ac0 in QPlatformBackingStore::setBackingStore(QBackingStore*) ()</span><br><span style="font-family:terminal,monaco,monospace">   from /home/valentin/Software/miniconda3/envs/qt/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5</span><br><span style="font-family:terminal,monaco,monospace">(gdb) bt</span><br><span style="font-family:terminal,monaco,monospace">#0  0x00007ffff2e98ac0 in QPlatformBackingStore::setBackingStore(QBackingStore*) ()</span><br><span style="font-family:terminal,monaco,monospace">   from /home/valentin/Software/miniconda3/envs/qt/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5</span><br><span style="font-family:terminal,monaco,monospace">#1  0x00007ffff2d5df6a in QBackingStore::handle() const ()</span><br><span style="font-family:terminal,monaco,monospace">   from /home/valentin/Software/miniconda3/envs/qt/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5</span><br><span style="font-family:terminal,monaco,monospace">#2  0x00007ffff1154cf8 in QWidgetPrivate::create() ()</span><br><span style="font-family:terminal,monaco,monospace">   from /home/valentin/Software/miniconda3/envs/qt/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Widgets.so.5</span><br><span style="font-family:terminal,monaco,monospace">#3  0x00007ffff1154e96 in QWidget::create(unsigned long long, bool, bool) ()</span><br><span style="font-family:terminal,monaco,monospace">   from /home/valentin/Software/miniconda3/envs/qt/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Widgets.so.5</span><br><span style="font-family:terminal,monaco,monospace">#4  0x00007ffff1160164 in QWidgetPrivate::setVisible(bool) ()</span><br><span style="font-family:terminal,monaco,monospace">   from /home/valentin/Software/miniconda3/envs/qt/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Widgets.so.5</span><br><span style="font-family:terminal,monaco,monospace">#5  0x00007ffff075e543 in sipQMainWindow::setVisible(bool) ()</span><br><span style="font-family:terminal,monaco,monospace">   from /home/valentin/Software/miniconda3/envs/qt/lib/python3.10/site-packages/PyQt5/<a href="http://QtWidgets.abi3.so" target="_blank">QtWidgets.abi3.so</a></span><br><span style="font-family:terminal,monaco,monospace">#6  0x00007ffff06d9822 in meth_QWidget_show () from /home/valentin/Software/miniconda3/envs/qt/lib/python3.10/site-packages/PyQt5/<a href="http://QtWidgets.abi3.so" target="_blank">QtWidgets.abi3.so</a></span><br><span style="font-family:terminal,monaco,monospace">#7  0x0000555555698468 in cfunction_call (func=0x7fffefad1ad0, args=<optimized out>, kwargs=<optimized out>)</span><br><span style="font-family:terminal,monaco,monospace">    at /usr/local/src/conda/python-3.10.13/Objects/methodobject.c:552</span><br><span style="font-family:terminal,monaco,monospace">#8  0x000055555569197b in _PyObject_MakeTpCall (tstate=0x555555909030, callable=0x7fffefad1ad0, args=<optimized out>, nargs=0, keywords=0x0)</span><br><span style="font-family:terminal,monaco,monospace">    at /usr/local/src/conda/python-3.10.13/Objects/call.c:215</span><br><span style="font-family:terminal,monaco,monospace">#9  0x000055555568d8c6 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=<optimized out>, callable=0x7fffefad1ad0, </span><br><span style="font-family:terminal,monaco,monospace">    tstate=<optimized out>) at /usr/local/src/conda/python-3.10.13/Include/cpython/abstract.h:112</span><br><span style="font-family:terminal,monaco,monospace">#10 _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7ffff7895bb0, callable=0x7fffefad1ad0, tstate=<optimized out>)</span><br><span style="font-family:terminal,monaco,monospace">    at /usr/local/src/conda/python-3.10.13/Include/cpython/abstract.h:99</span><br><span style="font-family:terminal,monaco,monospace">#11 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7ffff7895bb0, callable=0x7fffefad1ad0)</span><br><span style="font-family:terminal,monaco,monospace">    at /usr/local/src/conda/python-3.10.13/Include/cpython/abstract.h:123</span><br><span style="font-family:terminal,monaco,monospace">#12 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, trace_info=0x7fffffffbf70, tstate=<optimized out>)</span><br><span style="font-family:terminal,monaco,monospace">    at /usr/local/src/conda/python-3.10.13/Python/ceval.c:5893</span></p>
<div id="m_5046639650292863732signature"></div>
</div>
<p>Hope it can help for something.</p>
<p>Regards,</p>
<p>Valentin</p>
</div>
</blockquote></div>