Skip Menu |

This queue is for tickets about the autodie CPAN distribution.

Report information
The Basics
Id: 47564
Status: resolved
Priority: 0/
Queue: autodie

People
Owner: PJF [...] cpan.org
Requestors: frequency [...] cpan.org
Cc:
AdminCc:

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



Subject: warning from t/socket.t
Hi: While packaging your module for Debian, I came across the following warning: Use of uninitialized value $tcp in socket at t/socket.t line 26. t/socket.........................ok I looked at the file and it appears to be accessible given the scope that it's used: my $tcp = getprotobyname('tcp'); eval { socket(my $socket, PF_INET, SOCK_STREAM, $tcp); my $bogus_address = "This isn't even formatted properly"; connect($socket, $bogus_address); }; But I guess it might not be initialized when the eval{} is compiled. Cheers, Jonathan
G'day Jonathan, On Sat Jul 04 12:40:51 2009, FREQUENCY wrote: Show quoted text
> Use of uninitialized value $tcp in socket at t/socket.t line 26. > my $tcp = getprotobyname('tcp');
Perl's in-built getprotobyname() function does whatever is needed to convert a human readable string ('tcp') into something usable by the socket call (eg: '6'). On Linux systems, that means looking it up in /etc/protocols . My guess is that in a sandboxed build environment, there is no /etc/protocols, and so this is failing, and returning undef. That doesn't impact the test at all, since the whole purpose is to end up with an invalid call to connect(). Besides from being unsightly, does the warning cause any other problems with the build process? If not, would you mind particularly if it stayed in there for the moment? It does remind me that having getprotobyname() supported by autodie is currently marked as a TODO test, and with the current autodie framework, it should be trivial to implement. So with the next release you may see that test having changed somewhat, and that warning will probably go away. All the best, Paul
Hi Paul: On Sat Jul 04 23:48:49 2009, PJF wrote: Show quoted text
> G'day Jonathan, > > On Sat Jul 04 12:40:51 2009, FREQUENCY wrote: >
> > Use of uninitialized value $tcp in socket at t/socket.t line 26. > > my $tcp = getprotobyname('tcp');
> > Perl's in-built getprotobyname() function does whatever is needed to > convert a human readable string ('tcp') into something usable by the > socket call (eg: '6'). On Linux systems, that means looking it up in > /etc/protocols .
Oh, I see. Show quoted text
> > My guess is that in a sandboxed build environment, there is no > /etc/protocols, and so this is failing, and returning undef. That > doesn't impact the test at all, since the whole purpose is to end up > with an invalid call to connect().
That makes sense. Show quoted text
> > Besides from being unsightly, does the warning cause any other problems > with the build process? If not, would you mind particularly if it > stayed in there for the moment?
Nope, I've upgraded the package appropriately. It might have even existed from the past, I really don't know. It's not a huge issue, just thought I'd let you know. Show quoted text
> > It does remind me that having getprotobyname() supported by autodie is > currently marked as a TODO test, and with the current autodie framework, > it should be trivial to implement. So with the next release you may see > that test having changed somewhat, and that warning will probably go away.
Cool. I look forward to it. Thanks for the prompt response. Cheers, Jonathan
Marking as resolved. I really don't know why RT insists on re-opening bugs every time an informative response is added.