Skip to content

fix(EvalState): Use make_shared for enable_shared_from_this compatibi…#15291

Merged
edolstra merged 1 commit intoNixOS:masterfrom
roberth:fix-evalstate-shared-from-this-usage
Feb 18, 2026
Merged

fix(EvalState): Use make_shared for enable_shared_from_this compatibi…#15291
edolstra merged 1 commit intoNixOS:masterfrom
roberth:fix-evalstate-shared-from-this-usage

Conversation

@roberth
Copy link
Member

@roberth roberth commented Feb 18, 2026

…lity

EvalState inherits from enable_shared_from_this (added in b4c24a2 for debugRepl), but was being stack-allocated or created with make_unique in several places. This causes bad_weak_ptr errors when shared_from_this is called.

Convert all EvalState allocations to use make_shared.

Motivation

Might fix a crash.
Brings debugger support in the old CLI closer if anyone's interested.

Context

Was needed at some point in my eval cache work.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

…lity

EvalState inherits from enable_shared_from_this (added in b4c24a2 for
debugRepl), but was being stack-allocated or created with make_unique
in several places. This causes bad_weak_ptr errors when shared_from_this
is called.

Convert all EvalState allocations to use make_shared.
@roberth roberth requested a review from edolstra as a code owner February 18, 2026 21:18
@github-actions github-actions bot added new-cli Relating to the "nix" command c api Nix as a C library with a stable interface labels Feb 18, 2026
@edolstra edolstra enabled auto-merge February 18, 2026 21:40
@edolstra edolstra added this pull request to the merge queue Feb 18, 2026
Merged via the queue into NixOS:master with commit 8491e26 Feb 18, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c api Nix as a C library with a stable interface new-cli Relating to the "nix" command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants