Skip to content

Commit 4c33e2b

Browse files
committed
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 <[email protected]>
1 parent 9737e8f commit 4c33e2b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

opal/util/stacktrace.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* All rights reserved.
1212
* Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
1313
* Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
14+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1415
* $COPYRIGHT$
1516
*
1617
* Additional copyrights may follow
@@ -348,6 +349,14 @@ static void show_stackframe (int signo, siginfo_t * info, void * p)
348349
} else {
349350
write(fileno(stderr), unable_to_print_msg, strlen(unable_to_print_msg));
350351
}
352+
353+
/* Raise the signal again, so we don't accidentally mask critical signals.
354+
* For critical signals, it is preferred that we call 'raise' instead of
355+
* 'exit' or 'abort' so that the return status is set properly for this
356+
* process.
357+
*/
358+
signal(signo, SIG_DFL);
359+
raise(signo);
351360
}
352361

353362
#endif /* OPAL_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__) */

0 commit comments

Comments
 (0)