bugGNU Octave - Bugs: bug #53054, Variable Editor: crash when trying...


bug #53054: Variable Editor: crash when trying to edit specific empty struct cells

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Sat 03 Feb 2018 08:50:17 AM UTC
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Tue 12 May 2020 09:46:38 PM UTC, comment #18: 

The serious part of this bug report, the sgefault, has been fixed.  There is still an issue where modifications to a substruct are not reflected in the struct container above until an operation is performed in the console or <RETURN> is hit.  But that deserves its own bug report.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Fri 09 Feb 2018 05:11:30 PM UTC, comment #17: 

Oops, I spoke too soon.  I still can get crashes when editing structs.  Unfortunately I don't have the exact sequence of what I did, although I will try to find it again.

Rik <rik5>
Group administrator
Fri 09 Feb 2018 04:50:58 PM UTC, comment #16: 

We're approaching done on this particular bug report.  Editing of struct empty cells no longer causes a crash.

The issue with updating the master variable X when a portion of X has changed in a different tab is still there.  However, I notice that just hitting 'Enter' in the Command Window is enough to update the master variable tab.

The sub-variable probably just needs to emit a signal for its parent to update itself.  Although, it may be that this is already happening, but when the parent receives the signal it discards it because it is not visible/exposed.  For performance reasons I know the GUI is trying to update as little as possible, and only when necessary.

Should I file a different bug report about the updating or do we want to continue in this particular report?

Rik <rik5>
Group administrator
Wed 07 Feb 2018 08:47:49 PM UTC, comment #15: 

@jwe: Yes, Octave updates the variable correctly, it just isn't made known to the Variable Editor.

Rik <rik5>
Group administrator
Wed 07 Feb 2018 07:30:42 PM UTC, comment #14: 

Hey ... yesterday I added some comments but apparently they didn't come through :-(

I'll try again (about the status after the patch in comment #8):

I also noted Rik's observation about not updating cell contents; I found that pressing Enter with focus in the terminal does update the cell.

When editing empty cells in a struct (0x0 matrix) a new tab opens and then I see no row and column headers. In a way obvious as there are no rows and columns (empty array) but it looks funny.

Once in that 0x0 array no other types are accepted than doubles. No char, no logical. But entering a double, closing the tab and then editing the new cell contents one can finally change the contents into other types. A bit involved but it works.

Surely there's more work to do, but I got used to circumventing some issues in the 1.5 years or more that the VE was just a patch so I'm already quite content now: no more crashes when openvar'ing Java objects, ability to edit structs, ... etc. Nice.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 07 Feb 2018 05:15:09 PM UTC, comment #13: 


RE comment #11.  The variable does change in the workspace though, doesn't it (if you examine it at the command prompt, for example)?  So the action is happening, but there is apparently some missing signal/slot/update connection.  I haven't figured out what needs to happen there yet.

RE comment #13.  I'll see if I can avoid displaying the errors in the command window.

John W. Eaton <jwe>
Group administrator
Wed 07 Feb 2018 04:41:59 PM UTC, comment #12: 

Additional small weirdness, I get an error when a tab is open on a cell array, and then the underlying data type is changed.

x = cell (3,1)
openvar x
# Edit x{1,1} to change value to 2
# Leave this tab open in V.E. and return to the command window
x = [1; 1.23]
>> error: matrix cannot be indexed with {

The V.E. does change the text to "variable 'x{1,1}' is invalid or undefined", but somewhere this error is leaking out rather than getting caught by a try/catch block.

Rik <rik5>
Group administrator
Wed 07 Feb 2018 04:34:53 PM UTC, comment #11: 

Okay, no crash when opening struct cells which is much better.

Also, the weird behavior with strings has gone away.

One remaining quirk is that when editing a cell in a data container, such as a structure or cell array, the edits are not reflected back up to the container object.

For example

x = cell (3, 1)
openvar x
# Edit x{1,1} which is 0x0 double
# Type in a value such as 2 and hit return
# The cell value becomes 2 and the tab now reads "x{1,1} [1x1 double]"
# Use the mouse to switch back to V.E. tab "x"
# The display is still that x{1,1} is "[0x0 double]"

Rik <rik5>
Group administrator
Wed 07 Feb 2018 08:17:16 AM UTC, comment #10: 

Oops, the link to the changeset in comment #9 should be:


John W. Eaton <jwe>
Group administrator
Wed 07 Feb 2018 08:16:23 AM UTC, comment #9: 

I pushed the following changeset:


I think this should avoid the crashes.  It also allows more flexible editing of numeric data (easily add elements outside the bounds of the current array, for example).

There is still a lot of work to do, but I think it is looking better.

John W. Eaton <jwe>
Group administrator
Tue 06 Feb 2018 11:23:53 AM UTC, comment #8: 

Try the attached patch.  I think it's better, but even in my limited testing I see a few things that don't work quite right.  Sorry for the trouble.  I hope we are starting to converge on a real solution now.

(file #43191)

John W. Eaton <jwe>
Group administrator
Sun 04 Feb 2018 07:19:28 PM UTC, comment #7: 

OK, I see the problem.  After my previous changes, I only tested with numeric arrays.  I'm working on a fix, but it will probably not be ready for a day or so.

John W. Eaton <jwe>
Group administrator
Sun 04 Feb 2018 10:54:41 AM UTC, comment #6: 

calling openvar on cell arrays or structs makes Octave crash.

In addition, typing
a = "text"
openvar ('a')

shows as a 1x4 array of cells each containing "text", see attached pic

Philip Nienhuis <philipnienhuis>
Group Member
Sun 04 Feb 2018 10:42:46 AM UTC, comment #5: 

A little investigation shows that it is this cset

ea058ec5ef30  track display and data rows/columns separately in variable editor (bug #53033)

makes Octave crash when doing openvar on a struct.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 03 Feb 2018 09:24:52 PM UTC, comment #4: 

With a clean source tree, complete rebuild, trying the commands in the original report, after entering
openvar ('s')
Octave disappears and the terminal (from which it started with ./run-octave &) says "octave exited with signal 11".

Confirmed this on another build tree with some local mods, kept up-to-date by merging locally.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 03 Feb 2018 08:42:44 PM UTC, comment #3: 

Hang on ... got some mix up in my build tree here.
I'll try again.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 03 Feb 2018 08:33:46 PM UTC, comment #2: 

After entering the code in my report the V.E. now says "unable to edit [1x2] 'struct' objects".
Same for 1x3 and scalar structs.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 03 Feb 2018 03:26:51 PM UTC, comment #1: 

I pushed the following changeset:


It seems to fix these problems for me.  Does it work for you?

John W. Eaton <jwe>
Group administrator
Sat 03 Feb 2018 08:50:17 AM UTC, original submission:  

Reproducible on Linux and Windows:

s = struct ("f1", 1.4)
s(2).f2 = true
openvar ('s')

Then in the shown matrix double-click the empty cell (1, 2) ("[0x0 matrix]") => opens that cell, fine.
But double-clicking the empty (2, 1) cell leads to an immediate crash.

OK, trying again with one more field:

s = struct ("f1", 1.4)
s(2).f2 = true
s(3).f3 = "Text"

cell (1, 2) is still OK, double-clicking most other empty cells makes Octave crash.

I see no struct field names in the headers. ISTR I did see them in an earlier revision, but my memory could be a bit mixed up with what Matlab does.

None of the filled struct cells seems to be editable, I get popups along the lines of
"failed to evaluate expression: s(1,1) = 1.402'"

Should I open separate bug reports for these "BTW's"? perhaps these are all related.

Philip Nienhuis <philipnienhuis>
Group Member


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

Attach Files:

Attached Files
file #43191:  diffs.txt added by jwe (56KiB - text/plain)
file #43167:  VE_bug53054.png added by philipnienhuis (40KiB - image/png)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by philipnienhuis (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 project members can vote.


    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-12 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2018-02-09 rik5 StatusFixed In Progress
    2018-02-09 rik5 StatusReady For Test Fixed
    2018-02-07 jwe StatusPatch Submitted Ready For Test
    2018-02-06 jwe Attached File- Added diffs.txt, #43191
        StatusReady For Test Patch Submitted
    2018-02-04 philipnienhuis Attached File- Added VE_bug53054.png, #43167
    2018-02-03 jwe SummaryVariable editor: crash when trying to edit specific empty struct cells Variable Editor: crash when trying to edit specific empty struct cells
    2018-02-03 jwe StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.12