summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcbeaulac <cbeaulac@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-04-19 18:23:39 +0000
committercbeaulac <cbeaulac@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-04-19 18:23:39 +0000
commita77bc1a67e63f5e075db708360987fd5574ad6fd (patch)
tree27c0708365649e7bdcbfad2fb9837c4c19184e57
parentafdde46ad84360164deaa75bce80c6ed2f232f42 (diff)
downloadATCD-bugzilla_fix_3334.tar.gz
Mon Apr 19 18:17:30 UTC 2010 UTC 2010 Chad Beaulac <chad@objectivesolutions.combugzilla_fix_3334
* ace/Service_Repository.cpp Modified ASR::fini to print debug info for empty service entries and handle empty service entries. This fixes the ASR remove functionality that was one of the reasons SC_Server was crashing at shutdown. * examples/ASX/CCM_App/SC_Server.cpp Removing signal handler before main exit to present SEGV * tests/run_test.lst Apparently it was missed in the last commit. This fixes Bugzilla #2916 and #3205. I'll create another patch for #3334 after this commit.
-rw-r--r--ChangeLog11
-rw-r--r--examples/ASX/CCM_App/SC_Server.cpp43
-rw-r--r--tests/run_test.lst2
3 files changed, 19 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog
index ca116aace05..bc67ebe0995 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-Mon Apr 19 17:34:04 UTC 2010 Chad Beaulac <chad@objectivesolutions.com
+Mon Apr 19 18:17:30 UTC 2010 UTC 2010 Chad Beaulac <chad@objectivesolutions.com
* ace/Service_Repository.cpp
Modified ASR::fini to print debug info for empty
@@ -7,11 +7,12 @@ Mon Apr 19 17:34:04 UTC 2010 Chad Beaulac <chad@objectivesolutions.com
one of the reasons SC_Server was crashing at shutdown.
* examples/ASX/CCM_App/SC_Server.cpp
- Removed ACE_Sig_Adapter shutdown_handler.
- Registered SIGINT and SIGQUIT handler for Event_Handler
- so it could call eh->remove_std_in_handler() to prevent
- SEGV at shutdown when CTRL-C was used to shutdown.
+ Removing signal handler before main exit to present SEGV
+ * tests/run_test.lst
+ Removed !FIXED_BUGS_ONLY from Bug_3334_Regression_Test
+ Apparently it was missed in the last commit.
+
This fixes Bugzilla #2916 and #3205.
I'll create another patch for #3334 after this commit.
diff --git a/examples/ASX/CCM_App/SC_Server.cpp b/examples/ASX/CCM_App/SC_Server.cpp
index 0199451fdd3..e133c3db614 100644
--- a/examples/ASX/CCM_App/SC_Server.cpp
+++ b/examples/ASX/CCM_App/SC_Server.cpp
@@ -10,7 +10,7 @@
#include "ace/Reactor.h"
#include "ace/Sig_Adapter.h"
-ACE_RCSID (CCM_App, SC_Server, "$Id$")
+ACE_RCSID(CCM_App, SC_Server, "$Id$")
class Event_Handler : public ACE_Event_Handler
{
@@ -18,26 +18,8 @@ public:
virtual int handle_input (ACE_HANDLE handle);
virtual int handle_close (ACE_HANDLE,
ACE_Reactor_Mask);
-
- virtual int handle_signal (int signum,
- siginfo_t *,
- ucontext_t *);
};
-
-// @@ Note that this code is not portable to all OS platforms since
-// it does print statements within the signal handler.
-
-int
-Event_Handler::handle_signal (int signum,
- siginfo_t *,
- ucontext_t *)
-{
- if (signum == SIGINT || signum == SIGQUIT)
- return -1;
- return 0;
-}
-
int
Event_Handler::handle_input (ACE_HANDLE handle)
{
@@ -53,7 +35,7 @@ Event_Handler::handle_input (ACE_HANDLE handle)
else if (ACE_OS::write (ACE_STDOUT, buf, n) != n)
ACE_ERROR_RETURN ((LM_DEBUG,
ACE_TEXT ("%p\n"), ACE_TEXT ("write failed")),
- -1);
+ -1);
else
return 0;
}
@@ -63,8 +45,6 @@ Event_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("closing Event_Handler\n")));
- //ACE_Reactor::instance ()->remove_handler (this,ACE_Event_Handler::ALL_EVENTS_MASK);
- this->remove_stdin_handler (ACE_Reactor::instance (),ACE_Thread_Manager::instance ());
ACE_Reactor::instance ()->end_reactor_event_loop ();
return 0;
}
@@ -74,6 +54,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
ACE_Service_Config loggerd;
Event_Handler handler;
+ ACE_Sig_Adapter shutdown_handler ((ACE_Sig_Handler_Ex) ACE_Reactor::end_event_loop);
if (ACE_Event_Handler::register_stdin_handler (&handler,
ACE_Reactor::instance (),
@@ -91,16 +72,16 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
ACE_TEXT ("%p\n%a"),
ACE_TEXT ("open"),
1));
- else
- {
- ACE_Reactor::instance ()->register_handler (SIGQUIT, &handler);
- ACE_Reactor::instance ()->register_handler (SIGINT, &handler);
- ACE_Reactor::instance ()->run_reactor_event_loop ();
+ else if (ACE_Reactor::instance ()->register_handler
+ (SIGINT, &shutdown_handler) == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%p\n%a"),
+ ACE_TEXT ("register_handler"),
+ 1));
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("SC_Server exiting\n")));
+ // Perform logging service until we receive SIGINT.
- loggerd.fini_svcs ();
- }
+ ACE_Reactor::instance ()->run_reactor_event_loop ();
+ handler.remove_stdin_handler (ACE_Reactor::instance (),ACE_Thread_Manager::instance ());
return 0;
}
diff --git a/tests/run_test.lst b/tests/run_test.lst
index 3d1d603d078..d198d0c1d99 100644
--- a/tests/run_test.lst
+++ b/tests/run_test.lst
@@ -47,7 +47,7 @@ Bug_2820_Regression_Test
Bug_2980_Regression_Test: !STATIC !Win32 !VxWorks !WCHAR
Bug_3102_Regression_Test
Bug_3319_Regression_Test
-Bug_3334_Regression_Test: !STATIC !FIXED_BUGS_ONLY
+Bug_3334_Regression_Test: !STATIC
Bug_3432_Regression_Test
Bug_3500_Regression_Test
Bug_3532_Regression_Test