The following script generates a segmentation fault when run in the
Ubuntu Meerkat Beta 64bit livecd
environment. This was an older version, so I downloaded and compiled
the latest version and I get the
segv in that version as well.
You call the script with a single argument of a directory to traverse;
on my machine, /usr/lib was
sufficient to generate the segv. However, on another RHEL 5.5
machine, I needed a bigger directory,
i.e. /usr to generate the segv.
The script was a distillation of a much larger script which also
produced the same segv.
I reported it to the Ubuntu bug tracking system as bug 638867; in that
report there is a stack trace from
the debug-compiled latest version (after a stack trace from the ubuntu version).
I figured this list might be interested as well. (I only found it
after I'd reported the Ubuntu bug.)
Here's the script.
#!/bin/ksh
function recursive_directory_read {
typeset function_to_call directory_to_read filename is_link is_directory
directory_to_read=$1
function_to_call=$2
ls -a $directory_to_read | while read f ; do
if [[ "$f" = '.' || "$f" = '..' ]] ; then
continue
elif [[ -L $directory_to_read/"$f" ]] ; then
continue
elif [[ -d $directory_to_read/"$f" ]] ; then
recursive_directory_read $directory_to_read/"$f" $function_to_call
else
$function_to_call $directory_to_read $f
fi
done
}
function print_it {
echo "$1/$2"
}
function testit {
recursive_directory_read $1 print_it
}
ulimit -c unlimited
testit ${1:-/usr/lib}
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers