Bug 47865 - directory handle not closed
Summary: directory handle not closed
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: LPRng   
(Show other bugs)
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Brock Organ
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-08 07:13 UTC by Chris Dunlop
Modified: 2007-04-18 16:34 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-21 12:43:48 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fixes file descriptor leak (348 bytes, patch)
2001-07-08 07:15 UTC, Chris Dunlop
no flags Details | Diff

Description Chris Dunlop 2001-07-08 07:13:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.2.19-7.0.1smp i686)

Description of problem:
In common.c::Scan_queue() the current directory is opened using
opendir("."). This
directory is never closed which causes a leak of the file descriptor.  E.g.
with 200 files
in the queue I ended up with the spool directory open over 1000 times at
the same time as shown by lsof.  The process ends up running out of file
descriptors.

How reproducible:
Always

Steps to Reproduce:
1. Queue 200 files to be printed
2. Wait a while...
3.  Use "lsof" on the "Server" daemon:
    lsof -p `ps ax | fgrep 'lpd (Server' | fgrep -v fgrep | sed 's/ .*//'`

	

Actual Results:  There were over 1000 instances of this in the output:

  lpd     11667 root 1023r   DIR    3,7   28672 106188 /var/spool/lpd/lp


Expected Results:  There should be a single instance, if that.

Additional info:

Attached patch fixes the problem

Comment 1 Chris Dunlop 2001-07-08 07:15:04 UTC
Created attachment 22987 [details]
Fixes file descriptor leak

Comment 2 Tim Waugh 2002-01-04 16:46:41 UTC
This seems to be fixed in the upstream 3.8.4 release.


Comment 3 Tim Waugh 2002-01-22 13:53:52 UTC
Fixed in LPRng-3.8.4-1.



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