This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: dbm.gnu leaks file descriptors on .reorganize()
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ischwabacher
Priority: normal Keywords:

Created on 2015-12-09 19:04 by ischwabacher, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg256159 - (view) Author: Isaac Schwabacher (ischwabacher) * Date: 2015-12-09 19:04
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.
msg256160 - (view) Author: Isaac Schwabacher (ischwabacher) * Date: 2015-12-09 20:39
Further searching reveals this as a dupe of #13947. Closing.
History
Date User Action Args
2022-04-11 14:58:24adminsetgithub: 70018
2015-12-09 20:39:37ischwabachersetstatus: open -> closed

messages: + msg256160
2015-12-09 19:04:21ischwabachercreate