[New-bugs-announce] [issue25831] dbm.gnu leaks file descriptors on .reorganize()

Isaac Schwabacher report at bugs.python.org
Wed Dec 9 14:04:21 EST 2015


New submission from Isaac Schwabacher:

I found because test_dbm_gnu fails on NFS; my initial thought was that the test was failing to close a file somewhere (similarly to #20876), but a little digging suggested that the problem is in dbm.gnu itself:

    $ ./python
    Python 3.5.1 (default, Dec  9 2015, 11:55:23) 
    [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import dbm.gnu
    >>> import subprocess
    >>> db = dbm.gnu.open('foo', 'c')
    >>> db.reorganize()
    >>> db.close()
    >>> subprocess.check_call(['lsof', 'foo'])
    COMMAND     PID        USER  FD   TYPE DEVICE SIZE/OFF        NODE NAME
    python  2302377 schwabacher mem-W  REG   0,52    98304 25833923756 foo
    0

A quick look at _gdbmmodule.c makes clear that the problem is upstream, but their bug tracker has 9 total entries... The best bet might just be to skip the test on NFS.

----------
components: Library (Lib)
messages: 256159
nosy: ischwabacher
priority: normal
severity: normal
status: open
title: dbm.gnu leaks file descriptors on .reorganize()
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25831>
_______________________________________


More information about the New-bugs-announce mailing list