Repository: node
Issue: Node failed to build locally
Labels: build

### Version

main branch

### Platform

Darwin Yagizs-MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64

### Subsystem

_No response_

### What steps will reproduce the bug?

1. `configure --ninja`
2. `make -j10`

### How often does it reproduce? Is there a required condition?

Everytime.

### What is the expected behavior?

Build successfully

### What do you see instead?

```
➜  node git:(perf/blob) make -j10
ninja -C out/Release
ninja: Entering directory `out/Release'
[1/4] ACTION node: node_mksnapshot_9b7a2d2290b02e76d66661df74749f56
FAILED: gen/node_snapshot.cc
cd ../../; export BUILT_FRAMEWORKS_DIR=/Users/yagiz/Developer/node/out/Release; export BUILT_PRODUCTS_DIR=/Users/yagiz/Developer/node/out/Release; export CONFIGURATION=Release; export EXECUTABLE_NAME=node; export EXECUTABLE_PATH=node; export FULL_PRODUCT_NAME=node; export PRODUCT_NAME=node; export PRODUCT_TYPE=com.apple.product-type.tool; export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk; export SRCROOT=/Users/yagiz/Developer/node/out/Release/../../; export SOURCE_ROOT="${SRCROOT}"; export TARGET_BUILD_DIR=/Users/yagiz/Developer/node/out/Release; export TEMP_DIR="${TMPDIR}"; export XCODE_VERSION_ACTUAL=1400;/Users/yagiz/Developer/node/out/Release/node_mksnapshot /Users/yagiz/Developer/node/out/Release/gen/node_snapshot.cc
global handle not serialized: 0x1d3167f50271: [JS_API_OBJECT_TYPE] in OldSpace
 - map: 0x08188aa7a929 <Map(HOLEY_ELEMENTS)> [FastProperties]
 - prototype: 0x2fb730351879 <Object map = 0x8188aa7a971>
 - elements: 0x20e18df01329 <FixedArray[0]> [HOLEY_ELEMENTS]
 - embedder fields: 2
 - properties: 0x20e18df01329 <FixedArray[0]>
 - All own properties (excluding elements): {}
 - embedder fields = {
    1, aligned pointer: 0x107f4b860
    24576, aligned pointer: 0x600001b2c870
 }



#
# Fatal error in , line 0
# Check failed: handle_checker.CheckGlobalAndEternalHandles().
#
#
#
#FailureMessage Object: 0x16b716528
 1: 0x104bf2660 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/yagiz/Developer/node/out/Release/node_mksnapshot]
 2: 0x10577a8f0 V8_Fatal(char const*, ...) [/Users/yagiz/Developer/node/out/Release/node_mksnapshot]
 3: 0x104fa5cb8 v8::SnapshotCreator::CreateBlob(v8::SnapshotCreator::FunctionCodeHandling) [/Users/yagiz/Developer/node/out/Release/node_mksnapshot]
 4: 0x104c0f700 node::SnapshotBuilder::Generate(node::SnapshotData*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >) [/Users/yagiz/Developer/node/out/Release/node_mksnapshot]
 5: 0x104c10168 node::SnapshotBuilder::Generate(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >) [/Users/yagiz/Developer/node/out/Release/node_mksnapshot]
 6: 0x104aba69c BuildSnapshot(int, char**) [/Users/yagiz/Developer/node/out/Release/node_mksnapshot]
 7: 0x1096dd08c
/bin/sh: line 1: 72367 Trace/BPT trap: 5       /Users/yagiz/Developer/node/out/Release/node_mksnapshot /Users/yagiz/Developer/node/out/Release/gen/node_snapshot.cc
ninja: build stopped: subcommand failed.
make: *** [node] Error 1
```

### Additional information

macOS Monterey 12.6, Apple M1 Max, Arm64 arch.