Re: [RFC] [Patch 0/21] Non disruptive application core dumpinfrastructure

From: Suzuki K. Poulose
Date: Thu Dec 16 2010 - 02:57:16 EST


On Wed, 15 Dec 2010 12:51:54 +0100
Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:

> > 1) A process can trigger a core synchronously, upon an event, say a signal
> > handler and continue from there. gcore would require a fork(), which is not
> > safe to use from a signal handler.
>
> Why is it not safe for a signal?
>
> From the kernel side it should be. glibc may do some funky things
> on fork, but you could always call the syscall directly.

I came across the following links,

http://sourceware.org/bugzilla/show_bug.cgi?id=4737
https://www.opengroup.org/austin/docs/austin_445.txt

which seem to suggest that fork() is not async-safe due to malloc and the
fork handlers. But a direct fork syscall by-passing glibc should be safe.

Thanks
Suzuki

>
> -Andi

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/