Assertion failure in eval.cc with partial application #1102

Closed
opened 2026-01-14 19:09:15 +00:00 by lunagl · 4 comments

Describe the bug

apply = f: arg: f arg;
applyList = builtins.foldl' apply;

applyList lib.nameValuePair ["a" "b"]; # this works
x = applyList lib.nameValuePair;
x ["a" "b"] # this fails

The last expression causes Lix to abort with this message:

nix: lix/libexpr/eval.cc:1717: void nix::EvalState::callFunction(Value &, std::span<Value>, Value &, const PosIdx): Assertion `!vCur.app().left().isApp()' failed.

The code evaluates correctly when changing the definition of applyList to

applyList = f: builtins.foldl' apply f;

nix --version output

nix (Lix, like Nix) 2.94.0

## Describe the bug ```nix apply = f: arg: f arg; applyList = builtins.foldl' apply; applyList lib.nameValuePair ["a" "b"]; # this works x = applyList lib.nameValuePair; x ["a" "b"] # this fails ``` The last expression causes Lix to abort with this message: ``` nix: lix/libexpr/eval.cc:1717: void nix::EvalState::callFunction(Value &, std::span<Value>, Value &, const PosIdx): Assertion `!vCur.app().left().isApp()' failed. ``` The code evaluates correctly when changing the definition of `applyList` to ```nix applyList = f: builtins.foldl' apply f; ``` ## `nix --version` output `nix (Lix, like Nix) 2.94.0`
raito added this to the 2.94.1 milestone 2026-01-14 19:16:28 +00:00
Owner

Thank you @lunagl for the bug report. We are working on a fix. Did you encounter this in production code or is this a case that stumbled on while writing your own code?

Thank you @lunagl for the bug report. We are working on a fix. Did you encounter this in production code or is this a case that stumbled on while writing your own code?
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/4942 ("libexpr: fix app chain extension")
  • commit message in cl/4943 ("libexpr: fix app chain extension")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/4942", "number": 4942, "kind": "commit message"}, {"backlink": "https://gerrit.lix.systems/c/lix/+/4943", "number": 4943, "kind": "commit message"}], "cl_meta": {"4942": {"change_title": "libexpr: fix app chain extension"}, "4943": {"change_title": "libexpr: fix app chain extension"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/4942](https://gerrit.lix.systems/c/lix/+/4942) ("libexpr: fix app chain extension") * commit message in [cl/4943](https://gerrit.lix.systems/c/lix/+/4943) ("libexpr: fix app chain extension")
Author

@raito wrote in #1102 (comment):

Thank you @lunagl for the bug report. We are working on a fix. Did you encounter this in production code or is this a case that stumbled on while writing your own code?

Thank you for fixing this so quickly! I encountered it when writing my own code, I don't know of any public projects that run into this issue

@raito wrote in https://git.lix.systems/lix-project/lix/issues/1102#issuecomment-17201: > Thank you @lunagl for the bug report. We are working on a fix. Did you encounter this in production code or is this a case that stumbled on while writing your own code? Thank you for fixing this so quickly! I encountered it when writing my own code, I don't know of any public projects that run into this issue
Owner

Awesome, thank you so much for the report! We are planning to release 2.94.1 in response to this issue on an accelerated schedule.

Awesome, thank you so much for the report! We are planning to release 2.94.1 in response to this issue on an accelerated schedule.
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#1102
No description provided.