wlroots-hyprland/types
Simon Ser b2f6ff45c2 output: fix stack variable lifetime in wlr_output_send_present
Variables on the stack are released when the parent block is closed.
Here, `now` is used outside of the `if` block, causing the following
crash when starting Sway with the headless backend:

    ==49606==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fff94645f90 at pc 0x5558aeae9e29 bp 0x7fff94645df0 sp 0x7fff94645de0
    READ of size 16 at 0x7fff94645f90 thread T0
        #0 0x5558aeae9e28 in handle_present ../sway/desktop/output.c:834
        #1 0x7fdc8d6792fb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
        #2 0x7fdc8d54f77f in wlr_output_send_present ../subprojects/wlroots/types/output/output.c:766
        #3 0x7fdc8d524a28 in output_commit ../subprojects/wlroots/backend/headless/output.c:71
        #4 0x7fdc8d54d2db in wlr_output_commit ../subprojects/wlroots/types/output/output.c:629
        #5 0x5558aeb013cb in output_render ../sway/desktop/render.c:1157
        #6 0x5558aeae549e in output_repaint_timer_handler ../sway/desktop/output.c:544
        #7 0x5558aeae5f8a in damage_handle_frame ../sway/desktop/output.c:606
        #8 0x7fdc8d6792fb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
        #9 0x7fdc8d6007d5 in output_handle_frame ../subprojects/wlroots/types/wlr_output_damage.c:44
        #10 0x7fdc8d6792fb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
        #11 0x7fdc8d54ee84 in wlr_output_send_frame ../subprojects/wlroots/types/output/output.c:720
        #12 0x7fdc8d54efc3 in schedule_frame_handle_idle_timer ../subprojects/wlroots/types/output/output.c:728
        #13 0x7fdc8c9dcf5a in wl_event_loop_dispatch_idle (/usr/lib/libwayland-server.so.0+0xaf5a)
        #14 0x7fdc8c9dcfb4 in wl_event_loop_dispatch (/usr/lib/libwayland-server.so.0+0xafb4)
        #15 0x7fdc8c9dabc6 in wl_display_run (/usr/lib/libwayland-server.so.0+0x8bc6)
        #16 0x5558aeac8e30 in server_run ../sway/server.c:285
        #17 0x5558aeac3c7d in main ../sway/main.c:396
        #18 0x7fdc8be35b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
        #19 0x5558aea8686d in _start (/home/simon/src/sway/build/sway/sway+0x33f86d)
