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

Deadlock when using multiple CATCH + rethrow #3080

Open
ugexe opened this issue Jul 23, 2019 · 2 comments
Open

Deadlock when using multiple CATCH + rethrow #3080

ugexe opened this issue Jul 23, 2019 · 2 comments
Labels
phasers tests needed Issue is generally resolved but tests were not written yet

Comments

@ugexe
Copy link
Member

ugexe commented Jul 23, 2019

The Problem

perl6 -Mnqp -e '                              \
    loop {                                    \
        say ++$;                              \
        CATCH { default { } };                \
        {                                     \
            CATCH { };                        \
            my $ex := nqp::newexception();    \
            try nqp::setmessage($ex, "test"); \
            nqp::rethrow($ex);                \
        }                                     \
    }
'

This program deadlocks. See: https://colabti.org/irclogger/irclogger_log/perl6-dev?date=2019-07-23#l183 -- this is a golf of the deadlock when doing:
perl6 -e 'loop { say ++$; my $r = run("xxx"); }'

but works with MVM_SPESH_DISABLE=1

Expected Behavior

The program should run indefinitely

Actual Behavior

The program deadlocks after some number of iterations

Environment

  • Operating system: OSX
  • Compiler version (perl6 -v): This is Rakudo version 2019.03.1-683-g20e74837a built on MoarVM version 2019.07-5-gdefe0a959 implementing Perl 6.d.
@voldenet
Copy link

Using nqp::throw instead of nqp::rethrow also produces similar bug, but default awaiter users rethrow.

@dogbert17
Copy link

This seems to work now with

dogbert@dogbert-VirtualBox:~/repos/rakudo$ perl6 -v
Welcome to 𝐑𝐚𝐤𝐮𝐝𝐨™ v2020.09-88-gc37ffe71b.
Implementing the 𝐑𝐚𝐤𝐮™ programming language v6.d.
Built on MoarVM version 2020.09-15-g4b06df1a6.

@vrurg vrurg added the tests needed Issue is generally resolved but tests were not written yet label Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
phasers tests needed Issue is generally resolved but tests were not written yet
Projects
None yet
Development

No branches or pull requests

5 participants