From 4c33e2b341ab3ae3acbbb73bd4cf32713881782b Mon Sep 17 00:00:00 2001 From: Joshua Hursey Date: Thu, 19 Jan 2017 10:15:04 -0500 Subject: [PATCH] opal/stacktace: Raise the signal after processing - This prevents us for accidentally masking a signal that was meant to terminate the application. Signed-off-by: Joshua Hursey --- opal/util/stacktrace.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/opal/util/stacktrace.c b/opal/util/stacktrace.c index 3d202d7747a..b5be66e1cb6 100644 --- a/opal/util/stacktrace.c +++ b/opal/util/stacktrace.c @@ -11,6 +11,7 @@ * All rights reserved. * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -348,6 +349,14 @@ static void show_stackframe (int signo, siginfo_t * info, void * p) } else { write(fileno(stderr), unable_to_print_msg, strlen(unable_to_print_msg)); } + + /* Raise the signal again, so we don't accidentally mask critical signals. + * For critical signals, it is preferred that we call 'raise' instead of + * 'exit' or 'abort' so that the return status is set properly for this + * process. + */ + signal(signo, SIG_DFL); + raise(signo); } #endif /* OPAL_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__) */