swaywm / wlroots

A modular Wayland compositor library
https://gitlab.freedesktop.org/wlroots/wlroots/
MIT License
2.15k stars 343 forks source link

RDP backend weirdness and crash #1699

Closed aemino closed 5 years ago

aemino commented 5 years ago

When using the rdp backend and attempting to connect, with either xfreerdp ... --rfx or xfreerdp ... --nsc, my status bar (waybar) does not render properly, there are artifacts when moving the mouse, and a few seconds after moving the mouse, sway crashes. I'm not sure what useful information I can provide about this other then the following crash log. I included a few non-Sway messages just in case this issue is entirely unrelated to wlroots. I should also probably mention that I am running sway (with the rdp backend) inside of "normal," desktop sway.

xkbcommon: ERROR: Unrecognized RMLVO option "grp:alt_toggle" was ignored
[19:25:25:717] [2620:2620] [INFO][com.freerdp.core.listener] - Listening on 0.0.0.0:3389
...
glamor: No eglstream capable devices found
glamor: 'wl_drm' not supported
Missing Wayland requirements for glamor GBM backend
Missing Wayland requirements for glamor EGLStream backend
Failed to initialize glamor, falling back to sw
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
> Internal error:   Could not resolve keysym XF86MonBrightnessCycle
Errors from xkbcomp are not fatal to the X server
Resources files: /home/aemino/.config/waybar/config, /home/aemino/.config/waybar/style.css
Unknown option -b
Created log file at "/tmp/Alacritty-2632.log"
[2019-05-17 19:25] [ERROR] Alacritty encountered an unrecoverable error:

    Error creating GL context; No monitors were detected.

[19:25:40:382] [2620:2620] [INFO][com.freerdp.core.connection] - Client Security: NLA:0 TLS:1 RDP:0
[19:25:40:383] [2620:2620] [INFO][com.freerdp.core.connection] - Server Security: NLA:0 TLS:1 RDP:1
[19:25:40:383] [2620:2620] [INFO][com.freerdp.core.connection] - Negotiated Security: NLA:0 TLS:1 RDP:0
[19:25:40:423] [2620:2620] [INFO][com.freerdp.core.connection] - Accepted client: NUS11180-10-roh
[19:25:40:423] [2620:2620] [INFO][com.freerdp.core.connection] - Accepted channels:
[19:25:40:424] [2620:2620] [INFO][com.freerdp.core.connection] -  rdpdr
[19:25:40:424] [2620:2620] [INFO][com.freerdp.core.connection] -  rdpsnd
[19:25:40:424] [2620:2620] [INFO][com.freerdp.core.connection] -  cliprdr
[19:25:40:424] [2620:2620] [INFO][com.freerdp.core.gcc] - Active rdp encryption level: NONE
[19:25:40:424] [2620:2620] [INFO][com.freerdp.core.gcc] - Selected rdp encryption method: NONE
xkbcommon: ERROR: Unrecognized RMLVO option "grp:alt_toggle" was ignored
xkbcommon: ERROR: Unrecognized RMLVO variant "nodeadkeys" was ignored
xkbcommon: ERROR: Unrecognized RMLVO option "grp:alt_toggle" was ignored
2019-05-17 19:25:40 - [swaybg/main.c:300] Found config * for output RDP-1 (RDP RDP )

(waybar:2628): Gdk-CRITICAL **: 19:25:40.390: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(waybar:2628): Gdk-CRITICAL **: 19:25:40.391: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(waybar:2628): Gdk-CRITICAL **: 19:25:40.391: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(waybar:2628): Gdk-CRITICAL **: 19:25:40.391: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(waybar:2628): Gdk-CRITICAL **: 19:25:40.391: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(waybar:2628): Gdk-CRITICAL **: 19:25:40.391: gdk_monitor_get_workarea: assertion 'GDK_IS_MONITOR (monitor)' failed
Bar configured (width: 1280, height: auto) for output: RDP-1
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 374, clipping.
>                   X11 cannot support keycodes above 255.
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
> Internal error:   Could not resolve keysym XF86MonBrightnessCycle
Errors from xkbcomp are not fatal to the X server
Bar configured (width: 1280, height: 37) for output: RDP-1
...
(EE) Gdk-Message: 19:25:53.556: Error reading events from display: Connection reset by peer
failed to read Wayland events: Broken pipe
fish: “env WLR_RDP_TLS_CERT_PATH=$HOME…” terminated by signal SIGSEGV (Address boundary error)

OS: Arch Linux wlroots-git: a68c7c0c sway-git: ed2e553b

queezle42 commented 5 years ago

rdp_error I can confirm the error on Arch with wlroots-git 0ab1bb6. I am running sway with the wlroots rdp backend on a headless server and after connecting with xfreerdp --rfx ... I can see the desktop, but all further updates (swaybar updates and mouse movements) render parts of the wallpaper with an incorrect offset. When I move the mouse more sway (/wlroots) crashes with a segmentation fault.

Starting a program refreshes the screen once but is followed by a segmentation fault half a second later.

rdp_error_nsc Similar behavior can be observed when connecting with xfreerdp --nsc ... except the initial screen is black, moving the mouse paints what looks like random data. Moving the mouse more usually results in a segmentation fault.

I also tried using the rdp backend with cage (cage glxgears and cage sway), but I could not get it to render anything but a gray screen. The segmentation fault also happens when I am moving the mouse a bit.

emersion commented 5 years ago

If it's crashing, a backtrace (and a patch!) would help.

aemino commented 5 years ago

@emersion Is the crash log that I put in the original issue post sufficient, or is a more detailed backtrace necessary? I would be willing to help submit a patch if you could point me in the right direction--I don't know very much about the wlroots codebase.

As a side note, this seems to be related to https://github.com/swaywm/sway/issues/4163.

queezle42 commented 5 years ago

Backtrace:

#0  0x00007ff9d52e568a in  () at /usr/lib/dri/i965_dri.so
#1  0x00007ff9d53053aa in  () at /usr/lib/dri/i965_dri.so
#2  0x00007ff9d519d226 in  () at /usr/lib/dri/i965_dri.so
#3  0x00007ff9d50a106b in  () at /usr/lib/dri/i965_dri.so
#4  0x00007ff9d519dda7 in  () at /usr/lib/dri/i965_dri.so
#5  0x00007ff9d519e1b2 in  () at /usr/lib/dri/i965_dri.so
#6  0x00007ff9dcf21023 in gles2_read_pixels
    (wlr_renderer=<optimized out>, wl_fmt=<optimized out>, flags=0x0, stride=7680, width=37, height=<optimized out>, src_x=1008, src_y=539, dst_x=1008, dst_y=539, data=0x7ff9cd2ea010) at ../render/gles2/renderer.c:321
#7  0x00007ff9dcf1d40d in output_commit (wlr_output=0x55fc647888f0) at ../backend/rdp/output.c:200
#8  0x00007ff9dcf41561 in wlr_output_commit (output=0x55fc647888f0) at ../types/wlr_output.c:456
#9  0x000055fc626fe9f4 in output_render (output=0x55fc647a6240, when=0x7ffc220a32d0, damage=0x7ffc220a32e0)
    at ../sway/sway/desktop/render.c:1097
#10 0x000055fc626fa482 in damage_handle_frame (listener=0x55fc647a63c8, data=0x55fc647a6400)
    at ../sway/sway/desktop/output.c:403
#11 0x00007ff9dcf4d0be in wlr_signal_emit_safe (signal=0x55fc647a6460, data=0x55fc647a6400) at ../util/signal.c:29
#12 0x00007ff9dcf4d0be in wlr_signal_emit_safe (signal=signal@entry=0x55fc64788a30, data=data@entry=0x55fc647888f0)
    at ../util/signal.c:29
#13 0x00007ff9dcf41697 in wlr_output_send_frame (output=output@entry=0x55fc647888f0) at ../types/wlr_output.c:479
#14 0x00007ff9dcf1d27a in signal_frame (data=0x55fc647888f0) at ../backend/rdp/output.c:257
#15 0x00007ff9dcf9110a in  () at /usr/lib/libwayland-server.so.0
#16 0x00007ff9dcf917f2 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#17 0x00007ff9dcf9039c in wl_display_run () at /usr/lib/libwayland-server.so.0
#18 0x000055fc626f6b32 in server_run (server=0x55fc6275dee0 <server>) at ../sway/sway/server.c:225
#19 0x000055fc626f5fbe in main (argc=3, argv=0x7ffc220a3788) at ../sway/sway/main.c:397

I'm not sure how to get more information about the mesa functions (i965_dri.so at the top of the backtrace).

chron-isch commented 5 years ago

I can confirm that #1809 fixed the problem for me, RDP connections work now, but I'm running into #1654 now, when closing the connection.

Testing on Archlinux with wlroots-git.

aemino commented 5 years ago

Yeah, I believe that #1809 resolved this issue. I can't quite test for myself though, since now it seems that https://github.com/swaywm/sway/issues/4549 is preventing me from using RDP.