Skip to content

Instantly share code, notes, and snippets.

@samcv
Last active June 30, 2018 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samcv/4d12bb5e80a6d509a3b4654dd6efb541 to your computer and use it in GitHub Desktop.
Save samcv/4d12bb5e80a6d509a3b4654dd6efb541 to your computer and use it in GitHub Desktop.
t/concurrency/01-thread.t asan error
===( 10599;18 228/? 0/? 0/? 0/? 0/? 0/? 9/24 0/? 1/12 )=====================================================================
==9196==ERROR: AddressSanitizer: heap-use-after-free on address 0x618000285a88 at pc 0x7f1559cfe31c bp 0x7f15554fbea0 sp 0x7f15554fbe98
WRITE of size 8 at 0x618000285a88 thread T1
#0 0x7f1559cfe31b in save_or_free_sim_stack /home/samantha/git/MoarVM/src/spesh/stats.c:508:37
#1 0x7f1559cfe31b in MVM_spesh_stats_update /home/samantha/git/MoarVM/src/spesh/stats.c:649
#2 0x7f1559cf632d in worker /home/samantha/git/MoarVM/src/spesh/worker.c:16:5
#3 0x7f1559bd3705 in invoke_handler /home/samantha/git/MoarVM/src/6model/reprs/MVMCFunction.c:9:9
#4 0x7f1559b0b7cd in thread_initial_invoke /home/samantha/git/MoarVM/src/core/threads.c:59:5
#5 0x7f1559abe3e9 in MVM_interp_run /home/samantha/git/MoarVM/src/core/interp.c:92:5
#6 0x7f1559b0aa43 in start_thread /home/samantha/git/MoarVM/src/core/threads.c:87:5
#7 0x7f1558d8bac5 (/lib64/libpthread.so.0+0x7ac5)
#8 0x7f15581408be in clone (/lib64/libc.so.6+0x1098be)
0x618000285a88 is located 520 bytes inside of 792-byte region [0x618000285880,0x618000285b98)
freed by thread T0 here:
#0 0x4bc9e2 in __interceptor_free /var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.0/work/compiler-rt-6.0.0.src/lib/asan/asan_malloc_linux.cc:68:3
#1 0x7f1559adf4f3 in MVM_free /home/samantha/git/MoarVM/src/core/alloc.h:40:5
#2 0x7f1559adf4f3 in MVM_tc_destroy /home/samantha/git/MoarVM/src/core/threadcontext.c:113
#3 0x7f1559b65003 in run_gc /home/samantha/git/MoarVM/src/gc/orchestrate.c:220:13
#4 0x7f1559b63db2 in MVM_gc_enter_from_allocator /home/samantha/git/MoarVM/src/gc/orchestrate.c:525:9
#5 0x7f1559b0ad32 in try_join /home/samantha/git/MoarVM/src/core/threads.c:192:5
#6 0x7f1559b0ad32 in MVM_thread_join /home/samantha/git/MoarVM/src/core/threads.c:198
#7 0x7f1559acacfe in MVM_interp_run /home/samantha/git/MoarVM/src/core/interp.c:3669:17
#8 0x7f1559dbe036 in MVM_vm_run_file /home/samantha/git/MoarVM/src/moar.c:412:5
#9 0x4eaff1 in main /home/samantha/git/MoarVM/src/main.c:299:10
#10 0x7f155805810c in __libc_start_main (/lib64/libc.so.6+0x2110c)
previously allocated by thread T0 here:
#0 0x4bcf0a in calloc /var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.0/work/compiler-rt-6.0.0.src/lib/asan/asan_malloc_linux.cc:97:3
#1 0x7f1559aded82 in MVM_calloc /home/samantha/git/MoarVM/src/core/alloc.h:11:17
#2 0x7f1559aded82 in MVM_tc_create /home/samantha/git/MoarVM/src/core/threadcontext.c:8
#3 0x7f1559b09cc6 in MVM_thread_new /home/samantha/git/MoarVM/src/core/threads.c:29:5
#4 0x7f1559acae12 in MVM_interp_run /home/samantha/git/MoarVM/src/core/interp.c:3664:40
#5 0x7f1559dbe036 in MVM_vm_run_file /home/samantha/git/MoarVM/src/moar.c:412:5
#6 0x4eaff1 in main /home/samantha/git/MoarVM/src/main.c:299:10
#7 0x7f155805810c in __libc_start_main (/lib64/libc.so.6+0x2110c)
Thread T1 created by T0 here:
#0 0x4a5cbd in __interceptor_pthread_create /var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.0/work/compiler-rt-6.0.0.src/lib/asan/asan_interceptors.cc:204:3
#1 0x7f1559e4abcc in uv_thread_create (//home/samantha/perl6/lib/libmoar.so+0xc9cbcc)
#2 0x7f1559b0a69c in MVM_thread_run /home/samantha/git/MoarVM/src/core/threads.c:162:18
#3 0x7f1559cf5ac4 in MVM_spesh_worker_setup /home/samantha/git/MoarVM/src/spesh/worker.c:156:9
#4 0x7f1559dbce16 in MVM_vm_create_instance /home/samantha/git/MoarVM/src/moar.c:357:5
#5 0x4eaec6 in main /home/samantha/git/MoarVM/src/main.c:274:18
#6 0x7f155805810c in __libc_start_main (/lib64/libc.so.6+0x2110c)
SUMMARY: AddressSanitizer: heap-use-after-free /home/samantha/git/MoarVM/src/spesh/stats.c:508:37 in save_or_free_sim_stack
Shadow bytes around the buggy address:
0x0c3080048b00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c3080048b10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3080048b20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3080048b30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3080048b40: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c3080048b50: fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3080048b60: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3080048b70: fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c3080048b80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c3080048b90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3080048ba0: 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
==9196==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment