Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created June 21, 2018 22:26
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/ade0912904a3d05a34a229a38f5c7b6f to your computer and use it in GitHub Desktop.
Save dogbert17/ade0912904a3d05a34a229a38f5c7b6f to your computer and use it in GitHub Desktop.
gdb stuff
dogbert@dogbert-VirtualBox ~/repos/doc $ MVM_JIT_DISABLE=1 perl6-gdb-m --profile xt/examples-compilation.t
================================================================================================
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 2018.05.122.ga.167.e.6.c built on MoarVM version 2018.05.131.g.9.fb.02.c.9,
running on linuxmint (18.3.Sylvia) / linux (4.10.0.38.generic)
Type `bt full` to generate a backtrace if applicable, type `q` to quit or `help` for help.
------------------------------------------------------------------------------------------------
Reading symbols from /home/dogbert/.rakudobrew/moar-master/install/bin/moar...done.
Starting program: /home/dogbert/.rakudobrew/moar-master/install/bin/moar --execname=/home/dogbert/.rakudobrew/bin/../moar-master/install/bin/perl6-gdb-m --libpath=/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib --libpath=/home/dogbert/.rakudobrew/moar-master/install/share/perl6/lib --libpath=/home/dogbert/.rakudobrew/moar-master/install/share/perl6/runtime /home/dogbert/.rakudobrew/moar-master/install/share/perl6/runtime/perl6.moarvm --profile xt/examples-compilation.t
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff628e700 (LWP 14829)]
[New Thread 0x7ffff3d8a700 (LWP 14830)]
[New Thread 0x7ffff2ef2700 (LWP 14831)]
[New Thread 0x7ffff1c60700 (LWP 14832)]
[New Thread 0x7ffff145f700 (LWP 14835)]
1..4654
ok 1 - doc/Language/5to6-nutshell.pod6 chunk 1 starts with “sub test-d” compiles
Thread 1 "moar" received signal SIGSEGV, Segmentation fault.
0x00007ffff7584c40 in MVM_interp_run (tc=0x604a20, initial_invoke=0x7ffff76cb9e0 <toplevel_initial_invoke>, invoke_data=0x67ff60) at src/core/interp.c:5397
5397 if (!check || !IS_CONCRETE(check) || STABLE(check) != want)
(gdb) bt
#0 0x00007ffff7584c40 in MVM_interp_run (tc=0x604a20, initial_invoke=0x7ffff76cb9e0 <toplevel_initial_invoke>, invoke_data=0x67ff60) at src/core/interp.c:5397
#1 0x00007ffff76cbb45 in MVM_vm_run_file (instance=0x604010, filename=0x7fffffffe26c "/home/dogbert/.rakudobrew/moar-master/install/share/perl6/runtime/perl6.moarvm") at src/moar.c:412
#2 0x00000000004016f7 in main (argc=8, argv=0x7fffffffdd78) at src/main.c:299
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7ffff7fdb700 (LWP 14825) "moar" 0x00007ffff7584c40 in MVM_interp_run (tc=0x604a20, initial_invoke=0x7ffff76cb9e0 <toplevel_initial_invoke>, invoke_data=0x67ff60) at src/core/interp.c:5397
2 Thread 0x7ffff628e700 (LWP 14829) "moar" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7ffff3d8a700 (LWP 14830) "moar" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7ffff2ef2700 (LWP 14831) "moar" 0x00007ffff708e30d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
5 Thread 0x7ffff1c60700 (LWP 14832) "moar" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
6 Thread 0x7ffff145f700 (LWP 14835) "moar" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
(gdb) p want
$1 = (MVMSTable *) 0x65bbf0
(gdb) l
5392 OP(sp_guardconc): {
5393 MVMObject *check = GET_REG(cur_op, 0).o;
5394 MVMSTable *want = (MVMSTable *)tc->cur_frame
5395 ->effective_spesh_slots[GET_UI16(cur_op, 2)];
5396 cur_op += 8;
5397 if (!check || !IS_CONCRETE(check) || STABLE(check) != want)
5398 MVM_spesh_deopt_one(tc, GET_UI32(cur_op, -4));
5399 goto NEXT;
5400 }
5401 OP(sp_guardtype): {
(gdb) p *check
Cannot access memory at address 0x8
(gdb) p cur_op
$2 = (MVMuint8 *) 0x7fffec3f9c2c "\b"
(gdb) p *cur_op
$3 = 8 '\b'
(gdb) p MVM_dump_backtrace(tc)
at gen/moar/stage2/QAST.nqp:3008 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:)
from gen/moar/stage2/QAST.nqp:1635 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:compile_op)
from gen/moar/stage2/QAST.nqp:6018 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:compile_node)
from gen/moar/stage2/QAST.nqp:5221 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:as_mast)
from gen/moar/stage2/QAST.nqp:5977 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:compile_all_the_stmts)
from gen/moar/stage2/QAST.nqp:5594 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:)
from gen/moar/stage2/QAST.nqp:5569 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:)
from gen/moar/stage2/QAST.nqp:5865 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:compile_node)
from gen/moar/stage2/QAST.nqp:5221 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:as_mast)
from gen/moar/stage2/QAST.nqp:5367 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:compile_node)
from gen/moar/stage2/QAST.nqp:5221 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:as_mast)
from gen/moar/stage2/QAST.nqp:4957 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:to_mast)
from gen/moar/stage2/QAST.nqp:6704 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/QAST.moarvm:to_mast)
from gen/moar/stage2/NQPHLL.nqp:437 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:mast)
from gen/moar/stage2/NQPHLL.nqp:1825 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:execute_stage)
from gen/moar/stage2/NQPHLL.nqp:1861 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:run)
from gen/moar/stage2/NQPHLL.nqp:1869 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:)
from gen/moar/stage2/NQPHLL.nqp:1886 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:compile)
from SETTING::src/core/ForeignCode.pm6:63 (/home/dogbert/.rakudobrew/moar-master/install/share/perl6/runtime/CORE.setting.moarvm:EVAL)
from xt/examples-compilation.t:113 (<ephemeral file>:)
from xt/examples-compilation.t:113 (<ephemeral file>:)
from xt/examples-compilation.t:122 (<ephemeral file>:)
from xt/examples-compilation.t:128 (<ephemeral file>:<unit>)
from xt/examples-compilation.t:1 (<ephemeral file>:<unit-outer>)
from gen/moar/stage2/NQPHLL.nqp:1559 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:)
from gen/moar/stage2/NQPHLL.nqp:73 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:run_profiled)
from gen/moar/stage2/NQPHLL.nqp:1559 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:eval)
from gen/moar/stage2/NQPHLL.nqp:1805 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:evalfiles)
from gen/moar/stage2/NQPHLL.nqp:1695 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
from src/Perl6/Compiler.nqp:42 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/Perl6/Compiler.moarvm:command_eval)
from gen/moar/stage2/NQPHLL.nqp:1654 (/home/dogbert/.rakudobrew/moar-master/install/share/nqp/lib/NQPHLL.moarvm:command_line)
from gen/moar/main.nqp:47 (/home/dogbert/.rakudobrew/moar-master/install/share/perl6/runtime/perl6.moarvm:MAIN)
from gen/moar/main.nqp:38 (/home/dogbert/.rakudobrew/moar-master/install/share/perl6/runtime/perl6.moarvm:<mainline>)
from <unknown>:1 (/home/dogbert/.rakudobrew/moar-master/install/share/perl6/runtime/perl6.moarvm:<main>)
from <unknown>:1 (/home/dogbert/.rakudobrew/moar-master/install/share/perl6/runtime/perl6.moarvm:<entry>)
$4 = void
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment