--debugger crashes when not ignoring try on HEAD #761

Closed
opened 2025-03-24 20:24:34 +00:00 by jade · 2 comments
Owner

Describe the bug

$ nix build --debugger -f '<nixpkgs>' hello
error: file 'nixpkgs-overlays' was not found in the Nix search path (add it using $NIX_PATH or -I)

This exception occurred in a 'tryEval' call. Use --ignore-try to skip these.

Lix crashed. This is a bug. We would appreciate if you report it along with what caused it at https://git.lix.systems/lix-project/lix/issues with the following information included:

Exception: kj::ExceptionImpl: kj/async.c++:1957: failed: expected !loop.running; wait() is not allowed from within event callbacks.
stack: 103349a03 102deb31b 102e37fbf 103ef8db3 103ee8653 103f30af7 10334ff4b 103356feb 1033497fb 104012fcb 103ff3a37 103effea7 103f015f7 103f04b3f 103fff10f 103effea7 103f015f7 103fffd2f 103effea7 103f015f7 103efcc0b 103efcd2f 103f020e7 103f02037 103efc7a7 103f0032f 103f015f7 103efcc0b 103f02e23 103f020e7 103f02f0b
Stack trace:
 0# nix::getStackTrace() in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixutil.dylib
 1# nix::(anonymous namespace)::onTerminate() in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixmain.dylib
 2# std::__terminate(void (*)()) in /nix/store/8694lkf7x68l8fspp17g9gc45nw42r76-libcxx-19.1.7/lib/libc++abi.1.0.dylib
 3# __cxa_rethrow in /nix/store/8694lkf7x68l8fspp17g9gc45nw42r76-libcxx-19.1.7/lib/libc++abi.1.0.dylib
 4# nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib
 5# nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib
 6# nix::ExprLet::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib
 7# nix::ExprLet::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib
 8# nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib
 9# nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib
10# nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib
11# nix::EvalState::autoCallFunction(nix::Bindings&, nix::Value&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib
12# nix::findAlongAttrPath(nix::EvalState&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, nix::Bindings&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib
13# nix::InstallableAttrPath::toValue(nix::EvalState&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib
14# nix::InstallableAttrPath::toDerivedPaths(nix::EvalState&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib
15# nix::Installable::build2(nix::EvalState&, nix::ref<nix::Store>, nix::ref<nix::Store>, nix::Realise, std::__1::vector<nix::ref<nix::Installable>, std::__1::allocator<nix::ref<nix::Installable>>> const&, nix::BuildMode) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib
16# nix::Installable::build(nix::EvalState&, nix::ref<nix::Store>, nix::ref<nix::Store>, nix::Realise, std::__1::vector<nix::ref<nix::Installable>, std::__1::allocator<nix::ref<nix::Installable>>> const&, nix::BuildMode) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib
17# nix::CmdBuild::run(nix::ref<nix::Store>, std::__1::vector<nix::ref<nix::Installable>, std::__1::allocator<nix::ref<nix::Installable>>>&&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/bin/nix
18# nix::InstallablesCommand::run(nix::ref<nix::Store>, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib
19# nix::RawInstallablesCommand::run(nix::ref<nix::Store>) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib
20# nix::StoreCommand::run() in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib
21# nix::mainWrapped(nix::AsyncIoRoot&, int, char**) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/bin/nix
22# std::__1::__function::__func<main::$_0, std::__1::allocator<main::$_0>, void ()>::operator()() in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/bin/nix
23# nix::handleExceptions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::function<void ()>) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixmain.dylib
24# main in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/bin/nix

zsh: abort      nix build --debugger -f '<nixpkgs>' hello

Steps To Reproduce

Run:

$ nix build --debugger -f '<nixpkgs>' hello

My nixpkgs is c4929d0eb17ec2ddb04a5eb6bdcd57dffa065acd if that becomes necessary info.

Expected behavior

Should not crash.

nix --version output

nix (Lix, like Nix) 2.93.0-dev-pre20250324-4181796
System type: aarch64-darwin
Additional system types: x86_64-darwin
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /Users/jade/.config/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/share

Additional context

Add any other context about the problem here.

## Describe the bug ``` $ nix build --debugger -f '<nixpkgs>' hello error: file 'nixpkgs-overlays' was not found in the Nix search path (add it using $NIX_PATH or -I) This exception occurred in a 'tryEval' call. Use --ignore-try to skip these. Lix crashed. This is a bug. We would appreciate if you report it along with what caused it at https://git.lix.systems/lix-project/lix/issues with the following information included: Exception: kj::ExceptionImpl: kj/async.c++:1957: failed: expected !loop.running; wait() is not allowed from within event callbacks. stack: 103349a03 102deb31b 102e37fbf 103ef8db3 103ee8653 103f30af7 10334ff4b 103356feb 1033497fb 104012fcb 103ff3a37 103effea7 103f015f7 103f04b3f 103fff10f 103effea7 103f015f7 103fffd2f 103effea7 103f015f7 103efcc0b 103efcd2f 103f020e7 103f02037 103efc7a7 103f0032f 103f015f7 103efcc0b 103f02e23 103f020e7 103f02f0b Stack trace: 0# nix::getStackTrace() in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixutil.dylib 1# nix::(anonymous namespace)::onTerminate() in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixmain.dylib 2# std::__terminate(void (*)()) in /nix/store/8694lkf7x68l8fspp17g9gc45nw42r76-libcxx-19.1.7/lib/libc++abi.1.0.dylib 3# __cxa_rethrow in /nix/store/8694lkf7x68l8fspp17g9gc45nw42r76-libcxx-19.1.7/lib/libc++abi.1.0.dylib 4# nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib 5# nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib 6# nix::ExprLet::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib 7# nix::ExprLet::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib 8# nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib 9# nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib 10# nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib 11# nix::EvalState::autoCallFunction(nix::Bindings&, nix::Value&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib 12# nix::findAlongAttrPath(nix::EvalState&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, nix::Bindings&, nix::Value&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixexpr.dylib 13# nix::InstallableAttrPath::toValue(nix::EvalState&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib 14# nix::InstallableAttrPath::toDerivedPaths(nix::EvalState&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib 15# nix::Installable::build2(nix::EvalState&, nix::ref<nix::Store>, nix::ref<nix::Store>, nix::Realise, std::__1::vector<nix::ref<nix::Installable>, std::__1::allocator<nix::ref<nix::Installable>>> const&, nix::BuildMode) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib 16# nix::Installable::build(nix::EvalState&, nix::ref<nix::Store>, nix::ref<nix::Store>, nix::Realise, std::__1::vector<nix::ref<nix::Installable>, std::__1::allocator<nix::ref<nix::Installable>>> const&, nix::BuildMode) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib 17# nix::CmdBuild::run(nix::ref<nix::Store>, std::__1::vector<nix::ref<nix::Installable>, std::__1::allocator<nix::ref<nix::Installable>>>&&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/bin/nix 18# nix::InstallablesCommand::run(nix::ref<nix::Store>, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&&) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib 19# nix::RawInstallablesCommand::run(nix::ref<nix::Store>) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib 20# nix::StoreCommand::run() in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixcmd.dylib 21# nix::mainWrapped(nix::AsyncIoRoot&, int, char**) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/bin/nix 22# std::__1::__function::__func<main::$_0, std::__1::allocator<main::$_0>, void ()>::operator()() in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/bin/nix 23# nix::handleExceptions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::function<void ()>) in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/lib/liblixmain.dylib 24# main in /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/bin/nix zsh: abort nix build --debugger -f '<nixpkgs>' hello ``` ## Steps To Reproduce Run: ``` $ nix build --debugger -f '<nixpkgs>' hello ``` My nixpkgs is c4929d0eb17ec2ddb04a5eb6bdcd57dffa065acd if that becomes necessary info. ## Expected behavior Should not crash. ## `nix --version` output ``` nix (Lix, like Nix) 2.93.0-dev-pre20250324-4181796 System type: aarch64-darwin Additional system types: x86_64-darwin Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /Users/jade/.config/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/zrvf4zf2jl838kd987ngim3a18jpx6kj-lix-2.93.0-dev-pre20250324-4181796/share ``` ## Additional context Add any other context about the problem here.
Owner

root cause: something called by __findFile throws a debug exception and tries to launch a repl, but the throwing happens in a promise and the repl really should've been NeverAsync. yay for lints, i guess

root cause: something called by `__findFile` throws a debug exception and tries to launch a repl, but the throwing happens in a promise and the repl really should've been NeverAsync. yay for lints, i guess
pennae self-assigned this 2025-03-25 15:39:34 +00:00
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/2892 ("libexpr: don't debugThrow from async code")
  • commit message in cl/2890 ("libexpr: make undefined var errors non-debuggable in the parser")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/2892", "number": 2892, "kind": "commit message"}, {"backlink": "https://gerrit.lix.systems/c/lix/+/2890", "number": 2890, "kind": "commit message"}], "cl_meta": {"2892": {"change_title": "libexpr: don't debugThrow from async code"}, "2890": {"change_title": "libexpr: make undefined var errors non-debuggable in the parser"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/2892](https://gerrit.lix.systems/c/lix/+/2892) ("libexpr: don't debugThrow from async code") * commit message in [cl/2890](https://gerrit.lix.systems/c/lix/+/2890) ("libexpr: make undefined var errors non-debuggable in the parser")
Sign in to join this conversation.
No milestone
No project
No assignees
3 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#761
No description provided.