nix build does not respond to ctrl-c or ctrl-z #393

Open
opened 2024-06-13 09:46:49 +00:00 by yorickvp · 7 comments
Member

Describe the bug

nix build ignores ctrl-c and ctrl-z

Steps To Reproduce

$ echo 'with import <nixpkgs> {}; (runCommand "unending" {} "sleep 600s")' > long.nix
$ nix build -f long.nix
^C

I have to kill it with kill to make it error: interrupted by the user

Expected behavior

The build exits.

nix --version output

nix (Lix, like Nix) 2.90.0pre20240613_1d6fd94

## Describe the bug `nix build` ignores ctrl-c and ctrl-z ## Steps To Reproduce ```console $ echo 'with import <nixpkgs> {}; (runCommand "unending" {} "sleep 600s")' > long.nix $ nix build -f long.nix ^C ``` I have to kill it with `kill` to make it `error: interrupted by the user` ## Expected behavior The build exits. ## `nix --version` output `nix (Lix, like Nix) 2.90.0pre20240613_1d6fd94`
yorickvp added the
bug
label 2024-06-13 09:46:49 +00:00
Owner

hmmm wonder if this is a regression because it did work for us at some point recently. will have to look into it

hmmm wonder if this is a regression because it did work for us at some point recently. will have to look into it
Member

I can't reproduce this:

[leo60228@desktop:~]$ nix shell git+https://git.lix.systems/lix-project/lix.git#nix

[leo60228@desktop:~]$ nix --version
nix (Lix, like Nix) 2.90.0pre20240613_1d6fd94

[leo60228@desktop:~]$ nix build -f long.nix
error: interrupted by the user
I can't reproduce this: ```console [leo60228@desktop:~]$ nix shell git+https://git.lix.systems/lix-project/lix.git#nix [leo60228@desktop:~]$ nix --version nix (Lix, like Nix) 2.90.0pre20240613_1d6fd94 [leo60228@desktop:~]$ nix build -f long.nix error: interrupted by the user ```

This happens to me a lot on Nix 2.18 (darwin) as well, so I don't think it's unique to Lix. More often than not it happens when interrupting nix-direnv right after cding into a project with a dev shell, so I wonder if it's timing related (interrupting nix at a specific phase).

This happens to me a lot on Nix 2.18 (darwin) as well, so I don't think it's unique to Lix. More often than not it happens when interrupting nix-direnv right after `cd`ing into a project with a dev shell, so I wonder if it's timing related (interrupting nix at a specific phase).
Owner

If you wind up hitting this problem again, can you please attach a gdb to it (pgrep -af nix on Linux, then sudo gdb -p PID) and get a backtrace with bt?

I am assuming it is deadlocked somewhere, but I don't really have any way of diagnosing that without more information.

If you wind up hitting this problem again, can you please attach a gdb to it (`pgrep -af nix` on Linux, then `sudo gdb -p PID`) and get a backtrace with `bt`? I am assuming it is deadlocked somewhere, but I don't really have any way of diagnosing that without more information.
Author
Member

I can no longer reproduce it after rebooting :(.

I think what might have triggered it (though I can no longer reproduce this):

  1. run nix repl
  2. evaluate pkgs
  3. ctrl-c
  4. everything still works as expected
  5. try tab completing something
  6. error: interrupted by the user, nix repl exits
  7. ctrl-c no longer works
I can no longer reproduce it after rebooting :(. I think what might have triggered it (though I can no longer reproduce this): 1. run nix repl 2. evaluate `pkgs` 3. ctrl-c 4. everything still works as expected 5. try tab completing something 6. `error: interrupted by the user`, nix repl exits 7. ctrl-c no longer works
Owner
Upstream issue: https://github.com/NixOS/nix/issues/7245
Owner

Mostly fixed by 86b213e632, but we expect there to still be some cases where Lix is slow or unresponsive to quit following CTRL-C.

Mostly fixed by 86b213e6321540328fb11c3ea99c0b24becc45b0, but we expect there to still be some cases where Lix is slow or unresponsive to quit following CTRL-C.
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#393
No description provided.