Subject: | file descriptor leak without $cdbh->finish |
Date: | Wed, 11 Mar 2015 12:57 +0300 |
To: | bug-CDB_File [...] rt.cpan.org |
From: | Alexander Gnatyna <gnatyna [...] yandex.ru> |
Hello.
I found file descriptor leak in CDB_File: cdbmaker_DESTROY does't close
opened file handle, so descriptors leak if no $cdb->finish method called.
Example below:
perl -le 'use CDB_File; warn $CDB_File::VERSION; for(1..3){ my $cdb =
CDB_File->new("$_.cdb", "$_.cdb.tmp"); } print `lsof -np $$`'|grep cdb
0.97_02 at -e line 1.
perl 5928 gnatyna 6w REG 9,4 0 108922859 /tmp/1.cdb.tmp
perl 5928 gnatyna 7w REG 9,4 0 108922875 /tmp/2.cdb.tmp
perl 5928 gnatyna 8w REG 9,4 0 108922876 /tmp/3.cdb.tmp
draft patch in attachment.
Thank you.
Gnatyna Alexander.
Message body is not shown because sender requested not to inline it.