Well, the oddity to me is that we're not passing bad parameters. Or, at least, that's what everything seems to say. The Perl error expressly tells us that we're providing the necessary params correctly, and printing them out immediately before the call shows the same thing.

The error is caused by the fact that DateTime.pm somehow loses the parameters that we passed it. We pass them, and I hacked a print line into DateTime.pm to prove that it was indeed receiving the params correctly in @_. However, DateTime.pm then processes the arguments using Params::Validate. So, when Params::Validate returns the object, it's empty, with no error!

As for why it's in an eval? I think that's because it's important that the code doesn't die (I didn't actually write it, so I'm guessing here). The library is used in a few places, one of them processing human input, which occasionally is input with crap. So I believe without the eval, junk input can result in an exit from DateTime, which shouldn't cause the program to fail.

We're suspicious about the fact that it's time zone code thanks to the fact that there was the recent problem with the Olson DB, which might have causing this, but it... doesn't seem like the problem. At least not offhand. We re-processed the Olson data a few times (using different versions), but nothing seems to solve the error.

Our guess for the time being is that the error is further upstream somewhere, and perhaps something in the stack is being screwed up, and it's only getting to the breaking point when it gets down to the TimeZone level.

The whole environment is ... interesting. As noted, it's a very old Perl version (we've been denied in trying to have them upgrade it, and some libraries we maintain ourselves, not maintained by the sysadmins). But I'm still at a loss, since, well, you're not supposed to get actual segfaults!

DaveE

In reply to Re^2: Tracking down a segfault by davee123
in thread Tracking down a segfault by davee123

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.