Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Last active February 24, 2017 11:51
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/9aadb12cb065a0e5761f1ddab001eb1b to your computer and use it in GitHub Desktop.
Save dogbert17/9aadb12cb065a0e5761f1ddab001eb1b to your computer and use it in GitHub Desktop.
IOninja finds another SEGV
#gdb
ogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6-gdb-m -I /home/dogbert/repos/rakudo/install/share/perl6/site/lib mapper.p6
================================================================================================
This is Rakudo Perl 6 running in the GNU 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 2017.02.55.g.320.c.2.fb.46 built on MoarVM version 2017.02.7.g.3.d.859008,
running on ubuntu (14.04.3.LTS.Trusty.Tahr) / linux (3.19.0.32.generic)
Type `bt full` to generate a backtrace if applicable, type `q` to quit or `help` for help.
------------------------------------------------------------------------------------------------
Reading symbols from /home/dogbert/repos/rakudo/install/bin/moar...done.
Starting program: /home/dogbert/repos/rakudo/install/bin/moar --execname=./perl6-gdb-m --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=. /home/dogbert/repos/rakudo/perl6.moarvm --nqp-lib=blib -I /home/dogbert/repos/rakudo/install/share/perl6/site/lib mapper.p6
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
p6recont_ro (tc=0xb5803c80, cur_op=0xab680fea "\004") at src/vm/moar/ops/perl6_ops.c:268
268 if (!MVM_is_null(tc, desc) && ((Rakudo_ContainerDescriptor *)desc)->rw) {
(gdb) bt
#0 p6recont_ro (tc=0xb5803c80, cur_op=0xab680fea "\004") at src/vm/moar/ops/perl6_ops.c:268
#1 0xb5f367b5 in MVM_interp_run (tc=tc@entry=0xb5803c80, initial_invoke=initial_invoke@entry=0xb6287c30 <toplevel_initial_invoke>, invoke_data=0x1) at src/core/interp.c:5633
#2 0xb6289e33 in MVM_vm_run_file (instance=0xb5a03780, filename=0xbffff269 "/home/dogbert/repos/rakudo/perl6.moarvm") at src/moar.c:309
#3 0x080490e2 in main (argc=10, argv=0xbfffefb4) at src/main.c:201
(gdb) f 0
#0 p6recont_ro (tc=0xb5803c80, cur_op=0xab680fea "\004") at src/vm/moar/ops/perl6_ops.c:268
268 if (!MVM_is_null(tc, desc) && ((Rakudo_ContainerDescriptor *)desc)->rw) {
(gdb) p MVM_dump_backtrace(tc)
at <unknown>:1 (./CORE.setting.moarvm:return)
from <unknown>:1 (./CORE.setting.moarvm:return)
from SETTING::src/core/Any-iterable-methods.pm:1506 (./CORE.setting.moarvm:pull-one)
from SETTING::src/core/Any-iterable-methods.pm:362 (./CORE.setting.moarvm:pull-one)
from SETTING::src/core/Any-iterable-methods.pm:362 (./CORE.setting.moarvm:pull-one)
from SETTING::src/core/Any-iterable-methods.pm:362 (./CORE.setting.moarvm:pull-one)
from SETTING::src/core/Rakudo/Internals.pm:1717 (./CORE.setting.moarvm:pull-one)
from SETTING::src/core/Iterator.pm:55 (./CORE.setting.moarvm:push-all)
from SETTING::src/core/Rakudo/Internals.pm:1766 (./CORE.setting.moarvm:coremap)
from SETTING::src/core/Rakudo/Internals.pm:1685 (./CORE.setting.moarvm:coremap)
from SETTING::src/core/metaops.pm:538 (./CORE.setting.moarvm:deepmap)
from SETTING::src/core/metaops.pm:536 (./CORE.setting.moarvm:deepmap)
from <unknown>:1 (./CORE.setting.moarvm:HYPER)
from SETTING::src/core/metaops.pm:419 (./CORE.setting.moarvm:HYPER)
from <unknown>:1 (./CORE.setting.moarvm:dispatch:<hyper>)
from mapper.p6:22 (<ephemeral file>:methods)
from mapper.p6:6 (<ephemeral file>:<unit>)
from mapper.p6:1 (<ephemeral file>:<unit-outer>)
from gen/moar/stage2/NQPHLL.nqp:1587 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:eval)
from gen/moar/stage2/NQPHLL.nqp:1790 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:evalfiles)
from gen/moar/stage2/NQPHLL.nqp:1684 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
from src/Perl6/Compiler.nqp:42 (./blib/Perl6/Compiler.moarvm:command_eval)
from gen/moar/stage2/NQPHLL.nqp:1658 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_line)
from gen/moar/main.nqp:47 (/home/dogbert/repos/rakudo/perl6.moarvm:MAIN)
from gen/moar/main.nqp:38 (/home/dogbert/repos/rakudo/perl6.moarvm:<mainline>)
from <unknown>:1 (/home/dogbert/repos/rakudo/perl6.moarvm:<main>)
from <unknown>:1 (/home/dogbert/repos/rakudo/perl6.moarvm:<entry>)
$1 = void
(gdb) bt full
#0 p6recont_ro (tc=0xb5803c80, cur_op=0xab680fea "\004") at src/vm/moar/ops/perl6_ops.c:268
desc = 0x1
check = 0xb3e3edd0
#1 0xb5f367b5 in MVM_interp_run (tc=tc@entry=0xb5803c80, initial_invoke=initial_invoke@entry=0xb6287c30 <toplevel_initial_invoke>, invoke_data=0x1) at src/core/interp.c:5633
record = 0xaea48890
op = 1028
LABELS = {0xb5f0f19a <MVM_interp_run+1514>, 0xb5f36975 <MVM_interp_run+163269>, 0xb5f0fc86 <MVM_interp_run+4310>, 0xb5f0fc86 <MVM_interp_run+4310>, 0xb5f2470d <MVM_interp_run+88925>,
0xb5f247b6 <MVM_interp_run+89094>, 0xb5f152d2 <MVM_interp_run+26402>, 0xb5f15375 <MVM_interp_run+26565>, 0xb5f15469 <MVM_interp_run+26809>, 0xb5f1553e <MVM_interp_run+27022>,
0xb5f361e0 <MVM_interp_run+161328>, 0xb5f362b9 <MVM_interp_run+161545>, 0xb5f3638f <MVM_interp_run+161759>, 0xb5f36465 <MVM_interp_run+161973>, 0xb5f35bc8 <MVM_interp_run+159768>,
0xb5f35c9d <MVM_interp_run+159981>, 0xb5f24562 <MVM_interp_run+88498>, 0xb5f2463c <MVM_interp_run+88716>, 0xb5f16fa1 <MVM_interp_run+33777>, 0xb5f17241 <MVM_interp_run+34449>,
0xb5f1707f <MVM_interp_run+33999>, 0xb5f17168 <MVM_interp_run+34232>, 0xb5f17323 <MVM_interp_run+34675>, 0xb5f17408 <MVM_interp_run+34904>, 0xb5f17b10 <MVM_interp_run+36704>,
0xb5f17bef <MVM_interp_run+36927>, 0xb5f174a6 <MVM_interp_run+35062>, 0xb5f176f7 <MVM_interp_run+35655>, 0xb5f17598 <MVM_interp_run+35304>, 0xb5f177b6 <MVM_interp_run+35846>,
0xb5f240de <MVM_interp_run+87342>, 0xb5f241b8 <MVM_interp_run+87560>, 0xb5f49d4d <MVM_interp_run+242077>, 0xb5f49e5d <MVM_interp_run+242349>, 0xb5f2513a <MVM_interp_run+91530>,
0xb5f254a4 <MVM_interp_run+92404>, 0xb5f25254 <MVM_interp_run+91812>, 0xb5f256e1 <MVM_interp_run+92977>, 0xb5f1cf01 <MVM_interp_run+58193>, 0xb5f36824 <MVM_interp_run+162932>,
0xb5f178c2 <MVM_interp_run+36114>, 0xb5f17a07 <MVM_interp_run+36439>, 0xb5f24e47 <MVM_interp_run+90775>, 0xb5f24f48 <MVM_interp_run+91032>, 0xb5f25041 <MVM_interp_run+91281>,
0xb5f0fde6 <MVM_interp_run+4662>, 0xb5f0fde6 <MVM_interp_run+4662>, 0xb5f2b418 <MVM_interp_run+116840>, 0xb5f247d0 <MVM_interp_run+89120>, 0xb5f2490f <MVM_interp_run+89439>,
0xb5f49921 <MVM_interp_run+241009>, 0xb5f49b1d <MVM_interp_run+241517>, 0xb5f49bd9 <MVM_interp_run+241705>, 0xb5f49c96 <MVM_interp_run+241894>, 0xb5f3b970 <MVM_interp_run+183744>,
0xb5f53dde <MVM_interp_run+283182>, 0xb5f519d6 <MVM_interp_run+273958>, 0xb5f53e55 <MVM_interp_run+283301>, 0xb5f3ba37 <MVM_interp_run+183943>, 0xb5f3bcb1 <MVM_interp_run+184577>,
0xb5f3bb80 <MVM_interp_run+184272>, 0xb5f3bdea <MVM_interp_run+184890>, 0xb5f242c5 <MVM_interp_run+87829>, 0xb5f2441e <MVM_interp_run+88174>, 0xb5f32792 <MVM_interp_run+146402>,
0xb5f32a1a <MVM_interp_run+147050>, 0xb5f324a6 <MVM_interp_run+145654>, 0xb5f32b62 <MVM_interp_run+147378>, 0xb5f32644 <MVM_interp_run+146068>, 0xb5f328d6 <MVM_interp_run+146726>,
0xb5f4f183 <MVM_interp_run+263635>, 0xb5f5424c <MVM_interp_run+284316>, 0xb5f541ac <MVM_interp_run+284156>, 0xb5f55b05 <MVM_interp_run+290645>, 0xb5f4f26f <MVM_interp_run+263871>,
0xb5f4f307 <MVM_interp_run+264023>, 0xb5f4f397 <MVM_interp_run+264167>, 0xb5f4f4c1 <MVM_interp_run+264465>, 0xb5f26fac <MVM_interp_run+99324>, 0xb5f54f0b <MVM_interp_run+287579>,
0xb5f270de <MVM_interp_run+99630>, 0xb5f27247 <MVM_interp_run+99991>, 0xb5f4a7e1 <MVM_interp_run+244785>, 0xb5f4a97d <MVM_interp_run+245197>, 0xb5f54ff4 <MVM_interp_run+287812>,
0xb5f551cc <MVM_interp_run+288284>, 0xb5f273c9 <MVM_interp_run+100377>, 0xb5f27508 <MVM_interp_run+100696>, 0xb5f27647 <MVM_interp_run+101015>, 0xb5f2777e <MVM_interp_run+101326>,
0xb5f278b5 <MVM_interp_run+101637>, 0xb5f279ee <MVM_interp_run+101950>, 0xb5f27b27 <MVM_interp_run+102263>, 0xb5f27c5e <MVM_interp_run+102574>, 0xb5f3cc89 <MVM_interp_run+188633>,
0xb5f3cdb8 <MVM_interp_run+188936>, 0xb5f565a1 <MVM_interp_run+293361>, 0xb5f580a3 <MVM_interp_run+300275>, 0xb5f3cee7 <MVM_interp_run+189239>, 0xb5f3cfd8 <MVM_interp_run+189480>,
0xb5f3d0e2 <MVM_interp_run+189746>, 0xb5f3d215 <MVM_interp_run+190053>, 0xb5f52925 <MVM_interp_run+277877>, 0xb5f52a4c <MVM_interp_run+278172>, 0xb5f56ae8 <MVM_interp_run+294712>,
0xb5f56bdf <MVM_interp_run+294959>, 0xb5f566d0 <MVM_interp_run+293664>, 0xb5f567c7 <MVM_interp_run+293911>, 0xb5f568be <MVM_interp_run+294158>, 0xb5f569b5 <MVM_interp_run+294405>,
0xb5f16ab1 <MVM_interp_run+32513>, 0xb5f30816 <MVM_interp_run+138342>, 0xb5f16bae <MVM_interp_run+32766>, 0xb5f16ca5 <MVM_interp_run+33013>, 0xb5f3071f <MVM_interp_run+138095>,
0xb5f30b03 <MVM_interp_run+139091>, 0xb5f3090f <MVM_interp_run+138591>, 0xb5f30a0c <MVM_interp_run+138844>, 0xb5f30220 <MVM_interp_run+136816>, 0xb5f4e20c <MVM_interp_run+259676>,
0xb5f43bb6 <MVM_interp_run+217094>, 0xb5f43cdc <MVM_interp_run+217388>, 0xb5f30317 <MVM_interp_run+137063>, 0xb5f30421 <MVM_interp_run+137329>, 0xb5f3052c <MVM_interp_run+137596>,
0xb5f30634 <MVM_interp_run+137860>, 0xb5f16d9c <MVM_interp_run+33260>, 0xb5f16e87 <MVM_interp_run+33495>, 0xb5f450ad <MVM_interp_run+222461>, 0xb5f451e1 <MVM_interp_run+222769>,
0xb5f31d65 <MVM_interp_run+143797>, 0xb5f320a1 <MVM_interp_run+144625>, 0xb5f31ea7 <MVM_interp_run+144119>, 0xb5f31fa7 <MVM_interp_run+144375>, 0xb5f44858 <MVM_interp_run+220328>,
0xb5f501dd <MVM_interp_run+267821>, 0xb5f4ecbd <MVM_interp_run+262413>, 0xb5f4ef20 <MVM_interp_run+263024>, 0xb5f449c3 <MVM_interp_run+220691>, 0xb5f44c26 <MVM_interp_run+221302>,
0xb5f44e89 <MVM_interp_run+221913>, 0xb5f44f75 <MVM_interp_run+222149>, 0xb5f2ba73 <MVM_interp_run+118467>, 0xb5f2bba2 <MVM_interp_run+118770>, 0xb5f4ca52 <MVM_interp_run+253602>,
0xb5f4fbc6 <MVM_interp_run+266262>, 0xb5f408e5 <MVM_interp_run+204085>, 0xb5f40a6f <MVM_interp_run+204479>, 0xb5f40c11 <MVM_interp_run+204897>, 0xb5f40db3 <MVM_interp_run+205315>,
0xb5f2bce9 <MVM_interp_run+119097>, 0xb5f2c3e0 <MVM_interp_run+120880>, 0xb5f2be78 <MVM_interp_run+119496>, 0xb5f2c023 <MVM_interp_run+119923>, 0xb5f2c206 <MVM_interp_run+120406>,
0xb5f2c88e <MVM_interp_run+122078>, 0xb5f2c58b <MVM_interp_run+121307>, 0xb5f2c77d <MVM_interp_run+121805>, 0xb5f37c35 <MVM_interp_run+168069>, 0xb5f37d1f <MVM_interp_run+168303>,
0xb5f384ca <MVM_interp_run+170266>, 0xb5f386df <MVM_interp_run+170799>, 0xb5f37e4c <MVM_interp_run+168604>, 0xb5f383d0 <MVM_interp_run+170016>, 0xb5f37f60 <MVM_interp_run+168880>,
0xb5f38198 <MVM_interp_run+169448>, 0xb5f47f27 <MVM_interp_run+234359>, 0xb5f480f8 <MVM_interp_run+234824>, 0xb5f482d3 <MVM_interp_run+235299>, 0xb5f488e5 <MVM_interp_run+236853>,
0xb5f48521 <MVM_interp_run+235889>, 0xb5f48620 <MVM_interp_run+236144>, 0xb5f4871f <MVM_interp_run+236399>, 0xb5f4881e <MVM_interp_run+236654>, 0xb5f13780 <MVM_interp_run+19408>,
0xb5f2dff8 <MVM_interp_run+128072>, 0xb5f13847 <MVM_interp_run+19607>, 0xb5f1393e <MVM_interp_run+19854>, 0xb5f13cdc <MVM_interp_run+20780>, 0xb5f142fb <MVM_interp_run+22347>,
0xb5f14211 <MVM_interp_run+22113>, 0xb5f14400 <MVM_interp_run+22608>, 0xb5f13a06 <MVM_interp_run+20054>, 0xb5f13b1a <MVM_interp_run+20330>, 0xb5f13bfb <MVM_interp_run+20555>,
0xb5f13d94 <MVM_interp_run+20964>, 0xb5f13f93 <MVM_interp_run+21475>, 0xb5f14abb <MVM_interp_run+24331>, 0xb5f145db <MVM_interp_run+23083>, 0xb5f1483d <MVM_interp_run+23693>,
0xb5f2de16 <MVM_interp_run+127590>, 0xb5f41cb2 <MVM_interp_run+209154>, 0xb5f416f3 <MVM_interp_run+207683>, 0xb5f41926 <MVM_interp_run+208246>, 0xb5f41213 <MVM_interp_run+206435>,
0xb5f413d1 <MVM_interp_run+206881>, 0xb5f4153b <MVM_interp_run+207243>, 0xb5f415ec <MVM_interp_run+207420>, 0xb5f40f4b <MVM_interp_run+205723>, 0xb5f410a8 <MVM_interp_run+206072>...}
cur_op = 0xab680fea "\004"
bytecode_start = 0xab680fc4 "\214"
reg_base = 0xac614800
cu = 0xb1e01668
cur_callsite = 0xb68f7ae0 <inv_arg_callsite>
#2 0xb6289e33 in MVM_vm_run_file (instance=0xb5a03780, filename=0xbffff269 "/home/dogbert/repos/rakudo/perl6.moarvm") at src/moar.c:309
tc = 0xb5803c80
cu = 0xb1e00400
#3 0x080490e2 in main (argc=10, argv=0xbfffefb4) at src/main.c:201
instance = 0xb5a03780
---Type <return> to continue, or q <return> to quit---
input_file = 0xbffff269 "/home/dogbert/repos/rakudo/perl6.moarvm"
executable_name = <optimized out>
lib_path = {0xbffff1f1 "/home/dogbert/repos/rakudo/install/share/nqp/lib", 0xbffff22c "/home/dogbert/repos/rakudo/install/share/nqp/lib", 0xbffff267 ".", 0x0,
0x804c0a0 "\300\230\004\b\312\004", 0x14 <error: Cannot access memory at address 0x14>, 0x1 <error: Cannot access memory at address 0x1>, 0x80488a5 <_init+9> "\201\303[7"}
dump = <optimized out>
full_cleanup = <optimized out>
argi = 6
lib_path_i = <optimized out>
#valgrind
dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6-valgrind-m -I /home/dogbert/repos/rakudo/install/share/perl6/site/lib mapper.p6
================================================================================================
This is Rakudo Perl 6 running in valgrind, a tool for debugging and profiling programs.
Running a program in valgrind usually takes *a lot* more time than running it directly,
so please be patient.
This Rakudo version is 2017.02.55.g.320.c.2.fb.46 built on MoarVM version 2017.02.7.g.3.d.859008,
running on ubuntu (14.04.3.LTS.Trusty.Tahr) / linux (3.19.0.32.generic)
------------------------------------------------------------------------------------------------
==8974== Memcheck, a memory error detector
==8974== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==8974== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==8974== Command: /home/dogbert/repos/rakudo/install/bin/moar --full-cleanup --execname=./perl6-valgrind-m --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=. /home/dogbert/repos/rakudo/perl6.moarvm --nqp-lib=blib -I /home/dogbert/repos/rakudo/install/share/perl6/site/lib mapper.p6
==8974==
==8974== Invalid read of size 4
==8974== at 0x59E22CF: p6recont_ro (perl6_ops.c:268)
==8974== by 0x40F0544: MVM_interp_run (interp.c:5633)
==8974== by 0x41D1935: MVM_vm_run_file (moar.c:309)
==8974== by 0x8048D38: main (main.c:201)
==8974== Address 0x1d is not stack'd, malloc'd or (recently) free'd
==8974==
==8974==
==8974== Process terminating with default action of signal 11 (SIGSEGV)
==8974== Access not within mapped region at address 0x1D
==8974== at 0x59E22CF: p6recont_ro (perl6_ops.c:268)
==8974== by 0x40F0544: MVM_interp_run (interp.c:5633)
==8974== by 0x41D1935: MVM_vm_run_file (moar.c:309)
==8974== by 0x8048D38: main (main.c:201)
==8974== If you believe this happened as a result of a stack
==8974== overflow in your program's main thread (unlikely but
==8974== possible), you can try to increase the size of the
==8974== main thread stack using the --main-stacksize= flag.
==8974== The main thread stack size used in this run was 8388608.
==8974==
==8974== HEAP SUMMARY:
==8974== in use at exit: 76,663,925 bytes in 560,689 blocks
==8974== total heap usage: 11,976,436 allocs, 11,415,747 frees, 3,733,066,292 bytes allocated
==8974==
==8974== LEAK SUMMARY:
==8974== definitely lost: 144 bytes in 12 blocks
==8974== indirectly lost: 0 bytes in 0 blocks
==8974== possibly lost: 12,151,471 bytes in 253,615 blocks
==8974== still reachable: 64,512,310 bytes in 307,062 blocks
==8974== suppressed: 0 bytes in 0 blocks
==8974== Rerun with --leak-check=full to see details of leaked memory
==8974==
==8974== For counts of detected and suppressed errors, rerun with: -v
==8974== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
#ASAN
dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6 -I /home/dogbert/repos/rakudo/install/share/perl6/site/lib mapper.p6
ASAN:SIGSEGV
=================================================================
==10055== ERROR: AddressSanitizer: SEGV on unknown address 0x0000001d (pc 0xb47172cf sp 0xbfc24c60 bp 0xb471bea0 T0)
AddressSanitizer can not provide additional info.
#0 0xb47172ce in MVM_is_null /home/dogbert/repos/rakudo/install/include/moar/6model/reprs/MVMNull.h:11
#1 0xb47172ce in p6recont_ro /home/dogbert/repos/rakudo/src/vm/moar/ops/perl6_ops.c:268
#2 0xb57357b4 in MVM_interp_run /home/dogbert/repos/rakudo/nqp/MoarVM/src/core/interp.c:5633
#3 0xb5a88e32 in MVM_vm_run_file /home/dogbert/repos/rakudo/nqp/MoarVM/src/moar.c:309
#4 0x80490e1 in main /home/dogbert/repos/rakudo/nqp/MoarVM/src/main.c:201
#5 0xb5416af2 (/lib/i386-linux-gnu/libc.so.6+0x19af2)
#6 0x8049233 in _start (/home/dogbert/repos/rakudo/install/bin/moar+0x8049233)
SUMMARY: AddressSanitizer: SEGV /home/dogbert/repos/rakudo/src/vm/moar/ops/perl6_ops.c:268 MVM_is_null
==10055== ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment