-
Notifications
You must be signed in to change notification settings - Fork 458
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
Crash when adding overlay view since CEF 125 due to invalid static_cast #3784
Comments
Thanks for the quick fix. While the cefclient example doesn't crash anymore, I have now the issue that the overlay browser is not created. Is this a new issue or am I using it wrong? As far as I see, there is no browser instance created. According to the documentation, the browser instance is created when the overlay view is added to the views hierarchy, which I assumed whould happen when adding the view to the window. See code below (taken from the provided patch file)
I can create a new issue with the same patch file if it's a new one. |
We don't currently test the usage of browser views in overlays. Please add a new issue. |
Ok, I created #3790 |
Describe the bug
Since CEF 125, when adding an overlay view the code will crash due to an illegal memory access. I did some debugging with a modified cefclient application. I think it comes down to an invalid
static_cast
.When the overlay view is added, eventually
CefBrowserView::AddedToWidget
is called. This will callCefWidget::GetForWidget
on the suppliedwidget
and there is a check if the view is using Alloy style or Chrome style. In my case the widget is cast toChromeBrowserFrame
but according to the debugger thewidget
is of typeThemeCopyingWidget
. The cast result in an invalid_vfptr
pointer, which is then dereferenced by the caller, causing the crash.To Reproduce
Steps to reproduce the behavior:
cefclient_testcode.patch
. This will add an overlay view to the cefclient application.--use-views --hide-frame --hide-controls
CefBrowserViewImpl::AddedToWidget
Expected behavior
Application must not crash.
Screenshots
Exception:
Note that
cef_widget
is a valid pointer but its_vfptr
is null.Invalid type cast:
Note that
widget
is of typeThemeCopyingWidget
and cast toChromeBrowserFrame
Versions (please complete the following information):
Additional context
cefclient_testcode.patch
The text was updated successfully, but these errors were encountered: