Bug 25728 - File descriptor leak in lib/gcov.exp
Summary: File descriptor leak in lib/gcov.exp
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 3.4.6
Assignee: Not yet assigned to anyone
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2006-01-09 19:54 UTC by H.J. Lu
Modified: 2006-01-28 21:20 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.0.3 3.4.6 4.1.0 4.2.0
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2006-01-09 19:54:38 UTC
verify-lines in gcc/testsuite/lib/gcov.exp has

proc verify-lines { testcase file } {
    #send_user "verify-lines\n"
    set failed 0
    set fd [open $file r]
    while { [gets $fd line] >= 0 } {
        if [regexp "^ *(\[^:]*): *(\[0-9\]+):.*count\\((\[0-9\]+)\\)" \
                "$line" all is n shouldbe] {
            if { $is == "" } {
                fail "$n:no data available for this line"
                incr failed
            } elseif { $is != $shouldbe } {
                fail "$n:is $is:should be $shouldbe"
                incr failed
            }
        }
    }
    return $failed
}

There is no "close $fd", which leads to file descriptor leak.
Comment 1 H.J. Lu 2006-01-09 19:59:10 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2006-01/msg00495.html
Comment 2 hjl@gcc.gnu.org 2006-01-12 01:29:10 UTC
Subject: Bug 25728

Author: hjl
Date: Thu Jan 12 01:29:07 2006
New Revision: 109627

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109627
Log:
2006-01-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/25728
	* lib/gcov.exp (verify-lines): Add "close $fd".

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/lib/gcov.exp

Comment 3 hjl@gcc.gnu.org 2006-01-12 01:35:25 UTC
Subject: Bug 25728

Author: hjl
Date: Thu Jan 12 01:35:21 2006
New Revision: 109628

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109628
Log:
2006-01-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/25728
	* lib/gcov.exp (verify-lines): Add "close $fd".

Modified:
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/lib/gcov.exp

Comment 4 hjl@gcc.gnu.org 2006-01-12 01:40:51 UTC
Subject: Bug 25728

Author: hjl
Date: Thu Jan 12 01:40:48 2006
New Revision: 109631

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109631
Log:
2006-01-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/25728
	* lib/gcov.exp (verify-lines): Add "close $fd".

Modified:
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_0-branch/gcc/testsuite/lib/gcov.exp

Comment 5 hjl@gcc.gnu.org 2006-01-12 01:45:57 UTC
Subject: Bug 25728

Author: hjl
Date: Thu Jan 12 01:45:54 2006
New Revision: 109632

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109632
Log:
2006-01-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/25728
	* lib/gcov.exp (verify-lines): Add "close $fd".

Modified:
    branches/gcc-3_4-branch/gcc/testsuite/ChangeLog
    branches/gcc-3_4-branch/gcc/testsuite/lib/gcov.exp

Comment 6 H.J. Lu 2006-01-12 01:47:34 UTC
Fixed.