mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-29 16:05:59 +01:00
e035f2b9c4
[1] and [2] have introduced new wl_array usage in wlroots, but contains a mistake: wl_array_for_each iterates over pointers to the wl_array entries, not over entries themselves. Fix all wl_array_for_each call sites. Name the variables "ptr" to avoid confusion. Found via ASan: ==148752==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x602000214111 in thread T0 #0 0x7f6ff2235f19 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x7f6ff1c04004 in wlr_tablet_destroy ../subprojects/wlroots/types/wlr_tablet_tool.c:24 #2 0x7f6ff1b8463c in wlr_input_device_destroy ../subprojects/wlroots/types/wlr_input_device.c:51 #3 0x7f6ff1ab9941 in backend_destroy ../subprojects/wlroots/backend/wayland/backend.c:306 #4 0x7f6ff1a68323 in wlr_backend_destroy ../subprojects/wlroots/backend/backend.c:57 #5 0x7f6ff1ab36b4 in multi_backend_destroy ../subprojects/wlroots/backend/multi/backend.c:57 #6 0x7f6ff1ab417c in handle_display_destroy ../subprojects/wlroots/backend/multi/backend.c:124 #7 0x7f6ff106184e in wl_display_destroy (/usr/lib/libwayland-server.so.0+0x884e) #8 0x55cd1a77c9e5 in server_fini ../sway/server.c:218 #9 0x55cd1a77893f in main ../sway/main.c:400 #10 0x7f6ff04bdb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #11 0x55cd1a73a7ad in _start (/home/simon/src/sway/build/sway/sway+0x33a7ad) 0x602000214111 is located 1 bytes inside of 16-byte region [0x602000214110,0x602000214120) freed by thread T0 here: #0 0x7f6ff2235f19 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x7f6ff1c04004 in wlr_tablet_destroy ../subprojects/wlroots/types/wlr_tablet_tool.c:24 #2 0x7f6ff1b8463c in wlr_input_device_destroy ../subprojects/wlroots/types/wlr_input_device.c:51 #3 0x7f6ff1ab9941 in backend_destroy ../subprojects/wlroots/backend/wayland/backend.c:306 #4 0x7f6ff1a68323 in wlr_backend_destroy ../subprojects/wlroots/backend/backend.c:57 #5 0x7f6ff1ab36b4 in multi_backend_destroy ../subprojects/wlroots/backend/multi/backend.c:57 #6 0x7f6ff1ab417c in handle_display_destroy ../subprojects/wlroots/backend/multi/backend.c:124 #7 0x7f6ff106184e in wl_display_destroy (/usr/lib/libwayland-server.so.0+0x884e) previously allocated by thread T0 here: #0 0x7f6ff2236279 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x7f6ff1066d03 in wl_array_add (/usr/lib/libwayland-server.so.0+0xdd03) [1]: https://github.com/swaywm/wlroots/pull/3002 [2]: https://github.com/swaywm/wlroots/pull/3004 |
||
---|---|---|
.. | ||
data_device | ||
seat | ||
tablet_v2 | ||
xdg_shell | ||
meson.build | ||
wlr_buffer.c | ||
wlr_compositor.c | ||
wlr_cursor.c | ||
wlr_data_control_v1.c | ||
wlr_drm.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_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.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_surface.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 |