Subject: bug#15794: Core dump after SIGTERM during GC marking

From: Eli Zaretskii <[email-masked]>
Date: Mon, 04 Nov 2013 18:02:38 +0200

> From: Andreas Schwab <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Mon, 04 Nov 2013 09:56:44 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> From: Andreas Schwab <[email-masked]>
> >> Cc: [email-masked],  [email-masked]
> >> Date: Sun, 03 Nov 2013 23:22:31 +0100
> >> 
> >> >> Even auto-save is a no-no in a signal handler.
> >> >
> >> > I don't see why.  Auto-save takes care to do only predictable things.
> >> 
> >> A lot of things that are a no-no in a signal handler, like calling
> >> auto-save-hook.
> >
> > We could disable that (and the other things) as well.
> 
> You would have to disable opening files, too.

What's wrong with opening files from a signal handler?  I always
thought that open(2) (and also write(2) and close(2)) are async-signal
safe on Posix systems, and this page

  http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html

seems to agree.