ERROR:channel.cc(507) Invalid message size

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

ERROR:channel.cc(507) Invalid message size

Postby michael » Thu Jun 29, 2017 10:05 am

I'm working on a cef addon for openFramworks. I run into a problem on macOS which I can't firgure out. I've documented this here. The important points are:

With every associated render helper.app there is a chance that it starts consuming massive ammounts of memory. Often after a few GB the process crashes and I see something like
Code: Select all
[0507/173057.677689:ERROR:channel.cc(507)] Invalid message size: 302285456

in the Xcode console. There are other times where the memory just keeps going up.

I dag into the chromium source and found where the massage is coming from "mojo/edk/system/channel.cc". If I understand correctly it's about the communication between the browser and render process.

The addon uses offscreen rendering, CefDoMessageLoopWork(), the most interesting source is probably this.

Also this is cross platform and I don't see this behavior on windows with the cef windows version but the same addon source files.

If anyone wants to try it out, I decribed it here. You can use "example_multi" from this branch.
This example lets you create and delete instances. In that example the first instance has always that memory behavior. There will be more after you create and delete some instances.
The funny thing is if you only change this example a little bit the first instance won't have this behavior anymore. And I'm talking about changes that seemingly have nothing to do with cef. For example when you add
Code: Select all
ofToDataPath("html/index.html", true);
to the setup() function, which is a helper function which creates an absolute path to an asset.

I really have no idea what's going on, I've tested this on a MacBook Pro Mid 2015 and iMac Mid 2009 both with macOS Sierra (10.12.5). Of course I've also tested different cef versions, basically every for two months and currently the "3.3071.1644.g408afd1".

Image

Does anyone have a clue what's going on?
Thanks.
michael
Techie
 
Posts: 14
Joined: Thu Jun 29, 2017 9:28 am

Re: ERROR:channel.cc(507) Invalid message size

Postby magreenblatt » Thu Jun 29, 2017 11:05 am

What content are you loading in the browser? What callbacks have you implemented in the renderer process?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: ERROR:channel.cc(507) Invalid message size

Postby michael » Thu Jun 29, 2017 1:12 pm

It really doesn't matter what I try to load, I tried a simple local html file all the way to WebGL stuff like http://mrdoob.com/#/137/voxels_liquid, this behavior doesn't change.
I also tried different things with the helper.app, right now I'm just using the one that is generated when building the cefclient example, because I thought if something is stable than probably that. But we have also sources to build one ourselves, with pretty much nothing in there, I guess what you mean is probably this. This is why I think it's probably something on the browser process site.
michael
Techie
 
Posts: 14
Joined: Thu Jun 29, 2017 9:28 am

Re: ERROR:channel.cc(507) Invalid message size

Postby magreenblatt » Thu Jun 29, 2017 1:21 pm

In https://github.com/michaelbaisch/ofxCef ... andler.cpp you implement some V8 bound functions that send IPC messages. Are you sending very large data via these functions?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: ERROR:channel.cc(507) Invalid message size

Postby michael » Thu Jun 29, 2017 1:58 pm

Since I'm using the helper.app from the cefclient example this code shouldn't be there (as far as I know). Additionally I disabled anything I could think of that would send data from the browser to the renderer. And this Execute function is only called from js, which shouldn't make any difference since I tried different webpages (including not my own) without code that would call that.
To answer your question as far as I know I'm sending nothing at all, and the one test page that could interact with this only sends minimal data.
michael
Techie
 
Posts: 14
Joined: Thu Jun 29, 2017 9:28 am

Re: ERROR:channel.cc(507) Invalid message size

Postby magreenblatt » Thu Jun 29, 2017 2:11 pm

Does the problem reproduce if you run `open cefclient.app --args --off-screen-rendering-enabled --external-message-pump`?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: ERROR:channel.cc(507) Invalid message size

Postby michael » Fri Jun 30, 2017 12:31 pm

I can't reproduce the behavior with the cefclient.app.
But I kept going trying different sites, and I found something else. The reproducible part where the first instance always has the described behavior only happens on a local file. After trying a few things I found that it makes a difference if I hardcode the full file url or get it with the ofToDataPath function. So
Code: Select all
string url = "file://" + ofToDataPath("html/index.html", true);
has the described behavior but not this:
Code: Select all
string url = "file:///Users/michael/Projects/of_v0.9.8_osx_release/addons/ofxCef/example_multi/bin/data/html/index.html";
. You can find the function in this file. CEF and this function both look at the filesystem for files but that should be totally sequential, I can't see how this can make a memory spike like this. And to this only the first time. Of course I tried the local url in the cefclient, but it worked. But in the cefclient I can only open one page, close and open it again so I can't test so many instances.

Apart from the first instance still happens randomly after a few instances were created. I tried a few different sites there as well and strangely on my website https://michaelbais.ch I didn't observe memory spike, but when I start a few google or wikipedia instances it happens after while.
michael
Techie
 
Posts: 14
Joined: Thu Jun 29, 2017 9:28 am

Re: ERROR:channel.cc(507) Invalid message size

Postby magreenblatt » Fri Jun 30, 2017 12:37 pm

Sounds like a bug in the ofToDataPath function. What is the resulting |url| value after calling that function? Does it differ from the hard-coded url value?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: ERROR:channel.cc(507) Invalid message size

Postby michael » Fri Jun 30, 2017 12:49 pm

I immediately checked that, the url string is exactly the same. And even if it weren't the same, this would mean that some string as url could crash cef, which I think/hope shouldn't happen (which it isn't).
michael
Techie
 
Posts: 14
Joined: Thu Jun 29, 2017 9:28 am

Re: ERROR:channel.cc(507) Invalid message size

Postby magreenblatt » Fri Jun 30, 2017 12:54 pm

Perhaps the ofToDataPath function is messing up some internal application state or otherwise doing something bad. I would suggest selectively removing contents from that function until you identify the problematic part, and then research further.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 32 guests