Bug 420435 - [Wayland] Kwin aborts after typing Alt+X into dosemu
Summary: [Wayland] Kwin aborts after typing Alt+X into dosemu
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.18.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-22 22:38 UTC by magiblot
Modified: 2021-10-13 13:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Output of startplasma-wayland with WAYLAND_DEBUG=1 QT_LOGGING_RULES="kwin_*.debug=true" (2.52 MB, text/x-log)
2020-04-22 23:54 UTC, magiblot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description magiblot 2020-04-22 22:38:28 UTC
SUMMARY

Kwin sometimes crashes when typing the Alt+X key combination in dosemu, in a Wayland session.

I started the Wayland session with the GDK_BACKEND=x11 and QT_QPA_PLATFORM=xcb environment variables so as to force applications to use Xwayland. I don't know if this is required to reproduce the issue.

dosemu seems to be an X11 application as its window has the X11 icon.

The crash does not happen every time. I'm not sure yet what needs to be done to always hit this issue.

STEPS TO REPRODUCE
1. Start a wayland session, e.g. 'GDK_BACKEND=x11 QT_QPA_PLATFORM=xcb startplasma-wayland'
2. Open a dosemu window, then type 'edit' to get into FreeDOS edit
3. Press the Alt+X key combination.

OBSERVED RESULT

kwin crashes with the following backtrace:

