Subject: Re: signal(SIGSEGV, SIG_IGN) -> 100% CPU
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 06/10/1999 13:34:10
> There are two `problems' here.

> The first is [irrelevant to my message -dM]

> The second is that pipe(2) causes a segmentation violation rather
> than returning EFAULT.  [...POSIX is silent...]  The behaviour that
> results in this happening is due to the somewhat bogus manner in
> which pipe(2) returns the fd's (although there is some evidence to
> suggest we are at least consistant with some other commercial
> operating systems).

My impression is that in this respect we are compatible with
practically everything in existence, clear back to V7.  However, that
is just an impression; I have no experience with anything before
BSD4.1c, and can't recall looking into how pipes were returned under
anything before BSD4.3, and I'm not sure about that.

> [U]nless someone wants to take it upon themselves to make it possible
> for pipe(2) to return EFAULT,

I looked at doing this, and it looks pretty simple.  If anyone wants
it, I can even do the work (even for arches I don't use, since it
amounts to making pipe() no longer a special call - preserving the old
interface for binary compatability is something I don't feel prepared
to do except for arches I use, though that may change after I do it a
time or two).

But is it worth it?  The only benefits I can see to changing this are
(1) uniformity with other syscalls, and the (current) manpage, wrt
invalid pointer arguments (EFAULT instead of a signal), and (2)
removing a special-case syscall from libc.

In my opinion, the latter benefit is worth the work.  Anyone else care
to offer opinions, point out things I missed, etc?

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B