trouble generating a core file

Matthew Dillon dillon at apollo.backplane.com
Mon May 9 13:37:34 PDT 2005


: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);
 	}
 }
 





More information about the Bugs mailing list