From owner-freebsd-current@FreeBSD.ORG Thu Feb 19 09:43:34 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1670C16A4CE for ; Thu, 19 Feb 2004 09:43:34 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FA4743D2F for ; Thu, 19 Feb 2004 09:43:33 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id i1JHhObq001979; Thu, 19 Feb 2004 18:43:24 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: kientzle@acm.org From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 19 Feb 2004 08:45:00 PST." <4034E80C.5060505@kientzle.com> Date: Thu, 19 Feb 2004 18:43:24 +0100 Message-ID: <1978.1077212604@critter.freebsd.dk> cc: current@freebsd.org Subject: Re: standard error handling for malloc() broken for user root and group wheel X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2004 17:43:34 -0000 In message <4034E80C.5060505@kientzle.com>, Tim Kientzle writes: >Poul-Henning Kamp wrote: >> In message <4034700C.9090107@kientzle.com>, Tim Kientzle writes: >> >>>Aborting the program >>>on a failure to allocate memory is pretty clearly a violation >>>of the standard, which requires the malloc function to >>>always return. >> >> There is neither requirements nor guarantees how any function in >> the ansi/iso regime reacts if you grossly violate the API or stomp >> on random memory. > >If malloc's internal data structures are corrupted, I >completely agree that a prompt abort is appropriate. > >My concern is that the current 'A' flag aborts on a failure >to allocate, which is not a "gross violation" of the API. Right, it's my mistake that this was still there, it should have been removed a couple of years ago. It is removed in the patch I posted earlier. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.