Thanks to everyone for the help so far.

I wasn't actually trying to make the problem go away by adding the call to log4perl. I was hoping to work out what was going on.

I'm using version 5.8.3 and don't think it is a problem with incorrect modules or the like. However, I don't know how I would look at %ENV and @INC immediately before the seg fault or bus error.

I suspect it is the recursion - the function being called uses LibXML version 1.58 to check some attributes of an XML tree. Although, even just putting a print in the loop over the children where the function calls itself also "removes" the problem, so this assumption may also be incorrect. As I now have another bug to correct, I shall return to the last working version, fix the second problem and try to implement and test the correction for the first problem more incrementally.

I would post some code but:

1. The program is written like C and peolple would laugh.
2. It is rather convoluted (see 1) and it would probably take more more time to produce a simple example than to solve the problem in the first place (although maybe that would be a good approach to solving the problem anyway).

Thanks again for the advice.

loris

Update

OK, now I know what is causing the problem. It is something to do with LibXML (V 1.58). If I do:

$parent->replaceChild($newNode,$oldNode);
I get a segmentation fault. If I do:

$parent->removeChild($oldNode); $parent->addChild($newNode);
everything works OK. I would rather replace the node so that I don't have to worry keeping the ordering the same. Has anyone seen behaviour like that before? Thanks again for the help.

loris


In reply to Re^3: Vague "bus error" question by loris
in thread Vague "bus error" question by loris

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.