diff options
author | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-04-04 22:23:05 +0000 |
---|---|---|
committer | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-04-04 22:23:05 +0000 |
commit | 33c37c98bf206a6a72892481112f738ac6681085 (patch) | |
tree | 379fbed8c0f52cf199b09d9bbd64ec151090a9d9 | |
parent | 6d383cd95d34a8fa4ff47d3d2c45fe17e9db20d7 (diff) | |
download | ATCD-33c37c98bf206a6a72892481112f738ac6681085.tar.gz |
ChangeLogTag: Fri Apr 4 22:15:16 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 39 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/Bug_3216_Regression/run_test.pl | 2 | ||||
-rw-r--r-- | TAO/tao/ORBInitializer_Registry.cpp | 2 | ||||
-rw-r--r-- | TAO/tests/Bug_2735_Regression/server.cpp | 10 | ||||
-rw-r--r-- | TAO/tests/Bug_2936_Regression/PersistentPOA.cpp | 22 | ||||
-rw-r--r-- | TAO/tests/Bug_3251_Regression/Bug_3251.conf | 2 | ||||
-rw-r--r-- | TAO/tests/Bug_3251_Regression/PersistentPoa.h | 4 | ||||
-rw-r--r-- | TAO/tests/Bug_3251_Regression/server.cpp | 43 | ||||
-rwxr-xr-x | TAO/tests/ORB_Local_Config/run_tests_all.pl | 5 |
9 files changed, 82 insertions, 47 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 15fe311fb98..38dd523dda8 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,42 @@ +Fri Apr 4 22:15:16 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> + + This is the first batch of changes related to the refactoring of + the service configuration, which aims to eliminate a number of + related memory leaks and bugs. The changes are being ported back + from the "iliyan-gestalt" branch. + + * orbsvcs/tests/Bug_3216_Regression/run_test.pl: + + Fixed to use $ACE_ROOT instead of '../..', to search for PerlACE. + + * tao/ORBInitializer_Registry.cpp: + + Removing a misplaced call to TAO::ORB::init_orb_globals(). Now + that the latter has non-trivial functionality, calling it from an + ORB initializer would be wrong. + + * tests/Bug_2735_Regression/server.cpp: + + The argv must be 0-terminated to fulfill the contract with C's + argv. + + * tests/Bug_2936_Regression/PersistentPOA.cpp: + + Fixing (what seems to be) a bad ownership transfer of Object's, + causing memory leaks. + + * tests/Bug_3251_Regression/Bug_3251.conf: + * tests/Bug_3251_Regression/PersistentPoa.h: + * tests/Bug_3251_Regression/server.cpp: + + Changes to make it compile (but not test anything) on + Windows. Also added a call to sync (after fork) so we get the + correct values for PID in the child. + + * tests/ORB_Local_Config/run_tests_all.pl: + + Fixed a bug that was preventing it from running. + Fri Apr 4 10:20:00 UTC 2008 Simon Massey <simon dot massey at prismtech dot com> * orbsvcs/tests/Bug_1630_Regression/testclient.cpp: diff --git a/TAO/orbsvcs/tests/Bug_3216_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_3216_Regression/run_test.pl index 8c3d67c4f2a..2c5d8ff9ced 100755 --- a/TAO/orbsvcs/tests/Bug_3216_Regression/run_test.pl +++ b/TAO/orbsvcs/tests/Bug_3216_Regression/run_test.pl @@ -5,7 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -use lib '../../../../bin'; +use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; $status = 0; diff --git a/TAO/tao/ORBInitializer_Registry.cpp b/TAO/tao/ORBInitializer_Registry.cpp index b3c16fc8706..ca7fbf64476 100644 --- a/TAO/tao/ORBInitializer_Registry.cpp +++ b/TAO/tao/ORBInitializer_Registry.cpp @@ -41,8 +41,6 @@ namespace PortableInterceptor ACE_TEXT ("(%P|%t) register_orb_initializer: ") ACE_TEXT ("Unable to pre-initialize TAO\n"))); } - - TAO::ORB::init_orb_globals (); } #if defined (ACE_VXWORKS) && defined (ACE_HAS_TSS_EMULATION) diff --git a/TAO/tests/Bug_2735_Regression/server.cpp b/TAO/tests/Bug_2735_Regression/server.cpp index 5fa0f1e4591..8484e743e59 100644 --- a/TAO/tests/Bug_2735_Regression/server.cpp +++ b/TAO/tests/Bug_2735_Regression/server.cpp @@ -27,7 +27,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) while ((c = get_opts ()) != -1) switch (c) - { + { case 'f': factory_strategy = FOO_STRATEGY; break; @@ -40,12 +40,12 @@ parse_args (int argc, ACE_TCHAR *argv[]) "usage: %s " "-f " "-s " - "\n", + "\n", argv [0]), -1); } - return 0; -} + return 0; +} int @@ -57,7 +57,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) return -1; int targc = 3; - const char* targv[] = { "server", "-ORBSvcConfDirective", 0 }; + const char* targv[] = { "server", "-ORBSvcConfDirective", 0, 0 }; // null-terminated! switch (factory_strategy) { case FOO_STRATEGY: diff --git a/TAO/tests/Bug_2936_Regression/PersistentPOA.cpp b/TAO/tests/Bug_2936_Regression/PersistentPOA.cpp index a6a2530f01a..4e5feec818c 100644 --- a/TAO/tests/Bug_2936_Regression/PersistentPOA.cpp +++ b/TAO/tests/Bug_2936_Regression/PersistentPOA.cpp @@ -59,24 +59,20 @@ int PersistentPoa::init (int argc, char *argv[]) return -1; } - // Threading policy - CORBA::Policy_var v_threadingPolicy = - mv_rootPOA->create_thread_policy(PortableServer::ORB_CTRL_MODEL); - // Lifespan policy - CORBA::Policy_var v_lifespanPolicy = - mv_rootPOA->create_lifespan_policy(PortableServer::PERSISTENT); - - // ID assignment policy - CORBA::Policy_var v_idAssignmentPolicy = - mv_rootPOA->create_id_assignment_policy(PortableServer::USER_ID); // Policies for the new POA CORBA::PolicyList policies(3); policies.length (3); - policies[0] = v_threadingPolicy.in(); - policies[1] = v_lifespanPolicy.in(); - policies[2] = v_idAssignmentPolicy.in(); + + // Threading policy + policies[0] = mv_rootPOA->create_thread_policy(PortableServer::ORB_CTRL_MODEL); + + // Lifespan policy + policies[1] = mv_rootPOA->create_lifespan_policy(PortableServer::PERSISTENT); + + // ID assignment policy + policies[2] = mv_rootPOA->create_id_assignment_policy(PortableServer::USER_ID); mv_thisPOA = mv_rootPOA->create_POA( POAname_, diff --git a/TAO/tests/Bug_3251_Regression/Bug_3251.conf b/TAO/tests/Bug_3251_Regression/Bug_3251.conf index 5f0ce74d685..b79947bdd3c 100644 --- a/TAO/tests/Bug_3251_Regression/Bug_3251.conf +++ b/TAO/tests/Bug_3251_Regression/Bug_3251.conf @@ -1,3 +1,3 @@ -dynamic PersistentPOA Service_Object * Bug_3251:_make_DllOrb() "DllOrb -NumThreads 12 -ORBDottedDecimalAddresses 1 -ORBCollocationStrategy thru_poa" +dynamic DllOrb Service_Object * Bug_3251:_make_DllOrb() "DllOrb -NumThreads 12 -ORBDottedDecimalAddresses 1 -ORBCollocationStrategy thru_poa" dynamic PersistentPOA Service_Object * Bug_3251:_make_PersistentPoa() "PersistentPOA DllOrb" diff --git a/TAO/tests/Bug_3251_Regression/PersistentPoa.h b/TAO/tests/Bug_3251_Regression/PersistentPoa.h index dace9c4db7f..9063e9ef1ec 100644 --- a/TAO/tests/Bug_3251_Regression/PersistentPoa.h +++ b/TAO/tests/Bug_3251_Regression/PersistentPoa.h @@ -13,9 +13,7 @@ #include "bug_3251_export.h" -class PersistentPoa -: - public ACE_Service_Object +class bug_3251_Export PersistentPoa: public ACE_Service_Object { // public types and methods public: diff --git a/TAO/tests/Bug_3251_Regression/server.cpp b/TAO/tests/Bug_3251_Regression/server.cpp index 38f15342b16..94ded03c24b 100644 --- a/TAO/tests/Bug_3251_Regression/server.cpp +++ b/TAO/tests/Bug_3251_Regression/server.cpp @@ -11,7 +11,7 @@ static volatile bool bShutdown = false; static void shutdown_func(int) { - ACE_DEBUG ((LM_INFO, ACE_TEXT ("Shutdown requested\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) Shutdown requested\n"))); bShutdown = true; } #endif @@ -22,23 +22,26 @@ ACE_TMAIN(int, ACE_TCHAR ** argv) int result = 0; #if !defined (ACE_LACKS_FORK) ACE_Sig_Action sigUSR2((ACE_SignalHandler) shutdown_func, SIGUSR2); - ACE_DEBUG ((LM_INFO, ACE_TEXT ("SIGUSR2 shutdown handler installed\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) SIGUSR2 shutdown handler installed\n"))); ACE_UNUSED_ARG(sigUSR2); pid_t pid = -1; pid = ACE_OS::fork(); + ACE_Log_Msg::instance ()->sync (argv[0]); // Make %P|%t work right + if (pid == 0) // child { - ACE_DEBUG ((LM_INFO, ACE_TEXT ("child waiting\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) child waiting\n"))); ACE_OS::sleep(5); - ACE_DEBUG ((LM_INFO, ACE_TEXT ("signaling parent\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) signaling parent\n"))); result = ACE_OS::kill(ACE_OS::getppid(), SIGUSR2); - ACE_DEBUG ((LM_INFO, ACE_TEXT ("signaled parent\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) signaled parent\n"))); + // ACE_OS::sleep (100000); return 0; } else if (pid > 0) // parent { - ACE_DEBUG ((LM_INFO, ACE_TEXT ("parent using ACE_Service_Config\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) parent using ACE_Service_Config, pid=%d\n"), pid)); ACE_Service_Config serviceConfig; char signum[64]; @@ -59,12 +62,12 @@ ACE_TMAIN(int, ACE_TCHAR ** argv) ); if(0 != result) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Error: serviceConfig.open failed\n"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Error: serviceConfig.open failed\n"))); return result; } - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.open done\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) serviceConfig.open done\n"))); - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.process_file ...\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) serviceConfig.process_file ...\n"))); #if (ACE_USES_CLASSIC_SVC_CONF == 1) result = serviceConfig.process_file("Bug_3251.conf"); #else @@ -72,10 +75,10 @@ ACE_TMAIN(int, ACE_TCHAR ** argv) #endif if(0 != result) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Error: serviceConfig.process_file failed\n"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Error: serviceConfig.process_file failed\n"))); return result; } - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.process_file done\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) serviceConfig.process_file done\n"))); ACE_DEBUG ((LM_INFO, ACE_TEXT ("run_event_loop ...\n"))); while(!bShutdown) @@ -92,38 +95,38 @@ ACE_TMAIN(int, ACE_TCHAR ** argv) { ACE_DEBUG (( LM_INFO, - ACE_TEXT ("run_event_loop failed (%s, %d)\n"), + ACE_TEXT ("(%P|%t) run_event_loop failed (%s, %d)\n"), ACE_OS::strerror(ACE_OS::last_error()), ACE_OS::last_error() )); } } - ACE_DEBUG ((LM_INFO, ACE_TEXT ("run_event_loop done\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) run_event_loop done\n"))); - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.fini_svcs ...\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) serviceConfig.fini_svcs ...\n"))); result = serviceConfig.fini_svcs(); if(0 != result) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Error: serviceConfig.fini_svcs failed\n"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Error: serviceConfig.fini_svcs failed\n"))); return result; } - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.fini_svcs done\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) serviceConfig.fini_svcs done\n"))); - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.close ...\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) serviceConfig.close ...\n"))); result = serviceConfig.close(); if(0 != result) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Error: serviceConfig.close failed\n"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Error: serviceConfig.close failed\n"))); return result; } - ACE_DEBUG ((LM_INFO, ACE_TEXT ("serviceConfig.close done\n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) serviceConfig.close done\n"))); return result; } /* end of if */ else // fork failed { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("fork failed\n"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Error: fork failed\n"))); return 1; } /* end of else */ #else diff --git a/TAO/tests/ORB_Local_Config/run_tests_all.pl b/TAO/tests/ORB_Local_Config/run_tests_all.pl index 076bf732bd4..3440928815d 100755 --- a/TAO/tests/ORB_Local_Config/run_tests_all.pl +++ b/TAO/tests/ORB_Local_Config/run_tests_all.pl @@ -27,11 +27,12 @@ sub test($) { (my $executable, my $arguments) = @_; chdir ($executable); + my $t1; if (PerlACE::is_vxworks_test()) { - my $t1 = new PerlACE::ProcessVX ("Test", ($arguments ? $arguments : "")); + $t1 = new PerlACE::ProcessVX ("Test", ($arguments ? $arguments : "")); } else { - my $t1 = new PerlACE::Process ("Test", ($arguments ? $arguments : "")); + $t1 = new PerlACE::Process ("Test", ($arguments ? $arguments : "")); } print STDERR "\nTest $executable is running ...\n"; my $status = $t1->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); |