mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
92eedb84c1
In output_ensure_buffer() we create a swapchain and attach an empty
buffer to the output if necessary. We do that during the first commit.
This is fine when the first commit enables the output, however this breaks
when the first commit disables the output. A commit which disables an
output and has a buffer attached is invalid (see output_basic_test()), and
makes the DRM backend crash:
00:00:00.780 [wlr] [backend/drm/drm.c:622] connector eDP-1: Turning off
../subprojects/wlroots/backend/drm/drm.c:652:44: runtime error: member access within null pointer of type 'struct wlr_drm_crtc'
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2524==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f22e894afc1 bp 0x7ffe1d57c550 sp 0x7ffe1d57c420 T0)
==2524==The signal is caused by a READ memory access.
==2524==Hint: address points to the zero page.
#0 0x7f22e894afc1 in drm_connector_commit_state ../subprojects/wlroots/backend/drm/drm.c:652
#1 0x7f22e894b1f5 in drm_connector_commit ../subprojects/wlroots/backend/drm/drm.c:674
#2 0x7f22e89e8da9 in wlr_output_commit_state ../subprojects/wlroots/types/output/output.c:756
#3 0x555ab325624d in apply_output_config ../sway/config/output.c:517
#4 0x555ab31a1aa1 in handle_new_output ../sway/desktop/output.c:974
#5 0x7f22e9272f6d in wl_signal_emit_mutable (/usr/lib/libwayland-server.so.0+0x9f6d)
#6 0x7f22e899b012 in new_output_reemit ../subprojects/wlroots/backend/multi/backend.c:161
#7 0x7f22e9272f6d in wl_signal_emit_mutable (/usr/lib/libwayland-server.so.0+0x9f6d)
#8 0x7f22e895a153 in scan_drm_connectors ../subprojects/wlroots/backend/drm/drm.c:1488
#9 0x7f22e893c2e4 in backend_start ../subprojects/wlroots/backend/drm/backend.c:24
#10 0x7f22e892ed00 in wlr_backend_start ../subprojects/wlroots/backend/backend.c:56
#11 0x7f22e8999b83 in multi_backend_start ../subprojects/wlroots/backend/multi/backend.c:31
#12 0x7f22e892ed00 in wlr_backend_start ../subprojects/wlroots/backend/backend.c:56
#13 0x555ab317d5cc in server_start ../sway/server.c:316
#14 0x555ab317748d in main ../sway/main.c:400
#15 0x7f22e783c28f (/usr/lib/libc.so.6+0x2328f)
#16 0x7f22e783c349 in __libc_start_main (/usr/lib/libc.so.6+0x23349)
#17 0x555ab3134c84 in _start (/home/simon/src/sway/build/sway/sway+0x377c84)
Fixes:
|
||
---|---|---|
.. | ||
buffer | ||
data_device | ||
output | ||
scene | ||
seat | ||
tablet_v2 | ||
xdg_shell | ||
meson.build | ||
wlr_compositor.c | ||
wlr_content_type_v1.c | ||
wlr_cursor.c | ||
wlr_damage_ring.c | ||
wlr_data_control_v1.c | ||
wlr_drm.c | ||
wlr_drm_lease_v1.c | ||
wlr_export_dmabuf_v1.c | ||
wlr_foreign_toplevel_management_v1.c | ||
wlr_fullscreen_shell_v1.c | ||
wlr_gamma_control_v1.c | ||
wlr_idle.c | ||
wlr_idle_inhibit_v1.c | ||
wlr_idle_notify_v1.c | ||
wlr_input_device.c | ||
wlr_input_inhibitor.c | ||
wlr_input_method_v2.c | ||
wlr_keyboard.c | ||
wlr_keyboard_group.c | ||
wlr_keyboard_shortcuts_inhibit_v1.c | ||
wlr_layer_shell_v1.c | ||
wlr_linux_dmabuf_v1.c | ||
wlr_matrix.c | ||
wlr_output_damage.c | ||
wlr_output_layout.c | ||
wlr_output_management_v1.c | ||
wlr_output_power_management_v1.c | ||
wlr_pointer.c | ||
wlr_pointer_constraints_v1.c | ||
wlr_pointer_gestures_v1.c | ||
wlr_presentation_time.c | ||
wlr_primary_selection.c | ||
wlr_primary_selection_v1.c | ||
wlr_region.c | ||
wlr_relative_pointer_v1.c | ||
wlr_screencopy_v1.c | ||
wlr_server_decoration.c | ||
wlr_session_lock_v1.c | ||
wlr_shm.c | ||
wlr_single_pixel_buffer_v1.c | ||
wlr_subcompositor.c | ||
wlr_switch.c | ||
wlr_tablet_pad.c | ||
wlr_tablet_tool.c | ||
wlr_text_input_v3.c | ||
wlr_touch.c | ||
wlr_viewporter.c | ||
wlr_virtual_keyboard_v1.c | ||
wlr_virtual_pointer_v1.c | ||
wlr_xcursor_manager.c | ||
wlr_xdg_activation_v1.c | ||
wlr_xdg_decoration_v1.c | ||
wlr_xdg_foreign_registry.c | ||
wlr_xdg_foreign_v1.c | ||
wlr_xdg_foreign_v2.c | ||
wlr_xdg_output_v1.c |