On Thu, Feb 13, 2014 at 02:43:03PM -0600, Bill McCormick wrote:
> I have a Perl module that calls a function from in a Swig generated
> module, which in turn calls a function in a shared library. It's
> been a while since I put it all together and made it work, so I'm
> kind of hazy on the technical details - and since it mostly works I
> never need to look at it.
> 
> There is occasion, when called with incorrect parameters, that the
> wrapped function(s) will create a segmentation fault. I'd like to be
> able to get the details of the seg fault up to the Perl/CGI script
> that runs all of this. Is there some way I should be wrapping calls
> to the shared lib in something like an eval BLOCK, so I can croak a
> message back to the web page?
> 
perldoc -q exception turned up a result from perlfaq8 just so you know the
tools for exception handling are there.  You might be able to catch the
exception nicely and prevent death by seg fault but I'm not sure you can delve
into the shared object via Perl.  

The best you could do is report the parameters that caused the problem and
tighten up your data validation.

Kind regards

Lesley

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to