Re: SIGPIPE crash when writing to closed socket port

Robert Sachunsky <[email protected]>
Newsgroups gmane.lisp.scheme.bigloo
Message-ID <[email protected]>
Hi Manuel,

according to the POSIX definition of send(2) and sendto(2), for this
occasion the dedicated return code EPIPE is provided. This makes SIGPIPE
redundant behaviour in the first place: the error ends up in a
&io-write-error anyway (or could be delegated to a specialized exception).

IMHO, having to add a signal handler here is nothing to expect from a
high level language. Also, there is not much useful to do from the
signal handler's context (as opposed to the exception handler), unless
stateful globals were introduced. And if uncaught, a client can easily
tear down a server, for example. Besides, many other Schemes already
ignore this signal.

Therefore I believe it would really make sense to have Bigloo do
  signal (SIGPIPE, SIG_IGN);
between socket initialization and shutdown.

What do you think?

Regards,
Robert

Am 04.12.2013 09:25, schrieb Sven Hartrumpf:
> Hi.
> 
> MS:
>> SIGPIPE is a signal, not an error code. Hence, you should rather install
>> a signal handler for catching it. Try something as:
>>
>>   (signal sigpipe (lambda (n) (print "GOT IT")))
> 
> This works perfectly.
> Thanks for your help, Manuel!
> 
> Ciao
> Sven
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.