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

Block.assuming method apparently not reentrant #5264

Open
p6rt opened this issue Apr 25, 2016 · 4 comments
Open

Block.assuming method apparently not reentrant #5264

p6rt opened this issue Apr 25, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 25, 2016

Migrated from rt.perl.org#127987 (status was 'open')

Searchable as RT127987$

@p6rt
Copy link
Author

p6rt commented Apr 25, 2016

From @smls

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.

@p6rt
Copy link
Author

p6rt commented Apr 27, 2016

From @jnthn

On Mon Apr 25 06​:10​:50 2016, smls75@​gmail.com wrote​:

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

@p6rt
Copy link
Author

p6rt commented Apr 27, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 9, 2016

From @zoffixznet

Still present on This is Rakudo version 2016.06-154-g55c359e built on MoarVM version 2016.06-9-g8fc21d5
implementing Perl 6.c.

@p6rt p6rt added the conc label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant