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

deadalnix deadalnix at gmail.com
Wed Mar 14 09:40:24 PDT 2012


Le 14/03/2012 14:43, FeepingCreature a écrit :
> On 03/14/12 12:13, deadalnix wrote:
>> Le 13/03/2012 23:24, Vladimir Panteleev a écrit :
>>> I think something like this needs to end up in Druntime, at least for
>>> Linux x86 and x64.
>>
>> You are loosing EAX in the process.
> It's somewhat unavoidable. One way or another, you need to find _some_ threadlocal spot to stick those extra size_t.sizeof bytes, since you mustn't lose data, but the hack works by _overwriting_ the return address.

Thread local storage is a very easy thing in D. Can't we just use a 
static variable and set from within the signal handler ?


More information about the Digitalmars-d mailing list