Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!husc6!uwvax!rutgers!labrea!decwrl!pyramid!uccba!hal!ncoast!allbery
From: allbery@ncoast.UUCP (Brandon Allbery)
Newsgroups: comp.unix.wizards
Subject: Re: signals like interrupts?
Message-ID: <3254@ncoast.UUCP>
Date: Sun, 19-Jul-87 16:35:42 EDT
Article-I.D.: ncoast.3254
Posted: Sun Jul 19 16:35:42 1987
Date-Received: Mon, 20-Jul-87 03:48:04 EDT
References: <17691@cmcl2.NYU.EDU>
Reply-To: allbery@ncoast.UUCP (Brandon Allbery)
Followup-To: comp.unix.wizards
Organization: Cleveland Public Access UN*X, Cleveland, Oh
Lines: 36

As quoted from <17691@cmcl2.NYU.EDU> by edler@cmcl2.UUCP:
(grouped hardware signals (SIGILL, SIGSEGV, etc.), then kernel notifications
(SIGALRM, etc.), then software notifications (SIGTERM, SIGUSR1, SIGUSR2)...)
+---------------
| level or something like that.  I believe that signals of the first
| category above (and probably those in the second category as well)
| should not be sendable by kill() or killpg().  I know someone will say
| "but I like to test my program's SIGSEGV handler by sending SIGSEGV
| from the shell", but while this may be a convenience when debugging
| relatively small programs I think it is a hindrance to construction of
| reliable large systems.
+---------------

Cases where trapping hardware signals is desirable:

(1) my malloc() debugger package (soon in comp.sources.misc) dumps the malloc
tables when an invalid memory access (SIGBUS, SIGSEGV) occurs; this allows
the programmer to determine if it was a bogus pointer reference.

(2) I often send SIGBUS to a process which traps SIGQUIT and then goes into
an infinite loop.  I want the core dump, else I would use SIGKILL.  Remember:
_no_ program is ever totally bug-free!

As for queueing:  what's wrong with the System V technique?  Send a message,
then a SIGUSR1; it doesn't matter how many SIGUSR1's are lost as long as you
get one of them, and the IPC msg mechanism does the queueing.  You can send
data asynchronously this way as well.  The SIGUSR1 handler can deal with the
messages.  (To forestall sV/BSD wars:  it's my considered opinion that each
version of UNIX has good and bad features.  And some things were botched by
both (sockets vs. so-called "streams" vs. Ritchie's streams in V8).)
-- 
[Copyright 1987 Brandon S. Allbery, all rights reserved] \ ncoast 216 781 6201
[Redistributable only if redistribution is subsequently permitted.] \ 2400 bd.
Brandon S. Allbery, moderator of comp.sources.misc and comp.binaries.ibm.pc
{{ames,harvard,mit-eddie}!necntc,{well,ihnp4}!hoptoad,cbosgd}!ncoast!allbery
<>