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

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

[Octave-bug-tracker] [bug #62308] use of octave::feval causes error: fun


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #62308] use of octave::feval causes error: function '...' not found
Date: Thu, 14 Apr 2022 12:14:35 -0400 (EDT)

Follow-up Comment #12, bug #62308 (project octave):

This all is pretty intricate.

IIUC, the shutdown needs to happen inside `execute` if the interpreter was
constructed with app context. It is probably also a good idea for it to happen
if an exception is caught (during initialization or any other step).
It should *not* happen inside that function if the interpreter is embedded
like in the example here.
Does that mean it should never shutdown inside that function if the
interpreter was constructed without app context?

In that case, the interpreter needs to be shutdown somewhere else (to avoid a
segfault at exit). The `shutdown` function is private. So, I assume that it
needs to be called somewhat automatically. My best guess was that this could
be inside its destructor.


diff -r f67d2ce5d6d4 libinterp/corefcn/interpreter.cc
--- a/libinterp/corefcn/interpreter.cc  Tue Apr 12 17:07:01 2022 +0200
+++ b/libinterp/corefcn/interpreter.cc  Thu Apr 14 18:08:12 2022 +0200
@@ -654,6 +654,9 @@
 
   interpreter::~interpreter (void)
   {
+    if (! m_app_context)
+      shutdown ();
+
     delete m_gh_manager;
   }
 
@@ -906,15 +909,17 @@
               }
             else
               exit_status = main_loop ();
+
+            shutdown ();
           }
       }
     catch (const exit_exception& xe)
       {
         exit_status = xe.exit_status ();
+
+        shutdown ();
       }
 
-    shutdown ();
-
     return exit_status;
   }
 


However, jwe removed `shutdown` from the destructor for bug #61994:
https://hg.savannah.gnu.org/hgweb/octave/rev/dadbfe6fddd6

So, moving it back there could potentially cause other issues. It fixes the
example here for me though...


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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