in reply to segmentation fault for perl

How do you call y.pl when you capture the error, as opposed to when not capturing the error?

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: segmentation fault for perl
by Anonymous Monk on Jul 06, 2009 at 06:47 UTC
    I am invoking the script x.pl from y.pl as system(x.pl); my $exit_status = $? >> 8; I am capturing the status always. It sometimes happen that x.pl is able to execute successfuly (it updates a database before exiting). But capturing the error status in y.pl shows the system(x.pl) has a exit status of segmentation fault. My os is solaris 10
      I am invoking the script x.pl from y.pl as system(x.pl);

      I take it to mean system('x.pl');. And I guess you made sure that x.pl has a correct #! line?

      my $exit_status = $? >> 8; I am capturing the status always.
      How do you know that your program died by segmentation fault? $? >> 8 is whatever x.pl passes to its exit call, so from this value alone, you can not deduce that your program segfaulted.

      But *if* it does, it could be that either the Perl used has a problem (that's why I'm asking you about the #! line), or (more likely) that x.pl uses some Perl module which contains compiled parts, so this would be the place to look.

      -- 
      Ronald Fischer <ynnor@mm.st>