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

 
 

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

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Sat 03 Feb 2018 08:50:17 AM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: In ProgressAssigned to: None
Originator Name: Philip NienhuisOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

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>
Project 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>
Project 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>
Project 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>
Project Member
Wed 07 Feb 2018 05:15:09 PM UTC, comment #13:

Rik:

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>
Project 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.

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>
Project 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

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

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

http://hg.savannah.gnu.org/hgweb/octave/rev/21d6d80ed427

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

I pushed the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/21d6d80ed427a

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>
Project 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>
Project 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>
Project Administrator
Sun 04 Feb 2018 10:54:41 AM UTC, comment #6:

Correction:
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

(file #43167)

Philip Nienhuis <philipnienhuis>
Project 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>
Project 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>
Project 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>
Project 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>
Project Member
Sat 03 Feb 2018 03:26:51 PM UTC, comment #1:

I pushed the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/2bd8ba9bc39b

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

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

Reproducible on Linux and Windows:

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:

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

BTW 1
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.

BTW 2
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>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

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
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by philipnienhuis (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

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

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 09 Feb 2018 05:11:30 PM UTCrik5StatusFixed=>In Progress
    Fri 09 Feb 2018 04:50:58 PM UTCrik5StatusReady For Test=>Fixed
    Wed 07 Feb 2018 08:16:23 AM UTCjweStatusPatch Submitted=>Ready For Test
    Tue 06 Feb 2018 11:23:53 AM UTCjweAttached File-=>Added diffs.txt, #43191
      StatusReady For Test=>Patch Submitted
    Sun 04 Feb 2018 10:54:41 AM UTCphilipnienhuisAttached File-=>Added VE_bug53054.png, #43167
    Sat 03 Feb 2018 04:13:56 PM UTCjweSummaryVariable editor: crash when trying to edit specific empty struct cells=>Variable Editor: crash when trying to edit specific empty struct cells
    Sat 03 Feb 2018 03:26:51 PM UTCjweStatusNone=>Ready For Test

    Back to the top


    Powered by Savane 3.1-cleanup1