Skip to content
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

Segfault when creating a Sub object and trying to say it #4312

Closed
p6rt opened this issue Jun 10, 2015 · 8 comments
Closed

Segfault when creating a Sub object and trying to say it #4312

p6rt opened this issue Jun 10, 2015 · 8 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 10, 2015

Migrated from rt.perl.org#125376 (status was 'resolved')

Searchable as RT125376$

@p6rt
Copy link
Author

p6rt commented Jun 10, 2015

From @jonathanstowe

Just experimenting​:

perl6 -e 'my $f = Sub.new(); say $f'
/home/jonathan/.rakudobrew/bin/perl6​: line 2​: 17687 Segmentation fault (core dumped) PATH=/home/jonathan/.rakudobrew/bin/../moar-nom/install/bin​:$PATH perl6 "$@​"

gdb output​:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b4f2b7 in MVM_coerce_istrue_s ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
(gdb) bt
#​0 0x00007ffff7b4f2b7 in MVM_coerce_istrue_s ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​1 0x00007ffff7b4f4c2 in MVM_coerce_istrue ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​2 0x00007ffff7b403e1 in MVM_interp_run ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​3 0x00007ffff7bd87ab in MVM_vm_run_file ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​4 0x000000000040101f in main ()

valgrind output​:
==18186==
==18186== Invalid read of size 1
==18186== at 0x4D6D2B7​: MVM_coerce_istrue_s (in /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so)
==18186== by 0x4D6D4C1​: MVM_coerce_istrue (in /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so)
==18186== by 0x4D5E3E0​: MVM_interp_run (in /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so)
==18186== by 0x4DF67AA​: MVM_vm_run_file (in /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so)
==18186== by 0x40101E​: main (in /home/jonathan/.rakudobrew/moar-nom/install/bin/moar)
==18186== Address 0xffffffff0000000d is not stack'd, malloc'd or (recently) free'd
==18186==
==18186==
==18186== Process terminating with default action of signal 11 (SIGSEGV)
==18186== Access not within mapped region at address 0xFFFFFFFF0000000D
==18186== at 0x4D6D2B7​: MVM_coerce_istrue_s (in /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so)
==18186== by 0x4D6D4C1​: MVM_coerce_istrue (in /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so)
==18186== by 0x4D5E3E0​: MVM_interp_run (in /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so)
==18186== by 0x4DF67AA​: MVM_vm_run_file (in /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so)
==18186== by 0x40101E​: main (in /home/jonathan/.rakudobrew/moar-nom/install/bin/moar)
==18186== If you believe this happened as a result of a stack
==18186== overflow in your program's main thread (unlikely but
==18186== possible), you can try to increase the size of the
==18186== main thread stack using the --main-stacksize= flag.
==18186== The main thread stack size used in this run was 8388608.
==18186==
==18186== HEAP SUMMARY​:
==18186== in use at exit​: 41,569,167 bytes in 144,593 blocks
==18186== total heap usage​: 163,773 allocs, 19,180 frees, 52,779,557 bytes allocated
==18186==
==18186== LEAK SUMMARY​:
==18186== definitely lost​: 41,049 bytes in 702 blocks
==18186== indirectly lost​: 21,779 bytes in 748 blocks
==18186== possibly lost​: 171,752 bytes in 3,070 blocks
==18186== still reachable​: 41,334,587 bytes in 140,073 blocks
==18186== suppressed​: 0 bytes in 0 blocks

@p6rt
Copy link
Author

p6rt commented Jun 15, 2015

From @usev6

After Rakudo commit a6d2edc644 this command dies (with X​::AdHoc)​:

$ perl6 -e 'my $f = Sub.new(); say $f'
Cannot make a Sub object using .new
  in block <unit> at -e​:1

I added a test to S06-other/misc.t with commit Raku/roast@ff2dc709fd

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 15, 2015

From @usev6

After Rakudo commit a6d2edc644 this command dies (with X​::AdHoc)​:

$ perl6 -e 'my $f = Sub.new(); say $f'
Cannot make a Sub object using .new
  in block <unit> at -e​:1

I added a test to S06-other/misc.t with commit Raku/roast@ff2dc709fd

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Jun 15, 2015

@usev6 - Status changed from 'new' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

From @jonathanstowe

Hi,
This fixes the immediate problem bit it appears there is an underlying issue with the construction of code like objects​:

my $a = Sub(0);

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b7b7d8 in get_int ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
(gdb) bt
#​0 0x00007ffff7b7b7d8 in get_int ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​1 0x00007ffff7b7911e in get_attribute ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​2 0x00007ffff7b46635 in MVM_frame_find_invokee_multi_ok ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​3 0x00007ffff7b3a997 in MVM_interp_run ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​4 0x00007ffff7bd7eee in MVM_vm_run_file ()
  from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​5 0x000000000040101f in main ()

On Mon Jun 15 13​:37​:59 2015, bartolin@​gmx.de wrote​:

After Rakudo commit a6d2edc644 this command dies (with X​::AdHoc)​:

$ perl6 -e 'my $f = Sub.new(); say $f'
Cannot make a Sub object using .new
in block <unit> at -e​:1

I added a test to S06-other/misc.t with commit
Raku/roast@ff2dc709fd

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

@jonathanstowe - Status changed from 'resolved' to 'open'

@p6rt
Copy link
Author

p6rt commented Jun 23, 2015

From @jnthn

On Sat Jun 20 15​:06​:05 2015, jns+bc@​gellyfish.co.uk wrote​:

Hi,
This fixes the immediate problem bit it appears there is an underlying
issue with the construction of code like objects​:

my $a = Sub(0);

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b7b7d8 in get_int ()
from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
(gdb) bt
#​0 0x00007ffff7b7b7d8 in get_int ()
from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​1 0x00007ffff7b7911e in get_attribute ()
from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​2 0x00007ffff7b46635 in MVM_frame_find_invokee_multi_ok ()
from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​3 0x00007ffff7b3a997 in MVM_interp_run ()
from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​4 0x00007ffff7bd7eee in MVM_vm_run_file ()
from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so
#​5 0x000000000040101f in main ()

On Mon Jun 15 13​:37​:59 2015, bartolin@​gmx.de wrote​:

After Rakudo commit a6d2edc644 this command dies (with X​::AdHoc)​:

$ perl6 -e 'my $f = Sub.new(); say $f'
Cannot make a Sub object using .new
in block <unit> at -e​:1

I added a test to S06-other/misc.t with commit
Raku/roast@ff2dc709fd

I'm closing this ticket as 'resolved'.

Hunted down the various SEGVs in MoarVM and fixed those. Also added another test for the original bug that the nice error message did not cover (so exposing the VM SEGV), along with a test for the Sub(0) case.

@p6rt p6rt closed this as completed Jun 23, 2015
@p6rt
Copy link
Author

p6rt commented Jun 23, 2015

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant