diff options
-rw-r--r-- | ChangeLog-99b | 30 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | ace/Memory_Pool.cpp | 18 | ||||
-rw-r--r-- | ace/Signal.cpp | 20 | ||||
-rw-r--r-- | ace/Signal.h | 14 | ||||
-rw-r--r-- | examples/ASX/CCM_App/SC_Server.cpp | 6 | ||||
-rw-r--r-- | examples/Service_Configurator/IPC-tests/server/server_test.cpp | 8 |
7 files changed, 70 insertions, 27 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index 2bf7bcd14ce..134c6671a82 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,3 +1,33 @@ +Mon Aug 9 10:45:24 1999 Douglas C. Schmidt <schmidt@mambo.cs.wustl.edu> + + * ace/Memory_Pool.cpp (handle_signal): When working with an MMAP + memory pool, a "real" segmentation fault (not related to + updating the memory mapping) will cause the process to fail but + not write a core file. This is because that on linux (and + possibly other flavours of UNIX) core file writing is a default + behaviour which is disabled once you register a signal handler. + Even if the signal handler returns a bad return value which + crashes the program, a core file will not be written. + + The fix for this is to modify the mmap() signal handler so that + it de-registers the signal handler when detecting a segfault + with the mapping up to date and return an "ok" answer. the + program will attempt to access the illegal address again and + dump core. Thanks to Joseph Weihs <joseph-w@Orbotech.Co.IL> for + contributing this fix. + + * ace/Signal: Changed the new handle_i() and register_handler_i() + methods to be static member functions so they can be called from + the static dispatch() member function. Thanks to Andreas + Geisler <andreas.geisler@erls.siemens.de> for reporting this. + +Mon Aug 9 10:33:50 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * examples/ASX/CCM_App/SC_Server.cpp: Make sure to enable + the appropriate parameter for ACE_Service_Config::open() so that + static services will be enabled. Thanks to Michael Roth + <ombelico@gmx.net> for reporting this. + Mon Aug 09 10:21:37 1999 David L. Levine <levine@cs.wustl.edu> * include/makeinclude/wrapper_macros.GNU (INCLDIRS): @@ -717,6 +717,7 @@ Matthias Schumann <matthias.schumann@xcc.de> John Gathright <johng@keck.hawaii.edu> Alexander Villatora <alex@cfx.com> Hoang Duong <hduong@lycosmail.com> +Michael Roth <ombelico@gmx.net> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson. Paul devised the recursive Makefile scheme that diff --git a/ace/Memory_Pool.cpp b/ace/Memory_Pool.cpp index 06877977001..b9ba8e1b3d3 100644 --- a/ace/Memory_Pool.cpp +++ b/ace/Memory_Pool.cpp @@ -433,18 +433,22 @@ ACE_MMAP_Memory_Pool::handle_signal (int signum, siginfo_t *siginfo, ucontext_t // If guess_on_fault_ is true, then we want to try to remap without // knowing the faulting address. guess_on_fault_ can only be true // on platforms that do not provide the faulting address through - // signals or exceptions. - // We check to see if the mapping is up to date. If it is, then this - // fault isn't due to this mapping and we pass it on. + // signals or exceptions. We check to see if the mapping is up to + // date. If it is, then this fault isn't due to this mapping and we + // pass it on. if (guess_on_fault_) { - // check if the current mapping is up to date. + // Check if the current mapping is up to date. off_t current_map_size = ACE_OS::filesize (this->mmap_.handle ()); - if (ACE_static_cast(size_t, current_map_size) == this->mmap_.size()) + if (ACE_static_cast (size_t, current_map_size) == this->mmap_.size ()) { - // It is up to date so this is a bad address. - return -1; + // The mapping is up to date so this really is a bad + // address. Thus, remove current signal handler so process + // will fail with default action and core file will be + // written. + this->signal_handler_.remove_handler (SIGSEGV); + return 0; } // Extend the mapping to cover the size of the backing store. diff --git a/ace/Signal.cpp b/ace/Signal.cpp index 5900b792d86..b84feff3e92 100644 --- a/ace/Signal.cpp +++ b/ace/Signal.cpp @@ -236,7 +236,7 @@ ACE_Sig_Handler::handler (int signum, (ACE_Object_Manager::ACE_SIG_HANDLER_LOCK); ACE_Guard<ACE_Recursive_Thread_Mutex> m (*lock)); - return this->handler_i (signum, new_sh); + return ACE_Sig_Handler::handler_i (signum, new_sh); } // Register an ACE_Event_Handler along with the corresponding SIGNUM. @@ -255,8 +255,8 @@ ACE_Sig_Handler::register_handler_i (int signum, if (ACE_Sig_Handler::in_range (signum)) { ACE_Sig_Action sa; // Define a "null" action. - ACE_Event_Handler *sh = this->handler_i (signum, - new_sh); + ACE_Event_Handler *sh = ACE_Sig_Handler::handler_i (signum, + new_sh); // Return a pointer to the old <ACE_Sig_Handler> if the user // asks for this. @@ -295,11 +295,11 @@ ACE_Sig_Handler::register_handler (int signum, (ACE_Object_Manager::ACE_SIG_HANDLER_LOCK); ACE_Guard<ACE_Recursive_Thread_Mutex> m (*lock)); - return this->register_handler_i (signum, - new_sh, - new_disp, - old_sh, - old_disp); + return ACE_Sig_Handler::register_handler_i (signum, + new_sh, + new_disp, + old_sh, + old_disp); } // Remove an ACE_Event_Handler. @@ -386,8 +386,8 @@ ACE_Sig_Handler::dispatch (int signum, // dispatched. Therefore, to workaround this "feature" we // must re-register the <ACE_Event_Handler> with <signum> // explicitly. - this->register_handler_i (signum, - eh); + ACE_Sig_Handler::register_handler_i (signum, + eh); #endif /* ACE_WIN32*/ } } diff --git a/ace/Signal.h b/ace/Signal.h index 887ca09dacb..71b2964d54a 100644 --- a/ace/Signal.h +++ b/ace/Signal.h @@ -261,17 +261,17 @@ public: protected: // = These methods and data members are shared by derived classes. - virtual ACE_Event_Handler *handler_i (int signum, - ACE_Event_Handler *); + static ACE_Event_Handler *handler_i (int signum, + ACE_Event_Handler *); // Set a new <ACE_Event_Handler> that is associated with <signum>. // Return the existing handler. Does not acquire any locks so that // it can be called from a signal handler, such as <dispatch>. - virtual int register_handler_i (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0, - ACE_Event_Handler **old_sh = 0, - ACE_Sig_Action *old_disp = 0); + static int register_handler_i (int signum, + ACE_Event_Handler *new_sh, + ACE_Sig_Action *new_disp = 0, + ACE_Event_Handler **old_sh = 0, + ACE_Sig_Action *old_disp = 0); // This implementation method is called by <register_handler> and // <dispatch>. It doesn't do any locking so that it can be called // within a signal handler, such as <dispatch>. It adds a new diff --git a/examples/ASX/CCM_App/SC_Server.cpp b/examples/ASX/CCM_App/SC_Server.cpp index 25ec26b41b0..8ee9d741770 100644 --- a/examples/ASX/CCM_App/SC_Server.cpp +++ b/examples/ASX/CCM_App/SC_Server.cpp @@ -61,7 +61,11 @@ main (int argc, char *argv[]) "%p\n", "register_stdin_handler")); - if (loggerd.open (argc, argv) == -1 && errno != ENOENT) + if (loggerd.open (argc, + argv, + ACE_DEFAULT_LOGGER_KEY, + // Don't ignore static services! + 0) == -1 && errno != ENOENT) ACE_ERROR ((LM_ERROR, "%p\n%a", "open", diff --git a/examples/Service_Configurator/IPC-tests/server/server_test.cpp b/examples/Service_Configurator/IPC-tests/server/server_test.cpp index e96eadca795..b42010c7d17 100644 --- a/examples/Service_Configurator/IPC-tests/server/server_test.cpp +++ b/examples/Service_Configurator/IPC-tests/server/server_test.cpp @@ -9,7 +9,10 @@ ACE_RCSID(server, server_test, "$Id$") int main (int argc, char *argv[]) { - if (ACE_Service_Config::open (argc, argv, ACE_DEFAULT_LOGGER_KEY, 0) == -1) + if (ACE_Service_Config::open (argc, + argv, + ACE_DEFAULT_LOGGER_KEY, + 0) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_Service_Config::open"), @@ -24,7 +27,8 @@ main (int argc, char *argv[]) // Register ourselves to receive signals so we can shut down // gracefully. - if (ACE_Reactor::instance ()->register_handler (sig_set, &sa) == -1) + if (ACE_Reactor::instance ()->register_handler (sig_set, + &sa) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n"), -1); |