Bug 444374

Summary: Intermittently incorrect exit status for child processes
Product: Red Hat Enterprise Linux 4 Reporter: Michael Forrest <mef>
Component: kshAssignee: Tomas Smetana <tsmetana>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: 4.8   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-29 05:55:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test script (also see attached file "large1")
none
Contains a number of functions for total script size > 50K
none
Patch to fix the (sometimes) incorrect exit status none

Description Michael Forrest 2008-04-28 00:33:44 UTC
Description of problem:
In some internal testing with moderately sized scripts (see attachments),
I have found that the exit status reported in the "$?" parameter can sometimes
be incorrect, and unrelated to the actual exit statuses of child processes.

I bave only detected this problem with ksh-20050202-0.4E.4.

I have a single line patch (attached) which properly initialises the
structure member that was added in the "exit19" patch (appears to be
a backport for  RHBZ 232640, which I cannot see the details for).


Version-Release number of selected component (if applicable):
ksh-20050202-0.4E.4

How reproducible:

Run my test script (with accompanying "large1" file) as follows:

ksh ./test_mkdir 1 > _output

Actual results:

The _output file should report a number of failures of the form:

"Failed with status=<some random number>"

Expected results:


The _output file should only have lines like the following:

"Success"

Additional info:

My "exitfix" patch corrects the ksh executable so that only the expected
result is seen for the 150 attemnpts to execute a child mkdir.

Comment 1 Michael Forrest 2008-04-28 00:33:44 UTC
Created attachment 303925 [details]
Test script (also see attached file "large1")

Comment 2 Michael Forrest 2008-04-28 00:37:13 UTC
Created attachment 303926 [details]
Contains a number of functions for total script size > 50K

Comment 3 Michael Forrest 2008-04-28 00:38:38 UTC
Created attachment 303927 [details]
Patch to fix the (sometimes) incorrect exit status

Comment 4 Tomas Smetana 2008-05-05 08:27:06 UTC
This issue should be fixed in ksh-20050202-0.5E.4 that is about to be released
in RHEL 4.7.

The testing packages that contain all the recent changes can be downloaded from
http://tsmetana.fedorapeople.org/ksh/el4-test/
Note these are unofficial and unsupported -- just if you wish to test them
yourself to verify everything works OK for you.

Comment 5 Tomas Smetana 2008-05-07 08:20:56 UTC
If you can't verify the testing packages I'll close this bug as a duplicate of
bug #429153 because I failed to reproduce the problem with the new version.

Comment 6 Michael Forrest 2008-05-29 05:07:46 UTC
(In reply to comment #5)
> If you can't verify the testing packages I'll close this bug as a duplicate of
> bug #429153 because I failed to reproduce the problem with the new version.

Sorry it has taken so long to get back on this particular issue, but I have
finally had some time to verify that the ksh contained in the rpm at:

http://tsmetana.fedorapeople.org/ksh/el4-test/ksh-20050202-0.5E.4.i386.rpm

does NOT have the same return status issue described in this bug report.

The test_mkdir test script (which shows a number of failures with ksh-0.5E-4)
has _no_ failures with the new proposed ksh at the above URL.

I look forward to the 4.7 release bundle with a new ksh!

Comment 7 Tomas Smetana 2008-05-29 05:55:10 UTC
Thanks for the testing.  Closing.

*** This bug has been marked as a duplicate of 429153 ***