Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Sub-Uplevel CPAN distribution.

Report information
The Basics
Id: 17637
Status: resolved
Priority: 0/
Queue: Sub-Uplevel

People
Owner: Nobody in particular
Requestors: cpan [...] fireartist.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.09
Fixed in: 0.10



Subject: "uninitialized value" warnings under test suite
I get warnings when running "make test" If I change line 123 of file lib/Sub/Uplevel.pm from... if( $caller[0] eq __PACKAGE__ ) { to... if( defined $caller[0] && $caller[0] eq __PACKAGE__ ) { All tests pass with no warnings. Show quoted text
>dmake test
cp lib/Sub/Uplevel.pm blib\lib\Sub\Uplevel.pm C:\vanilla-perl\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0 , 'blib\lib', 'blib\arch')" t/*.t t/die_check....ok t/Uplevel......ok 1/18Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at C:\Documents and Settings\cafranks\Desktop\cpan\Sub-Uplevel-0.09\blib\lib/Sub/Uplevel.pm line 123. t/Uplevel......ok All tests successful. Files=2, Tests=19, 0 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU) WinXP XP 2 Show quoted text
>perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=define use5005threads=undef useithreads=define usemultiplicity=de fine useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags =' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTE XT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX', optimize='-s -O2', cppflags='-DWIN32' ccversion='', gccversion='3.4.5', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long long', lseek size=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags ='-s -L"c:\vanilla-perl\perl\lib\CORE" -L"C:\vanilla-perl\ MinGW\lib"' libpth=C:\vanilla-perl\MinGW\lib libs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 perllibs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdl g32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lw inmm -lversion -lodbc32 -lodbccp32 libc=-lmsvcrt, so=dll, useshrplib=yes, libperl=libperl58.a gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -s -L"c:\vanilla-perl\perl\lib\CORE" -L"C:\ vanilla-perl\MinGW\lib"' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES USE_PERLIO Built under MSWin32 Compiled at Feb 10 2006 10:33:10 @INC: c:/vanilla-perl/perl/lib c:/vanilla-perl/perl/site/lib .
From: jpo [...] di.uminho.pt
I am having the same problems in Fedora Core 5 test 3 with perl 5.8.8 (no problems with perl 5.8.7). The use of uninitialized values *breaks* the Test::Warn test suite and also makes Test::Exception test suite noisy (even WWW::Mechanize test suite appears to be failling tests due to Sub::Uplevel). Regards, jpo make test output ---------------- $ make test TEST_VERBOSE=1 PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib', 'blib/arch')" t/*.t t/die_check....1..1 ok 1 ok t/Uplevel......Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. Use of uninitialized value in string eq at /home/users/fedora/rpms/BUILD/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123. 1..18 ok 1 - use Sub::Uplevel; ok 2 - Sub::Uplevel->can(uplevel) ok 3 - main->can(uplevel) ok 4 - top-level caller() not screwed up ok 5 - die() not screwed up ok 6 - uplevel() ok 7 - die() fooled ok 8 - warn() fooled ok 9 - croak() fooled ok 10 - caller() not screwed up ok 11 - die() not screwed up ok 12 - carp() fooled ok 13 - main->can(fooble) ok 14 - caller check ok 15 - shallow caller ok 16 - deep caller() ok 17 - deep caller() + uplevel ok 18 - nested uplevel()s ok All tests successful. Files=2, Tests=19, 0 wallclock secs ( 0.17 cusr + 0.08 csys = 0.25 CPU) ----------------
From: jpo [...] di.uminho.pt
Hi, If I apply the following patch (full patch attached) to Sub::Uplevel I am able to eliminate the Sub::Uplevel warnings and also able to successfully execute the test suite of Test::Warn and Test::Exception (no noise). ------------ --- Sub-Uplevel-0.09-orig/lib/Sub/Uplevel.pm 2004-07-07 19:56:23.000000000 +0100 +++ Sub-Uplevel-0.09/lib/Sub/Uplevel.pm 2006-02-22 01:44:19.000000000 +0000 @@ -120,13 +120,14 @@ # Yes, we need a C style for loop here since $height changes for( my $up = 1; $up <= $height + 1; $up++ ) { my @caller = CORE::caller($up); + next unless @caller; if( $caller[0] eq __PACKAGE__ ) { $height++; $height += $Up_Frames unless $saw_uplevel; $saw_uplevel = 1; } } ------------ Regards, jpo PS - I am not sure if this is the best solution to the problem (with perl 5.8.8).
diff -ruN Sub-Uplevel-0.09-orig/lib/Sub/Uplevel.pm Sub-Uplevel-0.09/lib/Sub/Uplevel.pm --- Sub-Uplevel-0.09-orig/lib/Sub/Uplevel.pm 2004-07-07 19:56:23.000000000 +0100 +++ Sub-Uplevel-0.09/lib/Sub/Uplevel.pm 2006-02-22 01:44:19.000000000 +0000 @@ -120,13 +120,14 @@ # Yes, we need a C style for loop here since $height changes for( my $up = 1; $up <= $height + 1; $up++ ) { my @caller = CORE::caller($up); + next unless @caller; if( $caller[0] eq __PACKAGE__ ) { $height++; $height += $Up_Frames unless $saw_uplevel; $saw_uplevel = 1; } } - + return undef if $height < 0; my @caller = CORE::caller($height);
From: jpo [...] di.uminho.pt
Hi, With the above Sub::Uplevel patch I am also able to build WWW::Mechanize successfully. No more test failures like: ---------- t/find_link-warnings.....ok 1/19 # Failed test 'detected usage error: TEXT => 'string'' # in t/find_link-warnings.t at line 31. # found carped warning: Use of uninitialized value in string eq at /usr/lib/perl5/vendor_perl/5.8.7/Sub/Uplevel.pm line 123. # found carped warning: Use of uninitialized value in string eq at /usr/lib/perl5/vendor_perl/5.8.7/Sub/Uplevel.pm line 123. # found carped warning: Unknown link-finding parameter "TEXT" at t/find_link-warnings.t line 31 # expected to find warning: (?-xism:Unknown link-finding parameter) ... ---------- /jpo
From: jpo [...] di.uminho.pt
Hi, Rafael Garcia-Suarez forwarded me to one of the bug fixes mentioned in the perl 5.8.8 release notes (perl588delta): http://search.cpan.org/dist/perl/pod/perl588delta.pod#no_warnings_%27category%27_works_correctly_with_-w ========== ... no warnings 'category' works correctly with -w ---------------------------------------------- Previously when running with warnings enabled globally via -w, selective disabling of specific warning categories would actually turn off all warnings. This is now fixed; now no warnings 'io'; will only turn off warnings in the io class. Previously it would erroneously turn off all warnings. This bug fix may cause some programs to start correctly issuing warnings. ... ========== jpo References: [1] Rafael's email message: http://www.redhat.com/archives/fedora-perl-devel-list/2006-February/msg00038.html
On Ven. 24 Feb. 2006 10:55:26, guest wrote: Show quoted text
> Hi, > > Rafael Garcia-Suarez forwarded me to one of the bug fixes mentioned in > the perl 5.8.8 release notes (perl588delta): >
http://search.cpan.org/dist/perl/pod/perl588delta.pod#no_warnings_%27category%27_works_correctly_with_- Show quoted text
> w > > ========== > ... > no warnings 'category' works correctly with -w > ---------------------------------------------- > > Previously when running with warnings enabled globally via -w, > selective disabling of specific warning categories would actually > turn off all warnings. This is now fixed; now no warnings 'io'; > will only turn off warnings in the io class. Previously it would > erroneously turn off all warnings. > > This bug fix may cause some programs to start correctly issuing > warnings. > ... > ========== > > jpo > > References: > [1] Rafael's email message: > http://www.redhat.com/archives/fedora-perl-devel-list/2006- > February/msg00038.html
The really weird thing is that in Test::Warn, if you issue: prove -b t/carped.t there is *no* error (even if there are situations with undef in $caller[0]), but when you launch make test the warnings are still there.
Fixed in version 0.10