Re: ARM Linux EABI: unwinding through a segfault handler

2015-10-05 Thread Ian Lance Taylor
On Sun, Oct 4, 2015 at 5:09 AM, Matthijs van Duin wrote: > On 4 October 2015 at 10:05, Andrew Haley wrote: >> Do you have GCC copyright assignment > > No, but I hereby license it under the http://www.wtfpl.net/ (or, in > any legal system which acknowledges such an act, place it in public > domain

Re: ARM Linux EABI: unwinding through a segfault handler

2015-10-04 Thread Matthijs van Duin
On 4 October 2015 at 10:50, mads_bn wrote: > Can somebody try if e.g. backtrace_symbols () will show where the offending > code was called from? Included a backtrace test, pushed to github. ./test(_Z9backtracev+0xb)[0x10f28] ./test(_Z17backtrace_handleri+0x5)[0x10f4a] < signal handler ./

Re: ARM Linux EABI: unwinding through a segfault handler

2015-10-04 Thread Matthijs van Duin
On 4 October 2015 at 10:05, Andrew Haley wrote: > Do you have GCC copyright assignment No, but I hereby license it under the http://www.wtfpl.net/ (or, in any legal system which acknowledges such an act, place it in public domain) > will you turn this into a patch which can be applied? I've alr

SV: ARM Linux EABI: unwinding through a segfault handler

2015-10-04 Thread mads_bn
it in future ;-) /Mads Fra: Matthijs van Duin [via gcc] [mailto:ml-node+s1065356n1191196...@n5.nabble.com] 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:

Re: ARM Linux EABI: unwinding through a segfault handler

2015-10-04 Thread Andrew Haley
On 03/10/15 21:41, Matthijs van Duin wrote: > Anyhow, it only took four years, but you can now throw > NullPointerExceptions on ARM. Enjoy. ;-) Ok, nice. :-) Do you have GCC copyright assignment, and will you turn this into a patch which can be applied? Thanks, Andrew.

Re: ARM Linux EABI: unwinding through a segfault handler

2015-10-03 Thread Matthijs van Duin
A shiny revised version of my unwind-through-signal code for ARM EABI: https://github.com/mvduin/arm-signal-unwind/ 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

Re: ARM Linux EABI: unwinding through a segfault handler

2015-09-18 Thread Matthijs van Duin
I've managed to expand Paul's outline into working code. It's still incomplete but I can report success throwing an exception in a signal handler and catching it outside it. I didn't rebuild glibc but just linked some extra code to my executable. The I grabbed from glibc, the rest are system head

Re: ARM Linux EABI: unwinding through a segfault handler

2015-02-03 Thread mads_bn
() -- View this message in context: http://gcc.1065356.n5.nabble.com/ARM-Linux-EABI-unwinding-through-a-segfault-handler-tp692287p1117717.html Sent from the gcc - Dev mailing list archive at Nabble.com.

Re: ARM Linux EABI: unwinding through a segfault handler

2015-02-03 Thread mads_bn
() -- View this message in context: http://gcc.1065356.n5.nabble.com/ARM-Linux-EABI-unwinding-through-a-segfault-handler-tp692287p1117716.html Sent from the gcc - Dev mailing list archive at Nabble.com.

Re: ARM Linux EABI: unwinding through a segfault handler

2014-08-01 Thread prafullakota
: http://gcc.1065356.n5.nabble.com/ARM-Linux-EABI-unwinding-through-a-segfault-handler-tp692287p1056478.html Sent from the gcc - Dev mailing list archive at Nabble.com.

Re: ARM Linux EABI: unwinding through a segfault handler

2011-10-27 Thread Paul Brook
> I'm trying to understand what you mean, but your comments are rather > obscure. Which file do you think I should change? Just tell me where to > look and I'll do it. glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S Currently has: .fnstart .save {r0-r15} .pad #

Re: ARM Linux EABI: unwinding through a segfault handler

2011-10-27 Thread Andrew Haley
On 10/27/2011 12:53 PM, Paul Brook wrote: >> On 10/27/2011 02:15 AM, Paul Brook wrote: >> So, suggestions welcome. Is there a nice way to detect a signal >> frame? >>> >>> That just makes me ask why are you're trying to detect a signal frame in >>> the first place? >> >> Because I need bac

Re: ARM Linux EABI: unwinding through a segfault handler

2011-10-27 Thread Paul Brook
> On 10/27/2011 02:15 AM, Paul Brook wrote: > So, suggestions welcome. Is there a nice way to detect a signal > frame? > > > > That just makes me ask why are you're trying to detect a signal frame in > > the first place? > > Because I need backtrace() to work when called from a signal

Re: ARM Linux EABI: unwinding through a segfault handler

2011-10-27 Thread Andrew Haley
On 10/27/2011 02:15 AM, Paul Brook wrote: So, suggestions welcome. Is there a nice way to detect a signal frame? > > That just makes me ask why are you're trying to detect a signal frame in the > first place? Because I need backtrace() to work when called from a signal handler. >>> Libunw

Re: ARM Linux EABI: unwinding through a segfault handler

2011-10-26 Thread Paul Brook
> >> So, suggestions welcome. Is there a nice way to detect a signal frame? That just makes me ask why are you're trying to detect a signal frame in the first place? > > Libunwind also reads the IP to detect signal frames on ARM Linux: > > http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=b

Re: ARM Linux EABI: unwinding through a segfault handler

2011-08-30 Thread Joseph S. Myers
On Mon, 29 Aug 2011, Daniel Jacobowitz wrote: > I thought we used a handler in GLIBC that was properly annotated, > nowadays, but I might be mistaken. What we have in GLIBC is ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S. Note that sigaction.c has to check the kernel version to determi

Re: ARM Linux EABI: unwinding through a segfault handler

2011-08-30 Thread Andrew Haley
On 08/29/2011 06:13 PM, Daniel Jacobowitz wrote: > On Mon, Aug 29, 2011 at 11:18 AM, Ken Werner wrote: >> On 08/25/2011 02:26 PM, Andrew Haley wrote: >>> >>> Throwing an exception through a segfault handler doesn't always work >>> on ARM: the attached example fails on current gcc trunk. >>> >>> pa

Re: ARM Linux EABI: unwinding through a segfault handler

2011-08-29 Thread Daniel Jacobowitz
On Mon, Aug 29, 2011 at 11:18 AM, Ken Werner wrote: > On 08/25/2011 02:26 PM, Andrew Haley wrote: >> >> Throwing an exception through a segfault handler doesn't always work >> on ARM: the attached example fails on current gcc trunk. >> >> panda-9:~ $ g++ segv.cc -fnon-call-exceptions -g >> panda-9

Re: ARM Linux EABI: unwinding through a segfault handler

2011-08-29 Thread Ken Werner
On 08/25/2011 02:26 PM, Andrew Haley wrote: Throwing an exception through a segfault handler doesn't always work on ARM: the attached example fails on current gcc trunk. panda-9:~ $ g++ segv.cc -fnon-call-exceptions -g panda-9:~ $ ./a.out terminate called after throwing an instance of 'FoobarExc

Re: ARM Linux EABI: unwinding through a segfault handler

2011-08-25 Thread Andrew Haley
On 08/25/2011 05:57 PM, David Daney wrote: > On 08/25/2011 05:26 AM, Andrew Haley wrote: >> Throwing an exception through a segfault handler doesn't always work >> on ARM: the attached example fails on current gcc trunk. >> >> panda-9:~ $ g++ segv.cc -fnon-call-exceptions -g >> panda-9:~ $ ./a.out

Re: ARM Linux EABI: unwinding through a segfault handler

2011-08-25 Thread David Daney
On 08/25/2011 05:26 AM, Andrew Haley wrote: Throwing an exception through a segfault handler doesn't always work on ARM: the attached example fails on current gcc trunk. panda-9:~ $ g++ segv.cc -fnon-call-exceptions -g panda-9:~ $ ./a.out terminate called after throwing an instance of 'FoobarExc

ARM Linux EABI: unwinding through a segfault handler

2011-08-25 Thread Andrew Haley
Throwing an exception through a segfault handler doesn't always work on ARM: the attached example fails on current gcc trunk. panda-9:~ $ g++ segv.cc -fnon-call-exceptions -g panda-9:~ $ ./a.out terminate called after throwing an instance of 'FoobarException*' Aborted The bug is that _Unwind_GetI