FW: [wxPython-dev] wxPython 4/wx.Yield: C++ assert failure

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FW: [wxPython-dev] wxPython 4/wx.Yield: C++ assert failure

Joseph Lee

Hi all,

 

For Jamie: I’ll test Robin’s answer to see what’s going on.

Cheers,

Joseph

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Robin Dunn
Sent: Thursday, April 27, 2017 12:17 AM
To: [hidden email]
Subject: Re: [wxPython-dev] wxPython 4/wx.Yield: C++ assert failure

 

Joseph Lee wrote:

Hi Robin and others,

 

In one of the projects I’m involved in (NonVisual Desktop Access), numerous calls to wx.Yield function are made from various modules. After porting NVDA to wxPython 4 alpha, when wx.Yield is called from some modules, I get a traceback that ends with the following:

wxAssertionError: C++ assertion "Assert failure" failed at ..\..\src\common\evtloopcmn.cpp(110) in wxEventLoopBase::Yield(): wxYield called recursively

 

Relevant GitHub issue for NVDA can be found at:

https://github.com/nvaccess/nvda/issues/7077

 

The source code for a version of NVDA that uses wxPython 4 can be found at:

https://github.com/josephsl/nvda

 

Branch is “wxPy4”. I and other NVDA developers involved in porting NVDA to wxPython 4 consider this a showstopper, with a lead developer commenting that this might be due to reentrancy issue.


Yes. Basically some event(s) happens while within a wx.Yield call which then results in some other code being called that uses wx.Yield.

The best fix would be to find ways to avoid needing to use yield. Otherwise you could switch to wx.YieldIfNeeded() (which is just a convenience wrapper for wx.GetApp().Yield(True)...) That will just return when the recursion is detected instead of asserting about it.  The wx.EventLoopBase.Yield documentation is applicable to this as all the incarnations of Yield eventually get to that method.

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel