Skip to content

Commit 5248b29

Browse files
prevent calling abort while handling the SIGABRT signal
1 parent 6d56882 commit 5248b29

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libasr/runtime/lfortran_intrinsics.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2681,7 +2681,7 @@ void get_local_address_mac(struct Stacktrace *d) {
26812681
printf("The stack address was not found in any shared library or"
26822682
" the main program, the stack is probably corrupted.\n"
26832683
"Aborting...\n");
2684-
abort();
2684+
exit(1);
26852685
}
26862686
#endif // HAVE_LFORTRAN_MACHO
26872687

@@ -2697,7 +2697,7 @@ void get_local_address(struct Stacktrace *d) {
26972697
printf("The stack address was not found in any shared library or"
26982698
" the main program, the stack is probably corrupted.\n"
26992699
"Aborting...\n");
2700-
abort();
2700+
exit(1);
27012701
}
27022702
#else
27032703
#ifdef HAVE_LFORTRAN_MACHO

src/libasr/stacktrace.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void get_local_address(StacktraceItem &item)
139139
// happen if the stacktrace is somehow corrupted. In that case, we simply
140140
// abort here.
141141
std::cout << "The stack address was not found in any shared library or the main program, the stack is probably corrupted. Aborting." << std::endl;
142-
abort();
142+
exit(1);
143143
}
144144
#else
145145
#ifdef HAVE_LFORTRAN_MACHO
@@ -183,7 +183,7 @@ void get_local_address(StacktraceItem &item)
183183
}
184184
}
185185
std::cout << "The stack address was not found in any shared library or the main program, the stack is probably corrupted. Aborting." << std::endl;
186-
abort();
186+
exit(1);
187187
#else
188188
item.local_pc=0;
189189
#endif // HAVE_LFORTRAN_MACHO

0 commit comments

Comments
 (0)