#1115374 perl: Dumpvalue bugs with shared arrays and hashes with circular loops

Package:
perl
Source:
perl
Description:
Larry Wall's Practical Extraction and Report Language
Submitter:
David Christensen
Date:
2026-09-05 08:51:02 UTC
Severity:
normal
#1115374#5
Date:
2025-09-16 02:27:35 UTC
From:
To:
Dear Maintainer,

I use Perl and use the module Dumpvalue for development.
Unforunately, it fails on deep recursion when I attempt to dump
shared arrays or hashes with circular loops:

2025-09-15 19:20:06 dpchrist@laalaa ~/sandbox/perl
$ cat /etc/debian_version ; uname -a ; perl -v
11.11
Linux laalaa 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64 GNU/Linux

This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-gnu-thread-multi
(with 56 registered patches, see perl -V for more detail)

Copyright 1987-2021, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


2025-09-15 19:20:22 dpchrist@laalaa ~/sandbox/perl
$ cat Dumpvalue-bug-shared-array-with-circular-loop.sh
#!/bin/sh
# $Id: Dumpvalue-bug-shared-array-with-circular-loop.sh,v 1.2 2025/09/16 02:19:40 dpchrist Exp $
#
# Demonstrate bug in Perl Dumpvalue with shared array with circular
# loop.
#
# By David Paul Christensen dpchrist@holgerdanske.com
# Public Domain.

perl -Mstrict -Mwarnings -Mthreads -Mthreads::shared -MDumpvalue -e 'my @a :shared; $a[0]=\@a; $|=1; my $d=Dumpvalue->new; $d->dumpValue(\@a)' > foo &

pid=$!
sleep 1
kill $pid

sync
wc foo

2025-09-15 19:20:29 dpchrist@laalaa ~/sandbox/perl
$ cat Dumpvalue-bug-shared-hash-with-circular-loop.sh
#!/bin/sh
# $Id: Dumpvalue-bug-shared-hash-with-circular-loop.sh,v 1.1 2025/09/16 02:19:40 dpchrist Exp $
#
# Demonstrate bug in Perl Dumpvalue with shared hash with circular
# loop.
#
# By David Paul Christensen dpchrist@holgerdanske.com
# Public Domain.

perl -Mstrict -Mwarnings -Mthreads -Mthreads::shared -MDumpvalue -e 'my %h :shared; $h{loop}=\%h; $|=1; my $d=Dumpvalue->new; $d->dumpValue(\%h)' > foo &

pid=$!
sleep 1
kill $pid

sync
wc foo

2025-09-15 19:20:34 dpchrist@laalaa ~/sandbox/perl
$ /bin/sh -x Dumpvalue-bug-shared-array-with-circular-loop.sh
+ pid=10808
+ sleep 1
+ perl -Mstrict -Mwarnings -Mthreads -Mthreads::shared -MDumpvalue -e my @a :shared; $a[0]=\@a; $|=1; my $d=Dumpvalue->new; $d->dumpValue(\@a)
Deep recursion on subroutine "Dumpvalue::unwrap" at /usr/share/perl/5.32/Dumpvalue.pm line 173.
Deep recursion on subroutine "Dumpvalue::DumpElem" at /usr/share/perl/5.32/Dumpvalue.pm line 270.
+ kill 10808
+ sync
+ wc foo
    16008     32016 384760284 foo

2025-09-15 19:20:50 dpchrist@laalaa ~/sandbox/perl
$ /bin/sh -x Dumpvalue-bug-shared-hash-with-circular-loop.sh
+ pid=10817
+ sleep 1
+ perl -Mstrict -Mwarnings -Mthreads -Mthreads::shared -MDumpvalue -e my %h :shared; $h{loop}=\%h; $|=1; my $d=Dumpvalue->new; $d->dumpValue(\%h)
Deep recursion on subroutine "Dumpvalue::unwrap" at /usr/share/perl/5.32/Dumpvalue.pm line 173.
Deep recursion on subroutine "Dumpvalue::DumpElem" at /usr/share/perl/5.32/Dumpvalue.pm line 243.
+ kill 10817
+ sync
+ wc foo
    17045     51135 436322304 foo

2025-09-15 19:21:05 dpchrist@laalaa ~/sandbox/perl
$


These bugs may affect newer Debian, Perl, and/or Dumpvalue releases.


Please feel free to modify and/or add the test scripts to your testing
infrastructure.


Please advise.


Thank you,

David