Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created March 3, 2022 16:08
Show Gist options
  • Save dogbert17/c1bcbfc6214e1b8f6453f0ad38be3f7a to your computer and use it in GitHub Desktop.
Save dogbert17/c1bcbfc6214e1b8f6453f0ad38be3f7a to your computer and use it in GitHub Desktop.
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