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

LEAVE inside a block is leaking internals on sub exit #5547

Open
p6rt opened this issue Aug 8, 2016 · 2 comments
Open

LEAVE inside a block is leaking internals on sub exit #5547

p6rt opened this issue Aug 8, 2016 · 2 comments
Labels
bootstrap regression Issue did not exist previously

Comments

@p6rt
Copy link

p6rt commented Aug 8, 2016

Migrated from rt.perl.org#128872 (status was 'new')

Searchable as RT128872$

@p6rt
Copy link
Author

p6rt commented Aug 8, 2016

From @AlexDaniel

First let's take a look at example that works​:

Code​:
sub foo {
    say ‘start’;
    {
        LEAVE { say ‘block left’ }
        return 42;
    }
    say ‘end’;
}
say foo;

Result​:
start
block left
42

↑ Fine, no problem here. Now let's remove the first “say”​:

Code​:
sub foo {
    {
        LEAVE { say ‘block left’ }
        return 42;
    }
    say ‘end’;
}
say foo;

Current Result​:
block left
0

Oops. What is 0? Why 0?
If we print it's .^name, then it is BOOTInt.

bisectable is giving a list of commits that could have introduced the problem​:
e609822f01b82608b1b1c869032c95e9641172ce
615d30c39eba318f7449b94bbbd0295e2fd75387
8beb87b415014254412409d56378afb3ed5f14d9
05170e0c14969663c816ee1c5aaa019d70938247
899e0fd4c1ce51bc492666ffc69627c502f657f7
e5443765d4bce0697c6191dd2b17db3044e027ab
fcd0093b43614ce91caeb8c23e2bbcff68d54f72
04929feeb06fa851d77ef5efa6be35248301f88c
7ee6578ce99aae069349c283012ae7e45dfd75ec
519e76487ddd1546b319bfbd47661beac2417d61

Seems like it is associated with the merge of return-without-lexotic branch.

Just in case, IRC log​: http://irclog.perlgeek.de/perl6/2016-08-08#i_12984076

@p6rt
Copy link
Author

p6rt commented Dec 30, 2016

From @AlexDaniel

Code​:
sub foo { LEAVE { say �block left� }; return 42 }; say foo

Result (2015.12,2016.05)​:
block left
42

Result (2016.06,HEAD)​:
block left
0

Not sure where would this 0 come from.

Bisectable gives this list of possible causes (similarly to https://rt-archive.perl.org/perl6/Ticket/Display.html?id=130442 )​:
e609822f01b82608b1b1c869032c95e9641172ce
615d30c39eba318f7449b94bbbd0295e2fd75387
8beb87b415014254412409d56378afb3ed5f14d9
05170e0c14969663c816ee1c5aaa019d70938247
899e0fd4c1ce51bc492666ffc69627c502f657f7
e5443765d4bce0697c6191dd2b17db3044e027ab
fcd0093b43614ce91caeb8c23e2bbcff68d54f72
04929feeb06fa851d77ef5efa6be35248301f88c
7ee6578ce99aae069349c283012ae7e45dfd75ec
519e76487ddd1546b319bfbd47661beac2417d61

@p6rt p6rt added bootstrap regression Issue did not exist previously labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bootstrap regression Issue did not exist previously
Projects
None yet
Development

No branches or pull requests

1 participant