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

Issue 766713 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: 2017-10-09
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug-Regression

Blocking:
issue 774158



Sign in to add a comment

Extensions sending oversized IPCs

Project Member Reported by roc...@chromium.org, Sep 19 2017

Issue description

See crash reports here:

https://crash.corp.google.com/browse?q=custom_data.ChromeCrashProto.magic_signature_1.name%3D%27IPC%3A%3AChannelProxy%3A%3ASendInternal%27%20AND%20product.version%20%3E%3D%20%2763.0.3219.0%27%20AND%20%20custom_data.ChromeCrashProto.ptype%3D%27extension%27&sql_dialect=dremelsql&ignore_case=false&enable_rewrite=true&omit_field_name=&omit_field_value=&omit_field_opt=%3D

It's not clear which extensions API(s) make this possible, and it's also not clear whether or not this is a high priority to address, since it just means an extension will be appropriately killed if it tries sending the browser too much data.
 

Comment 2 by roc...@chromium.org, Sep 19 2017

Actually if the numbers are high enough it might be worth blocking stable release on getting this fixed. An extension process dying is one thing, but if a content script can crash a tab that seems quite a bit more unfortunate.
How much is "too much data"?  Is this restriction new, or did extensions just start sending more?

Comment 4 by roc...@chromium.org, Sep 19 2017

No, it's an old restriction but it used to go undetected by crash reports,
resulting in silent extension or renderer process death. The limit is 128
MB.

Comment 5 by roc...@chromium.org, Sep 19 2017

FWIW on second glance it looks like *all* of the reports are in fact from message port usage, so fixing this may be as simple as imposing a max message length in the messaging JS shim.
Yeah, messaging is one of the few areas where we allow arbitrary large data.  So this isn't regressing in any way, but now we can quantify how bad it is.  Nifty.

I shudder to think about what extensions are passing 128 MB through JS, though...

Comment 7 by roc...@chromium.org, Sep 20 2017

Note that this means an extension can also cause the browser itself to send an oversized IPC to a renderer or extension process, resulting in us hitting the CHECK in the browser as well:

https://crash.corp.google.com/browse?q=custom_data.ChromeCrashProto.magic_signature_1.name%3D%27IPC%3A%3AChannelProxy%3A%3ASendInternal%27%20AND%20custom_data.ChromeCrashProto.ptype%3D%27browser%27&sql_dialect=dremelsql&ignore_case=false&enable_rewrite=true&omit_field_name=&omit_field_value=&omit_field_opt=%3D

Arguably we should not crash the browser in such cases, but the net result before the CHECK would still have been a renderer or extension process silently breaking. Crashing may be better than that.

Comment 8 by roc...@chromium.org, Sep 20 2017

Issue 766691 has been merged into this issue.
Project Member

Comment 9 by sheriffbot@chromium.org, Sep 21 2017

Labels: FoundIn-M-63 Fracas
Users experienced this crash on the following builds:

Win Canary 63.0.3220.0 -  1.37 CPM, 18 reports, 17 clients (signature IPC::ChannelProxy::SendInternal)
Mac Canary 63.0.3220.0 -  3.89 CPM, 14 reports, 12 clients (signature IPC::ChannelProxy::SendInternal)

If this update was incorrect, please add "Fracas-Wrong" label to prevent future updates.

- Go/Fracas
Issue 766032 has been merged into this issue.
Cc: ajha@chromium.org jmukthavaram@chromium.org
Just to update the latest behavior of the crash:

Still we are seeing the crashes on latest dev:

63.0.3218.0	54.17%	130	-Dev

Link to the list of builds:
----------------------------
https://crash.corp.google.com/browse?q=product.name%3D%27Chrome_Mac%27%20%20AND%20custom_data.ChromeCrashProto.magic_signature_1.name%3D%27mojo%3A%3Aedk%3A%3ANodeChannel%3A%3AWriteChannelMessage%27&sql_dialect=dremelsql&ignore_case=false&enable_rewrite=true&omit_field_name=&omit_field_value=&omit_field_opt=%3D#productversion:1000

