Bug 1315 - POA PolicyFactory registration breaks DLL ORB functionality
Summary: POA PolicyFactory registration breaks DLL ORB functionality
Status: RESOLVED FIXED
Alias: None
Product: TAO
Classification: Unclassified
Component: POA (show other bugs)
Version: 1.2.4
Hardware: All All
: P3 critical
Assignee: Irfan Pyarali
URL:
Depends on:
Blocks: 1277
  Show dependency tree
 
Reported: 2002-10-03 19:33 CDT by Ossama Othman
Modified: 2002-10-04 18:26 CDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ossama Othman 2002-10-03 19:33:47 CDT
The following change:

Tue Aug 27 15:48:17 2002  Irfan Pyarali  <irfan@oomworks.com>

        Thanks to Christian Klutz <cklutz@gmx.net> for reporting the bug
	that resulted in the following changes.

	* tao/PortableServer/PortableServer_PolicyFactory.cpp: New class
	  for creating POA Policies.

	* tao/PortableServer/PortableServer_ORBInitializer.cpp:  New
	  initialization class that adds TAO_PortableServer_PolicyFactory
	  as a factory for POA Policies.

	* tao/PortableServer/PortableServer.cpp (init): Registered
	  TAO_PortableServer_ORBInitializer with the PortableInterceptor.
        ...

Breaks the DLL ORB functionality whenever the POA's static constructor is used.
   The problem stems from the fact that the static constructor defined in
tao/PortableServer/PortableServer.cpp calls
PortableInterceptor::register_orb_initializer().  That call forces
TAO_Singleton_Manager to be default initialized since the ORBInitializer
table/registry is a Singleton.  Default initializing the TAO_Singleton_Manager
causes it to be registered with the ACE_Object_Manager.  Doing so prevents TAO
from being dynamically unloaded safely since the ACE_Object_Manager will have a
dangling reference to a non-existent TAO_Singleton_Manager.

This problem is evident in the TAO/tests/DLL_ORB test.
Comment 1 Ossama Othman 2002-10-03 19:35:03 CDT
Blocks TAO 1.3 since this is a major regression in TAO.
Comment 2 Ossama Othman 2002-10-03 19:37:19 CDT
Note that calling PortableInterceptor::register_orb_initializer() in a static
constructor in a DLL ORB environment is safe if the TAO_Singleton_Manager is
pre-initialized to not be registered with the ACE_Object_Manager.
Comment 3 Irfan Pyarali 2002-10-04 18:26:56 CDT
Fixed. Thanks for pointing this out Ossama!

ChangeLogTag: Fri Oct 04 19:23:08 2002  Irfan Pyarali  <irfan@oomworks.com>