NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.45k stars 1.5k forks source link

Stack overflow detection is broken except on x86_64-linux #8281

Open roberth opened 1 year ago

roberth commented 1 year ago

Describe the bug

nix-repl> :p let a = _: { a = a a; }; in a {}
{ a = { a = ..... { a = zsh: segmentation fault

Steps To Reproduce

Try the above in nix repl but not on x86_64-linux where it works.

If you don't want to have the printing code involved in the overflow, do something with seq for example.

Expected behavior

nix-env --version output

2.16.0pre20230428_89d3cc5

x86_64-darwin, aarch64-darwin, aarch64-linux

Additional context

Workaround: when nix crashes on mac, try evaluating the same thing on linux. You might learn that it is indeed a stack overflow, ruling out another kind of bug with a fairly high degree of certainty. However, even in this case, it's not very actionable because of the

Priorities

Add :+1: to issues you find important.

cole-h commented 1 year ago

I was able to reproduce the segfault on the aarch64 community box, but not my x86-64 machine (as expected).