Skip to content

Instantly share code, notes, and snippets.

Thread 1 "moar" received signal SIGSEGV, Segmentation fault.
0x00007ffff77b69e3 in MVM_interp_run (tc=0x55555555ae40, initial_invoke=0x7ffff7985410 <toplevel_initial_invoke>, invoke_data=0x5555555ec570, outer_runloop=0x0) at src/core/interp.c:6400
6400 found = GET_LEX(cur_op, 2, f);
(gdb) p MVM_dump_bytecode(tc)
00000 null loc_0_obj
00001 null loc_1_obj
00002 null loc_17_obj
00003 null loc_19_obj
00004 getcode loc_15_obj, Frame_12208
00005 takeclosure loc_15_obj, loc_15_obj
Specialization of '' (cuid: 171)
Before:
Spesh of '' (cuid: 171, file: NQP::src/core/dispatchers.nqp:568)
BB 0 (0x7ff56b235e70):
line: 568 (pc 0)
Instructions:
no_op
Successors: 1
Starting program: /home/dilbert/repos/rakudo/install/bin/moar --execname=/home/dilbert/repos/rakudo/rakudo-gdb-m --libpath=/home/dilbert/repos/rakudo --libpath=/home/dilbert/repos/rakudo/blib --libpath=/home/dilbert/repos/rakudo/install/share/nqp/lib /home/dilbert/repos/rakudo/perl6.moarvm -e await\ \(\^5\).map\(\{start\ \{\ print\ qqx\{echo\ \$_\}\ \}\ \}\)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff71d0640 (LWP 44155)]
[New Thread 0x7ffff3693640 (LWP 44164)]
[New Thread 0x7ffff2e90640 (LWP 44165)]
[New Thread 0x7ffff268d640 (LWP 44166)]
[New Thread 0x7ffff1e8a640 (LWP 44167)]
[New Thread 0x7ffff1687640 (LWP 44168)]
[New Thread 0x7ffff0e84640 (LWP 44169)]
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.
------------------------------------------------------------------------------------------------
@dogbert17
dogbert17 / gist:c1bcbfc6214e1b8f6453f0ad38be3f7a
Created March 3, 2022 16:08
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
...
==================
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)
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
[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 March 1, 2022 11:12
MasterDuke's example causing a SEGV
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
@dogbert17
dogbert17 / gist:34f979acee7d605b06f3e4038b8ee21f
Created February 3, 2022 17:43
SEGV in t/02-rakudo/repl.t
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: