New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfaults raised when trying with this code. #2147

Open
xinminglai opened this Issue Jul 29, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@xinminglai

xinminglai commented Jul 29, 2018

The Problem

Segfault will be raised when try with this test scripts.

Expected Behavior

Should run smooth without any problem.

Actual Behavior

rakudo compiler segfaults.

Steps to Reproduce

#----- file main.p6
#!env perl6

use lib '.';
use A;
use B;
my %cfg = ({});

#----- file A.pm6
use B;

#----- file B.pm6
multi infix:['|+|'] (Any, $arg) is export { }
multi infix:['|+|'] (Int \o, $t) is export { }

Save these 3 files to same directly, and run perl6 main.p6

Environment

  • Operating system: Gentoo Base System release 2.4.1
  • Compiler version (perl6 -v): This is Rakudo version 2018.06-265-gb7379a804 built on MoarVM version 2018.06-314-g4199a9564
@zoffixznet

This comment has been minimized.

Show comment
Hide comment

@zoffixznet zoffixznet added the SEGV label Jul 29, 2018

@MasterDuke17

This comment has been minimized.

Show comment
Hide comment
@MasterDuke17

MasterDuke17 Jul 29, 2018

Contributor
================================================================================================
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.233.gbf.514.c.150 built on MoarVM version 2018.06.313.gebf.0464.e.0,
running on arch (4.17.3.1.arch) / linux (4.17.2.1.ARCH)

Type `bt full` to generate a backtrace if applicable, type `q` to quit or `help` for help.
------------------------------------------------------------------------------------------------
Reading symbols from /home/dan/Source/perl6/install/bin/moar...done.
MoarVM string pretty printer registered
moar-heap registered
diff-moar-heap registered
Starting program: /home/dan/Source/perl6/install/bin/moar --execname=/home/dan/Source/perl6/install/bin/perl6-gdb-m --libpath=/home/dan/Source/perl6/install/share/nqp/lib --libpath=/home/dan/Source/perl6/install/share/perl6/lib --libpath=/home/dan/Source/perl6/install/share/perl6/runtime /home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm main.p6
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff6271700 (LWP 10633)]

Thread 1 "moar" received signal SIGSEGV, Segmentation fault.
0x00007ffff7604c48 in MVM_gc_mark_collectable (tc=0x555555758c80, worklist=0x555559679a10, new_addr=0x5555584a4620) at src/gc/collect.c:367
367             MVM_gc_worklist_add(tc, worklist, &(tc->instance->all_scs[sc_idx]->sc));
(gdb) bt
#0  0x00007ffff7604c48 in MVM_gc_mark_collectable (tc=0x555555758c80, worklist=0x555559679a10, new_addr=0x5555584a4620) at src/gc/collect.c:367
#1  0x00007ffff7605bea in process_worklist (tc=tc@entry=0x555555758c80, worklist=worklist@entry=0x555559679a10, wtp=wtp@entry=0x7fffffffe0a0, gen=gen@entry=1 '\001') at src/gc/collect.c:341
#2  0x00007ffff760625e in MVM_gc_collect (tc=tc@entry=0x555555758c80, what_to_do=what_to_do@entry=0 '\000', gen=<optimized out>) at src/gc/collect.c:114
#3  0x00007ffff75ffdef in run_gc (tc=tc@entry=0x555555758c80, what_to_do=what_to_do@entry=0 '\000') at src/gc/orchestrate.c:396
#4  0x00007ffff76009df in MVM_gc_enter_from_allocator (tc=tc@entry=0x555555758c80) at src/gc/orchestrate.c:525
#5  0x00007ffff7600d18 in MVM_gc_allocate_nursery (tc=0x555555758c80, size=32) at src/gc/allocation.c:32
#6  0x00007ffff760106f in MVM_gc_allocate_object (tc=0x555555758c80, st=<optimized out>) at src/gc/allocation.c:86
#7  0x00007ffff75e9626 in MVM_box_int (tc=0x555555758c80, value=6637, type=0x5555557cd1a8, dst=0x5555592ba408) at src/core/coerce.c:488
#8  0x00007ffff75c92c0 in MVM_interp_run (tc=tc@entry=0x555555758c80, initial_invoke=0x58425300, invoke_data=0x555555767f70) at src/core/interp.c:2112
#9  0x00007ffff76d0ff5 in MVM_vm_run_file (instance=0x555555758260, filename=<optimized out>) at src/moar.c:412
#10 0x00005555555555a0 in main (argc=7, argv=0x7fffffffe808) at src/main.c:299
(gdb)

Segfaults with MVM_SPESH_DISABLE=1 also. No segfaults under valgrind though.

Contributor

MasterDuke17 commented Jul 29, 2018

================================================================================================
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.233.gbf.514.c.150 built on MoarVM version 2018.06.313.gebf.0464.e.0,
running on arch (4.17.3.1.arch) / linux (4.17.2.1.ARCH)

Type `bt full` to generate a backtrace if applicable, type `q` to quit or `help` for help.
------------------------------------------------------------------------------------------------
Reading symbols from /home/dan/Source/perl6/install/bin/moar...done.
MoarVM string pretty printer registered
moar-heap registered
diff-moar-heap registered
Starting program: /home/dan/Source/perl6/install/bin/moar --execname=/home/dan/Source/perl6/install/bin/perl6-gdb-m --libpath=/home/dan/Source/perl6/install/share/nqp/lib --libpath=/home/dan/Source/perl6/install/share/perl6/lib --libpath=/home/dan/Source/perl6/install/share/perl6/runtime /home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm main.p6
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff6271700 (LWP 10633)]

Thread 1 "moar" received signal SIGSEGV, Segmentation fault.
0x00007ffff7604c48 in MVM_gc_mark_collectable (tc=0x555555758c80, worklist=0x555559679a10, new_addr=0x5555584a4620) at src/gc/collect.c:367
367             MVM_gc_worklist_add(tc, worklist, &(tc->instance->all_scs[sc_idx]->sc));
(gdb) bt
#0  0x00007ffff7604c48 in MVM_gc_mark_collectable (tc=0x555555758c80, worklist=0x555559679a10, new_addr=0x5555584a4620) at src/gc/collect.c:367
#1  0x00007ffff7605bea in process_worklist (tc=tc@entry=0x555555758c80, worklist=worklist@entry=0x555559679a10, wtp=wtp@entry=0x7fffffffe0a0, gen=gen@entry=1 '\001') at src/gc/collect.c:341
#2  0x00007ffff760625e in MVM_gc_collect (tc=tc@entry=0x555555758c80, what_to_do=what_to_do@entry=0 '\000', gen=<optimized out>) at src/gc/collect.c:114
#3  0x00007ffff75ffdef in run_gc (tc=tc@entry=0x555555758c80, what_to_do=what_to_do@entry=0 '\000') at src/gc/orchestrate.c:396
#4  0x00007ffff76009df in MVM_gc_enter_from_allocator (tc=tc@entry=0x555555758c80) at src/gc/orchestrate.c:525
#5  0x00007ffff7600d18 in MVM_gc_allocate_nursery (tc=0x555555758c80, size=32) at src/gc/allocation.c:32
#6  0x00007ffff760106f in MVM_gc_allocate_object (tc=0x555555758c80, st=<optimized out>) at src/gc/allocation.c:86
#7  0x00007ffff75e9626 in MVM_box_int (tc=0x555555758c80, value=6637, type=0x5555557cd1a8, dst=0x5555592ba408) at src/core/coerce.c:488
#8  0x00007ffff75c92c0 in MVM_interp_run (tc=tc@entry=0x555555758c80, initial_invoke=0x58425300, invoke_data=0x555555767f70) at src/core/interp.c:2112
#9  0x00007ffff76d0ff5 in MVM_vm_run_file (instance=0x555555758260, filename=<optimized out>) at src/moar.c:412
#10 0x00005555555555a0 in main (argc=7, argv=0x7fffffffe808) at src/main.c:299
(gdb)

Segfaults with MVM_SPESH_DISABLE=1 also. No segfaults under valgrind though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment