Bug 432574 - kwin_wayland master (drm backend) on qxl tries to fall back to XRender, and then segfaults in KWin::SceneOpenGL::createScene() on startup
Summary: kwin_wayland master (drm backend) on qxl tries to fall back to XRender, and t...
Status: RESOLVED DUPLICATE of bug 432570
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-06 15:05 UTC by bluescreenavenger
Modified: 2021-04-28 22:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bluescreenavenger 2021-02-06 15:05:40 UTC
SUMMARY


Hi
It seems that kwin_wayland on qxl is now trying to fall back to XRender again
Where instead, it should probably try to fall back to QPainter

Here is some of the scrollback I get:

failed to load driver: qxl
Driver:                 Unknown
Driver Version:         0.0
GPU class:              Unknown
OpenGL version:         0.0
Linux Kernel Version:   5.10
Rquires strict binding: yes
GLSL shaders:           yes
texture npot support:   no
kwin_scene_opengl: GL_ARB_texture_non_power_of two and GL_ARB_texture_rectangle are missing
kwin_sc ene_opengl: OpenGL driver recommends Xrender based compositing. Falling back to Xrender
 


forcing KWIN_COMPOSE=Q is a workaround that works

I am not sure when this started, but I think it was working probably in December, but I don't test everyday

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 5.10.0
(available in About System)
KDE Plasma Version: Master
KDE Frameworks Version: Master
Qt Version: 5.15

ADDITIONAL INFORMATION
Comment 1 bluescreenavenger 2021-02-07 04:35:07 UTC
It seems to not do this with the nested x11 backend oddly, but it does seem to do this under the nested wayland backend, but the Wayland backend does NOT print the line about falling back to Xrender.
 
Here it is easier to get a stack trace, and in seems to crash in KWin::SceneOpenGL::createScene, but it's hard to copy all this out of my VM, which booted off a live image, and I'd have to rebuild it with kwin symbols...
Comment 2 Nate Graham 2021-02-08 19:36:13 UTC
Yeah I'm afraid we will need the full backtrace. Thanks!
Comment 3 bluescreenavenger 2021-02-09 00:12:59 UTC
OK, managed to catch it with
    while [ 1 ]; do sudo gdb -p $(pidof kwin_wayland); done
from a second seat on one of my other scripted QEMU VMs that has 2 seats


#0  0x00000021 in ?? ()
No symbol table info available.
#1  0xaf96b59e in KWin::SceneOpenGL::createScene (parent=0x1f85440)
    at /srcbuild/kwin/plugins/scenes/opengl/scene_opengl.cpp:472
        backend = <optimized out>
        scene = <optimized out>
        __PRETTY_FUNCTION__ = "static KWin::SceneOpenGL* KWin::SceneOpenGL::createScene(QObject*)"
#2  0xaf96b6d5 in KWin::OpenGLFactory::create (this=0x1f83c90, parent=0x1f85440)
    at /srcbuild/kwin/plugins/scenes/opengl/scene_opengl.cpp:2759
        __PRETTY_FUNCTION__ = "virtual KWin::Scene* KWin::OpenGLFactory::create(QObject*) const"
        s = <optimized out>
