[PATCH 1/1] handle SIGABRT similar to SIGSEGV

Jiri Slaby <[email protected]>
Newsgroups org.kernel.vger.trinity
Message-ID <[email protected]>
Sometimes, glibc aborts when some assertion is not met. In that case,
we want to have a coredump, so do not ignore that signal when
debugging is enabled.
---
 child.c   | 1 +
 signals.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/child.c b/child.c
index 74c72e124a86..8351d8eb6706 100644
--- a/child.c
+++ b/child.c
@@ -35,6 +35,7 @@ static void disable_coredumps(void)
 	struct rlimit limit;
 
 	if (debug == TRUE) {
+		(void)signal(SIGABRT, SIG_DFL);
 		(void)signal(SIGSEGV, SIG_DFL);
 		return;
 	}
diff --git a/signals.c b/signals.c
index 94c690bc6ffc..a6cac95aa2ba 100644
--- a/signals.c
+++ b/signals.c
@@ -82,8 +82,10 @@ void mask_signals_child(void)
 		(void)signal(i, SIG_IGN);
 
 	/* If we are in debug mode, we want segfaults and core dumps */
-	if (debug == TRUE)
+	if (debug == TRUE) {
+		(void)signal(SIGABRT, SIG_DFL);
 		(void)signal(SIGSEGV, SIG_DFL);
+	}
 
 	/* trap ctrl-c */
 	(void)signal(SIGINT, ctrlc_handler);
-- 
1.8.5.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.