[omniORB] Debugging marshaling errors

Duncan Grisby duncan at grisby.org
Tue Jul 31 00:33:36 BST 2007


On Monday 30 July, Jason Stelzer wrote:

> On Jul 30, 2007, at 4:13 PM, Duncan Grisby wrote:

[...]
> > The place it's segfaulting is where it tries to call _add_ref on the
> > factory you have registered, which suggests that perhaps you have
> > released too many references on it, causing it to be prematurely
> > deleted.

> Thank you for the reply and sorry not all relevant information was
> present. Should you care to look, all code is here:
> http://neverlight.com/~cynic/libLms/

As I guessed, the problem is that you are releasing too many references
on your ValueFactory. This is the code:

    CORBA::ValueFactoryBase_var vf = new com::hmsonline::lms::common::AddressResultsFactory();
    CORBA::String_var repIdV = com::hmsonline::lms::common::AddressResults::_PD_repoId;
    orb->register_value_factory(repIdV.in(),vf.in());
    vf->_remove_ref();

The _var type automatically releases the reference to the factory when
the _var goes out of scope. Add that to the explicit _remove_ref, and
the factory object is deleted. That leads to the segfault when the ORB
later tries to use the factory. If you remove the call to _remove_ref,
that problem will go away.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list