Skip Menu |
Report information
Id: 1031
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: tobez [at] plab.ku.dk
Cc:
AdminCc:

Operating System: freebsd
PatchStatus: (no value)
Severity: medium
Type: library
Perl Version: (no value)
Fixed In: (no value)



Date: Sat, 24 Jul 1999 15:11:23 +0200 (CEST)
From: Anton Berezin <tobez [...] plab.ku.dk>
To: perlbug [...] perl.com
Subject: Incorrect line number reporting due to overoptimization
Cc: tobez [...] plab.ku.dk
Download (untitled) / with headers
text/plain 4.3k
----------------------------------------------------------------- [Please enter your report here] The following script: #! /usr/bin/perl -w my $k; if (1) { # # # my $z = $k+1; } produces ``Use of uninitialized value at bug.pl line 3.'' warning. It does so in 5.005_03 and 5.005_57. I tracked the problem down to the optimization performed in op.c's scope() function, but I am unable to fix it properly (disabling the optimization does not count, though it fixes the problem). Probably this output will be helpful for someone: [ optimization enabled] $ perl -MO=Terse bug.pl bug.pl syntax OK Use of uninitialized value at /usr/libdata/perl/5.00503/mach/B/Terse.pm line 81. Use of uninitialized value at /usr/libdata/perl/5.00503/mach/B/Terse.pm line 81. LISTOP (0x8057940) pp_leave OP (0x8059160) pp_enter COP (0x80528c0) pp_nextstate OP (0x8059120) pp_padsv [1] COP (0x8057a00) pp_nextstate LISTOP (0x80579c0) pp_scope OP (0x8057980) pp_null [173] BINOP (0x8059220) pp_sassign BINOP (0x8059200) pp_add [3] OP (0x80591c0) pp_padsv [1] SVOP (0x80591e0) pp_const IV (0x8050ef4) 1 OP (0x8059180) pp_padsv [2] The last pp_nextstate corresponds to the line 3. [ optimization disabled] $ perl -T bug.pl Use of uninitialized value at bug.pl line 7. Correct line number is reported. ^^^^^^ $ perl -T -MO=Terse bug.pl bug.pl syntax OK Use of uninitialized value at /usr/libdata/perl/5.00503/mach/B/Terse.pm line 81. Use of uninitialized value at /usr/libdata/perl/5.00503/mach/B/Terse.pm line 81. Use of uninitialized value at /usr/libdata/perl/5.00503/mach/B/Terse.pm line 81. LISTOP (0x8057880) pp_leave OP (0x8059500) pp_enter COP (0x80528c0) pp_nextstate OP (0x80594c0) pp_padsv [1] COP (0x8057940) pp_nextstate LISTOP (0x8057900) pp_leave OP (0x8059600) pp_enter COP (0x80578c0) pp_nextstate BINOP (0x80595c0) pp_sassign BINOP (0x80595a0) pp_add [3] OP (0x8059560) pp_padsv [1] SVOP (0x8059580) pp_const IV (0x8050ec4) 1 OP (0x8059520) pp_padsv [2] pp_scope has been replaced (or is this other way around?) with pp_leave and pp_enter, and pp_nextstate corresponding to the correct line is there. Is there a better way to fix this rather than disabling the optimization completely? [Please do not change anything below this line] ----------------------------------------------------------------- --- Site configuration information for perl 5.00503: Configured by markm at $Date: 1999/05/05 19:09:48 $. Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=freebsd, osvers=4.0-current, archname=i386-freebsd uname='freebsd freefall.freebsd.org 4.0-current freebsd 4.0-current #0: $Date: 1999/05/05 19:09:48 $' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='undef', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release) cppflags='' ccflags ='' stdchar='char', d_stdstdio=undef, usevfork=true intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags ='-Wl,-E' libpth=/usr/lib libs=-lm -lc -lcrypt libc=/usr/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so.3 Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-DPIC -fpic', lddlflags='-shared' Locally applied patches: --- @INC for perl 5.00503: /home/tobez/src/Prima /home/tobez/src/Prima/scripts/modules /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 . --- Environment for perl 5.00503: HOME=/home/tobez LANG=ru_RU.KOI8-R LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/site/bin:/home/tobez/bin:/home/tobez/bin/kuim:/plab/usr/home/tobez/bin:/plab/usr/local/site/bin PERL5LIB=/home/tobez/src/Prima:/home/tobez/src/Prima/scripts/modules PERL_BADLANG (unset) SHELL=/usr/local/bin/zsh


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org