From 616babd5d1d50df61646b23bb6b4200f70dffe45 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 15 Sep 2016 15:40:52 +0200 Subject: Added shutdown to cleanly shutdown the ORB and release all CORBA resources to resolve several valgrind reported memory leaks * TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp: * TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.h: * TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp: --- .../tests/InterfaceRepo/Persistence_Test/Ptest.cpp | 19 +++++++++++++++++++ .../tests/InterfaceRepo/Persistence_Test/Ptest.h | 3 +++ .../tests/InterfaceRepo/Persistence_Test/test.cpp | 10 ++++++---- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp index c8f86a137ad..d18b5883ec6 100644 --- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp +++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp @@ -59,6 +59,25 @@ Ptest::init (int argc, ACE_TCHAR *argv[]) return 0; } +int +Ptest::shutdown (void) +{ + try + { + this->repo_ = CORBA::Repository::_nil (); + + this->orb_->destroy (); + + this->orb_ = CORBA::ORB::_nil (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Ptest::init"); + return -1; + } + return 0; +} + int Ptest::run (void) { diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.h b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.h index 6e675fc1f70..5f6c61df0fb 100644 --- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.h +++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.h @@ -45,6 +45,9 @@ public: /// Execute test code. int run (void); + /// Cleanup + int shutdown (void); + private: /// The two IFR tests. void populate (void); diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp index 7d5829a5a78..a3ee919438d 100644 --- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp +++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp @@ -5,12 +5,14 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { Ptest ptest; - int retval = ptest.init (argc, argv); + if (ptest.init (argc, argv) == -1) + return 1; - if (retval == -1) + if (ptest.run () == -1) return 1; - retval = ptest.run (); + if (ptest.shutdown () == -1) + return 1; - return retval; + return 0; } -- cgit v1.2.1 From cdf54724dea3807bfd5ed0773b11838048c2cf3a Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 15 Sep 2016 15:41:09 +0200 Subject: Zapped some empty lines * TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README: --- TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README | 2 -- 1 file changed, 2 deletions(-) diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README index a206fc29a42..aa02061d0ab 100644 --- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README +++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README @@ -1,5 +1,3 @@ - - This test addresses the functionality of persistence in the Interface Repository. -- cgit v1.2.1 From 87671627d5de5ed9c4a5dd06c4e1f7710ecba9eb Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 15 Sep 2016 16:00:08 +0200 Subject: Removed not needed variable * TAO/orbsvcs/IFR_Service/IFR_Service.h: --- TAO/orbsvcs/IFR_Service/IFR_Service.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/TAO/orbsvcs/IFR_Service/IFR_Service.h b/TAO/orbsvcs/IFR_Service/IFR_Service.h index 489a9e83f03..6e3d62ee102 100644 --- a/TAO/orbsvcs/IFR_Service/IFR_Service.h +++ b/TAO/orbsvcs/IFR_Service/IFR_Service.h @@ -49,13 +49,9 @@ public: void shutdown (void); protected: - /// Reference to our ORB. CORBA::ORB_var orb_; - /// Root POA reference. - PortableServer::POA_var root_poa_; - /// IFR Server instance. TAO_IFR_Server my_ifr_server_; }; -- cgit v1.2.1 From 5385cbc61f1ce880b06abd2960265297753f53cc Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 15 Sep 2016 16:00:48 +0200 Subject: Cleanup * TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp: * TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h: * TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp: * TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl: --- TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp | 3 +-- TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h | 2 +- TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp | 2 -- TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl | 4 ++-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp index 2ee9ffd3c7e..fe21ede6f1e 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp @@ -23,8 +23,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Repository_i *TAO_IFR_Service_Utils::repo_ = 0; TAO_IFR_Server::TAO_IFR_Server (void) - : //servant_locator_impl_ (0), - ior_multicast_ (0), + : ior_multicast_ (0), config_ (0) { } diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h index 3b3b127c888..8fb9f31fc59 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h +++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h @@ -55,7 +55,7 @@ public: PortableServer::POA_ptr rp, int use_multicast_server = 0); - /// Destroy the child POA created in . + /// Destroy the child POA created in init_with_poa(). int fini (void); /// Destructor. diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp index d18b5883ec6..d954dbd5a98 100644 --- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp +++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp @@ -3,8 +3,6 @@ #include "ace/Get_Opt.h" #include "ace/OS_NS_string.h" - - Ptest::Ptest (void) : debug_ (0), query_ (0) diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl index cdafdc04f59..f37a7c4382a 100755 --- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl +++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl @@ -72,7 +72,7 @@ if ($client->PutFile ($iorbase) == -1) { exit 1; } -print "Starting Persistence_Test\n"; +print "Starting Persistence_Test 1\n"; $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45); @@ -122,7 +122,7 @@ if ($client->PutFile ($iorbase) == -1) { exit 1; } -print "Starting Persistence_Test\n"; +print "Starting Persistence_Test 2\n"; $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45); -- cgit v1.2.1 From d4e368c76124dc6dea13e33f92411aef17197fca Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 15 Sep 2016 16:20:00 +0200 Subject: Mark the IFRService persistence test with !FIXED_BUGS_ONLY, it fails frequently which goes back to 2009, see bugzilla 3699 * TAO/bin/tao_other_tests.lst: --- TAO/bin/tao_other_tests.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TAO/bin/tao_other_tests.lst b/TAO/bin/tao_other_tests.lst index f46fb7b24a6..95ceb43cca6 100644 --- a/TAO/bin/tao_other_tests.lst +++ b/TAO/bin/tao_other_tests.lst @@ -103,7 +103,7 @@ TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl: !MINIMUM !CORBA_E_COMPAC TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO !DISTRIBUTED TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO -TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO !FIXED_BUGS_ONLY TAO/orbsvcs/tests/InterfaceRepo/Union_Forward_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO TAO/orbsvcs/tests/InterfaceRepo/Bug_2962_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO -- cgit v1.2.1