The XS version is most likely calling into the kernel/system, particularly, the local Time Zone database, hence the reason you're getting a segfault from passing bad parameters.

Given the recent legal debacle with the default time zone database used on most systems, if you have any kind of "auto update" running on your system, the culprit may not be your perl code. The Linux folks may have reacted to the copyright infringement lawsuit by modifying their TZ database in some strange, and incompatible way.

I noticed your perl version is ancient, v5.8.8, so if you're using a newer module with an old perl, this might be the cause.

Personally, I see no reason for you to be running the code inside an eval? Do you have some specific reason for doing this? --Note: I can't see much of the code, so there may be some hidden reason.

If you want to remove your 'self' from harms way, validate the input. It would also be wise to validate the inputs you send to Params::Validate, specifically, make sure @_ is non-empty, and make sure $NewValidate is a HASHREF and is non-empty.

sub new { if ($_[0] =~ m/^$PROGRAM=HASH\(0x/) { my $class = shift(); print "Got Self\n"; } else { print "Selfless\n"; } if ( ((defined @_) && (@_ > -1)) && ((defined $NewValidate) && (ref($NewValidate) eq 'HASH') && (keys %$NewValidate)) ) { my %p = validate( @_, $NewValidate ); unless ((defined %p) && (keys %p)) { die("failed to validate!"); } } else { die("a horrible death!"); } ...

Hope this helps


In reply to Re: Tracking down a segfault by Anonymous Monk
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.