1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-24 23:14:14 +00:00
cde/src/cmd/ksh93/tests
Johnothan King 7e7f137245
Fix a crash on unsetting preset alias (re: ddaa145b) (#133)
The following set of commands caused ksh to crash:

$ unalias history; unalias r
Memory fault

When ksh is compiled with -D_std_malloc, the crash always
occurs when the 'r' alias is removed with 'unalias r',
although with vmalloc 'unalias history' must be run first
for the crash to occur. With the native malloc, the crash
message is also different:

$ unalias history; unalias r
free(): invalid pointer
Abort

This crash happens because when an alias is unset, _nv_unset
removes the NV_NOFREE flag which results in an invalid use
of free(3) as nv_isattr no longer detects NV_NOFREE afterward.
The history and r aliases shouldn't be freed from memory by
nv_delete because those aliases are given the NV_NOFREE attribute.

src/cmd/ksh93/bltins/typeset.c:
- Save the state of NV_NOFREE for aliases to fix the crash
  caused by 'unalias r'.

src/cmd/ksh93/tests/alias.sh:
- Use unalias on both history and r to check for the crash.
  'unalias -a' can't be used to replicate the crash.

Co-authored-by: Martijn Dekker <martijn@inlv.org>
2020-09-18 11:17:20 +01:00
..
alias.sh Fix a crash on unsetting preset alias (re: ddaa145b) (#133) 2020-09-18 11:17:20 +01:00
append.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
arith.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
arrays.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
arrays2.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
attributes.sh -o posix: don't import/export variable attributes thru environment 2020-09-05 11:41:02 +02:00
basic.sh Fix BUG_LOOPRET2 and related return/exit misbehaviour 2020-09-09 20:02:20 +02:00
bracket.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
builtins.sh tests/builtins.sh: correctly count errors (re: 1bc2c74c) 2020-09-12 03:34:57 +02:00
case.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
comvar.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
comvario.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
coprocess.sh tests/coprocess.sh: fix rare fail (re: 712261c8) 2020-09-06 22:40:17 +02:00
cubetype.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
enum.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
exit.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
expand.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
functions.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
glob.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
grep.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
heredoc.sh Fix ${!} and ${$} throwing syntax error in here-document 2020-09-04 04:54:35 +02:00
io.sh tests/io.sh: add proc subst FD leak test (re: ab5dedde) 2020-09-14 13:52:01 +02:00
leaks.sh Fix memory leak in typeset (rhbz#1036470) 2020-09-15 23:52:32 +02:00
locale.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
math.sh sfio: correct floating decimal point scaling of fractions (#131) 2020-09-14 13:46:40 +02:00
nameref.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
namespace.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
options.sh A few job control (-m, -o monitor) fixes (rhbz#960034) 2020-09-18 04:42:27 +02:00
path.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
pointtype.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
pty.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
quoting.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
quoting2.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
readcsv.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
recttype.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
restricted.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
return.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
select.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
shtests shtests: add ${.sh.pid} to PS4/xtrace (re: 9de65210) 2020-09-02 15:51:02 +01:00
sigchld.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
signal.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
statics.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
subshell.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
substring.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
tilde.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
timetype.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
treemove.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
types.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
variables.sh Improve fix for parentheses in param expansions (re: 5ed9ffd6) 2020-09-13 10:15:26 +02:00
vartree1.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00
vartree2.sh shtests: cd to each test set's temp dir before running 2020-09-02 06:02:40 +01:00