Crash in g_array_copy
The following code results in crash (ignore the leak):
g_array_copy (g_array_sized_new (FALSE, FALSE, sizeof (int), 1));
asan output:
# random seed: R02S993d818550a35ef6df03af132cbfed32
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3995318==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f3bf25c0b8f bp 0x7fff33f0f0f0 sp 0x7fff33f0e868 T0)
==3995318==The signal is caused by a WRITE memory access.
==3995318==Hint: address points to the zero page.
#0 0x7f3bf25c0b8e in memcpy (/lib/x86_64-linux-gnu/libc.so.6+0xa3b8e)
#1 0x7f3bf2ac6e45 (/lib/x86_64-linux-gnu/libasan.so.5+0x96e45)
#2 0x7f3bf26fd612 in memcpy /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34
#3 0x7f3bf26fd612 in g_array_copy ../../../glib/garray.c:1123
#4 0x55fe3c20eae2 in main /home/sadiq/games/game/yes-oe/test.c:141
#5 0x7f3bf2543bba in __libc_start_main ../csu/libc-start.c:308
#6 0x55fe3c20c319 in _start (/home/sadiq/games/game/yes-oe/test+0x3319)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0xa3b8e) in memcpy
==3995318==ABORTING