Your message dated Sun, 31 May 2020 12:08:18 +0300 with message-id <[email protected]> and subject line Re: Bug#417999: perl: GDBM tied hash weirdness - deletion in 'each' loop does nothing has caused the Debian Bug report #417999, regarding GDBM tied hash weirdness; deletion ends 'each' loop to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 417999: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417999 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: perl Version: 5.8.8-7 Severity: important Try the following pearl: ## begin test script #! /usr/bin/perl use GDBM_File; %iddb = (); tie %iddb, 'GDBM_File', './weird', &GDBM_WRCREAT|&GDBM_NOLOCK, 0600; for (1..200) { $iddb{"foo$_"} = $_; } print "Before deletion:\n\n"; while (my ($k, $v) = each %iddb) { print "$k:$v\n"; } while (my ($k, $v) = each %iddb) { delete $iddb{$k} if $v > 150 ; } print "\n\nAfter deletion:\n\n"; while (my ($k, $v) = each %iddb) { print "$k:$v\n"; } untie %iddb; ## end test script This is only the beginning, though. The same happens on (net|free|open)bsd platforms with perl 5.8.8. On top of that, on those platforms, the same happens with DB_File! (with the tie line changed to suit, of course). OTOH, on Debian DB_File works as expected: the second print loses all the values over 150. For a bit of context, see the test results here: http://cpantesters.perl.org/show/Mail-Sort.html#Mail-Sort-20070403 The severity may be a stretch but I think most real perl programs involve a persistent hash. -- System Information: Debian Release: 4.0 APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/dash Kernel: Linux 2.6.18-11unicorn200703160124 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Versions of packages perl depends on: ii libc6 2.3.6.ds1-13 GNU C Library: Shared libraries ii libdb4.4 4.4.20-8 Berkeley v4.4 Database Libraries [ ii libgdbm3 1.8.3-3 GNU dbm database routines (runtime ii perl-base 5.8.8-7 The Pathologically Eclectic Rubbis ii perl-modules 5.8.8-7 Core Perl modules Versions of packages perl recommends: ii perl-doc 5.8.8-7 Perl documentation -- no debconf information
--- End Message ---
--- Begin Message ---Version: 5.28.0-1 On Fri, Dec 15, 2017 at 12:02:40PM +0000, Dominic Hargreaves wrote: > On Mon, Apr 01, 2013 at 10:27:24PM +0100, Dominic Hargreaves wrote: > > tags 417999 +confirmed > > retitle 417999 GDBM tied hash weirdness; deletion ends 'each' loop > > thanks > Upstream has explained the situation here: > > https://rt.perl.org/Ticket/Display.html?id=117449 > > In brief, this is a limitation of GDBM and can't realistically be fixed. > This limitation will be fixed in a future release of perl. I suspect that last line should have said 'documented', not 'fixed'. The GDBM_File documentation now reads Unlike Perl's built-in hashes, it is not safe to "delete" the current item from a GDBM_File tied hash while iterating over it with "each". This is a limitation of the gdbm library. I don't think there's anything more we can do about this, so closing this. -- Niko Tyni [email protected]
--- End Message ---

