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]: Electron 14 crashes (sigtrap) when run ts-jest tests #31032

Closed
3 tasks done
EvgeneOskin opened this issue Sep 21, 2021 · 4 comments
Closed
3 tasks done

[Bug]: Electron 14 crashes (sigtrap) when run ts-jest tests #31032

EvgeneOskin opened this issue Sep 21, 2021 · 4 comments

Comments

@EvgeneOskin
Copy link

Preflight Checklist

Electron Version

14.0.0

What operating system are you using?

macOS

Operating System Version

macOS 11.6, Ubuntu 20.04.3 LTS

What arch are you using?

x64

Last Known Working Electron version

13.1.8, 13.4.0

Expected Behavior

Electron runs Jest without native crashes.

Actual Behavior

Electron crashes (exited with signal SIGTRAP) at a random test-case when we run jest in electron

Testcase Gist URL

No response

Additional Information

Node 16.9.1 and Node v14.17.0 run all test cases without issues. We use several node addons and our custom one. To run it in Node we mocked all node addons with jest mocks. We also have JS test cases for node addons, but we excluded them due to this crash.

The following command causes an exit due to a SIGTRAP. Without --runInBand jest halts.

ELECTRON_RUN_AS_NODE=true ./node_modules/.bin/electron "./node_modules/jest/bin/jest.js" --runInBand

Info about other packages versions:

  • jest 27.0.0
  • ts-jest 27.0.5
  • typescript 4.4.3

The backtrace from lldb:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
  * frame #0: 0x0000000100bfd90d Electron Framework`v8::internal::ConcurrentLookupIterator::TryGetPropertyCell(v8::internal::Isolate*, v8::internal::LocalIsolate*, v8::internal::Handle<v8::internal::JSGlobalObject>, v8::internal::Handle<v8::internal::Name>) + 173
    frame #1: 0x0000000101033e1f Electron Framework`v8::internal::compiler::MapRef::TrySerializePrototype() + 1279
    frame #2: 0x00000001010a2943 Electron Framework`v8::internal::compiler::JSNativeContextSpecialization::ReduceNamedAccess(v8::internal::compiler::Node*, v8::internal::compiler::Node*, v8::internal::compiler::NamedAccessFeedback const&, v8::internal::compiler::AccessMode, v8::internal::compiler::Node*) + 10211
    frame #3: 0x000000010109e294 Electron Framework`v8::internal::compiler::JSNativeContextSpecialization::ReduceJSLoadProperty(v8::internal::compiler::Node*) + 228
    frame #4: 0x00000001043e684a Electron Framework`v8::internal::compiler::Reducer::Reduce(v8::internal::compiler::Node*, v8::internal::compiler::ObserveNodeManager*) + 26
    frame #5: 0x000000010442118d Electron Framework`v8::internal::compiler::Operator::PrintToImpl(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, v8::internal::compiler::Operator::PrintVerbosity) const + 13133
    frame #6: 0x0000000100fe1e3e Electron Framework`v8::internal::compiler::GraphReducer::ReduceNode(v8::internal::compiler::Node*) + 3550
    frame #7: 0x0000000101123731 Electron Framework`v8::internal::compiler::Pipeline::AllocateRegistersForTesting(v8::internal::RegisterConfiguration const*, v8::internal::compiler::InstructionSequence*, bool, bool) + 18945
    frame #8: 0x0000000101118ec4 Electron Framework`v8::internal::compiler::Operator::PrintPropsTo(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const + 13428
    frame #9: 0x0000000101116d42 Electron Framework`v8::internal::compiler::Operator::PrintPropsTo(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const + 4850
    frame #10: 0x00000001011166b9 Electron Framework`v8::internal::compiler::Operator::PrintPropsTo(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const + 3177
    frame #11: 0x000000010096cc51 Electron Framework`v8::internal::OptimizedCompilationJob::PrepareJob(v8::internal::Isolate*) + 65
    frame #12: 0x0000000100973c6c Electron Framework`v8::internal::Compiler::Compile(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Compiler::ClearExceptionFlag, v8::internal::IsCompiledScope*) + 2860
    frame #13: 0x0000000100976928 Electron Framework`v8::internal::Compiler::CompileOptimized(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::ConcurrencyMode, v8::internal::CodeKind) + 72
    frame #14: 0x0000000100d315b5 Electron Framework`v8::internal::RegExp::CompileForTesting(v8::internal::Isolate*, v8::internal::Zone*, v8::internal::RegExpCompileData*, v8::base::Flags<v8::internal::JSRegExp::Flag, int>, v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::String>, bool) + 18117
    frame #15: 0x000000230007cc58
    frame #16: 0x000000230000b8f1
    frame #17: 0x000000230000b700
    frame #18: 0x00000023001f94c6
    frame #19: 0x000000230000b700
    frame #20: 0x000000230000b700
    frame #21: 0x00000023004f3ed6
    frame #22: 0x000000230000b700
    frame #23: 0x00000023006af065
    frame #24: 0x00000023006b911d
    frame #25: 0x000000230000b700
    frame #26: 0x00000023004f5c16
    frame #27: 0x000000230000b700
    frame #28: 0x00000023006af065
    frame #29: 0x00000023006b911d
    frame #30: 0x000000230000b700
    frame #31: 0x00000023004f5c16
    frame #32: 0x000000230000b700
    frame #33: 0x00000023006af065
    frame #34: 0x00000023006b911d
    frame #35: 0x000000230000b700
    frame #36: 0x00000023004f5c16
    frame #37: 0x000000230000b700
    frame #38: 0x00000023006af065
    frame #39: 0x00000023006b911d
    frame #40: 0x000000230000b700
    frame #41: 0x00000023004f5c16
    frame #42: 0x000000230000b700
    frame #43: 0x00000023006af065
    frame #44: 0x00000023006b911d
    frame #45: 0x000000230000b700
    frame #46: 0x00000023004f5c16
    frame #47: 0x000000230000b700
    frame #48: 0x00000023006af065
    frame #49: 0x000000230000b700
    frame #50: 0x000000230000b700
    frame #51: 0x00000023006b917b
    frame #52: 0x000000230000b700
    frame #53: 0x00000023004f5c16
    frame #54: 0x000000230000b700
    frame #55: 0x00000023006af065
    frame #56: 0x000000230000b700
    frame #57: 0x000000230003c5a1
    frame #58: 0x00000023000c59f8
    frame #59: 0x000000230002e3cf
    frame #60: 0x00000023000096c7
    frame #61: 0x00000001009b6d7f Electron Framework`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>*) + 6079
    frame #62: 0x00000001009b7603 Electron Framework`v8::internal::Execution::TryCall(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::Execution::MessageHandling, v8::internal::MaybeHandle<v8::internal::Object>*, bool) + 355
    frame #63: 0x00000001009b76e0 Electron Framework`v8::internal::Execution::TryCall(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::Execution::MessageHandling, v8::internal::MaybeHandle<v8::internal::Object>*, bool) + 576
    frame #64: 0x00000001009d2dad Electron Framework`v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) + 493
    frame #65: 0x00000001036636ea Electron Framework`node::CallbackScope::~CallbackScope() + 1178
    frame #66: 0x0000000103663aac Electron Framework`node::CallbackScope::~CallbackScope() + 2140
    frame #67: 0x0000000103663d66 Electron Framework`node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) + 182
    frame #68: 0x00000001036a91b5 Electron Framework`node::EmitAsyncDestroy(node::Environment*, node::async_context) + 262293
    frame #69: 0x000000010017de94 Electron Framework`uv_check_stop + 212
    frame #70: 0x000000010017825f Electron Framework`uv_run + 335
    frame #71: 0x000000010032cfa1 Electron Framework`ElectronInitializeICUandStartNode + 1715809
    frame #72: 0x000000010018a26d Electron Framework`ElectronInitializeICUandStartNode + 301
    frame #73: 0x000000010000161a Electron`_mh_execute_header + 5658
    frame #74: 0x00007fff2036bf3d libdyld.dylib`start + 1
    frame #75: 0x00007fff2036bf3d libdyld.dylib`start + 1
@EvgeneOskin
Copy link
Author

A similar issue was reported in Jest and was fixed by upgrading node.

@EvgeneOskin
Copy link
Author

The same issue on Electron 14.1.0 and 14.0.2.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Oct 5, 2022
@EvgeneOskin
Copy link
Author

The issue was fixed in electron 17. I forgot to write about it.

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

No branches or pull requests

2 participants