[m-rev.] for review: call MR_fatal_abort when handling strange seg faults
Ian MacLarty
maclarty at cs.mu.OZ.AU
Thu Mar 16 08:41:56 AEDT 2006
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.
Index: runtime/mercury_memory_handlers.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_memory_handlers.c,v
retrieving revision 1.30
diff -u -r1.30 mercury_memory_handlers.c
--- runtime/mercury_memory_handlers.c 15 Dec 2005 10:40:37 -0000 1.30
+++ runtime/mercury_memory_handlers.c 14 Mar 2006 20:08:09 -0000
@@ -407,9 +407,8 @@
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 @@
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);
}
/*
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list