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

Spurious Failures in successful require #1332

Closed
zoffixznet opened this issue Dec 23, 2017 · 3 comments
Closed

Spurious Failures in successful require #1332

zoffixznet opened this issue Dec 23, 2017 · 3 comments
Labels
BLOCKER Preventing the next release of rakudo, or just needing attention before the release

Comments

@zoffixznet
Copy link
Contributor

zoffixznet commented Dec 23, 2017

Need to run t/fudgeandrun S11-modules/require.t a few times to trigger this. The warnings reference two successful requires, so there should not be any Failures.

This can be worked around with (require ...) orelse Nil or (require ...) andthen Nil. I also stuck a .^name print statement into orelse there and it always prints the module's name, not a Failure.

2017.12.11 zoffix@VirtualBox~/CPANPRC/rakudo (master)$ t/fudgeandrun S11-modules/require.t
t/spec/S11-modules/require.t .. 
1..34
ok 1 - successful require PACKAGE returns PACKAGE
ok 2 - successful require STRING returns STRING
ok 3 - require Test installs stub Test package at compile time
ok 4 - can introspect EXPORT of require'd package
ok 5 - can call our-sub from required module
ok 6 - can load InnerModule from a path at run time
ok 7 - can load InnerModule from a variable at run time
ok 8 - can import symbol not inside module
ok 9 - can load InnerModule by name and path, with import list
ok 10 - &bar didn't leak to outer scope
    1..2
    ok 1 - code dies
    ok 2 - right exception type (X::Import::MissingSymbols)
ok 11 - &-less import of sub does not produce `Null PMC access` error
WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it as handled by calling .Bool, .so, .not, or .defined methods. The Failure was:
No such symbol 'InnerModule'
  in block <unit> at t/spec/S11-modules/require.t line 47

WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it as handled by calling .Bool, .so, .not, or .defined methods. The Failure was:
No such symbol 'S11-modules::NoModule'
  in block <unit> at t/spec/S11-modules/require.t line 41

ok 12 - can call our-sub from required module
ok 13 - can load Fancy::Utilities at run time
ok 14 - can require with variable name
ok 15 - can call subroutines in a module by name
ok 16 - package returned from Fancy::Utilities matches the indirect lookup
ok 17 - require with import list
ok 18 - loading modules does not clobber GLOBAL
ok 19 - can change directory and require a module
ok 20 - requiring something non-existent does not make it segfault
    1..2
    ok 1 - code dies
    ok 2 - right exception type (X::Import::MissingSymbols)
ok 21 - throws correct exception
ok 22 - require works at BEGIN
ok 23 - require can import at BEGIN
ok 24 - got outer symbol
ok 25 - call method that causes a require
ok 26 - Did not find inner symbol
ok 27 - Cool::Utils has been merged
ok 28 - Cool::Utils was returned
ok 29 - 1. multiple requires with top level package already defined
ok 30 - 2. multiple requires with top level package already defined
ok 31 - 3. multiple requires with top level package already defined
ok 32 - class in required package
ok 33 - class in long required package name
ok 34 - require class with set constant
ok
All tests successful.
Files=1, Tests=34,  1 wallclock secs ( 0.03 usr  0.00 sys +  1.19 cusr  0.22 csys =  1.44 CPU)
Result: PASS
2017.12.11 zoffix@VirtualBox~/CPANPRC/rakudo (master)$ ./perl6 -v
This is Rakudo version 2017.12-15-g57d164b built on MoarVM version 2017.12-1-g912f967
implementing Perl 6.c.
2017.12.11 zoffix@VirtualBox~/CPANPRC/rakudo (master)$ 

Same symptoms in RT#131996. Closing it in favour of this Issue, since this one is easier to repro.

@zoffixznet
Copy link
Contributor Author

Worth mentioning: this test file on occasion flops during stresstests

@AlexDaniel AlexDaniel added the BLOCKER Preventing the next release of rakudo, or just needing attention before the release label Apr 25, 2018
@AlexDaniel
Copy link
Contributor

Adding the blocker label (for 2018.05 release) because it constantly flops in release-related operations. (example)

niner added a commit that referenced this issue Apr 25, 2018
We compiled a require unconditionally to the actual module loading code plus
an indirect lookup of the loaded module. If the loaded comp unit does not
actually contain a module with that name the lookup would fail. However we
don't sink require's return value so the Failure would escape.
Fix by only compiling the indirect lookup when someone's actually interested
in the result.
Seems to fix GH #1332
@niner
Copy link
Collaborator

niner commented Apr 25, 2018

Hopefully fixed in commit 666eb3a though the stated diagnosis was only really true for the first Failure. But with that fixed I fail to reproduce the others, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKER Preventing the next release of rakudo, or just needing attention before the release
Projects
None yet
Development

No branches or pull requests

3 participants