Skip to content

Infinite recursion false-positives in nix-repl #1407

@Ericson2314

Description

@Ericson2314

In nix-repl, if one begins evaluating some long-running evaluation, sends a SIGINT, and then tries it again, it is likely that they'll get an infinite recursion error, even if there is no infinite recursion.

I think this is because Nix's backholes thunks, but doesn't un-blackhole them while handling the interrupt. That opens the possibility of a blackholed thunk being encountered on the second evaluation, leading Nix to falsy conclude it's already started forcing this thunk on this evaluation, and thus infinite recursion is happening.

The solution would to unwind after the interrupt, un-blackholing all thunks on the stack.

Inspired by @zimbatm to extract this from NixOS/rfcs#14.

Metadata

Metadata

Assignees

Labels

buglanguageThe Nix expression language; parser, interpreter, primops, evaluation, etcstale

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions