Skip to content

Instantly share code, notes, and snippets.

View gist:ab921bcf10e64b522b591f6ae0a85d75
dogbert@dogbert-VirtualBox:~$ ASAN_OPTIONS=alloc_dealloc_mismatch=0 MVM_JIT_DISABLE=1 LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5 perl6-gdb-m -e 'my $t = ("errors.md.tmpl" xx 1_000).join(" foo "); race for ^9_00 { my $page = $t; $page ~~ s:g[ "foo" ] = "a"; }'
================================================================================================
This is Rakudo running in the debugger, which often allows the user to generate useful back-
traces to debug or report issues in Rakudo, the MoarVM backend or the currently running code.
This Rakudo version is 2021.12 built on MoarVM version 2021.12,
running on linuxmint (20.Ulyana) / linux
Type `bt full` to generate a backtrace if applicable, type `q` to quit or `help` for help.
------------------------------------------------------------------------------------------------
View gist:c1bcbfc6214e1b8f6453f0ad38be3f7a
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
View gist:ee63cc54d9f7bb712e05e0ac464e0b34
...
==================
WARNING: ThreadSanitizer: data race (pid=193074)
Read of size 1 at 0x7f83e48dbc4d by thread T4:
#0 VMArray_gc_mark src/6model/reprs/VMArray.c:90 (libmoar.so+0x36c90f)
#1 MVM_gc_mark_collectable src/gc/collect.c:412 (libmoar.so+0x322dc3)
#2 MVM_gc_root_add_gen2s_to_worklist src/gc/roots.c:350 (libmoar.so+0x31b5de)
#3 MVM_gc_collect src/gc/collect.c:136 (libmoar.so+0x31ecf6)
#4 run_gc src/gc/orchestrate.c:444 (libmoar.so+0x30b7c8)
#5 MVM_gc_enter_from_interrupt src/gc/orchestrate.c:734 (libmoar.so+0x30ceea)
View gist:700a7474ad8da4b2618de3f438ad6fae
dogbert@dogbert-VirtualBox:~/repos/rakudo$ ./rakudo-m --ll-exception -e 'my $t = ("errors.md.tmpl" xx 1_000).join(" foo "); race for ^5_00 { my $page = $t; $page ~~ s:g[ "foo" ] = "a"; }'
Type check failed in binding to parameter '<anon>'; expected List but got Match (Match.new(:orig("err...)
at SETTING::src/core.c/Exception.pm6:62 (/home/dogbert/repos/rakudo/blib/CORE.c.setting.moarvm:throw)
from gen/moar/Metamodel.nqp:60 (/home/dogbert/repos/rakudo/blib/Perl6/Metamodel.moarvm:throw_or_die)
from gen/moar/BOOTSTRAP/v6c.nqp:345 (/home/dogbert/repos/rakudo/blib/Perl6/BOOTSTRAP/v6c.moarvm:)
from gen/moar/BOOTSTRAP/v6c.nqp:4195 (/home/dogbert/repos/rakudo/blib/Perl6/BOOTSTRAP/v6c.moarvm:)
from SETTING::src/core.c/List.pm6:879 (/home/dogbert/repos/rakudo/blib/CORE.c.setting.moarvm:eager)
from -e:1 (<ephemeral file>:)
from SETTING::src/core.c/Rakudo/Internals/HyperRaceSharedImpl.pm6:59 (/home/dogbert/repos/rakudo/blib/CORE.c.setting.moarvm:process-batch)
from SETTING::src/core.c/Rakudo/Internals/Hy
View gist:802e396b7601472c935b1154bf9a6b58
[New LWP 189371]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/home/dogbert/repos/rakudo/nqp/MoarVM/../../install/bin/moar --execname=/home/d'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007ff804065645 in VMArray_gc_mark (tc=0x20010101200, st=0x2000118b968, data=0x20020533118, worklist=0x200240aff00) at src/6model/reprs/VMArray.c:90
90 MVM_gc_worklist_add_no_include_gen2_nocheck(tc, worklist, &slots[i]);
[Current thread is 1 (Thread 0x7ff7f97fa700 (LWP 189372))]
(gdb) bt
#0 0x00007ff804065645 in VMArray_gc_mark (tc=0x20010101200, st=0x2000118b968, data=0x20020533118, worklist=0x200240aff00) at src/6model/reprs/VMArray.c:90
@dogbert17
dogbert17 / gist:b318650ee80576d79f54b22d88bf3b7b
Created Mar 1, 2022
MasterDuke's example causing a SEGV
View gist:b318650ee80576d79f54b22d88bf3b7b
dogbert@dogbert-VirtualBox:~/repos/rakudo$ ASAN_OPTIONS=detect_leaks=false ./rakudo-m -e 'my $t = ("errors.md.tmpl" xx 1_000).join(" foo "); race for ^2_000 { my $page = $t; $page ~~ s:g[ "foo" ] = "a"; }'
AddressSanitizer:DEADLYSIGNAL
=================================================================
==182115==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f0dfce351d1 bp 0x7f0dec8073a0 sp 0x7f0dec807230 T6)
==182115==The signal is caused by a READ memory access.
==182115==Hint: address points to the zero page.
#0 0x7f0dfce351d0 in MVM_gc_write_barrier src/gc/wb.h:10
#1 0x7f0dfce351d0 in MVM_gc_write_barrier src/gc/wb.h:9
#2 0x7f0dfce351d0 in log_param_type src/spesh/log.c:87
#3 0x7f0dfce351d0 in log_parameter src/spesh/log.c:96
View gist:34f979acee7d605b06f3e4038b8ee21f
dogbert@dogbert-VirtualBox:~/repos/rakudo$ gdb install/bin/moar core.moar.1000.b2d97e39327e49f583d2b42f2f4e8691.358445.1643821268000000000000
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@dogbert17
dogbert17 / gist:6b316ea9bbc836f4506657a08197e87f
Created Jan 16, 2022
Mysterious SEGV when running spectest
View gist:6b316ea9bbc836f4506657a08197e87f
dogbert@dogbert-VirtualBox:~/repos/rakudo$ gdb install/bin/moar core.moar.1000.fe02281e586e4bf7a95818aee37796e3.500627.1642345053000000000000
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@dogbert17
dogbert17 / gist:6e3669287a7cfbce0eba1d391550f08f
Created Dec 29, 2021
GC error in t/05-messages/03-errors.t
View gist:6e3669287a7cfbce0eba1d391550f08f
Thread 1 "moar" hit Breakpoint 1, MVM_panic (exitCode=0, messageFormat=0x0) at src/core/exceptions.c:840
840 MVM_NO_RETURN void MVM_panic(MVMint32 exitCode, const char *messageFormat, ...) {
(gdb) bt
#0 MVM_panic (exitCode=0, messageFormat=0x0) at src/core/exceptions.c:840
#1 0x00007ffff7869e72 in MVM_gc_root_add_frame_registers_to_worklist (tc=0x55555555ae30, worklist=0x555557a4e5e0, frame=0x7ffff72272d8) at src/gc/roots.c:456
#2 0x00007ffff7869cc3 in MVM_gc_root_add_frame_roots_to_worklist (tc=0x55555555ae30, worklist=0x555557a4e5e0, cur_frame=0x7ffff72272d8) at src/gc/roots.c:429
#3 0x00007ffff78278fd in mark (tc=0x55555555ae30, from_record=0x7ffff7228240, worklist=0x555557a4e5e0, snapshot=0x0) at src/core/callstack.c:915
#4 0x00007ffff78297c8 in MVM_callstack_mark_current_thread (tc=0x55555555ae30, worklist=0x555557a4e5e0, snapshot=0x0) at src/core/callstack.c:1046
#5 0x00007ffff7865e9a in MVM_gc_root_add_tc_roots_to_worklist (tc=0x55555555ae30, worklist=0x555557a4e5e0, snapshot=0x0) at src/gc/roots
@dogbert17
dogbert17 / gist:9bf6d86d03b424c300829bad6b3dafee
Created Dec 2, 2021
GC error in t/spec/S32-str/indent.rakudo.moar
View gist:9bf6d86d03b424c300829bad6b3dafee
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff720e700 (LWP 125092)]
1..63
ok 1 - Simple .indent(1)
ok 2 - Simple .indent(2)
ok 3 - Simple .indent(3)
ok 4 - Simple .indent(4)
ok 5 - New indent goes after existing - .indent(1)
ok 6 - New indent goes after existing - .indent(2)