enrique.trilles Posted September 24, 2019 Share Posted September 24, 2019 Hi. We upgraded our project to Unigine 2 Sim 2.9.0.2 version, but after this, the DISConnector from our app crashes with an exception thrown by DISConnector. The exception thrown by the application, and the CallStack looks like this: The only configuration we do to our connector is shown here: bool ConnectorManager::InitDIS() { int index = Engine::get()->findPlugin("DISConnector"); if (index < 0) { Log::error(">>>> ConnectorManager::InitDIS(): DISConnector plugin NOT loaded!\n"); return false; } _disConnector = (IG::DIS::ConnectorInterface*)Engine::get()->getPluginData(index); BindAllCallbacks(); Log::message(">> ConnectorManager::InitDIS(): Disconnector plugin LOADED!\n"); return true; } void ConnectorManager::BindAllCallbacks() { /* _disConnector->setCallbackOnRecvPacket calls here... */ } Memory right at the end of the InitDIS() call looks like this: We assume the problem lies on that "connected => false" and the "on_connect = 0xcdcdcdcd...". We think we are missing some function call for a correct setup of the plugin, but after checking the DISConnectorInterface.h file, we don't know which one could be the 'culprit' of our problems. Any idea of what is the problem here? Thanks for your time. Link to comment
cash-metall Posted September 25, 2019 Share Posted September 25, 2019 something happened with the "on_connect" callback if (on_connect) on_connect->run(); please check in BindAllCallbacks what exactly you insert in _disConnector->setConnectCallback(/*here*/); Also check that the source/include/plugins contain files from the SDK/sdks/sim_windows_2.9.0.2/utils/project/template/ig/include/plugins. There may have been migration errors. Link to comment
enrique.trilles Posted September 25, 2019 Author Share Posted September 25, 2019 (edited) Hi. Some update: 1) I double checked plugin's files and they are updated to the 2.9 version. 2) The on_connect attribute is protected/privated and I have no way to access it (I can see its value because of the debugger). 3) It seems the problem lies in the "setConnectCallback" function. Our BindAllCallbacks function looks like this: void ConnectorManager::BindAllCallbacks() { int pduType = 1 // PDU types here _disConnector->setCallbackOnRecvPacket(pduType, MakeCallback(&GetDISPackageManager(), &DISPackageManager::OnPDUReceived)); /* More PDU listing... */ } We are not calling the setConnectCallback and I guess this is the problem. After updating the code, it looks like this now: bool ConnectorManager::InitDIS() { int index = Engine::get()->findPlugin("DISConnector"); if (index < 0) { Log::error(">>>> ConnectorManager::InitDIS(): DISConnector plugin NOT loaded!\n"); return false; } _disConnector = (IG::DIS::ConnectorInterface*)Engine::get()->getPluginData(index); _disConnector->setConnectCallback( MakeCallback(this, &OnConnect) ); BindAllCallbacks(); Log::message(">> ConnectorManager::InitDIS(): Disconnector plugin LOADED!\n"); return true; } void ConnectorManager::OnConnect() { Log::message("ConnectorManager::OnConnect() callback OK!\n"); } Now, the app crashes when calling the "setConnectCallback" line, with the same exception throw. My guess now is that the function signature is not correct. That function should have 0 parameters, or are we missing something? EDIT: I created an empty project on Unigine2.9.0.2 with just the connectors to make some clean tests without all of our application's code, and the crash still remains. KDIS version is 2.9.0 Edited September 25, 2019 by enrique.trilles Link to comment
silent Posted September 25, 2019 Share Posted September 25, 2019 Please, check if you have the same issue with patched DIS (from support ticket 2174). Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
enrique.trilles Posted September 25, 2019 Author Share Posted September 25, 2019 Hi. After updating the plugin with the patch you have provided in the ticket 2174, everything works fine now! Wathever the problem was, its now solved. Thanks for your time. 1 Link to comment
Recommended Posts