REBOL3 tracker
  0.9.12 beta
Ticket #0000851 User: anonymous

Project:



rss
TypeBug Statusbuilt Date25-May-2009 10:48
Versionalpha 54 CategoryError Handling Submitted byLadislav
PlatformAll Severitycrash Priorityhigh

Summary TRY does not handle errors when encountering CATCH/quit
Description See the code below. This will also affect DO of a string or script inside a TRY, which is common. The bug is causing test-framework crashes.
Example code
; this case works as expected:
>> error? try [do [1] do make error! "try failure"]
== true

; this case does not work as expected
>> error? try [do "1" do make error! "try failure"]
** User error: "try failure"

; Here is the real bug
>> error? try [catch/quit [1] do make error! "try failure"] 
** User error: "try failure" 

Assigned ton/a Fixed inr3 master Last Update17-Feb-2014 23:44


Comments
(0000821)
Carl
27-May-2009 00:05

This problem comes from this line in system/intrinsic/do:

return catch/quit data

which is evaluated during DO "1" (which is no longer natively supported in R3 and generally that form is to be avoided).

More investigation needed.
(0000822)
Carl
27-May-2009 00:12

Removing catch/quit fixes this problem - but it will likely cause some new problem related to DO of strings at the outer level. Watch for it.

This change in mezz-instrinsic has been heavily notated (to avoid circular fixes).
(0000824)
BrianH
27-May-2009 00:21

It looks like the catching of the outer TRY is being disabled by the inner CATCH/quit. For example, an error that should be caught:

>> error? try [catch/quit [1] do make error! "Hello"]
** User error: "Hello"

The test code and description of this bug has been changed accordingly.
(0000914)
Ladislav
8-Jun-2009 08:37

This (a combination of CATCH/QUIT and TRY instead of just CATCH/QUIT) fixes the CATCH/QUIT problem:

>> error? try [try [catch/quit []] 1 / 0]
== true
(0002064)
BrianH
3-Mar-2010 22:43

Might be related to #1509.
(0002741)
Ladislav
2-Nov-2010 00:07

in the core-tests suite
(0003215)
BrianH
26-Oct-2011 20:39

Reported again in #1896.
(0003723)
abolka
23-Mar-2013 00:42

This also affects ATTEMPT:

>> attempt [catch/quit [1] do make error! "attempt failure"]
** User error: "attempt failure"

(Added to the core-tests suite.)
(0004035)
abolka
4-Oct-2013 02:06

Fix submitted as pull request:
https://github.com/rebol/r3/pull/167

(Sorry for having forgot to mention the pending fix in this ticket earlier.)

Date User Field Action Change
17-Feb-2014 23:44 BrianH Status Modified pending => built
17-Feb-2014 23:44 BrianH Fixedin Modified => r3 master
31-Dec-2013 12:49 abolka Comment : 0004035 Modified -
4-Oct-2013 02:14 Ladislav Comment : 0004030 Removed -
4-Oct-2013 02:06 abolka Comment : 0004035 Added -
2-Oct-2013 12:07 Ladislav Status Modified reviewed => pending
2-Oct-2013 12:07 Ladislav Severity Modified major => crash
2-Oct-2013 12:07 Ladislav Description Modified -
2-Oct-2013 12:06 Ladislav Comment : 0004030 Added -
23-Mar-2013 00:42 abolka Comment : 0003723 Added -
22-Mar-2013 23:38 BrianH Code Modified -
26-Oct-2011 20:39 BrianH Comment : 0003215 Added -
2-Nov-2010 00:07 Ladislav Comment : 0002741 Added -
3-Mar-2010 22:43 BrianH Comment : 0002064 Added -
27-Oct-2009 20:43 BrianH Category Modified => Error Handling
8-Jun-2009 09:08 Ladislav Comment : 0000914 Modified -
8-Jun-2009 08:57 Ladislav Comment : 0000914 Modified -
8-Jun-2009 08:37 Ladislav Comment : 0000914 Modified -
8-Jun-2009 08:37 Ladislav Comment : 0000914 Added -
7-Jun-2009 20:48 Ladislav Comment : 0000913 Removed -
7-Jun-2009 19:22 Ladislav Comment : 0000913 Added -
28-May-2009 08:41 BrianH Status Modified built => reviewed
28-May-2009 08:41 BrianH Fixedin Modified alpha 55 => none
27-May-2009 01:13 BrianH Comment : 0000824 Modified -
27-May-2009 01:12 BrianH Code Modified -
27-May-2009 01:12 BrianH Description Modified -
27-May-2009 01:12 BrianH Summary Modified Try does not handle errors when encountering do "1" => TRY does not handle errors when encountering CATCH/quit
27-May-2009 01:08 BrianH Comment : 0000824 Modified -
27-May-2009 01:05 BrianH Comment : 0000824 Modified -
27-May-2009 00:55 BrianH Comment : 0000824 Modified -
27-May-2009 00:51 BrianH Comment : 0000824 Modified -
27-May-2009 00:22 BrianH Comment : 0000824 Modified -
27-May-2009 00:21 BrianH Comment : 0000824 Added -
27-May-2009 00:13 carl Status Modified waiting => built
27-May-2009 00:13 carl Fixedin Modified => alpha 55
27-May-2009 00:12 carl Comment : 0000822 Added -
27-May-2009 00:05 carl Status Modified reviewed => waiting
27-May-2009 00:05 carl Comment : 0000821 Added -
25-May-2009 20:12 BrianH Priority Modified normal => high
25-May-2009 20:12 BrianH Status Modified submitted => reviewed
25-May-2009 20:12 BrianH Version Modified alpha 55 => alpha 54
25-May-2009 10:57 Ladislav Severity Modified minor => major
25-May-2009 10:57 Ladislav Code Modified -
25-May-2009 10:48 Ladislav Ticket Added -