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

Crash in development in Electron when reloading (Ctrl+R/Cmd+R or from webpack) #3904

Closed
4ian opened this issue May 13, 2022 · 1 comment · Fixed by #3931
Closed

Crash in development in Electron when reloading (Ctrl+R/Cmd+R or from webpack) #3904

4ian opened this issue May 13, 2022 · 1 comment · Fixed by #3931

Comments

@4ian
Copy link
Owner

4ian commented May 13, 2022

Describe the bug

The "renderer process" of Electron crashes when we reload the editor page in development in Electron. Thankfully we never reload in the production app.

To Reproduce

  1. git clone the repo,
  2. cd newIDE/app && npm install && npm start,
  3. cd newIDE/electron-app && npm install && npm start,
  4. Once launched, reload the page in Electron from the dev tools

Investigation

Googling around the issue of crash in Electron seems to give pointers to things like static functions being registered by native modules, while not supported.

Stacktrace

Found in ~/Library/Logs/DiagnosticReports/ (after googling "macos get stacktrace of process"):

Thread 0 Crashed:: CrRendererMain  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib              0x00007fff6844933a __pthread_kill + 10
1   libsystem_pthread.dylib             0x00007fff68505e60 pthread_kill + 430
2   libsystem_c.dylib                   0x00007fff683d0808 abort + 120
3   com.github.Electron.framework       0x00000001029741e4 uv_mutex_lock + 20
4   com.github.Electron.framework       0x0000000108dca636 napi_release_threadsafe_function + 38
5   fsevents.node                       0x000000010ea51821 fse_instance_destroy + 145
6   com.github.Electron.framework       0x0000000108dcaa3f node_api_get_module_file_name + 751
7   com.github.Electron.framework       0x0000000108dbecbf node::Stop(node::Environment*) + 1327
8   com.github.Electron.framework       0x0000000108dca886 node_api_get_module_file_name + 310
9   com.github.Electron.framework       0x0000000108dcb3bc node_api_get_module_file_name + 3180
10  com.github.Electron.framework       0x0000000108dcb42e node_api_get_module_file_name + 3294
11  com.github.Electron.framework       0x0000000108dcb72b node_api_get_module_file_name + 4059
12  com.github.Electron.framework       0x0000000102967bf8 uv_run + 536
13  com.github.Electron.framework       0x0000000108dad0c4 node::EmitAsyncDestroy(node::Environment*, node::async_context) + 212436
14  com.github.Electron.framework       0x0000000108dad5d3 node::EmitAsyncDestroy(node::Environment*, node::async_context) + 213731
15  com.github.Electron.framework       0x0000000108d76a84 node::FreeEnvironment(node::Environment*) + 164
16  com.github.Electron.framework       0x0000000102aeaa7f v8::internal::CallInterfaceDescriptor::IsValidFloatParameterRegister(v8::internal::Register) + 20911
17  com.github.Electron.framework       0x00000001083fa7a9 node::CommonEnvironmentSetup::event_loop() const + 9898633
18  com.github.Electron.framework       0x0000000106cf6074 node::AsyncResource::get_async_id() const + 31099156
19  com.github.Electron.framework       0x0000000106cf8936 node::AsyncResource::get_async_id() const + 31109590
20  com.github.Electron.framework       0x0000000107185e6f node::AsyncResource::get_async_id() const + 35882767
21  com.github.Electron.framework       0x000000010767a1aa node::AsyncResource::get_async_id() const + 41077322
22  com.github.Electron.framework       0x000000010767ac10 node::AsyncResource::get_async_id() const + 41079984
23  com.github.Electron.framework       0x000000010768bbbf node::AsyncResource::get_async_id() const + 41149535
24  com.github.Electron.framework       0x000000010768e728 node::AsyncResource::get_async_id() const + 41160648
25  com.github.Electron.framework       0x000000010720f382 node::AsyncResource::get_async_id() const + 36445218
26  com.github.Electron.framework       0x00000001083eb637 node::CommonEnvironmentSetup::event_loop() const + 9836823
27  com.github.Electron.framework       0x0000000108406403 node::CommonEnvironmentSetup::event_loop() const + 9946851
28  com.github.Electron.framework       0x000000010840626b node::CommonEnvironmentSetup::event_loop() const + 9946443
29  com.github.Electron.framework       0x00000001083e9fc7 node::CommonEnvironmentSetup::event_loop() const + 9831079
30  com.github.Electron.framework       0x00000001083bf3e5 node::CommonEnvironmentSetup::event_loop() const + 9656005
31  com.github.Electron.framework       0x00000001038fab54 v8::internal::compiler::BasicBlock::set_loop_depth(int) + 391092
32  com.github.Electron.framework       0x00000001083bf93b node::CommonEnvironmentSetup::event_loop() const + 9657371
33  com.github.Electron.framework       0x0000000105aae049 node::AsyncResource::get_async_id() const + 11929833
34  com.github.Electron.framework       0x0000000105ab1f67 node::AsyncResource::get_async_id() const + 11945991
35  com.github.Electron.framework       0x0000000105aaf67d node::AsyncResource::get_async_id() const + 11935517
36  com.github.Electron.framework       0x0000000105cc9878 node::AsyncResource::get_async_id() const + 14139672
37  com.github.Electron.framework       0x000000010577aead node::AsyncResource::get_async_id() const + 8574797
38  com.github.Electron.framework       0x00000001057984a5 node::AsyncResource::get_async_id() const + 8695109
39  com.github.Electron.framework       0x00000001057d556c node::AsyncResource::get_async_id() const + 8945164
40  com.github.Electron.framework       0x00000001027b294a 0x102626000 + 1624394
41  com.github.Electron.framework       0x00000001057d4ccf node::AsyncResource::get_async_id() const + 8942959
42  com.apple.CoreFoundation            0x00007fff2e291d52 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
43  com.apple.CoreFoundation            0x00007fff2e291cf1 __CFRunLoopDoSource0 + 103
44  com.apple.CoreFoundation            0x00007fff2e291b0b __CFRunLoopDoSources0 + 209
45  com.apple.CoreFoundation            0x00007fff2e29083a __CFRunLoopRun + 927
46  com.apple.CoreFoundation            0x00007fff2e28fe3e CFRunLoopRunSpecific + 462
47  com.apple.Foundation                0x00007fff3092b1c8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
48  com.github.Electron.framework       0x00000001057d5d09 node::AsyncResource::get_async_id() const + 8947113
49  com.github.Electron.framework       0x00000001057d4771 node::AsyncResource::get_async_id() const + 8941585

