Bash problems, strace, performance, etc.

Cyrille Lefevre
Fri Oct 22 02:41:00 GMT 2010

Le 21/10/2010 23:22, Lee D. Rothstein a écrit :
>  On 10/21/2010 1:22 AM, Cyrille Lefevre wrote:
>> seems to work here ! even on cpan.1 generated from pod2man...
> Just curious, what part of 'man2pdf' did you run that indicates
> that it works on your system? (Commands and options, would be
> most helpful.)

dos2unix < man2pdf > /usr/local/bin/man2pdf
perl -pi -e 's/=letter/=a4/' /usr/local/bin/man2pdf
echo echo /tmp > /usr/local/bin/tmpdir
echo > /usr/local/bin/man_blrm
echo 'case $1 in *.*) echo ${1##*.} ;; esac' \
> /usr/local/bin/fn_ext_last
chmod +x /usr/local/bin/man2pdf /usr/local/bin/tmpdir \
/usr/local/bin/man_blrm /usr/local/bin/fn_ext_last
mkdir -p /tmp/man/man1
cd /tmp/man
pod2man /usr/lib/perl5/5.10/ > man1/cpan.1
MANPATH=$PWD man2pdf cpan.1
cd /usr/lib/perl5/5.10/pods
ls |
sed 'h;s|\.pod|.1|;x;G;s|\n| > /tmp/man/man1/|;s|^|eval pod2man |' |
parallel # see attachment, please, keep the copyright, thanks :-)

>> do you have bash-completion, if yes, get rid of it and try again.
> Bash completion is installed on my system but never loaded; i.e.,
> /etc/bash_completion is not sourced in '~/.bashrc', or
> '~/.profile', or anywhere else.
> Why do you think this is the cause of the problem?

bcoz bash-completion is known to cause performance problem to bash...

> You might be combining two parts of my report in a
> misleading way. The slowdown was due to the errant Bash
> sessions not the cause of them. A reboot eventually returned
> the system to its normal sluggish state (for Cygwin on a 64-bit
> version of Windoze). Or, what don't I understand?

well, I'm running 32bit windoz...

> Notice:
> -- 
>   $ time bash -i -c echo
>   real    0m0.683s
>   user    0m0.015s
>   sys     0m0.186s
>   $ time bash -c echo
>   real    0m0.342s
>   user    0m0.015s
>   sys     0m0.062s
> -- 

bash is also known to be a *piece of crap* in I/O, done.

however, these exemples aren't representative, specifically the first
one since you have the interactive initialisation. a r/w loop would be
more representative (1000 times is sufficient)

i.e. :

v2$ time bash -c 'i=0; while (( (i+=1) < 1000 )); do while read -r; do
echo -E "$REPLY"; done < /etc/passwd; done > /dev/null'

real    0m25.965s
user    0m2.838s
sys     0m22.494s

# pdksh
v2$ time ksh -c 'i=0; while (( (i+=1) < 1000 )); do while read -r; do
echo -E "$REPLY"; done < /etc/passwd; done > /dev/null'

real    0m8.250s
user    0m0.764s
sys     0m7.065s

v2$ time ksh88 -c 'i=0; while (( (i+=1) < 1000 )); do while read -r; do
echo -E "$REPLY"; done < /etc/passwd; done > /dev/null'

real    0m1.270s
user    0m0.296s
sys     0m0.810s

v2$ time ksh93 -c 'i=0; while (( (i+=1) < 1000 )); do while read -r; do
echo -E "$REPLY"; done < /etc/passwd; done > /dev/null'

real    0m1.472s
user    0m0.374s
sys     0m0.967s

the -i doesn't change anything, bash is still so ssslllooowwww !

> I'm more inclined to believe that it has something to do with
> either:
>   * the "extreme" number of processes generated by:
>     'mkperlmanpdfs'/'man2pdf' and interaction possibly with a
>     'bash' bug

no problem, here, except a windows memory exhausted ! then bash died...
almost the first time I see this windows box !!!

maybe you launch too many processes at a time ?

however, I propose you to modify your mkperlmanpdfs script using the
attached parallel shell script... please, keep the copyright, thanks :-)

first time posted on

i.e. :

cd /tmp/man
cat << 'EOF' > mkperlmanpdfs
ls /usr/lib/perl5/5.10/pods |
sed 's|\.pod||;s|^|man2pdf -n |' |
chmod +x mkperlmanpdfs
MANPATH=$PWD ./mkperlmanpdfs

no memory exhausted and only 98% cpu :-)
elapsed time is 425 seconds (aka 7+ minutes) on a Q6600.

> or
>   * corrupt fonts in Windows or Cygwin that 'man'/'groff' is
>     "barfing" on.

no problem here ?

> WRT the font "issue" (real or imagined on my part), I'm unclear
> on whether Cygwin can use Windows TT fonts for things like
> 'groff', and X windows rendering. (I would like to know, for
> example, how to specify which fonts to 'enscript'.)
> *But*, *I know I don't know what I'm talking about and that's why
> I asked the Cygwin list.*

out of topic.

>> PS : where do you find the Club-G package ?
> The Club-G (TM) scripts are an interdependent set that I wrote,
> which will be published, RSN, on
> "Club-G" (TM), BTW, stands for:

well, and how do you expect I test your man2pdf script the right way w/
these missing pieces ?
for instance, I wrote them using a simple a one liner... and they seems
to make it :-P


Cyrille Lefevre

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: parallel
URL: <>
-------------- next part --------------
Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list