Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2001 15:33:49 +0900 (JST)
From:      Shingo Nishioka <nis@pc3.geta.hatoyama.hitachi.co.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   i386/25603: mmap + fork = panic: vm_object_deallocate: object deallocated too may times: 0
Message-ID:  <200103080633.f286XnB02074@pc3.geta.hatoyama.hitachi.co.jp>

next in thread | raw e-mail | index | archive | help

>Number:         25603
>Category:       i386
>Synopsis:       mmap + fork = panic: vm_object_deallocate: object deallocated too may times: 0
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 07 22:40:05 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Shingo Nishioka
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
CRL, Hitachi, Ltd.
>Environment:

	FreeBSD 4.2-RELEASE (GENERIC) #0: Mon Nov 20 13:02:55 GMT 2000

>Description:

	The code blow causes a "panic: vm_object_deallocate: object deallocated too may times: 0"

>How-To-Repeat:

Compile and run the following code.

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

main()
{
	char *path = "foo.c";
	int d;
	struct stat sb;
	void *p;
	size_t len;

	if ((d = open(path, O_RDONLY))==-1) {
		perror(path);
		return 1;
	}

	if (fstat(d, &sb)==-1) {
		perror(path);
		return 1;
	}

	len = sb.st_size;
	if ((p = mmap(0, len, PROT_READ, MAP_INHERIT, d, 0))==MAP_FAILED) {
		perror("mmap");
		return 1;
	}

	fork();

	return 0;
}

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103080633.f286XnB02074>