summaryrefslogtreecommitdiff
path: root/ACE/ace/Service_Types.cpp
diff options
context:
space:
mode:
authorcbeaulac <cbeaulac@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-05-04 21:34:39 +0000
committercbeaulac <cbeaulac@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-05-04 21:34:39 +0000
commit0c4c75e10be67e56b25e225803ec4546c2985d68 (patch)
tree9999716bd05654a49fb8b57a7e1aaa1f43ec6c11 /ACE/ace/Service_Types.cpp
parente3fbeb113a456fca004ab17591f7c8a7b3f9a236 (diff)
downloadATCD-0c4c75e10be67e56b25e225803ec4546c2985d68.tar.gz
Tue May 4 21:23:44 UTC 2010 Chad Beaulac <chad@objectivesolutions.com>
* ace/Stream.cpp Added debug and warning logging in ACE_Stream::remove * ace/Service_Types.cpp One of problems is that ACE_Module_Type::name gets its value from the svc.conf file. The ACE_Module that it references gets its name from the static factory method used to create the module. When the names don't match the call to ACE_Stream_Type::fini fails to remove any ACE_Modules from the underlying ACE_Stream. Since none of the ACE_Modules are removed, ACE_Module_Type::fini tries to call fini on the ACE_Module reader and writer ACE_Task instances. And they've already been deleted by ACE_Stream::close called from ACE_Stream_Type::fini. Reassigned ACE_Module::name in ACE_Module_Type::init to ACE_Module_Type::name and fixed the SEGV at shutdown because of the issue described above. All of these issues are related: #3334 #3205 #2916 #3847
Diffstat (limited to 'ACE/ace/Service_Types.cpp')
-rw-r--r--ACE/ace/Service_Types.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/ACE/ace/Service_Types.cpp b/ACE/ace/Service_Types.cpp
index 5c2c2fae3b7..16417e50755 100644
--- a/ACE/ace/Service_Types.cpp
+++ b/ACE/ace/Service_Types.cpp
@@ -185,6 +185,15 @@ ACE_Module_Type::init (int argc, ACE_TCHAR *argv[]) const
ACE_TRACE ("ACE_Module_Type::init");
void *obj = this->object ();
MT_Module *mod = (MT_Module *) obj;
+ //
+ // Change the Module's name to what's in the svc.conf file.
+ // We must do this so the names match up so everything shuts
+ // down properly during the call to ACE_Stream_Type::fini
+ // which calls MT_Stream::remove([name]) for all the modules.
+ // If the calls to remove fail, we end up with a double delete
+ // during shutdown. Bugzilla #3847
+ //
+ mod->name (this->name_);
MT_Task *reader = mod->reader ();
MT_Task *writer = mod->writer ();