Analysis:

fsevents

npm ls fsevents gives:

├─┬ @storybook/addon-essentials@6.3.12
│ └─┬ @storybook/addon-docs@6.3.12
│   └─┬ @jest/transform@26.6.2
│     └─┬ jest-haste-map@26.6.2
│       └── fsevents@2.1.3 deduped
├─┬ react-scripts@3.4.0
│ ├─┬ babel-jest@24.9.0
│ │ └─┬ @jest/transform@24.9.0
│ │   └─┬ jest-haste-map@24.9.0
│ │     └── fsevents@1.2.13
│ ├── fsevents@2.1.2
│ └─┬ webpack-dev-server@3.10.2
│   └─┬ chokidar@2.1.8
│     └── fsevents@1.2.13
└─┬ webpack@4.41.5
  └─┬ watchpack@1.7.4
    └─┬ chokidar@3.4.2
      └── fsevents@2.1.3

The version of fsevents is not the latest one and looking at the releases notes, this could come from this:
image

Digging in the commits, we find:

Other details

  • Happening on macOS at least
@4ian
Copy link
Owner Author

4ian commented May 13, 2022

Issue is only on macOS because of an old fsevents being used by an old chokidar which is used in the Electron renderer process, by newIDE/app/src/GameEngineFinder/LocalGDJSDevelopmentWatcher.js.

We should probably move this to the main process of Electron anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant