From owner-freebsd-hackers Fri Sep 19 15:36:17 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA14845 for hackers-outgoing; Fri, 19 Sep 1997 15:36:17 -0700 (PDT) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA14836; Fri, 19 Sep 1997 15:36:10 -0700 (PDT) Received: (from grog@localhost) by freebie.lemis.com (8.8.7/8.8.5) id IAA17509; Sat, 20 Sep 1997 08:05:54 +0930 (CST) Message-ID: <19970920080554.38866@lemis.com> Date: Sat, 20 Sep 1997 08:05:54 +0930 From: Greg Lehey To: Terry Lambert Cc: Niall Smart , Don.Lewis@tsc.tdk.com, hackers@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG Subject: Re: Bug in malloc/free References: <199709192002.NAA29627@usr03.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e In-Reply-To: <199709192002.NAA29627@usr03.primenet.com>; from Terry Lambert on Fri, Sep 19, 1997 at 08:02:33PM +0000 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8250 Fax: +61-8-8388-8250 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Fight-Spam-Now: http://www.cauce.org Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Fri, Sep 19, 1997 at 08:02:33PM +0000, Terry Lambert wrote: >>>> } We claim to be sort of POSIX conformant. Perhaps this is enough. We >>>> } aren't actually POSIX conformant. All the above "safe" routines may >>>> } clobber the global `errno'. >>>> >>>> Which is why I save and restore errno in signal handlers. >>> >>> Perhaps this should be done by the trampoline code on the user's >>> behalf... >> >> Perhaps that would encourage people to write non-portable code. > > When a read or write fault occurs on page zero in a program running > on SVR4, rather than crashing, the map the page and note the effect. > > There is a kernel tunable that can turn this off, but a great many > legacy programs dereference NULL pointers, expecting a NULL pointer > to be identical to a NULL string. > > The default for SVR4 is arguably incorrect, but it follows the principle > of least astonishment, and allows legacy code to run. It's not just incorrect, it's inconsistent. Some SVR4 do, some SVR4 don't. True SRV4 story (I'll omit the name of the vendor to protect the guilty): they had some problems with a runaway csh which went crazy after the stdin line dropped, and ultimately it killed the system. They determined that, for some reason, csh wasn't responding to SIGHUP. So they introduced a kernel mod to send a SIGKILL after 100 SIGHUPs. Greg