This is a bug in perl or in the XML::Parser module which I have been tracking down. Please try the example code included in the report and see if you can reproduce the bug. If you are unable to reproduce it, I will try to narrow down the test case further still. The bug is a message Attempt to free unreferenced scalar: SV 0x8063b9c during global destruction. which indicates some screwup in perl's data structures. While investigating the bug I also saw 'Attempt to free temp prematurely' appearing as well, but the minimal test case produces just one error message. Please save the first attached file as 'test_program' and the second as 'test_library'. The split into two separate files is necessary to reproduce the bug, at least for me. Then run % perl ./test_program to see the 'unreferenced scalar' message, along with a correct message about main::foo. (I have manually upgraded some perl packages from the Fedora development SRPMs or from CPAN while investigating this bug, but I hope you will be able to see it on your installation too.)
Created attachment 97251 [details] Perl program to print 'Attempt to free unreferenced scalar' message - but needs test_library too
Created attachment 97252 [details] Library file for test program - save in the same directory
Has this been reported to upstream CPAN? Has this been fixed upstream?
No, I reported it here first because Red Hat applies some patches to the vanilla perl distribution. FWIW, I can still reproduce this on FC4 with perl-5.8.6-15 and perl-XML-Parser-2.34-6.
I mean, is this an issue with a non-Fedora build of perl?
OK, I'll download a vanilla source tarball of perl5 and see if I can reproduce there.
I can confirm that this bug is reproducible with non-Fedora perl5. It is also reproducible with Fedora 6. The error message is now Attempt to free unreferenced scalar: SV 0x9953804, Perl interpreter: 0x9952008 during global destruction. Again, this indicates some memory management bug inside perl itself. Are you able to reproduce it?
Wow, what an old bug! I was able to find a fix for this one though, I'm about to commit it to rawhide.
Hooray - I'm glad you were able to squash this one. If you point me to the SRPM for the fixed source package in rawhide I will be able to test and confirm the fix. Sorry for taking two years to test whether vanilla (non-Fedora) perl5 also has the bug.
http://koji.fedoraproject.org/koji/buildinfo?buildID=21594 perl-5.8.8-30 has the fix. Once you confirm that it works for more complicated cases than your testcase (I already confirmed that it resolves that), I'll push the fix out as an update for FC-6/F-7.
FTR, Joris van Rantwijk in Debian bug 230844 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230844> discovered that XML::Parser is not guilty. You can still reproduce the bug using test_program attached above and the following code for test_library: package Fred; sub new { my ($class, %args) = @_; my $handlers = $args{Key}; bless $handlers; } sub parse { my ($self, $s) = @_; $self->{'/a'}->($self, 'Fred::Foo'->bar($self)); } package Fred::Foo; sub bar { my $class= shift; } sub children { my $elt= shift; } 1;
I confirm that the new perl package fixes the test program and also Joris van Rantwijk's simplified test program. I no longer remember exactly what triggered the bug in the first place but I suspect it was some use of XML::DOM. Thanks.
perl-5.8.8-25.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.