psi-plus / main

Main repository with patches and required resources
https://psi-plus.com/
GNU Lesser General Public License v2.1
68 stars 20 forks source link

Segfault in chat room #791

Closed ericjmcalvin closed 3 years ago

ericjmcalvin commented 3 years ago

OS: openSUSE 15.2 x86_64 psi+ version: psi+-1.4.1159+0-lp152.1.1.x86_64

Randomly when in a chat room, psi+ will segfault. I managed to get a core file and loaded it into GDB. Here is the gdb output:

Reading symbols from /usr/bin/psi-plus...
Reading symbols from /usr/lib/debug/usr/bin/psi-plus-1.4.1159+0-lp152.1.1.x86_64.debug...

warning: Ignoring non-absolute filename: <linux-vdso.so.1>
Missing separate debuginfo for linux-vdso.so.1
Try: zypper install -C "debuginfo(build-id)=369ab9bbbdb37dee39abc9cca581c46804b69344"
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `psi-plus'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f2d33d40594 in QSGOpaqueTextureMaterialShader::updateState (this=0x56087920d9d0, state=..., newEffect=<optimized out>, oldEffect=0x0)
    at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/scenegraph/util/qsgtexturematerial.cpp:115
115             t->bind();
[Current thread is 1 (Thread 0x7f2d41aef940 (LWP 1182))]
Missing separate debuginfos, use: zypper install cyrus-sasl-digestmd5-debuginfo-2.1.26-lp152.7.3.x86_64 glibc-debuginfo-2.26-lp152.26.3.1.x86_64 krb5-debuginfo-1.16.3-lp152.5.10.1.x86_64 libIlmImf-2_2-23-debuginfo-2.2.1-lp152.7.5.1.x86_64 libQt5Concurrent5-debuginfo-5.12.7-lp152.3.6.1.x86_64 libQt5Core5-debuginfo-5.12.7-lp152.3.6.1.x86_64 libQt5DBus5-debuginfo-5.12.7-lp152.3.6.1.x86_64 libQt5Gui5-debuginfo-5.12.7-lp152.3.6.1.x86_64 libQt5Network5-debuginfo-5.12.7-lp152.3.6.1.x86_64 libQt5PrintSupport5-debuginfo-5.12.7-lp152.3.6.1.x86_64 libQt5Sql5-debuginfo-5.12.7-lp152.3.6.1.x86_64 libQt5Sql5-sqlite-debuginfo-5.12.7-lp152.3.6.1.x86_64 libQt5Widgets5-debuginfo-5.12.7-lp152.3.6.1.x86_64 libQt5Xml5-debuginfo-5.12.7-lp152.3.6.1.x86_64 libX11-6-debuginfo-1.6.5-lp152.5.9.1.x86_64 libX11-xcb1-debuginfo-1.6.5-lp152.5.9.1.x86_64 libXau6-debuginfo-1.0.8-lp152.3.4.x86_64 libXdamage1-debuginfo-1.1.4-lp152.3.4.x86_64 libasound2-debuginfo-1.1.5-lp152.9.4.1.x86_64 libavformat57-debuginfo-3.4.4-pm152.5.3.x86_64 libavutil55-debuginfo-3.4.4-pm152.5.3.x86_64 libcom_err2-debuginfo-1.43.8-lp152.11.3.1.x86_64 libfreetype6-debuginfo-2.10.1-lp152.2.5.1.x86_64 libgcc_s1-debuginfo-10.2.1+git583-lp152.2.2.x86_64 libgnutls30-debuginfo-3.6.7-lp152.9.3.2.x86_64 libhunspell-1_6-0-debuginfo-1.6.2-lp152.4.3.1.x86_64 libjpeg8-debuginfo-8.1.2-lp152.8.3.1.x86_64 liblz4-1-debuginfo-1.8.0-lp152.4.3.x86_64 libminizip1-debuginfo-1.2.11-lp152.8.6.1.x86_64 libmp3lame0-debuginfo-3.100-lp152.3.6.x86_64 libopenssl1_1-debuginfo-1.1.1d-lp152.7.6.1.x86_64 libopus0-debuginfo-1.3.1-lp152.2.3.1.x86_64 libpkcs11-helper1-debuginfo-1.25.1-lp152.2.5.x86_64 libproxy1-debuginfo-0.4.15-lp152.5.3.1.x86_64 libre2-6-debuginfo-20200401-lp152.13.2.x86_64 libsqlite3-0-debuginfo-3.28.0-lp152.3.5.x86_64 libswresample2-debuginfo-3.4.4-pm152.5.3.x86_64 libsystemd0-debuginfo-234-lp152.31.7.1.x86_64 libtiff5-debuginfo-4.0.9-lp152.11.3.1.x86_64 libuuid1-debuginfo-2.33.1-lp152.5.3.1.x86_64 libva-x11-2-debuginfo-2.5.0-lp152.2.3.x86_64 libvdpau1-debuginfo-1.1.1-lp152.3.7.x86_64 libwebp7-debuginfo-1.0.3-lp152.1.3.x86_64 libx264-159-debuginfo-0.159+git20191127.1771b556-pm152.1.1.x86_64 libx265-192-debuginfo-3.4-pm152.1.1.x86_64 libxcb-glx0-debuginfo-1.13-lp152.5.3.1.x86_64 libxcb-render-util0-debuginfo-0.3.9-lp152.3.4.x86_64 libxcb-render0-debuginfo-1.13-lp152.5.3.1.x86_64 libxcb-shape0-debuginfo-1.13-lp152.5.3.1.x86_64 libxcb-sync1-debuginfo-1.13-lp152.5.3.1.x86_64 libxcb-xfixes0-debuginfo-1.13-lp152.5.3.1.x86_64 libxcb-xinerama0-debuginfo-1.13-lp152.5.3.1.x86_64 libxcb-xkb1-debuginfo-1.13-lp152.5.3.1.x86_64 libxcb1-debuginfo-1.13-lp152.5.3.1.x86_64 libxvidcore4-debuginfo-1.3.7-pm152.1.1.x86_64 libz1-debuginfo-1.2.11-lp152.8.6.1.x86_64 mozilla-nspr-debuginfo-4.25.1-lp152.2.3.1.x86_64 mozilla-nss-debuginfo-3.53.1-lp152.2.4.1.x86_64 sasl2-kdexoauth2-debuginfo-20.04.2-lp152.2.3.1.x86_64
(gdb) bt
#0  0x00007f2d33d40594 in QSGOpaqueTextureMaterialShader::updateState (this=0x56087920d9d0, state=..., newEffect=<optimized out>, oldEffect=0x0)
    at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/scenegraph/util/qsgtexturematerial.cpp:115
#1  0x00007f2d33d2fe5a in QSGBatchRenderer::Renderer::renderMergedBatch (this=0x56087870cce0, batch=0x7f2d0401e6a0)
    at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2306
#2  0x00007f2d33d31205 in QSGBatchRenderer::Renderer::renderBatches (this=this@entry=0x56087870cce0)
    at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2547
#3  0x00007f2d33d36816 in QSGBatchRenderer::Renderer::render (this=<optimized out>) at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2735
#4  0x00007f2d33d26ff0 in QSGRenderer::renderScene (this=0x56087870cce0, bindable=...) at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/scenegraph/coreapi/qsgrenderer.cpp:244
#5  0x00007f2d33d274c7 in QSGRenderer::renderScene (this=<optimized out>, fboId=<optimized out>)
    at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/scenegraph/coreapi/qsgrenderer.cpp:190
#6  0x00007f2d33d641b0 in QSGDefaultRenderContext::renderNextFrame (this=0x5608785e2dd0, renderer=0x56087870cce0, fboId=<optimized out>)
    at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/scenegraph/qsgdefaultrendercontext.cpp:182
#7  0x00007f2d33dc7ee8 in QQuickWindowPrivate::renderSceneGraph (this=this@entry=0x560875fa0fc0, size=...)
    at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/items/qquickwindow.cpp:487
#8  0x00007f2d33e8b9b8 in QQuickRenderControl::render (this=<optimized out>) at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quick/items/qquickrendercontrol.cpp:344
#9  0x00007f2d33725aae in QQuickWidgetPrivate::render (this=this@entry=0x56087857d860, needsSync=needsSync@entry=true)
    at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quickwidgets/qquickwidget.cpp:300
#10 0x00007f2d33725cf2 in QQuickWidgetPrivate::renderSceneGraph (this=0x56087857d860) at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quickwidgets/qquickwidget.cpp:351
#11 0x00007f2d36bd648b in QObject::event(QEvent*) () from /usr/lib64/libQt5Core.so.5
#12 0x00007f2d37b18f23 in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#13 0x00007f2d33729a1b in QQuickWidget::event (this=0x5608785e2bc0, e=0x7ffcefa0b2e0) at /usr/src/debug/libqt5-qtdeclarative-5.12.7-lp152.2.2.x86_64/src/quickwidgets/qquickwidget.cpp:1537
#14 0x00007f2d3fa16ba0 in QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget::event (this=0x5608785e2bc0, event=0x7ffcefa0b2e0) at render_widget_host_view_qt_delegate_widget.cpp:481
#15 0x00007f2d37ad8a0c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#16 0x00007f2d37ae0020 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#17 0x00007f2d36ba5e08 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#18 0x00007f2d36c02319 in QTimerInfoList::activateTimers() () from /usr/lib64/libQt5Core.so.5
#19 0x00007f2d36c02ae1 in ?? () from /usr/lib64/libQt5Core.so.5
#20 0x00007f2d2d2fb464 in g_main_dispatch (context=0x7f2d18004fa0) at ../glib/gmain.c:3216
#21 g_main_context_dispatch (context=context@entry=0x7f2d18004fa0) at ../glib/gmain.c:3881
#22 0x00007f2d2d2fb800 in g_main_context_iterate (context=context@entry=0x7f2d18004fa0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:3954
#23 0x00007f2d2d2fb88c in g_main_context_iteration (context=0x7f2d18004fa0, may_block=1) at ../glib/gmain.c:4015
#24 0x00007f2d36c02eaf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#25 0x00007f2d36ba405a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#26 0x00007f2d36bad260 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#27 0x0000560873b62a28 in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.cpp:583
(gdb) 
Ri0n commented 3 years ago

I'm pretty sure it's a Qt bug. I found a few similar reports on bugreports.qt.io. Most likely Qt doesn't handle some system errors correctly and eventually crash. For example in cases of some incompatibility with video driver.

So if you use non-intel video, try to switch to intel.

ericjmcalvin commented 3 years ago

I'm pretty sure it's a Qt bug. I found a few similar reports on bugreports.qt.io. Most likely Qt doesn't handle some system errors correctly and eventually crash. For example in cases of some incompatibility with video driver.

So if you use non-intel video, try to switch to intel.

Well, it is a bit more complicated than that. We are using vncviewer to connect to a virtual headless session (running Xvnc (TigerVNC)). The window manager in the VNC session is FVWM. The underlying hardware on the machine running Xvnc is Nvidia with G05 (435) drivers.

From there, we SSH to another machine (with X Forwarding enabled) to run psi+ (that remote machine also has nvidia drivers (G05/440).

Ri0n commented 3 years ago

Well I also had similar crashes with nvidia. all them were related to nvidia driver upgrade without consequent reboot. After the reboot everything worked properly. But I usually had a crash on start, so it was not something random.

If you are somehow able to reproduce it (like exact steps to make it crash) it would be super helpful. Currently from the stack trace above I see there is no explicit issue with Psi. But I remember Qt changed something in multithreading handling in webengine. If this is an issue, like Qt-5.12 still has some unsafe code, then Qt upgrade would help as well as using Psi version compiled without webengine.

tehnick commented 3 years ago

@ericjmcalvin Could you check if this crash reproducible in our AppImage builds of Psi+?

ericjmcalvin commented 3 years ago

@ericjmcalvin Could you check if this crash reproducible in our AppImage builds of Psi+?

Apologies for the delayed reply. I am unable to use AppImages in this particular environment (and I can't reproduce it successfully outside of it). However, other users did experience the issue (this time psi-plus would immediately core dump and the backtrace showed nvidia_glcore.so as the culprit. Also, running glxgears on the same system caused the same core dump backtrace. So this may be due to iGLX perhaps (as this is displayed over SSH + XForwarding). So, after upgrading to the latest Nvidia drivers (460) the issue so far seems to be resolved. I don't think we need to keep this issue opened as it is obviously either a QT library or Nvidia library bug and not psi-plus. Thank you for your help!