Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created August 23, 2018 20:53
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/24e6033ef092560ab1d6e3c8cfdfb444 to your computer and use it in GitHub Desktop.
Save dogbert17/24e6033ef092560ab1d6e3c8cfdfb444 to your computer and use it in GitHub Desktop.
Testing new debug check
dogbert@dogbert-VirtualBox ~/repos/rakudo $ MVM_JIT_DISABLE=1 ./perl6-gdb-m t/spec/S17-lowlevel/atomic.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.06.479.g.0979.b.77 built on MoarVM version 2018.06.560.ge.446.a.67,
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/repos/rakudo/nqp/MoarVM/../../install/bin/moar...done.
Starting program: /home/dogbert/repos/rakudo/install/bin/moar --execname=./perl6-gdb-m --libpath=. --libpath=blib --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib /home/dogbert/repos/rakudo/perl6.moarvm --nqp-lib=blib t/spec/S17-lowlevel/atomic.t
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff6633700 (LWP 14674)]
1..33
ok 1 - Doing a full memory barrier lives
ok 2 - Can do an atomic fetch from a Scalar container
[several runs skipped]
Thread 1 "moar" hit Breakpoint 2, __GI_exit (status=0) at exit.c:104
104 exit.c: No such file or directory.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff6633700 (LWP 14709)]
1..33
ok 1 - Doing a full memory barrier lives
ok 2 - Can do an atomic fetch from a Scalar container
ok 3 - Can do an atomic assign to a Scalar container; returns new value
ok 4 - Atomic fetch after atomic assign shows latest value
ok 5 - Updated value seen by non-atomic too
1..2
ok 1 - code dies
ok 2 - right exception type (X::TypeCheck::Assignment)
ok 6 - Cannot atomic assign value of the wrong type
ok 7 - Can atomic assign to a Scalar container with a subset type if value matches
1..2
ok 1 - code dies
ok 2 - right exception type (X::TypeCheck::Assignment)
ok 8 - Cannot atomic assign value failing to meet subset type
ok 9 - Correct value is in the container
[New Thread 0x7fffeffff700 (LWP 14710)]
[New Thread 0x7fffef7fe700 (LWP 14711)]
ok 10 - No hang due to incorrect lifting of atomic fetch out of loop
ok 11 - Can do an atomic fetch from an int container
ok 12 - Can do an atomic assign to an int container; returns new value
ok 13 - Atomic int fetch after atomic int assign shows latest value
ok 14 - Updated value seen by non-atomic too
ok 15 - No hang due to incorrect lifting of atomic int fetch out of loop
ok 16 - atomic-fetch-inc returns value before incrementing (1)
ok 17 - atomic-fetch-inc returns value before incrementing (1)
ok 18 - atomic-fetch-dec returns value before decrementing (1)
ok 19 - atomic-fetch-dec returns value before decrementing (2)
ok 20 - atomic-postfix-add returns value before adding (1)
ok 21 - atomic-postfix-add returns value before adding (2)
[New Thread 0x7fffeeffd700 (LWP 14712)]
[New Thread 0x7fffee7fc700 (LWP 14713)]
[New Thread 0x7fffedffb700 (LWP 14714)]
ok 22 - Atomic increment of lexical works (1)
ok 23 - Atomic increment of lexical works (2)
ok 24 - Atomic increment of lexical works (3)
ok 25 - Atomic increment of lexical works (4)
ok 26 - Atomic decrement of lexical works (1)
ok 27 - Atomic decrement of lexical works (2)
Thread 1 "moar" hit Breakpoint 1, MVM_panic (exitCode=1, messageFormat=0x7ffff77132d4 "SC index out of range") at src/core/exceptions.c:821
821 MVM_NO_RETURN void MVM_panic(MVMint32 exitCode, const char *messageFormat, ...) {
(gdb) bt
#0 MVM_panic (exitCode=1, messageFormat=0x7ffff77132d4 "SC index out of range") at src/core/exceptions.c:821
#1 0x00007ffff7581143 in MVM_gc_mark_collectable (tc=0x604a70, worklist=0x3083d70, new_addr=0x3538f30) at src/gc/collect.c:372
#2 0x00007ffff7580feb in process_worklist (tc=0x604a70, worklist=0x3083d70, wtp=0x7fffffffc320, gen=0 '\000') at src/gc/collect.c:344
#3 0x00007ffff7580b40 in MVM_gc_collect (tc=0x604a70, what_to_do=1 '\001', gen=0 '\000') at src/gc/collect.c:163
#4 0x00007ffff7576431 in run_gc (tc=0x604a70, what_to_do=1 '\001') at src/gc/orchestrate.c:409
#5 0x00007ffff7576c44 in MVM_gc_enter_from_interrupt (tc=0x604a70) at src/gc/orchestrate.c:613
#6 0x00007ffff750647b in MVM_interp_run (tc=0x604a70, initial_invoke=0x7ffff76af86c <toplevel_initial_invoke>, invoke_data=0x6e0568) at src/core/interp.c:231
#7 0x00007ffff76af9d1 in MVM_vm_run_file (instance=0x604010, filename=0x7fffffffe2af "/home/dogbert/repos/rakudo/perl6.moarvm") at src/moar.c:420
#8 0x00000000004016e7 in main (argc=10, argv=0x7fffffffddf8) at src/main.c:300
(gdb) f 1
#1 0x00007ffff7581143 in MVM_gc_mark_collectable (tc=0x604a70, worklist=0x3083d70, new_addr=0x3538f30) at src/gc/collect.c:372
372 MVM_panic(1, "SC index out of range");
(gdb) l
367 /*assert(REPR(new_addr));*/
368 sc_idx = MVM_sc_get_idx_of_sc(new_addr);
369 if (sc_idx > 0) {
370 #if MVM_GC_DEBUG
371 if (sc_idx >= tc->instance->all_scs_next_idx)
372 MVM_panic(1, "SC index out of range");
373 #endif
374 MVM_gc_worklist_add(tc, worklist, &(tc->instance->all_scs[sc_idx]->sc));
375 }
376
(gdb) p sc_idx
$1 = 55807408
(gdb) p tc->instance->all_scs_next_idx
$2 = 27
(gdb) p MVM_dump_backtrace(tc)
at SETTING::src/core/List.pm6:146 (./CORE.setting.moarvm:reify-all)
from SETTING::src/core/List.pm6:896 (./CORE.setting.moarvm:eager)
from SETTING::src/core/Sequence.pm6:71 (./CORE.setting.moarvm:eager)
from SETTING::src/core/asyncops.pm6:53 (./CORE.setting.moarvm:await)
from t/spec/S17-lowlevel/atomic.t:95 (<ephemeral file>:)
from t/spec/S17-lowlevel/atomic.t:93 (<ephemeral file>:<unit>)
from t/spec/S17-lowlevel/atomic.t:1 (<ephemeral file>:<unit-outer>)
from gen/moar/stage2/NQPHLL.nqp:1567 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:eval)
from gen/moar/stage2/NQPHLL.nqp:1806 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:evalfiles)
from gen/moar/stage2/NQPHLL.nqp:1696 (/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:1655 (/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>)
$3 = void
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment