bugGNU Octave - Bugs: bug #65768, segfault on default branch


bug #65768: segfault on default branch

Submitter:  Hg200 <hg200>
Submitted:  Wed 22 May 2024 04:03:11 PM UTC
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  hg200 Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  10.1.0 (current default) Planned Release:  10.1.0 (current default)
* Mandatory Fields

Add a New Comment Rich Markup

Sun 26 May 2024 10:29:50 AM UTC, comment #4: 

Thank you for testing.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Sat 25 May 2024 12:00:37 PM UTC, comment #3: 

Many thanks for the fix. I have tested several guide guis and it looks fine. Ticket can be closed.

Hg200 <hg200>
Thu 23 May 2024 07:25:52 PM UTC, comment #2: 

I pushed the following changeset to the default branch.  Marking as ready for test.


John W. Eaton <jwe>
Group administrator
Wed 22 May 2024 05:13:35 PM UTC, comment #1: 

I can reproduce the crash and I'll try to fix it.  Until there is a fix, I think you can work around the problem by using explicit "end" statements for each of your functions in untitled.m.

John W. Eaton <jwe>
Group administrator
Wed 22 May 2024 04:03:11 PM UTC, original submission:  

I made an observation on the default branch (ec2635a02328) that might be worth mentioning. When I run the attached minimal working example Octave crashes.

Thread 8 "QThread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fa0cfe006c0 (LWP 1230747)]
0x00007fa15b89b12d in octave::tree_index_expression::end_pos (this=0x7fa0b8c2b3e0) at libinterp/parse-tree/pt-idx.cc:157
157             return dyn_field->end_pos ();

It must have something to do with the missing “end” statements of the functions, because when I add the “end” keyword to the functions, the example runs fine. The attached script is a guide example that simply opens an empty window. It should be mentioned that guide gui's were running quite well until maybe 6 weeks ago.

I did a bisect and the attached MWE runs without problems with Octave commits prior to this one:


I know those things are all under construction but maybe something is missing here. This is the reason why i am mention it.

#0  0x00007fa15b89b12d in octave::tree_index_expression::end_pos (this=0x7fa0b8c2b3e0) at libinterp/parse-tree/pt-idx.cc:157
#1  0x00007fa15b865eed in octave::tree_simple_assignment::end_pos (this=0x7fa0b82fe930) at libinterp/parse-tree/pt-assign.h:65
#2  0x00007fa15b8a8587 in octave::tree_statement::end_pos (this=0x7fa0b8cbbeb0) at libinterp/parse-tree/pt-stmt.cc:126
#3  0x00007fa15b7bacbb in octave_user_function::maybe_relocate_end_internal (this=0x7fa0b828a7f0) at libinterp/octave-value/ov-usr-fcn.cc:352
#4  0x00007fa15b7bad90 in octave_user_function::maybe_relocate_end (this=0x7fa0b82c9730) at libinterp/octave-value/ov-usr-fcn.cc:372
#5  0x00007fa15b83b3be in octave::parse_fcn_file
    (interp=..., full_file="untitled.m", file="untitled", dir_name="debug", dispatch_type="", package_name="", require_file=true, force_script=false, autoload=false, relative_lookup=false)
    at libinterp/parse-tree/oct-parse.yy:5385
#6  0x00007fa15b83c9f5 in octave::load_fcn_from_file (file_name="untitled.m", dir_name="debug", dispatch_type="", package_name="", fcn_name="", autoload=false)
    at libinterp/parse-tree/oct-parse.yy:5623
#7  0x00007fa15b9f6d9c in octave::fcn_info::fcn_info_rep::find_user_function (this=0x7fa0b82aec40) at libinterp/corefcn/fcn-info.cc:1058
#8  0x00007fa15b9f36f3 in octave::fcn_info::fcn_info_rep::load_class_constructor (this=0x7fa0b82aec40) at libinterp/corefcn/fcn-info.cc:131
#9  0x00007fa15b9f5c90 in octave::fcn_info::fcn_info_rep::xfind (this=0x7fa0b82aec40, search_scope=..., args=...) at libinterp/corefcn/fcn-info.cc:775
#10 0x00007fa15b9f4530 in octave::fcn_info::fcn_info_rep::find (this=0x7fa0b82aec40, scope=..., args=...) at libinterp/corefcn/fcn-info.cc:358
#11 0x00007fa15bdf67bd in octave::fcn_info::find (this=0x7fa0cfdfe1b0, search_scope=..., args=...) at libinterp/corefcn/fcn-info.h:251
#12 0x00007fa15bdf3926 in octave::symbol_table::fcn_table_find (this=0x7fa0b8002580, name="untitled", args=..., search_scope_arg=...) at libinterp/corefcn/symtab.cc:242
#13 0x00007fa15bdf3c6f in octave::symbol_table::find_function (this=0x7fa0b8002580, name="untitled", args=..., search_scope=...) at libinterp/corefcn/symtab.cc:289
#14 0x00007fa15bdf3b91 in octave::symbol_table::find_function (this=0x7fa0b8002580, name="untitled", search_scope_arg=...) at libinterp/corefcn/symtab.cc:277
#15 0x00007fa15b8997cd in octave::tree_identifier::evaluate_n (this=0x7fa0b8c86040, tw=..., nargout=0) at libinterp/parse-tree/pt-id.cc:104
#16 0x00007fa15b89a0df in octave::tree_identifier::evaluate (this=0x7fa0b8c86040, tw=..., nargout=0) at libinterp/parse-tree/pt-id.h:101
#17 0x00007fa15b87b9d4 in octave::tree_evaluator::visit_statement (this=0x7fa0b80015e8, stmt=...) at libinterp/parse-tree/pt-eval.cc:4068
#18 0x00007fa15b8a9504 in octave::tree_statement::accept (this=0x7fa0b8b18910, tw=...) at libinterp/parse-tree/pt-stmt.h:125
#19 0x00007fa15b87beb9 in octave::tree_evaluator::visit_statement_list (this=0x7fa0b80015e8, lst=...) at libinterp/parse-tree/pt-eval.cc:4153
#20 0x00007fa15b64be72 in octave::tree_statement_list::accept (this=0x7fa0b8c36ec0, tw=...) at libinterp/parse-tree/pt-stmt.h:215
#21 0x00007fa15b87078a in octave::tree_evaluator::eval (this=0x7fa0b80015e8, stmt_list=std::shared_ptr<octave::tree_statement_list> (use count 2, weak count 0) = {...}, interactive=true) at libinterp/parse-tree/pt-eval.cc:1000
#22 0x00007fa15b86fda9 in octave::tree_evaluator::repl (this=0x7fa0b80015e8) at libinterp/parse-tree/pt-eval.cc:817
#23 0x00007fa15bc4faaf in octave::interpreter::main_loop (this=0x7fa0b80013f0) at libinterp/corefcn/interpreter.cc:1336

Hg200 <hg200>


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

Attach Files:

Attached Files
file #56076:  untitled.fig added by hg200 (3KiB - image/x-xfig)
file #56077:  untitled.m added by hg200 (858B - text/x-objcsrc)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by hg200 (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-26 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
        Operating SystemGNU/Linux Any
        Fixed ReleaseNone 10.1.0 (current default)
        Planned ReleaseNone 10.1.0 (current default)
    2024-05-23 jwe StatusNone Ready For Test
    2024-05-22 hg200 Attached File- Added untitled.fig, #56076
        Attached File- Added untitled.m, #56077

    Back to the top

    Powered by Savane 3.13-6ae7.
    Corresponding source code