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

NullPointerException when calling a sub which runs EVAL on minimal role declaration #3559

Closed
p6rt opened this issue Oct 17, 2014 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Oct 17, 2014

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

Searchable as RT123002$

@p6rt
Copy link
Author

p6rt commented Oct 17, 2014

From @usev6

I got a NullPointerException with a golfed version of a failing test from roast (test for RT #​114380 in S14-roles/basic.t). The test in question uses "eval_lives_ok" which does something similiar to the golfed example via Test.pm. The test in question runs fine with "lives_ok" instead of "eval_lives_ok"

$ perl6-j --version
This is perl6 version 2014.09-222-g0dcd0d6 built on JVM

$ perl6-j -e "sub foo { EVAL 'role R { }' }; foo; say 'alive'"
===SORRY!===
java.lang.NullPointerException

Using EVAL on the role declaration directly doesn't fail​:

$ perl6-j -e "EVAL 'role R { }'; say 'alive'"
alive

With the help from psch (http://irclog.perlgeek.de/perl6/2014-10-17#i_9527240) I tried to get some more info with jdb, but everything I got was​:

====
$ jdb -sourcepath nqp/src/vpathm/jvm/runtime/ -attach 8000
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...

VM Started​: No frames on the current call stack

main[1] catch java.lang.NullPointerException
Set all java.lang.NullPointerException
main[1] run

Exception occurred​: java.lang.NullPointerException (to be caught at​: 64411D3B4B0DBD5895A2F295CC3F75570C8D73C2.qb_54(), line=1,497 bci=2,686)"thread=main", org.perl6.nqp.runtime.Ops.getobjsc(), line=3,811 bci=1

main[1] up
main[2] list
Source file not found​: src/Perl6/World.nqp
main[2] resume
All threads resumed.

The application exited

Additional informations where available with --ll-exception​:

====
$ perl6-j --ll-exception -e "sub foo { EVAL 'role R { }' }; foo;"
java.lang.NullPointerException
  in compile_in_context (src/Perl6/World.nqp​:1497)
  in pkg_set_role_body_block (src/Perl6/World.nqp​:1745)
  in package_def (src/Perl6/Actions.nqp​:1953)
  in !reduce (gen/jvm/stage2/QRegex.nqp​:771)
  in !cursor_pass (gen/jvm/stage2/QRegex.nqp​:732)
  in package_def (src/Perl6/Grammar.nqp​:2395)
  in package_declarator​:sym<role> (src/Perl6/Grammar.nqp)
  in !protoregex (gen/jvm/stage2/QRegex.nqp​:808)
  in package_declarator (src/Perl6/Grammar.nqp)
  in term​:sym<package_declarator> (src/Perl6/Grammar.nqp)
  in !protoregex (gen/jvm/stage2/QRegex.nqp​:808)
  in term (src/Perl6/Grammar.nqp)
  in termish (src/Perl6/Grammar.nqp​:3557)
  in EXPR (gen/jvm/stage2/NQPHLL.nqp​:558)
  in EXPR (src/Perl6/Grammar.nqp​:3588)
  in statement (src/Perl6/Grammar.nqp​:1300)
  in statementlist (src/Perl6/Grammar.nqp​:1235)
  in LANG (gen/jvm/stage2/NQPHLL.nqp​:766)
  in FOREIGN_LANG (src/Perl6/Grammar.nqp​:1638)
  in comp_unit (src/Perl6/Grammar.nqp​:1093)
  in TOP (src/Perl6/Grammar.nqp​:356)
  in parse (gen/jvm/stage2/QRegex.nqp​:1400)
  in parse (gen/jvm/stage2/NQPHLL.nqp​:1425)
  in compile (gen/jvm/stage2/NQPHLL.nqp​:1381)
  in EVAL (gen/jvm/CORE.setting​:763)
  in EVAL (gen/jvm/CORE.setting​:756)
  in foo (-e​:1)
  in <unit> (-e​:1)
  in <unit-outer> (-e​:1)
  in eval (gen/jvm/stage2/NQPHLL.nqp​:1145)
  in (gen/jvm/stage2/NQPHLL.nqp​:1234)
  in command_eval (gen/jvm/stage2/NQPHLL.nqp​:1231)
  in command_eval (src/Perl6/Compiler.nqp​:17)
  in command_line (gen/jvm/stage2/NQPHLL.nqp​:1216)
  in MAIN (gen/jvm/main.nqp​:39)
  in <mainline> (gen/jvm/main.nqp​:35)
  in (gen/jvm/main.nqp)

@p6rt
Copy link
Author

p6rt commented Mar 4, 2015

From @donaldh

Fixed by Raku/nqp@0c4096e1e7

@p6rt
Copy link
Author

p6rt commented Mar 4, 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 to S14-roles/basic.t with commit Raku/roast@62ca417fa2

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Mar 10, 2015

From @usev6

I added a test to S14-roles/basic.t with commit Raku/roast@62ca417fa2

I'm closing this ticket as 'resolved'.

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

p6rt commented Mar 10, 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