develooper Front page | perl.perl5.porters | Postings from March 2003

Re: [perl #21614] 5.8.0 Unbalanced string table refcount

Thread Previous | Thread Next
Nicholas Clark
March 24, 2003 15:28
Re: [perl #21614] 5.8.0 Unbalanced string table refcount
Message ID:
On Sun, Mar 23, 2003 at 05:59:59PM +0000, Nicholas Clark wrote:

> Running with maintperl (5.8.1 to be) or bleadperl (the current development
> snapshot) valgrind reports no memory errors. So there does seem to be a bug
> in 5.8.0, and it seems to have been fixed for 5.8.1
> However, I can't be sure if this illegal memory access is actually the
> same bug as you're seeing. I'm a bit confused by all this, because valgrind

It's not. It can be repeated on a debugging 5.8.0 like this:

$ echo | PERL_DESTRUCT_LEVEL=2 perl5.8.0-32-g -lwe '%a= qw(k v); foreach (keys %a) {$_ = <>;}'
Unbalanced string table refcount: (1) for "k" during global destruction.

It's present in maint:

nick@penfold:~/19053-g$ echo | PERL_DESTRUCT_LEVEL=2 ./perl -lwe '%a= qw(k v); foreach (keys %a) {$_ = <>;}'
Assertion !((sv)->sv_flags & 0x00800000) failed: file "pp_hot.c", line 1528 at -e line 1.

It's fixed in blead for the normal case (not copy on write), but not for
copy on write. The code paths in Perl_sv_force_normal_flags are completely
different depending on whether perl is built with copy on write

How does one write a regression test to check for lack of warnings?
Make a new perl and check that STDERR is empty?

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About