-
Notifications
You must be signed in to change notification settings - Fork 13
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
ERROR:channel.cc(507) Invalid message size #36
Comments
How's your progress on this? I will give it a go early next week. For now, I'm working on Windows and I managed to get quite a good performance and fixed most of the keyboard input issues. |
I'm still in the process of getting my head around the whole CEF business. I tried to inspect a helper.app that behaves that way, but I didn't have any luck. When choosing that process as target in Instruments (command line) it just quits and I don't get any data. In Xcode I can attach to a helper process but as soon as I try to transfer to Instruments to see what's going on in memory, the process disappears again. Performance seems to be alright, as good as expected keeping in mind that we still copy from GPU -> CPU -> GPU. I hope we get a way around that soon. I'm not too concerned about keyboard input issues, right now. Primarily I want to have multiple cef views in 3D space and communicate with JS calls. That's a good idea I haven't tried any other build, will try the current build tomorrow. |
I've tried the current build form this morning Now I took a look at the chromium source to find out where this error is coming from. I found this in bool Channel::OnReadComplete(size_t bytes_read, size_t *next_read_size_hint) {
bool did_dispatch_message = false;
read_buffer_->Claim(bytes_read);
while (read_buffer_->num_occupied_bytes() >= sizeof(Message::LegacyHeader)) {
// Ensure the occupied data is properly aligned. If it isn't, a SIGBUS could
// happen on architectures that don't allow misaligned words access (i.e.
// anything other than x86). Only re-align when necessary to avoid copies.
if (!IsAlignedForChannelMessage(
reinterpret_cast<uintptr_t>(read_buffer_->occupied_bytes()))) {
read_buffer_->Realign();
}
// We have at least enough data available for a LegacyHeader.
const Message::LegacyHeader* legacy_header =
reinterpret_cast<const Message::LegacyHeader*>(
read_buffer_->occupied_bytes());
if (legacy_header->num_bytes < sizeof(Message::LegacyHeader) ||
legacy_header->num_bytes > kMaxChannelMessageSize) {
LOG(ERROR) << "Invalid message size: " << legacy_header->num_bytes;
return false;
}
… This fits the error messages I'm seeing: const size_t kMaxChannelMessageSize = 256 * 1024 * 1024; // = 268435456 The interface describes the
When I don't run our update function with
Does anyone think that this problem could be connected to not using I'll try to push a branch with my example project tomorrow. When trying this out, be warned that not all of those helper apps actually stop at at maybe around ~3GB memory and log this error before going back to normal or quitting (Like I wrote initially). Some of them just keep going, I saw some of them going up to >30GB memory. I always have Activity Monitor running to have a look at the helper apps. |
I have created an example project, which shows the issue more easily by being able to create multiple instances: I've cleaned up some stuff and tried to remove unnecessary code, just to make sure none of those are messing things up. Funny thing is that the first instance you create with this code will aways have memory issues. The kind where it doesn't stop at around 3GB and logs the error. But if you just add After that you can press |
I tested this with the newest
this to the I think there is a good chance to take this addon out of the experimental stage and make it more or less simple for anyone to use on both macOS and windows. The only problem I see is this right now, if anyone has any ideas, I'm open for suggestions. |
I started discussing this in the cef forum here. |
Good news! It seems that I found the problem. It was because of uninitialized variables ( Among other things this was fixed in #39 pull request. |
As mentioned in #34, I'm trying to get this running on macOS again. One problem I run into is that sometimes it just shows a white screen. I found out when that happens, the associated Helper.app uses a lot of memory for a while, this can go up to a few GB. After a while the Xcode console tells me something like:
After that the memory usage for the helper process goes back to "normal" ~40mb. I have to reload the browser to finally see the webpage.
This happens in maybe about 30% when creating a new browser.
I tried the helper app from the
cefclient
cef example and the one compiled from the addon. Both behave the same.I couldn't find anything about that message, and for now I'm not sure whats going on.
The text was updated successfully, but these errors were encountered: