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
Fish eats memory with huge slices #4127
Comments
FWIW, I don't think this is a bug per se. It's undefined what happens when you do something like that. I'll grant you the implementation should be smarter than it currently is and not allocate more space than is required for the slice. It should limit each end of the range to reasonable values before using those values to construct a new array. Obviously the reasonable limits are one to the current length of the var being sliced. |
Of course it's not really expected that we have lists with that amount of elements. I'm just objecting to the mode of failure here - it's not just unresponsive, it's actually bringing down the system.
This actually happens with even larger values: $ echo $a[1..111111523232322222222222222]
fish: Invalid index value I have found the issue ( |
While trying to solve #826, one of the things I ended up testing was a huge slice.
It turns out that
will eat all your memory, even with $a undefined.
The text was updated successfully, but these errors were encountered: