USNavalResearchLaboratory / norm

NACK-Oriented Reliable Multicast (NORM) implementation & tools (RFCs 5740, 5401)
https://www.nrl.navy.mil/Our-Work/Areas-of-Research/Information-Technology/NCS/NORM/
Other
96 stars 33 forks source link

NormRestartInstance cause ASSERT INVALID_DESCRIPTOR error #67

Closed honglei closed 1 year ago

honglei commented 2 years ago

test code:

    NormInstanceHandle instance = NormCreateInstance();
    NormRestartInstance(instance);

assert error position: protolib\src\common\protoDispatcher.cpp(2192)

bool ProtoDispatcher::InstallBreak()
{
    ASSERT(INVALID_DESCRIPTOR == break_event.GetDescriptor());
bebopagogo commented 1 year ago

I tried to recreate this issue but I am not having a problem with this call sequence. I looked at the code and the NormRestartInstance() first stops if needed (which removes/invalidates the break_event descriptor) before it then starts the instance again. What operating system are you testing with?

honglei commented 1 year ago

Env: Win10/VC2022 x64/Python3.10 x64

bebopagogo commented 1 year ago

That helped. I found the issue. The Windows ProtoEvent::Close() code was resetting the "event_handle" to NULL instead of to INVALID_HANDLE value as it should. I have committed and pushed a fix to Protolib and updated the NORM git repo accordingly.

Thanks for catching this and let me know if this resolves the issue for you and we can close this item.

honglei commented 1 year ago

Problem solved!