develooper Front page | perl.perl5.porters | Postings from April 2012

[perl #7937] 5.6.1 question with inet_aton (Socket module)

Thread Previous | Thread Next
From:
Brian Fraser via RT
Date:
April 30, 2012 00:38
Subject:
[perl #7937] 5.6.1 question with inet_aton (Socket module)
Message ID:
rt-3.6.HEAD-4610-1335603297-1290.7937-15-0@perl.org
On Mon Nov 26 05:34:26 2001, perl@neuron.mct.rochester.edu wrote:
> I expected this program to NOT print anything, but it does, and it
>    seems to
> possibly point to a bug.  The man page for Socket says that inet_aton
>    should
> return undef: "If the host name cannot be resolved, returns undef."
>    My
> program uses a hostname of "undef", which to me should mean that it
>    cannot
> be resolved.  I also confirmed this behavior is the same for perl
>    5.005_03
> (on the same machine).  The issue does NOT seem to be present with
>    perl
> 5.6.0 on i386-linux.
> 
> 
> 
> 	use  Socket;
> 	if ($host=inet_aton(undef)) {
>   		printf "Socket version=%s\n",$Socket::VERSION;
>   		printf "not OK, host=%s\n",join('.',unpack('C4',$host));
> 	}
> 
> Here's the output from this program:
> 
> 
> 	Socket version=1.72
> 	not OK, host=0.0.0.0
> 
> 
> Eric Lenio
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> 
> 
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
>     category=core
>     severity=medium
> ---
> Site configuration information for perl v5.6.1:
> 
> Configured by perl at Thu Nov 22 15:18:16 EST 2001.
> 
> Summary of my perl5 (revision 5.0 version 6 subversion 1)
>    configuration:
>   Platform:
>     osname=solaris, osvers=2.6, archname=sun4-solaris
>     uname='sunos neuron.mct.rochester.edu 5.6 generic_105181-28 sun4u
>    sparc sunw,ultra-250 '
>     config_args='-des -Dcc=gcc -Dprefix=/usr/mct1/perl
>   
-Dotherlibdirs=/u/develop/develop/study_tk/lib:/usr/mct1/www/neuron/conf:/usr/mct1/www/neuron/lib/perl'
>     hint=recommended, useposix=true, d_sigaction=define
>     usethreads=undef use5005threads=undef useithreads=undef
>    usemultiplicity=undef
>     useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
>     use64bitint=undef use64bitall=undef uselongdouble=undef
>   Compiler:
>     cc='gcc', ccflags =' -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
>     optimize='-O',
>     cppflags=''
>     ccversion='', gccversion='2.8.1', gccosandvers='solaris2.6'
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
>     d_longlong=define, longlongsize=8, d_longdbl=define,
>    longdblsize=16
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
>    lseeksize=8
>     alignbytes=8, usemymalloc=y, prototype=define
>   Linker and Libraries:
>     ld='gcc', ldflags =' '
>     libpth=/usr/lib /usr/ccs/lib
>     libs=-lsocket -lnsl -ldl -lm -lc
>     perllibs=-lsocket -lnsl -ldl -lm -lc
>     libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
>     cccdlflags='-fPIC', lddlflags='-G'
> 
> Locally applied patches:
> 
> 
> ---
> @INC for perl v5.6.1:
>     /usr/mct1/www/neuron/lib/perl
>     /u/develop/develop/study_tk/lib
>     /usr/mct1/perl/lib/5.6.1/sun4-solaris
>     /usr/mct1/perl/lib/5.6.1
>     /usr/mct1/perl/lib/site_perl/5.6.1/sun4-solaris
>     /usr/mct1/perl/lib/site_perl/5.6.1
>     /usr/mct1/perl/lib/site_perl
>     /u/develop/develop/study_tk/lib
>     /usr/mct1/www/neuron/conf
>     /usr/mct1/www/neuron/lib/perl
>     .
> 
> ---
> Environment for perl v5.6.1:
>     HOME=/usr/mct1/cpan
>     LANG (unset)
>     LANGUAGE (unset)
>     LD_LIBRARY_PATH=/usr/mct1/lib:/usr/license1/ingres2/ingres/lib
>     LOGDIR (unset)
>    
PATH=/usr/mct1/perl/bin:/usr/mct1/scripts:/usr/mct1/bin:/usr/mct1/www/neuron/bin:/u/develop/develop/study_tk/bin:/usr/bin:/usr/openwin/bin:/usr/ucb:/usr/license1/ingres2/ingres/bin:/usr/license1/ingres2/ingres/utility:/usr/mct/bin:/usr/mct1/samba/bin:/usr/ccs/bin:/usr/license2/wp7/wpbin
>     PERL5LIB=/usr/mct1/www/neuron/lib/perl:/u/develop/develop/study_tk/lib
>     PERL_BADLANG (unset)
>     SHELL=/usr/mct1/bin/tcsh

hugmeir@global:~/perl-blead$ perlbrew exec ~/perl-blead/7937.pl
perl-5.10.1-gcc
==========


perl-5.10.1-suncc
==========


perl-5.12.4-gcc
==========


perl-5.12.4-suncc
==========


perl-5.14.2-gcc
==========


perl-5.14.2-suncc
==========


Same result with the 5.8.4 that comes with Solaris 10. So it appears
that this was already fixed. I vote to close this.


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=7937

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About