bugGNU Octave - Bugs: bug #62863, Octave closes if empty editor tab...

 
 

bug #62863: Octave closes if empty editor tab is closed before .octaverc is finished

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Fri 05 Aug 2022 12:52:27 PM UTC
   
 
Category:  GUI Severity:  2 - Minor
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:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 12 Apr 2023 10:12:49 PM UTC, comment #9: 

Forgot about this one, sorry. Thx for heads up.
My problem was fixed as stated in comment #6.
Closing report.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 12 Apr 2023 09:07:22 PM UTC, comment #8: 

@jwe: patch was pushed in January, 2023.  Okay to close report?  Or do you want to open a new report about general problem mentioned in comment #7?

Rik <rik5>
Group administrator
Wed 11 Jan 2023 07:12:23 PM UTC, comment #7: 

The diff I posted was based on the current stable branch.

This report exposes a general problem with interpreter_event callbacks that emit signals or rely on pointers to data belonging to the GUI.  If there is a delay in executing the callback, it is possible for the GUI object(s) to be deleted before the callback executes.  But in some cases, it is OK to execute part of the callback.

For another example of when problems might occur, try the following:

  • open a tab in the editor and insert some code
  • in the command window, issue a command like "pause(20)"
  • back in the editor, select the code and run it (run selection; F9)
  • delete the editor tab before the pause command finishes
  • wait for Octave to crash


For now, I checked in the following changeset on stable and merged with default.  I believe it takes care of all the cases involving callbacks that emit signals.  There may be other issues that I didn't catch yet.

http://hg.savannah.gnu.org/hgweb/octave/rev/9ab31fe294c1

John W. Eaton <jwe>
Group administrator
Tue 10 Jan 2023 10:23:15 PM UTC, comment #6: 

Yep, works fine in Octave-9.0.0, thanks very much.
Would this be backported to Octave-8.x ?

Importing the diff in hg baa77a716bb8 didn't work ("hunk failed at 816") so I had to apply it manually. I noted some indentation differences but didn't investigate further.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 10 Jan 2023 06:05:49 PM UTC, comment #5: 

Does the attached change avoid the problem for you?


(file #54211)

John W. Eaton <jwe>
Group administrator
Mon 09 Jan 2023 07:55:59 PM UTC, comment #4: 

Where I wrote in comment #3:

> I suppose this clearly points to some race condition in the GUI during Octave's initialization stage

I should probably have written

> I suppose this points to some threading issue in the GUI during Octave's initialization stage

Philip Nienhuis <philipnienhuis>
Group Member
Sat 10 Dec 2022 07:46:47 PM UTC, comment #3: 

Oh and as I'm running Octave on a much faster laptop these days: I found that timing can be a factor. Closing the empty editor tab and then switching to the command window on 9.0.0 has to be done quickly to avoid the crash.

I suppose this clearly points to some race condition in the GUI during Octave's initialization stage, e.g., when it is processing .octaverc's

Philip Nienhuis <philipnienhuis>
Group Member
Sat 10 Dec 2022 07:43:07 PM UTC, comment #2: 

It's only on Windows. This behavior has been, and still is, consistently present as of Octave-6.x or even earlier.

Just tested on 9.0.0 and there the behavior changed a little: Octave crashes only when the editor has focus - docked or not.

With Octave-8.0.0 (the last build before dev became 9.0.0) and earlier builds it does not matter whether the editor pane (docked or not) has focus.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 10 Dec 2022 05:37:23 PM UTC, comment #1: 

Philip, can you reproduce this issue with a recent build from the default branch. At least on linux, I am not able to reproduce this.

Torsten Lilge <ttl>
Group Member
Fri 05 Aug 2022 12:52:27 PM UTC, original submission:  

(I've got used to this, has been happening for years and years, but OTOH it's not as it should be. Not a showstopper, so severity -> minor.)

Steps to reproduce:

  • create an .octaverc, only add the command 'pause (10)' in it
  • fire up Octave GUI
  • soon after GUI is up (but before 10 seconds are passed), click the close button on the empty Editor tab.

==> result:
After .octaverc is finished (which can take the rest of the 10 secs.) Octave vanishes from sight, w/o any trace or Windows popup. So I'm even not sure whether Octave crashes or is just unexpectedly closing ... (I guess it's the latter).

With regard to this the Octave GUI used to be more sensitive in the past; resizing or closing panes, browsing in the file browser, loading other files in the editor, etc sometimes gave the same behavior; but in 7.x.0 and 8.0.0 I know only of closing the empty editor tab during startup.

My .octaverc takes quite a bit of time to get processed (a.o., loading several packages I'm using daily) so I'm often tempted to start fiddling around in the mean time: e.g., loading recent editor files, shifting panes around if the layout got screwed up, etc., that's how I hit this.

AFAICS it started with Octave-6.1.0; the GUIs of yet older Octaves (I have 4.2.0 and 5.2.0 still around) are more robust w.r.t. this.

Philip Nienhuis <philipnienhuis>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #54211:  fetab-diffs.txt added by jwe (1KiB - text/plain)

 

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 (Updated the item)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by philipnienhuis
  • -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 group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-04-12 philipnienhuis StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2023-01-11 jwe StatusPatch Submitted Ready For Test
    2023-01-10 jwe Item GroupUnexpected Error or Warning Segfault, Bus Error, etc.
    2023-01-10 jwe StatusNeed Info Patch Submitted
    2023-01-10 jwe Attached File- Added fetab-diffs.txt, #54211
    2022-12-10 ttl StatusNone Need Info
    2022-08-19 philipnienhuis Carbon-Copy- Added ttl

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code