LispWorks: RETURN-FROM doesn't work when invoked form HANDLER-BIND on LispWorks x86, while works on LispWorks x64 and all other Lisp implementations

Bug #1268779 reported by Anton Vodonosov
6
This bug affects 1 person
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-gray-streams project test suite.
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://common-lisp.net/project/cl-test-grid/library/trivial-gray-streams.html for test results of trivial-gray-streams).

But it fails on lw-6.1.0-win-x86 and lw-6.1.1-macosx-x86.
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

Tags: lispworks
Revision history for this message
Anton Vodonosov (avodonosov) wrote :
description: updated
Revision history for this message
Anton Vodonosov (avodonosov) wrote :

Reply from LispWorks support:

14.01.2014, 20:46, "Martin Simmons" <email address hidden>:
> 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://www.lispworks.com/support/
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.