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

Segmentation fault when calling a routine having a native parameter with a type object argument in Rakudo #3678

Closed
p6rt opened this issue Feb 11, 2015 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Feb 11, 2015

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

Searchable as RT123789$

@p6rt
Copy link
Author

p6rt commented Feb 11, 2015

From @masak

<TimToady> m​: sub foo(int​:U $x) { $x };
<camelia> rakudo-moar f53a94​: ( no output )
<TimToady> m​: sub foo(int​:U $x) { $x }; foo(1)
<camelia> rakudo-moar f53a94​: ( no output )
<jnthn> m​: sub foo(int $x) { $x }; foo(Int)
<camelia> rakudo-moar f53a94​: OUTPUT«(signal SEGV)»
* jnthn wonders what's to blame...
<jnthn> m​: my int $x = Int;
<camelia> rakudo-moar f53a94​: OUTPUT«Cannot unbox a type object␤ in
block <unit> at /tmp/ILlhXl0Hz5​:1␤␤»
<jnthn> TimToady​: Fixed the SEGV; thanks.
<jnthn> Though should really give it a spectest, except it's fixed in
a branch, so... :)
* jnthn pokes masakbot to submit an RT :P
* masakbot submits an RT
<masak> m​: class A { method foo(int $x) { $x } }; A.new.foo(Int)
<camelia> rakudo-moar f53a94​: OUTPUT«(signal SEGV)»
<masak> m​: sub foo(int $x) { say "haha!" }; foo(Int)
<camelia> rakudo-moar f53a94​: OUTPUT«(signal SEGV)»
<masak> m​: my int $x = Int; say "alive"
<camelia> rakudo-moar f53a94​: OUTPUT«Cannot unbox a type object␤ in
block <unit> at /tmp/NEZ6_sYpTa​:1␤␤»
<jnthn> masak​: That's what it reports locally now I've fixed it.
<jnthn> (Instead of the SEGVs)

@p6rt
Copy link
Author

p6rt commented Mar 9, 2015

From @FROGGS

Fixed by jnthn​:
FROGGS m​: sub foo(int $x) { $x }; foo(Int)
camelia rakudo-moar a49900​: OUTPUT«Cannot unbox a type object␤ in sub foo at /tmp/HhxDcb2kX0​:1␤ in block <unit> at /tmp/HhxDcb2kX0​:1␤␤»

@p6rt
Copy link
Author

p6rt commented Mar 9, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 10, 2015

From @usev6

I added a test for the 'sub(int $x) ...' example to S06-signature/types.t with commit Raku/roast@cae9192292. Please note that I had to expand the body of the sub a litte bit -- otherwise the command didn't die on rakudo.jvm​:

$ perl6-j -e 'sub foo(int $x) { $x }; foo(Int)'; echo $?
0

$ perl6-j -e 'sub foo(int $x) { say $x }; foo(Int)'
Cannot unbox a type object
  in sub foo at -e​:1
  in block <unit> at -e​:1

But more importantly, the simple case without any sub involved gives a segfault on rakudo.moar nowadays​:

$ perl6-m -e 'my int $x = Int'
Segmentation fault

$ perl6-j -e 'my int $x = Int'
Cannot unbox a type object
  in block <unit> at -e​:1

$ perl6-m --version
This is perl6 version 2015.02-252-ge395707 built on MoarVM version 2015.02-45-g86cb4db

@p6rt
Copy link
Author

p6rt commented Apr 12, 2015

From @jnthn

On Tue Mar 10 11​:17​:12 2015, bartolin@​gmx.de wrote​:

I added a test for the 'sub(int $x) ...' example to S06-
signature/types.t with commit
Raku/roast@cae9192292. Please note that I
had to expand the body of the sub a litte bit -- otherwise the command
didn't die on rakudo.jvm​:

$ perl6-j -e 'sub foo(int $x) { $x }; foo(Int)'; echo $?
0

$ perl6-j -e 'sub foo(int $x) { say $x }; foo(Int)'
Cannot unbox a type object
in sub foo at -e​:1
in block <unit> at -e​:1

But more importantly, the simple case without any sub involved gives a
segfault on rakudo.moar nowadays​:

$ perl6-m -e 'my int $x = Int'
Segmentation fault

$ perl6-j -e 'my int $x = Int'
Cannot unbox a type object
in block <unit> at -e​:1

$ perl6-m --version
This is perl6 version 2015.02-252-ge395707 built on MoarVM version
2015.02-45-g86cb4db

Fixed this case, and added a tests (also covering num and str) in S02-types/native.t.

@p6rt
Copy link
Author

p6rt commented Apr 12, 2015

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

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

No branches or pull requests

1 participant