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.

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

Postby michael » Sun Jul 02, 2017 11:34 am

I found the problematic part in the function, it's around here:
Code: Select all
char path[FILENAME_MAX];
uint32_t size = sizeof(path);
if(_NSGetExecutablePath(path, &size) != 0){
    ofLogError("ofFilePath") << "getCurrentExePath(): path buffer too small, need size " <<  size;
}

The weird thing is it only shows the behavior if I do specifc things with the `path` variable. For example if this is in a function and I return `path` as a string or if I log it with the OF function
Code: Select all
ofLogNotice() << path;
, it shows the behavior. But if I do nothing with `path` or cout it, it works. I can also use the ofLogNotice() function to log other chars or strings and it also works. Then I looked if there is some optimization turned on by accident (I'm building debug of course), but it's not. I don't know what to make of this. I have this feeling that the problem might be somewhere else and this is just breaks it for good in some black magic way. And not to forget even if I compile in a way that "it works", the behavior will still show after a random amount of instances created.
michael
Techie
 
Posts: 14
Joined: Thu Jun 29, 2017 9:28 am

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

Postby michael » Fri Nov 03, 2017 7:16 am

I worked some more on this with a recent CEF version (3.3163.1671).

I'm not getting the invalid `Invalid message size` message anymore. But the behavior is still similar. I can start the same program and sometimes it works and sometimes the render process goes up to ~1.03 GB of memory and 100 % CPU usage.

To further reduce other influences it I tried more or less this:

Code: Select all
CefWindowInfo windowInfo;
renderHandler = new ofxCEFRenderHandler();

NSWindow * cocoaWindow =  (NSWindow *) ((ofAppGLFWWindow *) ofGetWindowPtr())->getCocoaWindow();
[cocoaWindow setReleasedWhenClosed:NO];
   
NSView * view =  [ cocoaWindow contentView];
windowInfo.SetAsWindowless(view);

CefBrowserSettings settings;
settings.web_security = STATE_DISABLED;
settings.webgl = STATE_ENABLED;
settings.windowless_frame_rate = 60;
settings.background_color = 0x00FFFFFF;

client = new ofxCEFBrowserClient(this, renderHandler);
browser = CefBrowserHost::CreateBrowserSync(windowInfo, client.get(), "http://localhost:8000", settings, NULL);

bool isInitialized = renderHandler->initialized; // is true when OnPaint was called
while (!isInitialized) {
    CefDoMessageLoopWork();
    isInitialized = renderHandler->initialized;
    ofSleepMillis(50);
}

// Continue



After a few iteration of the while loop the CefDoMessageLoopWork() calls the OnPaint() function of the CefRenderHandler class and sets 'initialized' to true. Sometimes this happens and sometimes it doesn't. The console doesn't print anything different. The render process also starts either way. What could stop the CefDoMessageLoopWork() to eventually call OnPaint() of the CefRenderHandler?
michael
Techie
 
Posts: 14
Joined: Thu Jun 29, 2017 9:28 am

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

Postby michael » Mon Feb 05, 2018 9:58 am

I'm still not sure what the cause for this all is.

But I've found out that if I call
Code: Select all
CreateBrowser()
instead of
Code: Select all
CreateBrowserSync()
this problem seems to go away.

How could this be?
michael
Techie
 
Posts: 14
Joined: Thu Jun 29, 2017 9:28 am

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

Postby michael » Tue Feb 06, 2018 9:14 am

It seems that I found the problem. It was because of uninitialized variables (width and height) in the renderHander. CEF asks immediately for the size of the page and the renderHandler returned the values of some memory address. This could return a huge number, which would explain the high memory utilization of the render process. And it also explains why commenting or changing some totally unrelated things would change this behavior.

Thanks for the help!
michael
Techie
 
Posts: 14
Joined: Thu Jun 29, 2017 9:28 am

Previous

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 53 guests