Skip Menu |
Report information
Id: 131841
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: darek.cidlinsky [at] atlas.cz
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] In a 'unit module', a 'die' along any CATCH block causes a compiler error
From: Darek Cidlinský <darek.cidlinsky [...] atlas.cz>
To: rakudobug [...] perl.org
Date: Fri, 4 Aug 2017 22:37:35 +0200
Download (untitled) / with headers
text/plain 1006b
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.
To: perl6 via RT <perl6-bugs-followup [...] perl.org>
Subject: Re: [perl #131841] AutoReply: [BUG] In a 'unit module', a 'die' along any CATCH block causes a compiler error
From: Darek Cidlinský <darek.cidlinsky [...] atlas.cz>
Date: Fri, 4 Aug 2017 22:56:32 +0200
Download (untitled) / with headers
text/plain 165b
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.
To: perl6-compiler [...] perl.org
Date: Mon, 7 Aug 2017 20:07:13 +0200
Subject: Re: [perl #131841] AutoReply: [BUG] In a 'unit module', a 'die' along any CATCH block causes a compiler error
From: Timo Paulssen <timo [...] wakelift.de>
Download (untitled) / with headers
text/plain 5.1k
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: Show quoted text
> 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
To: Timo Paulssen via RT <perl6-bugs-followup [...] perl.org>
From: Darek Cidlinský <darek.cidlinsky [...] atlas.cz>
Subject: Re: [perl #131841] AutoReply: [BUG] In a 'unit module', a 'die' along any CATCH block causes a compiler error
Date: Tue, 8 Aug 2017 01:09:31 +0200
Download (untitled) / with headers
text/plain 5.4k
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: Show quoted text
> 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 >
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 564b
On Mon, 07 Aug 2017 11:08:07 -0700, timo wrote: Show quoted text
> 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 '…'


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org