Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing GC root in zipAttrsWith #11548

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

edolstra
Copy link
Member

Motivation

Fixes #11547.

My SNAFU was that I assumed that all the Value *s we put in attrsSeen are already reachable (which they are), but I forgot about the elems pointer in ListBuilder.

Thanks to @puckipedia and @yorickvP for diagnosing.

Context

Priorities and Process

Add 👍 to pull requests you find important.

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

My SNAFU was that I assumed that all the `Value *`s we put in
`attrsSeen` are already reachable (which they are), but I forgot about
the `elems` pointer in `ListBuilder`.

Fixes NixOS#11547.
@edolstra edolstra added bug backport 2.24-maintenance Automatically creates a PR against the branch labels Sep 19, 2024
Co-authored-by: Robert Hensing <[email protected]>
@Mic92
Copy link
Member

Mic92 commented Sep 19, 2024

Fixes the the issue for me. nix 2.24 crashes in 10s

#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/4b87f8820eba50283dbcc38442d49439a4117529.tar.gz -i bash -p nix parallel rr
set -e

SCRIPT_DIR=$(dirname -- "$0";)
RRDIR="$SCRIPT_DIR/rr-testing"
cd "$SCRIPT_DIR"
export GC_FREE_SPACE_DIVISOR=69 GC_ENABLE_INCREMENTAL=1

gorun() {
    for (( i=0; i < 80; i = i + 1 )); do
        #_RR_TRACE_DIR=$RRDIR parallel -N0 --verbose --halt-on-error 2 --lb rr record --chaos -- nix eval --eval-store "$(pwd)/store" -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/4b87f8820eba50283dbcc38442d49439a4117529.tar.gz  -I nixos-config=./configuration.nix -f '"<nixpkgs/nixos>"' config.system.build.toplevel ::: {1..80}
        #parallel -N0 --verbose --halt-on-error 2 --lb /nix/store/qi0z5ar7ln3ahmnnd2336221bz5zm2zn-nix-2.25.0pre20240919_75dc688/bin/nix eval --eval-store "$(pwd)/store" -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/4b87f8820eba50283dbcc38442d49439a4117529.tar.gz  -I nixos-config=./configuration.nix -f '"<nixpkgs/nixos>"' config.system.build.toplevel ::: {1..80}
        parallel -N0 --verbose --halt-on-error 2 --lb nix eval --eval-store "$(pwd)/store" -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/4b87f8820eba50283dbcc38442d49439a4117529.tar.gz  -I nixos-config=./configuration.nix -f '"<nixpkgs/nixos>"' config.system.build.toplevel ::: {1..80}
    done
}

nix --version

while true; do
    rm -rvf "$RRDIR"
    gorun
done

This script keeps running:

#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/4b87f8820eba50283dbcc38442d49439a4117529.tar.gz -i bash -p nix parallel rr
set -e

SCRIPT_DIR=$(dirname -- "$0";)
RRDIR="$SCRIPT_DIR/rr-testing"
cd "$SCRIPT_DIR"
export GC_FREE_SPACE_DIVISOR=69 GC_ENABLE_INCREMENTAL=1

gorun() {
    for (( i=0; i < 80; i = i + 1 )); do
        parallel -N0 --verbose --halt-on-error 2 --lb /nix/store/qi0z5ar7ln3ahmnnd2336221bz5zm2zn-nix-2.25.0pre20240919_75dc688/bin/nix eval --eval-store "$(pwd)/store" -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/4b87f8820eba50283dbcc38442d49439a4117529.tar.gz  -I nixos-config=./configuration.nix -f '"<nixpkgs/nixos>"' config.system.build.toplevel ::: {1..80}
    done
}

nix --version

while true; do
    rm -rvf "$RRDIR"
    gorun
done

@edolstra edolstra merged commit ca3fc16 into NixOS:master Sep 19, 2024
11 checks passed
@edolstra edolstra deleted the fix-zipAttrsWith-gc branch September 19, 2024 19:02
edolstra added a commit that referenced this pull request Sep 19, 2024
…1548

Fix missing GC root in zipAttrsWith (backport #11548)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.24-maintenance Automatically creates a PR against the branch bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Inconsistent segfaults in concatLists during evaluation
3 participants