justibus has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to edit a xml file using XML::Twig, but perl always crashes on outputting the xml to a new file. Now, this already happens when I don't do anything to the file, just parse it and print it to another file. I've traced the problem to the cleanup routine in XML::Twig using the Devel::ptkdb debugger, it happens somewhere in the vicinity of line 7535 in Twig.pm (I use the newest version 3.39 of XML::Twig, and strawberry perl 5.12.3).
Sometimes there's also a memory leak and I get a message "Out of memory!". The crash itself doesn't produce any error messages in perl, aside from the message in Windows 7 that perl.exe has crashed.
The xml file can be found here: http://dl.dropbox.com/u/14595053/test.zip (45 kb, 1.7 MB expanded). I have zipped it and uploaded it to dropbox because it's quite big. I have validated it with several tools and all say, that it's a valid xml file.
Does anybody know, what's going on? Thanks!use strict; use warnings; use XML::Twig; my $xml = new XML::Twig(); $xml->parsefile('test.xml'); open OUT, ">", "test.new.xml"; $xml->print(\*OUT); close OUT;
Edit: The workaround I found is to downgrade to perl 5.10.1.5.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl crashes when processing xml with XML::Twig
by choroba (Cardinal) on Mar 12, 2012 at 22:31 UTC | |
by justibus (Acolyte) on Mar 13, 2012 at 09:04 UTC | |
by choroba (Cardinal) on Mar 13, 2012 at 11:32 UTC | |
|
Re: perl crashes when processing xml with XML::Twig
by Anonymous Monk on Mar 13, 2012 at 03:31 UTC | |
by justibus (Acolyte) on Mar 13, 2012 at 09:00 UTC | |
by Anonymous Monk on Mar 13, 2012 at 09:39 UTC | |
by justibus (Acolyte) on Mar 13, 2012 at 13:19 UTC | |
by Anonymous Monk on Mar 13, 2012 at 14:02 UTC | |
|