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

Issue 408633002: Fix error handling for message parse errors that occur during connection setup. (Closed)

Created:
6 years, 5 months ago by Kevin M
Modified:
6 years, 4 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Fix error handling for message parse errors that occur during connection setup. BUG=394940 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285769

Patch Set 1 #

Patch Set 2 : Allow read event loop to close socket on error. #

Total comments: 17

Patch Set 3 : Addressed feedback, changed some DCHECKs to CHECKs #

Patch Set 4 : Restored previous impl for hopping from read loop to connect loop. #

Patch Set 5 : Misc. changes #

Total comments: 20

Patch Set 6 : Responded to review feedback #

Patch Set 7 : Removed NOTREACHED #

Total comments: 8

Patch Set 8 : Removed superfluous size check #

Total comments: 15

Patch Set 9 : Changed some sanity checks back to CHECKs. #

Total comments: 2

Patch Set 10 : CHECK_NE => CHECK_GT #

Patch Set 11 : Merging in changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -41 lines) Patch
M extensions/browser/api/cast_channel/cast_socket.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +37 lines, -30 lines 0 comments Download
M extensions/browser/api/cast_channel/cast_socket_unittest.cc View 1 2 3 4 5 6 7 8 9 10 43 chunks +80 lines, -11 lines 0 comments Download

Messages

