bugGNU Octave - Bugs: bug #51993, Seg fault when calling 'clear all'...

 
 

bug #51993: Seg fault when calling 'clear all' after creating class that contains subfunctions in local functions

Submitter:  Piotr Held <jsoh425>
Submitted:  Mon 11 Sep 2017 09:04:24 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Piotr Held Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 14 Sep 2017 05:36:39 PM UTC, comment #2: 

So I tested it again before the new changeset and after it and the changeset fixed the problem for me. Thanks :).

Piotr Held <jsoh425>
Thu 14 Sep 2017 02:51:31 PM UTC, comment #1: 

I pushed the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/840882c82e22

I'm not sure how to add a test for this since "clear all" or "clear classes" could have disastrous results if executed in the middle of running the test suite.

John W. Eaton <jwe>
Group administrator
Mon 11 Sep 2017 09:04:24 PM UTC, original submission:  

When creating the following class (I attached the class *.m file also):


classdef local_fcn_class
  methods
    function obj = local_fcn_class (arg1)
      local_foo (arg1);
    end
  end
end

function ret = local_foo (arg1)
  function y = sub_foo (x)
    y = x + 1;
  end
  ret = sub_foo(arg1);
end


After constructing this class calling 'clear all' or exiting Octave causes heap-use-after-free AddressSanitizer error. This does not seem to be a problem if the subfunction ('sub_foo' in this case) is defined not in a classdef local function but in a separate function file.

I also stepped through the code and was able to confirm that the error occurs while clearing 'sub_foo' from symbol_table::clear_functions ( symtab.h:1194) when clearing 'sub_foo' from the symbol table.

Piotr Held <jsoh425>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #41781:  local_fcn_class.m added by jsoh425 (227B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jsoh425 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-14 jwe StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2017-09-14 jwe StatusNone Ready For Test
    2017-09-11 jsoh425 Attached File- Added local_fcn_class.m, #41781

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code