>From 8568625c7d2d32aa772f28c5c95ce4b083d0a5bb Mon Sep 17 00:00:00 2001
From: Rob Latham <robl@mcs.anl.gov>
Date: Thu, 7 May 2015 13:53:39 -0500
Subject: [PATCH 2/2] avoid segfault when calling built-in error handler

we were not correctly handling the case where the error handler
MPI_ERRORS_ARE_FATAL was called.  credit Lisandro Dalcin with finidng
the issue.
---
 src/mpi/errhan/file_call_errhandler.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mpi/errhan/file_call_errhandler.c b/src/mpi/errhan/file_call_errhandler.c
index 7856e0ce..fa965dee 100644
--- a/src/mpi/errhan/file_call_errhandler.c
+++ b/src/mpi/errhan/file_call_errhandler.c
@@ -98,6 +98,11 @@ int MPI_File_call_errhandler(MPI_File fh, int errorcode)
 	goto fn_exit;
     }
 
+    if (e->handle == MPI_ERRORS_ARE_FATAL) {
+	MPIR_Err_return_comm(NULL, "MPI_File_call_errhandler", errorcode);
+    }
+
+
 
     switch (e->language) {
     case MPID_LANG_C:
-- 
1.9.1

