Issue 512 - Bad file number
Summary: Bad file number
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-04-21 08:01 UTC by dpoccia@libero.it
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description dpoccia@libero.it 2000-04-21 08:01:01 UTC
Full_Name: Danilo Poccia
Version: 1.2.9
OS: HP-UX 11.00
URL: 
Submission from: (NULL) (192.6.59.72)


I use BerkeleyDB 2.77 as the backend.

When I try to define more than 10 indexes I have an 'operations error' during an
ldapadd then uses all of that.

I have seen, using slapd with the full debug (-d 65535), than there is a 'Bad
file number' during then 11th 'ldbm_cache_open', which probably opens an already
opened file.

That function is defined in 'servers/slapd/back-ldbm/dbcache.c' and uses, as the
cache size, the MAXDBCACHE define of 'servers/slapd/back-ldbm/back-ldbm.h' which
defaults to 10.

The problems seems to happen where there are MAXDBCACHE files open by
'ldbm_cache_open' and all are used (dbc_refcnt > 0). When there is a request of
another 'cache open', a thread lock waits for a cache to be reassigned, but the
next 'ldbm_cache_open' on that file gives the 'Bad file number' error.

As as quick fix I have increased the MAXDBCACHE value to 100, a value that I
think I will not reach, but I think that a better fix can be done.

I have used both pthread and lthread (--without-threads to configure script).


Comment 1 Kurt Zeilenga 2000-06-02 18:40:39 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 2 Kurt Zeilenga 2000-06-08 16:45:04 UTC
changed notes
changed state Test to Closed
Comment 3 OpenLDAP project 2014-08-01 21:06:54 UTC
Seems like a reasonable workaround
released with 1.2.11