RedisGraph icon indicating copy to clipboard operation
RedisGraph copied to clipboard

SIGSEGV handler

Open swilly22 opened this issue 3 years ago • 1 comments

This is an example of how we might be able to handle one of the common exceptions we encounter (invalid memory access) the API resembles the Try/Catch mechanism.

The idea is to install a single handler for SIGSEGV in addition to a long-jump point, such that if the single handler is called i.e. we've access an invalid memory address execution of the offending thread will jump to the "recovery" point.

Shortcomings: depending on the "try/catch" block scope, we might be leaking or leave the graph or one of its components in an invalid state, so use with care!

Is this better than crashing and losing data? maybe...

swilly22 avatar Jul 05 '22 12:07 swilly22

I believe that crashing is better than undefined behavior.

LiorKogan avatar Jul 06 '22 06:07 LiorKogan

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 22 '22 05:09 CLAassistant