Date: Wed, 31 Mar 2004 21:58:56 +0900 (JST) From: JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/64991: malloc(3) crashes with some large parameters Message-ID: <200403311258.i2VCwuqj034068@shuttle.wide.toshiba.co.jp> Resent-Message-ID: <200403311300.i2VD0UpM076183@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 64991
>Category: bin
>Synopsis: malloc(3) crashes with some large parameters
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Mar 31 05:00:30 PST 2004
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403311258.i2VCwuqj034068>
