You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently made it possible to build again with ksh using posix_spawn() (see commit be962c7). That results in the basic.sh unit test to fail. I've boiled it down to a minimal test case and can reproduce on macOS 10.14 and Fedora 28. Replace the content of src/cmd/ksh93/tests/basic.sh with this:
set -x
x=$($SHELL -c 'echo yes' <&-)
lsof -p $$
print xxx > $TEST_DIR/file
for x in 1 2
do
tee >(sleep 1; cat > $TEST_DIR/file) <<< "hello" > /dev/null
lsof -p $$
done
Then build and test with meson -Duse-spawn=true; ninja; meson test basic. If you inspect build/meson-logs/testlog.txt you should see that the subshell dies from a SIGSEGV when executing the builtin cat. Why this requires a for loop is unknown but removing that loop does not result in failure. The lsof -p $$ aren't required to reproduce the problem. They're only to show that the shells stdin is closed.
Also, the SIGSEGV is because after executing fp = sfstdin; the subsequent use of fp is fatal because sfstdin is NULL due to the problem described above.
The text was updated successfully, but these errors were encountered:
And, of course, this is another example for why I wrote in issue #1117 that stdin, stdout, and stderr should never be left closed. The problem here appears to involve the non-forking optimization described in issue #480 but I don't really know at this stage.
I recently made it possible to build again with ksh using
posix_spawn()
(see commit be962c7). That results in the basic.sh unit test to fail. I've boiled it down to a minimal test case and can reproduce on macOS 10.14 and Fedora 28. Replace the content of src/cmd/ksh93/tests/basic.sh with this:Then build and test with
meson -Duse-spawn=true; ninja; meson test basic
. If you inspect build/meson-logs/testlog.txt you should see that the subshell dies from a SIGSEGV when executing the builtincat
. Why this requires afor
loop is unknown but removing that loop does not result in failure. Thelsof -p $$
aren't required to reproduce the problem. They're only to show that the shells stdin is closed.Also, the SIGSEGV is because after executing
fp = sfstdin;
the subsequent use offp
is fatal becausesfstdin
is NULL due to the problem described above.The text was updated successfully, but these errors were encountered: