[PATCH] D26809: [lli] Handle SIGSEGV in Jit'ed code more gracefully.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 17 12:48:20 PST 2016


On Thu, Nov 17, 2016 at 12:37 PM, Davide Italiano <dccitaliano at gmail.com> wrote:
> On Thu, Nov 17, 2016 at 12:28 PM, Filipe Cabecinhas <filcab at gmail.com> wrote:
>> What happens if the process wants to handle SIGSEGV?
>> You can't say it's in JITted code on the handler, as the signal might come
>> from other parts of code, no?
>>
>
> As the only pieces of code we're interested into are the RunFunction()
> bits, we can (maybe) move this logic to ExecutionEngine or delete the
> signal handler via SIG_DFL after runFunction() is executed. How does
> that feel?

Lang, what do you think? It's reasonable to set a signal handler at
the beginning of MCJIT::runFunction() and unset at the end?  My
preferred solution doesn't quite work for llvm (try {} catch (...) {
// handle SIGSEGV }) but maybe there's a similar alternative I'm
missing.

--
Davide


More information about the llvm-commits mailing list