This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: [PowerPC] Fix eh unwind segfault


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~


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