mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
Instead of just aborting when a "strange" segfault or bus error is
Estimated hours taken: 0.5 Branches: main runtime/mercury_memory_handlers.c: Instead of just aborting when a "strange" segfault or bus error is caught, call MR_fatal_abort which will print a stack dump and display the last trace event in debugging grades. Call MR_fatal_abort instead of MR_fatal_error because the comment above MR_fatal_abort says it is safe to call from signal handlers.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
** vim: ts=4 sw=4 expandtab
|
||||
*/
|
||||
/*
|
||||
** Copyright (C) 1998, 2000, 2002, 2005 The University of Melbourne.
|
||||
** Copyright (C) 1998, 2000, 2002, 2005-2006 The University of Melbourne.
|
||||
** This file may only be copied under the terms of the GNU Library General
|
||||
** Public License - see the file COPYING.LIB in the Mercury distribution.
|
||||
*/
|
||||
@@ -407,9 +407,8 @@ complex_bushandler(int sig, siginfo_t *info, void *context)
|
||||
fflush(stdout);
|
||||
|
||||
if (sig != SIGBUS || !info || info->si_signo != SIGBUS) {
|
||||
fprintf(stderr, "\n*** Mercury runtime: ");
|
||||
fprintf(stderr, "caught strange bus error ***\n");
|
||||
exit(1);
|
||||
MR_fatal_abort(context, "\n*** Mercury runtime: "
|
||||
"caught strange bus error ***\n", 1);
|
||||
}
|
||||
|
||||
fprintf(stderr, "\n*** Mercury runtime: ");
|
||||
@@ -523,9 +522,8 @@ static void
|
||||
complex_segvhandler(int sig, siginfo_t *info, void *context)
|
||||
{
|
||||
if (sig != SIGSEGV || !info || info->si_signo != SIGSEGV) {
|
||||
fprintf(stderr, "\n*** Mercury runtime: ");
|
||||
fprintf(stderr, "caught strange segmentation violation ***\n");
|
||||
exit(1);
|
||||
MR_fatal_abort(context, "\n*** Mercury runtime: "
|
||||
"caught strange segmentation violation ***\n", 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user