This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PowerPC] Fix eh unwind segfault
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 30 Aug 2004 23:30:52 -0700
- Subject: Re: [PowerPC] Fix eh unwind segfault
- References: <20040831050014.GD26692@bubble.modra.org>
On Tue, Aug 31, 2004 at 02:30:14PM +0930, Alan Modra wrote:
> Another complication is that the unwind library functions need
> to be thread safe, so we can't use static variables. That's why I use
> a nested function for the signal handler.
Signal handlers are by nature not thread safe. Without using
clone directly, all threads share the same set of signal handlers.
So as soon as you start unwinding in one thread, another thread
may crash, because the nested function doesn't apply.
So I don't see this patch as an improvement at all.
Short of hardware for speculative loads, the only plausible option
would have been using mincore and praying you don't hit an munmap
race condition. Except that linux after 2.2 has a bug in which
anonymous pages are *not* reported as present in core. Which
includes the stack, and so makes it entirely worthless for this
particular problem.
If you were really dedicated, you could re-implement mincore
functionality by hand by scanning /proc/self/maps. Personally
I'd prefer that you smack IBM kernel hackers around until they
fix the syscall bug.
r~