Skip to content
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

[Bug]: NativeWindowViews::ShouldDescendIntoChildForEventHandling sporadically crashing application when checking BrowserViews for draggable regions #31812

Closed
3 tasks done
arctictron opened this issue Nov 14, 2021 · 2 comments
Assignees
Labels

Comments

@arctictron
Copy link

Preflight Checklist

Electron Version

15.3.0

What operating system are you using?

Windows

Operating System Version

Windows 10 version 21H1

What arch are you using?

x64

Last Known Working Electron version

11.0.3

Expected Behavior

Should return true or false when checking if the click was within a draggable region of a browserview.

Actual Behavior

It appears that sporadically that the view_draggable_region may not be valid, thus when checking if the cursor is contained within the SkRegion by calling SkRegion::contains, an uncaught exception happens that results in electron crashing.

Testcase Gist URL

No response

Additional Information

I believe this is related to issue #31406, as it crashes in the same way. I'm submitting this bug because while I was trying to figure out what was really causing issue 31406 I ran into this one. As a refresher I am using a frameless window with a BrowserView acting as the title bar that has a draggable region, then 1+ other BrowserViews serving the main content that do not have draggable regions. This is interesting because I reverted back to using a window instead of being a frameless and this started to happen, while no longer experiencing the crashes reported in issue 31406. Next I switched to running the title bar code from being in a BrowserView into the main BrowserWindow since it seems to be only BrowserViews that will cause this issue (I could be misunderstanding the underlying code), and the crashes still happen. I have tried this using several versions of electron from 11.x.x, 12.x.x, 13.x.x, and 15.x.x and they all exhibit this behavior, however 11.0.3 is the last working version that does not crash. My guess is that pull 26738 was when this issue, and subsequently issue 31406, was introduced as this bit of code

for (auto* view : browser_views()) { auto* native_view = static_cast<NativeBrowserViewViews*>(view); auto* view_draggable_region = native_view->draggable_region(); if (view_draggable_region && view_draggable_region->contains(location.x(), location.y())) return false; }

is both in NativeWindowViews::ShouldDescendIntoChildForEventHandling and FramelessView::NonClientHitTest.

I still don't have a gist that reproduces either issue, so it could be something else in my application that is causing both issues to crop up. I do have crashdumps that are telling me that these are the last calls in the callstack and that when it calls SkRegion::contains it causes an invalid_read and then crashes due to the uncaught exception.

@codebytere
Copy link
Member

could you paste a crash dump?

@codebytere codebytere added the blocked/need-info ❌ Cannot proceed without more information label Jan 10, 2022
@arctictron
Copy link
Author

After upgrading to version 16 and several weeks of testing, I'm no longer seeing this type of crash. I'm going to close this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants