octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61841] rethrowing an exception leads to an in


From: Rik
Subject: [Octave-bug-tracker] [bug #61841] rethrowing an exception leads to an internal error
Date: Wed, 19 Jan 2022 14:35:23 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

Follow-up Comment #14, bug #61841 (project octave):

I upgraded the diff from jwe into a true changeset (added commit message).  It
is attached as rethrow.cset.  Unfortunately, it segfaults under regression
testing.  The problem case is attached as errtst.m


%!test
%! try
%!   union ({'a'}, 1);
%! catch
%!   x = lasterror ();
%!   try
%!     y = struct ("message", "msg", "identifier", "", "stack",
%!                 struct ("file", "foo.m", "name", "foo", "line", 13));
%!     rethrow (y);
%!   catch
%!     assert (y, lasterror ());
%!   end_try_catch
%! end_try_catch


Reproduce with "test errtst"

The issue is that rethrow (and throw() if we implemented it) can take an
exception object as an input.  The "stack" field in turn must have fieldnames
"file", "name", and "line" for Matlab compatibility.  In the problem case
above, rethrow() is called with just such a struct, but when Octave tries to
get "column(i)" it fails as an indexing operation because, while the fieldname
existis, it is empty (0x0).
https://savannah.gnu.org/bugs/?61841

(file #52685, file #52686)
    _______________________________________________________

Additional Item Attachment:

File name: rethrow.cset                   Size:2 KB
    <https://file.savannah.gnu.org/file/rethrow.cset?file_id=52685>

File name: errtst.m                       Size:0 KB
    <https://file.savannah.gnu.org/file/errtst.m?file_id=52686>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61841>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]