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

Attempt to free unreferenced scalar with tied hash #7606

Closed
p5pRT opened this issue Nov 19, 2004 · 4 comments
Closed

Attempt to free unreferenced scalar with tied hash #7606

p5pRT opened this issue Nov 19, 2004 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 19, 2004

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

Searchable as RT32511$

@p5pRT
Copy link
Author

p5pRT commented Nov 19, 2004

From nobull@mail.com

This is a bug report for perl from nobull@​mail.com,
generated with the help of perlbug 1.35 running under perl v5.8.5.


While trying to track down the cause of a slippery "Attempt to free unreferenced
scalar" in my code I discovered that the found that the following will
reproducably cause the error (although I'm not convinced it is
actually related to the errors I'm seeing in preduction code).

sub TIEHASH { bless [ ] };
tie my %h, 'TieThing';

for (1) {
  map { die } $h{X};
}



Flags​:
  category=core
  severity=medium


Site configuration information for perl v5.8.5​:

Configured by bam at Tue Nov 2 16​:13​:20 GMT 2004.

Summary of my perl5 (revision 5 version 8 subversion 5) configuration​:
  Platform​:
  osname=linux, osvers=2.4.18-64gb-smp, archname=i686-linux
  uname='linux wcl-l 2.4.18-64gb-smp #1 smp wed mar 27 13​:58​:12 utc 2002 i686 unknown '
  config_args='-des'
  hint=previous, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=undef use64bitall=undef uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',
  cppflags='-fno-strict-aliasing -pipe -I/usr/local/include -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
  ccversion='', gccversion='2.95.3 20010315 (SuSE)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  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, 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 -lcrypt -lutil -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
  libc=, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.2.5'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches​:
 


@​INC for perl v5.8.5​:
  /home/bam/perl5/5.8.0
  /home/bam/perl5
  /usr/local/lib/perl5/5.8.5/i686-linux
  /usr/local/lib/perl5/5.8.5
  /usr/local/lib/perl5/site_perl/5.8.5/i686-linux
  /usr/local/lib/perl5/site_perl/5.8.5
  /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
  /usr/local/lib/perl5/site_perl/5.8.0
  /usr/local/lib/perl5/site_perl
  .


Environment for perl v5.8.5​:
  HOME=/home/bam
  LANG=en_GB
  LANGUAGE (unset)
  LC_COLLATE=POSIX
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/home/bam/bin​:/usr/local/bin​:/usr/bin​:/usr/X11R6/bin​:/bin​:/usr/games​:/opt/gnome/bin​:/opt/kde3/bin​:/opt/kde2/bin​:.​:/usr/lib/java/bin​:/opt/gnome/bin
  PERL5LIB=/home/bam/perl5
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Nov 26, 2004

From perl-bug@ton.iguana.be

[nobull - Fri Nov 19 09​:27​:55 2004]​:

sub TIEHASH { bless [ ] };
tie my %h, 'TieThing';

for (1) {
map { die } $h{X};
}
-----------------------------------------------------------------

I'm think that the tie here is a red herring​:

my %h;
for (1) {
  map { die } $h{X};
}

gives the same problem.

Basically it seems a duplicate of bug 24254, which I think should be
increased in importance since it happens easily in pretty normal
code.

@p5pRT
Copy link
Author

p5pRT commented Nov 26, 2004

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 30, 2008

p5p@spam.wizbit.be - Status changed from 'open' to 'resolved'

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

No branches or pull requests

1 participant