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

Re: trouble generating a core file


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 9 May 2005 13:37:07 -0700 (PDT)

:Below is what came out on comconsole including the output from 'trace'.
:Note that the svd_* entries are from our loadable driver which you can
:find at http://www.tuffli.net/svd.c and http://www.tuffli.net/svd.h
:The application making calls to our driver is essentially allocating
:dmamem buffers until an allocation fails in order to test error
:handling within the application. Also note that this dump is from a
:different machine that is running 1.2.1-RELEASE, but the failure is
:identical.
:
:...

    It looks like the vm_contig_pg_kmap() call failed and it paniced
    trying to free the page list.

    generally speaking a kmap will only fail if the kernel has run out
    of KVM, which means that it is likely a memory leak in the driver
    (e.g. it could be missing some busdma calls or might not be freeing
    busdma'd memory properly).

    This patch should fix the panic, but it is likely something else
    will go poof due to the memory leak.

						-Matt

Index: vm/vm_contig.c
===================================================================
RCS file: /cvs/src/sys/vm/vm_contig.c,v
retrieving revision 1.13
diff -u -r1.13 vm_contig.c
--- vm/vm_contig.c	22 Feb 2005 21:35:33 -0000	1.13
+++ vm/vm_contig.c	9 May 2005 20:36:04 -0000
@@ -364,6 +364,7 @@
 vm_contig_pg_free(int start, u_long size)
 {
 	vm_page_t pga = vm_page_array;
+	vm_page_t m;
 	int i;
 	
 	size = round_page(size);
@@ -371,7 +372,9 @@
 		panic("vm_contig_pg_free: size must not be 0");
 
 	for (i = start; i < (start + size / PAGE_SIZE); i++) {
-		vm_page_free(&pga[i]);
+		m = &pga[i];
+		vm_page_busy(m);
+		vm_page_free(m);
 	}
 }
 



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