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

In a 'unit module', a 'die' along any CATCH block causes a compiler error #6425

Open
p6rt opened this issue Aug 4, 2017 · 6 comments
Open
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 4, 2017

Migrated from rt.perl.org#131841 (status was 'open')

Searchable as RT131841$

@p6rt
Copy link
Author

p6rt commented Aug 4, 2017

From darek.cidlinsky@atlas.cz

A minimal example​:
  echo 'unit module Foo; die; CATCH { }' > Foo.pm6; perl6 -I. -MFoo -e ''
That fails with a
  ===SORRY!===
  Cannot invoke this object (REPR​: Null; VMNull)

With a --ll-exception switch, it yields
  Unhandled exception​: concatenate requires a concrete string, but got null
  at gen/moar/stage2/NQPCORE.setting​:840 (...path...)
  from gen/moar/stage2/NQPHLL.nqp​:1735 (...)
  from src/Perl6/Compiler.nqp​:42 (...)
  (...)

The same happens even if we catch the exception (and probably no matter
what the CATCH block does)​:
  echo 'unit module Foo; die; CATCH { default { .say } }' > Foo.pm6; perl6 -I. -MFoo -e ''
And it happens no matter what the type of the exception is​:
  echo 'unit module Foo; X​::Proc​::Unsuccessful.new.throw; CATCH { default { .say } }' > Foo.pm6; perl6 -I. -MFoo -e ''

On the other hand, if we use 'module Foo { }' or try it in a script,
everything works OK​:
  perl6 -e 'die; CATCH { }'
  echo 'module Foo { die; CATCH { } }' > Foo.pm6; perl6 -I. -MFoo -e ''

D.

@p6rt
Copy link
Author

p6rt commented Aug 7, 2017

From darek.cidlinsky@atlas.cz

It should be added that this bugreport pertains to the version 2017.07​:

  This is Rakudo version 2017.07 built on MoarVM version 2017.07
  implementing Perl 6.c.

D.

@p6rt
Copy link
Author

p6rt commented Aug 7, 2017

From @timo

Annoyingly, 2017.07 has a bug that makes every --ll-exception print that
exact error. Here's what a newer version of rakudo gives you​:

Cannot invoke this object (REPR​: Null; VMNull)
at SETTING​::src/core/Exception.pm​:57
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:throw)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:81
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:79
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from <unknown>​:1
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from <unknown>​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:)
from SETTING​::src/core/Exception.pm​:54
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:throw)
from SETTING​::src/core/control.pm​:170
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:die)
from SETTING​::src/core/control.pm​:166
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:die)
from /tmp/Foo.pm6 (Foo)​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:)
from /tmp/Foo.pm6 (Foo)​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:<unit>)
from /tmp/Foo.pm6 (Foo)​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:<unit-outer>)
from <unknown>​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:<load>)
from SETTING​::src/core/CompUnit/Loader.pm​:50
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load-precompilation-file)
from SETTING​::src/core/CompUnit/Loader.pm​:33
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load-precompilation-file)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:71
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load-handle-for-path)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:195
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:191
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:166
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:46
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:try-load)
from SETTING​::src/core/CompUnit/Repository/FileSystem.pm​:128
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from SETTING​::src/core/CompUnit/Repository/FileSystem.pm​:121
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:need)
from src/Perl6/World.nqp​:1218
(/home/timo/perl6/install/share/nqp/lib/Perl6/World.moarvm​:load_module)
from src/Perl6/World.nqp​:1148
(/home/timo/perl6/install/share/nqp/lib/Perl6/World.moarvm​:do_pragma_or_load_module)
from src/Perl6/World.nqp​:616
(/home/timo/perl6/install/share/nqp/lib/Perl6/World.moarvm​:loading_and_symbol_setup)
from src/Perl6/Grammar.nqp​:1188
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:comp_unit)
from src/Perl6/Grammar.nqp​:495
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:TOP)
from gen/moar/stage2/QRegex.nqp​:2324
(/home/timo/perl6/install/share/nqp/lib/QRegex.moarvm​:parse)
from gen/moar/stage2/NQPHLL.nqp​:1935
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:parse)
from gen/moar/stage2/NQPHLL.nqp​:1848
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:execute_stage)
from gen/moar/stage2/NQPHLL.nqp​:1884
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:run)
from gen/moar/stage2/NQPHLL.nqp​:1887
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:)
from gen/moar/stage2/NQPHLL.nqp​:1873
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:compile)
from gen/moar/stage2/NQPHLL.nqp​:1588
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:eval)
from gen/moar/stage2/NQPHLL.nqp​:1713
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:)
from gen/moar/stage2/NQPHLL.nqp​:1753
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:command_eval)
from src/Perl6/Compiler.nqp​:42
(/home/timo/perl6/install/share/nqp/lib/Perl6/Compiler.moarvm​:command_eval)
from gen/moar/stage2/NQPHLL.nqp​:1694
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:command_line)
from gen/moar/main.nqp​:47
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:MAIN)
from gen/moar/main.nqp​:38
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:<mainline>)
from <unknown>​:1
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:<main>)
from <unknown>​:1
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:<entry>)