2021-10-29 15:03:29 +03:00
..
data_device wlr_drag: Destroy drag after releasing grabs 2020-06-30 11:11:52 +02:00
output output: fix stack variable lifetime in wlr_output_send_present 2021-10-29 15:03:29 +03:00
scene scene: inline subsurface_tree_destroy 2021-10-27 16:18:10 +02:00
seat seat: avoid copying the keymap for each client 2021-09-05 22:06:25 +02:00
tablet_v2 Fix invalid uses of wl_array_for_each 2021-07-08 10:08:47 -04:00
xdg_shell xdg-shell: remove redundant NULL buffer check 2021-10-06 10:15:49 +02:00
meson.build output: split into multiple files 2021-10-23 00:49:24 +02:00
wlr_buffer.c types/buffer: make {begin,end}_data_ptr_access part of the public API 2021-09-15 11:50:44 +02:00
wlr_compositor.c surface: make wlr_subsurface_create private 2021-06-29 10:32:17 -04:00
wlr_cursor.c cursor: emit hold gesture events 2021-09-27 15:30:31 +02:00
wlr_data_control_v1.c Simplify globals implementation by removing destructors 2019-11-25 09:01:46 -05:00
wlr_drm.c drm: add support for DMA-BUFs 2021-07-05 11:13:41 -04:00
wlr_drm_lease_v1.c types: introduce wlr_drm_lease_v1 2021-09-08 11:09:07 +02:00
wlr_export_dmabuf_v1.c output: remove wlr_output_impl.export_dmabuf 2021-07-12 13:29:03 -04:00
wlr_foreign_toplevel_management_v1.c toplevel-management: avoid redundant state events 2021-01-05 12:22:20 +01:00
wlr_fullscreen_shell_v1.c Simplify globals implementation by removing destructors 2019-11-25 09:01:46 -05:00
wlr_gamma_control_v1.c gamma-control-v1: schedule frame when resetting gamma LUT 2021-01-10 18:40:08 +01:00
wlr_idle.c Simplify globals implementation by removing destructors 2019-11-25 09:01:46 -05:00
wlr_idle_inhibit_v1.c idle-inhibit: Style and naming improvements 2020-02-20 21:40:34 +01:00
wlr_input_device.c Remove all wayland-server.h includes 2019-07-27 15:49:32 -04:00
wlr_input_inhibitor.c Make implementation function lists static const 2021-02-05 10:04:20 +01:00
wlr_input_method_v2.c Implement input_method_v2 popups 2021-09-22 09:42:14 +02:00
wlr_keyboard.c keyboard: add wlr_keyboard.keymap_fd 2021-09-05 22:06:25 +02:00
wlr_keyboard_group.c Replace wlr_key_state with wl_keyboard_key_state 2020-11-11 10:58:38 +01:00
wlr_keyboard_shortcuts_inhibit_v1.c keyboard-shortcuts-inhibit: Implement the protocol 2020-02-20 21:40:34 +01:00
wlr_layer_shell_v1.c layer-shell: move NULL buffer check to role precommit handler 2021-10-06 10:15:49 +02:00
wlr_linux_dmabuf_v1.c Revert "Require INVALID for implicit format modifiers" 2021-10-01 09:26:05 -06:00
wlr_matrix.c move wlr_box from /types to /util 2021-07-06 21:43:17 +02:00
wlr_output_damage.c output-damage: fix damage on modeset 2021-09-07 22:27:31 +02:00
wlr_output_layout.c util/addon: find both by owner and impl 2021-08-11 18:12:57 +02:00
wlr_output_management_v1.c output-management: use same types as wlr_output 2021-01-10 16:28:19 +01:00
wlr_output_power_management_v1.c output-power-management-v1: listen to output commit 2020-08-27 13:54:19 -06:00
wlr_pointer.c pointer: add hold pointer event definition 2021-09-27 15:30:31 +02:00
wlr_pointer_constraints_v1.c move wlr_box from /types to /util 2021-07-06 21:43:17 +02:00
wlr_pointer_gestures_v1.c wlr_pointer_gestures: hold gestures (protocol v3) 2021-09-27 15:30:31 +02:00
wlr_presentation_time.c presentation-time: use a surface addon 2021-10-22 11:57:19 +02:00
wlr_primary_selection.c wlr_seat: Fix edge cases with serial validation 2019-06-30 15:01:05 -04:00
wlr_primary_selection_v1.c primary selection: destroy devices before manager 2021-01-05 13:53:58 +01:00
wlr_region.c region: stabilize interface 2021-07-05 09:25:25 -04:00
wlr_relative_pointer_v1.c Simplify globals implementation by removing destructors 2019-11-25 09:01:46 -05:00
wlr_screencopy_v1.c sceeencopy-v1: listen to output destroy in capture_output 2021-10-29 11:37:59 +02:00
wlr_server_decoration.c Simplify globals implementation by removing destructors 2019-11-25 09:01:46 -05:00
wlr_surface.c surface_at: check if surfaces are mapped 2021-10-02 11:38:40 +02:00
wlr_switch.c Remove all wayland-server.h includes 2019-07-27 15:49:32 -04:00
wlr_tablet_pad.c Fix invalid uses of wl_array_for_each 2021-07-08 10:08:47 -04:00
wlr_tablet_tool.c Fix invalid uses of wl_array_for_each 2021-07-08 10:08:47 -04:00
wlr_text_input_v3.c text_input_v3: correct typo in enum field 2021-02-15 16:33:05 +01:00
wlr_touch.c touch: add frame event 2021-07-08 09:12:17 +02:00
wlr_viewporter.c surface: drop wlr_surface_state.buffer_resource 2021-09-06 14:21:23 -04:00
wlr_virtual_keyboard_v1.c virtual_keyboard: Emulate key release events on destroy 2021-05-07 11:18:19 +02:00
wlr_virtual_pointer_v1.c Fix incorrect format parameters 2020-07-27 10:49:19 +02:00
wlr_xcursor_manager.c Make wlr_xcursor_manager_load() return a bool 2020-05-18 16:48:44 +02:00
wlr_xdg_activation_v1.c xdg-activation-v1: fix wlr_xdg_activation_v1_create error path 2021-06-17 14:48:28 +02:00
wlr_xdg_decoration_v1.c xdg-decoration: refactor configure/state flow 2021-10-07 07:27:51 -06:00
wlr_xdg_foreign_registry.c util/uuid: replace with util/token, remove libuuid 2021-04-11 19:09:36 +02:00
wlr_xdg_foreign_v1.c xdg-foreign: rename finish_* functions to destroy_* 2021-02-08 18:09:00 +01:00
wlr_xdg_foreign_v2.c xdg-foreign-v2: use error enum 2021-10-25 18:22:11 +03:00
wlr_xdg_output_v1.c xdg-output: destroy outputs before manager 2021-01-19 11:56:31 +01:00