This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SV: ARM Linux EABI: unwinding through a segfault handler

Nice work !


Some time ago I was in a project, where we would like to get more context in
syslog when e.g. SIGSEGV occurred (embedded Linux).

On x86 this was working fine, and I hope a change like this for ARM will
allow it to work here as well (as long as stack is still valid).


I don't have access to such an ARM setup currently.

Can somebody try if e.g. backtrace_symbols () will show where the offending
code was called from? 


Also I really like the idea to get this back into the mainstream version, so
we all will benefit from it in future ;-)




Fra: Matthijs van Duin [via gcc]
Sendt: 3. oktober 2015 22:42
Til: mads_bn <>
Emne: Re: ARM Linux EABI: unwinding through a segfault handler


A shiny revised version of my unwind-through-signal code for ARM EABI:

For actual unwinding it now uses sigreturn as a cleanup handler (after 
diddling the ucontext to make it land right onto a call to 
_Unwind_Resume), which means that all state should get properly 
restored by the kernel. 

Virtual unwinding still only restores core registers, but hopefully 
that isn't too big a problem in practice. 

A small test is included that confirms throwing exceptions out of 
SEGV, checks VFP is restored properly, and that returning normally 
from an async signal handler still works (my original patch accidently 
broke that). 

I'd finally like to take a moment to say this was hell to figure 
out.... this shit is really documented nowhere properly since it 
appears to be a magic blend of ARM EABI and IA64 C++ ABI (meaning 
neither documentation quite applies) and I had to plow through the 
innards of libgcc and libsupc++ to figure out how things *actually* 
work. Argh. 

Anyhow, it only took four years, but you can now throw 
NullPointerExceptions on ARM. Enjoy. ;-) 

Matthijs van Duin 


If you reply to this email, your message will be added to the discussion

To unsubscribe from ARM Linux EABI: unwinding through a segfault handler,
click here
_by_code&node=692287&code=bWFkc2JuQG1haWwuZGt8NjkyMjg3fDIwNDQ1NTEzNzU=> .
ls%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML 

View this message in context:
Sent from the gcc - Dev mailing list archive at

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]