Bug 47865 - directory handle not closed
directory handle not closed
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: LPRng (Show other bugs)
7.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-08 03:13 EDT by Chris Dunlop
Modified: 2007-04-18 12:34 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-21 07:43:48 EST
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 03:15 EDT, Chris Dunlop
no flags Details | Diff

  None (edit)
Description Chris Dunlop 2001-07-08 03:13:49 EDT
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 03:15:04 EDT
Created attachment 22987 [details]
Fixes file descriptor leak
Comment 2 Tim Waugh 2002-01-04 11:46:41 EST
This seems to be fixed in the upstream 3.8.4 release.
Comment 3 Tim Waugh 2002-01-22 08:53:52 EST
Fixed in LPRng-3.8.4-1.

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