bugGNU Octave - Bugs: bug #58403, "uicontextmenu" property...

 
 

bug #58403: "uicontextmenu" property is not empty immediately after deleting corresponding graphics object

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Tue 19 May 2020 01:15:01 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 6.0.90 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 26 Oct 2020 10:37:13 AM UTC, comment #3: 

Closing as a duplicate of bug #53513.

Markus Mützel <mmuetzel>
Group administrator
Sun 25 Oct 2020 04:48:09 PM UTC, comment #2: 

Do you know why `invokeMethod` fails?
The qt documentation for that method states:
https://doc.qt.io/qt-5/qmetaobject.html#invokeMethod

> Returns false if there is no such member or the parameters did not match.


Could it be that `invokeMethod` is called before "slotFinalize" is installed?
If that is the case, is there a way to make sure that slot is installed early enough?

Markus Mützel <mmuetzel>
Group administrator
Fri 22 May 2020 09:03:58 PM UTC, comment #1: 

The current workflow is as follows:
1- uicontextmenu object deletion requested
2- notify the gui thread that it should delete the ContextMenu object and release its reference to the uicontexmenu. Block the interpreter thread until it's done.
3- delete the last reference to the uicontextmenu held by the gh_manager.
4- handle the uicontextmenu property in the uicontextmenu destructor

But if step 2 fails, the destructor won't get called in time (at all?)

I tried hard to use Qt's blocking connections to have predictable behavior, but it doesn't look like the correct approach: sometimes invokeMethod will fail to execute the requested slot and your only choice is to try again (and implement  your own local ugly blocking connection).


The attached patch will probably help in reducing the probability that this bug happens but is a fig leaf. 
This BlockingQueuedConnection method has improved stability, but turns out to be very slow and is still unpredictable.





(file #49150)

Pantxo Diribarne <pantxo>
Group Member
Tue 19 May 2020 01:15:01 PM UTC, original submission:  

The tests for the buildbots sporadically fail for this BIST:

>>>>> processing /scratch/buildbot/workers/jwe-debian-x86_64-3/gcc-7-lto-debian/build/libinterp/corefcn/graphics.cc-tst
***** test
 hf = figure ("visible", "off");
 hax = axes ("parent", hf);
 unwind_protect
   hctx1 = uicontextmenu ("parent", hf);
   hctx2 = uicontextmenu ("parent", hf);
   set (hf, "uicontextmenu", hctx2);
   set (hax, "uicontextmenu", hctx2);
   assert (get (hf, "uicontextmenu"), hctx2);
   assert (get (hax, "uicontextmenu"), hctx2);
   assert (get (hf, "children"), [hctx2; hctx1; hax]);
   delete (hctx2);
   assert (get (hf, "uicontextmenu"), []);
   assert (get (hax, "uicontextmenu"), []);
   assert (get (hf, "children"), [hctx1; hax]);
   set (hf, "uicontextmenu", hctx1);
   assert (get (hf, "uicontextmenu"), hctx1);
   set (hf, "uicontextmenu", []);
   assert (get (hf, "uicontextmenu"), []);
   assert (get (hf, "children"), [hctx1; hax]);
 unwind_protect_cleanup
   close (hf);
 end_unwind_protect;
!!!!! test failed
ASSERT errors for:  assert (get (hf, "uicontextmenu"),[])
  Location  |  Observed  |  Expected  |  Reason
     .          O(1x1)       E(0x0)      Dimensions don't match


See e.g.:
http://buildbot.octave.org:8010/#/builders/24/builds/1235/steps/6/logs/stdio

This is probably a multi-threading issue that leads to the "uicontextmenu" property of the figure not being empty immediately after the corresponding "uicontextmenu" graphics object is deleted.

I also see this error randomly when running "make check" on my system.

Markus Mützel <mmuetzel>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #49150:  bug58403.patch added by pantxo (1KiB - text/x-patch)

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by mmuetzel (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-10-26 mmuetzel StatusConfirmed Duplicate
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #53513
    2020-05-22 pantxo Attached File- Added bug58403.patch, #49150

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code