Skip Menu |
Report information
Id: 127987
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: smls75 [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Block.assuming method apparently not reentrant
The following works fine: for (^100).race(batch=>1) { {1 + $^a}(10) } But the following pretty reliably crashes: for (^100).race(batch=>1) { {1 + $^a}.assuming(10)() } If even crashes when EVAL is used to make sure each thread has a completely different closure: for (^100).race(batch=>1) { EVAL(q[ ({1 + $^a}) ]).assuming(10)() } It doesn't always crash with the same error message. But it always seems to be a variation of one of the following four: P6opaque: no such attribute '$!named' in any named at gen/moar/stage2/QASTNode.nqp line 30 ... Parameter '$a' requires a type object of type Int, but an object instance was passed. Did you forget a 'multi'? in block Cannot call postfix:<++>(Int); none of these signatures match: ... in block No such symbol 'primers' at ...EVAL_10:4 ------> $self(primersā.list[0], |{ %ahash, %chash }); # |{} wo The code fragment that the last one quotes, is from src/core/Block.pm. ----- This is Rakudo version 2016.04-33-gf05c77b built on MoarVM version 2016.04 implementing Perl 6.c.
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 677b
On Mon Apr 25 06:10:50 2016, smls75@gmail.com wrote: Show quoted text
> The following works fine: > > for (^100).race(batch=>1) { {1 + $^a}(10) } > > But the following pretty reliably crashes: > > for (^100).race(batch=>1) { {1 + $^a}.assuming(10)() } > > If even crashes when EVAL is used to make sure each thread has a > completely different closure: > > for (^100).race(batch=>1) { EVAL(q[ ({1 + $^a}) ]).assuming(10)() } >
I believe `assuming` uses `EVAL` under the hood, and that it's `EVAL` having reentrancy issues that is at the heart of it. So adding an extra `EVAL` is only making it worse. (And yes, this is fairly high on my list of stuff to hunt down and fix.) /jnthn
Download (untitled) / with headers
text/plain 127b
Still present on This is Rakudo version 2016.06-154-g55c359e built on MoarVM version 2016.06-9-g8fc21d5 implementing Perl 6.c.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org