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

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

[Octave-bug-tracker] [bug #51993] Seg fault when calling 'clear all' aft


From: Piotr Held
Subject: [Octave-bug-tracker] [bug #51993] Seg fault when calling 'clear all' after creating class that contains subfunctions in local functions
Date: Mon, 11 Sep 2017 17:04:25 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?51993>

                 Summary: Seg fault when calling 'clear all' after creating
class that contains subfunctions in local functions
                 Project: GNU Octave
            Submitted by: jsoh425
            Submitted on: Mon 11 Sep 2017 09:04:24 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Segfault, Bus Error, etc.
                  Status: None
             Assigned to: None
         Originator Name: Piotr Held
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

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
<http://hg.savannah.gnu.org/hgweb/octave/file/c2ef0eddf6bc/libinterp/corefcn/symtab.h#l1194>)
when clearing 'sub_foo' from the symbol table. 



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 11 Sep 2017 09:04:24 PM UTC  Name: local_fcn_class.m  Size: 227B  
By: jsoh425

<http://savannah.gnu.org/bugs/download.php?file_id=41781>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51993>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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