nwjs/nw.js

Application crash on Windows when network changes (like turning on/off Wi-Fi)

sirisian opened this issue · 1 comments

Issue Type

Before opening an issue, please search and see if it has already been raised.

  • Bug Report

  • Successfully reproduced against the latest version of NW.js?
    v0.87.0 specifically crashes in the same way.

Current Behavior

This is reproducible on multiple Windows devices I have, but seems more reproducible on some (50% of the time on one device vs like 2% of the time on another). I think it's a race condition in the networking as it's inconsistent.

I basically have nw.js running making simple get request periodically every 15 seconds using XMLHttpRequest. I toggle the Ethernet (by pulling it) or Wi-Fi off (by just disconnecting in Windows).

In the console I'll see the request and error:

GET myURL net::ERR_INTERNET_DISCONNECTED

but the crash doesn't appear instant. It's like a second later it crashes.

Additional Info

  • Operating System: Windows
  • NW.js Version: 0.49.0 and 0.87.0
  • Crash report: The dump is for 0.49.0 because I can't build for Windows without errors at the moment to get the symbol files. 0.49.0 has working symbol files though. I did notice it doesn't generate crash dumps consistently. It's almost like certain crashes also stop the crash dump from executing. Hopefully this has something useful:

dump.txt

Crash reason:  EXCEPTION_ACCESS_VIOLATION_READ
Crash address: 0x18
Process uptime: 38 seconds

Thread 0 (crashed)
 0  nw.dll!base::SupportsUserData::GetUserData(void const *) [supports_user_data.cc : 26 + 0x0]
    rax = 0x0000000000000000   rdx = 0x00007ffc6ad11370
    rcx = 0x0000000000000008   rbx = 0x000000ad6bbf7930
    rsi = 0x000000ad6bbf7a18   rdi = 0x00000279061e7130
    rbp = 0x0000000000000001   rsp = 0x000000ad6bbf78f8
     r8 = 0x0000000000000000    r9 = 0x0000000000000000
    r10 = 0x0000000000000000   r11 = 0x0000000000000010
    r12 = 0xaaaaaaaaaaaaaaaa   r13 = 0xaaaaaaaaaaaaaaaa
    r14 = 0x0000000000000000   r15 = 0x000002790389ebf0
    rip = 0x00007ffc6606d680
    Found by: given as instruction pointer in context
 1  nw.dll!BrowserView::GetWindowIcon() [browser_view.cc : 2614 + 0x10]
    rsp = 0x000000ad6bbf7900   rip = 0x00007ffc67270edc
    Found by: stack scanning
 2  nw.dll!GlassBrowserFrameView::GetFaviconForTabIconView() [glass_browser_frame_view.cc : 393 + 0x9]
    rsp = 0x000000ad6bbf7980   rip = 0x00007ffc69684e4c
    Found by: call frame info
 3  nw.dll!TabIconView::PaintButtonContents(gfx::Canvas *) [tab_icon_view.cc : 157 + 0x22]
    rsp = 0x000000ad6bbf79b0   rip = 0x00007ffc69bdc055
    Found by: call frame info
 4  nw.dll!views::Button::OnPaint(gfx::Canvas *) [button.cc : 404 + 0xf]
    rsp = 0x000000ad6bbf7b20   rip = 0x00007ffc65fbf680
    Found by: call frame info
 5  nw.dll!views::View::Paint(views::PaintInfo const &) [view.cc : 1089 + 0xf]
    rsp = 0x000000ad6bbf7b60   rip = 0x00007ffc65fc6e59
    Found by: call frame info
 6  nw.dll!views::View::RecursivePaintHelper(void ( views::View::*)(views::PaintInfo const &),views::PaintInfo const &) [view.cc : 2198 + 0x9]
    rsp = 0x000000ad6bbf8fa0   rip = 0x00007ffc65fc8fe1
    Found by: call frame info
 7  nw.dll!views::View::PaintChildren(views::PaintInfo const &) [view.cc : 1726 + 0x21]
    rsp = 0x000000ad6bbf9020   rip = 0x00007ffc65fc8e86
    Found by: call frame info
 8  nw.dll!views::View::Paint(views::PaintInfo const &) [view.cc : 1093 + 0x14]
    rsp = 0x000000ad6bbf9110   rip = 0x00007ffc65fc6e84
    Found by: call frame info
 9  nw.dll!views::View::RecursivePaintHelper(void ( views::View::*)(views::PaintInfo const &),views::PaintInfo const &) [view.cc : 2198 + 0x9]
    rsp = 0x000000ad6bbfa550   rip = 0x00007ffc65fc8fe1
    Found by: call frame info
10  nw.dll!views::View::PaintChildren(views::PaintInfo const &) [view.cc : 1726 + 0x21]
    rsp = 0x000000ad6bbfa5d0   rip = 0x00007ffc65fc8e86
    Found by: call frame info
11  nw.dll!views::View::Paint(views::PaintInfo const &) [view.cc : 1093 + 0x14]
    rsp = 0x000000ad6bbfa6c0   rip = 0x00007ffc65fc6e84
    Found by: call frame info
12  nw.dll!views::View::RecursivePaintHelper(void ( views::View::*)(views::PaintInfo const &),views::PaintInfo const &) [view.cc : 2198 + 0x9]
    rsp = 0x000000ad6bbfbb00   rip = 0x00007ffc65fc8fe1
    Found by: call frame info
13  nw.dll!views::View::PaintChildren(views::PaintInfo const &) [view.cc : 1726 + 0x21]
    rsp = 0x000000ad6bbfbb80   rip = 0x00007ffc65fc8e86
    Found by: call frame info
14  nw.dll!BrowserRootView::PaintChildren(views::PaintInfo const &) [browser_root_view.cc : 322 + 0x5]
    rsp = 0x000000ad6bbfbc70   rip = 0x00007ffc68d0f73e
    Found by: call frame info
15  nw.dll!views::View::Paint(views::PaintInfo const &) [view.cc : 1093 + 0x14]
    rsp = 0x000000ad6bbfd040   rip = 0x00007ffc65fc6e84
    Found by: call frame info
16  nw.dll!views::View::PaintFromPaintRoot(ui::PaintContext const &) [view.cc : 2205 + 0xb]
    rsp = 0x000000ad6bbfe480   rip = 0x00007ffc65fc987a
    Found by: call frame info
17  nw.dll!ui::Layer::PaintContentsToDisplayList(cc::ContentLayerClient::PaintingControlSetting) [layer.cc : 1300 + 0x2f]
    rsp = 0x000000ad6bbfe530   rip = 0x00007ffc65fd9609
    Found by: call frame info
18  nw.dll!cc::PictureLayer::Update() [picture_layer.cc : 143 + 0xe]
    rsp = 0x000000ad6bbfe630   rip = 0x00007ffc66a396e2
    Found by: call frame info
19  nw.dll!cc::LayerTreeHost::DoUpdateLayers() [layer_tree_host.cc : 851 + 0x31]
    rsp = 0x000000ad6bbfe750   rip = 0x00007ffc66a2485a
    Found by: call frame info
20  nw.dll!cc::LayerTreeHost::UpdateLayers() [layer_tree_host.cc : 713 + 0x8]
    rsp = 0x000000ad6bbfe840   rip = 0x00007ffc66a24557
    Found by: call frame info
21  nw.dll!cc::SingleThreadProxy::BeginMainFrame(viz::BeginFrameArgs const &) [single_thread_proxy.cc : 845 + 0x17]
    rsp = 0x000000ad6bbfe8c0   rip = 0x00007ffc6765a317
    Found by: call frame info
22  nw.dll!base::TaskAnnotator::RunTask(char const *,base::PendingTask *) [task_annotator.cc : 142 + 0x15]
    rsp = 0x000000ad6bbfe970   rip = 0x00007ffc6607103d
    Found by: call frame info
23  nw.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow *) [thread_controller_with_message_pump_impl.cc : 332 + 0x17]
    rsp = 0x000000ad6bbfeab0   rip = 0x00007ffc66b2c892
    Found by: call frame info
24  nw.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() [thread_controller_with_message_pump_impl.cc : 252 + 0x15]
    rsp = 0x000000ad6bbfec20   rip = 0x00007ffc66b2c576
    Found by: call frame info
25  nw.dll!base::MessagePumpForUI::DoRunLoop() [message_pump_win.cc : 219 + 0x11]
    rsp = 0x000000ad6bbfecc0   rip = 0x00007ffc660a257a
    Found by: call frame info
26  nw.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate *) [message_pump_win.cc : 75 + 0x9]
    rsp = 0x000000ad6bbfed50   rip = 0x00007ffc660a1cca
    Found by: call frame info
27  nw.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool,base::TimeDelta) [thread_controller_with_message_pump_impl.cc : 446 + 0xa]
    rsp = 0x000000ad6bbfeda0   rip = 0x00007ffc66b2cfa4
    Found by: call frame info
28  nw.dll!base::RunLoop::Run() [run_loop.cc : 124 + 0x10]
    rsp = 0x000000ad6bbfee10   rip = 0x00007ffc66059836
    Found by: call frame info
29  nw.dll!ChromeBrowserMainParts::MainMessageLoopRun(int *) [chrome_browser_main.cc : 1721 + 0xc]
    rsp = 0x000000ad6bbfeeb0   rip = 0x00007ffc66a52f77
    Found by: call frame info
30  nw.dll!content::BrowserMainLoop::RunMainMessageLoopParts() [browser_main_loop.cc : 1012 + 0xa]
    rsp = 0x000000ad6bbfef40   rip = 0x00007ffc641625b7
    Found by: call frame info
31  nw.dll!content::BrowserMainRunnerImpl::Run() [browser_main_runner_impl.cc : 150 + 0x5]
    rsp = 0x000000ad6bbfef70   rip = 0x00007ffc641642f1
    Found by: call frame info
32  nw.dll!content::BrowserMain(content::MainFunctionParams const &) [browser_main.cc : 47 + 0x6]
    rsp = 0x000000ad6bbfefa0   rip = 0x00007ffc6415fa0f
    Found by: call frame info
33  nw.dll!content::RunBrowserProcessMain(content::MainFunctionParams const &,content::ContentMainDelegate *) [content_main_runner_impl.cc : 525 + 0x8]
    rsp = 0x000000ad6bbff040   rip = 0x00007ffc65f88130
    Found by: call frame info
34  nw.dll!content::ContentMainRunnerImpl::RunServiceManager(content::MainFunctionParams &,bool) [content_main_runner_impl.cc : 1001 + 0xc]
    rsp = 0x000000ad6bbff0a0   rip = 0x00007ffc65f88f27
    Found by: call frame info
35  nw.dll!content::ContentMainRunnerImpl::Run(bool) [content_main_runner_impl.cc : 885 + 0x10]
    rsp = 0x000000ad6bbff1f0   rip = 0x00007ffc65f88afa
    Found by: call frame info
36  nw.dll!service_manager::Main(service_manager::MainParams const &) [main.cc : 457 + 0xa]
    rsp = 0x000000ad6bbff290   rip = 0x00007ffc65fbbf29
    Found by: call frame info
37  nw.dll!content::ContentMain(content::ContentMainParams const &) [content_main.cc : 19 + 0x8]
    rsp = 0x000000ad6bbff5b0   rip = 0x00007ffc65f880a8
    Found by: call frame info
38  nw.dll!ChromeMain [chrome_main.cc : 119 + 0x5]
    rsp = 0x000000ad6bbff650   rip = 0x00007ffc632211f4
    Found by: call frame info
39  nw.exe!MainDllLoader::Launch(HINSTANCE__ *,base::TimeTicks) [main_dll_loader_win.cc : 178 + 0x12]
    rsp = 0x000000ad6bbff750   rip = 0x00007ff60d6d26dc
    Found by: call frame info
40  nw.exe!wWinMain [chrome_exe_main_win.cc : 267 + 0x13]
    rsp = 0x000000ad6bbff820   rip = 0x00007ff60d6d1992
    Found by: call frame info
41  nw.exe!__scrt_common_main_seh [exe_common.inl : 288 + 0x21]
    rsp = 0x000000ad6bbffc10   rip = 0x00007ff60d803922
    Found by: call frame info
42  KERNEL32.DLL + 0x8364
    rsp = 0x000000ad6bbffc50   rip = 0x00007ffc92288364
    Found by: call frame info
43  ntdll.dll + 0x67091
    rsp = 0x000000ad6bbffc80   rip = 0x00007ffc94d57091
    Found by: stack scanning
44  KERNELBASE.dll + 0x54e10
    rsp = 0x000000ad6bbffcb0   rip = 0x00007ffc91794e10
    Found by: stack scanning

I'll create a simpler test case on Monday for 0.87.0.

I found the issue in my code and it wasn't related to this crash log at all nor the network. It was a very subtle bug when the network changes Chrome randomly outputs 403. I have code that handles errors like:

if (exception.message == '403' || exception.message == 'Networking Error: Firewall') {

Never realized Chrome could output such an error by just toggling the Wi-Fi a bunch. I was originally doing a hot-fix for a customer when that happened to bypass a firewall issue.

If I find more information related to the actual crash I'll open another issue.