This is Rakudo version 2017.07-137-g46ef1b5 built on MoarVM version
2017.07-346-g0fe5cd6

@p6rt
Copy link
Author

p6rt commented Aug 7, 2017

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

@p6rt
Copy link
Author

p6rt commented Aug 8, 2017

From darek.cidlinsky@atlas.cz

Aaah, that explains quite some things! Thank you for pointing it out.

D.

Die 07.08.2017, hora 11​:08, Timo Paulssen via RT hoc scripsit​:

Annoyingly, 2017.07 has a bug that makes every --ll-exception print that
exact error. Here's what a newer version of rakudo gives you​:

Cannot invoke this object (REPR​: Null; VMNull)
at SETTING​::src/core/Exception.pm​:57
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:throw)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:81
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:79
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from <unknown>​:1
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from <unknown>​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:)
from SETTING​::src/core/Exception.pm​:54
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:throw)
from SETTING​::src/core/control.pm​:170
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:die)
from SETTING​::src/core/control.pm​:166
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:die)
from /tmp/Foo.pm6 (Foo)​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:)
from /tmp/Foo.pm6 (Foo)​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:<unit>)
from /tmp/Foo.pm6 (Foo)​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:<unit-outer>)
from <unknown>​:1
(/tmp/.precomp/D9F3CABC797F4C68B8C92AB15C271BDDF8756DF0.1502129121.89224/20/201A6B3053CC1422D2C3670B62616221D2290929​:<load>)
from SETTING​::src/core/CompUnit/Loader.pm​:50
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load-precompilation-file)
from SETTING​::src/core/CompUnit/Loader.pm​:33
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load-precompilation-file)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:71
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load-handle-for-path)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:195
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:191
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:166
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:load)
from SETTING​::src/core/CompUnit/PrecompilationRepository.pm​:46
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:try-load)
from SETTING​::src/core/CompUnit/Repository/FileSystem.pm​:128
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:)
from SETTING​::src/core/CompUnit/Repository/FileSystem.pm​:121
(/home/timo/perl6/install/share/perl6/runtime/CORE.setting.moarvm​:need)
from src/Perl6/World.nqp​:1218
(/home/timo/perl6/install/share/nqp/lib/Perl6/World.moarvm​:load_module)
from src/Perl6/World.nqp​:1148
(/home/timo/perl6/install/share/nqp/lib/Perl6/World.moarvm​:do_pragma_or_load_module)
from src/Perl6/World.nqp​:616
(/home/timo/perl6/install/share/nqp/lib/Perl6/World.moarvm​:loading_and_symbol_setup)
from src/Perl6/Grammar.nqp​:1188
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:comp_unit)
from src/Perl6/Grammar.nqp​:495
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:TOP)
from gen/moar/stage2/QRegex.nqp​:2324
(/home/timo/perl6/install/share/nqp/lib/QRegex.moarvm​:parse)
from gen/moar/stage2/NQPHLL.nqp​:1935
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:parse)
from gen/moar/stage2/NQPHLL.nqp​:1848
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:execute_stage)
from gen/moar/stage2/NQPHLL.nqp​:1884
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:run)
from gen/moar/stage2/NQPHLL.nqp​:1887
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:)
from gen/moar/stage2/NQPHLL.nqp​:1873
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:compile)
from gen/moar/stage2/NQPHLL.nqp​:1588
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:eval)
from gen/moar/stage2/NQPHLL.nqp​:1713
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:)
from gen/moar/stage2/NQPHLL.nqp​:1753
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:command_eval)
from src/Perl6/Compiler.nqp​:42
(/home/timo/perl6/install/share/nqp/lib/Perl6/Compiler.moarvm​:command_eval)
from gen/moar/stage2/NQPHLL.nqp​:1694
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:command_line)
from gen/moar/main.nqp​:47
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:MAIN)
from gen/moar/main.nqp​:38
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:<mainline>)
from <unknown>​:1
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:<main>)
from <unknown>​:1
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:<entry>)

This is Rakudo version 2017.07-137-g46ef1b5 built on MoarVM version
2017.07-346-g0fe5cd6

@p6rt
Copy link
Author

p6rt commented Aug 10, 2017

From @zoffixznet

On Mon, 07 Aug 2017 11​:08​:07 -0700, timo wrote​:

Annoyingly, 2017.07 has a bug that makes every --ll-exception print
that

Just for reference, if needed, it's possible to work around that bug by telling rakudo to use a custom exceptions handler​:

  cd $(mktemp -d)
  mkdir Exceptions
  echo 'class Exceptions​::Foo {
  method process ($e) {
  say "$e.message() $e.backtrace.full()";
  False
  }
  }' > Exceptions/Foo.pm6

  RAKUDO_EXCEPTIONS_HANDLER=Foo perl6 -I. -MExceptions​::Foo -e '…'

@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