brave-browser: Intermittent crash in Beta when watching youtube in Picture-in-Picture

IMPORTANT: Your crash has already been automatically reported to our crash system. Please file this bug only if you can provide more information about it.

Brave Version: 1.63.131 Chromium: 121.0.6167.85 Operating System: Mac OS X 14.3.0

URL (if applicable) where crash occurred: youtube.com with Floating Player - Picture in Picture extension installed.

Can you reproduce this crash?

What steps will reproduce this crash? (If it’s not reproducible, what were you doing just before the crash?)

  1. Install Floating Player - Picture in Picture
  2. Open some video on youtube
  3. Watch it in Picure-in-Picture mode
  4. At some point the crash occured

DO NOT CHANGE BELOW THIS LINE Crash ID: crash/d6570e00-802f-5e0b-0000-000000000000

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 19 (4 by maintainers)

Most upvoted comments

Seems reasonable that this is related to https://github.com/brave/brave-browser/issues/36407

@Haravikk I think you’re exactly right!

We’ll make sure to uplift. Thanks @sangwoo108 for the fix 😄

Verified with

Brave	1.63.174 Chromium: 122.0.6261.128 (Official Build) (arm64) 
Revision	0d369d4e1dfee7bcea82774079dc8cd658746c98
OS	macOS Version 14.4 (Build 23E214)

Reproduced the crash using STR from https://github.com/brave/brave-core/pull/22468 and Google’s Picture in Picture extension with 1.63.169 Chromium: 122.0.6261.111:

Screenshot 2024-03-13 at 8 53 26 AM

Using the same STR/Cases, ensured that Brave wasn’t crashing when running through 1.63.174 Chromium: 122.0.6261.128.

I think I found the steps to reproduce

  1. Open a youtube video and enter pip and exit the pip
  2. Open another tab and close the tab used for step 1
  3. Open another video in the newly opened tab, and enter fullscreen for the video

It’s still hard to figure out what/how to cause the crash. I’m suspecting GetController() returns dangling pointer, but not sure why it’s happening.

[3097:259:0219/112048.058474:ERROR:video_overlay_window_views.cc(684)] native_widget: 0
[3097:259:0219/112048.058522:ERROR:video_overlay_window_views.cc(685)] IsVisible(): 0
[3097:259:0219/112048.058533:ERROR:video_overlay_window_views.cc(686)] GetNativeWindow(): 0
[3097:259:0219/112048.058541:ERROR:video_overlay_window_views.cc(687)] GetController(): 1
Received signal 11 SEGV_ACCERR 000000000000
0   libbase.dylib                       0x0000000103957588 base::debug::CollectStackTrace(void const**, unsigned long) + 28
1   libbase.dylib                       0x000000010393fae4 base::debug::StackTrace::StackTrace() + 24
2   libbase.dylib                       0x0000000103957460 base::debug::(anonymous namespace)::StackDumpSignalHandler(int, __siginfo*, void*) + 1208
3   libsystem_platform.dylib            0x000000018081ba24 _sigtramp + 56
4   libchrome_dll.dylib                 0x00000001109d788c VideoOverlayWindowViews::GetWorkAreaForWindow() const + 484
5   libchrome_dll.dylib                 0x00000001109d8650 non-virtual thunk to VideoOverlayWindowViews::OnDisplayMetricsChanged(display::Display const&, unsigned int) + 104
6   libui_display.dylib                 0x00000001058ebb00 display::DisplayChangeNotifier::NotifyDisplaysChanged(std::__Cr::vector<display::Display, std::__Cr::allocator<display::Display>> const&, std::__Cr::vector<display::Display, std::__Cr::allocator<display::Display>> const&) + 1276
7   libui_display.dylib                 0x00000001058fddb0 display::(anonymous namespace)::ScreenMac::OnNSScreensMayHaveChanged() + 200
8   CoreFoundation                      0x00000001808be80c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 128