diff options
-rw-r--r-- | ChangeLog-98b | 11 | ||||
-rw-r--r-- | ace/Map_Manager.cpp | 12 | ||||
-rw-r--r-- | ace/Thread_Manager.cpp | 11 | ||||
-rw-r--r-- | examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp | 2 |
4 files changed, 28 insertions, 8 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b index 6eb83bb50d0..f794c559585 100644 --- a/ChangeLog-98b +++ b/ChangeLog-98b @@ -1,3 +1,14 @@ +Fri May 8 11:57:23 1998 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu> + + * ace/Map_Manager.cpp: Fixed a bug where we weren't calling + close_i() when resizing the buffer. + + * ace/Thread_Manager.cpp (set_grp): In + ACE_Thread_Manager::{get,set}_grp we must check to see that we + have a valid pointer after the ACE_FIND. Otherwise a seg fault + occurs. Thanks to Chris Lahey <CLahey@cccis.com> for reporting + this. + Fri May 08 09:47:50 1998 David L. Levine <levine@cs.wustl.edu> * ace/config-linux-common.h: only use ACE_HAS_POLL with glibc2. diff --git a/ace/Map_Manager.cpp b/ace/Map_Manager.cpp index c37691ab1a2..3b0ea0c5504 100644 --- a/ace/Map_Manager.cpp +++ b/ace/Map_Manager.cpp @@ -198,11 +198,13 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::open (size_t size, this->allocator_ = alloc; - // If we need to grow buffer, then remove the existing buffer. - if (this->total_size_ < size) - return this->resize_i (size); - else - return 0; + // This assertion is here to help track a situation that shouldn't happen + ACE_ASSERT (size != 0); + + // Calling this->close_i () to ensure we release previous allocated + // memory before allocating new one. + this->close_i (); + return this->resize_i (size); } template <class EXT_ID, class INT_ID, class ACE_LOCK> int diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp index e29f2fe96cd..92a552a801a 100644 --- a/ace/Thread_Manager.cpp +++ b/ace/Thread_Manager.cpp @@ -1082,7 +1082,11 @@ ACE_Thread_Manager::get_grp (ACE_thread_t t_id, int &grp_id) ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); ACE_FIND (this->find_thread (t_id), ptr); - grp_id = ptr->grp_id_; + + if (ptr) + grp_id = ptr->grp_id_; + else + return -1; return 0; } @@ -1095,7 +1099,10 @@ ACE_Thread_Manager::set_grp (ACE_thread_t t_id, int grp_id) ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); ACE_FIND (this->find_thread (t_id), ptr); - ptr->grp_id_ = grp_id; + if (ptr) + ptr->grp_id_ = grp_id; + else + return -1; return 0; } diff --git a/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp b/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp index 8c0be1c0e58..98f7d59ec44 100644 --- a/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp +++ b/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp @@ -57,12 +57,12 @@ main (int argc, char *argv[]) char *sock_client = ACE_OS::tempnam (0, 0); + ACE_LSOCK_Dgram sd ((ACE_UNIX_Addr) (sock_client)); if (ACE_OS::unlink (sock_client)) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "unlink"), -1); - ACE_LSOCK_Dgram sd ((ACE_UNIX_Addr) (sock_client)); ACE_OS::free ((void *) sock_client); ACE_LSOCK_CODgram sc; |