views:

152

answers:

1

I have a Ruby script, which uses one external lib. Sometimes script exits with segmentation fault, when uses this lib and I must to rerun it. Is it possible to somehow rescue this error by extracting fragment, which has dangerous code to separate process or something like that?

Thanks

+3  A: 

Never say die

sepp2k
For what it's worth, this is incredibly dangerous; once you're segfaulted, all bets are off on memory corruption and process state. If you do decide to rescue SEGVs, you should clean up and exit the running process as quickly as possible, and test very very well.
Brad
Thanks, but it does not compliles under my operating system,I'll try to figure out how to fix issue.
taro