wlroots/types
Rouven Czerwinski a5e32f652b wlr_output: remove idle_done on output destroy
If an output is destroyed while an idle_done event is scheduled, it
results in the following Address Sanitizer Output:

==1469==ERROR: AddressSanitizer: heap-use-after-free on address 0x6170000bb668 at pc 0x7f49aaa0c348 bp 0x7ffed5da35b0 sp 0x7ffed5da35a0
WRITE of size 8 at 0x6170000bb668 thread T0
    #0 0x7f49aaa0c347 in schedule_done_handle_idle_timer ../subprojects/wlroots/types/wlr_output.c:265
    #1 0x7f49aa2f875b in wl_event_loop_dispatch_idle (/usr/lib/libwayland-server.so.0+0xa75b)
    #2 0x7f49aa2f8815 in wl_event_loop_dispatch (/usr/lib/libwayland-server.so.0+0xa815)
    #3 0x7f49aa2f739b in wl_display_run (/usr/lib/libwayland-server.so.0+0x939b)
    #4 0x556622dadd51 in server_run ../sway/server.c:216
    #5 0x556622dac25d in main ../sway/main.c:397
    #6 0x7f49aa0d0ce2 in __libc_start_main (/usr/lib/libc.so.6+0x23ce2)
    #7 0x556622d8d09d in _start (/usr/local/bin/sway+0x3909d)

0x6170000bb668 is located 488 bytes inside of 672-byte region [0x6170000bb480,0x6170000bb720)
freed by thread T0 here:
    #0 0x7f49aabc8f89 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:66
    #1 0x7f49aa968fc2 in drm_connector_destroy ../subprojects/wlroots/backend/drm/drm.c:829
    #2 0x7f49aaa0cc52 in wlr_output_destroy ../subprojects/wlroots/types/wlr_output.c:357
    #3 0x7f49aa96d2e9 in scan_drm_connectors ../subprojects/wlroots/backend/drm/drm.c:1265
    #4 0x7f49aa961a59 in drm_invalidated ../subprojects/wlroots/backend/drm/backend.c:135
    #5 0x7f49aaa2e1e9 in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
    #6 0x7f49aa98319f in udev_event ../subprojects/wlroots/backend/session/session.c:52
    #7 0x7f49aa2f87f1 in wl_event_loop_dispatch (/usr/lib/libwayland-server.so.0+0xa7f1)

previously allocated by thread T0 here:
    #0 0x7f49aabc95a1 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:95
    #1 0x7f49aa96b7a2 in scan_drm_connectors ../subprojects/wlroots/backend/drm/drm.c:1114
    #2 0x7f49aa961a59 in drm_invalidated ../subprojects/wlroots/backend/drm/backend.c:135
    #3 0x7f49aaa2e1e9 in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
    #4 0x7f49aa98319f in udev_event ../subprojects/wlroots/backend/session/session.c:52
    #5 0x7f49aa2f87f1 in wl_event_loop_dispatch (/usr/lib/libwayland-server.so.0+0xa7f1)

SUMMARY: AddressSanitizer: heap-use-after-free ../subprojects/wlroots/types/wlr_output.c:265 in schedule_done_handle_idle_timer
Shadow bytes around the buggy address:
  0x0c2e8000f670: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2e8000f680: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2e8000f690: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e8000f6a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e8000f6b0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c2e8000f6c0: fd fd fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd
  0x0c2e8000f6d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e8000f6e0: fd fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2e8000f6f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2e8000f700: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2e8000f710: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb

Remove the idle_done idle timer when the output is destroyed
2019-05-30 09:14:46 +03:00
..
data_device data-device: ignore accept for selection offers 2019-04-19 13:24:41 -06:00
seat seat: fallback to v6 if libwayland 1.17 isn't available 2019-04-27 11:26:34 -06:00
tablet_v2 send proximity_out in proximity in for tablet_v2 2019-03-31 20:16:03 +03:00
xdg_shell wlr_xdg_toplevel: store pending fullscreen output 2019-03-27 10:04:10 +02:00
xdg_shell_v6 wlr_xdg_toplevel_v6: store pending fullscreen output 2019-03-27 10:04:10 +02:00
meson.build Remove wlr_wl_shell 2019-04-26 18:23:25 +03:00
wlr_box.c Standardize the wlr_box input paramaters 2018-12-21 13:56:10 -05:00
wlr_buffer.c Remove fmt parameter from wlr_texture_write_pixels 2018-10-15 23:56:56 +02:00
wlr_compositor.c Merge pull request #1116 from emersion/surface-role 2018-07-11 15:27:42 -07:00
wlr_cursor.c Implement the pointer-gestures-unstable-v1 protocol 2019-01-28 22:06:36 +01:00
wlr_data_control_v1.c Update data-control 2019-02-15 11:58:33 +01:00
wlr_export_dmabuf_v1.c output: rename swap_buffers event to precommit 2019-04-23 14:34:30 -06:00
wlr_foreign_toplevel_management_v1.c foreign-toplevel: support fullscreen state and request 2019-04-29 00:00:53 +03:00
wlr_fullscreen_shell_v1.c fullscreen-shell-v1: initial protocol implementation 2019-01-06 12:12:06 +01:00
wlr_gamma_control.c Init the new destroy signals added by #1200 2018-08-27 18:21:36 +02:00
wlr_gamma_control_v1.c gamma-control-v1: add missing destroy handler 2018-09-29 14:30:41 +02:00
wlr_gtk_primary_selection.c primary-selection-v1: copy from gtk-primary-selection 2019-02-13 19:28:25 +01:00
wlr_idle.c idle: enable the compositors to add custom idle timeouts (#1655) 2019-04-17 08:48:43 +03:00
wlr_idle_inhibit_v1.c Init the new destroy signals added by #1200 2018-08-27 18:21:36 +02:00
wlr_input_device.c s/lid_switch/switch_device 2019-03-19 22:45:58 -04:00
wlr_input_inhibitor.c Init the new destroy signals added by #1200 2018-08-27 18:21:36 +02:00
wlr_input_method_v2.c input-method-v2: initialize destroy signal 2018-10-28 12:23:47 +01:00
wlr_keyboard.c Send unique keymap file descriptors 2018-09-18 13:58:36 +05:30
wlr_layer_shell_v1.c layer-shell: add _v1 suffix 2018-09-14 19:32:33 +02:00
wlr_linux_dmabuf_v1.c render: switch wlr_renderer to wlr_drm_format_set 2019-04-01 19:18:04 +03:00
wlr_list.c Revert "ELF Visibility" 2018-02-19 18:01:27 -05:00
wlr_matrix.c Fix typos in comments and strings 2018-05-03 21:59:43 +01:00
wlr_output.c wlr_output: remove idle_done on output destroy 2019-05-30 09:14:46 +03:00
wlr_output_damage.c output-damage: fix segfault after destroy 2019-04-25 11:39:51 +03:00
wlr_output_layout.c output: remove lx, ly 2019-04-13 08:31:30 -06:00
wlr_output_management_v1.c output: remove lx, ly 2019-04-13 08:31:30 -06:00
wlr_pointer.c Implement the pointer-gestures-unstable-v1 protocol 2019-01-28 22:06:36 +01:00
wlr_pointer_constraints_v1.c pointer-constraints: use proper wayland-scanner functions 2018-09-27 10:53:11 +02:00
wlr_pointer_gestures_v1.c Implement the pointer-gestures-unstable-v1 protocol 2019-01-28 22:06:36 +01:00
wlr_presentation_time.c output: add presentation refresh prediction 2018-10-04 22:00:24 +02:00
wlr_primary_selection.c data-device: fix crash when setting the same selection twice 2019-01-31 20:33:48 +01:00
wlr_primary_selection_v1.c primary-selection-v1: copy from gtk-primary-selection 2019-02-13 19:28:25 +01:00
wlr_region.c compositor: redesign how resources are managed 2018-04-26 17:51:06 +01:00
wlr_relative_pointer_v1.c relative-pointer-v1: time is in usec, not msec 2019-01-30 21:25:42 +01:00
wlr_screencopy_v1.c output: rename needs_commit to needs_frame 2019-04-23 14:34:30 -06:00
wlr_screenshooter.c output: rename needs_commit to needs_frame 2019-04-23 14:34:30 -06:00
wlr_server_decoration.c Init the new destroy signals added by #1200 2018-08-27 18:21:36 +02:00
wlr_surface.c subsurface: add map/unmap events 2019-02-17 12:01:15 +01:00
wlr_switch.c s/lid_switch/switch_device 2019-03-19 22:45:58 -04:00
wlr_tablet_pad.c Use wlr_list for paths, and improve inert resource handling 2018-07-14 09:43:17 +02:00
wlr_tablet_tool.c rename wlr_tablet_tool to wlr_tablet 2018-07-14 09:49:58 +02:00
wlr_text_input_v3.c text-input-v3: remove newline in log message 2018-11-26 12:15:34 +01:00
wlr_touch.c Revert "ELF Visibility" 2018-02-19 18:01:27 -05:00
wlr_virtual_keyboard_v1.c Init the new destroy signals added by #1200 2018-08-27 18:21:36 +02:00
wlr_xcursor_manager.c Redesign wlr_texture 2018-03-24 23:48:32 -04:00
wlr_xdg_decoration_v1.c Fix a crash on zxdg_decoration_manager_v1 destroy 2018-10-01 14:45:17 +02:00
wlr_xdg_output_v1.c xdg-output: schedule a wl_output.done event on update 2019-04-27 10:02:21 -06:00