Bug 2302

Summary: manipulating "merged IOR" has side effects on orinal IORs
Product: TAO Reporter: Frank.Rehberger
Component: orbsvcsAssignee: Simon McQueen <sm>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 1.7.8   
Hardware: All   
OS: All   
Attachments: tar.gz contains modified IOGRManagement test, testing for side effects

Description Frank.Rehberger 2005-11-17 11:50:20 CST
Using service "TAO_OBJID_IORMANIPULATION" to merge IORs, the new IOR contains
shallow copies of original profiles. Now, manipulating the merged IOR has
side-effects on profiles of original IORs, eg. adding FT-primary-property to
merged IOR to achieve GroupObject, this property also shows up in one of
original IORs.  

In consequence, executing the following code twice (same IORs as input both
times)  the second time TAO_IOP::Duplicate is raised by operation set_primary(). 
Workarround: merging IORs should be based on deep copies, using the pattern
string_to_object(object_to_string(orig_ior)):


  // Get an object reference for the ORBs IORManipultion object!
  CORBA::Object_var IORM =
    orb->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
                                     0
                                     ACE_ENV_ARG_PARAMETER);
  ACE_CHECK;

  TAO_IOP::TAO_IOR_Manipulation_var iorm =
    TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
  ACE_CHECK;

  TAO_IOP::TAO_IOR_Manipulation::IORList iors (2);
  iors.length(2);
  iors [0] = CORBA::Object::_duplicate (obj0);
  iors [1] = CORBA::Object::_duplicate (obj1);
  
  // Create a new IOR
  CORBA::Object_var merged = iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);

  // Construct the IOGR Property class
  TAO_FT_IOGR_Property iogr_prop (ft_tag_component);

  // Set the property for object 1
  CORBA::Boolean ft_tag = iorm->set_property (&iogr_prop,
                                              merged.in (),
                                              ACE_ENV_ARG_PARAMETER);

  ACE_CHECK;

  if (ft_tag)
    {
      retval = iorm->set_primary (&iogr_prop,
                                  obj0,
                                  merged.in ()
                                  ACE_ENV_ARG_PARAMETER);
      ACE_CHECK;
    }
  else
Comment 1 Frank.Rehberger 2006-02-24 01:06:56 CST
Created attachment 476 [details]
tar.gz contains modified IOGRManagement test, testing for side effects
Comment 2 Frank.Rehberger 2006-02-24 01:09:03 CST
Calling run_test.pl the test should fail with "side-effect error message".
Comment 3 Simon McQueen 2006-09-15 08:59:06 CDT
taking
Comment 4 Johnny Willemsen 2007-11-12 03:40:38 CST
Simon, any ETA on integration of this test and possible fix?
Comment 5 Simon McQueen 2008-03-31 07:16:42 CDT
Still valid
Comment 6 Johnny Willemsen 2010-04-23 08:10:10 CDT
Any update?