Hi!
----
It seems the "leaks.sh" test is no longer working on Linux (and very
likely on Solaris, too (but I don't have a Solaris machine around to
verify)) because the GNU ld linker now removes all symbols from a
binary which are not used and this removes the whole "vmstate" (symbol
name |b_vmstate()|) builtin in the final link pass (the issue is not
detected because of the "builtin vmstate 2>/dev/null || exit 0"-line
in "leaks.sh".
AFAIK the only way to get around this issue is to use the symbol
|b_vmstate()| somewhere... ;-/
This patch fixes the issue (by binding the "vmstate" buitin the AST
default path (/opt/ast/bin/vmstate on Linux)) and makes "leaks.sh"
more verbose when it becomes a no-op (like "pty.sh"):
-- snip --
diff --git a/src/cmd/ksh93/data/builtins.c b/src/cmd/ksh93/data/builtins.c
index 95f10f8..e6d3f71 100644
--- a/src/cmd/ksh93/data/builtins.c
+++ b/src/cmd/ksh93/data/builtins.c
@@ -122,6 +122,7 @@ const struct shtable3 shtab_builtins[] =
"wait", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(wait),
"type", NV_BLTIN|BLT_ENV, bltin(whence),
"whence", NV_BLTIN|BLT_ENV, bltin(whence),
+ CMDLIST(vmstate)
#ifdef SHOPT_CMDLIB_HDR
#include SHOPT_CMDLIB_HDR
#else
diff --git a/src/cmd/ksh93/tests/leaks.sh b/src/cmd/ksh93/tests/leaks.sh
index 8d89b05..841a94c 100755
--- a/src/cmd/ksh93/tests/leaks.sh
+++ b/src/cmd/ksh93/tests/leaks.sh
@@ -17,7 +17,6 @@
# David Korn <[email protected]> #
# #
########################################################################
-builtin vmstate 2>/dev/null || exit 0
function err_exit
{
@@ -30,6 +29,8 @@ alias err_exit='err_exit $LINENO'
Command=${0##*/}
integer Errors=0
+builtin vmstate 2>'/dev/null' || { err_exit "vmstate command not
found -- tests skipped"; exit 0; }
+
# test for variable reset leak #
function test_reset
-- snip --
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) [email protected]
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers