Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created July 28, 2017 22:04
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 dogbert17/3cc123e33a87a66984ae8752eee4fb3c to your computer and use it in GitHub Desktop.
Save dogbert17/3cc123e33a87a66984ae8752eee4fb3c to your computer and use it in GitHub Desktop.
ASAN complains
dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6 -v
This is Rakudo version 2017.07-86-gf083cfc6a built on MoarVM version 2017.07-253-g82c282ef
implementing Perl 6.c.
dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6 t/spec/S17-lowlevel/thread-start-join-stress.t
1..1
=================================================================
==9835== ERROR: AddressSanitizer: heap-use-after-free on address 0xb4f7f894 at pc 0xb581dc73 bp 0xb1977a88 sp 0xb1977a7c
READ of size 4 at 0xb4f7f894 thread T1
#0 0xb581dc72 in bind_pos /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprs/VMArray.c:380
#1 0xb58075e9 in MVM_repr_bind_pos_o /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprconv.c:228
#2 0xb598fc03 in MVM_spesh_stats_cleanup /home/dogbert/repos/rakudo/nqp/MoarVM/src/spesh/stats.c:446
#3 0xb598a6c8 in worker /home/dogbert/repos/rakudo/nqp/MoarVM/src/spesh/worker.c:13
#4 0xb5833c5b in invoke_handler /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprs/MVMCFunction.c:9
#5 0xb574a7d6 in thread_initial_invoke /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/threads.c:57
#6 0xb5682d65 in MVM_interp_run /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/interp.c:88
#7 0xb574a9b9 in start_thread /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/threads.c:81
#8 0xb5a67916 in uv__thread_start /home/dogbert/repos/rakudo/nqp/MoarVM/3rdparty/libuv/src/unix/thread.c:49
#9 0xb61d89c6 (/usr/lib/i386-linux-gnu/libasan.so.0+0x1a9c6)
#10 0xb61c82ac (/usr/lib/i386-linux-gnu/libasan.so.0+0xa2ac)
#11 0xb535ef71 in start_thread (/lib/i386-linux-gnu/libpthread.so.0+0x6f71)
#12 0xb54623ed (/lib/i386-linux-gnu/libc.so.6+0xee3ed)
0xb4f7f894 is located 20 bytes inside of 472-byte region [0xb4f7f880,0xb4f7fa58)
freed by thread T0 here:
#0 0xb61d4774 (/usr/lib/i386-linux-gnu/libasan.so.0+0x16774)
#1 0xb57130f6 in MVM_free /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/alloc.h:29
#2 0xb5713cd1 in MVM_tc_destroy /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/threadcontext.c:109
#3 0xb579b8fb in finish_gc /home/dogbert/repos/rakudo/nqp/MoarVM/src/gc/orchestrate.c:210
#4 0xb579c288 in run_gc /home/dogbert/repos/rakudo/nqp/MoarVM/src/gc/orchestrate.c:358
#5 0xb579ce2a in MVM_gc_enter_from_allocator /home/dogbert/repos/rakudo/nqp/MoarVM/src/gc/orchestrate.c:466
#6 0xb574b3be in try_join /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/threads.c:186
#7 0xb574b4b1 in MVM_thread_join /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/threads.c:192
#8 0xb56dff1d in MVM_interp_run /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/interp.c:3690
#9 0xb5a46d56 in MVM_vm_run_file /home/dogbert/repos/rakudo/nqp/MoarVM/src/moar.c:349
#10 0x8049461 in main /home/dogbert/repos/rakudo/nqp/MoarVM/src/main.c:253
#11 0xb538daf2 (/lib/i386-linux-gnu/libc.so.6+0x19af2)
previously allocated by thread T0 here:
#0 0xb61d4905 (/usr/lib/i386-linux-gnu/libasan.so.0+0x16905)
#1 0xb57130b0 in MVM_calloc /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/alloc.h:11
#2 0xb5713124 in MVM_tc_create /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/threadcontext.c:8
#3 0xb574a4b9 in MVM_thread_new /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/threads.c:29
#4 0xb56dfd76 in MVM_interp_run /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/interp.c:3685
#5 0xb5a46d56 in MVM_vm_run_file /home/dogbert/repos/rakudo/nqp/MoarVM/src/moar.c:349
#6 0x8049461 in main /home/dogbert/repos/rakudo/nqp/MoarVM/src/main.c:253
#7 0xb538daf2 (/lib/i386-linux-gnu/libc.so.6+0x19af2)
Thread T1 created by T0 here:
#0 0xb61c81d0 (/usr/lib/i386-linux-gnu/libasan.so.0+0xa1d0)
#1 0xb5a67970 in uv_thread_create /home/dogbert/repos/rakudo/nqp/MoarVM/3rdparty/libuv/src/unix/thread.c:66
#2 0xb598adfc in MVM_spesh_worker_setup /home/dogbert/repos/rakudo/nqp/MoarVM/src/spesh/worker.c:149
#3 0xb5a4653b in MVM_vm_create_instance /home/dogbert/repos/rakudo/nqp/MoarVM/src/moar.c:294
#4 0x8049356 in main /home/dogbert/repos/rakudo/nqp/MoarVM/src/main.c:236
#5 0xb538daf2 (/lib/i386-linux-gnu/libc.so.6+0x19af2)
SUMMARY: AddressSanitizer: heap-use-after-free /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprs/VMArray.c:380 bind_pos
Shadow bytes around the buggy address:
0x369efec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x369efed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x369efee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x369efef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x369eff00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x369eff10: fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd
0x369eff20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x369eff30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x369eff40: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa
0x369eff50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x369eff60: 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
Heap righ redzone: fb
Freed Heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
ASan internal: fe
==9835== ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment