From jinmei@shuttle.wide.toshiba.co.jp  Wed Mar 31 04:58:58 2004
Return-Path: <jinmei@shuttle.wide.toshiba.co.jp>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B334B16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 31 Mar 2004 04:58:58 -0800 (PST)
Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [202.249.10.124])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4DCC943D49
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 31 Mar 2004 04:58:58 -0800 (PST)
	(envelope-from jinmei@shuttle.wide.toshiba.co.jp)
Received: from shuttle.wide.toshiba.co.jp (localhost [::1])
	by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id 7417315218
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 31 Mar 2004 21:58:56 +0900 (JST)
Received: (from jinmei@localhost)
	by shuttle.wide.toshiba.co.jp (8.12.8p1/8.12.6/Submit) id i2VCwuqj034068;
	Wed, 31 Mar 2004 21:58:56 +0900 (JST)
Message-Id: <200403311258.i2VCwuqj034068@shuttle.wide.toshiba.co.jp>
Date: Wed, 31 Mar 2004 21:58:56 +0900 (JST)
From: JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
Reply-To: JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: malloc(3) crashes with some large parameters
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         64991
>Category:       bin
>Synopsis:       malloc(3) crashes with some large parameters
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    phk
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 31 05:00:30 PST 2004
>Closed-Date:    Fri Jun 18 09:50:02 GMT 2004
>Last-Modified:  Fri Jun 18 09:50:02 GMT 2004
>Originator:     JINMEI Tatuya
>Release:        FreeBSD 4.9-RELEASE i386
>Organization:
the KAME Project
>Environment:
System: FreeBSD ocean.jinmei.org 4.9-RELEASE FreeBSD 4.9-RELEASE #22: Wed Mar 10 21:19:49 JST 2004 jinmei@ocean.jinmei.org:/home/jinmei/src/kame/kame/freebsd4/sys/compile/SS2010_SCTP i386

Toshiba Portege 2000
FreeBSD 4.9 (with some recent KAME snaps, which should not matter though)

>Description:

malloc(3) dumps core for large size parameters around 0xffff0000.


>How-To-Repeat:

Compile the following code and execute it.  Then something similar to the
following should happen:
% ./foo
malloc: Cannot allocate memory
zsh: 2153 segmentation fault (core dumped)  ./foo

#include <sys/types.h>
#include <sys/param.h>

#include <stdio.h>
#include <stdlib.h>

main()
{
	char *p;

	p = (char *)malloc(0x8fff0000);
	if (p == NULL)
		perror("malloc");
	else
		free(p);

	p = (char *)malloc(0xffff0000);
	if (p == NULL)
		perror("malloc");

	exit(0);
}

>Fix:

I don't have one.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->phk 
Responsible-Changed-By: kris 
Responsible-Changed-When: Wed Mar 31 17:46:27 PST 2004 
Responsible-Changed-Why:  
Assign to malloc author 

http://www.freebsd.org/cgi/query-pr.cgi?pr=64991 

From: Munechika Sumikawa <sumikawa@ebina.hitachi.co.jp>
To: freebsd-gnats-submit@freebsd.org
Cc: sumikawa@ebina.hitachi.co.jp
Subject: Re: bin/64991: malloc(3) crashes with some large parameters
Date: Thu, 01 Apr 2004 14:40:57 +0100 (BST)

 Note that 5-CURRENT is not affected.  4-STABLE is affected.
 
 -- Sumikawa
State-Changed-From-To: open->suspended 
State-Changed-By: phk 
State-Changed-When: Fri Jun 18 08:50:15 GMT 2004 
State-Changed-Why:  
I'm not active in releng_4 any more, sorry. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=64991 
State-Changed-From-To: suspended->closed 
State-Changed-By: phk 
State-Changed-When: Fri Jun 18 09:49:18 GMT 2004 
State-Changed-Why:  
OK, I'm out of date:  originator says it was fixed in 1.49.2.5. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=64991 
>Unformatted:
