bugGNU Octave - Bugs: bug #51954, exit in Command Window hangs GUI

 
 

bug #51954: exit in Command Window hangs GUI

Submitter:  Rik <rik5>
Submitted:  Wed 06 Sep 2017 07:57:37 PM UTC
   
 
Category:  GUI Severity:  4 - Important
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 08 Sep 2017 03:34:02 PM UTC, comment #10: 

@Dan: your patch works fine for me so I committed it here (http://hg.savannah.gnu.org/hgweb/octave/rev/46dc1ba54f7f).

Rik <rik5>
Group administrator
Thu 07 Sep 2017 05:16:41 PM UTC, comment #9: 

Octave should be deleting these resources if it owns them.  Before my style changes, there was no destructor for the variable editor.  So I added one, thinking it was just an unintentional omission.  But then you discovered that there was trouble, so I just commented out the actions as a quick fix.  I will try to take a closer look at it soon.

John W. Eaton <jwe>
Group administrator
Thu 07 Sep 2017 04:40:05 PM UTC, comment #8: 

I'll let jwe apply it if it makes sense.  When would the variable editor by destroyed?  Is it only at program exit, in which case we probably don't care too much.  Or does clicking the close button on an undocked Variable Editor window also destroy the object?  In that case we could have memory leaks.

Rik <rik5>
Group administrator
Thu 07 Sep 2017 03:22:42 AM UTC, comment #7: 

After compiling the latest, I added back the line of code that deletes m_main.  I don't see any errors when exiting.  Patch attached.


(file #41751)

Dan Sebald <sebald>
Wed 06 Sep 2017 10:01:06 PM UTC, comment #6: 

Regarding this comment:


variable_editor::~variable_editor (void)
{
  // FIXME: This doesn't work yet.
  //
  //  delete m_main;
  //  delete m_tool_bar;
  //  delete m_tab_widget;
}


The m_tool_bar and m_tab_widget look to be created with a non-NULL parent, i.e.,


    m_main (new QMainWindow ()),
    m_tool_bar (new QToolBar (m_main)),
    m_tab_widget (new QTabWidget (m_main)),


QMainWindow is probably a container class, meaning that it takes responsibility of cleaning up all the objects that it holds.  Calling delete on m_tool_bar and m_tab_widget means delete is most likely done twice, the second time being an error.

Whether delete needs to be called on m_main, isn't so clear.  (Notice it has no parent passed into the constructor.)  Should look if that is being cleaned up indirectly somehow.

Dan Sebald <sebald>
Wed 06 Sep 2017 08:57:01 PM UTC, comment #5: 

Change works for me as well, closing report.

Rik <rik5>
Group administrator
Wed 06 Sep 2017 08:52:06 PM UTC, comment #4: 

Ok, thanks, this change works for me.

Mike Miller <mtmiller>
Group Member
Wed 06 Sep 2017 08:44:55 PM UTC, comment #3: 

The func (void) syntax should work.

I was able to duplicate the problem but don't see it after making the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/b0e696ea6487

Some work is apparently needed with data ownership in the variable editor.

John W. Eaton <jwe>
Group administrator
Wed 06 Sep 2017 08:07:46 PM UTC, comment #2: 

I suspect that the Qt SIGNAL and SLOT definitions do not work with the "func (void)" syntax.

Mike Miller <mtmiller>
Group Member
Wed 06 Sep 2017 08:05:59 PM UTC, comment #1: 

Using hg bisect, the first bad revision is


changeset:   24014:bffd7d826887
user:        John W. Eaton <jwe@octave.org>
date:        Wed Sep 06 12:53:28 2017 -0400
summary:     style fixes for some GUI source files


Adding jwe to the CC list.

Rik <rik5>
Group administrator
Wed 06 Sep 2017 07:57:37 PM UTC, original submission:  

Typing 'exit' in the Command Window, i.e. Octave thread, causes the GUI to become unresponsive.  I have to eventually kill the process or kill the window using the window manager.  This is pretty recent, hg id == e327adeae7a0.  100% CPU utilization while the GUI is sitting there.

Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-07 sebald Attached File- Added octave-delete_variable-editor_m_main_window-djs2017sep06.patch, #41751
    2017-09-06 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2017-09-06 jwe StatusConfirmed Ready For Test
    2017-09-06 mtmiller Severity3 - Normal 4 - Important
        StatusNone Confirmed
    2017-09-06 rik5 Carbon-Copy- Added jwe

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code