Repository: trafficserver Updated Branches: refs/heads/master 2cfed613f -> 0f9dda615
TS-3339 Multithread access to PluginVC can cause crash due to unprotected check of shutdown/close Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0f9dda61 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0f9dda61 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0f9dda61 Branch: refs/heads/master Commit: 0f9dda615c2ae2fbc08156cc3c3d99175060ca14 Parents: 2cfed61 Author: William Bardwell <[email protected]> Authored: Thu Jan 29 12:09:55 2015 -0500 Committer: William Bardwell <[email protected]> Committed: Thu Jan 29 13:05:13 2015 -0500 ---------------------------------------------------------------------- CHANGES | 2 ++ proxy/PluginVC.cc | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f9dda61/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index c08adb1..c35c2b3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 5.3.0 + *) [TS-3339] Multithread access to PluginVC can cause crash due to unprotected check of shutdown/close + *) [TS-3300] Add a @internal ACL filter. *) [TS-2884] TSActionCancel() on TSNetAccept() causes spinning thread http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f9dda61/proxy/PluginVC.cc ---------------------------------------------------------------------- diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc index 7b612c2..82f5e8e 100644 --- a/proxy/PluginVC.cc +++ b/proxy/PluginVC.cc @@ -601,7 +601,7 @@ PluginVC::process_read_side(bool other_side_call) need_read_process = false; - if (read_state.vio.op != VIO::READ || closed || read_state.shutdown) { + if (read_state.vio.op != VIO::READ || closed) { return; } // Acquire the lock of the read side continuation @@ -619,6 +619,11 @@ PluginVC::process_read_side(bool other_side_call) Debug("pvc", "[%u] %s: process_read_side", core_obj->id, PVC_TYPE); need_read_process = false; + // Check read_state.shutdown after the lock has been obtained. + if (read_state.shutdown) { + return; + } + // Check the state of our read buffer as well as ntodo int64_t ntodo = read_state.vio.ntodo(); if (ntodo == 0) {
