From owner-freebsd-bugs Wed Oct 2 17:33:43 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3509637B401 for ; Wed, 2 Oct 2002 17:33:39 -0700 (PDT) Received: from ns.itga.com.au (ns.itga.com.au [202.53.40.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id A20E943E6A for ; Wed, 2 Oct 2002 17:33:38 -0700 (PDT) (envelope-from gnb@itga.com.au) Received: from lightning.itga.com.au (lightning.itga.com.au [192.168.71.20]) by ns.itga.com.au (8.9.3/8.9.3) with ESMTP id KAA60934; Thu, 3 Oct 2002 10:33:36 +1000 (EST) (envelope-from gnb@itga.com.au) Received: from lightning.itga.com.au (localhost [127.0.0.1]) by lightning.itga.com.au (8.9.3/8.9.3) with ESMTP id KAA01121; Thu, 3 Oct 2002 10:33:35 +1000 (EST) Message-Id: <200210030033.KAA01121@lightning.itga.com.au> X-Mailer: exmh version 2.4 05/15/2001 with nmh-1.0.4 From: Gregory Bond To: "Jin Guojun [DSD]" Cc: Garrett Wollman Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: kern/43599: Balloc did not check mallocated pointer in libc/stdlib/strtod.c In-reply-to: Your message of Wed, 02 Oct 2002 16:10:04 -0700. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 03 Oct 2002 10:33:35 +1000 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > "man stdio" does not say this. Is this BSD specific? No, signal handlers have always had very limited capability. IIUC, under the broader ANSI C standards, all they can reliably and portably do is set a variable of type "volatile sig_atomic_t" and return. Most real systems are more forgiving, but not limitless. [One of the real pains in the first ANSI C standardisation process was dealing with the then-common practice of calling longjmp() from a signal handler. There is simply no way to make this work anything like reliably or portably, so it is not required by the standard, even tho many C libraries jump through ugly hoops to try and make it work.] For FreeBSD, signal(3) contains the sentence: See sigaction(2) for a list of functions that are considered safe for use in signal handlers. And sigaction(2) has a list of 40-50 system calls and functions [notably _not_ including any STDIO ones, or longjmp()] and the comment: All functions not in the above lists are considered to be unsafe with respect to signals. That is to say, the behaviour of such functions when called from a signal handler is undefined. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message