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

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
Paul, do you know of any progress on this since 2011? I cannot find any attempt to use your suggested ".personality __gnu_personality_sigframe" in prologue for "__default_sa_restorer_v2". I still need to learn more about this syntax... I'm not building the glibc myself, but can probably let a frie

Re: ARM Linux EABI: unwinding through a segfault handler

2015-02-03 Thread mads_bn
Paul, do you know of any progress on this since 2011? I cannot find any attempt to use your suggested ".personality __gnu_personality_sigframe" in prologue for "__default_sa_restorer_v2". I still need to learn more about this syntax... I'm not building the glibc myself, but can probably let a frie

Re: ARM Linux EABI: unwinding through a segfault handler

2014-08-01 Thread prafullakota
Hi, We are also observing same issue and this was fixed in ulibc in below link and we are looking for any solution if exists in glibc similar to this. Please let us know. http://lists.uclibc.org/pipermail/uclibc/2013-September/047932.html Thanks, Prafulla -- View this message in context: htt

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