Skip to content

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

Closed

Description

@issacgerges

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

Activity

  1. issacgerges commented on Jun 12, 2019

    @issacgerges
    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

  2. coreh commented on Jun 12, 2019

    @coreh

    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

  3. nornagon commented on Jun 28, 2019

    @nornagon
    Contributor

    @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 :)

  4. nornagon commented on Jul 3, 2019

    @nornagon
    Contributor

    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.

  5. self-assigned this
    on Jul 23, 2019
  6. codebytere commented on Oct 25, 2019

    @codebytere
    Member

    Resolved by #20214.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions