Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created September 8, 2019 10:20
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/f396ed9afcea140cf24ca27f26227232 to your computer and use it in GitHub Desktop.
Save dogbert17/f396ed9afcea140cf24ca27f26227232 to your computer and use it in GitHub Desktop.
Union
ok 22 - short in union*
ok 23 - char in union*
ok 24 - sizeof(UnionOfStructs)
ok 25 - member a of union is-a MyStruct
Thread 1 "moar" hit Breakpoint 1, MVM_panic (exitCode=1, messageFormat=0x7ffff763e4f8 "Zeroed owner in item added to GC worklist") at src/core/exceptions.c:832
832 MVM_NO_RETURN void MVM_panic(MVMint32 exitCode, const char *messageFormat, ...) {
(gdb) bt
#0 MVM_panic (exitCode=1, messageFormat=0x7ffff763e4f8 "Zeroed owner in item added to GC worklist") at src/core/exceptions.c:832
#1 0x00007ffff74f2886 in gc_mark (tc=0x604ac0, st=0x3d81558, data=0x42bab78, worklist=0x4abe490) at src/6model/reprs/CUnion.c:623
#2 0x00007ffff748bf4b in MVM_gc_mark_collectable (tc=0x604ac0, worklist=0x4abe490, new_addr=0x42bab60) at src/gc/collect.c:439
#3 0x00007ffff7485e4c in MVM_gc_root_add_gen2s_to_worklist (tc=0x604ac0, worklist=0x4abe490) at src/gc/roots.c:337
#4 0x00007ffff7488aba in MVM_gc_collect (tc=0x604ac0, what_to_do=0 '\000', gen=0 '\000') at src/gc/collect.c:155
#5 0x00007ffff747d23c in run_gc (tc=0x604ac0, what_to_do=0 '\000') at src/gc/orchestrate.c:431
#6 0x00007ffff747d902 in MVM_gc_enter_from_allocator (tc=0x604ac0) at src/gc/orchestrate.c:588
#7 0x00007ffff747e17e in MVM_gc_allocate_nursery (tc=0x604ac0, size=32) at src/gc/allocation.c:37
#8 0x00007ffff747df79 in MVM_gc_allocate (tc=0x604ac0, size=32) at src/gc/allocation.h:18
#9 0x00007ffff747e207 in MVM_gc_allocate_zeroed (tc=0x604ac0, size=32) at src/gc/allocation.c:56
#10 0x00007ffff747e5aa in MVM_gc_allocate_object (tc=0x604ac0, st=0x66f7b0) at src/gc/allocation.c:93
#11 0x00007ffff74aa34d in MVM_repr_alloc_init (tc=0x604ac0, type=0x67b640) at src/6model/reprconv.c:17
#12 0x00007ffff73fcbfd in MVM_args_save_capture (tc=0x604ac0, frame=0x7ffff7fb9030) at src/core/args.c:99
#13 0x00007ffff73fcbba in MVM_args_use_capture (tc=0x604ac0, f=0x7ffff7fb9030) at src/core/args.c:94
#14 0x00007ffff740fd08 in MVM_interp_run (tc=0x604ac0, initial_invoke=0x7ffff75c5318 <toplevel_initial_invoke>, invoke_data=0x6a2bf8) at src/core/interp.c:1343
#15 0x00007ffff75c54b6 in MVM_vm_run_file (instance=0x604010, filename=0x7fffffffe1bc "/home/dogbert/repos/rakudo/perl6.moarvm") at src/moar.c:459
#16 0x00000000004016e7 in main (argc=10, argv=0x7fffffffdd38) at src/main.c:302
(gdb) f 1
#1 0x00007ffff74f2886 in gc_mark (tc=0x604ac0, st=0x3d81558, data=0x42bab78, worklist=0x4abe490) at src/6model/reprs/CUnion.c:623
623 MVM_gc_worklist_add(tc, worklist, &body->child_objs[i]);
(gdb) p data
$1 = (void *) 0x42bab78
(gdb) l
618 static void gc_mark(MVMThreadContext *tc, MVMSTable *st, void *data, MVMGCWorklist *worklist) {
619 MVMCUnionREPRData *repr_data = (MVMCUnionREPRData *) st->REPR_data;
620 MVMCUnionBody *body = (MVMCUnionBody *)data;
621 MVMint32 i;
622 for (i = 0; i < repr_data->num_child_objs; i++)
623 MVM_gc_worklist_add(tc, worklist, &body->child_objs[i]);
624 }
625
626 /* Marks the representation data in an STable.*/
627 static void gc_mark_repr_data(MVMThreadContext *tc, MVMSTable *st, MVMGCWorklist *worklist) {
(gdb) p i
$2 = 0
(gdb) p body->child_objs[i]
$3 = (MVMObject *) 0x6daf20
(gdb) p *body->child_objs[i]
$4 = {header = {sc_forward_u = {forwarder = 0x6daf28, sc = {sc_idx = 7188264, idx = 0}, st = 0x6daf28}, owner = 0, flags = 0, size = 0}, st = 0x30000800000001}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment