Bug 136418 (IT_52172)

Summary: [RHEL3][PATCH]csh bug
Product: Red Hat Enterprise Linux 3 Reporter: Martin Hunt <hunt>
Component: tcshAssignee: Miloslav Trmač <mitr>
Status: CLOSED DUPLICATE QA Contact: Bill Huang <bhuang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 19:06:29 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
fcntl patch for tcsh 6.12 none

Description Martin Hunt 2004-10-19 21:11:16 UTC
Customer runs script as below, which become error.
Although customer uses AMD64 Opteron, when I tested with my
machine(x86), there is no problem at all.

----------
Action by: stakagi
Issue Registered
----------
Action by: stakagi
(note: Script was saved as "test")

#!/bin/csh -f
echo "#!/bin/csh -f" > test__
echo  -n "\\" >> test__
echo "ls -l" >> test__
echo "" >> test__
chmod a+x test__
./test__

After the script was run, errors are showed as below:
# ./test
./test__: Text file busy.
# csh ./test
./test__: Text file busy.
# tcsh ./test
./test__: Text file busy.

There is no facility for testing AMD64 in Brisbane office so that this
case need to be escalated to L3/SEG group.
As I said, I couldn''t reproduce this issue with x86
RHEL3AS/kernel-2.4.21-20.EL/tcsh-6.12-4, which is same as customer's
environment.


Category set to: Applications::Functions
Status set to: Pending Escalation

----------
Action by: nhorman
I've recreated this.  It kinda looks to me like deny_write_access is
returning ETXTBSY when the shells call to execve is made, indicating
that i_writecount is greater than zero (implying a file writer still
has the file open).  This however would appear contradicted by the
strace of the shell script which seems to indicate that the opens and
closes of the file test__ are balanced.  Since we're dealing with a
shell however, theres lots of file descriptor duplication going on
(for output redirection) so perhaps there is a descrepancy in the
x86_64 kernel that doesn't correctly decrement the writer count if a
descriptor has been duped?  Escalating and investigating.


Issue escalated to Sustaining Engineering by: nhorman.
nhorman assigned to issue for Support Engineering Group.

Category set to: Applications

Comment 1 Martin Hunt 2004-10-19 21:15:24 UTC
Fixed in tcsh 6.13 in Fedora.

I reproduced this in 6.12 and tested the backported patch from the
Fedora 6.13 RPM.  

Attaching patch.

Comment 2 Martin Hunt 2004-10-19 21:16:36 UTC
Created attachment 105467 [details]
fcntl patch for tcsh 6.12

Comment 4 Miloslav Trmač 2004-10-19 21:29:12 UTC

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

Comment 6 Red Hat Bugzilla 2006-02-21 19:06:29 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.