File::Pid bug with Perl >= 5.12

Bug #1281292 reported by Denny de la Haye
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libfile-pid-perl (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

File::Pid has had a bug since at least 2006, RT here: https://rt.cpan.org/Public/Bug/Display.html?id=18960

This bug is fatal since Perl 5.12

As you can see in the comments on RT, there is a simple one-line patch that fixes the problem. I believe the Ubuntu or Debian package maintainer used to apply this patch but it seems to have been removed recently. Could it be re-applied please? :)

Regards,
Denny

Revision history for this message
gregor herrmann (gregoa) wrote : Re: [Pkg-perl-maintainers] [Bug 1281292] [NEW] File::Pid bug with Perl >= 5.12

On Mon, 17 Feb 2014 20:53:00 -0000, Denny de la Haye wrote:

> File::Pid has had a bug since at least 2006, RT here:
> https://rt.cpan.org/Public/Bug/Display.html?id=18960
>
> This bug is fatal since Perl 5.12
>
> As you can see in the comments on RT, there is a simple one-line patch
> that fixes the problem. I believe the Ubuntu or Debian package
> maintainer used to apply this patch but it seems to have been removed
> recently. Could it be re-applied please? :)

There's exactly one version of this package in all Debian and Ubuntu
suites:

 libfile-pid-perl | 1.01-1 | squeeze | source, all
 libfile-pid-perl | 1.01-1 | wheezy | source, all
 libfile-pid-perl | 1.01-1 | jessie | source, all
 libfile-pid-perl | 1.01-1 | sid | source, all
 libfile-pid-perl | 1.01-1 | lucid/universe | source, all
 libfile-pid-perl | 1.01-1 | precise/universe | source, all
 libfile-pid-perl | 1.01-1 | quantal/universe | source, all
 libfile-pid-perl | 1.01-1 | saucy/universe | source, all
 libfile-pid-perl | 1.01-1 | trusty/universe | source, all

I have a hard time imagining that the patch was removed in Ubuntu in
general, and especially without changing the version number :)

(And I'm also surprised we haven't seen a bug report about this in
Debian or Ubuntu earlier ...)

So I'm guessing that the problem is elsewhere, like the patch being
not complete or something.

Do you have a minimal testcase that shows the actual problem?

Cheers,
gregor

--
 .''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/
 `. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `- NP: Aziza Mustafà Zadeh: Carnival

Revision history for this message
Denny de la Haye (dennymeta) wrote :

Test case:

denny@serenity:~$ cat file-pid-go-boom.pl
#!/usr/bin/env perl

use strict;
use warnings;

use 5.012;

use File::Pid;
my $pidfile = File::Pid->new({
 file => '/tmp/file-pid-go-boom.pid',
});
if ( my $num = $pidfile->running ) {
 die "Already running: $num\n";
}
$pidfile->write;

say 'Hey, it worked!';

$pidfile->remove;

denny@serenity:~$ head -123 /usr/local/share/perl/5.14.2/File/Pid.pm | tail -2
    my $pid = $self->_get_pid_from_file;
# my $pid = $self->_get_pid_from_file or return undef;
denny@serenity:~$ perl file-pid-go-boom.pl
Can't kill a non-numeric process ID at /usr/local/share/perl/5.14.2/File/Pid.pm line 125.
denny@serenity:~$ head -123 /usr/local/share/perl/5.14.2/File/Pid.pm | tail -2
# my $pid = $self->_get_pid_from_file;
    my $pid = $self->_get_pid_from_file or return undef;
denny@serenity:~$ perl file-pid-go-boom.pl
Hey, it worked!
denny@serenity:~$

Revision history for this message
Denny de la Haye (dennymeta) wrote :

Interesting about the debian/ubuntu versions! All I can say is that the first time I wrote code using File::Pid, it worked on my home machine (Ubuntu 10.04 I think) but failed when deployed on my server (CentOS), and it took me ages to find that RT bug report which explained why. This has continued to be the case up until quite recently - moving to a new CentOS server a few months ago threw me all over again, having had over a year to forget the problem, as my home machine (now with Ubuntu 12.04) still worked fine. The comments on that RT report claim that Debian/Ubuntu had patched, which I assumed to be the reason for the difference between my home machine and server, although I'm not sure if I ever actually checked the relevant line in the module.

Revision history for this message
gregor herrmann (gregoa) wrote : Re: [Pkg-perl-maintainers] [Bug 1281292] Re: File::Pid bug with Perl >= 5.12

On Mon, 17 Feb 2014 22:04:24 -0000, Denny de la Haye wrote:

> Test case:

Thanks!

> denny@serenity:~$ head -123 /usr/local/share/perl/5.14.2/File/Pid.pm | tail -2
> my $pid = $self->_get_pid_from_file;
> # my $pid = $self->_get_pid_from_file or return undef;
> denny@serenity:~$ perl file-pid-go-boom.pl
> Can't kill a non-numeric process ID at /usr/local/share/perl/5.14.2/File/Pid.pm line 125.
> denny@serenity:~$ head -123 /usr/local/share/perl/5.14.2/File/Pid.pm | tail -2
> # my $pid = $self->_get_pid_from_file;
> my $pid = $self->_get_pid_from_file or return undef;
> denny@serenity:~$ perl file-pid-go-boom.pl
> Hey, it worked!
> denny@serenity:~$

Well, yes, I'm not surprised that you see a problem if you undo the
patch in a local copy (or an install from CPAN?) of the file under
/usr/local :)

Can you please
- check that you have libfile-pid-perl 1.01-1 installed
- and look in /usr/share/perl5/File/Pid.pm ?

% head -123 /usr/share/perl5/File/Pid.pm | tail -2
    my $pid = $self->_get_pid_from_file or return undef;

Cheers,
gregor

--
 .''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/
 `. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `- NP: Ostbahn-Kurti & Die Chefpartie: Radl Noch Rio

Revision history for this message
Denny de la Haye (dennymeta) wrote :

Oooops. I do not have libfile-pid-perl installed, sorry to have bothered you!

Changed in libfile-pid-perl (Ubuntu):
status: New → Invalid
Revision history for this message
gregor herrmann (gregoa) wrote :

On Mon, 17 Feb 2014 22:46:08 -0000, Denny de la Haye wrote:

> Oooops. I do not have libfile-pid-perl installed, sorry to have
> bothered you!

No worries, glad to see that we have solved the miracle :)

Cheers,
gregor

--
 .''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/
 `. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `- NP: Neerstroem: Kleiner Mond

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.