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
Regex code block closing over lexical variable, is not threadsafe #6437
Comments
From @smlsThis bug was found as a side-effect of RT #131870, but might be a ➜ await ^10 .map: -> $i { start { "".match(/ { say $i } /) } } Somehow, multiple iterations see the same value for the closed-over Without the `await` and `start`, it prints each number from 0 to 9 Note that the problem is only with *code blocks* inside regexes. When a ➜ say await ^10 .map: -> $i { start { "0123456789".match(/ $i /) } } Bot-friendly version that reliably prints `False`, even though it should my $c = Channel.new; (await ^100 .map: -> $i { start "".match(/ { According to bisectable6 and committable6 this prints `False` for all |
From @dogbert17On Wed, 09 Aug 2017 13:06:46 -0700, smls75@gmail.com wrote:
Fixed with one or more of (better-sched)
|
The RT System itself - Status changed from 'new' to 'open' |
From @AlexDanielOK, first of all, a bot-friendly (whateverable-friendly specifically) version of the first snippet is here: say run(:out, <perl6 -e>, ‘await ^100 .map: -> $i { start { "".match(/ { print $i } /) } }’).out.slurp-rest eq (^100).join And that points to the better-sched merge as noted by dogbert++ The second snippet is faulty in a completely different way, but it is also fixed. So the second snippet is living its own life which is probably more interesting than mine: On 2015.12 and onwards it was giving False. Then it was fixed (?) in: (2017-12-19) rakudo/rakudo@c51f179 and therefore started to give True. However, after this commit it got broken (?) again: (2018-02-07) rakudo/rakudo@c0c7756 and therefore started to give False. But it didn't take long to fix that again in: (2018-03-04) rakudo/rakudo@fb882d4 and so now it gives True again. Please write tests for this so that it does not get worse than that :) ***⚠ if you write tests, please test both snippets ⚠*** On 2017-08-09 13:06:46, smls75@gmail.com wrote:
|
Migrated from rt.perl.org#131871 (status was 'open')
Searchable as RT131871$
The text was updated successfully, but these errors were encountered: