-
Notifications
You must be signed in to change notification settings - Fork 98
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
Infinite loop (and memory usage) #1815
Comments
I mean, it is an infinite loop, right? Although we should probably be able to detect that without black-holing, and I'm not sure why we don't. What behavior do you think would be right? |
I'd expect the same infinite recursion error that you get from, say |
I haven't tested this hypothesis, but I believe it's to be expected that black-holing doesn't detect such loops. In fact, as long as you don't use So, evaluating However, this is different when forcing/deep_sequing the record, of course, because we are now trying to recurse into an infinite data structure. I wonder if we can extend the blackholing mechanism to handle this case, by forbidding thunks to be evaluated again while we're still forcing the children of this thunk. |
Related to #1722 |
I think also related to #1967 - both the issue and the solution should be pretty similar. |
I had a look at this today, but I couldn't figure out a version of:
that works. For example, this input is fine:
but when forcing the child I guess one thing that might work (and maybe helps in #1967 too) is to have special handling for a field that evaluates to a parent thunk. I don't see how to fit this into the existing black-holing framework though; it seems like it might need an extra stack? |
I have been looking at #1967 on my side actually 😅. My idea is to blackhole the thunk you're currently evaluating, that is the thunk of the field, not the thunk of the whole record. That is, before starting to evaluate |
Reproducing @jneem remark about using the result of #2055 to fix this issue as well but without a performance penalty: #2055 (review) |
When trying to export the following file, nickel gets stuck and starts using up all my memory:
The text was updated successfully, but these errors were encountered: