Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the IO-Pty-Easy CPAN distribution.

Report information
The Basics
Id: 50373
Status: open
Priority: 0/
Queue: IO-Pty-Easy

People
Owner: Nobody in particular
Requestors: kbrint [...] rufus.net
Cc:
AdminCc:

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



Subject: is_active() on closed IO::Pty::Easy causes vec(,undef,)
DESTROY calls ->close, which calls ->kill, which calls ->is_active. In this case, if the pty has already been ->close()'d, fileno($self) may be undef. vec($x,undef,$x) causes an error: Use of uninitialized value in vec at /usr/local/lib/perl5/site_perl/5.8.9/IO/Pty/Easy.pm line 270 during global destruction. The attached patch fixes the problem. Please release a new version.
Subject: easy.patch
--- Easy.pm.orig 2009-10-09 21:43:37.000000000 +0000 +++ Easy.pm 2009-10-09 21:43:03.000000000 +0000 @@ -263,6 +263,7 @@ my $self = shift; return 0 unless defined $self->pid; + return 0 unless defined fileno($self); # XXX FreeBSD 7.0 will not allow a session leader to exit until the kernel # tty output buffer is empty. Make it so. my $rin = '';
0.08 uploaded, I fixed what should be the actual cause of this warning rather than just masking it - let me know if it doesn't actually fix your issue.
Subject: Re: [rt.cpan.org #50373] is_active() on closed IO::Pty::Easy causes vec(,undef,)
Date: Sat, 10 Oct 2009 11:39:24 -0500
To: Jesse Luehrs via RT <bug-IO-Pty-Easy [...] rt.cpan.org>
From: kevin brintnall <kbrint [...] rufus.net>
On Sat, Oct 10, 2009 at 02:11:33AM -0400, Jesse Luehrs via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50373 > > > 0.08 uploaded, I fixed what should be the actual cause of this warning > rather than just masking it - let me know if it doesn't actually fix > your issue.
Hi, Your circular reference fix does prevent the cleanup from happening at global destruction.. However I am still seeing this in my application: Use of uninitialized value in vec at /usr/local/lib/perl5/site_perl/5.8.9/IO/Pty/Easy.pm line 273, <STDIN> line 1 I think "defined fileno($self)" is still a reasonable invariant in is_active(). Thoughts? -- kevin brintnall =~ /kbrint@rufus.net/
On Sat Oct 10 12:39:45 2009, KBRINT wrote: Show quoted text
> Hi, > > Your circular reference fix does prevent the cleanup from happening at > global destruction.. However I am still seeing this in my application: > > Use of uninitialized value in vec at > /usr/local/lib/perl5/site_perl/5.8.9/IO/Pty/Easy.pm line 273, <STDIN>
line 1 Show quoted text
> > I think "defined fileno($self)" is still a reasonable invariant in > is_active(). > > Thoughts?
Well, I'm not disagreeing that that being an invariant would be reasonable, but I'm having trouble seeing how that could actually happen... think you could write up a test case?
Subject: Re: [rt.cpan.org #50373] is_active() on closed IO::Pty::Easy causes vec(,undef,)
Date: Mon, 12 Oct 2009 10:39:15 -0500
To: Jesse Luehrs via RT <bug-IO-Pty-Easy [...] rt.cpan.org>
From: kevin brintnall <kbrint [...] rufus.net>
Show quoted text
> Well, I'm not disagreeing that that being an invariant would be > reasonable, but I'm having trouble seeing how that could actually > happen... think you could write up a test case?
Jesse, it looks like this is triggered when the pty is closed like this: #!/usr/bin/perl use IO::Pty::Easy; my $pty = IO::Pty::Easy->new; $pty->spawn('true'); close($pty); # <-- this is the trigger undef $pty; # <-- triggers error message Use of uninitialized value in vec at /usr/local/lib/perl5/site_perl/5.8.9/IO/Pty/Easy.pm line 273. -- kevin brintnall =~ /kbrint@rufus.net/
RT-Send-CC: doy [...] cpan.org
On Mon Oct 12 11:39:30 2009, KBRINT wrote: Show quoted text
> > Well, I'm not disagreeing that that being an invariant would be > > reasonable, but I'm having trouble seeing how that could actually > > happen... think you could write up a test case?
> > Jesse, it looks like this is triggered when the pty is closed like > this: > > #!/usr/bin/perl > > use IO::Pty::Easy; > > my $pty = IO::Pty::Easy->new; > $pty->spawn('true'); > close($pty); # <-- this is the trigger > undef $pty; # <-- triggers error message > > Use of uninitialized value in vec at > /usr/local/lib/perl5/site_perl/5.8.9/IO/Pty/Easy.pm line 273. >
Jesse, any thoughts on how to move forward? -kevin