Bug 1001220

Summary: leaked fd
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: expectAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: hhorak, jan.kratochvil, mmuzila, patrickm, vcrhonek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
URL: http://lists.gnu.org/archive/html/bug-dejagnu/2013-08/msg00000.html
Whiteboard:
Fixed In Version: expect-5.45-18.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-09 11:41:27 UTC Type: Bug
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
fd leak patch none

Description Jan Kratochvil 2013-08-26 19:18:11 UTC
Description of problem:
runtest leaks fd 

Version-Release number of selected component (if applicable):
dejagnu-1.5.1-3.fc20.noarch
expect-5.45-10.fc20.x86_64
tcl-8.5.14-1.fc20.x86_64

How reproducible:
Always.

Steps to Reproduce:
echo 'remote_exec target "ls -l /proc/self/fd/"' >dejagnuleak.exp
runtest dejagnuleak.exp
cat testrun.log

Actual results:
lrwx------ 1 jkratoch jkratoch 64 Aug 26 21:15 0 -> /dev/pts/5
lrwx------ 1 jkratoch jkratoch 64 Aug 26 21:15 1 -> /dev/pts/5
lrwx------ 1 jkratoch jkratoch 64 Aug 26 21:15 2 -> /dev/pts/5
lrwx------ 1 jkratoch jkratoch 64 Aug 26 21:15 3 -> /dev/pts/2
lr-x------ 1 jkratoch jkratoch 64 Aug 26 21:15 4 -> /proc/25522/fd

Expected results:
lrwx------ 1 jkratoch jkratoch 64 Aug 26 21:15 0 -> /dev/pts/5
lrwx------ 1 jkratoch jkratoch 64 Aug 26 21:15 1 -> /dev/pts/5
lrwx------ 1 jkratoch jkratoch 64 Aug 26 21:15 2 -> /dev/pts/5
lr-x------ 1 jkratoch jkratoch 64 Aug 26 21:15 3 -> /proc/25522/fd

Additional info:
With RHEL-5/6 versions the fd leak was worse - many fds.

Comment 1 Matej Mužila 2014-09-04 13:42:27 UTC
Created attachment 934436 [details]
fd leak patch

I found out that the problem isn't in dejagnu. The problem seems to be
in expect. 

The problem can be reproduced also by:
echo 'remote_exec target "ls -l /proc/self/fd/"' >dejagnuleak.exp
expect  -- /usr/share/dejagnu/runtest.exp dejagnuleak.exp

Attached patch solves the problem in Fedora 20. I haven't tested 
it in RHEL.

Reassigning to expect...