|
From: SourceForge.net <no...@so...> - 2005-06-20 16:57:06
|
Bugs item #1220548, was opened at 2005-06-14 18:36 Message generated for change (Comment added) made by hoehle You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1220548&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jörg Höhle (hoehle) Assigned to: Nobody/Anonymous (nobody) Summary: unwind-protect confuses abort restart Initial Comment: Hi, I mentioned that in clisp-devel around October 2004 ["confused debugger, aborts to outer break level -- repeatable"], but did not submit a bug report. The bug is still in clisp-cvs. When there's an unwind-protect frame somewhere on the stack, restarts may get confused. As a result, Lisp sessions get mixed up (e.g. today it affected my SLIME session). I originally noticed this with cl-sql, which uses with-foreign-string, which does the same as unwind-protect. [17]> (unwind-protect (error "hi") (print "out")) *** - hi Mögliche Optionen: ABORT :R1 ABORT Break 1 [18]> (unwind-protect (error "hi") (print "out")) *** - hi Mögliche Optionen: ABORT :R1 ABORT ABORT :R2 ABORT Break 2 [19]> abort "out" "out" [20]> Failed Expectation: get out only one level. The :r1 restart does this correctly. In contrast, using the :r1 restarts gets out only one level, as expected. This also happens using the interpreted memory image. Regards, Jörg Höhle ---------------------------------------------------------------------- >Comment By: Jörg Höhle (hoehle) Date: 2005-06-20 18:56 Message: Logged In: YES user_id=377168 I had hoped my examples demonstrate that a restart named ABORT behaves differently than other names, for no apparent reason. This is very confusing to users, causing trouble in the REPL which even lead to CLISP quitting a SLIME session (and exiting). Please explain "closest to your stack frame": while navigating the stack with up and down commands, I did not observe that the restarts would vary according to the current position. Furthermore, repeating the exercise with 3 times (unwind-protect (error "hi")(print "uh")) shows that it's the outermost ABORT restart (it's not even skipping one to the second) that's choosen! I.e. CLISP seems to choose the last restart, not the first one (while other names lead to the expected behaviour). ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2005-06-14 22:53 Message: Logged In: YES user_id=5735 when there are several identically named restarts available, one should use the ":R*" command to ensure the right one. if you use the restart name, the first (closest to your current frame) restart is invoked, and it may take you up the stack beyond your other restarts with the same name. see condition.lisp (*active-restarts* &c) ---------------------------------------------------------------------- Comment By: Jörg Höhle (hoehle) Date: 2005-06-14 18:52 Message: Logged In: YES user_id=377168 It seems like the topmost 'abort restart is sometimes skipped, as the following shows: [60]> (with-simple-restart (foo "my foo restart") (print(break))) 1. Trace: (SYSTEM::BREAK-LOOP 'NIL '#<SIMPLE-CONDITION #x2042A01E> 'T) ** - Continuable Error Break Wenn Sie (mit Continue) fortfahren: BREAK-Schleife beenden. Weitere mögliche Optionen: FOO :R1 my foo restart ABORT :R2 ABORT Break 1 [61]> (with-simple-restart (abort "my foo restart") (print(break))) 2. Trace: (SYSTEM::BREAK-LOOP 'NIL '#<SIMPLE-CONDITION #x2042EE46> 'T) ** - Continuable Error Break Wenn Sie (mit Continue) fortfahren: BREAK-Schleife beenden. Weitere mögliche Optionen: ABORT :R1 my foo restart ABORT :R2 ABORT FOO :R3 my foo restart ABORT :R4 ABORT Break 2 [62]> abort Break 1 [61]> abort ; --- this prompt shows that "my foo restart" was not invoked [63]> (with-simple-restart (foo "my foo restart") (print(break))) 1. Trace: (SYSTEM::BREAK-LOOP 'NIL '#<SIMPLE-CONDITION #x204353E6> 'T) ** - Continuable Error Break Wenn Sie (mit Continue) fortfahren: BREAK-Schleife beenden. Weitere mögliche Optionen: FOO :R1 my foo restart ABORT :R2 ABORT Break 1 [64]> foo NIL ; T ; --- here my foo restart was invoked [65]> Maybe this has to do with the ANSI-CL / Paul Dietz' testsuite related change that always supplies an abort restart in the repl? cf. Changelog 2004-02-25? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1220548&group_id=1355 |