develooper Front page | perl.perl5.porters | Postings from September 2000

[ID 20000902.010] Problem with Deparse

From:
zas
Date:
September 2, 2000 03:31
Subject:
[ID 20000902.010] Problem with Deparse
Message ID:
E13VAZP-0001Te-00@monster.zas.here

This is a bug report for perl from root@metaconcept.com,
generated with the help of perlbug 1.26 running under perl 5.006.


-----------------------------------------------------------------
[Please enter your report here]

On many scripts, 
perl -MO=Deparse,B script.pl
leads to 
Exiting subroutine via next at /usr/local/lib/perl5/5.6.0/i686-linux/B/Deparse.pm line 257.
Exiting subroutine via next at /usr/local/lib/perl5/5.6.0/i686-linux/B/Deparse.pm line 257.
Can't call method "sibling" on an undefined value at /usr/local/lib/perl5/5.6.0/i686-linux/B/Deparse.pm line 257.
CHECK failed--call queue aborted.

I found a message dated 08/20/2000 on  comp.lang.perl.misc:

8<-------------------------------------------------------
Date:      08/20/2000
Subject:   Re: Differing parses under 5.005, 5.6?
Newsgroup: comp.lang.perl.misc
Author:    John P. Linderman <jpl@research.att.com>
Top Thread Message
                  
   Jeff Boes wrote:

   > The following code worked _just fine_ under 5.00503. Under 5.6, however,
   > perl complains about
   >
   > Variable "$userdata" is not imported at testvars.pl line 7.
   > Global symbol "$userdata" requires explicit package name at testvars.pl
   > line 7.
   >
   > use strict;
   > use vars qw(%userdata %_pages @sortlist @showlist);
   >
   > sub showfolder_count_unshown_items {
   >    return 0 if $userdata{show0};
   >    @showlist = grep((
   >                      $userdata{show0}
   >                      or /^f/
   >                      or !defined($_pages{$_})
   >                      or &refisnew($_pages{$_})
   >                      or ($_pages{$_}->{status} ne 'VALID')
   >                      or ($_pages{$_}->{score} > 0)
   >                      ), @sortlist);
   >    scalar(@sortlist) - scalar(@showlist);
   > }
   >  
   > Now, the odd thing here is that if you take line 7 and move it,
   >
   >    @showlist = grep((
   >                      /^f/
   >                      or !defined($_pages{$_})
   >                      or &refisnew($_pages{$_})
   >                      or ($_pages{$_}->{status} ne 'VALID')
   >                      or ($_pages{$_}->{score} > 0)
   >                      or $userdata{show0}
   >                      ), @sortlist);
   >
   > then it parses just fine. (By the way, I realize that the logic in this
   > code is probably wrong, and since $userdata{show0} doesn't change within
   > the grep-loop, it really doesn't need to be re-evaluated for each trip.
   > That's not the issue. The code worked, and we were reluctant to change
   > it. Then 5.6 breaks it, and now we will rewrite it anyway.)
   >
   > Is this a 5.6 bug?
 To further muddy the waters, If I comment out the
   # use strict;
   at line 1, and run my 5.005 perl  with -MO=Deparse,B
   I get (reformatted to fit nicely)

   sub showfolder_count_unshown_items {
       return 0 if $userdata{'show0'};
       @showlist = grep(($userdata{'show0'} ||
           /^f/ ||
           !defined($_pages{$_}) ||
           &refisnew($_pages{$_}) ||
           $_pages{$_}{'status'} ne 'VALID' ||
           $_pages{$_}{'score'} > 0), @sortlist);
       scalar(@sortlist) - scalar(@showlist);
   }
   
   with 5.6, the same run yields
    
   Can't call method "sibling" on an undefined value at
   <path to my local 5.6 lib>/B/Deparse.pm line 258.
   CHECK failed--call queue aborted.
   
   I'd be inclined to call that a bug.
   John P. Linderman  jpl@research.att.com

8<------------------------------------------------------------



[Please do not change anything below this line]
-----------------------------------------------------------------

---
This perlbug was built using Perl 5.00503 - Mon Mar 20 12:30:13 CET 2000
It is being executed now by  Perl 5.006 - Sat Sep  2 10:18:39 CEST 2000.

Site configuration information for perl 5.006:

Configured by root at Sat Sep  2 10:18:39 CEST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.17pre20, archname=i686-linux
    uname='linux monster.zas.here 2.2.17pre20 #1 ven aoĆ» 25 16:32:08 cest 2000 i686 unknown '
    config_args='-de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='gcc', optimize='-O2', gccversion=pgcc-2.91.60 19981201 (egcs-1.1.1 release)
    cppflags='-O5 -mpentiumpro -malign-loops=2 -malign-functions=2 -s -fno-strict-aliasing -I/usr/local/include -DDEBUGGING'
    ccflags ='-O5 -mpentiumpro -malign-loops=2 -malign-functions=2 -s -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=/lib/libc-2.1.2.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.006:
    /usr/local/lib/perl5/5.6.0/i686-linux
    /usr/local/lib/perl5/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl 5.006:
    HOME=/root
    LANG=fr
    LANGUAGE=fr
    LC_ALL=fr_FR
    LC_CTYPE=ISO-8859-1
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/home/zas/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/samba/bin
    PERL_BADLANG (unset)
    SHELL=/sbin/bash




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