We have a problem with an internal mod_perl2 webapp that uses XML::LibXML.

For some reason it segfaults when we try to save a form with this XML:

<?xml version="1.0" encoding="UTF-8"?> <lom xmlns="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsmd_v1p2p2.xsd"> <general> <title> <langstring lang="nb">Poteten - skadelig eller bra for oss?</langstri +ng> <langstring lang="nn">Er poteten skadeleg eller bra for oss?</langstr +ing> </title> </general> </lom>

Segfault:

#0 0xb7699e5e in xmlDictOwns () from /usr/lib/libxml2.so.2 #1 0xb75fe790 in xmlFreeNodeList () from /usr/lib/libxml2.so.2 #2 0xb75fe734 in xmlFreeNodeList () from /usr/lib/libxml2.so.2 #3 0xb75fe734 in xmlFreeNodeList () from /usr/lib/libxml2.so.2 #4 0xb75fe8fa in xmlFreeNode () from /usr/lib/libxml2.so.2 #5 0xb75b3305 in PmmFreeNode () from /usr/lib/perl5/auto/XML/LibXML/L +ibXML.so #6 0xb75b33fd in PmmREFCNT_dec () from /usr/lib/perl5/auto/XML/LibXML +/LibXML.so #7 0xb75b33df in PmmREFCNT_dec () from /usr/lib/perl5/auto/XML/LibXML +/LibXML.so #8 0xb75981aa in XS_XML__LibXML__Node_DESTROY () from /usr/lib/perl5/ +auto/XML/LibXML/LibXML.so #9 0xb786d3b9 in Perl_pp_entersub () from /usr/lib/libperl.so.5.8 #10 0xb7804f10 in Perl_get_cv () from /usr/lib/libperl.so.5.8 #11 0xb7808cf1 in Perl_call_sv () from /usr/lib/libperl.so.5.8 #12 0xb7870079 in Perl_sv_clear () from /usr/lib/libperl.so.5.8 #13 0xb7870922 in Perl_sv_free () from /usr/lib/libperl.so.5.8 #14 0xb787039a in Perl_sv_clear () from /usr/lib/libperl.so.5.8 #15 0xb7870922 in Perl_sv_free () from /usr/lib/libperl.so.5.8 #16 0xb7895052 in Perl_free_tmps () from /usr/lib/libperl.so.5.8 #17 0xb7865a1e in Perl_pp_nextstate () from /usr/lib/libperl.so.5.8 #18 0xb7865917 in Perl_runops_standard () from /usr/lib/libperl.so.5.8 #19 0xb7804ef0 in Perl_get_cv () from /usr/lib/libperl.so.5.8 #20 0xb7808cf1 in Perl_call_sv () from /usr/lib/libperl.so.5.8 #21 0xb7918b7f in modperl_callback () from /usr/lib/apache2/modules/mo +d_perl.so #22 0xb7919451 in modperl_callback_run_handlers () from /usr/lib/apach +e2/modules/mod_perl.so #23 0xb79196ff in modperl_callback_per_dir () from /usr/lib/apache2/mo +dules/mod_perl.so #24 0xb7913f61 in modperl_response_finish () from /usr/lib/apache2/mod +ules/mod_perl.so #25 0xb79141e2 in modperl_response_handler_cgi () from /usr/lib/apache +2/modules/mod_perl.so #26 0x08077e48 in ap_run_handler () #27 0x080781cc in ap_invoke_handler () #28 0x08069c7f in ap_process_request () #29 0x08064c52 in _start ()

I have some problems understanding exactly what to look for from this dump.

Can anyone give me some pointers as to how to understand this one?

I'm not 100% sure it's XML::LibXML that is the culprit, but from the coredump I assume it is.

Filed a bug here: http://rt.cpan.org/Public/Bug/Display.html?id=30610


In reply to XML::LibXML::Node::DESTROY causes segfault in mod_perl2 by robins

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.