Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Issue 2032733002: Do not crash on null stream in writing to bidirectional streams (Closed)

Created:
4 years, 6 months ago by xunjieli
Modified:
4 years, 6 months ago
Reviewers:
kapishnikov, mef
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@fix_crash
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not crash on null stream in writing to bidirectional streams When SendData/SendvData is called, it might be that OnClose has been invoked without an error, in which case BidirectionalStream::Delegate::OnFailed would not have been invoked. This is theoretically possible, but I am not aware if such case would exist. This CL removes the assumption that SendData/SendvData is only called when stream is alive. If stream is destroyed, propagate that as an ERR_UNEXPECTED to caller, instead of crashing with a segfault. BUG=606394 Committed: https://crrev.com/707f895efd414219d609533e82be1ffc60fd9788 Cr-Commit-Position: refs/heads/master@{#398031}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Address comments #

Patch Set 3 : self review #

Patch Set 4 : #

Patch Set 5 : Added spdy tests #

Total comments: 8

Patch Set 6 : Rebased #

Total comments: 6

Patch Set 7 : Self review #

Patch Set 8 : Address Andrei's comments #

Total comments: 6

Patch Set 9 : Address Andrei's comments round 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+522 lines, -42 lines) Patch
M net/http/bidirectional_stream.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M net/http/bidirectional_stream_impl.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M net/net.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M net/quic/bidirectional_stream_quic_impl.cc View 1 2 3 4 5 6 7 8 10 chunks +49 lines, -12 lines 0 comments Download
M net/quic/bidirectional_stream_quic_impl_unittest.cc View 1 2 3 11 chunks +23 lines, -4 lines 0 comments Download
M net/spdy/bidirectional_stream_spdy_impl.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
M net/spdy/bidirectional_stream_spdy_impl.cc View 1 2 3 4 5 6 7 8 10 chunks +69 lines, -22 lines 0 comments Download
A net/spdy/bidirectional_stream_spdy_impl_unittest.cc View 1 2 3 4 5 6 1 chunk +373 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (12 generated)
xunjieli
Andrei, Misha: mind taking a look? This is regarding internal bug: 29059108.
4 years, 6 months ago (2016-06-01 21:21:25 UTC) #6
mef
Um, does this fix the problem or its symptoms? https://codereview.chromium.org/2032733002/diff/1/net/http/bidirectional_stream_impl.h File net/http/bidirectional_stream_impl.h (right): https://codereview.chromium.org/2032733002/diff/1/net/http/bidirectional_stream_impl.h#newcode77 net/http/bidirectional_stream_impl.h:77: ...
4 years, 6 months ago (2016-06-01 21:53:15 UTC) #7
kapishnikov
https://codereview.chromium.org/2032733002/diff/1/net/http/bidirectional_stream.h File net/http/bidirectional_stream.h (right): https://codereview.chromium.org/2032733002/diff/1/net/http/bidirectional_stream.h#newcode85 net/http/bidirectional_stream.h:85: // point. I think it is important to keep ...
4 years, 6 months ago (2016-06-01 22:09:50 UTC) #8
xunjieli
Thanks for the review! > Um, does this fix the problem or its symptoms? Sadly, ...
4 years, 6 months ago (2016-06-01 23:08:23 UTC) #10
xunjieli
Misha, Andrei: A friendly ping..
4 years, 6 months ago (2016-06-03 17:29:08 UTC) #13
mef
On 2016/06/03 17:29:08, xunjieli wrote: > Misha, Andrei: A friendly ping.. Is OnClose coming from ...
4 years, 6 months ago (2016-06-03 17:53:53 UTC) #14
xunjieli
On 2016/06/03 17:53:53, mef wrote: > On 2016/06/03 17:29:08, xunjieli wrote: > > Misha, Andrei: ...
4 years, 6 months ago (2016-06-03 17:58:15 UTC) #15
mef
On 2016/06/03 17:58:15, xunjieli wrote: > On 2016/06/03 17:53:53, mef wrote: > > On 2016/06/03 ...
4 years, 6 months ago (2016-06-03 19:34:56 UTC) #16
xunjieli
On 2016/06/03 19:34:56, mef wrote: > On 2016/06/03 17:58:15, xunjieli wrote: > > On 2016/06/03 ...
4 years, 6 months ago (2016-06-03 19:45:02 UTC) #17
mef
I think bailing out if stream_ is null is the right thing to do. I'm ...
4 years, 6 months ago (2016-06-03 20:03:19 UTC) #18
kapishnikov
The change looks good. I assume that NotifyError() and QUIC delegate methods are always called ...
4 years, 6 months ago (2016-06-03 20:10:08 UTC) #19
xunjieli
Just saw Andrei's comments. Will address those shortly. https://codereview.chromium.org/2032733002/diff/140001/net/quic/bidirectional_stream_quic_impl.cc File net/quic/bidirectional_stream_quic_impl.cc (right): https://codereview.chromium.org/2032733002/diff/140001/net/quic/bidirectional_stream_quic_impl.cc#newcode168 net/quic/bidirectional_stream_quic_impl.cc:168: LOG(ERROR) ...
4 years, 6 months ago (2016-06-03 20:20:54 UTC) #20
xunjieli
Thanks Andrei for noticing the logic flaw. I realized some of it after doing a ...
4 years, 6 months ago (2016-06-03 20:28:36 UTC) #21
kapishnikov
https://codereview.chromium.org/2032733002/diff/180001/net/spdy/bidirectional_stream_spdy_impl.cc File net/spdy/bidirectional_stream_spdy_impl.cc (right): https://codereview.chromium.org/2032733002/diff/180001/net/spdy/bidirectional_stream_spdy_impl.cc#newcode162 net/spdy/bidirectional_stream_spdy_impl.cc:162: DCHECK(!stream_); nit: This DCheck will always succeed and can ...
4 years, 6 months ago (2016-06-03 22:46:41 UTC) #22
xunjieli
Thanks a lot for the review!! https://codereview.chromium.org/2032733002/diff/180001/net/spdy/bidirectional_stream_spdy_impl.cc File net/spdy/bidirectional_stream_spdy_impl.cc (right): https://codereview.chromium.org/2032733002/diff/180001/net/spdy/bidirectional_stream_spdy_impl.cc#newcode162 net/spdy/bidirectional_stream_spdy_impl.cc:162: DCHECK(!stream_); On 2016/06/03 ...
4 years, 6 months ago (2016-06-04 01:31:05 UTC) #24
xunjieli
A friendly ping. I have 4 more crash reports on this. If possible, should we ...
4 years, 6 months ago (2016-06-06 12:16:20 UTC) #25
kapishnikov
Looks good to me. LGTM.
4 years, 6 months ago (2016-06-06 13:25:06 UTC) #26
mef
lgtm
4 years, 6 months ago (2016-06-06 14:13:00 UTC) #27
xunjieli
On 2016/06/06 14:13:00, mef wrote: > lgtm Thanks! I have a follow-up CL to improve ...
4 years, 6 months ago (2016-06-06 14:14:35 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2032733002/220001
4 years, 6 months ago (2016-06-06 14:14:59 UTC) #30
commit-bot: I haz the power
Committed patchset #9 (id:220001)
4 years, 6 months ago (2016-06-06 15:22:22 UTC) #32
commit-bot: I haz the power
4 years, 6 months ago (2016-06-06 15:23:50 UTC) #34
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/707f895efd414219d609533e82be1ffc60fd9788
Cr-Commit-Position: refs/heads/master@{#398031}

Powered by Google App Engine
This is Rietveld 408576698