Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.94k stars 166 forks source link

vfb Xwayland: crash of xpra server without --video-encoders=none (segmentation fault) #3431

Closed mviereck closed 2 years ago

mviereck commented 2 years ago

Describe the bug I use xpra to attach to Xwayland as its vfb. If I run the xpra server without --video-encoders=none, the server crashes with a segmentation fault.

I am aware that you do not officially support Xwayland as vfb, however, you might be interested in this.

To Reproduce

Script to reproduce: (please run in Xorg, not in e.g. Gnome-Wayland)

export LC_ALL=C

echo "### starting weston ###"
weston &
sleep 10

echo "### starting Xwayland ###"
Xwayland :10 -ac &
sleep 5

echo "### starting xpra server ###"
# crashing command:
xpra start :10 --use-display --daemon=no &
# does not crash:
#xpra start :10 --use-display --daemon=no --video-encoders=none &
sleep 20

echo "### starting xpra client ###"
xpra attach :10

System Information (please complete the following information):

Additional context Output of script with crash:

### starting weston ###
Date: 2022-01-14 CET
[16:20:39.722] weston 9.0.0
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 9.0.0
[16:20:39.722] Command line: weston
[16:20:39.722] OS: Linux, 5.10.0-10-amd64, #1 SMP Debian 5.10.84-1 (2021-12-08), x86_64
[16:20:39.722] Using config file '/home/lauscher/.config/weston.ini'
[16:20:39.722] Output repaint window is 7 ms maximum.
[16:20:39.722] Loading module '/usr/lib/x86_64-linux-gnu/libweston-9/x11-backend.so'
[16:20:39.728] Loading module '/usr/lib/x86_64-linux-gnu/libweston-9/gl-renderer.so'
[16:20:39.729] EGL client extensions: EGL_EXT_device_base
               EGL_EXT_device_enumeration EGL_EXT_device_query
               EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses
               EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device
               EGL_EXT_platform_wayland EGL_KHR_platform_wayland
               EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_MESA_platform_gbm
               EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
[16:20:39.785] EGL version: 1.4
[16:20:39.785] EGL vendor: Mesa Project
[16:20:39.785] EGL client APIs: OpenGL OpenGL_ES 
[16:20:39.785] EGL extensions: EGL_ANDROID_blob_cache EGL_CHROMIUM_sync_control
               EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import
               EGL_EXT_image_dma_buf_import_modifiers
               EGL_EXT_swap_buffers_with_damage EGL_KHR_cl_event2
               EGL_KHR_config_attribs EGL_KHR_create_context
               EGL_KHR_create_context_no_error EGL_KHR_fence_sync
               EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace
               EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
               EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image
               EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap
               EGL_KHR_no_config_context EGL_KHR_reusable_sync
               EGL_KHR_surfaceless_context EGL_KHR_swap_buffers_with_damage
               EGL_EXT_pixel_format_float EGL_KHR_wait_sync
               EGL_MESA_configless_context EGL_MESA_drm_image
               EGL_MESA_image_dma_buf_export EGL_MESA_query_driver
               EGL_NOK_texture_from_pixmap EGL_WL_bind_wayland_display
[16:20:39.785] warning: Disabling render GPU timeline and explicit synchronization due to missing EGL_ANDROID_native_fence_sync extension
[16:20:39.785] EGL_KHR_surfaceless_context available
[16:20:39.788] GL version: OpenGL ES 3.0 Mesa 20.3.5
[16:20:39.788] GLSL version: OpenGL ES GLSL ES 3.00
[16:20:39.788] GL vendor: nouveau
[16:20:39.788] GL renderer: NVA5
[16:20:39.788] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays
               GL_EXT_texture_filter_anisotropic
               GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1
               GL_EXT_texture_compression_rgtc GL_EXT_texture_format_BGRA8888
               GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24
               GL_OES_element_index_uint GL_OES_fbo_render_mipmap
               GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives
               GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float
               GL_OES_texture_float_linear GL_OES_texture_half_float
               GL_OES_texture_half_float_linear GL_OES_texture_npot
               GL_OES_vertex_half_float GL_EXT_draw_instanced
               GL_EXT_texture_sRGB_decode GL_OES_EGL_image
               GL_OES_depth_texture GL_AMD_performance_monitor
               GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV
               GL_NV_conditional_render GL_OES_get_program_binary
               GL_APPLE_texture_max_level GL_EXT_discard_framebuffer
               GL_EXT_read_format_bgra GL_EXT_frag_depth
               GL_NV_fbo_color_attachments GL_OES_EGL_image_external
               GL_OES_EGL_sync GL_OES_vertex_array_object
               GL_ANGLE_pack_reverse_row_order
               GL_ANGLE_texture_compression_dxt3
               GL_ANGLE_texture_compression_dxt5
               GL_EXT_occlusion_query_boolean GL_EXT_texture_rg
               GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer
               GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil
               GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug
               GL_KHR_texture_compression_astc_ldr GL_NV_pixel_buffer_object
               GL_OES_depth_texture_cube_map GL_OES_required_internalformat
               GL_OES_surfaceless_context GL_EXT_color_buffer_float
               GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects
               GL_EXT_shader_integer_mix GL_EXT_base_instance
               GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_copy_image
               GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex
               GL_EXT_polygon_offset_clamp GL_EXT_texture_border_clamp
               GL_KHR_context_flush_control GL_OES_copy_image
               GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex
               GL_OES_texture_border_clamp GL_OES_texture_stencil8
               GL_EXT_blend_func_extended GL_EXT_float_blend GL_KHR_no_error
               GL_KHR_texture_compression_astc_sliced_3d
               GL_OES_EGL_image_external_essl3 GL_EXT_clip_cull_distance
               GL_EXT_disjoint_timer_query
               GL_EXT_texture_compression_s3tc_srgb GL_EXT_window_rectangles
               GL_MESA_shader_integer_functions GL_EXT_clip_control
               GL_EXT_color_buffer_half_float GL_KHR_parallel_shader_compile
               GL_EXT_EGL_image_storage GL_MESA_framebuffer_flip_y
               GL_EXT_depth_clamp GL_EXT_texture_query_lod
[16:20:39.788] GL ES 2 renderer features:
               read-back format: BGRA
               wl_shm sub-image to texture: yes
               EGL Wayland extension: yes
[16:20:39.788] Using gl renderer
[16:20:39.795] Registered plugin API 'weston_windowed_output_api_v1' of size 16
[16:20:39.796] Chosen EGL config details: id:  17 rgba: 8 8 8 0 buf: 24 dep:  0 stcl: 0 int: 0-1000 type: win|pix|pbf vis_id: 0x21
[16:20:39.798] x11 output 1800x900, window id 90177541
[16:20:39.798] Output 'X1' enabled with head(s) X1
[16:20:39.798] Compositor capabilities:
               arbitrary surface rotation: yes
               screen capture uses y-flip: yes
               presentation clock: CLOCK_MONOTONIC_RAW, id 4
               presentation clock resolution: 0.000000001 s
[16:20:39.798] Loading module '/usr/lib/x86_64-linux-gnu/weston/desktop-shell.so'
[16:20:39.798] launching '/usr/lib/x86_64-linux-gnu/weston-keyboard'
[16:20:39.800] Old Xwayland module loading detected: Please use --xwayland command line option or set xwayland=true in the [core] section in weston.ini
[16:20:39.800] Loading module '/usr/lib/x86_64-linux-gnu/libweston-9/xwayland.so'
[16:20:39.809] Registered plugin API 'weston_xwayland_v1' of size 32
[16:20:39.809] Registered plugin API 'weston_xwayland_surface_v1' of size 16
[16:20:39.809] xserver listening on display :1
[16:20:39.809] launching '/usr/lib/x86_64-linux-gnu/weston-desktop-shell'
[16:20:39.811] Chosen EGL config details: id:  17 rgba: 8 8 8 0 buf: 24 dep:  0 stcl: 0 int: 0-1000 type: win|pix|pbf vis_id: 0x21
ERROR loading icon from file '/usr/share/icons/gnome/24x24/apps/utilities-terminal.png', error: 'file not found'
ERROR loading icon from file '/usr/share/icons/gnome-colors-common/24x24/actions/xfce4-appfinder.png', error: 'file not found'
ERROR loading icon from file '/usr/local/share/icons/hicolor/72x72/apps/x11docker.png', error: 'file not found'
### starting Xwayland ###
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 569, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
### starting xpra server ###
2022-01-14 16:20:55,056 no uinput module
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 569, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
2022-01-14 16:20:55,544 pointer device emulation using XTest
2022-01-14 16:20:55,581 serving html content from '/usr/share/xpra/www'
2022-01-14 16:20:55,582 wrote pid 38728 to '/run/user/1000/xpra/10/server.pid'
2022-01-14 16:20:55,612 Warning: socket directory '/run/user/1000/xpra'
2022-01-14 16:20:55,613  expected permissions 0o700 but found 0o755
2022-01-14 16:20:55,613 Warning: socket directory '/run/user/1000/xpra/10'
2022-01-14 16:20:55,613  expected permissions 0o700 but found 0o750
2022-01-14 16:20:55,614 created unix domain socket '/run/user/1000/xpra/debianlaptop-10'
2022-01-14 16:20:55,614 cannot create group socket '/run/xpra/debianlaptop-10'
2022-01-14 16:20:55,614  [Errno 13] Permission denied
2022-01-14 16:20:55,615 created unix domain socket '/home/lauscher/.xpra/debianlaptop-10'
2022-01-14 16:20:55,615 created unix domain socket '/run/user/1000/xpra/10/socket'
2022-01-14 16:20:55,616 xvfb pid not found
2022-01-14 16:20:55,702 D-Bus notification forwarding is available
2022-01-14 16:20:55,730 pulseaudio server started with pid 38769
2022-01-14 16:20:55,730  private server socket path:
2022-01-14 16:20:55,730  '/run/user/1000/xpra/10/pulse/pulse/native'
W: [pulseaudio] pid.c: Stale PID file, overwriting.
2022-01-14 16:20:55,879 watching for applications menu changes in:
2022-01-14 16:20:55,880  '/usr/share/xfce4/applications'
2022-01-14 16:20:55,880  '/usr/local/share/applications'
2022-01-14 16:20:55,880  '/usr/share/applications'
2022-01-14 16:20:55,949 Warning: webcam forwarding is disabled
2022-01-14 16:20:55,949  the virtual video directory '/sys/devices/virtual/video4linux' was not found
2022-01-14 16:20:55,949  make sure that the 'v4l2loopback' kernel module is installed and loaded
2022-01-14 16:20:55,950  or use the 'webcam=no' option
2022-01-14 16:20:55,950 found 0 virtual video devices for webcam forwarding

(Xpra:38728): Gtk-CRITICAL **: 16:20:55.995: gtk_widget_realize: assertion 'widget->priv->anchored || GTK_IS_INVISIBLE (widget)' failed
2022-01-14 16:20:56,122 waiting for initialization thread to complete
2022-01-14 16:20:56,123 xpra is ready.
2022-01-14 16:20:56,412 GStreamer version 1.18.4 for Python 3.9.2 64-bit
2022-01-14 16:20:58,181 xpra X11 seamless version 4.3.1-r0 64-bit
2022-01-14 16:20:58,201  uid=1000 (lauscher), gid=1000 (lauscher)
2022-01-14 16:20:58,202  running with pid 38728 on Linux Debian 11 bullseye
2022-01-14 16:20:58,218  connected to X11 display :10 with 24 bit colors
2022-01-14 16:21:01,186 loaded 8 start menu entries from 2 sub-menus in 5.3 seconds
2022-01-14 16:21:01,742 Error loading '/usr/share/pixmaps/herbstluftwm.xpm':
2022-01-14 16:21:01,742  cannot identify image file '/usr/share/pixmaps/herbstluftwm.xpm'
2022-01-14 16:21:04,745 printer forwarding enabled using postscript and pdf
/home/lauscher/bin/xpratest: line 17: 38728 Segmentation fault      xpra start :10 --use-display --daemon=no
### starting xpra client ###
2022-01-14 16:21:15,120 Xpra GTK3 X11 client version 4.3.1-r0 64-bit
2022-01-14 16:21:15,199  running on Linux Debian 11 bullseye
2022-01-14 16:21:15,201  window manager is 'Xfwm4'
2022-01-14 16:21:17,641 GStreamer version 1.18.4 for Python 3.9.2 64-bit
2022-01-14 16:21:17,888 created unix domain socket '/run/user/1000/xpra/clients/debianlaptop-38880'
2022-01-14 16:21:18,134 No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
2022-01-14 16:21:18,433 OpenGL enabled with NVA5
server socket for display :10 is in UNKNOWN state
 waiting up to 20 seconds
Warning: failed to connect:
 cannot find live server for display :10
2022-01-14 16:21:38,944 removing unix domain socket '/run/user/1000/xpra/clients/debianlaptop-38880'
totaam commented 2 years ago

Difficult to say what causes this crash. My guess is that this has nothing to do with Wayland and that this is caused by vaapi: b3c7c871f2049bec6c688e220d0fa80fcc7e650f (now disabled by default because of crashes like this one)

You can try:

XPRA_VAAPI=0 xpra start ...
mviereck commented 2 years ago

XPRA_VAAPI=0 xpra start ...

This fixed the crash, thank you!