[mvapich-discuss] [PATCH] check for error in vbuf.c

Ralph Campbell ralph.campbell at qlogic.com
Wed Apr 18 17:45:28 EDT 2007


I was getting a segmentation fault when trying to run
some test programs and I tracked it down to the system
not allowing enough memory to be pinned. This was not
obvious from the program crash and this patch fixes
the problem. This is with mvapich-0.9.8.


--- vbuf.c	2006-06-16 11:51:58.000000000 -0700
+++ vbuf.c.new	2007-04-18 14:18:20.656741000 -0700
@@ -206,6 +206,9 @@ static void allocate_vbuf_region(int nvb
 
     reg->mem_handle = register_memory(vbuf_dma_buffer,
             nvbufs * viadev_vbuf_total_size);
+    if (reg->mem_handle == NULL)
+        error_abort_all(GEN_EXIT_ERR, 
+                "unable to register vbuf DMA buffer");
 
     /* init the free list */
     for (i = 0; i < nvbufs - 1; i++) {




More information about the mvapich-discuss mailing list