bugGNU Octave - Bugs: bug #53342, Figure property IntegerHandle does...

 
 

bug #53342: Figure property IntegerHandle does not work fully with Qt toolkit

Submitted by:  Guillaume <gyom>
Submitted on:  Wed 14 Mar 2018 10:44:28 AM UTC  
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

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)

Wed 02 Jan 2019 05:32:05 PM UTC, comment #10:

Since this no longer causes a crash I have marked this bug as fixed on the 5.0 release checklist. I've modified the Item Group on this bug report to "Feature Request" for the remaining two items.

Rik <rik5>
Project Administrator
Tue 17 Apr 2018 06:56:28 PM UTC, comment #9:

@Pantxo: Why are we storing the handle as a data member in the Figure object on the Qt side of things? Is it for performance?

It seems like any time we need the handle we could just get the property "__myhandle__" from the figure::properties object directly rather than using the cached m_handle value.

If we don't want to do the approach above, should we add a setter routine to the Figure object so that the renumber function could call it and update the m_handle variable?

Rik <rik5>
Project Administrator
Thu 29 Mar 2018 10:17:36 AM UTC, comment #8:

The fix for bug #53487 seems to prevent a segfault here too, thanks jwe.

There is still a problem in the two examples below when the figure handle changes value (the figure become unusable) but at least it's not crashing any more:

Perhaps the title of this report could be updated to reflect the improvement?

Guillaume <gyom>
Mon 26 Mar 2018 10:16:55 AM UTC, comment #7:

Thanks for the feedbacks. First, a perhaps more interesting stack trace:

Now, unless there is a simple fix, I wonder if we shouldn't just make the "IntegerHandle" property read-only, with the only way to define it being during the construction of the figure, i.e.:

The situation in which I came across this bug is the following:

Interacting with the figure (e.g. a click on "Z+") creates a segfault. The issue here is with struct2hdl which creates a "naked" figure then adds properties, one at a time. Passing some or all of the properties when the figure is constructed would circumvent the bug found here and might anyway be a necessity as, for example, we will have anyway to do something like this for other properties such as "Visible" (to prevent a figure flashing when none was meant to be visible).

In summary, I think the use of the "IntegerHandle" property could be restricted without much loss of functionality, with struct2hdl modified accordingly. This would be a departure from Matlab but a small one in my opinion and this could be revisited when graphics handles as objects are introduced.

Guillaume <gyom>
Fri 23 Mar 2018 10:54:47 PM UTC, comment #6:

The problem is that the orignal figure handle is stored in the Figure object ("m_handle" member) and we try to use it to retrieve the figure properties. We currently have no mechanism to signal the handle value change.

Pantxo Diribarne <pantxo>
Project Member
Fri 23 Mar 2018 06:46:39 PM UTC, comment #5:

It seems that the real problem is that the Qt toolkit is not properly handling the switch to non-integer handles.

It works properly in the FLTK toolkit. To see what FLTK does, start here: http://hg.savannah.gnu.org/hgweb/octave/file/0b9e7fcaab91/libinterp/dldfcn/__init_fltk__.cc#l2343

In the QtHandles code, this function is called with pId set to ID_INTEGERHANDLE:

http://hg.savannah.gnu.org/hgweb/octave/file/0b9e7fcaab91/libgui/graphics/ObjectProxy.cc#l86

From there, the sendUpdate signal is emitted and handled in this function:

http://hg.savannah.gnu.org/hgweb/octave/file/0b9e7fcaab91/libgui/graphics/Object.cc#l84

The default case is executed but by that point the object is no longer valid. So QtHandles doesn't update the internal value for the figure handle ID. Things get worse from that point on.

I'm not sure of what the proper fix is. I'm not sure we have enough information at that point to renumber the figure, so some significant changes may be needed.

John W. Eaton <jwe>
Project Administrator
Fri 23 Mar 2018 04:50:13 PM UTC, comment #4:

I don't know whether it will help in this case, but it is sometimes useful to get the stack traces for all the threads, not just the default one. Try

to see whether there are any other clues about what else is going on at the point of the crash.

John W. Eaton <jwe>
Project Administrator
Wed 14 Mar 2018 03:16:12 PM UTC, comment #3:

Confirmed. It also crashes Octave with other uicontrol styles.

Pantxo Diribarne <pantxo>
Project Member
Wed 14 Mar 2018 11:15:01 AM UTC, comment #2:

And here is the stack trace, unfortunately rather limited:

Guillaume <gyom>
Wed 14 Mar 2018 11:01:48 AM UTC, comment #1:

I guess it's related to the number of the figure changing after the uicontrol being created as the following works:

On the way, noticed that the "Number" property of a figure is missing, opening another bug report/feature request for that.

Guillaume <gyom>
Wed 14 Mar 2018 10:44:28 AM UTC, original submission:

Running this:

and moving the mouse pointer to the button at the bottom left of the figure creates a segfault.

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

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

    Only project members can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-02 rik5 Item GroupSegfault, Bus Error, etc. => Feature Request
    2018-04-17 rik5 SummarySegfault in figure with property IntegerHandle set to off => Figure property IntegerHandle does not work fully with Qt toolkit
    2018-03-14 pantxo CategoryPlotting => Plotting with OpenGL
        StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.4