Yo Hal!

On Mon, 21 Mar 2016 20:23:41 -0700
Hal Murray <hmur...@megapathdsl.net> wrote:

> e...@thyrsus.com said:
> > I just ported in the Classic fix "[Bug 2814] msyslog deadlock when
> > signaled." I think that'll do it for this one.   
> 
> Is there any software that will check signal handlers to see if they
> call (or call anything that calls) any non-signal-safe routines?

# man signal

        "The behavior of signal() varies across UNIX versions, and has also var‐
        ied historically across different versions of Linux.   Avoid  its  use:
        use sigaction(2) instead."

That bears repeating:

        "Avoid  its  use: use sigaction(2) instead."

You may 'fix' msyslog, but signal() is inherently not thread safe.  From
the man page:

        "The effects of signal() in a multithreaded process are unspecified."


> The case I'm thinking of is a trap handler that catches a
> fatal error and wants to print out a useful message and then exit
> somewhat cleanly.

Check out "man 7 signal", almost nothing is legal to call from within
a signal.  You can't even open() of fopen() anything.  About the best you
can do is write(STDERR,) and exit().

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        g...@rellim.com  Tel:+1 541 382 8588

Attachment: pgpREUDHCZ_3k.pgp
Description: OpenPGP digital signature

_______________________________________________
devel mailing list
devel@ntpsec.org
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to