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 in ObjAt initialization #3413

Closed
p6rt opened this issue Jun 13, 2014 · 8 comments
Closed

Segfault in ObjAt initialization #3413

p6rt opened this issue Jun 13, 2014 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Jun 13, 2014

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

Searchable as RT122094$

@p6rt
Copy link
Author

p6rt commented Jun 13, 2014

From pjablons@conncoll.edu

In the REPL, the following line leads to a crash, with the error message "Segmentation fault (core dumped)"​:

ObjAt.new(​:val("test"));

For whatever reason, passing bogus named parameters to ObjAt (in the REPL) causes a segfault, but the issue doesn't present itself with other classes (at least that I've tried).

Perl6 version​: 2014.04 built on MoarVM 2014.04
OS​: Fedora 20 x64

@p6rt
Copy link
Author

p6rt commented Oct 20, 2014

From @usev6

Status update​: This (still) segfaults on Moar (REPL only), but runs fine on Parrot and JVM.

@p6rt
Copy link
Author

p6rt commented Oct 20, 2014

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

@p6rt
Copy link
Author

p6rt commented Jan 30, 2015

From @usev6

Actually one got a segfault (or a NullPointerException on JVM) until recently with the following code (not specific to REPL)​:

$ perl6-m -e 'my $foo = ObjAt.new(​:val("test")); $foo ~~ /"foo"/'
Segmentation fault
$ perl6-j -e 'my $foo = ObjAt.new(​:val("test")); $foo ~~ /"foo"/'
java.lang.NullPointerException
  in method ACCEPTS at gen/jvm/CORE.setting​:14541
  in block <unit> at -e​:1

Parrot gave an error message though​:

$ perl6-p -e 'my $foo = ObjAt.new(​:val("test")); $foo ~~ /"foo"/'
Invalid operation on null string
  in regex at -e​:1
  in method ACCEPTS at gen/parrot/CORE.setting​:14551
  in method ACCEPTS at gen/parrot/CORE.setting​:886
  in block <unit> at -e​:1

This was fixed with commit rakudo/rakudo@403b0f0687. The problem seemed to be that there where methods "Str" and "gist" which happily tried to nqp​::unbox_x(self) when self was null.

However, the above command now dies because it requires a positional parameter to be passed​:

$ perl6-m -e 'my $foo = ObjAt.new(​:val("test")); $foo ~~ /"foo"/'
Too few positionals passed; expected 2 arguments but got 1
  in method new at src/gen/m-CORE.setting​:20008
  in block <unit> at -e​:1

$ perl6-p -e 'my $foo = ObjAt.new(​:val("test")); $foo ~~ /"foo"/' ## same output for perl6-j
Not enough positional parameters passed; got 1 but expected 2
  in method new at gen/parrot/CORE.setting​:20154
  in block <unit> at -e​:1

@p6rt
Copy link
Author

p6rt commented Jan 30, 2015

From @usev6

Oops, it was fixed with commit rakudo/rakudo@cb5bb33c1b (moritz++)

@p6rt
Copy link
Author

p6rt commented Mar 3, 2015

From @usev6

The new test file S02-types/built-in.t is now included in t/spectest.data​: rakudo/rakudo@01c3faf9c5

I'm closing this ticket as resolved.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Mar 3, 2015

From @usev6

The new test file S02-types/built-in.t is now included in t/spectest.data​: rakudo/rakudo@01c3faf9c5

I'm closing this ticket as resolved.

@p6rt p6rt closed this as completed Mar 3, 2015
@p6rt
Copy link
Author

p6rt commented Mar 3, 2015

@usev6 - 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