bugGNU Octave - Bugs: bug #67749, Uncaught exception...

 
 

bug #67749: Uncaught exception "break_closure_cycles" crashes the interpreter

Submitter:  Thomas <kolmanthomas>
Submitted:  Sun 30 Nov 2025 05:18:37 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Ready For Test Assigned to:  None
Originator Name:  Thomas Kolman Open/Closed:  * Open
Release:  * 10.3.0 Operating System:  * Any
Fixed Release:  None Planned Release:  10.4.0 (current stable)
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Sun 30 Nov 2025 08:51:18 PM UTC, comment #4: 

Thanks Markus and Arun, I appreciate the quick turnaround. I'll remember to add tests next time, no matter how small the fix.

Thomas <kolmanthomas>
Sun 30 Nov 2025 08:05:08 PM UTC, comment #3: 

Thanks for the patch.

I was able to reproduce the crash with the example from comment #0.

The patch didn't apply cleanly on a current head. I hope I resolved the conflicts correctly.

Additionally, I slightly changed the commit message (some typos and whitespaces), added the visibility attributes for the new function, and added a test based on the example in comment #0.

Since this fixes a crash, I pushed the change to the stable branch (hg id 4786dcbf2fec).

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Sun 30 Nov 2025 07:39:29 PM UTC, comment #2: 

This patch is not applying cleanly for me. There is no parent node in my tree starting with 5c97fb0b22db. Could you check against the latest default branch pls? E.g. id 0f4ac4da4ac1.

Arun Giridhar <arungiridhar>
Group Member
Sun 30 Nov 2025 05:26:42 PM UTC, comment #1: 

I've attached a patch fixing the issue.

Previously, parent class "cdef_object" had the virtual method "break_closure_cycles" that was meant to be overriden by its child classes "cdef_object_scalar" and "cdef_object_array", but only the former had a concrete overrided implementation. The new implementation for "cdef_object_array" calls "break_closure_cycles" on every scalar classdef inside the classdef array.

This IMO is a high severity bug, since the interpreter should never crash. This bug pops up all over the place in Chebfun code, so there's real world code that is affected.

(file #57881)

Thomas <kolmanthomas>
Sun 30 Nov 2025 05:18:37 PM UTC, original submission:  

Running the following code (with an arbitrary classdef `foo_class`) will trigger an exception that is not caught by the interpreter.


function test_cdef_array_break_cycles()
  obj_array(1) = foo_class();
  obj_array(2) = foo_class();

  function result = nested_func(x)
    result = obj_array;
  end

  handle = @nested_func;
end


The exception message I get after the crash of the interpreter is:


libc++abi: terminating due to uncaught exception of type octave::execution_exception: break_closure_cycles: invalid object
fatal: caught signal Abort trap: 6 -- stopping myself...




Thomas <kolmanthomas>

 

Attached Files

Attached Files
file #57881:  bug67749.cset added by kolmanthomas (1.8KiB - application/octet-stream)

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by kolmanthomas (Submitted the item)
  •  

    Votes

    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.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-11-30 mmuetzel Item GroupUnexpected Error or Warning Segfault, Bus Error, etc.
        StatusNone Ready For Test
        Releasedev 10.3.0
        Operating SystemMac OS Any
        Planned ReleaseNone 10.4.0 (current stable)
    2025-11-30 kolmanthomas Attached File- Added bug67749.cset, #57881

    Back to the top

    Powered by Savane 3.16-a7ba.
    Corresponding source code