trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [1/2] trafficserver git commit: [TS-3083]: Fix core dump due to FetchSM double delete
Date Fri, 02 Jan 2015 02:39:23 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/5.2.x d0323f409 -> 84466819f


[TS-3083]: Fix core dump due to FetchSM double delete


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/61a4f24a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/61a4f24a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/61a4f24a

Branch: refs/heads/5.2.x
Commit: 61a4f24a57dc6bec0d1d63a1a640daac6b824c86
Parents: d0323f4
Author: sunwei <sunwei@yahoo-inc.com>
Authored: Wed Dec 31 01:56:11 2014 +0000
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Thu Jan 1 19:36:01 2015 -0700

----------------------------------------------------------------------
 proxy/FetchSM.cc | 5 +++++
 proxy/FetchSM.h  | 2 ++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/61a4f24a/proxy/FetchSM.cc
----------------------------------------------------------------------
diff --git a/proxy/FetchSM.cc b/proxy/FetchSM.cc
index c5fc04b..3bb950f 100644
--- a/proxy/FetchSM.cc
+++ b/proxy/FetchSM.cc
@@ -36,6 +36,11 @@ FetchSM::cleanUp()
 {
   Debug(DEBUG_TAG, "[%s] calling cleanup", __FUNCTION__);
 
+  if (!ink_atomic_cas(&destroyed, false, true)) {
+    Debug(DEBUG_TAG, "Error: Double delete on FetchSM, this:%p", this);
+    return;
+  }
+
   if (resp_is_chunked > 0 && (fetch_flags & TS_FETCH_FLAGS_DECHUNK)) {
     chunked_handler.clear();
    }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/61a4f24a/proxy/FetchSM.h
----------------------------------------------------------------------
diff --git a/proxy/FetchSM.h b/proxy/FetchSM.h
index c48bb4f..076e092 100644
--- a/proxy/FetchSM.h
+++ b/proxy/FetchSM.h
@@ -52,6 +52,7 @@ public:
     header_done = 0;
     user_data = NULL;
     has_sent_header = false;
+    destroyed = false;
     req_content_length = 0;
     resp_is_chunked = -1;
     resp_content_length = -1;
@@ -167,6 +168,7 @@ private:
   bool header_done;
   bool is_method_head;
   bool is_internal_request;
+  bool destroyed;
   IpEndpoint _addr;
   int resp_is_chunked;
   int resp_received_close;


Mime
View raw message