Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unhandled exception
11-04-2014, 03:49 AM
Post: #1
Unhandled exception
app crash sometimes when start, as below:
ERROR: Recursive lock attempted on mutex PRX2 from thread EventSession 0
Unhandled exception AssertionFailed at OpenHome/Net/ControlPoint/Upnp/EventUpnp.cpp:168 in thread EventSession 0

I can't find where it happened.

Can I solve this problem by using OpenHome::SetAssertHandler? Or is there other way to solve this unhandled exception.
Find all posts by this user
11-04-2014, 07:53 AM
Post: #2
RE: Unhandled exception
(11-04-2014 03:49 AM)pz003 Wrote:  app crash sometimes when start, as below:
ERROR: Recursive lock attempted on mutex PRX2 from thread EventSession 0
Unhandled exception AssertionFailed at OpenHome/Net/ControlPoint/Upnp/EventUpnp.cpp:168 in thread EventSession 0

I can't find where it happened.

Can I solve this problem by using OpenHome::SetAssertHandler? Or is there other way to solve this unhandled exception.

Assertion failures indicate a programming error. It is not possible (or desirable) to catch these at runtime and continue program execution.

This particular error looks like it could only be caused by entering two getters for state variable values (probably named Property[StateVariableName](Type& aVal)) on the same thread. This shouldn't be possible. The only way I can see for it to happen would be if you were trying to catch AssertionFailed exceptions and missing an earlier error showing an attempt to read a state variable that the remote device has never updated (so, probably an optional state variable that some device on your network doesn't implement).

Does this sound possible?
Find all posts by this user
11-04-2014, 12:29 PM
Post: #3
RE: Unhandled exception
I think I know what the problem is. Any property getter that throws PropertyError (likely because the property is optional and not enabled on a given device) will leave a mutex locked. The next code to call any getter on the same service from the same thread will then assert.

The fix for this will need to be in ohNet. I'll do this in the next couple of days.
Find all posts by this user
16-04-2014, 01:24 AM
Post: #4
RE: Unhandled exception
please let me know when you finish it, thank you!

(11-04-2014 12:29 PM)simonc Wrote:  I think I know what the problem is. Any property getter that throws PropertyError (likely because the property is optional and not enabled on a given device) will leave a mutex locked. The next code to call any getter on the same service from the same thread will then assert.

The fix for this will need to be in ohNet. I'll do this in the next couple of days.
Find all posts by this user
16-04-2014, 08:11 AM
Post: #5
RE: Unhandled exception
(16-04-2014 01:24 AM)pz003 Wrote:  please let me know when you finish it, thank you!

Now complete. The code is available on github.
Find all posts by this user


Forum Jump: