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

[ID 20000406.012] overload recursion not trapped

Thread Next
From:
Marc Lehmann
Date:
April 6, 2000 23:14
Subject:
[ID 20000406.012] overload recursion not trapped
Message ID:
20000407070043.A22407@cerebro.laendle
This is a bug report for perl from root@cerebro.laendle,
generated with the help of perlbug 1.28 running under perl v5.6.0.


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

use overload '""' => sub { "$_[0]" };
print bless {}, __PACKAGE__;

The above will lead to a segmentation fault:

0x80a1d87 in Perl_newAV () at av.c:310
310         av = (AV*)NEWSV(3,0);
(gdb) bt
#0  0x80a1d87 in Perl_newAV () at av.c:310
Cannot access memory at address 0xbf7ffff8.

Actually, in different circumstances it breaks at different addresses, so
it looks like a memory corruption problem (or maybe out-of-memory).

The obvious cause for that behaviour is that the stringification function
calls stringification itself (resulting in a kind-of-endless loop), which
is of course a bugin the code.

I still think segfaulting is a bad thing, since this error is easy to
make:

sub as_string { my $self = shift; "$self->{error}\n$self-{info}\n" }

HTH,


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.6.0:

Configured by root at Fri Mar 24 17:33:21 CET 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2, archname=i686-linux
    uname='linux cerebro 2.2.14 #59 smp fri mar 10 22:52:46 cet 2000 i686 unknown '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='gcc', optimize='-Os -mpentiumpro -g', gccversion=gcc-2.95.2 19991024 (release)
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccflags ='-fno-strict-aliasing -I/usr/local/include'
    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=4
    alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-ldl -lm -lc -lcrypt
    libc=/lib/libc-2.1.3.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 v5.6.0:
    /usr/app/lib/perl5
    /usr/app/lib/perl5
    /usr/app/lib/perl5
    /usr/app/lib/perl5
    .

---
Environment for perl v5.6.0:
    HOME=/root
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=de
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/root/ms::/usr/app/FM556_linux/bin:/root/cc/dejagnu/bin:/usr/app/qt/bin/:.:/root/s:/bin:/sbin:/usr/bin:/usr/sbin:/usr/app/bin:/usr/app/sbin:/usr/X11/bin:/usr/games:/usr/maple/bin:/usr/kde/bin:/usr/gnome/bin:/home/pg/bin:/opt/bin:/localvol/usr/app/insure++/bin.linux
    PERLDB_OPTS=ornaments=0
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Thread Next


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