Repository: trafficserver Updated Branches: refs/heads/master 4cc3fa3f6 -> cbac493e8
TS-3196: Core dump when handle event check_inactivity. This closes #147. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/cbac493e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/cbac493e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/cbac493e Branch: refs/heads/master Commit: cbac493e8c2654c7112c0cfc9a048b5a0c7c0078 Parents: 4cc3fa3 Author: zouyu <[email protected]> Authored: Fri Nov 14 14:23:43 2014 +0800 Committer: Alan M. Carroll <[email protected]> Committed: Sun Nov 16 20:24:40 2014 -0600 ---------------------------------------------------------------------- CHANGES | 2 ++ iocore/net/UnixNetVConnection.cc | 7 +++++-- proxy/ProtocolProbeSessionAccept.cc | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbac493e/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index f2b9e59..2e554d5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 5.2.0 + *) [TS-3196] Prevent crash due to de-allocated read VIO continuation. + *) [TS-3199] Do not wait for body for HEAD method *) [TS-3192] Implement proxy.config.config_dir. http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbac493e/iocore/net/UnixNetVConnection.cc ---------------------------------------------------------------------- diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc index b3d1a17..6adc4ee 100644 --- a/iocore/net/UnixNetVConnection.cc +++ b/iocore/net/UnixNetVConnection.cc @@ -134,7 +134,9 @@ static inline int read_signal_and_update(int event, UnixNetVConnection *vc) { vc->recursion++; - vc->read.vio._cont->handleEvent(event, &vc->read.vio); + if (vc->read.vio._cont) { + vc->read.vio._cont->handleEvent(event, &vc->read.vio); + } if (!--vc->recursion && vc->closed) { /* BZ 31932 */ ink_assert(vc->thread == this_ethread()); @@ -552,8 +554,9 @@ VIO * UnixNetVConnection::do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *buf) { ink_assert(!closed); + ink_assert(c || 0 == nbytes); read.vio.op = VIO::READ; - read.vio.mutex = c->mutex; + read.vio.mutex = c ? c->mutex : this->mutex; read.vio._cont = c; read.vio.nbytes = nbytes; read.vio.ndone = 0; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbac493e/proxy/ProtocolProbeSessionAccept.cc ---------------------------------------------------------------------- diff --git a/proxy/ProtocolProbeSessionAccept.cc b/proxy/ProtocolProbeSessionAccept.cc index 391604e..1ec85d2 100644 --- a/proxy/ProtocolProbeSessionAccept.cc +++ b/proxy/ProtocolProbeSessionAccept.cc @@ -111,7 +111,7 @@ struct ProtocolProbeTrampoline : public Continuation, public ProtocolProbeSessio key = PROTO_HTTP; } - netvc->do_io_read(this, 0, NULL); // Disable the read IO that we started. + netvc->do_io_read(NULL, 0, NULL); // Disable the read IO that we started. if (probeParent->endpoint[key] == NULL) { Warning("Unregistered protocol type %d", key);
