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

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

[Octave-bug-tracker] [bug #36067] bug in exist() when checking for a fau


From: Kris Thielemans
Subject: [Octave-bug-tracker] [bug #36067] bug in exist() when checking for a faulty mex/oct file
Date: Mon, 02 Apr 2012 13:56:45 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0

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

                 Summary: bug in exist() when checking for a faulty mex/oct
file
                 Project: GNU Octave
            Submitted by: krthie
            Submitted on: Mon 02 Apr 2012 13:56:44 GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Crash
                  Status: None
             Assigned to: None
         Originator Name: Kris Thielemans
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.1
        Operating System: GNU/Linux

    _______________________________________________________

Details:

I've just upgraded to 3.6.1 and discovered the following:


exist('myfile.bla','file')


exits octave with "panic: Segmentation fault -- stopping myself..." IF myfile
is actually a mex file (or presumably oct) file that causes a segmentation
fault. Note that this happens independent of the extension used (i.e. you
don't have to check for 'myfile.mex' or so).

This indicates that exist() actually tries to execute the function, which
sounds really rather dangerous.


I've looked at the C++ source for exist() in variables.cc. This calls
symbol_exist(). I don't know exactly where in this function it executes the
mex file (sorry, I didn't compile a debug version), but I am puzzled by the
fact that this function has special handling for structs in the string  :


  size_t pos = name.find ('.');
  if (pos != std::string::npos && pos > 0)
    {
      struct_elts = name.substr (pos+1);
      symbol_name = name.substr (0, pos);
    }
 octave_value val = safe_symbol_lookup (symbol_name); 


This is probably necessary for some use cases of symbol_exist (but which?) but
definitely not when the type is 'file' (and many others).





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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