Bug 1001220 - leaked fd
Summary: leaked fd
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: expect
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Vitezslav Crhonek
QA Contact: Fedora Extras Quality Assurance
URL: http://lists.gnu.org/archive/html/bug...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-26 19:18 UTC by Jan Kratochvil
Modified: 2014-09-09 11:41 UTC (History)
5 users (show)

Fixed In Version: expect-5.45-18.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-09 11:41:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
fd leak patch (532 bytes, patch)
2014-09-04 13:42 UTC, Matej Mužila
no flags Details | Diff

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...


Note You need to log in before you can comment on or make changes to this bug.