This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  1a7c0fc   TS-4195: double free on exit
1a7c0fc is described below

commit 1a7c0fc8cdf5ed48870e1507bf337fb2e711226f
Author: Zizhong Zhang <[email protected]>
AuthorDate: Fri Mar 10 11:19:51 2017 -0800

    TS-4195: double free on exit
---
 iocore/eventsystem/I_EThread.h    | 2 +-
 iocore/eventsystem/UnixEThread.cc | 2 +-
 lib/ts/signals.cc                 | 7 -------
 proxy/Main.cc                     | 2 --
 4 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/iocore/eventsystem/I_EThread.h b/iocore/eventsystem/I_EThread.h
index 777c759..a502c5c 100644
--- a/iocore/eventsystem/I_EThread.h
+++ b/iocore/eventsystem/I_EThread.h
@@ -53,7 +53,7 @@ enum ThreadType {
   DEDICATED,
 };
 
-extern bool shutdown_event_system;
+extern volatile bool shutdown_event_system;
 
 /**
   Event System specific type of thread.
diff --git a/iocore/eventsystem/UnixEThread.cc 
b/iocore/eventsystem/UnixEThread.cc
index 8206e3f..6fdc480 100644
--- a/iocore/eventsystem/UnixEThread.cc
+++ b/iocore/eventsystem/UnixEThread.cc
@@ -39,7 +39,7 @@ struct AIOCallback;
 #define THREAD_MAX_HEARTBEAT_MSECONDS 60
 #define NO_ETHREAD_ID -1
 
-bool shutdown_event_system = false;
+volatile bool shutdown_event_system = false;
 
 EThread::EThread()
   : generator((uint64_t)Thread::get_hrtime_updated() ^ 
(uint64_t)(uintptr_t)this),
diff --git a/lib/ts/signals.cc b/lib/ts/signals.cc
index 80f743b..3980d27 100644
--- a/lib/ts/signals.cc
+++ b/lib/ts/signals.cc
@@ -162,13 +162,7 @@ signal_format_siginfo(int signo, siginfo_t *info, const 
char *msg)
   (void)info;
   (void)signo;
 
-#if HAVE_PSIGINFO
-  psiginfo(info, const_cast<char *>(msg));
-#elif HAVE_PSIGNAL
-  psignal(signo, msg);
-#else
   char buf[64];
-  size_t len;
 
 #if HAVE_STRSIGNAL
   snprintf(buf, sizeof(buf), "%s: received signal %d (%s)\n", msg, signo, 
strsignal(signo));
@@ -178,7 +172,6 @@ signal_format_siginfo(int signo, siginfo_t *info, const 
char *msg)
 
   ssize_t ignored = write(STDERR_FILENO, buf, strlen(buf));
   (void)ignored; // because gcc and glibc are stupid, "(void)write(...)" 
doesn't suffice.
-#endif
 }
 
 void
diff --git a/proxy/Main.cc b/proxy/Main.cc
index 306f6b0..b65f563 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -462,8 +462,6 @@ proxy_signal_handler(int signo, siginfo_t *info, void *ctx)
 
   shutdown_event_system = true;
   sleep(1);
-
-  ::exit(signo);
 }
 
 //

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to