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

dprofpp array subscript error #8112

Closed
p5pRT opened this issue Sep 13, 2005 · 3 comments
Closed

dprofpp array subscript error #8112

p5pRT opened this issue Sep 13, 2005 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 13, 2005

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

Searchable as RT37163$

@p5pRT
Copy link
Author

p5pRT commented Sep 13, 2005

From scott@perlcode.org

Created by scott@perlcode.org

The dprofpp that comes with perl 5.8.6 and 5.8.4 (haven't tried
others) has a bug where a non-existent array element is assigned to
which makes dprofpp die.

I create a profile like this​:

  dprofpp -Q -p program.pl

and I get this tmon.out (gz)​:

  <http​://perlcode.org/dprofpp_bug/tmon.out.gz>

I try to profile it like this​:

  dprofpp -I -g main​::do_loop

and receive this error​:

  Modification of non-creatable array value attempted, subscript -1 at
  /usr/bin/dprofpp line 662, <fh> line 1100.

This happens on FreeBSD and Mac OSX under the above Perl versions.

This patch helps (I'm not sure if something is not being counted,
however. It may be that the chunk of code that creates the array index
below needs to be moved to before this section)​:

<patch>

Inline Patch
--- /usr/bin/dprofpp    2005-03-20 17:42:00.000000000 -0700
+++ dprofpp     2005-09-13 12:52:32.000000000 -0600
@@ -659,7 +659,7 @@
 
                my $ot = $t;
                if ( $dir eq '/' ) {
-                 $syst = $stack[-1][0];
+                 $syst = $stack[-1][0] if scalar @stack;
                  $usert = '&';
                  $dir = '-';
                  #warn("Inserted exit for $stack[-1][0].\n")
</patch>
Perl Info

Flags:
    category=utilities
    severity=medium

Site configuration information for perl v5.8.6:

Configured by root at Sun Mar 20 16:31:42 PST 2005.

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
  Platform:
    osname=darwin, osvers=8.0, archname=darwin-thread-multi-2level
    uname='darwin b28.apple.com 8.0 darwin kernel version 7.5.0: thu mar 3 18:48:46 pst 2005; root:xnuxnu-517.99.13.obj~1release_ppc power macintosh powerpc '
    config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  -Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib'
    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='cc', ccflags ='-g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include',
    optimize='-Os',
    cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build 1809)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-ldbm -ldl -lm -lc
    perllibs=-ldl -lm -lc
    libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-bundle -undefined dynamic_lookup -L/usr/local/lib'

Locally applied patches:
    23953 - fix for File::Path::rmtree CAN-2004-0452 security issue
    33990 - fix for setuid perl security issues


@INC for perl v5.8.6:
    /Users/scott/myperl/Library/Perl
    /Users/scott/myperl/System/Library/Perl/5.8.6/darwin-thread-multi-2level
    /Users/scott/myperl/System/Library/Perl/5.8.6
    /Users/scott/myperl/System/Library/Perl
    /Users/scott/myperl/lib/darwin-thread-multi-2level
    /Users/scott/myperl/lib
    /Users/scott/myperl/Library/Perl/5.8.1/darwin-thread-multi-2level
    /Users/scott/myperl/Library/Perl/5.8.1
    /System/Library/Perl/5.8.6/darwin-thread-multi-2level
    /System/Library/Perl/5.8.6
    /Library/Perl/5.8.6/darwin-thread-multi-2level
    /Library/Perl/5.8.6
    /Library/Perl
    /Network/Library/Perl/5.8.6/darwin-thread-multi-2level
    /Network/Library/Perl/5.8.6
    /Network/Library/Perl
    /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
    /System/Library/Perl/Extras/5.8.6
    /Library/Perl/5.8.1/darwin-thread-multi-2level
    /Library/Perl/5.8.1
    .


Environment for perl v5.8.6:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/scott
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/Users/scott/bin
    PERL5LIB=/Users/scott/myperl/Library/Perl:/Users/scott/myperl/System/Library/Perl:/Users/scott/myperl/lib:/Users/scott/myperl/Library/Perl/5.8.1
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2005

From @rgs

scott@​perlcode.org (via RT) wrote​:

The dprofpp that comes with perl 5.8.6 and 5.8.4 (haven't tried
others) has a bug where a non-existent array element is assigned to
which makes dprofpp die.

I create a profile like this​:

dprofpp -Q -p program.pl

and I get this tmon.out (gz)​:

<http​://perlcode.org/dprofpp_bug/tmon.out.gz>

I try to profile it like this​:

dprofpp -I -g main​::do_loop

and receive this error​:

Modification of non-creatable array value attempted, subscript -1 at
/usr/bin/dprofpp line 662, <fh> line 1100.

This happens on FreeBSD and Mac OSX under the above Perl versions.

This patch helps (I'm not sure if something is not being counted,
however. It may be that the chunk of code that creates the array index
below needs to be moved to before this section)​:

Thanks, applied as change #25413 to bleadperl.

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2005

@rgs - Status changed from 'new' 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