From 53b5803a76cde1d9809b98c11bba0a6de7f64f6e Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Wed, 20 Jun 2007 18:11:57 +0000 Subject: [PATCH] 1.0.6.58: better heap exhaustion information * Print states of *GC-PENDING*, *GC-INHIBIT*, and *SIG-STOP-FOR-GC-PENDING* for fatal heap exhaustions. * Use alloc_number instead of make_fixnum for requested/available. --- src/runtime/gencgc.c | 17 +++++++++++++---- version.lisp-expr | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 92df103..9aa2a3f 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -1071,9 +1071,9 @@ void gc_heap_exhausted_error_or_lose (long available, long requested) { /* Write basic information before doing anything else: if we don't - * call to lisp this is a must, and even if we do there is always the - * danger that we bounce back here before the error has been handled, - * or indeed even printed. + * call to lisp this is a must, and even if we do there is always + * the danger that we bounce back here before the error has been + * handled, or indeed even printed. */ fprintf(stderr, "Heap exhausted during %s: %ld bytes available, %ld requested.\n", gc_active_p ? "garbage collection" : "allocation", available, requested); @@ -1081,14 +1081,23 @@ gc_heap_exhausted_error_or_lose (long available, long requested) /* If we are in GC, or totally out of memory there is no way * to sanely transfer control to the lisp-side of things. */ + struct thread *thread = arch_os_get_current_thread(); print_generation_stats(1); + fprintf(stderr, "GC control variables:\n"); + fprintf(stderr, " *GC-INHIBIT* = %s\n *GC-PENDING* = %s\n", + SymbolValue(GC_INHIBIT,thread)==NIL ? "false" : "true", + SymbolValue(GC_PENDING,thread)==NIL ? "false" : "true"); +#ifdef LISP_FEATURE_SB_THREAD + fprintf(stderr, " *STOP-FOR-GC-PENDING* = %s\n", + SymbolValue(STOP_FOR_GC_PENDING,thread)==NIL ? "false" : "true"); +#endif lose("Heap exhausted, game over."); } else { /* FIXME: assert free_pages_lock held */ thread_mutex_unlock(&free_pages_lock); funcall2(SymbolFunction(HEAP_EXHAUSTED_ERROR), - make_fixnum(available), make_fixnum(requested)); + alloc_number(available), alloc_number(requested)); lose("HEAP-EXHAUSTED-ERROR fell through"); } } diff --git a/version.lisp-expr b/version.lisp-expr index c0a6c33..62ce26f 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.6.57" +"1.0.6.58" -- 1.7.10.4