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
{{ message }}
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
How reproducible:
Discovered in a sourced script, but also reproducible within an executed script. No such problem with ksh93 version of ksh or with [lm]ksh fork. Not sure about earlier versions of ksh2020.
Steps to reproduce:
Source or execute this script from a ksh2020 prompt (testing was done as root user on an Ubuntu 20.04 system):
#!/bin/ksh# generate coredump with ksh2020# failure appears to be associated with '>/dev/null 2>&1' when inside a function# set -x # path/to/this/script.shredirection() (
{ \unalias command;\unset -f command; } >/dev/null 2>&1||:echo$1
)
echo${.sh.version}echo${.sh.file}echo${.sh.file}>/dev/null
echo${.sh.file}2>&1echo${.sh.file}>/dev/null 2>&1
test=$(basename -- "$(redirection "${.sh.file}")")echo"\$test ="$test
Actual results:
# ./test.sh
Version A 2020.0.0
/root/test.sh
/root/test.sh
./test.sh: line 18: 32761: Abort(coredump)
$test =
Expected results:
# ./test.sh
Version A 2020.0.0
/root/test.sh
/root/test.sh
$test = /root/test.sh
Additional info:
While initially debugging this issue I managed to also generate a free(): invalid pointer message along with the Abort(coredump) message. But I am not able to recall precisely what I did that resulted in that additional error message. Including it here because it may be of value regarding resolution of this problem.