LispWorks: RETURN-FROM doesn't work when invoked form HANDLER-BIND on LispWorks x86, while works on LispWorks x64 and all other Lisp implementations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
common-lisp |
New
|
Undecided
|
Unassigned |
Bug Description
Save the attached lwbug.lisp to disk and then do
(load (compile-file "/path/to/lwbug"))
(lwbug::test (eq-test) (assert (= 2 3)))
This code is expected to return (LWBUG::TEST-RESULT :NAME EQ-TEST :STATUS :FAIL :CAUSE #<SIMPLE-ERROR {89C3AE}>)
but instead it falls into debugger.
This code is extracted from the trivial-
The LWBUG:TEST macro executes the BODY passed to it, wrapping it into HANDLER-BIND. If the body signals a SERIOUS-CONDITION, the HANDLER-BIND prints "FAIL" to console and executes RETURN-FROM. So, due to the RETURN-FROM the condition is handled and debugger should not be entered.
It works as expected on all other lisp implementations and on LispWorks x64
(proof link: see http://
But it fails on lw-6.1.0-win-x86 and lw-6.1.
I investigated the problem on Personal Edition (32 bit version) and reproduced it too.
--------------
This bug was reported to <email address hidden> and registered as id 39739
Reply from LispWorks support:
14.01.2014, 20:46, "Martin Simmons" <email address hidden>: www.lispworks. com/support/
> Hi Anton,
>
> Thanks for the report -- we will fix it.
>
> As a workaround, you could add an extra let like this:
>
> (defun test-impl (name body-fn)
> (flet ((make-result (status &optional cause)
> (list 'test-result :name name :status status :cause cause)))
> (handler-bind ((serious-condition
> (lambda (c)
> (format t "FAIL: ~A~%" c)
> (let ((result (make-result :fail c)))
> (return-from test-impl result)))))
> (format t "Running test ~S... " name)
> (funcall body-fn)
> (format t "OK~%")
> (make-result :ok))))
>
> Regards,
>
> Martin Simmons
> LispWorks Technical Support
> http://
>