You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Bryan Call (JIRA)" <ji...@apache.org> on 2016/06/28 18:46:57 UTC

[jira] [Commented] (TS-4542) ASAN error with HTTP/2

    [ https://issues.apache.org/jira/browse/TS-4542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15353513#comment-15353513 ] 

Bryan Call commented on TS-4542:
--------------------------------

Patch I am going to be testing in production
{code}
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 6986244..cc3aee9 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -1027,9 +1027,6 @@ Http2SendADataFrameResult
 Http2ConnectionState::send_a_data_frame(Http2Stream *stream, size_t &payload_length)
 {
   const ssize_t window_size = min(this->client_rwnd, stream->client_rwnd);
-  if (window_size <= 0) {
-    return HTTP2_SEND_A_DATA_FRAME_NO_WINDOW;
-  }
   const size_t buf_len        = BUFFER_SIZE_FOR_INDEX(buffer_size_index[HTTP2_FRAME_TYPE_DATA]) - HTTP2_FRAME_HEADER_LEN;
   const size_t available_size = min(buf_len, static_cast<size_t>(window_size));

@@ -1041,6 +1038,10 @@ Http2ConnectionState::send_a_data_frame(Http2Stream *stream, size_t &payload_len

   // Select appropriate payload length
   if (current_reader && current_reader->is_read_avail_more_than(0)) {
+    if (window_size <= 0) {
+      // We only need to check for window size when there is a payload
+      return HTTP2_SEND_A_DATA_FRAME_NO_WINDOW;
+    }
     // Copy into the payload buffer. Seems like we should be able to skip this copy step
     payload_length = current_reader->read(payload_buffer, available_size);
   } else {
diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index 482898a..df6fd40 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -269,6 +269,7 @@ Http2Stream::do_io_close(int /* flags */)
       static_cast<Http2ClientSession *>(parent)->connection_state.send_data_frames(this);
     }
     parent = NULL;
+    ink_release_assert(get_state() != HTTP2_STREAM_STATE_HALF_CLOSED_REMOTE);

     clear_timers();
     clear_io_events();
@@ -297,6 +298,8 @@ Http2Stream::initiating_close()
     // current_reader = NULL;

     parent = NULL;
+    _state = HTTP2_STREAM_STATE_CLOSED;
+
     clear_timers();
     clear_io_events();
{code}

> ASAN error with HTTP/2
> ----------------------
>
>                 Key: TS-4542
>                 URL: https://issues.apache.org/jira/browse/TS-4542
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: HTTP/2
>    Affects Versions: 6.2.0
>            Reporter: Bryan Call
>            Assignee: Bryan Call
>             Fix For: 7.0.0
>
>
> {code}
> ==29132==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000250 (pc 0x0000009a1be5 sp 0x2ae2c2ab0290 bp 0x2ae2c2ab0370 T20)
>     #0 0x9a1be4 in Ptr<ProxyMutex>::operator ProxyMutex*() const ../../../trafficserver/lib/ts/Ptr.h:317
>     #1 0x9a1be4 in Http2ConnectionState::schedule_stream(Http2Stream*) ../../../trafficserver/proxy/http2/Http2ConnectionState.cc:974
>     #2 0x99eb7f in Http2ConnectionState::restart_streams() ../../../trafficserver/proxy/http2/Http2ConnectionState.cc:914
>     #3 0x99eb7f in rcv_window_update_frame ../../../trafficserver/proxy/http2/Http2ConnectionState.cc:627
>     #4 0x9b27c4 in Http2ConnectionState::main_event_handler(int, void*) ../../../trafficserver/proxy/http2/Http2ConnectionState.cc:823
>     #5 0x9906e3 in Continuation::handleEvent(int, void*) ../../../trafficserver/iocore/eventsystem/I_Continuation.h:153
>     #6 0x9906e3 in send_connection_event ../../../trafficserver/proxy/http2/Http2ClientSession.cc:58
>     #7 0x991145 in Http2ClientSession::state_complete_frame_read(int, void*) ../../../trafficserver/proxy/http2/Http2ClientSession.cc:430
>     #8 0x992ba0 in Continuation::handleEvent(int, void*) ../../../trafficserver/iocore/eventsystem/I_Continuation.h:153
>     #9 0x992ba0 in Http2ClientSession::state_start_frame_read(int, void*) ../../../trafficserver/proxy/http2/Http2ClientSession.cc:403
>     #10 0xe2be16 in Continuation::handleEvent(int, void*) ../../../trafficserver/iocore/eventsystem/I_Continuation.h:153
>     #11 0xe2be16 in read_signal_and_update ../../../trafficserver/iocore/net/UnixNetVConnection.cc:153
>     #12 0xe2be16 in UnixNetVConnection::readSignalAndUpdate(int) ../../../trafficserver/iocore/net/UnixNetVConnection.cc:1036
>     #13 0xdc791e in SSLNetVConnection::net_read_io(NetHandler*, EThread*) ../../../trafficserver/iocore/net/SSLNetVConnection.cc:595
>     #14 0xde7db0 in NetHandler::mainNetEvent(int, Event*) ../../../trafficserver/iocore/net/UnixNet.cc:513
>     #15 0xea2ce9 in Continuation::handleEvent(int, void*) ../../../trafficserver/iocore/eventsystem/I_Continuation.h:153
>     #16 0xea2ce9 in EThread::process_event(Event*, int) ../../../trafficserver/iocore/eventsystem/UnixEThread.cc:148
>     #17 0xea2ce9 in EThread::execute() ../../../trafficserver/iocore/eventsystem/UnixEThread.cc:275
>     #18 0xe9e128 in spawn_thread_internal ../../../trafficserver/iocore/eventsystem/Thread.cc:86
>     #19 0x2ae2b8e85aa0 in start_thread (/lib64/libpthread.so.0+0x3818807aa0)
>     #20 0x38180e893c in clone (/lib64/libc.so.6+0x38180e893c)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)