certi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [certi-dev] Unable to create RTI ambassador


From: Jan-Patrick Osterloh
Subject: Re: [certi-dev] Unable to create RTI ambassador
Date: Mon, 12 Sep 2011 13:12:43 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.21) Gecko/20110830 Lightning/1.0b2 Thunderbird/3.1.13

Am 07.09.2011 23:08, schrieb Eric Noulard:
>
>> I compared it with the one outside X-Plane, and there the RTIA
>> constructor is called. In the createRTIambassador method, the
>> CreateProcess is called with
>> C:/Programme/CERTI/bin/rtia.exe -f 404
>> within xplane, and with
>> C:/Programme/CERTI/bin/rtia.exe -f 1860
>> I've run it multiple times, and these numbers (404 and 1860) seem to be
>> very stable, at least in my few runs it have been always the same. Don't
>> know if this important.
> Not really, at least I don't think so.
> rtia uses -f when run in "file descriptor mode"
> it could use -p when used in TCP mode.
> TCP mode is used if you compile CERTI with RTIA_USE_TCP.

I will try this. Is this a flag that I have to set in cmake, or can I
also use this in the makefile?


>
>>> You can try with the debugger but it's sometimes difficult to debug
>>> multiple processes.
>>>
>>> Are you sure that your RTIambassador object is not going out-of-scope?
>> The RTIambassador is stored in a static object that my wrapper has. I
>> see from my debugging that after the NetworkError exception is thrown,
>> the descructor of the ambassador is called.
> How would destructor be called if constructor is not?

The constructor of the RTIambassador is called, but fails with an
exception. I assume that therefore the destructor is called for cleanup...


>
>>> I think that in our ugly XPlane plugin we had to put the federate object
>>> (which contains the RTIambassador object instance) as a pointer in
>>> global scope (of the DLL)
>>> and create the object inside:
>>> PLUGIN_API int XPluginStart(char* outName, char* outSig, char* outDesc)
>> I do something similar, but I have my instance of the ambassador in my
>> wrapper object. Unfortunatly, he's already crashing in the constructor
>> part...
> Could you debug into
> rti1516::RTIambassadorFactory::createRTIambassador
> and go step by step in there in order see if something goes wrong in there?

I already did this, by adding the following macro to the cpp file:

#define dbg \
    { \
      FILE *logfiletmp = fopen("out2.txt","at"); \
      fprintf (logfiletmp, "DBG: %s::%s::%d\n", __FILE__, __FUNCTION__, 
__LINE__); \
      fclose (logfiletmp); \
    }


Adding dbg commands to several lines in the code, I see which lines are
executed (I had to print it to a file, as console output is somehow lost
within xplane).
See attached PDF for the code, and here is the output:

DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::RTIambassadorFactory::39
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::53
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassador.cpp::RTIambassador::112
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::55
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::57
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::61
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::63
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::65
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::67
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::77
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::86
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::97
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::107
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::110
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::123
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::133
 --> C:/Programme/CERTI/bin/rtia.exe -f 404
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::146
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::152
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::158
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::160
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::162
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::166
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::230
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::242
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::244
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::246
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::248
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassadorFactory.cpp::createRTIambassador::250
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::182
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::184
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::186
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::188
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::190
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::208
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::213
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::218
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::182
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::184
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::186
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::188
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::193
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::195
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::198
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::200
DBG: 
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambassador.cpp::~RTIambassador::117


So, for me everything looks OK.

In execution outside xplane, I get additionally:
DBG:
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::212
DBG: d:/home/patrick/eclipse/certi/certi/RTIA/RTIA.cc::RTIA::49
DBG: d:/home/patrick/eclipse/certi/certi/RTIA/RTIA.cc::RTIA::51
DBG: d:/home/patrick/eclipse/certi/certi/RTIA/RTIA.cc::RTIA::55
DBG: d:/home/patrick/eclipse/certi/certi/RTIA/RTIA.cc::RTIA::64
DBG: d:/home/patrick/eclipse/certi/certi/RTIA/RTIA.cc::RTIA::69
DBG:
d:/home/patrick/eclipse/certi/certi/libRTI/RTI1516ambPrivateRefs.cpp::executeService::214

In xplane, I get the same lines, but after executeService::200 it
diverges due to the error.

I will try to compile it with the TCP flag. If this doesn't work, I may
ask the xplane developers, if they have an idea (e.g. if xplane doesn't
allow opening new processes).

Bye
JPO


-- 
Dipl. Inform. Jan-Patrick Osterloh
FuE Bereich Verkehr | R&D Division Transportation
Human Centered Design Group

OFFIS
FuE Bereich Verkehr | R&D Division Transport
Escherweg 2 - 26121 Oldenburg - Germany
Phone/Fax: +49 441 97 22-524/502
E-Mail: address@hidden
URL: http://www.offis.de

Attachment: RTI1516ambassadorFactory.pdf
Description: Adobe PDF document

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]