-
Notifications
You must be signed in to change notification settings - Fork 4
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
Test suite fails with perl 5.39.4+ #14
Comments
@eserte It looks like something changed (broke?) handling of DESTROY. I may not have the bandwidth to diagnose the issue myself, unfortunately. |
Ah, it's already known: Perl/perl5#21524 |
The issue is that a change around 5.18 broke the documented behaviour of eval EXPR in package DB by not maintaining the OUTSIDE links for each closure. This means that with the way the failing Promise::ES6 test works you can end up with a reference loop between the closures and (I think) the This can be avoided in the test by not making the outer scopes visible, for example
though there may be prettier fixes. I asked on the list to see if anyone else had any ideas but didn't receive any solutions. |
Tests don't pass on perl v5.40.0 either. |
I haven't taken the time to dig into this and am unlikely to do so. (Too many other priorities, sorry.) I could:
Any other ideas? |
This solution works by making the event handlers not closures. Fixes FGasper#14
This solution works by breaking the loop between @resolves, and the closures the objects it contains, contain Fixes FGasper#14
@tonycoz I noticed all your changes were in the test scripts. Does that mean that I should install and use Promise::ES6 on perl v5.40 if I need it, skipping tests, and it should work perfectly? |
@tonycoz Thank you for your PRs. I hesitate, though, to merge them because they seem to solve the problem in ways that no pure-Perl programmer (i.e., someone who doesn’t grok Perl internals) would reasonably understand. Are the “OUTSIDE links for each closure” an implementation detail of Perl? Is that correct? If so, would a fix to the interpreter be possible so that pure-Perl code won’t encounter this problem? |
The problem is a reference loop. 5.18 broke the reference loop allowing your test to pass, but broke the documented 5.39.4 fixed that documented behaviour, but that means all subs, not just those with evals, need to keep a reference to their containing scope. This meant that the reference loop which your test documented as fixed in 5.18 was reinstated in 5.39.4. I spent a lot of time trying to find a solution, including asking on the p5p list, but didn't receive any feedback with a solution. So I went with the fix to the documented behaviour. |
This makes sense; thank you for clarifying.For posterity, though: where is it documented that subs retain a reference to their containing scope?-FGOn Aug 19, 2024, at 01:23, Tony Cook ***@***.***> wrote:
I hesitate, though, to merge them because they seem to solve the problem in ways that no pure-Perl programmer (i.e., someone who doesn’t grok Perl internals) would reasonably understand. Are the “OUTSIDE links for each closure” an implementation detail of Perl?
Is that correct? If so, would a fix to the interpreter be possible so that pure-Perl code won’t encounter this problem?
The problem is a reference loop.
5.18 broke the reference loop allowing your test to pass, but broke the documented eval "" in package DB behaviour that the debugger depends on, by removing the reference held by subs containing no normal eval on their containing scope.
5.39.4 fixed that documented behaviour, but that means all subs, not just those with evals, need to keep a reference to their containing scope.
This meant that the reference loop which your test documented as fixed in 5.18 was reinstated in 5.39.4.
I spent a lot of time trying to find a solution, including asking on the p5p list, but didn't receive any feedback with a solution.
So I went with the fix to the documented behaviour.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
It appears that @FGasper is still waiting for an answer to a question that was garbled in the GH interface. @tonycoz, can you clarify? (I'd like to see if we can close Perl/perl5#21524.) Thanks. |
The PSC said:
so I'm waiting on that. |
@tonycoz any update? |
It looks like discussions are still in progress to revert the change to perl. It still means this module is going to be broken on 5.40.0 but I'm trying the patch to see if it resolves this completely Perl/perl5#22635 |
See subject, and see http://matrix.cpantesters.org/?dist=Promise-ES6+0.28 for an overview.
Feel free to open a BBC if you think that bleadperl does not behave correctly here.
The text was updated successfully, but these errors were encountered: