brave / brave-browser

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

Browser getting crashed while installing new extension from webstore in Development #39588

Open jagadeshjai opened 2 weeks ago

jagadeshjai commented 2 weeks ago

Description

Found while trying to reproduce this issue https://github.com/brave/brave-browser/issues/39490

Stack Trace from component build:

[137709:137709:0705/233821.176524:FATAL:webstore_installer.cc(211)] Check failed: url.is_valid(). 
#0 0x76de86778b72 base::debug::CollectStackTrace()
#1 0x76de86755c9e base::debug::StackTrace::StackTrace()
#2 0x76de86625cae logging::LogMessage::Flush()
#3 0x76de86625b91 logging::LogMessage::~LogMessage()
#4 0x76de865ff81f logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage()
#5 0x76de865ff87e logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage()
#6 0x76de865ff1f3 logging::CheckError::~CheckError()
#7 0x651485d71691 extensions::WebstoreInstaller::GetWebstoreInstallURL()
#8 0x651485d74a7d extensions::WebstoreInstaller::DownloadCrx()
#9 0x651485d72954 extensions::WebstoreInstaller::DownloadNextPendingModule()
#10 0x651485d725bc extensions::WebstoreInstaller::Start()
#11 0x651485ca2dfd extensions::WebstorePrivateCompleteInstallFunction::Run()
#12 0x65148537acfe ExtensionFunction::RunWithValidation()
#13 0x65148538135d extensions::ExtensionFunctionDispatcher::DispatchWithCallbackInternal()
#14 0x6514853806d0 extensions::ExtensionFunctionDispatcher::Dispatch()
#15 0x651485378328 extensions::ExtensionFrameHost::Request()
#16 0x65148544f1ff extensions::mojom::LocalFrameHostStubDispatch::AcceptWithResponder()
#17 0x76de8627b940 mojo::InterfaceEndpointClient::HandleValidatedMessage()
#18 0x76de862843b3 mojo::MessageDispatcher::Accept()
#19 0x76de8627dd72 mojo::InterfaceEndpointClient::HandleIncomingMessage()
#20 0x76de83710176 IPC::ChannelAssociatedGroupController::AcceptOnEndpointThread()
#21 0x76de83710c3a base::internal::Invoker<>::RunOnce()
#22 0x76de865fc320 base::OnceCallback<>::Run()
#23 0x76de866ab3dd base::TaskAnnotator::RunTaskImpl()
#24 0x76de866e6a68 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#25 0x76de866e5f34 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
#26 0x76de866e7485 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
#27 0x76de8679f3a9 base::MessagePumpGlib::Run()
#28 0x76de866e7dcf base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#29 0x76de8667cd1c base::RunLoop::Run()
#30 0x76de84955f17 content::BrowserMainLoop::RunMainMessageLoop()
#31 0x76de84958ad5 content::BrowserMainRunnerImpl::Run()
#32 0x76de84952416 content::BrowserMain()
#33 0x76de85931c57 content::RunBrowserProcessMain()
#34 0x76de85934746 content::ContentMainRunnerImpl::RunBrowser()
#35 0x76de85933de8 content::ContentMainRunnerImpl::Run()
#36 0x76de85930489 content::RunContentProcess()
#37 0x76de859306f2 content::ContentMain()
#38 0x6514850c8abb ChromeMain
#39 0x76de6f629d90 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
#40 0x76de6f629e40 __libc_start_main
#41 0x6514850c86fa _start
Task trace:
#0 0x76de83708199 IPC::ChannelAssociatedGroupController::Accept()
#1 0x76de85ff5d87 mojo::SimpleWatcher::Context::Notify()
Crash keys:
  "extensions-frame.GetSiteInstance()" = "https://chromewebstore.google.com/"
  "RequestParams-name" = "webstorePrivate.completeInstall"
  "top-origin" = "https://chromewebstore.google.com"
  "url-chunk" = "https://chromewebstore.google.com/detail/monica-your-ai-copilot-po/ofpnmcalabcbjgholdjcjblkibolbppb"
  "num-extensions" = "0"
  "commandline-enabled-feature-5" = "ScrollableTabStrip"
  "commandline-enabled-feature-4" = "Playlist"
  "commandline-enabled-feature-3" = "BraveSplitView"
  "commandline-enabled-feature-2" = "BraveSharedPinnedTabs"
  "commandline-enabled-feature-1" = "BravePlayer"
  "reentry_guard_tls_slot" = "unused"
  "switch-9" = "--variations-insecure-server-url"
  "switch-8" = "--variations-server-url"
  "switch-7" = "--sync-url"
  "switch-6" = "--lso-url=https://no-thanks.invalid"
  "switch-5" = "--origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld"
  "switch-4" = "--enable-distillability-service"
  "switch-3" = "--enable-dom-distiller"
  "switch-2" = "--disable-domain-reliability"
  "switch-1" = "--disable-brave-update"
  "num-switches" = "14"
  "osarch" = "x86_64"
  "pid" = "137709"
  "ptype" = "browser"

[0705/233821.232855:ERROR:elf_dynamic_array_reader.h(64)] tag not found
null
null

Steps to reproduce

  1. Open a Developer build where DCHECK works.
  2. Open Chrome web store.
  3. Install any extension by clicking Add to Brave then browser will crash.

Actual result

Browser crashed by DCHECK.

Expected result

We should install the extension by solving the cause of DCHECK.

Reproduces how often

Easily reproduced

Brave version (brave://version info)

1.69.0 Chromium: 127.0.6533.26 (Developer Build) (64-bit)

Channel information

Reproducibility

Miscellaneous information

No response

jagadeshjai commented 2 weeks ago

Seems the endpoint is empty for unofficial builds here https://github.com/brave/brave-core/blob/92a4701ee6f43d578c07b0b3de6e175a653fe5d0/components/update_client/BUILD.gn#L9

But I don't think it's correct to disallow installing an extension from the Web Store. Can anyone advise on this? @simonhong