From 3ad133e59f34948ba38013d8de1e9122f2729805 Mon Sep 17 00:00:00 2001 From: Alastair Bridgewater Date: Tue, 7 May 2013 21:46:43 -0400 Subject: [PATCH] code/interr: Hook internal error contexts into the saved-fp-and-pc mechanism. * This covers the unfortunate case of a signal handler not having an unbroken stack frame chain to the interrupted context, which actually occurs on threaded x86-64 FreeBSD systems. * Use the existing saved-fp-and-pc mechanism, used for ALIEN-FUNCALL to cover for code compiled -fomit-frame-pointer to treat the internal error context as an alien funcall point. --- src/code/interr.lisp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/code/interr.lisp b/src/code/interr.lisp index 3e8f95f..b870da5 100644 --- a/src/code/interr.lisp +++ b/src/code/interr.lisp @@ -421,9 +421,18 @@ (/hexstr context) (infinite-error-protect (/show0 "about to bind ALIEN-CONTEXT") - (let ((alien-context (locally - (declare (optimize (inhibit-warnings 3))) - (sb!alien:sap-alien context (* os-context-t))))) + (let* ((alien-context (locally + (declare (optimize (inhibit-warnings 3))) + (sb!alien:sap-alien context (* os-context-t)))) + #!+c-stack-is-control-stack + (*saved-fp-and-pcs* + (cons (cons (%make-lisp-obj (sb!vm:context-register + alien-context + sb!vm::cfp-offset)) + (sb!vm:context-pc alien-context)) + (when (boundp '*saved-fp-and-pcs*) + *saved-fp-and-pcs*)))) + (declare (truly-dynamic-extent *saved-fp-and-pcs*)) (/show0 "about to bind ERROR-NUMBER and ARGUMENTS") (multiple-value-bind (error-number arguments) (sb!vm:internal-error-args alien-context) -- 1.7.10.4