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

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

[Octave-bug-tracker] [bug #61821] segfault in oct interface


From: anonymous
Subject: [Octave-bug-tracker] [bug #61821] segfault in oct interface
Date: Fri, 14 Jan 2022 04:38:31 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:94.0) Gecko/20100101 Firefox/94.0

URL:
  <https://savannah.gnu.org/bugs/?61821>

                 Summary: segfault in oct interface
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 14 Jan 2022 09:38:29 AM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Segfault, Bus Error, etc.
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 7.0.90
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

A segfault appeared when running a .oct file. I reduced the problem to a
minimal example:


#include <octave/oct.h>
#include <octave/pt-all.h>

DEFUN_DLD (params, args, nargout,
           "segfault in user fcn")
{
    octave::tree_parameter_list *lst = new
octave::tree_parameter_list(octave::tree_parameter_list::in);
    
    octave_user_function *fcn = new octave_user_function ();
    
    fcn->define_ret_list (lst);
    
    octave::tree_parameter_list *ret_list = fcn->return_list ();
    
    bool emp = ret_list->empty ();
    
    return octave_value(emp);
}


Simply I created an empty parameter list then set it as the return list of an
empty user function and get it back via "return_list()" method of the
"octave_user_function". Now calling any methods of the returned parameter list
results in segfault. Segfault appeared here:

++
bool emp = ret_list->empty ();
--

The above code runs without error on Octave 6.3.0.
Note that the following code runs without any problem in 7.0.90:

    octave::tree_parameter_list *lst = new
octave::tree_parameter_list(octave::tree_parameter_list::in);
    bool emp = lst->empty ();


The parameter list first must be saved into a user function and be retrieved
back to reproduce the segfault.
Is may be a bug in GCC or a bug in Octave config and build system. Other API
functions also may be affected.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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