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

nested lazy cross operators confuse the continuations #4578

Open
p6rt opened this issue Sep 23, 2015 · 5 comments
Open

nested lazy cross operators confuse the continuations #4578

p6rt opened this issue Sep 23, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Sep 23, 2015

Migrated from rt.perl.org#126139 (status was 'new')

Searchable as RT126139$

@p6rt
Copy link
Author

p6rt commented Sep 23, 2015

From @TimToady

18​:00 < TimToady> m​: my @​v := [1, 2]; my \step1 = 8 X* ^4; my \step2 = @​v
X+> step1; say step2 X% 256;
18​:00 <+camelia> rakudo-moar 631ac4​: OUTPUT«===SORRY!===␤Cannot invoke this
object (REPR​: Uninstantiable)␤»
18​:00 < TimToady> m​: my @​v := [1, 2]; my \step1 = (8 X* ^4).eager; my
\step2 = @​v X+> step1; say step2 X% 256;
18​:00 <+camelia> rakudo-moar 631ac4​: OUTPUT«(1 0 0 0 2 0 0 0)␤»

Putting eager on step1 fixes it, but putting eager anywhere else doesn't.

The stack trace indicates it's blowing up in sub GATHER, Seq.new, inside
the pull-one method where it calls nqp​::continuationreset(PROMPT,
&!resumption);

@p6rt
Copy link
Author

p6rt commented Jan 20, 2017

From @smls

  ➜ say 1, 2 Xand "ab".ords;
  Cannot invoke this object (REPR​: Uninstantiable; Callable)
  in block <unit> at -e line 1

Output with `--ll-exception`​: http://pastebin.com/raw/MfYJ8v6D

Interestingly, the following Rakudo performance-optimization commit
from 4 days ago actually fixes the problem for most operators (e.g.
`X+`)​:

* commit​: rakudo/rakudo@a26f513

* bisectable report​:
https://gist.github.com/Whateverable/64c152ed26ff96cba295b761414c763f

But as the commit message says, the "Xand family" is still using the
old code path.

@p6rt
Copy link
Author

p6rt commented Aug 26, 2017

From @smls

This bug is still present in

Rakudo version 2017.08-8-g753c9a5ea built on MoarVM version 2017.08.1-19-g151a2563
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Sep 12, 2017

From @smls

Merged two commits that I'm pretty sure are about the same issue.

On Tue, 22 Sep 2015 18​:09​:54 -0700, larry wrote​:

18​:00 < TimToady> m​: my @​v := [1, 2]; my \step1 = 8 X* ^4; my \step2 = @​v
X+> step1; say step2 X% 256;
18​:00 <+camelia> rakudo-moar 631ac4​: OUTPUT«===SORRY!===␤Cannot invoke this
object (REPR​: Uninstantiable)␤»

The original test-case posted by larry is among the ones that works correctly now, since¹ the aforementioned performance-optimization commit.

Golfed example that used to blow up before that commit, but now works​:

  say (1, 2 X* (3 X+> 4));

Golfed example that still blows up​:

  say (1, 2 Xand (3 Xand 4));


[1] https://gist.github.com/Whateverable/a662877edcb635eff937adb1f5c34275

@usev6
Copy link

usev6 commented Oct 9, 2023

The last example from the previous comment still blows up (the error message has probably changed):

$ ./rakudo-m -e 'say (1, 2 Xand (3 Xand 4))'
continuationreset requires a continuation or a code handle
  in block <unit> at -e line 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants