From bug-octave-request at bevo dot che dot wisc dot edu Fri Jan 28 04:17:45 2000 Subject: Some problems From: "John W. Eaton" To: Hagen Gilsing Cc: bug-octave at bevo dot che dot wisc dot edu Date: Fri, 28 Jan 2000 04:18:05 -0600 (CST) On 20-Feb-1999, Hagen Gilsing wrote: | Description 3: | ------------- | | a) | octave-2.1.12:1> clear;OCTAVE_VERSION | OCTAVE_VERSION = 2.1.12 | ans = 2.1.12 | octave-2.1.12:2> try | > try error('generate error at level2'); | > catch error('catched error at level2'); end_try_catch; | > catch fprintf(2,'catched error at level 1\n'); end_try_catch | error: catched error at level2 | error: Segmentation fault -- stopping myself... | attempting to save variables to `octave-core'... | save to `octave-core' complete | Segmentation fault | ../Octave990219 01:58:00 502 # | | b) | octave-2.1.12:1> clear;OCTAVE_VERSION | OCTAVE_VERSION = 2.1.12 | ans = 2.1.12 | octave-2.1.12:2> try | > try x=y; | > catch 0='abc'; end_try_catch; | > catch fprintf(2,'catched error at level 1\n'); end_try_catch | error: invalid lvalue function called in expression | error: evaluating assignment expression near line 4, column 10 | error: Segmentation fault -- stopping myself... | attempting to save variables to `octave-core'... | save to `octave-core' complete | Segmentation fault | ../Octave990219 02:01:47 502 # | | c) | octave-2.1.12:1> clear;OCTAVE_VERSION | OCTAVE_VERSION = 2.1.12 | ans = 2.1.12 | octave-2.1.12:2> function co=f(a,b) | > try co=[ a b ];catch co=0;error('interrupt in function');end_try_catch; | > endfunction | octave-2.1.12:3> try f(zeros(2),ones(3)) catch error("catched interrupt !");end_try_catch | error: interrupt in function | error: called from `f' | error: Segmentation fault -- stopping myself... | attempting to save variables to `octave-core'... | save to `octave-core' complete | Segmentation fault | ../Octave990219 02:08:04 502 # | | d) | I would describe the three cases as problems of nested try-catch-blocks. | If one would like to work with a hierarchy of try-catch-blocks, one | exceptional state in any catching branch terminates the whole program. | So nearly it is better to only use the try-catch-blocks, if one is sure, I think I've fixed these problems in the current development sources. Thanks, jwe ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------