[omniORB] Strange crash

Attila.Pletyak@anemo.com Attila.Pletyak@anemo.com
Sat, 28 Apr 2001 07:10:07 +0200


When I had such strange crashes the problem was not in the generated
skeleton but in my code earlier. You should make sure memory management is
okay on your side and if you are using a C library function which expects a
pointer, make sure it allocates the memory and does not expect you to do it
(I made a stupid mistake like this).

Sincerely,

Attila Pletyak
Anemo Ltd.
Hungary
http://www.anemo.com/


                                                                                                                                           
                    Matthew Berry                                                                                                          
                    <mberry@mweb.co.za>                 To:     omniORB <omniorb-list@uk.research.att.com>                                 
                    Sent by:                            cc:     Asif Makwana <AMakwana@Broner.co.uk>                                       
                    owner-omniorb-list@uk.resear        Subject:     [omniORB] Strange crash                                               
                    ch.att.com                                                                                                             
                                                                                                                                           
                                                                                                                                           
                    04/27/01 04:01 PM                                                                                                      
                    Please respond to mberry                                                                                               
                                                                                                                                           
                                                                                                                                           



One of my clients is crashing when it resolves a name using the naming
services on the line:

      obj = rootContext->resolve(name);

rootContext seems to be valid with a refcount of 3. name contains 5 valid
id/kind pairs.

If I step through the code, the particular line on which it crashes is in
my
idl-generated skeleton file:

    void*
    VersionBroker::_objref_VBServer::_ptrToObjRef(const char* id)
    {
      if( !strcmp(id, CORBA::Object::_PD_repoId) )
<--------- Crashes here
        return (CORBA::Object_ptr) this;
      if( !strcmp(id, VersionBroker::VBServer::_PD_repoId) )
        return (VersionBroker::VBServer_ptr) this;

      return 0;
    }

The string id is valid and null-terminated. If I step into the assembly
code, I think the value CORBA::Object::_PD_repoId is not valid.

The above _ptrToObjRef function is called by CORBA::UnMarshalObjRef in
corbaObject.cc by the return statement of line 474.

I am using omni3.0.3 with -wbBOA and having the problem on both Win2000 and
NT4 clients connecting to RH6.1 and DEC OSF servers.

Any help will be greatly appreciated. Thanks
Matthew Berry