diff options
author | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-03-24 20:15:10 +0000 |
---|---|---|
committer | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-03-24 20:15:10 +0000 |
commit | 4cbf5752999bfd22aa1f7b0c87573539154d7088 (patch) | |
tree | 01967d51ca4917eab3a9bef41292b9f293ec8e62 | |
parent | 262f1713a61a034c8e636483e646da4689e2a6c6 (diff) | |
download | ATCD-4cbf5752999bfd22aa1f7b0c87573539154d7088.tar.gz |
ChangeLogTag: Mon Mar 24 19:35:31 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
-rw-r--r-- | TAO/ChangeLog.iliyan-gestalt | 27 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp | 83 |
2 files changed, 60 insertions, 50 deletions
diff --git a/TAO/ChangeLog.iliyan-gestalt b/TAO/ChangeLog.iliyan-gestalt index 3415522a126..1e8d516c992 100644 --- a/TAO/ChangeLog.iliyan-gestalt +++ b/TAO/ChangeLog.iliyan-gestalt @@ -1,3 +1,30 @@ +Mon Mar 24 19:35:31 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> + + * orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp: + + Closing the SC before exiting ACE_TMAIN causes finalization + of (among others) the ORB Resource Factory. At exit however, the + ORB table will be finalized _after_ the SC. Any ORB that tries to + destroy itself at that point will cause SEGV, because its RF is no + longer a valid object. + + This test executable is loading DLL-based services that create + their ORBs, but it is also itself a taoexe. This causes many + ORB-related services, including a default RF to be inserted via + static initializers. This circumvents the destruction order and + also prevents the ORB from establishing its own local + configuration context, which otherwise would have made a very easy + fix possible (using -ORBGestalt local) + + The solution is to remove the explicit SC::open() and SC::close() + and leave ORB_init() to do the job for us. The Object Manager will + correctly finalize the static services at process exit. + + Alternatively, and perhaps a cleaner solution is to reduce the + server executable to a bare-bones aceexe. This eliminates TAO's + static initializers and leaves the DLL-based service to manage + their own service configuration contexts. + Sat Mar 22 04:25:07 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> * tests/ORB_Local_Config/Bug_1459/Test.cpp: diff --git a/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp b/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp index a66dad23b81..84a0fe87aa9 100644 --- a/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp +++ b/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp @@ -144,12 +144,10 @@ int loadOrb(ACE_Service_Config & r_serviceConfig) int -ACE_TMAIN(int, ACE_TCHAR ** argv) +ACE_TMAIN(int, ACE_TCHAR **argv) { int result = 0; - ACE_Service_Config serviceConfig; - char signum[64]; ACE_OS::sprintf(signum, "%d", SIGUSR1); @@ -158,80 +156,65 @@ ACE_TMAIN(int, ACE_TCHAR ** argv) args.add("-s"); args.add(signum); - result = serviceConfig.open ( - args.argc(), - args.argv(), - ACE_DEFAULT_LOGGER_KEY, - 1, // ignore_static_svcs = 1, - 1, // ignore_default_svc_conf_file = 0, - 0 // ignore_debug_flag = 0 - ); + ACE_Service_Config &serviceConfig = *ACE_Service_Config::singleton (); + + result = serviceConfig.open (args.argc(), + args.argv(), + ACE_DEFAULT_LOGGER_KEY, + true, // ignore_static_svcs = 1, + true, // ignore_default_svc_conf_file = 0, + false // ignore_debug_flag = 0 + ); if(0 != result) - { - ACE_DEBUG ((LM_ERROR, ACE_TEXT ("serviceConfig.open failed\n"))); - return result; - } + { + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("serviceConfig.open failed\n"))); + return result; + } ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.open done\n"))); + + for(int i = 0; i < 5; ++i) - { + { ACE_DEBUG ((LM_INFO, ACE_TEXT ("loadOrb ...\n"))); result = loadOrb(serviceConfig); if(0 != result) - { - ACE_DEBUG ((LM_ERROR, ACE_TEXT ("loadOrb failed\n"))); - return result; - } + { + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("loadOrb failed\n"))); + return result; + } ACE_DEBUG ((LM_INFO, ACE_TEXT ("loadOrb done\n"))); ACE_DEBUG ((LM_INFO, ACE_TEXT ("loadNotify ...\n"))); result = loadNotify(serviceConfig); if(0 != result) - { - ACE_DEBUG ((LM_ERROR, ACE_TEXT ("loadNotify failed\n"))); + { + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("loadNotify failed\n"))); return result; - } + } ACE_DEBUG ((LM_INFO, ACE_TEXT ("loadNotify done\n"))); ACE_DEBUG ((LM_INFO, ACE_TEXT ("unloadNotify ...\n"))); result = unloadNotify(serviceConfig); if(0 != result) - { - ACE_DEBUG ((LM_ERROR, ACE_TEXT ("unloadNotify failed\n"))); - return result; - } + { + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("unloadNotify failed\n"))); + return result; + } ACE_DEBUG ((LM_INFO, ACE_TEXT ("unloadNotify done\n"))); ACE_DEBUG ((LM_INFO, ACE_TEXT ("unloadOrb ...\n"))); result = unloadOrb(serviceConfig); if(0 != result) - { - ACE_DEBUG ((LM_ERROR, ACE_TEXT ("unloadOrb failed\n"))); - return result; - } + { + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("unloadOrb failed\n"))); + return result; + } ACE_DEBUG ((LM_INFO, ACE_TEXT ("unloadOrb done\n"))); - } - - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.fini_svcs ...\n"))); - result = serviceConfig.fini_svcs(); - if(0 != result) - { - ACE_DEBUG ((LM_ERROR, ACE_TEXT ("serviceConfig.fini_svcs failed\n"))); - return result; - } - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.fini_svcs done\n"))); - - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.close ...\n"))); - result = serviceConfig.close(); - if(0 != result) - { - ACE_DEBUG ((LM_ERROR, ACE_TEXT ("serviceConfig.close failed\n"))); - return result; - } - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.close done\n"))); + } return 0; } |