develooper Front page | perl.perl5.porters | Postings from May 2015

Use of uninitialized value in read - 5.20.2

Thread Next
From:
Peter Scott
Date:
May 8, 2015 02:37
Subject:
Use of uninitialized value in read - 5.20.2
Message ID:
20150508023719.9422.qmail@lists-nntp.develooper.com
I would appreciate any pointers on a peculiar issue I am having.  A 
program that calls read() on a filehandle bound to a scalar is issuing 
the warning "Use of uninitialized value in read".  What is most peculiar 
to me is that this is on 5.20.2 and since each call looks like:

    my $bytes = read $fh, $$bufref, $length;

perl at this version should identity *which* value, and so it does in all 
my one-liners.  So under what circumstances can perl emit this warning 
from read without the value being identified?

It will be difficult to construct a portable demonstration since 
presently this occurs only after hours of processing gigabytes of data, 
although I am working on it of course.  It is completely repeatable.  
I've inserted debug lines before the line to warn if any of those 
variables are undef and they don't fire.  Neither does a line after the 
call that warns if $bytes is undef.

I have checked my shebang.  It really is calling the 5.20.2 perl.  I've 
looked through the source I built it from and have been unable to figure 
out how this might result.  

This is not a bug report, just asking for suggestions, but here's my 
configuration anyway:

Summary of my perl5 (revision 5 version 20 subversion 2) configuration:
   
  Platform:
    osname=linux, osvers=2.6.32-504.3.3.el6.x86_64, archname=x86_64-linux
    uname='linux dev-web-pjs 2.6.32-504.3.3.el6.x86_64 #1 smp wed dec 17 
01:55:02 utc 2014 x86_64 x86_64 x86_64 gnulinux '
    config_args='-des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-
protector -I/usr/local/include -D_LARGEFILE_SOURCE -
D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/
local/include'
    ccversion='', gccversion='4.4.7 20120313 (Red Hat 4.4.7-11)', 
gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib /
lib64 /usr/lib64 /usr/local/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.12.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.12'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-
protector'


Characteristics of this binary (from libperl): 
  Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
                        PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
                        USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES
                        USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
  Built under linux
  Compiled at Mar 24 2015 10:51:06
  @INC:
    /usr/local/lib/perl5/site_perl/5.20.2/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.20.2
    /usr/local/lib/perl5/5.20.2/x86_64-linux
    /usr/local/lib/perl5/5.20.2
    .

-- 
Peter Scott


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