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

`xx` with large Int repeat count gives bogus results #6136

Open
p6rt opened this issue Mar 8, 2017 · 4 comments
Open

`xx` with large Int repeat count gives bogus results #6136

p6rt opened this issue Mar 8, 2017 · 4 comments
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Mar 8, 2017

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

Searchable as RT130956$

@p6rt
Copy link
Author

@p6rt p6rt commented Mar 8, 2017

From @zoffixznet

15​:53 m​: dd (($++ ?? 42 !! |()) xx 9999999999999999999)[^4]
15​:53 camelia rakudo-moar 0633f0​: OUTPUT​: «(Nil, Nil, Nil, Nil)␤»
15​:53 IOninja m​: dd (($++ ?? 42 !! |()) xx 999)[^4]
15​:53 camelia rakudo-moar 0633f0​: OUTPUT​: «(42, 42, 42, 42)␤»

Also, giving huge values that don't yet trigger the above bug causes a hang,
perhaps it shouldn't be refying everything?

m​: dd (($++ ?? 42 !! |()) xx 99999999999999)[^4]
camelia │ rakudo-moar 0633f0​: OUTPUT​: «(timeout)»

@p6rt
Copy link
Author

@p6rt p6rt commented Mar 8, 2017

From @lizmat

On 8 Mar 2017, at 16​:56, Zoffix Znet (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Zoffix Znet
# Please include the string​: [perl #​130956]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=130956 >

15​:53 m​: dd (($++ ?? 42 !! |()) xx 9999999999999999999)[^4]
15​:53 camelia rakudo-moar 0633f0​: OUTPUT​: «(Nil, Nil, Nil, Nil)␤»
15​:53 IOninja m​: dd (($++ ?? 42 !! |()) xx 999)[^4]
15​:53 camelia rakudo-moar 0633f0​: OUTPUT​: «(42, 42, 42, 42)␤»

Also, giving huge values that don't yet trigger the above bug causes a hang,
perhaps it shouldn't be refying everything?

m​: dd (($++ ?? 42 !! |()) xx 99999999999999)[^4]
camelia │ rakudo-moar 0633f0​: OUTPUT​: «(timeout)»

Turning xx into a Seq is already on my radar and I already have a patch for it.

But first I needed to make sure that HYPER could handle Seq’s as a result of the infix op. That’s been fixed now. Currently look at one other spectest fail.

@p6rt
Copy link
Author

@p6rt p6rt commented Mar 8, 2017

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

@p6rt
Copy link
Author

@p6rt p6rt commented Mar 10, 2017

From @lizmat

The 42 xx 999999999999999 case is fixed with rakudo/rakudo@f190f24 .

Not having an Empty indicate the end can only be done by breaking at least two spectests. Also​:

  (|(),) xx 42

would then hang. So this feels like something that cannot be fixed generally, unless we accept the hanging behaviour of this example.

I also have a patch for the thunked version of xx. But alas, this still breaks a couple of spectests that do​:

  my $a = 0; ($a++,) xx 42; # note the xx Seq is in sink context

So for some reason, it looks like the Seq.sink-all is not doing any pull-one’s. Still investigating!

On 8 Mar 2017, at 16​:56, Zoffix Znet (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Zoffix Znet
# Please include the string​: [perl #​130956]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=130956 >

15​:53 m​: dd (($++ ?? 42 !! |()) xx 9999999999999999999)[^4]
15​:53 camelia rakudo-moar 0633f0​: OUTPUT​: «(Nil, Nil, Nil, Nil)␤»
15​:53 IOninja m​: dd (($++ ?? 42 !! |()) xx 999)[^4]
15​:53 camelia rakudo-moar 0633f0​: OUTPUT​: «(42, 42, 42, 42)␤»

Also, giving huge values that don't yet trigger the above bug causes a hang,
perhaps it shouldn't be refying everything?

m​: dd (($++ ?? 42 !! |()) xx 99999999999999)[^4]
camelia │ rakudo-moar 0633f0​: OUTPUT​: «(timeout)»

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.