DragonFly bugs List (threaded) for 2009-04
DragonFly BSD
DragonFly bugs List (threaded) for 2009-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

[issue1343] panic: vm_map_entry_link, dup addr map


From: "Alex Hornung \(via DragonFly issue tracker\)" <sinknull@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Apr 2009 07:44:22 +0000

New submission from Alex Hornung <ahornung@gmail.com>:

The attached test program, when ran with a high argument (100000 or more) causes
this panic.

(gdb) bt
#0  Debugger (msg=0xc056c357 "panic") at ../../platform/pc32/i386/db_interface.c:335
#1  0xc02f455a in panic (fmt=0xc05b8ea8 "vm_map_entry_link: dup addr map %p ent
%p") at ../../kern/kern_shutdown.c:798
#2  0xc04870c0 in _vm_map_clip_end (map=0xc204a1d0, entry=0xd36e6bc0, end=4096,
countp=0xd2baba6c) at ../../vm/vm_map.c:695
#3  0xc0487f57 in vm_map_stack (map=0xc204a1d0, addrbos=4294049792,
max_ssize=1052672, prot=7 '\a', max=7 '\a', cow=0) at ../../vm/vm_map.c:3064
#4  0xc0489bda in vm_mmap (map=0xc204a1d0, addr=0xd2babc88, size=1052672, prot=7
'\a', maxprot=7 '\a', flags=<value optimized out>, handle=0x0, foff=0) at
. ./../vm/vm_mmap.c:1106
#5  0xc048a231 in kern_mmap (vms=0xc204a1d0, uaddr=0xfff20000<error reading
variable>, ulen=1052672, uprot=<value optimized out>, uflags=1024, fd=-1,
upos=0, res=0xd2babcf0)
    at ../../vm/vm_mmap.c:404
#6  0xc048a2aa in sys_mmap (uap=0xd2babcf0) at ../../vm/vm_mmap.c:419
#7  0xc05036f1 in syscall2 (frame=0xd2babd40) at
. ./../platform/pc32/i386/trap.c:1357
#8  0xc04f2aa6 in Xint0x80_syscall () at ../../platform/pc32/i386/exception. s:876
#9  0xd2babd40 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

----------
files: readdir.c
keyword: kernel
messages: 6443
nosy: alexh
priority: bug
status: unread
title: panic: vm_map_entry_link, dup addr map

_____________________________________________________
DragonFly issue tracker <bugs@lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue1343>
_____________________________________________________
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>

pthread_barrier_t bar;


void* tester(void *arg)
{
	struct dirent *en;
	DIR *d = opendir("/");

	pthread_barrier_wait(&bar);

	while ( (en = readdir(d)) != NULL )
	{
		if (errno != 0)
		{
			perror("thread tester error: ");
			exit(1);
		}
	}

	if (!en)
	{
		perror("thread tester error: ");
		exit(1);
	}
	
}

void* checker(void *arg)
{
	pthread_barrier_wait(&bar);
	printf("Passed barrier!\n");
}


int main(int argc, char *argv[])
{
	int i, ret, nthreads;
	pthread_t th;

	if (argc <= 1)
	{
		printf("Need one argument\n");
		exit(1);
	}

	nthreads = atoi(argv[1]);
	
	printf("Trying with %d threads\n", nthreads);	

	if ( (ret = pthread_barrier_init(&bar, NULL, nthreads)) != 0)
	{
		printf("error occured during pthread_barrier_init, ret = %d\n", ret);
		perror("Or: ");
		exit(1);
	}

	printf("Creating checker thread\n");
	pthread_create(&th, NULL, checker, NULL);

	printf("Creating tester threads\n");


	for (i = 0; i < nthreads; i++)
		pthread_create(&th, NULL, tester, NULL);

	for (;;)
	{
		sleep(1000);
	}

	return 0;
}


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]