Thanks..!


Comment 12 by ajha@chromium.org, Sep 26 2017

Labels: -Type-Bug -Pri-3 ReleaseBlock-Beta M-63 Pri-1 Type-Bug-Regression
Updating the blocker and milestone label for tracking.

Comment 13 by ajha@chromium.org, Sep 26 2017

Labels: Stability-Crash
Cc: -rdevlin....@chromium.org roc...@chromium.org
Labels: -ReleaseBlock-Beta
Owner: rdevlin....@chromium.org
Status: Assigned (was: Unconfirmed)
My understanding from rockot@ is that this is *not* a regression.  Is that accurate?
Yes, accurate. There is no net decrease in stability, only an increase in
visibility.
Project Member

Comment 16 by bugdroid1@chromium.org, Sep 28 2017

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

commit a31644c6bbfce45f46d92f6bb8ef4ca824ee5854
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Sep 28 21:58:34 2017

[Extensions] Enforce a maximum message size limit

Enforce a maximum message limit for extensions of a 64MB string (from
the JSON-ified object passed to the API call). We enforce a 128 MB limit
on IPC messages, but even that should be excessively large for our needs.
Also add metrics to see what average messages look like - 64MB is *huge*
(and we have to serialize/deserialize the object multiple times, so
message size can have a pretty big performance impact), so we may be
able to reduce this furter.

Add a test for the new behavior.

Bug:  766713 

Change-Id: Ic72b2c6c3ea3ca68a42fcd8061c9e006bc6f1795
Reviewed-on: https://chromium-review.googlesource.com/688674
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505176}
[modify] https://crrev.com/a31644c6bbfce45f46d92f6bb8ef4ca824ee5854/chrome/browser/extensions/extension_messages_apitest.cc
[add] https://crrev.com/a31644c6bbfce45f46d92f6bb8ef4ca824ee5854/chrome/test/data/extensions/api_test/messaging/large_messages/background.js
[add] https://crrev.com/a31644c6bbfce45f46d92f6bb8ef4ca824ee5854/chrome/test/data/extensions/api_test/messaging/large_messages/manifest.json
[modify] https://crrev.com/a31644c6bbfce45f46d92f6bb8ef4ca824ee5854/extensions/renderer/messaging_bindings.cc
[modify] https://crrev.com/a31644c6bbfce45f46d92f6bb8ef4ca824ee5854/extensions/renderer/messaging_bindings.h
[modify] https://crrev.com/a31644c6bbfce45f46d92f6bb8ef4ca824ee5854/extensions/renderer/resources/messaging.js
[modify] https://crrev.com/a31644c6bbfce45f46d92f6bb8ef4ca824ee5854/tools/metrics/histograms/histograms.xml

Project Member

Comment 17 by ClusterFuzz, Oct 1 2017

Components: Internals>Core
Labels: Test-Predator-AutoComponents
Automatically applying components based on information from OWNERS files. If this seems incorrect, please apply the Test-Predator-Wrong-Components label.
NextAction: 2017-10-09

Comment 20 by pdr@chromium.org, Oct 2 2017

Is this the primary cause of the IPC crashes in crbug.com/758902? Should this be merged?
crbug.com/758902 is about selecting text on the chrome://version page, which triggers a separate IPC.  I think these are separate issues, since this one is only about extensions sending massive messages (and other IPCs may need to be handled individually).
To be clear, bug 758902 was initiated by a generic IPC receiver stack trace which instigated this whole investigation, and it just happens that the chrome://version drag-and-drop behavior was a consistent way to repro the crash.

In hindsight with the data we have now (after moving to sender-side crashing) it seems likely that the majority of those crashes should be attributed to this bug instead. A merge may be desirable here, and it may also make sense for me to merge the sender-side crashing changes to M62 and M61, per bug 771235.
Cc: brajkumar@chromium.org
Just to update latest behavior, crashes are still observed on latest beta and dev channels.  

