bugGNU Octave - Bugs: bug #65056, Changing and saving a file in...

 
 

bug #65056: Changing and saving a file in debug mode with the byte-code interpreter active causes Octave to crash

Submitter:  Hendrik K <koerhen>
Submitted:  Wed 20 Dec 2023 01:49:38 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Ready For Test Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 23 Dec 2023 05:23:13 PM UTC, comment #3: 

Reviewed and pushed to the bytecode-interpreter branch: https://hg.savannah.gnu.org/hgweb/octave/rev/9faf6bc269a7

Marking as ready for test.

Arun Giridhar <arungiridhar>
Group Member
Sat 23 Dec 2023 01:15:18 AM UTC, comment #2: 

It seems like the gui uses a 'quit_debug_exception' to signal that debugging should be canceled, which the bytecode interpreter didn't handle properly. I've attached a patch.


Handle quit_debug_exception in bytecode interpreter (bug #65056)

To allow for escaping debugging in gui properly.

* pt-bytecode-vm.cc: Catch quit_debug_exception, handle in unwind
* pt-bytecode-vm.h: New field 'm_debug_quit_all'
* pt-bytecode.h: New 'DEBUG_QUIT' error type
* pt-eval.cc: Move quit_debug_exception def to header
* pt-eval.h


> On Windows 10 with dev Octave (GUI) from Dec. 14, I get no crash with the example in comment #0. But closing the test2.m file in the editor and then reopening it, and then entering '__vm_enable__' I get an infinite loop with messages:


I think the exception escaped the VM, which probably leads to quite arbitrary execution afterwards. There would e.g. be unpopped Octave stack frames etc. Maybe the try catch in vm::call() should have a 'catch (...)' to catch these kind of bugs easier.

(file #55480)

Petter <petter>
Wed 20 Dec 2023 12:57:48 PM UTC, comment #1: 

On Windows 10 with dev Octave (GUI) from Dec. 14, I get no crash with the example in comment #0.
But closing the test2.m file in the editor and then reopening it, and then entering '__vm_enable__' I get an infinite loop with messages:

:
error: VM internal error: Invalid call to varval() with frame offset 0, name '__vm_enable__'
called from
     test2
:

Maybe saving the file and reopening wasn't even needed.

Anyway, this isn't good.
Operating system => any
Status => confirmed

cc'ing Petter

Philip Nienhuis <philipnienhuis>
Group Member
Wed 20 Dec 2023 01:49:38 AM UTC, original submission:  

Changing and then saving a file in debug mode with the byte-code interpreter active causes Octave to crash.

Sample steps to show the issue:
 

function ret = test2(a);
  ret = sin(a);
endfunction


1) enable the byte-code interpreter ("__vm_enable__(1)")
2) Set a breakpoint in test2
3) Call test2(1)
4) When in debug mode, change the line to ret = sin(a+1);
5) Quit the debug mode

When now saving test2 in the editor, octave crashes.


version ("-hgid")
ans = 17f613a4a843



Hendrik K <koerhen>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #55480:  32996.patch added by petter (5KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by petter (Updated the item)
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by koerhen (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-12-23 arungiridhar StatusConfirmed Ready For Test
    2023-12-23 petter Attached File- Added 32996.patch, #55480
    2023-12-20 philipnienhuis StatusNone Confirmed
        Operating SystemGNU/Linux Any
        Carbon-Copy- Added philipnienhuis
        Carbon-Copy- Added petter

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code