#3  0xb734740f in KWin::Compositor::setupStart (this=<optimized out>) at /srcbuild/kwin/composite.cpp:238
        factory = {_M_t = {<std::__uniq_ptr_impl<KWin::SceneFactory, std::default_delete<KWin::SceneFactory> >> = {
              _M_t = {<std::_Tuple_impl<0, KWin::SceneFactory*, std::default_delete<KWin::SceneFactory> >> = {<std::_Tuple_impl<1, std::default_delete<KWin::SceneFactory> >> = {<std::_Head_base<1, std::default_delete<KWin::SceneFactory>, true>> = {<std::default_delete<KWin::SceneFactory>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0, KWin::SceneFactory*, false>> = {_M_head_impl = 0x1f83c90}, <No data fields>}, <No data fields>}}, <No data fields>}}
        pluginIt = 0x1f85c20
        type = <optimized out>
        __for_range = @0xbfc42044: {d = 0x1eae000}
        __for_begin = <optimized out>
        __for_end = <optimized out>
        supportedCompositors = {d = 0x1eae000}
        userConfigIt = <optimized out>
        availablePlugins = {d = 0x1f85c10}
        compositingType = <optimized out>
        __PRETTY_FUNCTION__ = {<optimized out> <repeats 36 times>}
#4  0xb7347eb4 in KWin::WaylandCompositor::start (this=0x1f85440) at /srcbuild/kwin/composite.cpp:722
No locals.
#5  0xb76e5dc1 in ?? () from target:/opt/lib/i386-linux-gnu/libQt5Core.so.5
No symbol table info available.
#6  0xb76ddca6 in QMetaCallEvent::placeMetaCall(QObject*) () from target:/opt/lib/i386-linux-gnu/libQt5Core.so.5
No symbol table info available.
#7  0xb76e0336 in QObject::event(QEvent*) () from target:/opt/lib/i386-linux-gnu/libQt5Core.so.5
No symbol table info available.
#8  0xb69bcd6c in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
--Type <RET> for more, q to quit, c to continue without paging--c
  .so.5
No symbol table info available.
#9  0xb69c2d9f in QApplication::notify(QObject*, QEvent*) () from target:/opt/lib/i386-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#10 0xb76c6cdd in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from target:/opt/lib/i386-linux-gnu/libQt5Core.so.5                                                                                                                           
No symbol table info available.
#11 0xb76c6d88 in QCoreApplication::sendEvent(QObject*, QEvent*) () from target:/opt/lib/i386-linux-gnu/libQt5Core.so.5
No symbol table info available.
#12 0xb76c6fbf in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from target:/opt/lib/i386-linux-gnu/libQt5Core.so.5                                                                                                         
No symbol table info available.
#13 0xb76fc198 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from target:/opt/lib/i386-linux-gnu/libQt5Core.so.5                                                                                                     
No symbol table info available.
#14 0x0047b1f6 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
No symbol table info available.
#15 0xb76c41c4 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from target:/opt/lib/i386-linux-gnu/libQt5Core.so.5                                                                                                                        
No symbol table info available.
#16 0xb76c8e9e in QCoreApplication::exec() () from target:/opt/lib/i386-linux-gnu/libQt5Core.so.5
No symbol table info available.
#17 0xb7a1165e in QGuiApplication::exec() () from target:/opt/lib/i386-linux-gnu/libQt5Gui.so.5
No symbol table info available.
#18 0xb69bb833 in QApplication::exec() () from target:/opt/lib/i386-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#19 0x0043f432 in main (argc=<optimized out>, argv=<optimized out>) at /srcbuild/kwin/main_wayland.cpp:800
        userSignals = {__val = {2560, 0 <repeats 31 times>}}
        environment = {d = {d = 0x1e80e70}}
        a = {<KWin::ApplicationWaylandAbstract> = {<KWin::Application> = {<QApplication> = {<No data fields>}, static staticMetaObject = {d = {superdata = {direct = 0xb6d96374 <QApplication::staticMetaObject>}, stringdata = 0xb7474500 <qt_meta_stringdata_KWin__Application>, data = 0xb74743a0 <qt_meta_data_KWin__Application>, static_metacall = 0xb731ed5c <KWin::Application::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, static crashes = 0, m_eventFilter = {d = 0x1ebd7c0}, m_configLock = false, m_config = {d = 0x1ebd850}, m_kxkbConfig = {d = 0x1ed9770}, m_operationMode = KWin::Application::OperationModeXwayland, m_x11Time = 0, m_rootWindow = 0, m_connection = 0x0, m_defaultScreen = 0x0, m_useKActivities = false, m_platform = 0x1ed4f40, m_terminating = false, m_isClosingX11Connection = false}, static staticMetaObject = {d = {superdata = {direct = 0xb751c154 <KWin::Application::staticMetaObject>}, stringdata = 0xb7474360 <qt_meta_stringdata_KWin__ApplicationWaylandAbstract>, data = 0xb7474320 <qt_meta_data_KWin__ApplicationWaylandAbstract>, static_metacall = 0xb731c9ac <KWin::ApplicationWaylandAbstract::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = {direct = 0xb751c13c <KWin::ApplicationWaylandAbstract::staticMetaObject>}, stringdata = 0x47d2c0 <qt_meta_stringdata_KWin__ApplicationWayland>, data = 0x47d280 <qt_meta_data_KWin__ApplicationWayland>, static_metacall = 0x43f93a <KWin::ApplicationWayland::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, m_startXWayland = true, m_applicationsToStart = {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, static is_always_lock_free = true}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0xb7757b30 <QListData::shared_null>}, d = 0xb7757b30 <QListData::shared_null>}}, <No data fields>}, m_inputMethodServerToStart = {static null = {<No data fields>}, d = 0xb7757000 <QArrayData::shared_null>}, m_environment = {d = {d = 0x1e80e70}}, m_sessionArgument = {static null = {<No data fields>}, d = 0x1ead060}, m_inputMethodProcess = 0x0, m_inputMethodCrashTimer = <incomplete type>, m_inputMethodCrashes = 0, m_xwayland = 0x0, m_settingsWatcher = {value = 0x0, d = 0x0}}
        availablePlugins = {d = 0x1eb2490}
        hasPlugin = {__availablePlugins = @0xbfc425c8}
        hasSizeOption = <optimized out>
        hasOutputCountOption = <optimized out>
        hasX11Option = <optimized out>
        hasVirtualOption = <optimized out>
        hasWaylandOption = <optimized out>
        hasFramebufferOption = <optimized out>
        hasDrmOption = <optimized out>
        xwaylandOption = {d = {d = 0x1eadc30}}
        waylandSocketOption = {d = {d = 0x1eaee00}}
        framebufferOption = {d = {d = 0x1eadfe0}}
        framebufferDeviceOption = {d = {d = 0x1eabfb0}}
        x11DisplayOption = {d = {d = 0x1eac130}}
        waylandDisplayOption = {d = {d = 0x1eadca0}}
        virtualFbOption = {d = {d = 0x1eaef60}}
        widthOption = {d = {d = 0x1eaea70}}
        heightOption = {d = {d = 0x1eabda0}}
        scaleOption = {d = {d = 0x1eac270}}
        outputCountOption = {d = {d = 0x1eb0910}}
        waylandSocketFdOption = {d = {d = 0x1eb3a20}}
        replaceOption = {d = {d = 0x1e89760}}
        parser = {d = 0x1eacc60}
        libinputOption = {d = {d = 0x1eae6b0}}
        drmOption = {d = {d = 0x1eae720}}
        inputMethodOption = {d = {d = 0x1eae790}}
        listBackendsOption = {d = {d = 0x1eae830}}
        screenLockerOption = {d = {d = 0x1eae900}}
        noScreenLockerOption = {d = {d = 0x1eae970}}
        noGlobalShortcutsOption = {d = {d = 0x1eaf160}}
        exitWithSessionOption = {d = {d = 0x1eaf230}}
        pluginName = {static null = {<No data fields>}, d = 0x47ea20 <KWin::s_drmPlugin::{lambda()#1}::operator()() const::qstring_literal>}
        initialWindowSize = {wd = <optimized out>, ht = <optimized out>}
        deviceIdentifier = {d = 0xb7757000 <QArrayData::shared_null>}
        outputCount = <optimized out>
        outputScale = <optimized out>
        pluginIt = <optimized out>
        server = <optimized out>
        flags = {i = <optimized out>}
Comment 4 Nate Graham 2021-02-09 17:27:51 UTC
Thank you very much!
Comment 5 Nate Graham 2021-02-09 17:46:01 UTC

*** This bug has been marked as a duplicate of bug 432570 ***
Comment 6 bluescreenavenger 2021-02-10 02:59:01 UTC
commenting out
https://invent.kde.org/plasma/kwin/-/blob/master/plugins/scenes/opengl/scene_opengl.cpp#L472
seems to workaround it.
Kwin doesn't instantly crash with that commented out

but doing 
if (backend)
{
    delete backend;
}
it still seems to crash
Comment 7 bluescreenavenger 2021-04-11 15:53:34 UTC
This still seems to happen
Comment 8 bluescreenavenger 2021-04-11 15:56:24 UTC
This still seems to happen even with kwin master. It crashes on QEMU right on startup. It's pretty easy to replicate on virtual hardware
Comment 9 bluescreenavenger 2021-04-20 12:50:35 UTC
I don't think this is a duplicate of https://bugs.kde.org/show_bug.cgi?id=432570 as 432570 is random.
On Virtual hardware, namely the 'qxl' device on QEMU the crash is near instantaneous, not intermittent.  
Unless I export LIBGL_ALWAYS_SOFTWARE
Comment 10 bluescreenavenger 2021-04-24 22:09:13 UTC
Dang, wait a minute, this might have something to do with my underlying build of Mesa, taking that out of the equasion, and I don't get the insta-crash
Comment 11 bluescreenavenger 2021-04-28 22:05:58 UTC

*** This bug has been marked as a duplicate of bug 432570 ***
Comment 12 bluescreenavenger 2021-04-28 22:06:41 UTC
Rebuilding everything, and now it doesn't happen again