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

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

[Octave-bug-tracker] [bug #64705] VM machine executed script clear the c


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #64705] VM machine executed script clear the content of a global pre-declared global variable
Date: Fri, 6 Oct 2023 10:18:56 -0400 (EDT)

Follow-up Comment #10, bug #64705 (project octave):

@Anonymous in comment #6: Changing the "run" statement makes it work for me
with and without the VM:

$ cat I_Use_Globals.m 
function ret = I_Use_Globals()
  Snippet_Globalvars     ## <==== This line no longer uses "run".
  disp(x1);
  ret = x1
endfunction


$ cat Snippet_Globalvars.m 
global x1;
global x2;
global x3;
global x4;


Not sure why calling run() exposes some problems.

Re the other problem I listed in comment #9, removing the line that causes the
panic gives some more information:

octave:2> testme
vector::_M_range_check: __n (which is 29) >= this->size() (which is 29)
VM error 7483: Exception in testme escaped the VM
error: VM error 7484: Exception in testme escaped the VM

That is followed by a segfault on exit.

The test code change was this:

diff -r 2c0dc2ac3d3b libinterp/corefcn/stack-frame.cc
--- a/libinterp/corefcn/stack-frame.cc  Thu Oct 05 17:14:53 2023 -0400
+++ b/libinterp/corefcn/stack-frame.cc  Fri Oct 06 10:08:58 2023 -0400
@@ -356,9 +356,6 @@ public:
 
   void internal_resize (std::size_t arg)
   {
-    // Not ok to resize for scripts. Extra slots should be in the eval
frame.
-    CHECK_PANIC (!m_fcn->is_user_script ());
-
     int diff = static_cast<int> (arg) - static_cast<int>(internal_size ());
 
     if (diff > 0)


>From what I gather, there's a difference between "script scope" and "top level
scope", and some of the variables are not making the transition properly when
the VM is active.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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