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

Data::Dumper segfaults on very large recursive structures #6787

Closed
p5pRT opened this issue Sep 23, 2003 · 6 comments
Closed

Data::Dumper segfaults on very large recursive structures #6787

p5pRT opened this issue Sep 23, 2003 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 23, 2003

Migrated from rt.perl.org#24013 (status was 'open')

Searchable as RT24013$

@p5pRT
Copy link
Author

p5pRT commented Sep 23, 2003

From DavidBuckley@bigfoot.com

Created by DavidBuckley@bigfoot.com

Data​::Dumper's XS code segfaults when dealing with exceptionally
deep structures. Example​:

[19​:09​:46] bucko(tank) ~$ perl -MData​::Dumper -e '$a = {}; $b = $a; for (1..3500) { $b->{a} = {}; $b = $b->{a} } Dumper($a);'
Segmentation fault

This originally turned up in my threads bug [perl #23965], where
simple recursive structures become infinitely deep non-recursive
structures.

Perl Info

Flags:
    category=core
    severity=medium

This perlbug was built using Perl v5.8.0 - Sun Jun 16 02:13:30 BST 2002
It is being executed now by  Perl v5.8.0 - Thu Sep 11 20:57:21 EST 2003.

Site configuration information for perl v5.8.0:

Configured by Debian Project at Thu Sep 11 20:57:21 EST 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.21-xfs+ti1211, archname=i386-linux-thread-multi
    uname='linux kosh 2.4.21-xfs+ti1211 #1 sat jul 12 10:35:04 est 2003 i686 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.8.0 -Darchlib=/usr/lib/perl/5.8.0 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.0 -Dsitearch=/usr/local/lib/perl/5.8.0 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm -Duseshrplib -Dlibperl=libperl.so.5.8.0 -Dd_dosuid -des'
    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 ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing'
    ccversion='', gccversion='3.3.2 20030908 (Debian prerelease)', 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=-lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so.5.8.0
    gnulibc_version='2.3.2'
  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.8.0:
    /etc/perl
    /usr/local/lib/perl/5.8.0
    /usr/local/share/perl/5.8.0
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.8.0
    /usr/share/perl/5.8.0
    /usr/local/lib/site_perl
    .


Environment for perl v5.8.0:
    HOME=/home/bucko
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/bucko/bin:/usr/local/jdk1.2.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Dec 4, 2005

From @smpeters

[DavidBuckley@​bigfoot.com - Tue Sep 23 11​:15​:56 2003]​:

This is a bug report for perl from DavidBuckley@​bigfoot.com,
generated with the help of perlbug 1.33 running under perl v5.8.0.

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

Data​::Dumper's XS code segfaults when dealing with exceptionally
deep structures. Example​:

[19​:09​:46] bucko(tank) ~$ perl -MData​::Dumper -e '$a = {}; $b = $a;
for (1..3500) { $b->{a} = {}; $b = $b->{a} } Dumper($a);'
Segmentation fault

This originally turned up in my threads bug [perl #23965], where
simple recursive structures become infinitely deep non-recursive
structures.

I was unable to duplicate the SEGV on any of my machines, although I did
get an "Out of Memory!" error on one server. That said, the problem
with the SEGV seems to be taken care of.

@p5pRT
Copy link
Author

p5pRT commented Dec 4, 2005

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

@p5pRT
Copy link
Author

p5pRT commented Dec 4, 2005

@smpeters - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Dec 4, 2005
@p5pRT
Copy link
Author

p5pRT commented May 27, 2006

From @iabyn

Just re-opening this, as the bug *isn't* fixed. It's the classic C stack
echaustion. On a machine with enought RAM, the stack fills before memory
is exhausted, so you still get a segfault.

Can only be fixed my making Data​::Dumper non-recusive, which woudn't be
easy.

@p5pRT
Copy link
Author

p5pRT commented May 27, 2006

@iabyn - Status changed from 'resolved' to 'open'

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