Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Two threads accessing array
dogbert@dogbert-VirtualBox:~$ MVM_JIT_DISABLE=1 LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5 perl6 -e 'my $t = ("errors.md.tmpl" xx 1_000).join(" foo "); race for ^9_00 { my $page = $t; $page ~~ s:g[ "foo" ] = "a"; }'
=================================================================
==218230==ERROR: AddressSanitizer: attempting double-free on 0x625001830900 in thread T2:
#0 0x7efe4160dffe in __interceptor_realloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe)
#1 0x7efe4046411d in MVM_realloc src/core/alloc.h:20
#2 0x7efe4046411d in set_size_internal src/6model/reprs/VMArray.c:372
#3 0x7efe4046411d in MVM_VMArray_push src/6model/reprs/VMArray.c:486
#4 0x7efe4034cc1c in MVM_interp_run src/core/interp.c:2095
#5 0x7efe40392eb9 in start_thread src/core/threads.c:101
#6 0x7efe3f9cc608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477
#7 0x7efe3fb16162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162)
0x625001830900 is located 0 bytes inside of 8192-byte region [0x625001830900,0x625001832900)
freed by thread T8 here:
#0 0x7efe4160dffe in __interceptor_realloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe)
#1 0x7efe4046411d in MVM_realloc src/core/alloc.h:20
#2 0x7efe4046411d in set_size_internal src/6model/reprs/VMArray.c:372
#3 0x7efe4046411d in MVM_VMArray_push src/6model/reprs/VMArray.c:486
#4 0x7efe4034cc1c in MVM_interp_run src/core/interp.c:2095
#5 0x7efe40392eb9 in start_thread src/core/threads.c:101
#6 0x7efe3f9cc608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477
previously allocated by thread T2 here:
#0 0x7efe4160dffe in __interceptor_realloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe)
#1 0x7efe4046411d in MVM_realloc src/core/alloc.h:20
#2 0x7efe4046411d in set_size_internal src/6model/reprs/VMArray.c:372
#3 0x7efe4046411d in MVM_VMArray_push src/6model/reprs/VMArray.c:486
#4 0x7efe4034cc1c in MVM_interp_run src/core/interp.c:2095
#5 0x7efe40392eb9 in start_thread src/core/threads.c:101
#6 0x7efe3f9cc608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477
Thread T2 created by T0 here:
#0 0x7efe4153a805 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a805)
#1 0x7efe40787d21 in uv_thread_create_ex (//home/dogbert/.rakudobrew/versions/moar-2021.12/install/lib/libmoar.so+0xb88d21)
Thread T8 created by T3 here:
#0 0x7efe4153a805 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a805)
#1 0x7efe40787d21 in uv_thread_create_ex (//home/dogbert/.rakudobrew/versions/moar-2021.12/install/lib/libmoar.so+0xb88d21)
Thread T3 created by T0 here:
#0 0x7efe4153a805 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a805)
#1 0x7efe40787d21 in uv_thread_create_ex (//home/dogbert/.rakudobrew/versions/moar-2021.12/install/lib/libmoar.so+0xb88d21)
SUMMARY: AddressSanitizer: double-free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe) in __interceptor_realloc
==218230==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment