Graphics acceleration in PcbNew causes segfault on Wayland

Bug #1755360 reported by Dylan Mackenzie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Triaged
Undecided
Unassigned

Bug Description

Application: kicad
Version: (5.0.0-rc1), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.55.1 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.18.0 (+libidn2/2.0.3) libssh2/1.8.0 nghttp2/1.25.0
Platform: Linux 4.15.6-300.fc27.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
    Boost: 1.64.0
    Curl: 7.55.1
    Compiler: GCC 7.3.1 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

When attempting to enable graphics acceleration mode while on Wayland, PcbNew segfaults with the attached coredump.

The segfault is triggered when `XQueryExtension` invokes the `LockDisplay` macro, which attempts to dereference `Display->lock_fns`. However, the underlying issue is that wxGLCanvas doesn't support Wayland.

The issue is discussed in further detail https://trac.wxwidgets.org/ticket/17702.

Obviously, Wayland support in wxWidgets would be ideal, but in the meantime it might be a good idea to disable accelerated graphics mode when not running on X.

Tags: wayland
Revision history for this message
Dylan Mackenzie (ecstaticmorse) wrote :
description: updated
tags: added: wayland
Revision history for this message
Maciej Suminski (orsonmmz) wrote :

I have just tried out KiCad on Wayland. I confirm that the accelerated rendering backend does not work, as Wayland does not support GLX, but I do not see a crash either (weston 3.0.0-2 + wayland 1.14.0-1).

Revision history for this message
Dylan Mackenzie (ecstaticmorse) wrote :

I'm on mutter 3.26.2-2 + wayland 1.14.01 (the default setup on fedora), so perhaps the issue is the compositor? I don't know much about X/wayland, so I won't be very helpful in pinpointing the issue. X's Display struct isn't being properly initialized (lock_fns points to invalid memory), but I'm not sure who's responsibility that is. Let me know if I can do anything to elucidate the problem.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

I just tried mutter-3.26.2 and it behaves the same. I suspect wxWidgets makes the difference - I noticed it is built against GTK3, which has given us some headache already.

Jon Evans (craftyjon)
Changed in kicad:
milestone: none → 5.0.0-rc2
importance: Undecided → Critical
Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

Jon, why do you consider a bug in Wayland a critical bug in Kicad?

Tom

Revision history for this message
Jon Evans (craftyjon) wrote :

I just wanted to flag it as critical so we remember to resolve it somehow, since the user has reported a crash. Maybe the action is just to mention this in the release notes so that users know what to expect.

Revision history for this message
Jon Evans (craftyjon) wrote :

Proposing a docs change to address this:
https://github.com/KiCad/kicad-website/pull/276

Jon Evans (craftyjon)
Changed in kicad:
milestone: 5.0.0-rc2 → none
importance: Critical → Undecided
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.