Skip to content

Commit 759b993

Browse files
Vipul-Cariappaubaidsk
authored andcommitted
prevent calling abort while handling the SIGABRT signal
1 parent eaf402c commit 759b993

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
@@ -3299,7 +3299,7 @@ void get_local_address_mac(struct Stacktrace *d) {
32993299
printf("The stack address was not found in any shared library or"
33003300
" the main program, the stack is probably corrupted.\n"
33013301
"Aborting...\n");
3302-
abort();
3302+
exit(1);
33033303
}
33043304
#endif // HAVE_LFORTRAN_MACHO
33053305

@@ -3315,7 +3315,7 @@ void get_local_address(struct Stacktrace *d) {
33153315
printf("The stack address was not found in any shared library or"
33163316
" the main program, the stack is probably corrupted.\n"
33173317
"Aborting...\n");
3318-
abort();
3318+
exit(1);
33193319
}
33203320
#else
33213321
#ifdef HAVE_LFORTRAN_MACHO

src/libasr/stacktrace.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void get_local_address(StacktraceItem &item)
135135
// happen if the stacktrace is somehow corrupted. In that case, we simply
136136
// abort here.
137137
std::cout << "The stack address was not found in any shared library or the main program, the stack is probably corrupted. Aborting." << std::endl;
138-
abort();
138+
exit(1);
139139
}
140140
#else
141141
#ifdef HAVE_LFORTRAN_MACHO
@@ -179,7 +179,7 @@ void get_local_address(StacktraceItem &item)
179179
}
180180
}
181181
std::cout << "The stack address was not found in any shared library or the main program, the stack is probably corrupted. Aborting." << std::endl;
182-
abort();
182+
exit(1);
183183
#else
184184
item.local_pc=0;
185185
#endif // HAVE_LFORTRAN_MACHO

0 commit comments

Comments
 (0)