brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.77k stars 2.32k forks source link

Crash in SidebarContainerView::StopObservingForEntry #41723

Open iefremov opened 1 week ago

iefremov commented 1 week ago

https://share.backtrace.io/api/share/3Cs0RbCD0FcajHDFplO741

[ 00 ] std::__Cr::vector<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>, std::__Cr::allocator<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>>>::begin() const ( vector:1417 )
[ 01 ] auto std::__Cr::ranges::__begin::__fn::operator()<std::__Cr::vector<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>, std::__Cr::allocator<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>>> const&>(T&&) const ( access.h:75 )
[ 02 ] auto base::ranges::find<std::__Cr::vector<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>, std::__Cr::allocator<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>>> const&, SidePanelEntry*, std::__Cr::identity, std::__Cr::random_access_iterator_tag>(std::__Cr::vector<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>, std::__Cr::allocator<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>>> const&, SidePanelEntry* const&, std::__Cr::identity) ( algorithm.h:457 )
[ 03 ] bool base::Contains<std::__Cr::vector<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>, std::__Cr::allocator<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>>>, SidePanelEntry*>(std::__Cr::vector<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>, std::__Cr::allocator<base::raw_ptr<SidePanelEntry, (partition_alloc::internal::RawPtrTraits)0>>> const&, SidePanelEntry* const&) ( contains.h:46 )
[ 04 ] base::ScopedMultiSourceObservation<SidePanelEntry, SidePanelEntryObserver>::IsObservingSource(SidePanelEntry*) const ( scoped_multi_source_observation.h:88 )
[ 05 ] SidebarContainerView::StopObservingForEntry(SidePanelEntry*) ( sidebar_container_view.cc:933 )
[ 06 ] SidebarContainerView::WillDeregisterSidePanelEntry(SidePanelEntry*) ( sidebar_container_view.cc:198 )
[ 07 ] BraveBrowserView::WillDeregisterSidePanelEntry(SidePanelEntry*) ( brave_browser_view.cc:787 )
[ 08 ] BraveSidePanelCoordinator::OnEntryWillDeregister(SidePanelRegistry*, SidePanelEntry*) ( brave_side_panel_coordinator.cc:191 )
[ 09 ] BraveSidePanelCoordinator::OnEntryWillDeregister(SidePanelRegistry*, SidePanelEntry*) ( brave_side_panel_coordinator.cc:186 )
[ 10 ] SidePanelRegistry::DeregisterAndReturnEntry(SidePanelEntryKey const&) ( side_panel_registry.cc:116 )
[ 11 ] extensions::ExtensionSidePanelCoordinator::DeregisterGlobalEntryAndCacheView() ( extension_side_panel_coordinator.cc:142 )
[ 12 ] extensions::ExtensionSidePanelCoordinator::OnPanelOptionsChanged(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, extensions::api::side_panel::PanelOptions const&) ( extension_side_panel_coordinator.cc:175 )
[ 13 ] non-virtual thunk to extensions::ExtensionSidePanelCoordinator::OnPanelOptionsChanged(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, extensions::api::side_panel::PanelOptions const&) ( extension_side_panel_coordinator.cc:0 )
[ 14 ] extensions::SidePanelService::SetOptions(extensions::Extension const&, extensions::api::side_panel::PanelOptions) ( side_panel_service.cc:173 )
[ 15 ] non-virtual thunk to extensions::ExtensionSidePanelCoordinator::OnPanelOptionsChanged(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, extensions::api::side_panel::PanelOptions const&) ( extension_side_panel_coordinator.cc:0 )
[ 16 ] extensions::SidePanelService::SetOptions(extensions::Extension const&, extensions::api::side_panel::PanelOptions) ( side_panel_service.cc:173 )
[ 17 ] extensions::SidePanelSetOptionsFunction::RunFunction() ( side_panel_api.cc:54 )
[ 18 ] extensions::ExtensionFunctionDispatcher::DispatchWithCallbackInternal(extensions::mojom::RequestParams const&, content::RenderFrameHost*, content::RenderProcessHost&, base::OnceCallback<void (ExtensionFunction::ResponseType, base::Value::List, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, mojo::StructPtr<extensions::mojom::ExtraResponseData>)>) ( extension_function_dispatcher.cc:532 )
[ 19 ] extensions::ExtensionFunctionDispatcher::DispatchForServiceWorker(mojo::StructPtr<extensions::mojom::RequestParams>, int, base::OnceCallback<void (bool, base::Value::List, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, mojo::StructPtr<extensions::mojom::ExtraResponseData>)>) ( extension_function_dispatcher.cc:347 )
[ 20 ] extensions::ServiceWorkerHost::RequestWorker(mojo::StructPtr<extensions::mojom::RequestParams>, base::OnceCallback<void (bool, base::Value::List, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, mojo::StructPtr<extensions::mojom::ExtraResponseData>)>) ( service_worker_host.cc:237 )
[ 21 ] extensions::mojom::ServiceWorkerHostStubDispatch::AcceptWithResponder(extensions::mojom::ServiceWorkerHost*, mojo::Message*, std::__Cr::unique_ptr<mojo::MessageReceiverWithStatus, std::__Cr::default_delete<mojo::MessageReceiverWithStatus>>) ( service_worker_host.mojom.cc:1472 )
[ 22 ] mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message*) ( interface_endpoint_client.cc:1005 )
iefremov commented 1 week ago

cc @simonhong @petemill

simonhong commented 6 days ago

Let's check this crash still happens after https://github.com/brave/brave-core/pull/26056 is merged. This crash stack is related with https://github.com/brave/brave-core/pull/25771 and https://github.com/brave/brave-core/pull/26056 will replace the method usage that causes this crash.

iefremov commented 6 days ago

thx @simonhong