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: Eric Noulard
Subject: Re: [certi-dev] Unable to create RTI ambassador
Date: Wed, 7 Sep 2011 23:08:21 +0200

2011/9/1 Jan-Patrick Osterloh <address@hidden>:
> Am 31.08.2011 19:52, schrieb Eric Noulard:
>>
>> Coud you add manual trace (using std::cout or std::cerr inside RTIA 
>> constructor
>> and destructor (see CERTI/RTIA/RTIA.cc file)
>>  in order to check whether if RTIA destructor is not called prematurely.
> I added some output into the RTIA.cc and also the
> RTI1516ambassadorFactory.cpp::createRTIambassador. I figured out, that
> in case I start everything in X-Plane, the RTIA constructor is never
> called.

This is really strange, but explains a lot.
If RTIA is not created then Federate cannot connect to it thus your failure.
Now the question WHY  RTIA is not called?

> 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.


>> The fork/CreateProcess is done inside RTIambassador constructor:
>> CERTI/libRTI/RTIambassador.cc lines 167--348, you can add traces in
>> there as well.
> I did it, but it is never called. Maybe because I use RTI1516? I should
> have mentioned this, sorry.

Yes right when using 1516 you should look into the 1516 specific file.
LibRTI has duplicate for 1.3 and 1516 API because it's hard to avoid.
libCERTI, RTIA and RTIG are multistandard.

>> 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?

> From what I had debugged,
> the exception occours when he's waiting for RTIA replay
> (rep->receive(socketUn,msgBufReceive);) in the
> RTI1516ambPrivateRefs.cpp::executeService().

Yes it's again a symptom that RTIA either did not start or died prematurely.

>> 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?



>>> No, I've got a "fresh", just started RTIG, without any other federates
>>> joined or trying to join.
>> When you setup RTIG_MSG=D in the console (or context) where the rtig is 
>> started
>> did you see whether if RTIG receives any message from RTIA?
>>
>> I guess no message will be received but I need to be sure.
>>
>> I'm pretty sure RTIA is dying prematurely but I cannot understand why...
>>
> I can confirm that the RTIG is not receiving any messages.
>
> I think the create Process fails for some reason. If I put some output
> in the main function of the RTIA, this never shows up...anyway, the
> CreateProcess returns non-zero.

This is expected:
http://msdn.microsoft.com/en-us/library/ms682425%28v=vs.85%29.aspx
If the function succeeds, the return value is nonzero

>
> P.S. Thanks alot for your help so far. I'm off to a conference next week
> (INTERACT), and I have to work on my presentation tomorrow, so I
> probably can't do much tomorrow, and nothing next week. I hope we can
> resume this work then.

You are welcome, I'll wait for you.
However I'm nearly blind here since I cannot reproduce your  error.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org



reply via email to

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