Bug 418066 - Disconnecting display in Wayland leads to crash in libepoxy
Summary: Disconnecting display in Wayland leads to crash in libepoxy
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: git master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-23 02:13 UTC by Daniel Albers
Modified: 2020-03-26 08:51 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 Daniel Albers 2020-02-23 02:13:05 UTC
SUMMARY
KWin (Wayland) crashes when switching of a display.

STEPS TO REPRODUCE
1. Dell XPS 9370 with external display connected via USB-C/DisplayPort
2. kscreen-doctor output.1.disable


OBSERVED RESULT
Crash
"Couldn't find current GLX or EGL context."

Core was generated by `/usr/bin/kwin_wayland --xwayland --libinput --exit-with-session=/usr/lib/startp'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f15e9e50ce5 in raise () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7f15e37b4840 (LWP 1469))]
(gdb) bt ful
#0  0x00007f15e9e50ce5 in raise () at /usr/lib/libc.so.6
#1  0x00007f15e9e3a92c in abort () at /usr/lib/libc.so.6
#2  0x00007f15e9e3a727 in _nl_load_domain.cold () at /usr/lib/libc.so.6
#3  0x00007f15e9e49426 in  () at /usr/lib/libc.so.6
#4  0x00007f15e92c00d8 in epoxy_get_proc_address (name=0x7f15e92d04d9 <entrypoint_strings+9849> "glDeleteProgram")
at ../src/dispatch_common.c:863
__PRETTY_FUNCTION__ = "epoxy_get_proc_address"
egl_api = <optimized out>
__PRETTY_FUNCTION__ = "epoxy_get_proc_address"
#5  epoxy_get_proc_address (name=0x7f15e92d04d9 <entrypoint_strings+9849> "glDeleteProgram")
at ../src/dispatch_common.c:839
egl_api = <optimized out>
__PRETTY_FUNCTION__ = "epoxy_get_proc_address"
#6  0x00007f15e929672a in epoxy_glDeleteProgram_resolver () at src/gl_generated_dispatch.c:81668
providers = {PROVIDER_Desktop_OpenGL_2_0, PROVIDER_OpenGL_ES_2_0, gl_provider_terminator}
entrypoints = {9849, 9849}
#7  epoxy_glDeleteProgram_global_rewrite_ptr (program=19) at src/gl_generated_dispatch.c:49458
#8  0x00007f15e9dc96d6 in KWin::ContrastShader::reset() (this=0x7f15b0008850)
at /usr/src/debug/kwin/effects/backgroundcontrast/contrastshader.cpp:53
#9  KWin::ContrastShader::~ContrastShader() (this=0x7f15b0008850, __in_chrg=<optimized out>)
at /usr/src/debug/kwin/effects/backgroundcontrast/contrastshader.cpp:43
#10 KWin::ContrastShader::~ContrastShader() (this=0x7f15b0008850, __in_chrg=<optimized out>)
at /usr/src/debug/kwin/effects/backgroundcontrast/contrastshader.cpp:44
#11 0x00007f15e9dc5161 in KWin::ContrastEffect::~ContrastEffect() (this=0x7f15c000f810, __in_chrg=<optimized out>)
at /usr/src/debug/kwin/effects/backgroundcontrast/contrast.cpp:77
#12 0x00007f15e9dc5209 in KWin::ContrastEffect::~ContrastEffect() (this=0x7f15c000f810, __in_chrg=<optimized out>)
at /usr/src/debug/kwin/effects/backgroundcontrast/contrast.cpp:75
#13 0x00007f15eb3ae10b in KWin::EffectsHandlerImpl::destroyEffect(KWin::Effect*)
(this=this@entry=0x55fc6447c040, effect=0x7f15c000f810) at /usr/src/debug/kwin/effects.cpp:1464
properties = 
{<QListSpecialMethods<QByteArray>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x55fc644a1f20}, d = 0x55fc644a1f20}}
#14 0x00007f15eb3af8e7 in KWin::EffectsHandlerImpl::unloadEffect(QString const&)
(this=this@entry=0x55fc6447c040, name=...) at /usr/src/debug/kwin/effects.cpp:1438
it = {i = 0x55fc6475a350}
#15 0x00007f15eb3afdf0 in KWin::EffectsHandlerImpl::reloadEffect(KWin::Effect*)
(this=0x55fc6447c040, effect=<optimized out>) at /usr/src/debug/kwin/effects.cpp:1522
effectName = 
{static null = {<No data fields>}, d = 0x7f15e9de4480 <KWin::BuiltInEffects::effectData()::{lambda()#5}::operator()() const::qstring_literal>}
#16 0x00007f15e9dc792d in KWin::ContrastEffect::slotScreenGeometryChanged() (this=0x7f15c000f810)
at /usr/src/debug/kwin/effects/backgroundcontrast/contrast.cpp:84
#17 0x00007f15ea4c946e in  () at /usr/lib/libQt5Core.so.5
#18 0x00007f15eb2273a6 in KWin::EffectsHandler::screenGeometryChanged(QSize const&) (this=<optimized out>, _t1=...)
at /usr/src/debug/build/libkwineffects/kwineffects_autogen/EWIEGA46WW/moc_kwineffects.cpp:1738
_a = {0x0, 0x7fff54c724b0}
#19 0x00007f15eb3a56a0 in KWin::EffectsHandlerImpl::desktopResized(QSize const&) (this=<optimized out>, size=...)
at /usr/src/debug/kwin/effects.cpp:836
#20 0x00007f15eb4b6dfe in KWin::Workspace::desktopResized() (this=0x55fc63bef480)
at /usr/include/qt/QtCore/qsize.h:125
geom = {x1 = 0, y1 = 0, x2 = 1919, y2 = 1199}
#21 0x00007f15ea4c94a0 in  () at /usr/lib/libQt5Core.so.5
#22 0x00007f15ea4c946e in  () at /usr/lib/libQt5Core.so.5
#23 0x00007f15eb5f9d3b in KWin::DrmBackend::enableOutput(KWin::DrmOutput*, bool)
(this=0x55fc63b69140, output=<optimized out>, output@entry=0x55fc63be1cf0, enable=enable@entry=false)
at /usr/src/debug/kwin/plugins/platforms/drm/drm_backend.cpp:572
#24 0x00007f15eb60775a in KWin::DrmOutput::atomicDisable() (this=0x55fc63be1cf0)
at /usr/src/debug/kwin/plugins/platforms/drm/drm_output.cpp:532
#25 0x00007f15eb411169 in KWin::Platform::requestOutputsChange(KWayland::Server::OutputConfigurationInterface*)
(this=0x55fc63b69140, config=0x55fc644faea0) at /usr/src/debug/kwin/platform.cpp:174
output = 0x55fc63be1cf0
changeset = <optimized out>
it = {i = 0x55fc645369f0}
changes = {{d = 0x55fc6456d3d0, e = 0x55fc6456d3d0}}
#26 0x00007f15ea4c946e in  () at /usr/lib/libQt5Core.so.5
#27 0x00007f15eaffb9f0 in KWayland::Server::OutputManagementInterface::configurationChangeRequested(KWayland::Server::OutputConfigurationInterface*) () at /usr/lib/libKF5WaylandServer.so.5
#28 0x00007f15e669069a in ffi_call_unix64 () at /usr/lib/libffi.so.6
#29 0x00007f15e668ffb6 in ffi_call () at /usr/lib/libffi.so.6
#30 0x00007f15e7c04f62 in  () at /usr/lib/libwayland-server.so.0
#31 0x00007f15e7c012dc in  () at /usr/lib/libwayland-server.so.0
#32 0x00007f15e7c02faa in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#33 0x00007f15eb00f360 in KWayland::Server::Display::Private::dispatch() () at /usr/lib/libKF5WaylandServer.so.5
#34 0x00007f15ea4c946e in  () at /usr/lib/libQt5Core.so.5
#35 0x00007f15ea4cccb2 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) ()
--Type <RET> for more, q to quit, c to continue without paging--
at /usr/lib/libQt5Core.so.5
#36 0x00007f15ea4cd002 in QSocketNotifier::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#37 0x00007f15ea882362 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#38 0x00007f15ea88b819 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#39 0x00007f15ea493962 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#40 0x00007f15ea4e9294 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () at /usr/lib/libQt5Core.so.5
#41 0x00007f15ea4e9705 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /usr/lib/libQt5Core.so.5
#42 0x00007f15e379a16e in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /usr/lib/qt/plugins/platforms/KWinQpaPlugin.so
#43 0x00007f15ea4924cc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#44 0x00007f15ea49a4d6 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#45 0x000055fc636b5f54 in main(int, char**) (argc=<optimized out>, argv=<optimized out>)
at /usr/src/debug/kwin/main_wayland.cpp:676
userSignals = {__val = {2560, 0 <repeats 15 times>}}
environment = {d = {d = 0x55fc63b1cff0}}
a =
{<KWin::ApplicationWaylandAbstract> = {<KWin::Application> = {<QApplication> = {<No data fields>}, static staticMetaObject = {d = {superdata = {direct = 0x7f15ead96f40 <QApplication::staticMetaObject>}, stringdata = 0x7f15eb530620 <qt_meta_stringdata_KWin__Application>, data = 0x7f15eb5304e0 <qt_meta_data_KWin__Application>, static_metacall = 0x7f15eb323bc0 <KWin::Application::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, m_originalSessionKey = {static null = {<No data fields>}, d = 0x7f15ea57b840 <QArrayData::shared_null>}, static crashes = 0, m_eventFilter = {d = 0x55fc63b4b990}, m_configLock = false, m_config = {d= 0x7f15dc0016e0}, m_kxkbConfig = {d = 0x55fc63b6a700}, m_inputConfig = {d = 0x55fc63b6b9f0}, m_operationMode = KWin::Application::OperationModeXwayland, m_x11Time = 45540, m_rootWindow = 927, m_connection = 0x55fc643de800, m_useKActivities = false, m_platform = 0x55fc63b69140, m_terminating = false}, static staticMetaObject = {d = {superdata = {direct = 0x7f15eb5cb9a0 <KWin::Application::staticMetaObject>}, stringdata = 0x7f15eb5304a0 <qt_meta_stringdata_KWin__ApplicationWaylandAbstract>, data = 0x7f15eb530460 <qt_meta_data_KWin__ApplicationWaylandAbstract>, static_metacall = 0x7f15eb318af0 <KWin::ApplicationWaylandAbstract::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = {direct = 0x7f15eb5cb960<KWin::ApplicationWaylandAbstract::staticMetaObject>}, stringdata = 0x55fc636d33e0 <qt_meta_stringdata_KWin__ApplicationWayland>, data = 0x55fc636d33a0 <qt_meta_data_KWin__ApplicationWayland>, static_metacall = 0x55fc636b64a0 <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}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7f15ea57c310 <QListData::shared_null>}, d = 0x7f15ea57c310 <QListData::shared_null>}}, <No data fields>}, m_inputMethodServerToStart = {static null = {<No data fields>}, d = 0x7f15ea57b840 <QArrayData::shared_null>}, m_environment = {d = {d = 0x55fc643e62e0}}, m_sessionArgument = {static null = {<No data fields>}, d = 0x55fc63b61fc0}, m_xwayland = 0x55fc643d5340}
availablePlugins = {d = 0x55fc63b5c090}
hasPlugin = {__availablePlugins = @0x7fff54c73518}
hasSizeOption = <optimized out>
hasOutputCountOption = <optimized out>
hasX11Option = <optimized out>
hasVirtualOption = <optimized out>
hasWaylandOption = true
hasFramebufferOption = true
hasDrmOption = <optimized out>
xwaylandOption = {d = {d = 0x55fc63b3df80}}
waylandSocketOption = {d = {d = 0x55fc63b1e350}}
framebufferOption = {d = {d = 0x55fc63b62470}}
framebufferDeviceOption = {d = {d = 0x55fc63b62110}}
x11DisplayOption = {d = {d = 0x55fc63b626e0}}
waylandDisplayOption = {d = {d = 0x55fc63b629c0}}
virtualFbOption = {d = {d = 0x55fc63b622e0}}
widthOption = {d = {d = 0x55fc63b52f00}}
heightOption = {d = {d = 0x55fc63b52960}}
scaleOption = {d = {d = 0x55fc63b529a0}}
outputCountOption = {d = {d = 0x55fc63b52c80}}
parser = {d = 0x55fc63b52f80}
libinputOption = {d = {d = 0x55fc63b62a40}}
drmOption = {d = {d = 0x55fc63b5be00}}
inputMethodOption = {d = {d = 0x55fc63b5aed0}}
listBackendsOption = {d = {d = 0x55fc63b5af10}}
screenLockerOption = {d = {d = 0x55fc63b5af50}}
noScreenLockerOption = {d = {d = 0x55fc63b5af90}}
noGlobalShortcutsOption = {d = {d = 0x55fc63b5b030}}
exitWithSessionOption = {d = {d = 0x55fc63b5b070}}
pluginName =
{static null = {<No data fields>}, d = 0x55fc636d4460 <KWin::{lambda()#4}::operator()() const::qstring_literal>}
initialWindowSize = {wd = 1024, ht = 768}
deviceIdentifier = {d = 0x7f15ea57b840 <QArrayData::shared_null>}
outputCount = 1
outputScale = 1
--Type <RET> for more, q to quit, c to continue without paging--
pluginIt = <optimized out>
server = 0x55fc63b4c0d0
flags = <optimized out>

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 

Operating System: Arch Linux 
KDE Plasma Version: 5.18.1-81-gf175460e0
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.1
Kernel Version: 5.5.5-arch1-1
libepoxy: 1.5.4.r11.gdcb0f31

ADDITIONAL INFORMATION
Comment 1 Daniel Albers 2020-02-23 13:50:21 UTC
Full error message:
kwin_wayland: ../src/dispatch_common.c:863: epoxy_get_proc_address: Assertion `0 && "Couldn't find current GLX or EGL context.\n"' failed.
Comment 2 Vlad Zahorodnii 2020-03-25 13:10:50 UTC
Hmm, very interesting... I'm pretty sure that we make current opengl context before reloading the background contrast effect. Can you run `qdbus org.kde.KWin /KWin supportInformation` and post the output here?
Comment 3 Daniel Albers 2020-03-25 13:18:24 UTC
Not sure after which update this stopped, but the crash doesn't seem to happen anymore on current git. I think we can close this bug.

Display hot plugging still doesn't work, though: https://bugs.kde.org/show_bug.cgi?id=419061
Comment 4 Christoph Feck 2020-03-25 13:46:03 UTC
Thanks for the update; changing status.
Comment 5 Méven Car 2020-03-25 14:35:01 UTC
This was perhaps a duplicate of https://bugs.kde.org/show_bug.cgi?id=413892
Comment 6 Vlad Zahorodnii 2020-03-26 08:51:44 UTC
No, they look unrelated.