62.0.3202.45	15.45%	38 - Beta	
63.0.3230.0	1.22%	3  - Dev

Link to the list of the builds getting crash:
---------------------------------------------
https://crash.corp.google.com/browse?q=product.name%3D%27Chrome%27%20%20AND%20custom_data.ChromeCrashProto.ptype%3D%27renderer%27%20AND%20custom_data.ChromeCrashProto.magic_signature_1.name%3D%27IPC%3A%3AChannelProxy%3A%3ASendInternal%27&sql_dialect=dremelsql&ignore_case=false&enable_rewrite=true&omit_field_name=&omit_field_value=&omit_field_opt=%3D#productversion:1000

Thanks!


	
Beta is 62, but the patch landed in 63.0.3227.0, so it's expected that we have crashes.

The crashes from 63.0.3230.0 are from different messages being sent.

https://crash.corp.google.com/browse?q=product.name%3D%27Chrome%27%20%20AND%20custom_data.ChromeCrashProto.ptype%3D%27renderer%27%20AND%20custom_data.ChromeCrashProto.magic_signature_1.name%3D%27IPC%3A%3AChannelProxy%3A%3ASendInternal%27%20AND%20product.version%3E%2763.0.3227.0%27&sql_dialect=dremelsql&ignore_case=false&enable_rewrite=true&omit_field_name=&omit_field_value=&omit_field_opt=%3D

It looks like there's two from clipboard (maybe copying huge amounts of data?) and one from a console message (logging huge amounts of data?).  Ken, do those have separate bugs filed?
Not that I'm aware of, but they should
Labels: Merge-Request-62
Also adding Merge-Request-62.  It seems like this does fix the extensions-related crash.  It's a bit late in the release cycle, so I'll leave it up to the release managers if this is worth merging.  So far, we've seen no issues with the patch, and it's a relatively small change.
Project Member

Comment 27 by sheriffbot@chromium.org, Oct 6 2017

Labels: -Merge-Request-62 Merge-Review-62 Hotlist-Merge-Review
This bug requires manual review: We are only 10 days from stable.
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Filed issue 772466 and issue 772468 for the clipboard and console bugs, respectively.
Since we're about 9 days away from Stable, recommendation is to wait until M63. Please confirm if you see any issues with this, or if there will be a large regression for users. 
From talking with Ken, there was a behavior change in M62 such that now these large messages crash the browser, instead of just exiting the renderer process.  Judging from numbers on Beta, it looks like this will be a significant crash on stable.  It seems like it might be worth merging.
The NextAction date has arrived: 2017-10-09
Project Member

Comment 32 by ClusterFuzz, Oct 9 2017

Labels: Needs-Feedback
ClusterFuzz testcase 6310618306183168 is still reproducing on tip-of-tree build (trunk).

Please re-test your fix against this testcase and if the fix was incorrect or incomplete, please re-open the bug. Otherwise, ignore this notification and add ClusterFuzz-Wrong label.
Cc: abdulsyed@chromium.org
@abdulsyed, please see comment #30.
Labels: ClusterFuzz-Wrong
https://clusterfuzz.com/v2/testcase-detail/6310618306183168 refers to a different crash (to do with blobs, rather than extension messages).
Labels: -Merge-Review-62 Merge-Approved-62
Thanks for more feedback. Approving merge to M62. Branch:3202
Project Member

Comment 36 by bugdroid1@chromium.org, Oct 10 2017

Labels: -merge-approved-62 merge-merged-3202
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6b618aa0771f9ec409919a96af5aa178e7fc91aa

commit 6b618aa0771f9ec409919a96af5aa178e7fc91aa
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Oct 10 20:35:06 2017

[Extensions] Enforce a maximum message size limit

Enforce a maximum message limit for extensions of a 64MB string (from
the JSON-ified object passed to the API call). We enforce a 128 MB limit
on IPC messages, but even that should be excessively large for our needs.
Also add metrics to see what average messages look like - 64MB is *huge*
(and we have to serialize/deserialize the object multiple times, so
message size can have a pretty big performance impact), so we may be
able to reduce this furter.

Add a test for the new behavior.

Bug:  766713 

TBR=rdevlin.cronin@chromium.org

(cherry picked from commit a31644c6bbfce45f46d92f6bb8ef4ca824ee5854)

Change-Id: Ic72b2c6c3ea3ca68a42fcd8061c9e006bc6f1795
Reviewed-on: https://chromium-review.googlesource.com/688674
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#505176}
Reviewed-on: https://chromium-review.googlesource.com/710375
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/branch-heads/3202@{#643}
Cr-Branched-From: fa6a5d87adff761bc16afc5498c3f5944c1daa68-refs/heads/master@{#499098}
[modify] https://crrev.com/6b618aa0771f9ec409919a96af5aa178e7fc91aa/chrome/browser/extensions/extension_messages_apitest.cc
[add] https://crrev.com/6b618aa0771f9ec409919a96af5aa178e7fc91aa/chrome/test/data/extensions/api_test/messaging/large_messages/background.js
[add] https://crrev.com/6b618aa0771f9ec409919a96af5aa178e7fc91aa/chrome/test/data/extensions/api_test/messaging/large_messages/manifest.json
[modify] https://crrev.com/6b618aa0771f9ec409919a96af5aa178e7fc91aa/extensions/renderer/messaging_bindings.cc
[modify] https://crrev.com/6b618aa0771f9ec409919a96af5aa178e7fc91aa/extensions/renderer/messaging_bindings.h
[modify] https://crrev.com/6b618aa0771f9ec409919a96af5aa178e7fc91aa/extensions/renderer/resources/messaging.js
[modify] https://crrev.com/6b618aa0771f9ec409919a96af5aa178e7fc91aa/tools/metrics/histograms/histograms.xml

Comment 37 by kbr@chromium.org, Oct 12 2017

Blocking: 774158

Comment 38 by kbr@chromium.org, Oct 12 2017

Cc: kbr@chromium.org
Please note that this change breaks useful extensions. It's unfortunate that it was merged back to M62. Please see Issue 774158.

Labels: -Test-Predator-AutoComponents Test-Predator-Auto-Components
Cc: gov...@chromium.org
rdevlin.cronin@, I'm still seeing considerable no. of crashes on Latest M62 Stable versions especially for "OS=Mac" after the above merge (c#36) to "3202 branch".

62.0.3202.94	32.40%	2099	
62.0.3202.89	21.89%	1418	
62.0.3202.75	17.80%	1153	
62.0.3202.62	19.59%	1269	

Ref link: https://goto.google.com/tisxf

Can you please take a look and comment what's happening here? We are doing M63 stable promotion in few days, so just wondering if it'll have potential impact on M63 as well?

Thanks in-advance!
Cc: pbomm...@chromium.org
@40 The reference link provided seems to be for a different crash?  Looks like it's for mojo::edk::NodeChannel::WriteChannelMessage(std::__1::unique_ptr<mojo::edk::Channel::Message, std::__1::default_delete<mojo::edk::Channel::Message> >) and issue 766032.
Cc: manoranj...@chromium.org
Yes, #40 is for crbug/766032 (which is duped into current crbug/766713).
Oh, I see.

I'm not sure that issue 766032 should have been duped into this - this was only a subset of the possible times when issue 766032 could have occurred.  Though this particular fix was merged to M62, there are other bugs (issue 772466 and issue 772468) where the crash can occur.

The reason the old stack trace is still showing up in M62 is that rockot's patch in 766032 was only in M63.  My suspicion is that the crashes we are seeing in M62 are from the other times this can happen (772466, 772468).

rockot@, would it make sense to un-dupe issue 766032 and mark it as blocked on the other bugs?
I don't think it makes sense to treat that as a meta-bug, as it can effectively never be closed, or will be re-opened ad infinitum whenever new message size violations are introduced.

I have however de-duped it from this bug and added a note for posterity.
rockot@, cool, thank you for the update!

Sign in to add a comment