Skip Menu |

This queue is for tickets about the P CPAN distribution.

Report information
The Basics
Id: 89067
Status: resolved
Priority: 0/
Queue: P

People
Owner: pause [...] tlinx.org
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: leaks fd when loaded
Date: Mon, 30 Sep 2013 14:38:57 +0100
To: bug-P [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
When P is loaded as a module, the loading process leaves a file descriptor open for the P::DATA filehandle, which is never closed. I can illustrate this by examining Linux's /proc/$$/fd directory: $ perl -Ilib -we 'use P; system("ls -l /proc/$$/fd")' total 0 lrwx------ 1 zefram zefram 64 Sep 30 14:37 0 -> /dev/pts/5 lrwx------ 1 zefram zefram 64 Sep 30 14:37 1 -> /dev/pts/5 lrwx------ 1 zefram zefram 64 Sep 30 14:37 2 -> /dev/pts/5 lr-x------ 1 zefram zefram 64 Sep 30 14:37 3 -> pipe:[127393829] lr-x------ 1 zefram zefram 64 Sep 30 14:37 4 -> /home/zefram/usr/perl/perl_install/perl-5.16.3-i64-f52/cpan/build/P-1.0.20-KhxgxS/lib/P.pm Well-behaved modules avoid leaking such a file descriptor: $ perl -Ilib -we 'use Data::Dumper; system("ls -l /proc/$$/fd")' total 0 lrwx------ 1 zefram zefram 64 Sep 30 14:37 0 -> /dev/pts/5 lrwx------ 1 zefram zefram 64 Sep 30 14:37 1 -> /dev/pts/5 lrwx------ 1 zefram zefram 64 Sep 30 14:37 2 -> /dev/pts/5 lr-x------ 1 zefram zefram 64 Sep 30 14:37 3 -> pipe:[127371935] -zefram
This was more than a little "arcane", as I don't usually care so much about fd's, but I think I fixed the problem -- which, as you may have guess if you looked at the code, comes about by it's "self-run-ability" to demonstrate simple examples (as well as test itself). This seems to also be fixed in my devel release.
FWIW, I'm entering items fixed by V1.1.0, which isn't listed in the dropdown yet (but is listed Under my perlID)...