1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-29 13:41:00 +01:00

Merge pull request #14671 from NixOS/fix-asan-stack-overload-repl-doc

tests/functional: Work around stack overflows under ASAN in doc-funct…
This commit is contained in:
Sergei Zimmerman 2025-11-29 00:56:10 +00:00 committed by GitHub
commit 0903b0aa7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

View file

@ -350,10 +350,9 @@ runRepl () {
local testDirNoUnderscores local testDirNoUnderscores
testDirNoUnderscores="${testDir//_/}" testDirNoUnderscores="${testDir//_/}"
# TODO: pass arguments to nix repl; see lang.sh
_NIX_TEST_RAW_MARKDOWN=1 \ _NIX_TEST_RAW_MARKDOWN=1 \
_NIX_TEST_REPL_ECHO=1 \ _NIX_TEST_REPL_ECHO=1 \
nix repl 2>&1 \ nix repl "$@" 2>&1 \
| stripColors \ | stripColors \
| tr -d '\0' \ | tr -d '\0' \
| stripEmptyLinesBeforePrompt \ | stripEmptyLinesBeforePrompt \
@ -373,7 +372,12 @@ for test in $(cd "$testDir/repl"; echo *.in); do
in="$testDir/repl/$test.in" in="$testDir/repl/$test.in"
actual="$TEST_ROOT/$test.actual" actual="$TEST_ROOT/$test.actual"
expected="$testDir/repl/$test.expected" expected="$testDir/repl/$test.expected"
(cd "$testDir/repl"; set +x; runRepl 2>&1) < "$in" > "$actual" || { declare -a flags=()
if test -e "$testDir/repl/$test.flags"; then
read -r -a flags < "$testDir/repl/$test.flags"
fi
(cd "$testDir/repl"; set +x; runRepl "${flags[@]}" 2>&1) < "$in" > "$actual" || {
echo "FAIL: $test (exit code $?)" >&2 echo "FAIL: $test (exit code $?)" >&2
badExitCode=1 badExitCode=1
} }

View file

@ -43,7 +43,7 @@ error:
| ^ | ^
91| }; 91| };
(19999 duplicate frames omitted) (199 duplicate frames omitted)
error: stack overflow; max-call-depth exceeded error: stack overflow; max-call-depth exceeded
at /path/to/tests/functional/repl/doc-functor.nix:90:23: at /path/to/tests/functional/repl/doc-functor.nix:90:23:
@ -56,7 +56,7 @@ nix-repl> :doc diverging
error: error:
… while partially calling '__functor' to retrieve documentation … while partially calling '__functor' to retrieve documentation
(10000 duplicate frames omitted) (100 duplicate frames omitted)
… while calling '__functor' … while calling '__functor'
at /path/to/tests/functional/repl/doc-functor.nix:103:21: at /path/to/tests/functional/repl/doc-functor.nix:103:21:

View file

@ -0,0 +1 @@
--max-call-depth 100