Like I said, this is very position dependent.  Perturbing the script by
even one byte makes the bug go away.  I've attached strace output from
both runs.  Trace 1 is where the bug in the output is.  Trace 2 is the
correct output. 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> David Korn
> Sent: Wednesday, September 09, 2009 6:24 PM
> To: [email protected]
> Subject: [ast-developers] (no subject)
> 
> Subject: 
> --------
> 
> > $ uname -a
> > Linux thmdtdev15 2.6.9-67.ELlargesmp #1 SMP Wed Nov 7 
> 14:07:22 EST 2007
> > x86_64
> > 
> > $ /bin/ksh --version
> >   version         sh (AT&T Labs Research) 1993-12-28 q
> > 
> > Install the bug.sh script from inside the attached tar file 
> *exactly* as
> > is and run the following script to demonstrate the bug:
> >  
> > #!/bin/ksh
> > perl -pe '     ' <bug.sh >bug_copy.sh; chmod 755 bug_copy.sh;
> > one=$(bug_copy.sh)
> > perl -pe 's/x//' <bug.sh >bug_copy.sh; chmod 755 bug_copy.sh;
> > two=$(bug_copy.sh)
> > [[ $one = "$two" ]] && echo "NO BUG"
> > [[ $one = "$two" ]] || echo "BUG"
> > rm bug_copy.sh
> > 
> > Just perturbing the script by one character (e.g. by 
> removing the "x"
> > character) causes the bug to go away.  I'm not quite sure 
> what's going
> > on here, but maybe someone can debug it?
> > 
> 
> I tried this script with ksh93t+ and [[ $one == "$two" ]] is 
> true in both
> cases so that it outputs only NO BUG.
> 
> David Korn
> [email protected]
> _______________________________________________
> ast-developers mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-developers
> 
> 

Attachment: bug.out1
Description: bug.out1

Attachment: bug.out2
Description: bug.out2

Attachment: bug.trace1
Description: bug.trace1

Attachment: bug.trace2
Description: bug.trace2

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

Reply via email to