Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for BigBuffer in IPC broken in 6.x and nightly #18758

Closed
3 tasks done
issacgerges opened this issue Jun 12, 2019 · 5 comments
Closed
3 tasks done

Support for BigBuffer in IPC broken in 6.x and nightly #18758

issacgerges opened this issue Jun 12, 2019 · 5 comments

Comments

@issacgerges
Copy link

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    7.0.0-nightly.20190611
  • Operating System:
    MacOS 10.14.5
  • Last Known Working Electron version:
    v5.0.3

Expected Behavior

With the merge of https://chromium.googlesource.com/chromium/src/+/4c5bd80e, legacy ipc internally uses BigBuffer and should support large messages.

Actual Behavior

Electron crashes when ipc.send is called with a large arg (~134mb)

To Reproduce

The following can be opened in electron-fiddle to reproduce the issue

https://gist.github.com/issacgerges/370a76335fd699930c43bde5cbeb41b7

@sofianguy sofianguy added this to Unsorted Issues in 6.1.x Jun 12, 2019
@issacgerges
Copy link
Author

Using lldb it looks like the 6.x error was introduced with this change https://chromium.googlesource.com/chromium/src/+/66.0.3359.158/mojo/edk/system/node_channel.cc#900

The 7.x-nightly error appears to be unrelated, due to porting away from legacy ipc

@coreh
Copy link

coreh commented Jun 12, 2019

image

Yeah, perhaps there is a way we can set max_message_num_bytes?

I tried using something like

app.commandLine.appendSwitch('max_message_num_bytes', '4096000000');

But it doesn't seem to be recognized

Edit: Looks like it's hardcoded to kMaximumMessageSize:

https://github.com/chromium/chromium/blob/8a7f35f9ff2de4a52d053b9a15969663077c2178/content/app/mojo/mojo_init.cc#L24-L25

@nornagon
Copy link
Member

@issacgerges hm.. i'm not sure how that change could result in an error in 6.x since it was introduced in Chrome 66?

I think the right way to handle this would be to add something like ipcRenderer.sendBuffer('channel', args, buf) that uses the mojo_base.mojom.BigBuffer data type under the hood, rather than trying to make send support arbitrarily large data. @issacgerges I'd be happy to help you out getting a PR up for that :)

@nornagon
Copy link
Member

nornagon commented Jul 3, 2019

I don't have time to work on this at the moment, but I'm happy to help someone else who wants to tackle it.

@sofianguy sofianguy moved this from Blocks Stable to Does Not Block Stable in 6.1.x Jul 3, 2019
@codebytere codebytere self-assigned this Jul 23, 2019
@codebytere
Copy link
Member

Resolved by #20214.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
6.1.x
Does Not Block Stable
Development

No branches or pull requests

6 participants