Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Running from source (npm run start) often crashes on Windows #13224

Closed
srirambv opened this issue Feb 21, 2018 · 15 comments
Closed

Running from source (npm run start) often crashes on Windows #13224

srirambv opened this issue Feb 21, 2018 · 15 comments

Comments

@srirambv
Copy link
Collaborator

Description

Off late i've been seeing running npm run start it launches browser and crashes

Steps to Reproduce

  1. Build from source
  2. npm run start to launch development instance
  3. Browser launches and crashes immediately

Actual result:

$ npm run start

> brave@0.21.10 start E:\srirambv\browser-laptop
> node ./tools/start.js --user-data-dir-name=brave-development --enable-logging --v=0 --enable-extension-activity-logging --enable-sandbox-logging --enable-dcheck

Crash reporting enabled
[7624:520:0221/171922.579:ERROR:CONSOLE(28293)] "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", source: http://localhost:8080/gen/app.entry.js (28293)
[7624:520:0221/171922.580:ERROR:CONSOLE(28293)] "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", source: http://localhost:8080/gen/app.entry.js (28293)
process exited with code 2147483651
npm ERR! code ELIFECYCLE
npm ERR! errno 2147483651
npm ERR! brave@0.21.10 start: `node ./tools/start.js --user-data-dir-name=brave-development --enable-logging --v=0 --enable-extension-activity-logging --enable-sandbox-logging --enable-dcheck`
npm ERR! Exit status 2147483651
npm ERR!
npm ERR! Failed at the brave@0.21.10 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\SriramBV\AppData\Roaming\npm-cache\_logs\2018-02-21T11_49_24_298Z-debug.log

Expected result:
Should launch upon running the command correctly

Reproduces how often:
Quite often

Brave Version

about:brave info:

Reproducible on current live release:
N/A

Additional Information

Same issue when relaunching an existing profile. Sometimes have to switch to npm start to launch and sometimes have to delete the brave-development profile before a successful browser launch

cc: @bridiver @darkdh @bsclifton

@srirambv
Copy link
Collaborator Author

Also closing the browser window doesn't terminate all process. Pressing Ctrl+C on the console shows process exited with code null message and then terminates background process

@bsclifton
Copy link
Member

bsclifton commented Feb 22, 2018

@srirambv I believe the process not exiting is covered by #13233 which is fixed with #13242

I wonder if the crash is related also. Maybe we can retest after that is merged

@bsclifton
Copy link
Member

bsclifton commented Feb 22, 2018

Reproduced on Windows 7 (after accepting the patch I mentioned above). The browser does terminate all processes now, but there is indeed a crash which you can see via chrome://crashes

screen shot 2018-02-21 at 11 10 38 pm

@bsclifton
Copy link
Member

bsclifton commented Feb 22, 2018

There's a possibility the root cause for the crash will be fixed with #13240. We can try to retest after this is accepted 😄

Steps I used to reproduce:

  1. Clone source on Windows; do npm install
  2. Check out 0.21.x branch
  3. Launch browser with npm start
  4. Load a page
  5. Exit
  6. Repeat steps 3 - 5 until you get a crash
  7. Confirm you see a crash in chrome://crashes

@bsclifton
Copy link
Member

Tentatively moving to 0.21.x; we can close if fixed or reset milestone to Triage Backlog

@bsclifton bsclifton modified the milestones: Triage Backlog, 0.21.x (Beta Channel - CR 65) Feb 22, 2018
@bsclifton bsclifton self-assigned this Feb 22, 2018
@bsclifton
Copy link
Member

bsclifton commented Feb 22, 2018

I cherry picked in 4321c87 and verified this does NOT fix the issue (which is contained in #13240)

@bsclifton bsclifton modified the milestones: 0.21.x (Beta Channel - CR 65), 0.21.x (Beta Channel) Feb 22, 2018
@alexwykoff alexwykoff added the priority/P4 Minor loss of function. Workaround usually present. label Feb 27, 2018
@alexwykoff alexwykoff modified the milestones: 0.22.x (Developer Channel), Backlog (Prioritized) Feb 27, 2018
@bsclifton bsclifton added the 0.21.x issue first seen in 0.21.x label Mar 23, 2018
@bsclifton
Copy link
Member

+1 from @srirambv via #13543

Browser crashes when opening a new window

Steps to Reproduce

  1. Build from aa9db3c
  2. Launch browser via npm run start
  3. Open a new window via keyboard shortcut browser crashes

@bsclifton bsclifton changed the title npm run start fails quite often Running from source (npm run start) often crashes on Windows Mar 23, 2018
@bsclifton
Copy link
Member

Running using a debug build of Muon, I see the following get output when this happens:

Crash reporting enabled
[6728:428:0323/123128.386:ERROR:gpu_process_transport_factory.cc(1019)] Lost UI shared context.
[6728:428:0323/123131.270:ERROR:CONSOLE(28534)] "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", source: http://localhost:8080/gen/app.entry.js (28534)
[6728:428:0323/123131.270:ERROR:CONSOLE(28534)] "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", source: http://localhost:8080/gen/app.entry.js (28534)
[6728:428:0323/123132.292:FATAL:navigator_impl.cc(156)] Check failed: 0.
Backtrace:
        base::debug::StackTrace::StackTrace [0x00007FF791892294+36] (C:\GitHub\browser-laptop-bootstrap\src\base\debug\stack_trace_win.cc:286)
        logging::LogMessage::~LogMessage [0x00007FF791813CC6+102] (C:\GitHub\browser-laptop-bootstrap\src\base\logging.cc:581)
        content::NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL [0x00007FF791172DA0+224] (C:\GitHub\browser-laptop-bootstrap\src\content\browser\frame_host\navigator_impl.cc:158)
        content::NavigationRequest::OnRequestFailedInternal [0x00007FF791170198+248] (C:\GitHub\browser-laptop-bootstrap\src\content\browser\frame_host\navigation_request.cc:942)
        content::NavigationRequest::BeginNavigation [0x00007FF79116F90E+206] (C:\GitHub\browser-laptop-bootstrap\src\content\browser\frame_host\navigation_request.cc:486)
        content::NavigatorImpl::OnBeginNavigation [0x00007FF791175319+281] (C:\GitHub\browser-laptop-bootstrap\src\content\browser\frame_host\navigator_impl.cc:902)
        content::RenderFrameHostImpl::BeginNavigation [0x00007FF791184DCE+622] (C:\GitHub\browser-laptop-bootstrap\src\content\browser\frame_host\render_frame_host_impl.cc:3064)
        content::mojom::FrameHostStubDispatch::Accept [0x00007FF7904C57EC+1036] (C:\GitHub\browser-laptop-bootstrap\src\out\Release\gen\content\common\frame.mojom.cc:2280)
        IPC::`anonymous namespace'::ChannelAssociatedGroupController::AcceptOnProxyThread [0x00007FF79194C961+81] (C:\GitHub\browser-laptop-bootstrap\src\ipc\ipc_mojo_bootstrap.cc:789)
        base::internal::Invoker<base::internal::BindState<void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*)(mojo::Message),scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>,base::internal::PassedWrapper<mojo::Message [0x00007FF79194AF0C+92] (C:\GitHub\browser-laptop-bootstrap\src\base\bind_internal.h:350)
        base::debug::TaskAnnotator::RunTask [0x00007FF79186A43A+218] (C:\GitHub\browser-laptop-bootstrap\src\base\debug\task_annotator.cc:53)
        base::MessageLoop::RunTask [0x00007FF79184CA5C+572] (C:\GitHub\browser-laptop-bootstrap\src\base\message_loop\message_loop.cc:399)
        base::MessageLoop::DoWork [0x00007FF79184CFDA+426] (C:\GitHub\browser-laptop-bootstrap\src\base\message_loop\message_loop.cc:462)
        base::MessagePumpForUI::DoRunLoop [0x00007FF7918AE27D+173] (C:\GitHub\browser-laptop-bootstrap\src\base\message_loop\message_pump_win.cc:174)
        base::MessagePumpWin::Run [0x00007FF7918ADDF8+104] (C:\GitHub\browser-laptop-bootstrap\src\base\message_loop\message_pump_win.cc:58)
        base::RunLoop::Run [0x00007FF79184AA55+53] (C:\GitHub\browser-laptop-bootstrap\src\base\run_loop.cc:136)
        content::BrowserMainLoop::MainMessageLoopRun [0x00007FF791085428+200] (C:\GitHub\browser-laptop-bootstrap\src\content\browser\browser_main_loop.cc:1795)
        content::BrowserMainLoop::RunMainMessageLoopParts [0x00007FF7910851F4+84] (C:\GitHub\browser-laptop-bootstrap\src\content\browser\browser_main_loop.cc:1239)
        content::BrowserMainRunnerImpl::Run [0x00007FF791088491+17] (C:\GitHub\browser-laptop-bootstrap\src\content\browser\browser_main_runner.cc:145)
        content::BrowserMain [0x00007FF7910816C6+198] (C:\GitHub\browser-laptop-bootstrap\src\content\browser\browser_main.cc:46)
        content::ContentMainRunnerImpl::Run [0x00007FF7918009B4+292] (C:\GitHub\browser-laptop-bootstrap\src\content\app\content_main_runner.cc:717)
        service_manager::Main [0x00007FF792963837+1127] (C:\GitHub\browser-laptop-bootstrap\src\services\service_manager\embedder\main.cc:456)
        content::ContentMain [0x00007FF791800341+65] (C:\GitHub\browser-laptop-bootstrap\src\content\app\content_main.cc:19)
        wWinMain [0x00007FF79020174F+1587] (C:\GitHub\browser-laptop-bootstrap\src\electron\atom\app\atom_main.cc:217)
        __scrt_common_main_seh [0x00007FF79455E386+266] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283)
        BaseThreadInitThunk [0x00007FF861CB1FE4+20]
        RtlUserThreadStart [0x00007FF86261EFC1+33]

null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! browser-laptop-bootstrap@1.0.0 start: `node ./scripts/commands.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the browser-laptop-bootstrap@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\brian\AppData\Roaming\npm-cache\_logs\2018-03-23T19_31_35_231Z-debug.log

@bsclifton
Copy link
Member

@jayyyin
Copy link

jayyyin commented Mar 24, 2018

heyo, @bsclifton try running starting it with npm run start instead, someone with the same issue just tried it and it launched without crashing, even though the previous 3 times it crashed on launch..., using npm start if this does fix the issue, the documentation might need to updated to state to try this if such a crash does occur.

@petemill
Copy link
Member

petemill commented Mar 30, 2018

This has almost certainly been fixed with muon's brave/muon@d5985a3 commit, which is not on master, only single-webview project branch.
Running NODE_ENV=production npm start does not have this issue, so I think given @bsclifton 's stack trace of the crash and @bridiver 's explanation, the issue is because of loading localhost URLs and it fails at, for example: http://localhost:8080/sockjs-node/iframe.html#thncx0vw (which is webpack's dev server notification url)

@petemill petemill removed this from the Backlog (Prioritized) milestone Mar 30, 2018
@petemill petemill added this to the 0.22.x Release 2 milestone Mar 30, 2018
@petemill
Copy link
Member

Adding to same milestone as single-webview since the fix is contained in that branch

@bsclifton
Copy link
Member

@petemill I tested on Windows using latest 0.22.x-single-webview branch (freshly rebuilt) and I still got a crash in 1/3 runs that I tried. Here's the error log:

Crash reporting enabled
[8824:9112:0403/143433.465:ERROR:browser_gpu_channel_host_factory.cc(120)] Failed to launch GPU process.
[8824:8864:0403/143433.465:ERROR:gpu_process_transport_factory.cc(1019)] Lost UI shared context.
[8824:8864:0403/143434.470:ERROR:CONSOLE(28571)] "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", source: http://localhost:8080/gen/app.entry.js (28571)
[8824:8864:0403/143434.655:ERROR:CONSOLE(28571)] "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", source: http://localhost:8080/gen/app.entry.js (28571)
[8824:8864:0403/143434.845:ERROR:CONSOLE(28571)] "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", source: http://localhost:8080/gen/app.entry.js (28571)
[8824:8864:0403/143435.195:ERROR:CONSOLE(103300)] "swapWebviewOnAttach: webview detached whilst waiting for attach!", source: http://localhost:8080/gen/app.entry.js (103300)
process exited with code 2147483651
npm ERR! code ELIFECYCLE
npm ERR! errno 2147483651
npm ERR! brave@0.22.103 start: `node ./tools/start.js --user-data-dir-name=brave-development --enable-logging --v=0 --enable-extension-activity-logging --enable-sandbox-logging --enable-dcheck`
npm ERR! Exit status 2147483651
npm ERR!
npm ERR! Failed at the brave@0.22.103 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\brian\AppData\Roaming\npm-cache\_logs\2018-04-03T21_34_36_614Z-debug.log

@petemill
Copy link
Member

petemill commented Apr 3, 2018

hmm @bsclifton can you update your debug build of muon to single-webview-c65 branch (muon v6) and see if you get the same / different error and stack as #13224 (comment)?

@petemill petemill modified the milestones: 0.22.x Release 2 (Beta Channel), 0.22.x Release 3 Apr 6, 2018
@bsclifton
Copy link
Member

Confirmed this works great using single-webview branch with Muon 6.0.1 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants