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

[].splice: 0, [] infiniloops #5710

Closed
p6rt opened this issue Oct 1, 2016 · 4 comments
Closed

[].splice: 0, [] infiniloops #5710

p6rt opened this issue Oct 1, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 1, 2016

Migrated from rt.perl.org#129773 (status was 'resolved')

Searchable as RT129773$

@p6rt
Copy link
Author

p6rt commented Oct 1, 2016

From @zoffixznet

# I have the fix; filing for records

  <Zoffix> m​: [].splice​: 0, [] # weeeeeeeeeeee
  <camelia> rakudo-moar 1f29cb​: OUTPUT«Memory allocation failed;
could not allocate 80320 bytes␤»

The problem is the candidate called [^1] takes the replacement array
as size to splice and then calls itself, ad infinitum.

Type restriction needs to be added to $size

[1] https://github.com/rakudo/rakudo/blob/1f29cb2/src/core/Array.pm#L1142

@p6rt
Copy link
Author

p6rt commented Oct 1, 2016

From @zoffixznet

Fixed in rakudo/rakudo@28bf87439e
Tests in Raku/roast@3253db362c

On Fri Sep 30 23​:14​:32 2016, cpan@​zoffix.com wrote​:

# I have the fix; filing for records

 \<Zoffix> m&#8203;: \[\]\.splice&#8203;: 0, \[\]  \# weeeeeeeeeeee
 \<camelia> rakudo\-moar 1f29cb&#8203;: OUTPUT«Memory allocation failed;  

could not allocate 80320 bytes␤»

The problem is the candidate called [^1] takes the replacement array
as size to splice and then calls itself, ad infinitum.

Type restriction needs to be added to $size

[1] https://github.com/rakudo/rakudo/blob/1f29cb2/src/core/Array.pm#L1142

@p6rt
Copy link
Author

p6rt commented Oct 1, 2016

@zoffixznet - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Oct 1, 2016
@p6rt
Copy link
Author

p6rt commented Oct 1, 2016

From @zoffixznet

The original fix was not enough, as passing incorrect type to `offset` also has the same issue.

Not pretty, but this commit fixes that issue​: rakudo/rakudo@b77d2b71db
And tests for offset condition hang added in Raku/roast@5d8750321d

On Fri Sep 30 23​:20​:55 2016, cpan@​zoffix.com wrote​:

Fixed in rakudo/rakudo@28bf87439e
Tests in Raku/roast@3253db362c

On Fri Sep 30 23​:14​:32 2016, cpan@​zoffix.com wrote​:

# I have the fix; filing for records

 \<Zoffix> m&#8203;: \[\]\.splice&#8203;: 0, \[\]  \# weeeeeeeeeeee
 \<camelia> rakudo\-moar 1f29cb&#8203;: OUTPUT«Memory allocation failed;  

could not allocate 80320 bytes␤»

The problem is the candidate called [^1] takes the replacement array
as size to splice and then calls itself, ad infinitum.

Type restriction needs to be added to $size

[1] https://github.com/rakudo/rakudo/blob/1f29cb2/src/core/Array.pm#L1142

@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
Labels
Projects
None yet
Development

No branches or pull requests

1 participant