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

DESTROY optimization? #189

Closed
p5pRT opened this issue Jul 14, 1999 · 1 comment
Closed

DESTROY optimization? #189

p5pRT opened this issue Jul 14, 1999 · 1 comment

Comments

@p5pRT
Copy link
Collaborator

@p5pRT p5pRT commented Jul 14, 1999

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

Searchable as RT995$

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jul 14, 1999

From smurf@noris.de

I noticed that the sequence

{
  my $foo;
  $foo = new bar();

  Some_Statement (doesn't_use_foo);
  [ more Statements which don't use foo ]
}
sometimes seems to be optimized such that when bar​::DESTROY is called,
caller(1) returns the line number of the first Statement, not the line
number of the end of the block.

I noticed this in a largish multithreaded program.
A small test program of course failed to exhibit the bug. :-(

Log from my program​:
test.pm​:193 Block
test.pm​:195 UnBlock

Lines 192-195​:
my $oblock;
$oblock = new Blocker($self);

my $arg = shift;
[... 400 more lines until the end of that block]

Perl Info


Site configuration information for perl 5.00557:

Configured by smurf at Fri Jul  2 07:57:44 MEST 1999.

Summary of my perl5 (revision 5.0 version 5 subversion 57) configuration:
  Platform:
    osname=linux, osvers=2.2.11-noris-pre1, archname=i686-linux-thread
    uname='linux play 2.2.11-noris-pre1 #23 smp wed jun 30 05:17:45 mest 1999 i686 unknown '
    config_args='-Dusethreads -Uusenm -Duseshrplib=true -Dprefix=/usr/lib/eperl -d -e'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define useperlio=undef d_sfio=undef
    use64bits=undef usemultiplicity=undef
  Compiler:
    cc='cc', optimize='-O2 -g', gccversion=gcc-2.96 19990603 (experimental)
    cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include'
    ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    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 =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lrt -lpthread -lc -lposix -lcrypt
    libc=/lib/libc-2.1.90.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/eperl/lib/5.00557/i686-linux-thread/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.00557:
    /usr/lib/eperl/lib/5.00557/i686-linux-thread
    /usr/lib/eperl/lib/5.00557
    /usr/lib/eperl/lib/site_perl/5.00557/i686-linux-thread
    /usr/lib/eperl/lib/site_perl/5.00557
    .


Environment for perl 5.00557:
    HOME=/home/smurf
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/pop/bin:/usr/src/STATUS/bin:/home/smurf/bin:/home/smurf/bin:/bin:/usr/bin:/usr/local/bin:.:/usr/X11R6/bin:/usr/share/tex/bin/i586-linux
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.