Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO::Socket::INET triggers 'Use of uninitialized value in die' when no die string given #8004

Closed
p5pRT opened this issue Jul 6, 2005 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 6, 2005

Migrated from rt.perl.org#36470 (status was 'resolved')

Searchable as RT36470$

@p5pRT
Copy link
Author

p5pRT commented Jul 6, 2005

From avised@kbcfp.com

Created by avised@kbcfp.com

The following test program

  use warnings;
  use IO​::Socket;
  IO​::Socket​::INET->new(PeerAddr => 'localhost',
  PeerPort => '23',
  );
  die;

produces the error output

  Use of uninitialized value in die at ./test line 7.
  Died at ./test line 7.

The uninitialized value warning is wrong - I did not pass anything to
die(). I do not know if this is a bug in the perl core or caused by
IO​::Socket trampling on something. But IO​::Socket is now part of the
perl distribution so I believe this bug report is valid.

I have reproduced this with perl 5.8.0, 5.8.4, 5.8.5 and 5.8.7,
variously on Linux and Solaris. The test program depends on being
able to connect to port 23 on localhost.

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl v5.8.4:

Configured by ActiveState at Thu Jun  3 11:51:49 PDT 2004.

Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
  Platform:
    osname=linux, osvers=2.2.17, archname=i686-linux-thread-multi
    uname='linux gimlet 2.2.17 #1 sun jun 25 09:24:41 est 2000 i686 unknown '
    config_args='-ders -Dcc=gcc -Accflags=-DNO_HASH_SEED -Dusethreads -Duseithreads -Ud_sigsetjmp -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Duselargefiles -Uusemallocwrap -Dinc_version_list=5.8.3/$archname 5.8.3 5.8.2/$archname 5.8.2 5.8.1/$archname 5.8.1 5.8.0/$archname 5.8.0 -Duseshrplib -Dprefix=/usr/local/pkgs/ActivePerl-5.8.4.810 -Dcf_by=ActiveState -Dcf_email=support@ActiveState.com'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DNO_HASH_SEED -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DNO_HASH_SEED -fno-strict-aliasing'
    ccversion='', gccversion='2.95.2 20000220 (Debian GNU/Linux)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/lib /usr/lib /usr/local/lib
    libs=-lnsl -lndbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lposix
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -lposix
    libc=/lib/libc-2.1.3.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.1.3'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/local/pkgs/ActivePerl-5.8.4.810/lib/5.8.4/i686-linux-thread-multi/CORE'
    cccdlflags='-fpic', lddlflags='-shared'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY
    22751 Update to Test.pm 1.25
    21540 Fix backward-compatibility issues in if.pm


@INC for perl v5.8.4:
    /u/avised/lib/perl5/5.8.0
    /u/avised/lib/perl5
    /u/avised/lib/perl5/5.8.4
    /u/avised/lib/perl5/site_perl/5.8.4
    /u/avised/lib/perl5/site_perl/5.8.4/i386-linux
    /u/avised/lib/perl5/site_perl/5.8.0
    /u/avised/lib/perl5/site_perl
    /u/avised/lib/5.8.4/i686-linux-thread-multi
    /u/avised/lib/5.8.4
    /u/avised/lib/site_perl/5.8.4/i686-linux-thread-multi
    /u/avised/lib/site_perl/5.8.4
    /u/avised/lib/site_perl/5.8.4/i386-linux
    /u/avised/lib/site_perl/5.8.4/i686-linux-thread-multi
    /u/avised/lib/site_perl/5.8.4
    /u/avised/lib/site_perl/5.8.3/i686-linux-thread-multi
    /u/avised/lib/site_perl/5.8.3
    /u/avised/lib/site_perl
    /u/avised/lib/site_perl/5.8.4/i686-linux-thread-multi
    /usr/local/pkgs/ActivePerl-5.8.4.810/lib/site_perl/5.8.4/i686-linux-thread-multi
    /usr/local/pkgs/ActivePerl-5.8.4.810/lib/site_perl/5.8.4
    /prod/datatech/inferno/bin/scripts
    /usr/local/pkgs/ActivePerl-5.8.4.810/lib/5.8.4/i686-linux-thread-multi
    /usr/local/pkgs/ActivePerl-5.8.4.810/lib/5.8.4
    /usr/local/pkgs/ActivePerl-5.8.4.810/lib/site_perl/5.8.4/i686-linux-thread-multi
    /usr/local/pkgs/ActivePerl-5.8.4.810/lib/site_perl/5.8.4
    /usr/local/pkgs/ActivePerl-5.8.4.810/lib/site_perl
    .


Environment for perl v5.8.4:
    HOME=/u/avised
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LANGVAR=en_US.UTF-8
    LD_LIBRARY_PATH=/u/avised/lib:/usr/local/lib:/usr/local/oracle/lib:/usr/local/deshaw/lib:/usr/local/pkgs/systems/lib:/usr/local/X11R6/lib:/opt/sybase/lib:/usr/local/pkgs/sybase-12.5/OCS-12_5/lib:/prod/fintech/inferno/copyleft/linux/lib:/proj/fintech/dev/rw/lib:/prod/datatech/lib/linux::
    LOGDIR (unset)
    PATH=/u/avised/bin:/u/avised/bin/linux:/u/avised/datatech_dev/build/bin:/u/avised/idev/build/bin:/proj/fintech/builds/private/avised-inf/cppmessagecompiler/bin/linux:/prod/datatech/inferno/bin/linux:/prod/datatech/inferno/bin/scripts:/usr/kerberos/bin:/usr/local/bin:/usr/common/bin:/usr/local/etc:/usr/local/deshaw/bin:/usr/bin:/bin:/usr/ucb:/usr/local/sybase/OCS/bin:/usr/sbin:/sbin:/usr/local/oracle/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/X/bin
    PERL5LIB=/u/avised/lib/perl5:/u/avised/lib/perl5/5.8.4:/u/avised/lib/perl5/site_perl/5.8.4:/u/avised/lib/perl5/site_perl/5.8.4/i386-linux:/u/avised/lib/perl5/site_perl:/u/avised/lib/5.8.4:/u/avised/lib/site_perl/5.8.4:/u/avised/lib/site_perl/5.8.4/i386-linux:/u/avised/lib/site_perl:/u/avised/lib/site_perl/5.8.4/i686-linux-thread-multi:/usr/local/pkgs/ActivePerl-5.8.4.810/lib/site_perl/5.8.4:/prod/datatech/inferno/bin/scripts
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Jul 6, 2005

From @iabyn

On Wed, Jul 06, 2005 at 03​:38​:22PM -0000, avised @​ kbcfp. com wrote​:

The following test program

use warnings;
use IO​::Socket;
IO​::Socket​::INET\->new\(PeerAddr => 'localhost'\,
                      PeerPort => '23'\,
                     \);
die;

produces the error output

Use of uninitialized value in die at \./test line 7\.
Died at \./test line 7\.

Thanks for the report; the test case be reduced to

  undef $@​; die;

Fixed in bleedperl by the change below.

Dave.

--
"The greatest achievement of the Austrians has been convincing the world
that Hitler was German, and Mozart Austrian."

Change 25087 by davem@​davem-splatty on 2005/07/06 20​:09​:29

  [perl #36470] 'undef $@​; die' gives uninint value warning

Affected files ...

... //depot/perl/pp_sys.c#429 edit
... //depot/perl/t/op/die.t#5 edit

Differences ...

==== //depot/perl/pp_sys.c#429 (text) ====

@​@​ -517,7 +517,10 @​@​
  if (SvPOK(error) && SvCUR(error))
  sv_catpv(error, "\t...propagated");
  tmpsv = error;
- tmps = SvPV_const(tmpsv, len);
+ if (SvOK(tmpsv))
+ tmps = SvPV_const(tmpsv, len);
+ else
+ tmps = Nullch;
  }
  }
  if (!tmps || !len)

==== //depot/perl/t/op/die.t#5 (xtext) ====

@​@​ -1,6 +1,6 @​@​
#!./perl

-print "1..14\n";
+print "1..15\n";

$SIG{__DIE__} = sub { print ref($_[0]) ? ("ok ",$_[0]->[0]++,"\n") : @​_ } ;

@​@​ -61,3 +61,14 @​@​
  print "not " unless $@​ =~ /Global symbol "\$\x{3b1}"/;
  print "ok 14\n";
}
+
+# [perl #36470] got uninit warning if $@​ was undef
+
+{
+ my $ok = 1;
+ local $SIG{__DIE__};
+ local $SIG{__WARN__} = sub { $ok = 0 };
+ eval { undef $@​; die };
+ print "not " unless $ok;
+ print "ok 15\n";
+}

@p5pRT
Copy link
Author

p5pRT commented Jul 6, 2005

The RT System itself - Status changed from 'new' to 'open'

@p5pRT p5pRT closed this as completed Jul 7, 2005
@p5pRT
Copy link
Author

p5pRT commented Jul 7, 2005

@iabyn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant