Hi!

----

Attached (as "testcase_tail_hang.sh") is a testcase which shows
problem with the bulitin "tail" utility... in some cases it stops
responding (e.g. it doesn't terminate anymore) to SIGTERM.
Note that this issue is there since at least two (or more) years... it
has nothing todo with the recent builtin API changes etc.

AFAIK right now it only happens when these four conditions are met:
1. libshell/libcmd/libdll/libcoshell/libast must be dynamic libraries
2. Platform must be Solaris 11 (SPARC or i386)
3. The shared libraries must be build with -Bdirect (-Bdirect enables
"direct bindings" ... this means that instead of searching all loaded
libraries+objects for a specific ELF symbol the consumer "remembers"
which library the symbol was in and looks-up this symbol directly (see
ld(1) and ld.so.1(1)) ... I have no clue why this is required
4. The "hang" requires a specific execution order in the testcase -
see this comment in the testcase:
-- snip --
# this one must run first to cause hangs in followtest[12]
test_tail_fifo_1 '/usr/bin/tail'

# these two will hang
followtest1 'test5a' 'tail' true
followtest2 'test6a' 'tail'
-- snip --

Sometimes the problem magically disappears and then comes back when I
rm -Rf * the tree and rebuild from scratch.

Example usage:
1. Build ast-open:
$ (printf "CMDLIST(tail)\n" >b.h ; export CC="/opt/SUNWspro/bin/cc
-Bdirect -O" CCFLAGS="-DSHOPT_CMDLIB_HDR=\\\"$PWD/b.h\\\""
PACKAGE_OPTIONS='optimize-space' ; ksh ./bin/package make) 2>&1 | tee
-a buildlog.log

2. Run testcase:
$ env - PATH=$PATH HOME=$HOME /usr/bin/bash -c 'export LC_ALL=C ;
(export LD_LIBRARY_PATH=$PWD/arch/sol11.i386/lib/ ;
./arch//sol11.i386/bin/ksh
/home/test001/ksh93/ast_ksh_20120531/testcase_tail_hang.sh)'

The output on my machines then looks like this:
-- snip --
        testcase_tail_hang.sh[216]: test5a: tail pid=16281 hung.
        testcase_tail_hang.sh[251]: test6a: tail pid=16286 hung.
-- snip --

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Attachment: testcase_tail_hang.sh
Description: Bourne shell script

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to