hikari wayland compositor (https://hikari.acmelabs.space)
#1`sigsegv` when client crash before responding to events.
==3238==ERROR: AddressSanitizer: heap-use-after-free on address 0x6110000e8728 at pc 0x000000317c7d bp 0x7fffffffd820 sp 0x7fffffffd818
READ of size 8 at 0x6110000e8728 thread T0
#0 0x317c7c in render_layer /usr/home/xanderio/Sources/hikari/src/output.c:239:16
#1 0x31716a in render_output /usr/home/xanderio/Sources/hikari/src/output.c:323:3
#2 0x3147b7 in damage_frame_handler /usr/home/xanderio/Sources/hikari/src/output.c:378:5
#3 0x8004222db (/usr/local/lib/libwlroots.so.5+0x952db)
#4 0x8004222db (/usr/local/lib/libwlroots.so.5+0x952db)
#5 0x8012af1ef in ffi_call_unix64 (/usr/local/lib/libffi.so.6+0x61ef)
#6 0x8012ae891 in ffi_call (/usr/local/lib/libffi.so.6+0x5891)
#7 0x800d67fa6 (/usr/local/lib/libwayland-client.so.0+0xbfa6)
#8 0x800d66136 (/usr/local/lib/libwayland-client.so.0+0xa136)
#9 0x800d65b06 in wl_display_dispatch_queue_pending (/usr/local/lib/libwayland-client.so.0+0x9b06)
#10 0x800d6544a in wl_display_dispatch_queue (/usr/local/lib/libwayland-client.so.0+0x944a)
#11 0x8003eb385 (/usr/local/lib/libwlroots.so.5+0x5e385)
#12 0x80089561b in wl_event_loop_dispatch (/usr/local/lib/libwayland-server.so.0+0xe61b)
#13 0x80089295c in wl_display_run (/usr/local/lib/libwayland-server.so.0+0xb95c)
#14 0x31b372 in hikari_server_start /usr/home/xanderio/Sources/hikari/src/server.c:838:3
#15 0x30ce15 in main /usr/home/xanderio/Sources/hikari/main.c:101:3
#16 0x2540ff in _start /usr/src/lib/csu/amd64/crt1.c:76:7
0x6110000e8728 is located 40 bytes inside of 200-byte region [0x6110000e8700,0x6110000e87c8)
freed by thread T0 here:
#0 0x2ab30d in free /wrkdirs/usr/ports/devel/llvm90/work/compiler-rt-9.0.1.src/lib/asan/asan_malloc_linux.cc:123:3
#1 0x310304 in hikari_free /usr/home/xanderio/Sources/hikari/src/memory.c:20:10
#2 0x30495f in destroy_handler /usr/home/xanderio/Sources/hikari/src/layer_shell.c:398:3
#3 0x8004222db (/usr/local/lib/libwlroots.so.5+0x952db)
#4 0x80041bf9d (/usr/local/lib/libwlroots.so.5+0x8ef9d)
#5 0x80089209a (/usr/local/lib/libwayland-server.so.0+0xb09a)
#6 0x800898e4c (/usr/local/lib/libwayland-server.so.0+0x11e4c)
#7 0x8008923d9 in wl_client_destroy (/usr/local/lib/libwayland-server.so.0+0xb3d9)
#8 0x800891c5c (/usr/local/lib/libwayland-server.so.0+0xac5c)
#9 0x80089561b in wl_event_loop_dispatch (/usr/local/lib/libwayland-server.so.0+0xe61b)
#10 0x80089295c in wl_display_run (/usr/local/lib/libwayland-server.so.0+0xb95c)
#11 0x31b372 in hikari_server_start /usr/home/xanderio/Sources/hikari/src/server.c:838:3
#12 0x30ce15 in main /usr/home/xanderio/Sources/hikari/main.c:101:3
#13 0x2540ff in _start /usr/src/lib/csu/amd64/crt1.c:76:7
#14 0x80036e007 (<unknown module>)
previously allocated by thread T0 here:
#0 0x2ab47d in malloc /wrkdirs/usr/ports/devel/llvm90/work/compiler-rt-9.0.1.src/lib/asan/asan_malloc_linux.cc:145:3
#1 0x3102b4 in hikari_malloc /usr/home/xanderio/Sources/hikari/src/memory.c:8:10
#2 0x322e71 in new_layer_shell_surface_handler /usr/home/xanderio/Sources/hikari/src/server.c:631:32
#3 0x8004222db (/usr/local/lib/libwlroots.so.5+0x952db)
#4 0x80040e991 (/usr/local/lib/libwlroots.so.5+0x81991)
#5 0x80041d6bc (/usr/local/lib/libwlroots.so.5+0x906bc)
#6 0x80041d0b7 (/usr/local/lib/libwlroots.so.5+0x900b7)
#7 0x8012af1ef in ffi_call_unix64 (/usr/local/lib/libffi.so.6+0x61ef)
SUMMARY: AddressSanitizer: heap-use-after-free /usr/home/xanderio/Sources/hikari/src/output.c:239:16 in render_layer
Shadow bytes around the buggy address:
0x4c220001d090: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x4c220001d0a0: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
0x4c220001d0b0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
0x4c220001d0c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x4c220001d0d0: fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x4c220001d0e0: fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd
0x4c220001d0f0: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa
0x4c220001d100: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
0x4c220001d110: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x4c220001d120: fd fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x4c220001d130: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
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
Shadow gap: cc
==3238==ABORTING