> Thread 1 "kwin_wayland" received signal SIGABRT, Aborted.
> 0x00007f96f702ece5 in raise () from /usr/lib/libc.so.6
> #0  0x00007f96f702ece5 in raise () at /usr/lib/libc.so.6
> #1  0x00007f96f701892c in abort () at /usr/lib/libc.so.6
> #2  0x00007f96f745a938 in qt_message_fatal (context=..., message=<synthetic pointer>...) at global/qlogging.cpp:1914
> #3  QMessageLogger::fatal(char const*, ...) const (this=<optimized out>, msg=<optimized out>)
>     at global/qlogging.cpp:893
> #4  0x00007f96f84f13db in KWin::AbstractClient::transientPlacement(QRect const&) const () at /usr/lib/libkwin.so.5
> #5  0x00007f96f76a6cde in QtPrivate::QSlotObjectBase::call(QObject*, void**)
>     (a=0x7ffc275811e0, r=0x55bb466002d0, this=0x55bb46f07830)
>     at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
> #6  doActivate<false>(QObject*, int, void**) (sender=0x55bb46f07340, signal_index=3, argv=0x7ffc275811e0)
>     at kernel/qobject.cpp:3870
> #7  0x00007f96f81d30a0 in KWayland::Server::ClientConnection::disconnected(KWayland::Server::ClientConnection*) ()
>     at /usr/lib/libKF5WaylandServer.so.5
> #8  0x00007f96f81e3d0d in KWayland::Server::ClientConnection::Private::destroyListenerCallback(wl_listener*, void*) ()
>     at /usr/lib/libKF5WaylandServer.so.5
> #9  0x00007f96f4e1de0f in wl_priv_signal_final_emit
>     (signal=signal@entry=0x55bb46f031b8, data=data@entry=0x55bb46f03150)
>     at ../wayland-1.18.0/src/wayland-server.c:2157
> #10 0x00007f96f4e1e002 in wl_client_destroy (client=0x55bb46f03150) at ../wayland-1.18.0/src/wayland-server.c:880
> #11 0x00007f96f4e1e109 in destroy_client_with_error (reason=<optimized out>, client=<optimized out>)
>     at ../wayland-1.18.0/src/wayland-server.c:319
> #12 wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=0x55bb46f03150)
>     at ../wayland-1.18.0/src/wayland-server.c:342
> #13 0x00007f96f4e1ffaa in wl_event_loop_dispatch (loop=0x55bb4664dd60, timeout=<optimized out>)
>     at ../wayland-1.18.0/src/event-loop.c:1027
> #14 0x00007f96f81e8c70 in KWayland::Server::Display::Private::dispatch() () at /usr/lib/libKF5WaylandServer.so.5
> #15 0x00007f96f76a6cde in QtPrivate::QSlotObjectBase::call(QObject*, void**)
>     (a=0x7ffc27581640, r=0x55bb4663a3f0, this=0x55bb4664e2b0)
>     at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
> #16 doActivate<false>(QObject*, int, void**) (sender=0x55bb4664e190, signal_index=3, argv=0x7ffc27581640)
>     at kernel/qobject.cpp:3870
> #17 0x00007f96f76a130f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
>     (sender=sender@entry=0x55bb4664e190, m=m@entry=0x7f96f78fd220 <QSocketNotifier::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffc27581640) at kernel/qobject.cpp:3930
> #18 0x00007f96f76aa532 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal)
>     (this=this@entry=0x55bb4664e190, _t1=<optimized out>, _t2=...) at .moc/moc_qsocketnotifier.cpp:141
> #19 0x00007f96f76aa882 in QSocketNotifier::event(QEvent*) (this=0x55bb4664e190, e=0x7ffc27581900)
>     at kernel/qsocketnotifier.cpp:266
> #20 0x00007f96f7a60352 in QApplicationPrivate::notify_helper(QObject*, QEvent*)
>     (this=this@entry=0x55bb465d39b0, receiver=receiver@entry=0x55bb4664e190, e=e@entry=0x7ffc27581900)
>     at kernel/qapplication.cpp:3685
> #21 0x00007f96f7a69829 in QApplication::notify(QObject*, QEvent*)
>     (this=0x7ffc27581ce0, receiver=0x55bb4664e190, e=0x7ffc27581900) at kernel/qapplication.cpp:3431
> #22 0x00007f96f76714f2 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
>     (receiver=0x55bb4664e190, event=0x7ffc27581900) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:153
> #23 0x00007f96f76c6b04 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() (this=0x55bb465e2630)
>     at kernel/qeventdispatcher_unix.cpp:304
> #24 0x00007f96f76c6f75 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
>     (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:509
> #25 0x00007f96f042785e in  () at /usr/lib/qt/plugins/platforms/KWinQpaPlugin.so
> #26 0x00007f96f767005c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
>     (this=this@entry=0x7ffc27581a90, flags=..., flags@entry=...)
>     at ../../include/QtCore/../../src/corelib/global/qflags.h:136
> #27 0x00007f96f7678066 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:118
> #28 0x000055bb45805f54 in  ()
> #29 0x00007f96f701a023 in __libc_start_main () at /usr/lib/libc.so.6
> #30 0x000055bb458063ce in _start ()

The startplasma-wayland output contains the following messages (pid 1494 is kwin_wayland):

> error in client communication (pid 1494)
> Xwayland Connection died
> (EE) 
> Fatal server error:
> (EE) Error sending request: Resource temporarily unavailable
> (EE) 
> X connection to :0 broken (explicit kill or server shutdown).
> XIO:  fatal IO error 0 (Success) on X server ":0"
>       after 10810 requests (6294 known processed) with 0 events remaining.
> X connection to :0 broken (explicit kill or server shutdown).
> klauncher: Exiting on signal 1
> XIO:  fatal IO error 9 (Bad file descriptor) on X server ":0"
>       after 10810 requests (6294 known processed) with 0 events remaining.
> stty: 'standard input': Inappropriate ioctl for device
> "/usr/bin/kwin_wayland" ("--xwayland", "--libinput", "--exit-with-session=/usr/lib/startplasma-waylandsession") exited with code 6
> startplasmacompositor: Shutting down...
> startplasmacompositor: Done.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2
Kernel Version: 5.6.5-arch3-1
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz
Memory: 11,6 GiB of RAM

dosemu version: 2.0pre8.r1740.gb364fdc61 (package dosemu2-git)
Comment 1 magiblot 2020-04-22 23:54:31 UTC
Created attachment 127781 [details]
Output of startplasma-wayland with WAYLAND_DEBUG=1 QT_LOGGING_RULES="kwin_*.debug=true"

I can confirm that the GDK_BACKEND=x11 QT_QPA_PLATFORM=xcb environment variables are unrelated to the issue.

dosemu is an X11 SDL2 application. When kwin aborts, dosemu receives a SIGHUP:

> Thread 6 "dosemu: sdl_r" received signal SIGHUP, Hangup
> [Switching to Thread 0x7f395d5f6700 (LWP 1138)]
> 0x00007f396fb957b4 in do_futex_wait.constprop ()
>    from /usr/lib/libpthread.so.0
> (gdb) thread apply all bt
> 
> Thread 10 (Thread 0x7f395a237700 (LWP 1151)):
> #0  0x00007f396fb957b4 in do_futex_wait.constprop () at /usr/lib/libpthread.so.0
> #1  0x00007f396fb958a8 in __new_sem_wait_slow.constprop.0 () at /usr/lib/libpthread.so.0
> #2  0x000055ae8ef0c94d in synth_thread ()
> #3  0x00007f396fb8c46f in start_thread () at /usr/lib/libpthread.so.0
> #4  0x00007f396f9663d3 in clone () at /usr/lib/libc.so.6
> 
> Thread 9 (Thread 0x7f395b7fb700 (LWP 1141)):
> #0  0x00007f396f95bbb6 in ppoll () at /usr/lib/libc.so.6
> #1  0x00007f396443a0e3 in pa_mainloop_poll () at /usr/lib/libpulse.so.0
> #2  0x00007f3964444301 in pa_mainloop_iterate () at /usr/lib/libpulse.so.0
> #3  0x00007f396eec7687 in  () at /usr/lib/libSDL2-2.0.so.0
> #4  0x00007f396ee0dff6 in  () at /usr/lib/libSDL2-2.0.so.0
> #5  0x00007f396ee5df4f in  () at /usr/lib/libSDL2-2.0.so.0
> #6  0x00007f396eeebc9a in  () at /usr/lib/libSDL2-2.0.so.0
> #7  0x00007f396fb8c46f in start_thread () at /usr/lib/libpthread.so.0
> #8  0x00007f396f9663d3 in clone () at /usr/lib/libc.so.6
> 
> Thread 8 (Thread 0x7f39644bc700 (LWP 1140)):
> #0  0x00007f396f95bbb6 in ppoll () at /usr/lib/libc.so.6
> #1  0x00007f396443a0e3 in pa_mainloop_poll () at /usr/lib/libpulse.so.0
> #2  0x00007f3964444301 in pa_mainloop_iterate () at /usr/lib/libpulse.so.0
> #3  0x00007f39644443b1 in pa_mainloop_run () at /usr/lib/libpulse.so.0
> #4  0x00007f396eec7990 in  () at /usr/lib/libSDL2-2.0.so.0
> #5  0x00007f396ee5df4f in  () at /usr/lib/libSDL2-2.0.so.0
> #6  0x00007f396eeebc9a in  () at /usr/lib/libSDL2-2.0.so.0
> #7  0x00007f396fb8c46f in start_thread () at /usr/lib/libpthread.so.0
> #8  0x00007f396f9663d3 in clone () at /usr/lib/libc.so.6
> 
> Thread 7 (Thread 0x7f395bffc700 (LWP 1139)):
> #0  0x00007f396fb957b4 in do_futex_wait.constprop () at /usr/lib/libpthread.so.0
> #1  0x00007f396fb958a8 in __new_sem_wait_slow.constprop.0 () at /usr/lib/libpthread.so.0
> #2  0x000055ae8ee3a81b in render_thread ()
> #3  0x00007f396fb8c46f in start_thread () at /usr/lib/libpthread.so.0
> #4  0x00007f396f9663d3 in clone () at /usr/lib/libc.so.6
> 
> Thread 6 (Thread 0x7f395d5f6700 (LWP 1138)):
> #0  0x00007f396fb957b4 in do_futex_wait.constprop () at /usr/lib/libpthread.so.0
> #1  0x00007f396fb958a8 in __new_sem_wait_slow.constprop.0 () at /usr/lib/libpthread.so.0
> #2  0x00007f396fbb17fd in render_thread () at /usr/lib/dosemu/libplugin_sdl.so
> #3  0x00007f396fb8c46f in start_thread () at /usr/lib/libpthread.so.0
> #4  0x00007f396f9663d3 in clone () at /usr/lib/libc.so.6
> 
> Thread 1 (Thread 0x7f396f866280 (LWP 1083)):
> #0  0x00007f396f22afe0 in FarPtr<_bprm>::~FarPtr() () at /usr/lib/fdpp/libfdpp.so
> #1  0x00007f396f8a5537 in __run_exit_handlers () at /usr/lib/libc.so.6
> #2  0x00007f396f8a56ee in  () at /usr/lib/libc.so.6
> #3  0x00007f396eca83f2 in _XDefaultIOError () at /usr/lib/libX11.so.6
> #4  0x00007f396eca869e in _XIOError () at /usr/lib/libX11.so.6
> #5  0x00007f396eca5db7 in _XEventsQueued () at /usr/lib/libX11.so.6
> #6  0x00007f396ec87c3b in XFlush () at /usr/lib/libX11.so.6
> #7  0x00007f396eed16ff in  () at /usr/lib/libSDL2-2.0.so.0
> #8  0x00007f396ee2b5ef in  () at /usr/lib/libSDL2-2.0.so.0
> #9  0x000055ae8eefbd48 in mouse_client_show_cursor ()
> #10 0x000055ae8eef56b6 in mouse_cursor ()
> #11 0x000055ae8eef75d7 in mouse_int ()
> #12 0x000055ae8ee51b18 in _int33_ ()
> #13 0x000055ae8ee555b4 in dos_helper ()
> #14 0x000055ae8ee5d19b in coopth_thread ()
> #15 0x000055ae8ee801f7 in co_runner ()
> #16 0x0000000000000000 in  ()

Reproducing the issue is not so straightforward. Sometimes I get it the first time I do `edit` > `Alt+X`, sometimes I get it after pressing Alt+X repeatedly, etc.
Comment 2 Vlad Zahorodnii 2021-10-13 13:19:05 UTC
Wayland related bits have changed quite a lot. Please reopen this bug report if the issue is still reproducible.