New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 664200 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

QUIC_STREAM_SEQUENCER_INVALID_STATE error caught

Project Member Reported by danzh@chromium.org, Nov 10 2016

Issue description

Here are some unexpected stream sequencer buffer states collected from server side:

Stream1: QUIC_STREAM_SEQUENCER_INVALID_STATE: QuicStreamSequencerBuffer error: OnStreamData() exceed array bounds.write offset = 0 write_block_num = 0 blocks_count_ = 0                                                                                   

Stream69: QUIC_STREAM_SEQUENCER_INVALID_STATE: QuicStreamSequencerBuffer error: OnStreamData() exceed array bounds.write offset = 8192 write_block_num = 1 blocks_count_ = 1

Stream1: QUIC_STREAM_SEQUENCER_INVALID_STATE: QuicStreamSequencerBuffer error: OnStreamData() exceed array bounds.write offset = 0 write_block_num = 0 blocks_count_ = 0

Stream5: QUIC_STREAM_SEQUENCER_INVALID_STATE: QuicStreamSequencerBuffer error: OnStreamData() exceed array bounds.write offset = 640759 write_block_num = 4294967295 blocks_count_ = 2048

Stream101: QUIC_STREAM_SEQUENCER_INVALID_STATE: QuicStreamSequencerBuffer error: OnStreamData() exceed array bounds.write offset = 8192 write_block_num = 1 blocks_count_ = 1

Stream1: QUIC_STREAM_SEQUENCER_INVALID_STATE: QuicStreamSequencerBuffer error: OnStreamData() exceed array bounds.write offset = 0 write_block_num = 0 blocks_count_ = 0

Stream113: QUIC_STREAM_SEQUENCER_INVALID_STATE: QuicStreamSequencerBuffer error: OnStreamData() exceed array bounds.write offset = 2323529 write_block_num = 4294967295 blocks_count_ = 2048

https://cs.chromium.org/chromium/src/net/quic/core/quic_stream_sequencer_buffer.cc?rcl=1478765818&l=187

blocks_count_ is supposed to be initiated as 2048 (16M/8k) in constructor, but the code below may have some type casting problem in certain platform:
 blocks_count_(
          ceil(static_cast<double>(max_capacity_bytes) / kBlockSizeBytes)),

some of the errors above have write_block_num = 4294967295 which also seems like a type casting issue because 4294967295 is 2^32-1. The code calculating write_block_num_ is:
size_t QuicStreamSequencerBuffer::GetBlockIndex(QuicStreamOffset offset) const {
  return (offset % max_buffer_capacity_bytes_) / kBlockSizeBytes;
}

Another error message belows means quic is trying to read out buffered data but the destination memory's address is null. This might indicate there is use of un-allocated memory.
Stream 5: QuicStreamSequencerBuffer error: Readv() dest == nullptr: true blocks_[0] == nullptr: false     

https://cs.chromium.org/chromium/src/net/quic/core/quic_stream_sequencer_buffer.cc?rcl=1478765818&l=289



 

Comment 1 by danzh@chromium.org, Nov 10 2016

Cc: rch@chromium.org

Comment 2 by danzh@chromium.org, Nov 10 2016

Components: Internals>Network>QUIC

Comment 3 by sdy@chromium.org, Nov 11 2016

Unsure if this is related, but I'm getting ERR_QUIC_PROTOCOL_ERROR when being redirected to a Google Sites site after entering a Google account password. Happy to share logs offline, but I'm not sure if I'm comfortable posting these particular logs to crbug.

Comment 4 by danzh@chromium.org, Nov 11 2016

Hi sdy@, thank for your report! It's hard to tell if the error you experienced is caused by this bug based on the error code ERR_QUIC_PROTOCOL_ERROR.

Can you search for QUIC_STREAM_SEQUENCER_INVALID_STATE in the log to seem whether it appears? Actually all quic errors start with "QUIC_", can you try to search for anything similar in your log? Of course, you're most welcomed to share the logs with me via email.

Comment 5 by rch@chromium.org, Nov 11 2016

sdy@: can you send the log to rch@chromium.org? I'll investigate. I suspect this is actually a problem with a recent experiment.  Which version of Chrome are you running.

Comment 6 by sdy@chromium.org, Nov 20 2016

rch@: I haven't been able to reproduce it again. I will if it comes back! I was running the current Canary at the time.
Project Member

Comment 7 by bugdroid1@chromium.org, Nov 28 2016

Comment 8 by rch@chromium.org, Dec 28 2016

danzh: ping. Is this bug fixed? If not, what's the next step?

Comment 9 by danzh@chromium.org, Dec 29 2016

I'm waiting for version 57.0.2936.0 to roll out. With CHECK's, I expect we should get some crash reports if it is really caused by use-after-free.

Comment 10 by rch@chromium.org, Dec 29 2016

m57 is already in dev. are we getting any crashes from it yet?
Project Member

Comment 12 by bugdroid1@chromium.org, Jul 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/03bdd99f175dacf861d34623d546a8f54278bb36

commit 03bdd99f175dacf861d34623d546a8f54278bb36
Author: Dan Zhang <danzh@chromium.org>
Date: Fri Jul 13 21:21:49 2018

Remove destruction_indicator_ from QuicStreamSequencerBuffer.

Existing crashes are not use-after-free. The CHECK's haven't been triggered so far.

Merge internal changelist: 204339592

R=zhongyi@chromium.org

Change-Id: I2b0549aafff5f639a3a86803aef364dc8c4e059c

Bug: 664200
Change-Id: I2b0549aafff5f639a3a86803aef364dc8c4e059c
Reviewed-on: https://chromium-review.googlesource.com/1135871
Commit-Queue: Dan Zhang <danzh@chromium.org>
Reviewed-by: Zhongyi Shi <zhongyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575074}
[modify] https://crrev.com/03bdd99f175dacf861d34623d546a8f54278bb36/net/third_party/quic/core/quic_stream_sequencer_buffer.cc
[modify] https://crrev.com/03bdd99f175dacf861d34623d546a8f54278bb36/net/third_party/quic/core/quic_stream_sequencer_buffer.h

Status: Assigned (was: Untriaged)
This bug has an owner, thus, it's been triaged. Changing status to "assigned".

Sign in to add a comment