OpenHome Forum
[Solved] EventSessionUpnp::Run unexpected execution - Printable Version

+- OpenHome Forum (http://forum.openhome.org)
+-- Forum: OpenHome (/forumdisplay.php?fid=1)
+--- Forum: Net (/forumdisplay.php?fid=5)
+--- Thread: [Solved] EventSessionUpnp::Run unexpected execution (/showthread.php?tid=1566)



[Solved] EventSessionUpnp::Run unexpected execution - ChriD - 31-12-2016 04:56 PM

Hi,
I get following exception sometimes

Code:
Unhandled exception AssertionFailed at OpenHome/Net/ControlPoint/Upnp/EventUpnp.cpp:182 in thread EventSession 2

AssertHandlerDefault
OpenHome::CallAssertHandler
OpenHome::Net::EventSessionUpnp::Run
OpenHome::SocketTcpSession::Start
OpenHome::MemberTranslator<OpenHome::SocketTcpSession,void (__thiscall OpenHome::SocketTcpSession::*)(void)>::Thunk
OpenHome::Functor::operator()
OpenHome::ThreadFunctor::Run
OpenHome::Thread::EntryPoint
threadEntrypoint
BaseThreadInitThunk
RtlSubscribeWnfStateChangeNotification
RtlSubscribeWnfStateChangeNotification
RtlSubscribeWnfStateChangeNotification

What may be the problem here?


RE: EventSessionUpnp::Run unexpected execution - simonc - 04-01-2017 09:25 AM

Callbacks that run when a property changes are not allowed to throw. This assertion fails if one of them does throw.

The immediate fix would be to review all of your code, adding try...catch blocks as appropriate. I can see this'll be a bit of a pain to maintain. Later, I'll change ohNet to silently consume any exceptions instead.


RE: EventSessionUpnp::Run unexpected execution - ChriD - 05-01-2017 01:31 PM

Ok, Thanks! I'll check this.
I thought i have added try catch blocks in every callback. I may have forgotten one


RE: EventSessionUpnp::Run unexpected execution - ChriD - 06-01-2017 07:03 PM

I've digged a little deeper and i found out that it happens sometimes on a renderer on the "AVTRansport" "LastChanged" event

And the throw comes from the Os/Windows/SignalHandlers.cpp on line 19
(EXCEPTION_ACCESS_VIOLATION)

So in fact the problem was that i used an undefined pointer in some case (shame on me) and therfore the callback crashed