-
Notifications
You must be signed in to change notification settings - Fork 530
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
strange race condition when using prototypes #21712
Comments
FWIW, I can't tell what "Expected behavior is that the $DISPATCH_TABLE variable would be populated but the k/v s accumulated via on (in Dispatch/Fu.pm) all the time, not just 75% of the time" means. (Also, there is no |
It's in Dispatch::Fu. The list of on() is parsed as I think the problem is this line:
It only works with the If I move So a bug in the code supplied, not in Dispatch::Fu and not in perl that I can see. |
It might be worth having on() warn in non-list context, which would catch this issue in user code. |
Sorry that's referencing the module code. @tonycoz - that was it, thanks for spotting that!! |
Rolling 1.00 (cherry picked from commit ce9c90a4d4343891c20759644dd8b9cf2f345f52) Signed-off-by: O. Odler, 577 <oodler@cpan.org>
Module:
Perl subroutine prototypes /
Dispatch::Fu
Description
I had to make this change in
Dispatch::Fu
in order to reliably populate$DISPATCH_TABLE
. The bug was triggered when runningdispatch
in a loop. Here's the commit to the change I had to make inDispatch::Fu
- it should be clear what the change is, it's not complicated but I am happy to clarify further. I've published 1.00 to CPAN since.oodler577/p5-Dispatch-Fu@1a4fdb9
Steps to Reproduce
Dispatch::Fu
0.99Expected behavior
Expected behavior is that the
$DISPATCH_TABLE
variable would be populated but the k/v s accumulated viaon
(inDispatch/Fu.pm
) all the time, not just 75% of the time. Seems like a weird race condition between prototypes and what I'm doing inDispatch::Fu
.Perl configuration
The text was updated successfully, but these errors were encountered: