Bug 2302 - manipulating "merged IOR" has side effects on orinal IORs
Summary: manipulating "merged IOR" has side effects on orinal IORs
Status: NEW
Alias: None
Product: TAO
Classification: Unclassified
Component: orbsvcs (show other bugs)
Version: 1.7.8
Hardware: All All
: P3 normal
Assignee: Simon McQueen
URL:
Depends on:
Blocks:
 
Reported: 2005-11-17 11:50 CST by Frank.Rehberger
Modified: 2010-04-23 08:10 CDT (History)
0 users

See Also:


Attachments
tar.gz contains modified IOGRManagement test, testing for side effects (8.64 KB, application/octet-stream)
2006-02-24 01:06 CST, Frank.Rehberger
Details

Note You need to log in before you can comment on or make changes to this bug.
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?