(print-unreadable-object (condition stream))))))
(define-condition memory-fault-error (error)
- ()
+ ((address :initarg :address :reader memory-fault-error-address))
(:report
(lambda (condition stream)
- (declare (ignore condition))
- (format stream "memory fault"))))
-
+ (format stream "Memory fault in address #x~X" (memory-fault-error-address condition)))))
(defun undefined-alien-function-error ()
(error 'undefined-alien-function-error))
+(define-alien-variable current-memory-fault-address long)
+
(defun memory-fault-error ()
- (error 'memory-fault-error))
+ (error 'memory-fault-error
+ :address current-memory-fault-address))
if (!gencgc_handle_wp_violation(fault_addr))
if(!handle_guard_page_triggered(context,fault_addr)) {
#ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
- arrange_return_to_lisp_function(context, SymbolFunction(MEMORY_FAULT_ERROR));
+ lisp_memory_fault_error(context, fault_addr);
#else
if (!interrupt_maybe_gc_int(signal, siginfo, context)) {
interrupt_handle_now(signal, siginfo, context);
{
return info->si_code;
}
+os_vm_address_t current_memory_fault_address;
+
+void
+lisp_memory_fault_error(os_context_t *context, os_vm_address_t addr)
+{
+ /* FIXME: This is lossy: if we get another memory fault (eg. from
+ * another thread) before lisp has read this, we the information.
+ * However, since this is mostly informative, we'll live with that for
+ * now -- some address is better then no address in this case.
+ */
+ current_memory_fault_address = addr;
+ arrange_return_to_lisp_function(context, SymbolFunction(MEMORY_FAULT_ERROR));
+}
#endif
#endif
if (!handle_guard_page_triggered(context, addr))
#ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
- arrange_return_to_lisp_function(context, SymbolFunction(MEMORY_FAULT_ERROR));
+ lisp_memory_fault_error(context, addr);
#else
interrupt_handle_now(signal, info, context);
#endif
if (!gencgc_handle_wp_violation(fault_addr))
if(!handle_guard_page_triggered(context, fault_addr))
#ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
- arrange_return_to_lisp_function(context,
- SymbolFunction(MEMORY_FAULT_ERROR));
+ lisp_memory_fault_error(context, fault_addr);
#else
interrupt_handle_now(signal, info, context);
#endif
;;; 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.0.19"
+"1.0.0.20"