From 7155ac935ea4c5cd9bc00cb1382649abdc776f4c Mon Sep 17 00:00:00 2001 From: Clément Pit--Claudel Date: Tue, 17 Nov 2015 23:25:23 -0500 Subject: recompilation: Improve error checking Bug recipe: * Process some imports * Enable on the fly compilation * Kill coq process Error: Debugger entered--Lisp error: (wrong-type-argument hash-table-p nil) maphash((lambda (ancestor state) (if (eq state (quote locked)) (progn (coq-unlock-ancestor ancestor) (puthash ancestor nil coq-par-ancestor-files)))) nil) (progn (maphash (function (lambda (ancestor state) (if (eq state (quote locked)) (progn (coq-unlock-ancestor ancestor) (puthash ancestor nil coq-par-ancestor-files))))) coq-par-ancestor-files)) (if (or t coq-par-ancestor-files) (progn (maphash (function (lambda (ancestor state) (if (eq state (quote locked)) (progn (coq-unlock-ancestor ancestor) (puthash ancestor nil coq-par-ancestor-files))))) coq-par-ancestor-files))) coq-par-unlock-ancestors-on-error() coq-par-emergency-cleanup() run-hooks(proof-shell-signal-interrupt-hook) proof-shell-kill-function() kill-buffer(#) proof-shell-exit(nil) funcall-interactively(proof-shell-exit nil) #(proof-shell-exit nil nil) ad-Advice-call-interactively(# proof-shell-exit nil nil) apply(ad-Advice-call-interactively # (proof-shell-exit nil nil)) call-interactively(proof-shell-exit nil nil) command-execute(proof-shell-exit) --- coq/coq-par-compile.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/coq/coq-par-compile.el b/coq/coq-par-compile.el index 915fe3ed..f469b4df 100644 --- a/coq/coq-par-compile.el +++ b/coq/coq-par-compile.el @@ -612,12 +612,14 @@ function returns () if MODULE-ID comes from the standard library." (defun coq-par-unlock-ancestors-on-error () "Unlock ancestors which are not in an asserted span. Used for unlocking ancestors on compilation errors." - (maphash - (lambda (ancestor state) - (when (eq state 'locked) - (coq-unlock-ancestor ancestor) - (puthash ancestor nil coq-par-ancestor-files))) - coq-par-ancestor-files)) + (when coq-par-ancestor-files + ;; nil e.g. when enabling on-the-fly compilation after processing imports. + (maphash + (lambda (ancestor state) + (when (eq state 'locked) + (coq-unlock-ancestor ancestor) + (puthash ancestor nil coq-par-ancestor-files))) + coq-par-ancestor-files))) (defun coq-par-emergency-cleanup () "Emergency cleanup for parallel background compilation. -- cgit v1.2.3