Total messages: 43 (0 generated)
mark a. foltz
Thanks for taking a stab at this. Writing a unit tests that fails without the ...
6 years, 5 months ago (2014-07-21 17:38:52 UTC) #1
mark a. foltz
Also, before committing, suggest having rsleevi@ have a look, as his feedback largely determined the ...
6 years, 5 months ago (2014-07-21 17:40:42 UTC) #2
Kevin M
https://codereview.chromium.org/408633002/diff/20001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/20001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode161 chrome/browser/extensions/api/cast_channel/cast_socket.cc:161: return AuthenticateChallengeReply(*challenge_reply_, peer_cert_); On 2014/07/21 17:38:52, mark a. foltz ...
6 years, 5 months ago (2014-07-21 20:48:58 UTC) #3
mark a. foltz
https://codereview.chromium.org/408633002/diff/20001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/20001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode638 chrome/browser/extensions/api/cast_channel/cast_socket.cc:638: // If inside connection flow, then get back to ...
6 years, 5 months ago (2014-07-21 21:23:01 UTC) #4
Kevin M
Note: I'm seeing segfaults when I close the browser after a Cast session on a ...
6 years, 5 months ago (2014-07-21 23:50:31 UTC) #5
Wez
LGTM; apologies for the delay, and thanks for being patient with your trio of picky ...
6 years, 5 months ago (2014-07-22 22:33:10 UTC) #6
Ryan Sleevi
https://codereview.chromium.org/408633002/diff/80001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/80001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode571 chrome/browser/extensions/api/cast_channel/cast_socket.cc:571: CHECK_LE(num_bytes_to_read, MessageHeader::max_message_size()); BUG? It seems to me that the ...
6 years, 5 months ago (2014-07-22 22:52:43 UTC) #7
Wez
https://codereview.chromium.org/408633002/diff/80001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/80001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode571 chrome/browser/extensions/api/cast_channel/cast_socket.cc:571: CHECK_LE(num_bytes_to_read, MessageHeader::max_message_size()); On 2014/07/22 22:52:43, Ryan Sleevi wrote: > ...
6 years, 5 months ago (2014-07-23 05:22:01 UTC) #8
Wez
On 2014/07/23 05:22:01, Wez wrote: > https://codereview.chromium.org/408633002/diff/80001/chrome/browser/extensions/api/cast_channel/cast_socket.cc > File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): > > https://codereview.chromium.org/408633002/diff/80001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode571 > ...
6 years, 5 months ago (2014-07-23 17:15:06 UTC) #9
Kevin M
https://codereview.chromium.org/408633002/diff/20001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/20001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode554 chrome/browser/extensions/api/cast_channel/cast_socket.cc:554: DCHECK_LE(num_bytes_to_read, MessageHeader::header_size()); On 2014/07/22 22:33:09, Wez wrote: > On ...
6 years, 5 months ago (2014-07-23 18:57:34 UTC) #10
Wez
https://codereview.chromium.org/408633002/diff/120001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/120001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode545 chrome/browser/extensions/api/cast_channel/cast_socket.cc:545: // Connection not yet established. nit: No need for ...
6 years, 5 months ago (2014-07-23 21:27:43 UTC) #11
Ryan Sleevi
https://codereview.chromium.org/408633002/diff/120001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/120001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode729 chrome/browser/extensions/api/cast_channel/cast_socket.cc:729: if (size >= static_cast<size_t>(kuint32max) || On 2014/07/23 21:27:42, Wez ...
6 years, 5 months ago (2014-07-23 22:31:13 UTC) #12
Wez
https://codereview.chromium.org/408633002/diff/120001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/120001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode729 chrome/browser/extensions/api/cast_channel/cast_socket.cc:729: if (size >= static_cast<size_t>(kuint32max) || On 2014/07/23 22:31:13, Ryan ...
6 years, 5 months ago (2014-07-23 22:33:32 UTC) #13
Kevin M
https://codereview.chromium.org/408633002/diff/120001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/120001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode545 chrome/browser/extensions/api/cast_channel/cast_socket.cc:545: // Connection not yet established. On 2014/07/23 21:27:42, Wez ...
6 years, 5 months ago (2014-07-23 23:40:47 UTC) #14
mark a. foltz
It's okay to convert to convert some of the DCHECKs to error states; but they ...
6 years, 5 months ago (2014-07-24 00:32:42 UTC) #15
Wez
Sorry... I think Mark's right that these DCHECKs really were to catch logic errors, so ...
6 years, 5 months ago (2014-07-24 00:55:55 UTC) #16
Kevin M
https://codereview.chromium.org/408633002/diff/140001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/140001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode564 chrome/browser/extensions/api/cast_channel/cast_socket.cc:564: error_state_ = CHANNEL_ERROR_INVALID_MESSAGE; On 2014/07/24 00:55:55, Wez wrote: > ...
6 years, 5 months ago (2014-07-24 17:45:07 UTC) #17
mark a. foltz
lgtm
6 years, 5 months ago (2014-07-24 20:16:38 UTC) #18
Kevin M
The CQ bit was checked by kmarshall@chromium.org
6 years, 5 months ago (2014-07-24 23:17:29 UTC) #19
Kevin M
The CQ bit was unchecked by kmarshall@chromium.org
6 years, 5 months ago (2014-07-24 23:17:53 UTC) #20
Kevin M
The CQ bit was checked by kmarshall@chromium.org
6 years, 5 months ago (2014-07-24 23:18:00 UTC) #21
Wez
lgtm https://codereview.chromium.org/408633002/diff/160001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/160001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode570 chrome/browser/extensions/api/cast_channel/cast_socket.cc:570: CHECK_NE(num_bytes_to_read, 0U); CHECK_GT?
6 years, 5 months ago (2014-07-24 23:18:38 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kmarshall@chromium.org/408633002/160001
6 years, 5 months ago (2014-07-24 23:21:34 UTC) #23
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: mac_chromium_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-25 05:14:32 UTC) #24
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-25 06:15:55 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/win_chromium_x64_rel/builds/34536)
6 years, 5 months ago (2014-07-25 06:15:56 UTC) #26
Kevin M
https://codereview.chromium.org/408633002/diff/160001/chrome/browser/extensions/api/cast_channel/cast_socket.cc File chrome/browser/extensions/api/cast_channel/cast_socket.cc (right): https://codereview.chromium.org/408633002/diff/160001/chrome/browser/extensions/api/cast_channel/cast_socket.cc#newcode570 chrome/browser/extensions/api/cast_channel/cast_socket.cc:570: CHECK_NE(num_bytes_to_read, 0U); On 2014/07/24 23:18:38, Wez wrote: > CHECK_GT? ...
6 years, 5 months ago (2014-07-25 17:02:39 UTC) #27
Kevin M
The CQ bit was checked by kmarshall@chromium.org
6 years, 5 months ago (2014-07-25 17:02:45 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kmarshall@chromium.org/408633002/180001
6 years, 5 months ago (2014-07-25 17:03:52 UTC) #29
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium ...
6 years, 5 months ago (2014-07-25 17:18:55 UTC) #30
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-25 17:20:57 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: mac_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu/builds/33398)
6 years, 5 months ago (2014-07-25 17:20:59 UTC) #32
Kevin M
The CQ bit was checked by kmarshall@chromium.org
6 years, 5 months ago (2014-07-25 17:41:39 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kmarshall@chromium.org/408633002/180001
6 years, 5 months ago (2014-07-25 17:43:15 UTC) #34
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium ...
6 years, 5 months ago (2014-07-25 18:02:03 UTC) #35
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-25 18:03:33 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: mac_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu/builds/33420)
6 years, 5 months ago (2014-07-25 18:03:34 UTC) #37
Kevin M
The CQ bit was checked by kmarshall@chromium.org
6 years, 5 months ago (2014-07-25 23:06:07 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kmarshall@chromium.org/408633002/200001
6 years, 5 months ago (2014-07-25 23:07:24 UTC) #39
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_rel_swarming on tryserver.chromium ...
6 years, 5 months ago (2014-07-26 05:02:26 UTC) #40
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_clang_dbg on tryserver.chromium.linux ...
6 years, 5 months ago (2014-07-26 17:09:40 UTC) #41
commit-bot: I haz the power
Change committed as 285769
6 years, 5 months ago (2014-07-26 18:16:33 UTC) #42
vivekg
6 years, 4 months ago (2014-07-28 09:12:31 UTC) #43
Message was sent while issue was closed.
On 2014/07/26 18:16:33, I haz the power (commit-bot) wrote:
> Change committed as 285769

This causes a build failure with gcc 4.8.2. CL fixing the same here:
https://codereview.chromium.org/421233002

Powered by Google App Engine
This is Rietveld 408576698