Hi Karel

Thanks for your reply.

As to why I am not using threading, the windows make files don't actual
enable threading properly (they don't configure a header file to enable
it). Also we haven't changed our code to make use of it.

Compiler VS 2008 (VC 9)
OS - Windows XP SP2 and 2003 64 bit

I have one more detail on how to cause the problem.

After getting the NamingConext (see the original code in first email) we
register our own object under the name "MyPath/MySubPath/MyName" which
we convert to CosName object.
And register as following:

NC->bind_new_context(CosName)// with CosName vector of "MyPath"
NC->bind_new_context(CosName)// with CosName vector of "MyPath" and
"MySubPath"
NC->rebind(CosName, MyObj) )// with CosName vector of
"MyPath","MySubPath" and" MyName"

If I remove the "MySubPath" name, and hence not have a nested ( and only
have one bind_new_context) then this removes the problems. If we don't
remove it, subsequent clients connecting to nsd fail on the call to get
the root NamingContext (in the original code mentioned below), or cause
nsd to crash.

I noticed in the demo under demo/services/naming-mt that
bind_new_context is used but is used differently - once it is used, the
new sub NamingContext is retrieved using NC->resolve(). The example is
fairly involved and I haven't been able to get it working correctly on
my machine yet (it doesn't come with windows makefile or script to run -
I have got a make file for it but still not sure about the running).
I have changed my code to use it, but this makes no difference -
assuming I am implementing it correctly.

Thanks
Malcolm

-----Original Message-----
From: Karel Gardas [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 26 November 2008 7:49 PM
To: Malcolm Davey
Cc: mico-devel@mico.org
Subject: Re: [mico-devel] nsd registration failing for multiple
registrations in 2.3.13


Hi Malcolm,

do you have a simple test case for this? I've tried with running several
nsadmin against nsd but was not able to cause a crash. Also why have you
disabled threading? Any particular reason for it? It would also be good
if you tell us more about your platform (ie. OS version/compiler
version, service packs/patches etc.)

Cheers,
Karel

Malcolm Davey wrote:
> Hi there
> 
>  
> 
> The nsd have issues when we register with it.
> 
>  
> 
> We have a windows compile of 2.3.13 with THREADS not defined or turned
> off.
> 
>  
> 
> Nsd command line is 
> 
> nsd -ORBIIOPAddr inet:%MACHINE%:%NAMINGSERVICEPORT% -ORBNoResolve
> -ORBIIOPVersion 1.2
> 
>  
> 
> My applications use the following as the address:
> corbaloc:iiop:[EMAIL PROTECTED]:%NAMINGSERVICEPORT%/NameService
> 
>  
> 
> Where %MACHINE% is the machine name, %NAMINGSERVICEPORT% is the host
> name
> 
>  
> 
> Our code which calls does the registration is the following:
> 
>  
> 
> Some initialization code is the following:
> 
>  
> 
>       m_orb = CORBA::ORB_init( CORBA_Argc, CORBA_Argv,
> _TEXT("mico-local-orb"));    
> 
>       CORBA::Object_var poaobj = m_orb->resolve_initial_references
> ("RootPOA");
> 
>       m_root_poa = PortableServer::POA::_narrow (poaobj);
> 
>       m_poa_mgr= m_root_poa->the_POAManager();
> 
>  
> 
> The code which has the problem is
> 
>  
> 
>       CosNaming::NamingContext_var  NC;
> 
>  
> 
>       CORBA::ORB_var orb = CORBA::ORB_instance("mico-local-orb",
false);
> 
>       if (CORBA::is_nil (orb))
> 
>             return NC;
> 
>  
> 
>       CORBA::Object_var Obj;
> 
>  
> 
>       Obj = orb->string_to_object(Address.c_str());
> 
>       
> 
>       NC = CosNaming::NamingContext::_narrow(Obj);
> 
>       return NC;
> 
>  
> 
> The final narrow call fails, or causes nsd to crash. Nsd crashes in
the
> following code
> 
>  
> 
> MICOPOA::POACurrent_impl::CurrentState::CurrentState
> (PortableServer::POA_ptr _poa, POAObjectReference * _por,
> PortableServer::Servant _serv)
> 
> {
> 
>   poa = _poa;
> 
>   por = _por;
> 
>   serv = _serv;
> 
>   serv->_add_ref (); // crashs on this line - serv seems like it is
> invalid
> 
> }
> 
>  
> 
> Call stack in release mode of crash with nsd.exe
> 
>  
> 
>>     mico2313.dll!MICOPOA::POACurrent_impl::set()  Line 417      C++
> 
>       mico2313.dll!MICOPOA::POA_impl::perform_invoke()  Line 3996 C++
> 
>       mico2313.dll!MICOPOA::POA_impl::local_invoke()  Line 3565   C++
> 
>       mico2313.dll!MICOPOA::POA_impl::invoke()  Line 3421   C++
> 
>       mico2313.dll!CORBA::ORB::invoke_async()  Line 2581    C++
> 
>       mico2313.dll!MICO::IIOPServer::exec_invoke_request()  Line 5613
> C++
> 
>       mico2313.dll!MICO::IIOPServer::handle_invoke_request()  Line
5676
> C++
> 
>       mico2313.dll!MICO::IIOPServer::handle_input()  Line 5528    C++
> 
>       mico2313.dll!MICO::IIOPServer::input_callback()  Line 6154  C++
> 
>       mico2313.dll!MICO::GIOPConn::do_read()  Line 2769     C++
> 
>       mico2313.dll!MICO::GIOPConn::callback()  Line 2925    C++
> 
>       mico2313.dll!MICO::SocketTransport::callback()  Line 209    C++
> 
>       mico2313.dll!MICO::SelectDispatcher::handle_fevents()  Line 267
> C++
> 
>       mico2313.dll!MICO::SelectDispatcher::run()  Line 460  C++
> 
>       mico2313.dll!CORBA::ORB::perform_work()  Line 1751    C++
> 
>       nsd.exe!main()  Line 221      C++
> 
>       nsd.exe!__tmainCRTStartup()  Line 586     C
> 
>  
> 
> We have two apps, which register with the name service. When the
second
> one registers nsd crashes. If the second one registers first then this
> work, but then when the first apps registeration fails. Nds.exe only
> seems to work for the first registration - when we substitute the
2.3.12
> or 2.3.8 versions they nsd.exe in they work all the time.
> 
>  
> 
> We also built some of the tests which come with the source.
> 
> When running any of the messaging tests we get the errror message
> "ERROR: exception not thrown" - don't know if this is the same problem
> or different.
> 
>  
> 
>  
> 
> Malcolm
> 
> 
> 
> 
>
------------------------------------------------------------------------
> 
> _______________________________________________
> Mico-devel mailing list
> Mico-devel@mico.org
> http://www.mico.org/mailman/listinfo/mico-devel


-- 
Karel Gardas                  [EMAIL PROTECTED]
ObjectSecurity Ltd.           http://www.objectsecurity.com

_______________________________________________
Mico-devel mailing list
Mico-devel@mico.org
http://www.mico.org/mailman/listinfo/mico-devel

Reply via email to