ast
ast copied to clipboard
Test failure: subshell
The 'subshell' test fails on Gentoo Linux.
268/287 subshell FAIL 1.03 s (exit status 1)
--- command ---
TEST_ROOT='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0-beta1/src/cmd/ksh93/tests' SHELL='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/cmd/ksh93/ksh' LD_LIBRARY_PATH='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/lib/libast:/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/lib/libcmd:/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/lib/libdll' LIBSAMPLE_PATH='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/lib/libdll/libsample.so' SRC_ROOT='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0-beta1' /x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/cmd/ksh93/ksh /x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0-beta1/src/cmd/ksh93/tests/util/run_test.sh subshell
--- stdout ---
<I> run_test[112]: TEST_DIR=/x/portage/app-shells/ksh-2020.0.0_beta1/temp/ksh.subshell.6rUBkQ
--- stderr ---
/x/portage/app-shells/ksh-2020.0.0_beta1/temp/ksh.subshell.6rUBkQ/subshell.sh: line 521: /x/portage/app-shells/ksh-2020.0.0_beta1/temp: arithmetic syntax error
-------
269/287 subshell/shcomp FAIL 1.03 s (exit status 1)
--- command ---
SHCOMP='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/cmd/ksh93/shcomp' TEST_ROOT='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0-beta1/src/cmd/ksh93/tests' SHELL='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/cmd/ksh93/ksh' LD_LIBRARY_PATH='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/lib/libast:/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/lib/libcmd:/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/lib/libdll' LIBSAMPLE_PATH='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/lib/libdll/libsample.so' SRC_ROOT='/x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0-beta1' /x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0_beta1-build/src/cmd/ksh93/ksh /x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0-beta1/src/cmd/ksh93/tests/util/run_test.sh shcomp subshell
--- stdout ---
<I> run_test[112]: TEST_DIR=/x/portage/app-shells/ksh-2020.0.0_beta1/temp/ksh.subshell.OvSMvI
--- stderr ---
/x/portage/app-shells/ksh-2020.0.0_beta1/temp/ksh.subshell.OvSMvI/subshell.sh.comp: line 521: /x/portage/app-shells/ksh-2020.0.0_beta1/temp: arithmetic syntax error
-------
This fails in the same way with 2020.0.0-alpha1.
The first thing to note is that line 521 is not line 521 in src/cmd/ksh93/tests/subshell.sh. It's line 521 of the script that is created by concatenating that file with a preamble and postamble. On my system that's line 379 in the original file, which is:
unset SKIP
Hard to see how that could result in that failure. The next line is a for(( ))
statement. That could conceivably be the source of the error. Please add a set -x
to the top of src/cmd/ksh93/tests/subshell.sh and show us the last few trace lines.
Portage sets an environment variable T
, and that seems to trigger the failure here. You should be able to reproduce this like so:
meson build
cd build
ninja
T=/tmp meson test
The problem exists in the ksh93u+ release. But it's even worse in that version. If you don't export T=/tmp
first the test fails with
/bin/ksh: syntax error at line 1: `;;' unexpected
Some part of the test also dies from a SIGSEGV. In fact, doing T='' meson test subshell
results in the same failure using ksh93u+. This failure mode does not happen with the git head version. It also doesn't fail in this way in the ksh93v- version but does fail in other ways.
Also interesting is that doing T=X meson test subshell
fails with
line 521: X: parameter not set
But doing T=/tmp meson subshell
fails with
line 521: /tmp: arithmetic syntax error
And doing T=+0
, T=0
, and T=2/1
all pass but T=/0
and T=0/1
fail. Beats me what the pattern is with respect to what works and what fails.
In all cases where the failure occurs none of the code in the loop that follows the unset SKIP
is executed. It looks like there is something wrong with how the parser is handling that code.