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

[Bug]: UtilityProcess crashes when using the asar path #41396

Open
3 tasks done
tuyangJs opened this issue Feb 21, 2024 · 7 comments · May be fixed by #41450
Open
3 tasks done

[Bug]: UtilityProcess crashes when using the asar path #41396

tuyangJs opened this issue Feb 21, 2024 · 7 comments · May be fixed by #41450
Assignees
Labels
28-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@tuyangJs
Copy link

Preflight Checklist

Electron Version

28.2.3

What operating system are you using?

Windows

Operating System Version

windows11 23h2

What arch are you using?

ia32

Last Known Working Electron version

No response

Expected Behavior

Should have been successfully created

Actual Behavior

// 载入新的模块实例 const Modurl = C:\Users\ihanl\Desktop\ELECTRON-tl\resources\app.asar\main\ModProcess\ModMain.js console.log(Modurl); //创建模块进程 const child = utilityProcess.fork(Modurl, ['pipe', 'pipe', 'pipe', 'ipc'], { serviceName: 'ModProcess', cwd: __dirname, })

Testcase Gist URL

No response

Additional Information

No response

@codebytere codebytere self-assigned this Feb 21, 2024
@codebytere codebytere added blocked/need-repro Needs a test case to reproduce the bug platform/windows 28-x-y labels Feb 21, 2024
@electron-issue-triage
Copy link

Hello @tuyangJs. Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

@silyont
Copy link

silyont commented Feb 27, 2024

I got same issue that failed to load utilityProcess. Here is the gist to reproduce the error. You may toggle the comment in line 45 of main.js to replicate the issue.

From my investigation, all electron versions that include this PR will failed to load utiltyProcess, i.e. v29, >=v28.2.0, >=v27.3.0

@electron-issue-triage electron-issue-triage bot removed the blocked/need-repro Needs a test case to reproduce the bug label Feb 27, 2024
@codebytere codebytere added status/confirmed A maintainer reproduced the bug or agreed with the feature has-repro-gist Issue can be reproduced with code at https://gist.github.com/ labels Feb 27, 2024
@codebytere
Copy link
Member

codebytere commented Feb 27, 2024

Confirmed - thanks for the repro @silyont 🙇🏻‍♀️

Stacktrace

[75874:0227/203008.829581:FATAL:browser_process_impl.cc(196)] Check failed: SystemNetworkContextManager::GetInstance(). 
0   Electron Framework                  0x0000000119ad9124 base::debug::CollectStackTrace(void const**, unsigned long) + 28
1   Electron Framework                  0x0000000119ac8f98 base::debug::StackTrace::StackTrace() + 24
2   Electron Framework                  0x00000001199f73e0 logging::LogMessage::Flush() + 140
3   Electron Framework                  0x00000001199f72d4 logging::LogMessage::~LogMessage() + 36
4   Electron Framework                  0x00000001199e1a04 logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage() + 124
5   Electron Framework                  0x00000001199e1a54 logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage() + 12
6   Electron Framework                  0x00000001199e1360 logging::CheckError::~CheckError() + 204
7   Electron Framework                  0x00000001199e140c logging::CheckError::~CheckError() + 12
8   Electron Framework                  0x0000000114ace0f0 BrowserProcessImpl::system_network_context_manager() + 92
9   Electron Framework                  0x0000000114a623c8 electron::api::UtilityProcessWrapper::UtilityProcessWrapper(mojo::StructPtr<node::mojom::NodeServiceParams>, std::__Cr::basic_string<char16_t, std::__Cr::char_traits<char16_t>, std::__Cr::allocator<char16_t>>, std::__Cr::map<electron::api::UtilityProcessWrapper::IOHandle, electron::api::UtilityProcessWrapper::IOType, std::__Cr::less<electron::api::UtilityProcessWrapper::IOHandle>, std::__Cr::allocator<std::__Cr::pair<electron::api::UtilityProcessWrapper::IOHandle const, electron::api::UtilityProcessWrapper::IOType>>>, std::__Cr::map<std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>>, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>>, std::__Cr::less<std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>>>, std::__Cr::allocator<std::__Cr::pair<std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>>>>>, base::FilePath, bool) + 1672
10  Electron Framework                  0x0000000114a642e8 electron::api::UtilityProcessWrapper::Create(gin::Arguments*) + 2024
11  Electron Framework                  0x00000001149e03d4 base::RepeatingCallback<gfx::Rect (electron::api::BaseWindow const*)>::Run(electron::api::BaseWindow const*) const & + 92
12  Electron Framework                  0x00000001149ff064 void gin_helper::Invoker<gin_helper::IndicesHolder<0ul>, v8::Isolate*>::DispatchToCallback<gin::Handle<electron::api::DesktopCapturer>>(base::RepeatingCallback<gin::Handle<electron::api::DesktopCapturer> (v8::Isolate*)>) + 508
13  Electron Framework                  0x0000000114a65604 gin_helper::Dispatcher<gin::Handle<electron::api::UtilityProcessWrapper> (gin::Arguments*)>::DispatchToCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 240
14  ???                                 0x0000000157d93de4 0x0 + 5768822244
15  ???                                 0x0000000157d91554 0x0 + 5768811860
16  ???                                 0x0000000157d92358 0x0 + 5768815448
17  ???                                 0x0000000157f80ff0 0x0 + 5770842096
18  ???                                 0x0000000157d91554 0x0 + 5768811860
19  ???                                 0x0000000157d91554 0x0 + 5768811860
20  ???                                 0x0000000157d91554 0x0 + 5768811860
21  ???                                 0x0000000157d91554 0x0 + 5768811860
22  ???                                 0x0000000157d91554 0x0 + 5768811860
23  ???                                 0x0000000157d91554 0x0 + 5768811860
24  ???                                 0x0000000157d91554 0x0 + 5768811860
25  ???                                 0x0000000157d91554 0x0 + 5768811860
26  ???                                 0x00000001500157c4 0x0 + 5637232580
27  ???                                 0x0000000157d8e728 0x0 + 5768800040
28  ???                                 0x0000000157d8e418 0x0 + 5768799256
29  Electron Framework                  0x00000001164fc824 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 4184
30  Electron Framework                  0x00000001164fb6f0 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 232
31  Electron Framework                  0x0000000116233f8c v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) + 488
32  Electron Framework                  0x000000011e98405c node::loader::ModuleWrap::SyntheticModuleEvaluationStepsCallback(v8::Local<v8::Context>, v8::Local<v8::Module>) + 476
33  Electron Framework                  0x0000000116acd2b8 v8::internal::SyntheticModule::Evaluate(v8::internal::Isolate*, v8::internal::Handle<v8::internal::SyntheticModule>) + 412
34  Electron Framework                  0x0000000116a1dfa8 v8::internal::Module::Evaluate(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Module>) + 876
35  Electron Framework                  0x00000001162109b4 v8::Module::Evaluate(v8::Local<v8::Context>) + 988
36  Electron Framework                  0x000000011e985104 node::loader::ModuleWrap::Evaluate(v8::FunctionCallbackInfo<v8::Value> const&) + 1212
37  ???                                 0x0000000157d93de4 0x0 + 5768822244
38  ???                                 0x0000000157d91554 0x0 + 5768811860
39  ???                                 0x0000000157dd5c0c 0x0 + 5769092108
40  ???                                 0x0000000157ee34e8 0x0 + 5770196200
41  ???                                 0x0000000157dc29ac 0x0 + 5769013676
42  ???                                 0x0000000157d8e618 0x0 + 5768799768
43  Electron Framework                  0x00000001164fc880 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 4276
44  Electron Framework                  0x00000001164fd9ec v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 156
45  Electron Framework                  0x00000001164fdfc0 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*) + 108
46  Electron Framework                  0x000000011654d4ac v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) + 608
47  Electron Framework                  0x000000011654d1f0 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) + 112
48  Electron Framework                  0x000000011e93bb74 node::InternalCallbackScope::Close() + 248
49  Electron Framework                  0x000000011e93b878 node::InternalCallbackScope::~InternalCallbackScope() + 20
50  Electron Framework                  0x000000011ea50d94 node::PerIsolatePlatformData::RunForegroundTask(std::__Cr::unique_ptr<v8::Task, std::__Cr::default_delete<v8::Task>>) + 156
51  Electron Framework                  0x000000011ea4fea4 node::PerIsolatePlatformData::FlushForegroundTasksInternal() + 740
52  Electron Framework                  0x0000000114995830 uv__async_io + 280
53  Electron Framework                  0x00000001149a6348 uv__io_poll + 976
54  Electron Framework                  0x0000000114995d28 uv_run + 412
55  Electron Framework                  0x0000000114bad448 electron::NodeBindings::JoinAppCode() + 140
56  Electron Framework                  0x0000000114ae2174 electron::ElectronBrowserMainParts::PostEarlyInitialization() + 624
57  Electron Framework                  0x000000011856b230 content::BrowserMainLoop::EarlyInitialization() + 680
58  Electron Framework                  0x000000011856fb58 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams) + 836
59  Electron Framework                  0x000000011856a500 content::Browse
rMain(content::MainFunctionParams) + 128
60  Electron Framework                  0x0000000114d7f0e8 content::RunBrowserProcessMain(content::MainFunctionParams, content::ContentMainDelegate*) + 280
61  Electron Framework                  0x0000000114d81508 content::ContentMainRunnerImpl::RunBrowser(content::MainFunctionParams, bool) + 1912
62  Electron Framework                  0x0000000114d80d20 content::ContentMainRunnerImpl::Run() + 1424
63  Electron Framework                  0x0000000114d7e720 content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) + 1192
64  Electron Framework                  0x0000000114d7e964 content::ContentMain(content::ContentMainParams) + 112
65  Electron Framework                  0x00000001149a6cb4 ElectronMain + 320
66  dyld                                0x000000018c0d50e0 start + 2360
Crash keys:
  "platform" = "darwin"
  "process_type" = "browser"

Electron exited with signal SIGTRAP.

@cedrikewers
Copy link
Contributor

I have a similar problem when trying to start a utilityProcess. With v28.1.4 everything is fine, but with anything >=v28.2.0 I get this error when i want to start the utilityProcess:

[105456:0227/134920.395:ERROR:crashpad_client_win.cc(867)] not connected

@codebytere
Copy link
Member

codebytere commented Feb 27, 2024

@silyont in the short term - your issue is partially that you're calling utilityProcess.fork before app is ready. It still shouldn't crash, but move it to after that and it works fine for me.

@silyont
Copy link

silyont commented Feb 27, 2024

The document should mention this if it is intended to put utilityProcess.fork after app ready. Anyway thanks for your help 🙏🏻

@codebytere codebytere linked a pull request Feb 27, 2024 that will close this issue
3 tasks
@codebytere
Copy link
Member

@silyont ah, sorry - to clarify: it's not intended, that's just where the bug is. I just opened a draft PR to address the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
28-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants