nix-tree
nix-tree copied to clipboard
Reproducible hanging
I've run into a specific case where nix-tree will lock up. What I'm doing is:
- run
nix-shell -p nix-tree --run "nix-tree --derivation /nix/store/aq69wwnfqb5c62kk6vaafc3x9kj37cjp-newsboat-2.28-vendor.tar.gz.drv" - use
/to search for headers - select the second
linux-headers-5.18.drventry - press
w
The process becomes unresponsive. This is repeatable. I'm not sure what's specific about that dependency - others open the "why-depends" window without issues.
Thank you for opening the issue, it was pretty interesting!
I had a look, and was able to reproduce the issue on the derivation you mentioned, and on a few others. I believe it is a memory leak/consumption issue that occurs when the why-depends output is too large. I can see that as soon as I press w it starts consuming more and more memory, and eventually gets killed.
I will try to figure out the cause, but it might simply be a matter of exponential explosion of potential paths. So maybe we need an upper limit.
(for reference, the code that calculates it is here: https://github.com/utdemir/nix-tree/blob/9098dc99cb975015a3ce0b99d8d5cb498eb98a2e/src/NixTree/PathStats.hs#L95-L111)
Hey @viraptor , I believe I worked around the issue, or at least I can not reproduce it anymore. It's merged tomain, so feel free to check it out.
I'll probably cut a release in a couple of weeks.
Thanks again for the issue.