Skip to content

Fix the touch panel crash - #7214

Merged
jonastsai merged 2 commits into
youtube:25.lts.1+from
a8901147:fix/touch-panel-crashed
Oct 9, 2025
Merged

jonastsai merged 2 commits into
youtube:25.lts.1+from
a8901147:fix/touch-panel-crashed

Conversation

@a8901147

@a8901147 a8901147 commented Sep 18, 2025 •

Copy link
Copy Markdown
Contributor

A crash occurs during vertical scrolling. The crash was caused by the scroll engine receiving a null pointer.

The FindFirstElementWithScrollType function in topmost_event_target.cc was returning a scrollable element that did not have an associated UiNavItem for vertical scroll events. This led to a null pointer being passed to the scroll_engine, causing the application to crash.

This change ensure scrollable element has a valid UiNavItem before calling scroll_engine

Bug: 426634950

@jonastsai
jonastsai self-requested a review September 26, 2025 01:39
@lamdbui

lamdbui commented Sep 29, 2025

Copy link
Copy Markdown
Member

@andrewsavage1 , this seems like a reasonable change for more robust handling of a NULL ptr situation. Any thoughts on this?

Comment thread cobalt/layout/topmost_event_target.cc Resolved
DCHECK(base::SequencedTaskRunner::GetCurrentDefault() ==
scroll_engine_.task_runner());

if (!scroll_container) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unnecessary if it's also being added in topmost_event_target.cc

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScrollEngine::HandleScrollStart is only called by TopmostEventTarget::HandleScrollState.

you are right. Let me remove it. thanks

prevent element_to_scroll->GetUiNavItem() nullptr being utilized by other function and crash
@jonastsai
jonastsai merged commit 05690a9 into youtube:25.lts.1+ Oct 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants