Here was a solution I used.
What I did in my local copy of ABCL, was instead of Keeping a dictionary of javaThread->LisptThread, I made LispThread implement UncaughtExcetionHandler interface.
public void uncaughtException(Thread arg0, Throwable arg1) { try { error(new LispError(getMessage(arg1))); } catch (Throwable e) { e.printStackTrace(); throw new RuntimeException(arg1); }
}
And used (LispThread)somejavaThread.getUncaughtExcetionHandler(); to retreive the LispThread
This also catches the wild GOs
----- Original Message ----- From: "Mark Evenson" evenson@panix.com To: armedbear-devel@common-lisp.net Sent: Monday, September 21, 2009 4:58 AM Subject: Re: [armedbear-devel] [FIXED?] Bug: Attempt to GO to a tag whose extent has ended quits ABCL
On 9/20/09 1:16 PM, Tobias C. Rittweiler wrote:
Mark Evensonevenson@panix.com writes:
On 9/18/09 1:36 PM, Mark Evenson wrote:
Filed as [bug ticket #63][63]. Thanks for the report.
This is not enough. You also have to add a catch to LispThread.
(threads:make-thread #'(lambda () (let ((f nil)) (tagbody (setf f (lambda () (go foo))) foo) (funcall f))) :name "foof")
Unfortunately this doesn't seem to be easy to do in clean manner.
As far as I got to investigate, there is no single place in which to make the catch, as we seemingly have multiple code paths for executing forms that fail to share common handler code. For your new test case of making the error appear in a MAKE-THREAD, the handler is actually created within the LispThread(Function, LispThread) constructor, which shares no common code with the place I patched the INTERACTIVE-EVAL handler in Lisp.java. And neither of these share code with the top level eval that can be created by invoking Interpreter.eval(String).
Out of time for today, but others please chime in to correct/enhance my understanding.
-- "A screaming comes across the sky. It has happened before, but there is nothing to compare to it now."
armedbear-devel mailing list armedbear-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel