Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assertion failure when running with full tracing
30-08-2011, 09:16 PM
Post: #1
Assertion failure when running with full tracing
When running the device stack with full debug tracing, there are occasional assertion failures as shown in the following trace extract:
OpenHome/Network.cpp:577: -SocketTcpSession::Start() Run session
OpenHome/Network.cpp:431: >SocketTcp::Read
OpenHome/Network.cpp:248: >Socket::Receive H = 68371728, MAX = 4096
OpenHome/Network.cpp:337: Socket::Accept H = 68231624
OpenHome/Network.cpp:257: <Socket::Receive H = 68371728, BC = 210
OpenHome/Network.cpp:443: <SocketTcp::Read
Subscription request from 0.0.0.0:0Assertion failed. OpenHome/Buffer.cpp:383
OpenHome/Network.cpp:339: Socket::Accept Accepted Handle = 68371560
OpenHome/Network.cpp:594: SocketTcpSession::Open 68371560
OpenHome/Network.cpp:530: SocketTcpServer::Terminating 0

I debugged this in Visual Studio and found that the problem is in the method
Code:
void HeaderCallback::Log()
{
    Endpoint::EndpointBuf buf;
    iEndpoint.AppendEndpoint(buf);
    LOG(kDvEvent, buf);
    LOG(kDvEvent, iUri);
}
in DviServerUpnp.cpp. The last line should be replaced by:
Code:
if (iUri.Bytes() > 0) {
    LOG(kDvEvent, iUri);
}
Find all posts by this user
31-08-2011, 02:04 PM
Post: #2
RE: Assertion failure when running with full tracing
(30-08-2011 09:16 PM)simoncn Wrote:  When running the device stack with full debug tracing, there are occasional assertion failures as shown in the following trace extract:
OpenHome/Network.cpp:577: -SocketTcpSession::Start() Run session
OpenHome/Network.cpp:431: >SocketTcp::Read
OpenHome/Network.cpp:248: >Socket::Receive H = 68371728, MAX = 4096
OpenHome/Network.cpp:337: Socket::Accept H = 68231624
OpenHome/Network.cpp:257: <Socket::Receive H = 68371728, BC = 210
OpenHome/Network.cpp:443: <SocketTcp::Read
Subscription request from 0.0.0.0:0Assertion failed. OpenHome/Buffer.cpp:383
OpenHome/Network.cpp:339: Socket::Accept Accepted Handle = 68371560
OpenHome/Network.cpp:594: SocketTcpSession::Open 68371560
OpenHome/Network.cpp:530: SocketTcpServer::Terminating 0

I debugged this in Visual Studio and found that the problem is in the method
Code:
void HeaderCallback::Log()
{
    Endpoint::EndpointBuf buf;
    iEndpoint.AppendEndpoint(buf);
    LOG(kDvEvent, buf);
    LOG(kDvEvent, iUri);
}
in DviServerUpnp.cpp. The last line should be replaced by:
Code:
if (iUri.Bytes() > 0) {
    LOG(kDvEvent, iUri);
}

Thanks for pointing this out. I've committed a fix, but have taken a different approach to the one you suggested.

The LOG macros should accept zero length buffers so I've changed Log::Print(FunctorMsg& , const Brx& ) (which LOG eventually calls once you strip away all the macros) to exit immediately when passed a buffer with Bytes()==0.

This'll hopefully fix the case you spotted plus any similar ones we haven't come across yet too.
Find all posts by this user


Forum Jump: