Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created July 18, 2021 11:27
Show Gist options
  • Save dogbert17/e85f9f02c49ea793355006fe9dfa68c9 to your computer and use it in GitHub Desktop.
Save dogbert17/e85f9f02c49ea793355006fe9dfa68c9 to your computer and use it in GitHub Desktop.
GC error in new-disp, nursery 8k and MVM_GC_DEBUG=1
dogbert@dogbert-VirtualBox:~/repos/rakudo$ gdb --args ./rakudo-m -Ilib t/spec/S17-procasync/many-processes-no-close-stdin.t
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:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./rakudo-m...
(gdb) set follow-fork-mode child
(gdb) b main
Breakpoint 1 at 0x1100: file rakudo-m.c, line 9.
(gdb) r
Starting program: /home/dogbert/repos/rakudo/rakudo-m -Ilib t/spec/S17-procasync/many-processes-no-close-stdin.t
Breakpoint 1, main (argc=3, argv=0x7fffffffdf68) at rakudo-m.c:9
9 {
(gdb) b MVM_panic
Function "MVM_panic" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 2 (MVM_panic) pending.
(gdb) c
Continuing.
process 252177 is executing new program: /home/dogbert/repos/rakudo/install/bin/moar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, main (argc=8, argv=0x7fffffffdd98) at src/main.c:145
145 {
(gdb) b MVM_panic
Note: breakpoint 2 also set at pc 0x7ffff78c9df0.
Breakpoint 3 at 0x7ffff78c9df0: file src/core/exceptions.c, line 854.
(gdb) c
Continuing.
[New Thread 0x7ffff7303700 (LWP 252181)]
1..1
[New Thread 0x7fffeffff700 (LWP 252182)]
[New Thread 0x7fffef7fe700 (LWP 252183)]
[New Thread 0x7fffeeffd700 (LWP 252184)]
[Attaching after Thread 0x7fffeeffd700 (LWP 252184) fork to child process 252185]
[New inferior 2 (process 252185)]
[Detaching after fork from parent process 252177]
[Inferior 1 (process 252177) detached]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 252185 is executing new program: /bin/dash
Error in re-setting breakpoint 1: Function "main" not defined.
[Attaching after process 252185 fork to child process 252186]
[New inferior 3 (process 252186)]
[Detaching after fork from parent process 252185]
[Inferior 2 (process 252185) detached]
process 252186 is executing new program: /home/dogbert/repos/rakudo/rakudo-m
process 252186 is executing new program: /home/dogbert/repos/rakudo/install/bin/moar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7303700 (LWP 252187)]
[Switching to Thread 0x7ffff7347440 (LWP 252186)]
Thread 3.1 "moar" hit Breakpoint 2, MVM_panic (exitCode=exitCode@entry=1, messageFormat=messageFormat@entry=0x7ffff7a54118 "Adding pointer %p to past fromspace to GC worklist") at src/core/exceptions.c:854
854 MVM_NO_RETURN void MVM_panic(MVMint32 exitCode, const char *messageFormat, ...) {
(gdb) bt
#0 MVM_panic (exitCode=exitCode@entry=1, messageFormat=messageFormat@entry=0x7ffff7a54118 "Adding pointer %p to past fromspace to GC worklist") at src/core/exceptions.c:854
#1 0x00007ffff798845b in mark_resumption_temps (tc=tc@entry=0x555555559ea0, temps=0x5555589cd910, worklist=worklist@entry=0x5555589deec0, snapshot=snapshot@entry=0x0, dp=<optimized out>, dp=<optimized out>)
at src/disp/program.c:2785
#2 0x00007ffff798e87d in MVM_disp_program_mark_record_temps (tc=tc@entry=0x555555559ea0, dp=<optimized out>, temps=<optimized out>, worklist=worklist@entry=0x5555589deec0, snapshot=snapshot@entry=0x0)
at src/disp/program.c:2811
#3 0x00007ffff78f7e36 in mark (tc=tc@entry=0x555555559ea0, from_record=<optimized out>, worklist=worklist@entry=0x5555589deec0, snapshot=snapshot@entry=0x0) at src/core/callstack.c:561
#4 0x00007ffff78f9529 in MVM_callstack_mark_current_thread (tc=tc@entry=0x555555559ea0, worklist=worklist@entry=0x5555589deec0, snapshot=snapshot@entry=0x0) at src/core/callstack.c:609
#5 0x00007ffff791ec80 in MVM_gc_root_add_tc_roots_to_worklist (tc=tc@entry=0x555555559ea0, worklist=worklist@entry=0x5555589deec0, snapshot=snapshot@entry=0x0) at src/gc/roots.c:173
#6 0x00007ffff79229e2 in MVM_gc_collect (tc=tc@entry=0x555555559ea0, what_to_do=what_to_do@entry=0 '\000', gen=<optimized out>) at src/gc/collect.c:121
#7 0x00007ffff791b6ba in run_gc (tc=tc@entry=0x555555559ea0, what_to_do=what_to_do@entry=0 '\000') at src/gc/orchestrate.c:443
#8 0x00007ffff791c71f in MVM_gc_enter_from_allocator (tc=tc@entry=0x555555559ea0) at src/gc/orchestrate.c:598
#9 0x00007ffff791ca41 in MVM_gc_allocate_nursery (tc=0x555555559ea0, size=32) at src/gc/allocation.c:37
#10 0x00007ffff791cd96 in MVM_gc_allocate_object (tc=0x555555559ea0, st=<optimized out>) at src/gc/allocation.c:93
#11 0x00007ffff78c9232 in MVM_args_slurpy_named (tc=0x555555559ea0, ctx=0x0) at src/core/args.c:1166
#12 0x00007ffff78e1c38 in MVM_interp_run (tc=0x1, initial_invoke=0x7ffff7a54118, invoke_data=0x7ffff7a54118, outer_runloop=0x3) at src/core/interp.c:1281
#13 0x00005555555557f0 in main (argc=7, argv=0x7fffffffddc8) at src/main.c:305
(gdb) f 1
#1 0x00007ffff798845b in mark_resumption_temps (tc=tc@entry=0x555555559ea0, temps=0x5555589cd910, worklist=worklist@entry=0x5555589deec0, snapshot=snapshot@entry=0x0, dp=<optimized out>, dp=<optimized out>)
at src/disp/program.c:2785
2785 add_collectable(tc, worklist, snapshot, temps[init_values[j].index].o,
(gdb) l
2780 MVMCallsite *cs = dp->resumptions[i].init_callsite;
2781 for (MVMuint32 j = 0; j < cs->flag_count; j++) {
2782 if (init_values[j].source == MVM_DISP_RESUME_INIT_TEMP) {
2783 MVMCallsiteFlags flag = cs->arg_flags[j] & MVM_CALLSITE_ARG_TYPE_MASK;
2784 if (flag == MVM_CALLSITE_ARG_OBJ || flag == MVM_CALLSITE_ARG_STR)
2785 add_collectable(tc, worklist, snapshot, temps[init_values[j].index].o,
2786 "Dispatch program temporary (resumption initialization)");
2787 }
2788 }
2789 }
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment