Jump to content

[SOLVED] DISConnector crash after upgrade to Unigine 2.9.0.2


photo

Recommended Posts

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:

a6c47ccb683801fa8adfa70b46adc996.png.4b46df862956225019ed976a5097ba57.png7c6b8c03d59f41ecb0873f607bdd1338.png.339493227c88b48af73f72c41cd97536.png

 

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:

6f1216fbe68e2a50abb63b854bd2cbbb.png.8cfb4e5e3cc2485a2406971ab4f8f00f.png

 

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

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

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 by enrique.trilles
Link to comment

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.

  • Like 1
Link to comment
  • silent changed the title to [SOLVED] DISConnector crash after upgrade to Unigine 2.9.0.2
×
×
  • Create New...