Hi Monks,

I've been having a bit of a problem with some scripts I am running, and I was wondering if someone could maybe just give me a nudge in the right direction.

I have a set of perl scripts that are used to setup and configure a piece of custom hardware. The perl scripts use an XS module that plugs into some C libraries that communicate with the hardware. The script has been giving me a segfault lately, but only under very specific conditions. If I run the script directly from the console (Linux) or through a putty session it works fine, the hardware gets correctly initialized and everything. If I run the script by sshing in from windows with cygwin ssh, it seg faults. However, debugging this problem has been quite difficult because any change to the file or how it is run seems to make the seg fault go away. The following make the seg fault disappear:
- adding any print or warn statement to the file
- hard-coding any function value in the file
- running perl with the perl debugger (-d option)
- running perl with the -u option to dump a core file
- running perl in gdb

Any suggestions on what this could be or how I could go about debugging something like this would be greatly appreciated.

In reply to disappearing segfault by cfreeman

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.