Description: LibreOffice X11 (gen) VCL backend is a good platform for testing. Unfortunately, it crashes with Skia enabled. Steps to Reproduce: 1. Build LibreOffice core on Linux 2. Try Vulkan/Raster on X11: export SAL_USE_VCLPLUGIN=gen export SAL_SKIA=raster instdir/program/soffice Actual Results: Immediate crash happens Expected Results: No crash should happen Reproducible: Always User Profile Reset: No Additional Info: Test is done with the latest LO 26.2 dev master. $ instdir/program/soffice --version LibreOfficeDev 26.2.0.0.alpha0 f6411560817dd9e2c07564eef100dcb8f995804f This is the terminal output which also contains back trace: X-Error: BadMatch (invalid parameter attributes) Major opcode: 72 (X_PutImage) Resource ID: 0x4c00019 Serial No: 302 (302) These errors are reported asynchronously, set environment variable SAL_SYNCHRONIZE to 1 to help debugging Unspecified Application Error Fatal exception: Signal 6 Stack: #0 sal::backtrace_get(unsigned int) in instdir/program/libuno_sal.so.3 #1 (anonymous namespace)::printStack(int) at signal.cxx:? #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at signal.cxx:? #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at signal.cxx:? #4 __restore_rt at libc_sigaction.c:? #5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 #6 __GI_raise at ./signal/../sysdeps/posix/raise.c:27 #7 __GI_abort at ./stdlib/abort.c:81 (discriminator 21) #8 SalAbort(rtl::OUString const&, bool) at crtstuff.c:? #9 Application::Abort(rtl::OUString const&) in instdir/program/libvcllo.so #10 desktop::Desktop::Exception(ExceptionCategory) at crtstuff.c:? #11 VCLExceptionSignal_impl(void*, oslSignalInfo*) at svmain.cxx:? #12 callSignalHandler(oslSignalInfo*) at crtstuff.c:? #13 osl_raiseSignal in instdir/program/libuno_sal.so.3 #14 X11SalData::XError(_XDisplay*, XErrorEvent*) at crtstuff.c:? #15 XErrorHdl(_XDisplay*, XErrorEvent*) at saldata.cxx:? #16 _XError in /lib/x86_64-linux-gnu/libX11.so.6 #17 _XError in /lib/x86_64-linux-gnu/libX11.so.6 #18 _XError in /lib/x86_64-linux-gnu/libX11.so.6 #19 _XReply in /lib/x86_64-linux-gnu/libX11.so.6 #20 XTranslateCoordinates in /lib/x86_64-linux-gnu/libX11.so.6 #21 X11SalFrame::HandleSizeEvent(XConfigureEvent*) at crtstuff.c:? #22 X11SalFrame::Dispatch(_XEvent*) at crtstuff.c:? #23 SalX11Display::Dispatch(_XEvent*) at crtstuff.c:? #24 SalX11Display::Yield() at crtstuff.c:? #25 DisplayYield(int, void*) at saldisp.cxx:? #26 (anonymous namespace)::YieldEntry::HandleNextEvent() const at saldata.cxx:? #27 SalXLib::Yield(bool, bool) at crtstuff.c:? #28 X11SalInstance::DoYield(bool, bool) at crtstuff.c:? #29 ImplYield(bool, bool) at svapp.cxx:? #30 Application::Yield() in instdir/program/libvcllo.so #31 Application::Execute() in instdir/program/libvcllo.so #32 desktop::Desktop::Main() at crtstuff.c:? #33 ImplSVMain() in instdir/program/libvcllo.so #34 SVMain() in instdir/program/libvcllo.so #35 soffice_main in instdir/program/libsofficeapp.so #36 sal_main at main.c:? #37 main in instdir/program/soffice.bin #38 __libc_start_call_main at ./csu/../sysdeps/nptl/libc_start_call_main.h:58 #39 call_init at ./csu/../csu/libc-start.c:128 #40 _start in instdir/program/soffice.bin Crash does not happen with: Version: 25.8.0.4 (X86_64) Build ID: 48f00303701489684e67c38c28aff00cd5929e67 CPU threads: 12; OS: Linux 6.2; UI render: Skia/Raster; VCL: x11 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
The bug is in the Skia code – it hardcodes image depth to 24, but calls to XPutImage should use same depth as for drawable. Thus just using depth as reported by XGetWindowAttributes makes the issue go away. Please test this patch: https://gerrit.libreoffice.org/c/core/+/199648
Māris Nartišs committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eb1fabd39fb5fdceb90c11eaf7740f3396a79bfe tdf#168138 skia: fix XPutImage BadMatch on 32-bit X11 windows It will be available in 26.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks Māris, I verify that your fixes the problem, with the latest LO 26.8 dev master. As a test, reverting the patch brings back the issue.
Māris Nartišs committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/7d110626be0d4e71cd91659bb38a730da94d6132 tdf#168138 skia: fix XPutImage BadMatch on 32-bit X11 windows It will be available in 26.2.2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.