Skip to content

Commit

Permalink
tests/functional: Add flake-based regression for debugger use-after-free
Browse files Browse the repository at this point in the history
This is the simplest reproducer I have. It would be great to find
a repro without flakes, but I guess this should be ok for now.
  • Loading branch information
xokdvium committed Feb 21, 2025
1 parent af2ddfd commit 0d50045
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
28 changes: 28 additions & 0 deletions tests/functional/flakes/debugger.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

source ./common.sh

requireGit

flakeDir="$TEST_ROOT/flake"
createGitRepo "$flakeDir"

cat >"$flakeDir/flake.nix" <<EOF
{
inputs = {
};
outputs =
_:
let
in
{
packages.$system.default = throw "oh no";
};
}
EOF

git -C "$flakeDir" add flake.nix

# regression #12527 and #11286
echo ":env" | expect 1 nix eval "$flakeDir#packages.${system}.default" --debugger
3 changes: 2 additions & 1 deletion tests/functional/flakes/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ suites += {
'commit-lock-file-summary.sh',
'non-flake-inputs.sh',
'relative-paths.sh',
'symlink-paths.sh'
'symlink-paths.sh',
'debugger.sh'
],
'workdir': meson.current_source_dir(),
}

0 comments on commit 0d50045

Please sign in to comment.