Turning a SIGSEGV into a regular function call under Linux, allowing throw

deadalnix deadalnix at gmail.com
Wed Mar 14 09:41:23 PDT 2012


Le 14/03/2012 17:34, Vladimir Panteleev a écrit :
> On Wednesday, 14 March 2012 at 07:35:50 UTC, FeepingCreature wrote:
>> Sweet. Yeah, I think you need to use naked and reconstruct the
>> stackframe. Not sure how it'd look; I'm not familiar with the x86_64 ABI.
>
> I think it might be safe to just reconstruct the stack frame in the
> signal handler, and set gregs[REG_EIP] to &_d_throw directly. It should
> also use a pre-allocated exception object (like how it's done with
> OutofMemoryError and InvalidMemoryOperationError), in case there's data
> corruption in the GC.

Especially if the signal is sent because of stack overflow !


More information about the Digitalmars-d mailing list