Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron 9: crash in SQLite 5.x on shutdown #8

Closed
bpasero opened this issue Sep 11, 2020 · 4 comments
Closed

Electron 9: crash in SQLite 5.x on shutdown #8

bpasero opened this issue Sep 11, 2020 · 4 comments
Assignees

Comments

@bpasero
Copy link
Member

bpasero commented Sep 11, 2020

To reproduce:

  • be on macOS
  • in VSCode open the ben/sqlite-5.x branch
  • yarn && yarn watch
  • start VSCode and quit

Dump:

Operating system: Mac OS X
                  10.15.6 19G73
CPU: amd64
     family 6 model 158 stepping 13
     16 CPUs
GPU: UNKNOWN
Crash reason:  0x00000000 / 0x00000000
Crash address: 0x7fff6890733a
Process uptime: 5 seconds
Thread 0 (crashed)
 0  libsystem_kernel.dylib!__pthread_kill + 0xa
    rax = 0x0000000000000000   rdx = 0x0000000000000000
    rcx = 0x00007ffee5202e48   rbx = 0x000000010f3b0dc0
    rsi = 0x0000000000000006   rdi = 0x0000000000000307
    rbp = 0x00007ffee5202e70   rsp = 0x00007ffee5202e48
     r8 = 0x0000000000000000    r9 = 0x0000000000989680
    r10 = 0x000000010f3b0dc0   r11 = 0x0000000000000246
    r12 = 0x0000000000000307   r13 = 0x0000000000000050
    r14 = 0x0000000000000006   r15 = 0x0000000000000016
    rip = 0x00007fff6890733a
    Found by: given as instruction pointer in context
 1  libsystem_c.dylib!__abort + 0x8b
    rbp = 0x00007ffee5202ec0   rsp = 0x00007ffee5202e80
    rip = 0x00007fff6888e8a2
    Found by: previous frame's frame pointer
 2  libsystem_c.dylib!abort + 0x87
    rbp = 0x00007ffee5202f00   rsp = 0x00007ffee5202ed0
    rip = 0x00007fff6888e817
    Found by: previous frame's frame pointer
 3  libsystem_malloc.dylib!malloc_vreport + 0x224
    rbp = 0x00007ffee5202f60   rsp = 0x00007ffee5202f10
    rip = 0x00007fff6898450b
    Found by: previous frame's frame pointer
 4  libsystem_malloc.dylib!malloc_report + 0x97
    rbp = 0x00007ffee5203040   rsp = 0x00007ffee5202f70
    rip = 0x00007fff6898740f
    Found by: previous frame's frame pointer
 5  Electron Framework + 0x5fb060c
    rbp = 0x00007ffee5203060   rsp = 0x00007ffee5203050
    rip = 0x000000011539b60c
    Found by: previous frame's frame pointer
 6  sqlite.node + 0x123a5
    rbp = 0x00007ffee5203080   rsp = 0x00007ffee5203070
    rip = 0x000000011a2203a5
    Found by: previous frame's frame pointer
 7  Electron Framework + 0x5fc84f9
    rbp = 0x00007ffee52030b0   rsp = 0x00007ffee5203090
    rip = 0x00000001153b34f9
    Found by: previous frame's frame pointer
 8  Electron Framework + 0x5fc8482
    rbp = 0x00007ffee52030e0   rsp = 0x00007ffee52030c0
    rip = 0x00000001153b3482
    Found by: previous frame's frame pointer
 9  Electron Framework + 0x5fc830e
    rbp = 0x00007ffee5203100   rsp = 0x00007ffee52030f0
    rip = 0x00000001153b330e
    Found by: previous frame's frame pointer
10  Electron Framework + 0x5f9cbaf
    rbp = 0x00007ffee5203170   rsp = 0x00007ffee5203110
    rip = 0x0000000115387baf
    Found by: previous frame's frame pointer
11  Electron Framework + 0x5f6a28e
    rbp = 0x00007ffee5203190   rsp = 0x00007ffee5203180
    rip = 0x000000011535528e
    Found by: previous frame's frame pointer
12  Electron Framework + 0xd769f
    rbp = 0x00007ffee52031e0   rsp = 0x00007ffee52031a0
    rip = 0x000000010f4c269f
    Found by: previous frame's frame pointer
13  Electron Framework + 0x1c0d5d1
    rbp = 0x00007ffee5203270   rsp = 0x00007ffee52031f0
    rip = 0x0000000110ff85d1
    Found by: previous frame's frame pointer
14  Electron Framework + 0x1c0ee74
    rbp = 0x00007ffee52032b0   rsp = 0x00007ffee5203280
    rip = 0x0000000110ff9e74
    Found by: previous frame's frame pointer
15  Electron Framework + 0x1c0abf4
    rbp = 0x00007ffee5203300   rsp = 0x00007ffee52032c0
    rip = 0x0000000110ff5bf4
    Found by: previous frame's frame pointer
16  Electron Framework + 0x1ab3f66
    rbp = 0x00007ffee5203380   rsp = 0x00007ffee5203310
    rip = 0x0000000110e9ef66
    Found by: previous frame's frame pointer
17  Electron Framework + 0x1ab3bbb
    rbp = 0x00007ffee52033f0   rsp = 0x00007ffee5203390
    rip = 0x0000000110e9ebbb
    Found by: previous frame's frame pointer
18  Electron Framework + 0x40392c8
    rbp = 0x00007ffee5203740   rsp = 0x00007ffee5203400
    rip = 0x00000001134242c8
    Found by: previous frame's frame pointer
19  Electron Framework + 0xd32d54
    rbp = 0x00007ffee52037d0   rsp = 0x00007ffee5203750
    rip = 0x000000011011dd54
    Found by: previous frame's frame pointer
20  Electron Framework + 0x2bd4
    rbp = 0x00007ffee5203860   rsp = 0x00007ffee52037e0
    rip = 0x000000010f3edbd4
    Found by: previous frame's frame pointer
21  Electron!main [electron_main.cc : 274 + 0xa]
    rbp = 0x00007ffee5203910   rsp = 0x00007ffee5203870
    rip = 0x000000010a9fd110
    Found by: previous frame's frame pointer
22  libdyld.dylib!start + 0x1
    rbp = 0x00007ffee5203928   rsp = 0x00007ffee5203920
    rip = 0x00007fff687bfcc9
    Found by: previous frame's frame pointer
23  libdyld.dylib!start + 0x1
    rbp = 0x00007ffee5203928   rsp = 0x00007ffee5203928
    rip = 0x00007fff687bfcc9
    Found by: stack scanning
@bpasero
Copy link
Member Author

bpasero commented Feb 12, 2021

I somehow cannot reproduce this crash anymore running with Electron 11. The original dump from Electron 9 is:

11ed22eb-1200-443b-88c7-b3eed47cd432.dmp.zip

@deepak1556
Copy link

Thread 0 (crashed)
 0  libsystem_kernel.dylib!__pthread_kill + 0xa
    rax = 0x0000000000000000   rdx = 0x0000000000000000
    rcx = 0x00007ffee7e75e18   rbx = 0x00000001134e9dc0
    rsi = 0x0000000000000006   rdi = 0x0000000000000307
    rbp = 0x00007ffee7e75e40   rsp = 0x00007ffee7e75e18
     r8 = 0x0000000000000000    r9 = 0x0000000000989680
    r10 = 0x00000001134e9dc0   r11 = 0x0000000000000246
    r12 = 0x0000000000000307   r13 = 0x0000000000000050
    r14 = 0x0000000000000006   r15 = 0x0000000000000016
    rip = 0x00007fff708dd33a
    Found by: given as instruction pointer in context
 1  libsystem_c.dylib!__abort + 0x8b
    rbp = 0x00007ffee7e75e90   rsp = 0x00007ffee7e75e50
    rip = 0x00007fff708648a2
    Found by: previous frame's frame pointer
 2  libsystem_c.dylib!abort + 0x87
    rbp = 0x00007ffee7e75ed0   rsp = 0x00007ffee7e75ea0
    rip = 0x00007fff70864817
    Found by: previous frame's frame pointer
 3  libsystem_malloc.dylib!malloc_vreport + 0x224
    rbp = 0x00007ffee7e75f30   rsp = 0x00007ffee7e75ee0
    rip = 0x00007fff7095a50b
    Found by: previous frame's frame pointer
 4  libsystem_malloc.dylib!malloc_report + 0x97
    rbp = 0x00007ffee7e76010   rsp = 0x00007ffee7e75f40
    rip = 0x00007fff7095d40f
    Found by: previous frame's frame pointer
 5  Electron Framework!napi_delete_reference [js_native_api_v8.cc : 252 + 0x9]
    rbp = 0x00007ffee7e76030   rsp = 0x00007ffee7e76020
    rip = 0x000000010dd6e60c
    Found by: previous frame's frame pointer
 6  sqlite.node + 0x15795
    rbp = 0x00007ffee7e76050   rsp = 0x00007ffee7e76040
    rip = 0x000000011802c795
    Found by: previous frame's frame pointer
 7  Electron Framework!void napi_env__::CallIntoModule<napi_env__::~napi_env__()::'lambda'(napi_env__*)&, void napi_env__::CallIntoModuleThrow<napi_env__::~napi_env__()::'lambda'(napi_env__*)>(napi_env__::~napi_env__()::'lambda'(napi_env__*)&&)::'lambda'(napi_env__*, v8::Local<v8::Value>)>(napi_env__::~napi_env__()::'lambda'(napi_env__*)&&, void napi_env__::CallIntoModuleThrow<napi_env__::~napi_env__()::'lambda'(napi_env__*)>(napi_env__::~napi_env__()::'lambda'(napi_env__*)&&)::'lambda'(napi_env__*, v8::Local<v8::Value>)&&) [js_native_api_v8.h : 27 + 0x6]
    rbp = 0x00007ffee7e76080   rsp = 0x00007ffee7e76060
    rip = 0x000000010dd864f9
    Found by: previous frame's frame pointer
 8  Electron Framework!napi_env__::~napi_env__() [js_native_api_v8.h : 59 + 0x8]
    rbp = 0x00007ffee7e760b0   rsp = 0x00007ffee7e76090
    rip = 0x000000010dd86482
    Found by: previous frame's frame pointer
 9  Electron Framework!node_napi_env__::~node_napi_env__() [node_api.cc : 14 + 0x5]
    rbp = 0x00007ffee7e760d0   rsp = 0x00007ffee7e760c0
    rip = 0x000000010dd8630e
    Found by: previous frame's frame pointer
10  Electron Framework!node::Environment::RunCleanup() [env.cc : 614 + 0x2]
    rbp = 0x00007ffee7e76140   rsp = 0x00007ffee7e760e0
    rip = 0x000000010dd5abaf
    Found by: previous frame's frame pointer
11  Electron Framework!node::FreeEnvironment(node::Environment*) [environment.cc : 291 + 0x5]
    rbp = 0x00007ffee7e76160   rsp = 0x00007ffee7e76150
    rip = 0x000000010dd2828e
    Found by: previous frame's frame pointer
12  Electron Framework!electron::ElectronBrowserMainParts::PostMainMessageLoopRun() [memory : 2378 + 0x8]
    rbp = 0x00007ffee7e761b0   rsp = 0x00007ffee7e76170
    rip = 0x0000000107e9569f
    Found by: previous frame's frame pointer
13  Electron Framework!content::BrowserMainLoop::ShutdownThreadsAndCleanUp() [browser_main_loop.cc : 1095 + 0x6]
    rbp = 0x00007ffee7e76240   rsp = 0x00007ffee7e761c0
    rip = 0x00000001099cb5d1
    Found by: previous frame's frame pointer
14  Electron Framework!content::BrowserMainRunnerImpl::Shutdown() [browser_main_runner_impl.cc : 178 + 0x5]
    rbp = 0x00007ffee7e76280   rsp = 0x00007ffee7e76250
    rip = 0x00000001099cce74
    Found by: previous frame's frame pointer
15  Electron Framework!content::BrowserMain(content::MainFunctionParams const&) [browser_main.cc : 49 + 0x6]
    rbp = 0x00007ffee7e762d0   rsp = 0x00007ffee7e76290
    rip = 0x00000001099c8bf4
    Found by: previous frame's frame pointer
16  Electron Framework!content::ContentMainRunnerImpl::RunServiceManager(content::MainFunctionParams&, bool) [content_main_runner_impl.cc : 530 + 0x5]
    rbp = 0x00007ffee7e76350   rsp = 0x00007ffee7e762e0
    rip = 0x0000000109871f66
    Found by: previous frame's frame pointer
17  Electron Framework!content::ContentMainRunnerImpl::Run(bool) [content_main_runner_impl.cc : 879 + 0x10]
    rbp = 0x00007ffee7e763c0   rsp = 0x00007ffee7e76360
    rip = 0x0000000109871bbb
    Found by: previous frame's frame pointer
18  Electron Framework!service_manager::Main(service_manager::MainParams const&) [main.cc : 454 + 0x9]
    rbp = 0x00007ffee7e76710   rsp = 0x00007ffee7e763d0
    rip = 0x000000010bdf72c8
    Found by: previous frame's frame pointer
19  Electron Framework!content::ContentMain(content::ContentMainParams const&) [content_main.cc : 19 + 0x8]
    rbp = 0x00007ffee7e767a0   rsp = 0x00007ffee7e76720
    rip = 0x0000000108af0d54
    Found by: previous frame's frame pointer
20  Electron Framework!ElectronMain [electron_library_main.mm : 23 + 0x5]
    rbp = 0x00007ffee7e76830   rsp = 0x00007ffee7e767b0
    rip = 0x0000000107dc0bd4
    Found by: previous frame's frame pointer
21  Electron!main [electron_main.cc : 274 + 0xa]
    rbp = 0x00007ffee7e768e0   rsp = 0x00007ffee7e76840
    rip = 0x0000000107d8a110
    Found by: previous frame's frame pointer
22  libdyld.dylib!start + 0x1
    rbp = 0x00007ffee7e768f8   rsp = 0x00007ffee7e768f0
    rip = 0x00007fff70795cc9
    Found by: previous frame's frame pointer
23  libdyld.dylib!start + 0x1
    rbp = 0x00007ffee7e768f8   rsp = 0x00007ffee7e768f8
    rip = 0x00007fff70795cc9
    Found by: stack scanning

@deepak1556
Copy link

Crash in the native module when destroying the napi_env, also reported at TryGhost#1370 when using RenderProcessReuse mode which has same destruction code path, users are reporting that it is fixed in Electron 11. I don't have the scope to investigate the issue this iteration, will continue next iteration.

@bpasero
Copy link
Member Author

bpasero commented Feb 16, 2021

Thanks I think it is fine to close this issue then, I plan to update SQLite maybe next iteration or the one after.

@bpasero bpasero closed this as completed Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants