From 759b993e144f2fb55b2e8787b4d7fdff0f46a299 Mon Sep 17 00:00:00 2001 From: Vipul-Cariappa Date: Mon, 25 Mar 2024 11:17:09 +0530 Subject: [PATCH] prevent calling `abort` while handling the `SIGABRT` signal --- src/libasr/runtime/lfortran_intrinsics.c | 4 ++-- src/libasr/stacktrace.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libasr/runtime/lfortran_intrinsics.c b/src/libasr/runtime/lfortran_intrinsics.c index 1381e97022..36bbbcb683 100644 --- a/src/libasr/runtime/lfortran_intrinsics.c +++ b/src/libasr/runtime/lfortran_intrinsics.c @@ -3299,7 +3299,7 @@ void get_local_address_mac(struct Stacktrace *d) { printf("The stack address was not found in any shared library or" " the main program, the stack is probably corrupted.\n" "Aborting...\n"); - abort(); + exit(1); } #endif // HAVE_LFORTRAN_MACHO @@ -3315,7 +3315,7 @@ void get_local_address(struct Stacktrace *d) { printf("The stack address was not found in any shared library or" " the main program, the stack is probably corrupted.\n" "Aborting...\n"); - abort(); + exit(1); } #else #ifdef HAVE_LFORTRAN_MACHO diff --git a/src/libasr/stacktrace.cpp b/src/libasr/stacktrace.cpp index d5cab7445d..4e3b4bbee9 100644 --- a/src/libasr/stacktrace.cpp +++ b/src/libasr/stacktrace.cpp @@ -135,7 +135,7 @@ void get_local_address(StacktraceItem &item) // happen if the stacktrace is somehow corrupted. In that case, we simply // abort here. std::cout << "The stack address was not found in any shared library or the main program, the stack is probably corrupted. Aborting." << std::endl; - abort(); + exit(1); } #else #ifdef HAVE_LFORTRAN_MACHO @@ -179,7 +179,7 @@ void get_local_address(StacktraceItem &item) } } std::cout << "The stack address was not found in any shared library or the main program, the stack is probably corrupted. Aborting." << std::endl; - abort(); + exit(1); #else item.local_pc=0; #endif // HAVE_LFORTRAN_MACHO