From owner-freebsd-current@FreeBSD.ORG Thu Dec 2 10:55:07 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 1F05316A4CE; Thu, 2 Dec 2004 10:55:07 +0000 (GMT) Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [202.249.10.124]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCD0143D39; Thu, 2 Dec 2004 10:55:06 +0000 (GMT) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from ocean.jinmei.org (unknown [2001:200:0:8002:200:39ff:fed7:e2e4]) by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id AE6AE15210; Thu, 2 Dec 2004 19:55:05 +0900 (JST) Date: Thu, 02 Dec 2004 19:55:15 +0900 Message-ID: From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= To: Andre Oppermann In-Reply-To: <41AEF204.2070402@freebsd.org> References: <41AEF204.2070402@freebsd.org> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) Emacs/21.3 Mule/5.0 (SAKAKI) Organization: Research & Development Center, Toshiba Corp., Kawasaki, Japan. MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII cc: current@FreeBSD.org Subject: Re: malloc(0) returns an invalid address 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, 02 Dec 2004 10:55:07 -0000 >>>>> On Thu, 02 Dec 2004 11:44:20 +0100, >>>>> Andre Oppermann said: >> I expected the answer:-) This is probably a matter of the definition >> of "validness", and I won't argue about this point. (and, of course, >> it cannot be justified to dereference a zero-length pointer, whether >> the result is segfault or not) >> >> BTW: the "same problem" (of segfault) does actually NOT occur with >> malloc(1) and int * on FreeBSD 5.3 (i386). I suspect malloc(3) takes >> a special action with the size of zero. > man malloc(3) and look for options 'V' and 'X'. I've already done this, and, sorry, this is irrelevant to this problem. JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp