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

Brave spins CPU if first launched while network is off #495

Closed riastradh-brave closed 6 years ago

riastradh-brave commented 6 years ago

Brave seems to try as fast as it can to load brave.com over and over again as it fails, spinning the CPU at 100% utilization and alternately displaying the reload and stop button in the UI several times a second, on the first launch if the network is off.

Steps to Reproduce

  1. Clear ~/.config/Brave-Browser-Development.
  2. Turn off the network.
  3. Launch Brave.
  4. Crack an egg over your CPU.

Actual result:

You get a fried egg.

Expected result:

You ruined your laptop and you wasted an egg.

Reproduces how often:

100%, on the first launch of Brave.

Brave version (about:brave info)

about:brave doesn't work, so here's about:version:

Brave 67.0.3396.103 (Developer Build) (64-bit)
Revision 870d56e631070860a3ddb6e724eecc4a6992c079-refs/branch-heads/3396@{#794}
OS Linux
JavaScript V8 6.7.288.46
Flash (Disabled)
User Agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.103 Safari/537.36
Command Line /home/riastradh/brave/brave/src/out/Debug/brave --enable-logging --v=0 --enable-tab-audio-muting --enable-features=EnableEmojiContextMenu,DesktopPWAWindowing --flag-switches-begin --flag-switches-end
Executable Path /home/riastradh/brave/brave/src/out/Debug/brave
Profile Path /home/riastradh/.config/Brave-Browser-Development/Default
Variations AlternateComponentUrls:AlternateComponentUrlsBackgroundVideoOptimizations:BackgroundOptimizationEnabled1sOrLessMediaSourceBlinkSchedulerHighPriorityInput:BlinkSchedulerHighPriorityInputBlockTabUnders:EnabledBrowserScheduler:RedirectWithDefaultInitParamsCSSExternalScanner:Enabled_ScanAndPreloadCertificateTransparencyLogAuditing:EnabledCheckerImaging:CheckerImagingDataReductionProxyRobustConnection:EnabledDynamicExpectCT:DynamicExpectCTEnabledEnableCastDiscovery:EnabledGaiaPasswordReuse:SofterWarningWarnOnLowReputationGuestViewCrossProcessFrames:EnabledIncognitoWindowInProductHelp:EnabledInstanceID:EnabledLocalScreenCasting:EnabledLowPriorityIframes2:EnabledModernMediaControls:EnabledMojoInputMessages:EnabledNTPUseGoogleLocalNtp:EnabledNavigationMojoResponse:NavigationMojoResponseNetworkQualityEstimator:EnabledNewTabInProductHelp:Enabled_1NoStatePrefetchRollout:NoStatePrefetchEnabledOmniboxBundledExperimentV1:DesktopExperimentsOverflowIconsForMediaControls:EnabledPWAFullCodeCache:EnabledPassiveDocumentEventListeners:EnabledPassiveEventListenersDueToFling:EnabledPasswordProtectionForEnterprise:V1EnabledPermissionPromptUIViews:BlockPromptsEnabledPersistentHistograms:EnabledOnDisk5QUIC:EnabledRendererSchedulerWakeUpThrottling:RendererSchedulerWakeUpThrottlingRendererSideResourceScheduler:Enabled_2_1024ReportingAPI:ReportingEnabledResourceLoadScheduler:Enabled_bg_limit_3_1SafeBrowsingAdSamplerTrigger:AdSampler_NormalRateSafeBrowsingScoutTransitionStudy:CanShowScoutOptInGroup2SafeBrowsingThreatDomDetailsTagAttributes:AdIdentifiersSavePreviousDocumentResources:until‑dclServiceWorkerPaymentApps:EnabledServiceWorkerScriptFullCodeCache:EnabledSignInProcessIsolation:Enabled_50_20171026SimpleCacheTrial:ExperimentYesSimplifyHttpsIndicator:EvToSecureSocketReadIfReady:EnabledSpeculativePreconnectValidation:Preconnect2TLS13Variant:Draft23V4ThrottleDelayable:EnabledTokenBinding:TokenBindingTranslateRankerModel:20180123_launchTranslateUserEvents:EnabledUKM:EnabledUseHeuristicLanguageModel:ExperimentUseMojoAudioOutputStreamFactory:UseMojoAudioOutputStreamFactoryUsePdfCompositorServiceForPrint:UsePdfCompositorServiceForPrintV8AsmJSToWasm:AsmJsToWebAssemblyV8ContextSnapshot:EnabledV8WasmTrapHandler:WasmTrapHandlerActiveVideoCaptureService:Enabled2VideoSurfaceLayer:EnabledVsyncAlignedInput:EnableWheelScrollLatchingAndAsyncWheelEvents:EnabledWorkStealingInScriptRunner:WorkStealingAndBackgroundCompile

Reproducible on current release:

no

Website problems only:

Does the issue resolve itself when disabling Brave Shields?

The reload cycle is so fast it kills the shields window as it is fading into existence before I get a chance to mess with it.

Is the issue reproducible on the latest version of Chrome?

I have not tried.

Additional Information

bbondy commented 6 years ago

Is this still an issue @srirambv ?

srirambv commented 6 years ago

Verified on 0.54.4 and on 0.55.1, cleared profile folder, disconnect from network and started browser didnt make me waste an egg. Laptop saved!

bbondy commented 6 years ago

@riastradh-brave given the above I'm going to close, but please re-open if you can still reproduce.