bugGNU Octave - Bugs: bug #53802, octave deadlocks with deletefcn...

 
 

bug #53802: octave deadlocks with deletefcn callback that calls graphical function

Submitter:  Guillaume <gyom>
Submitted:  Tue 01 May 2018 11:12:16 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  3 - Low Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 12 Jan 2019 04:38:21 PM UTC, comment #4: 

I confirm it has been fixed in the meantime. Thanks.

Guillaume <gyom>
Sat 12 Jan 2019 12:14:41 AM UTC, comment #3: 

Somewhere along the way this has been fixed (just tested with 26522:d6a4237a26b4 on stable).  Closing report.

Rik <rik5>
Group administrator
Wed 02 May 2018 06:34:47 AM UTC, comment #2: 

We addressed something similar to this in the past, but I think that was merely a simple C++ fix:

https://savannah.gnu.org/bugs/?func=detailitem&item_id=52666

However, Rik is probably correct here.

To explain the freeze, keep in mind that the hand-shaking for the Qt input dialog class of functions is programmed to put the worker thread to sleep when the user is engaged in responding to the dialog box.  That was my crude way of doing thread-safe sequential programming when at the time the Qt input dialog class was added there was no designed cross-thread protocol.

So, what could be happening is that the figure-closing graphics operations are interfering with the display of the question-dialog.  Rather than freezing, think of this one as Octave core (worker thread) waiting for the user to answer a question when there is no dialog box and button to click showing on the screen.

Notice the CPU monitor shows ostensibly 0% whereas for a freeze there is typically some sort of infinite loop with 100% CPU usage.

Dan Sebald <sebald>
Tue 01 May 2018 10:40:08 PM UTC, comment #1: 

Confirmed.  It probably isn't a very common occurrence so I lowered the priority, but this should work.  I actually wrote a little m-file mydel.m for testing


function mydel (h)
  keyboard;
  btn = questdlg ('Do you want to quit');
  if (strcmp (btn, 'Yes'))
    delete (h);
  endif
endfunction


I then used


figure ('deletefcn', @mydel)


and finally closed the figure.

stepping through the code, the problem was the call to questdlg.

Incidentally, using the FLTK toolkit a dialog was correctly shown so this is likely to be a cross-thread issue with Qt.

Rik <rik5>
Group administrator
Tue 01 May 2018 11:12:16 AM UTC, original submission:  

Incidentally found that the following freezes Octave when closing the figure:


figure ("deletefcn", "questdlg ('quit')")


It's a rather odd construct (I meant to use CloseRequestFcn) so it might be a low priority corner case.

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 rik5 (Posted a comment)
  • -email is unavailable- added by gyom (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
    2019-01-12 mtmiller Carbon-CopyRemoved 80942 -
    2019-01-12 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2018-05-01 rik5 Priority5 - Normal 3 - Low
    2018-05-01 mtmiller CategoryPlotting Plotting with OpenGL
        StatusNone Confirmed
        SummaryFreeze with deletefcn callback octave deadlocks with deletefcn callback that calls graphical function

    Back to the top

    Powered by Savane 3.14-49f2.
    Corresponding source code