This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Segfault while unwinding an invalid function pointer
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: Pete Eberlein <eberlein at linux dot vnet dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 31 Jan 2008 05:53:59 -0500
- Subject: Re: [PATCH] Segfault while unwinding an invalid function pointer
- References: <47A0F9FA.9000903@linux.vnet.ibm.com.suse.lists.egcs-patches> <p73r6fy46fh.fsf@bingen.suse.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Jan 31, 2008 at 11:48:18AM +0100, Andi Kleen wrote:
> mincore is racy because the page could be just munmaped by a different
> thread in the window between the call and the access. The only way to make it
> safe would be to use mlock, but that might require root.
>
> Better would be to install a signal handler and handle the exception.
> Might be tricky to coordinate this with other signal handlers though.
That's not something the unwinder can/should do. Signal handlers are
process-wide, a library shouldn't mess up with application's signal handlers
and some other thread can change the signal handler in the mean time anyway.
Jakub