Assertion failed: pDacsSystem != NULL

Is this a known issue while creating a DACS authorization context? The release libraries work fine, the only debug build has this error. I'm using OpenDACS 8.0.0L1 with RFA 8.1.3.L1 linked statically on Windows 32 bit / Visual C++ 12. Got following error:

Assertion failed: pDacsSystem != NULL, file C:\Jenkins\workspace\RFACPPDEV_RCDEV\OS\VS120-32\rcdev\source\dlib\cppdacslib\src\DacsLibThread.cpp, line 184

Failed stack trace:

NtWaitForSingleObject (ntdll.dll)

WaitForSingleObjectEx (kernel32.dll)

WaitForSingleObject (kernel32.dll)

crt_sig_handler (...]

raise (MSVCR120D.dll)

CrtSetReportHookW2 (MSVCR120D.dll)

VCrtDbgReportW (MSVCR120D.dll)

CrtDbgReportW (MSVCR120D.dll)

CrtDbgReportW (MSVCR120D.dll)

memcmp (MSVCR120D.dll)

abort (MSVCR120D.dll)

wassert (MSVCR120D.dll)

rfa::dacs::CDacsLibThread::runThread (...) [c:\jenkins\workspace\rfacppdev_rcdev\os\vs120-32\rcdev\source\dlib\cppdacslib\src\dacslibthread.cpp:184]

rfa::support::Thread::startWrapper (...) [c:\jenkins\workspace\rfacppdev_rcdev\os\vs120-32\rcdev\source\rfaut\common\support\os\impl\thread.cpp:46]

beginthreadex (MSVCR120D.dll)

endthreadex (MSVCR120D.dll)

BaseThreadInitThunk (kernel32.dll)

RtlInitializeExceptionChain (ntdll.dll)

RtlInitializeExceptionChain (ntdll.dll)


I have following code for creating the context. I checked that dacsAuthSystem is not NULL.

dacsAuthSystem->createAuthorizationAgent( rfac::RFA_String( "some name" ), false /*withCompleteEvents*/ );

The issue is not consistent.

Best Answer

  • The issue occurs only on Open DACS debug library when application reinitialize Open DACS AuthorizationSystem immediately after uninitializing previous AuthorizationSystem to close connection. The issue can be replicated on dacsSubscribeClient example which is modified to repeat the following sequences: 1. Open daemon connection, 2. Log in, 3. Check subscription permission, 4. Log out, 5. Closing daemon connection. Sleep() call needs to be removed from last step.

            if (pClient != NULL) {
                /******************************************************************
                * Following waiting code is for allowing usage logging process to
                * complete before exiting program.
                ******************************************************************/
                // Remove this Sleep call
    //SLEEP(USAGE_LOGGING_WAIT*1000);

                // Close daemon connection.
                pClient->closeDaemonConnection();
            }

    Development has explained that the debug library would build a lot of debug information, so it would cause more delay, then the other transaction such as usage logging is not completed yet. Application have to waiting for usage logging process to complete before it can do next step. However, they cannot find any other solution to avoid the sleep call.

    The “SLEEP” added generally is suggested to waiting for other transactions to complete. If no “SLEEP” added, possibly it is ok to continue, possibly it would trigger a failure. This depends on the CPU speed/server performance.
    There is potential issue that the usage logging process is still in progress.

    I have also suggested another solution to keep the connection to DACS opened. Once the application wants to do permission check, it will just sends login, checkSubscrciption and logout.

Answers