Debugger segfaults after exiting in some cases #1200

Open
opened 2026-04-28 14:11:16 +00:00 by blokyk · 0 comments
Member

Describe the bug

Using the debugger on an error inside a throw expression makes the process segfault after exiting the debugger.

Steps To Reproduce

  1. Launch nix eval -E 'let s.foo = "uwu"; f = v: throw s.bar; in f 5' --debugger
  2. Quit debugger with :q or Ctrl+D
  3. It prints the error :D
  4. ...but then segfaults instead of cleanly quitting :(

This happens with at least repl, eval, and build; i've not tried other commands but i'm guessing it's the same for anything that accepts installables and the --debugger flag

Expected behavior

The process doesn't segfault after quitting.

nix --version output

This happens on main (faaa14a303):

nix (Lix, like Nix) 2.96.0-devpre20260408-dev_dirty
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/courvoie/.config/nix/nix.conf:/etc/xdg/xdg-ubuntu-xorg/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /home/courvoie/lix/outputs/out/share

As well as on 2.95.1.

Additional context

Core dump available here, captured for the executable built from main, though it's easy to reproduce.

This doesn't happen on CppNix.

## Describe the bug Using the debugger on an error _inside_ a throw expression makes the process segfault after exiting the debugger. ## Steps To Reproduce 1. Launch `nix eval -E 'let s.foo = "uwu"; f = v: throw s.bar; in f 5' --debugger` 2. Quit debugger with `:q` or Ctrl+D 3. It prints the error :D 4. ...but then segfaults instead of cleanly quitting :( This happens with at least `repl`, `eval`, and `build`; i've not tried other commands but i'm guessing it's the same for anything that accepts installables and the `--debugger` flag ## Expected behavior The process doesn't segfault after quitting. ## `nix --version` output This happens on main (faaa14a303): ``` nix (Lix, like Nix) 2.96.0-devpre20260408-dev_dirty System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/courvoie/.config/nix/nix.conf:/etc/xdg/xdg-ubuntu-xorg/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /home/courvoie/lix/outputs/out/share ``` As well as on 2.95.1. ## Additional context [Core dump available here](https://sh.zoeee.net/-zDkdA9Eky5), captured for the executable built from main, though it's easy to reproduce. This doesn't happen on CppNix.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#1200
No description provided.