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


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

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

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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>
Project 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);
   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]);
   close (hf);
!!!!! test failed
ASSERT errors for:  assert (get (hf, "uicontextmenu"),[])
  Location  |  Observed  |  Expected  |  Reason
     .          O(1x1)       E(0x0)      Dimensions don't match

See e.g.:

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>
Project Member


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

Attach Files:

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


Depends on the following items: None found

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)

    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.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-22 pantxo Attached File- => Added bug58403.patch, #49150

    Back to the top

    Powered by Savane 3.5