IETF-SSH archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Messages with exit-signal



On 15 Mar 2001, Niels Mller wrote:

> 2. What should the accompanying message look like?
> 
> Some of the alternatives are
> 
>   "Segmentation fault" (i.e. whatever strerror returns)
>   "Segmentation fault (core dumped)"
>   "Process died: Segmentation fault"

You won't get these strings from strerror, because signals are not error
numbers.  You pretty much have to come up with them yourself.  See, for
example, sh.init.c in tcsh.

The message with " (core dumped)" is not merely an alternate form; it's an
indication that a core file was actually produced.  This is provided as a
bit in the process status returned by wait().  It may be an implementation
decision whether to make this information visible to the client; some
implementations or sites may prefer not to report this for security
reasons. 

> I think I'd prefer the first. If the client chooses to display the
> message, it has to add some information anyway in order to clearly
> indicate that the message originated at the remote end, so it seems
> natural to let the client be responsible for making the message look
> pretty and only send the information that the client can't figure out
> by itself, i.e. only send the string returned by strerror.

This reasoning clearly eliminates the third variant; the "Process died:"
part is superfluous.  The " (core dumped)", on the other hand, is _not_
information the client can get elsewhere, since even the concept is
UNIX-specific.  IMHO, auxillary information like this should be included
with the signal message.

-- Jeffrey T. Hutzelman (N3NHS) <jhutz+%cmu.edu@localhost>
   Sr. Research Systems Programmer
   School of Computer Science - Research Computing Facility
   Carnegie Mellon University - Pittsburgh, PA




Home | Main Index | Thread Index | Old Index