Rules_nodejs: Execute Node.js Binary Abort Trap 6

Created on 15 Jun 2020  ยท  15Comments  ยท  Source: bazelbuild/rules_nodejs

๐Ÿž bug report

Description

A clear and concise description of the problem...
I'm in the process of creating a typescript coverage test rule that executes jest on a particular library of files. The execution of the generated shell script is resulting in an error I cannot identify the source of Abort Trap: 6.

Please note I expect there to be failures in compiling the TypeScript. I had gotten this working once or twice. It seems to be a macOS specific issue and works on a Linux server.

๐Ÿ”ฌ Minimal Reproduction

tools/coverage/typescript/coverage.bzl

""" ts_coverage test rule """

# load("@build_bazel_rules_nodejs//:providers.bzl", "JSNamedModuleInfo")
load("//tools:utils.bzl", "get_transitive_files")

def _ts_coverage_test_impl(ctx):
    # Create a script to execute coverage on the source files during the

    # execution phase.
    coverage_bin = ctx.executable._coverage_bin.short_path
    babel_config = ctx.attr._babel_config.files.to_list()[0].short_path
    coverage_config = ctx.attr._coverage_config.files.to_list()[0].short_path
    coverage_filename = ctx.attr._coverage_config.files.to_list()[0].basename

    # generate coverage test script
    script_content = "\n".join([
        "#!/usr/bin/env bash",
        "export PWD=$(pwd)",
        "echo $PWD",
        # Symlink the jest config into the current working directory.
        # Jest needs the test files to be under the same root directory.
        # I'm guessing this is an istanbul thing.
        "ln -s %s ." % (coverage_config),
        "ln -s %s ." % (babel_config),
        # test the srcs have been symlinked into the sandbox.
        "\n".join(["test -f %s || exit" % (src.short_path) for src in ctx.files.srcs]),
        "%s --config ./%s " % (coverage_bin, coverage_filename) +
        " ".join(["--runTestsByPath %s" % (src.short_path) for src in ctx.files.srcs]),
        # this inserts a final newline
        "",
    ])

    script = ctx.actions.declare_file("%s.coverage.sh" % ctx.label.name)
    ctx.actions.write(script, script_content, is_executable = True)

    # Get all transitive dependencies, including data files.
    # Include coverage_bin, coverage_config and babel_config as additional dependencies so that
    # they are included in the runfiles without having to be explicitly listed
    # in the coverage_test() rule invocation.
    transitive_files = get_transitive_files(ctx.attr.deps + ctx.attr.data + [ctx.attr._coverage_bin, ctx.attr._coverage_config, ctx.attr._babel_config] + ctx.attr._default_deps)
    runfiles = ctx.runfiles(files = ctx.files.srcs, transitive_files = transitive_files)
    return [DefaultInfo(executable = script, runfiles = runfiles)]

ts_coverage_test = rule(
    implementation = _ts_coverage_test_impl,
    attrs = {
        "srcs": attr.label_list(allow_files = True),
        "deps": attr.label_list(
            # providers = [JSNamedModuleInfo]
        ),
        "data": attr.label_list(allow_files = True),
        "_coverage_bin": attr.label(
            default = Label("@npm//jest/bin:jest"),
            executable = True,
            cfg = "host",
        ),
        "_coverage_config": attr.label(
            default = Label("//tools/coverage/typescript:jest_config"),
            executable = False,
        ),
        "_babel_config": attr.label(
            default = Label("//tools/coverage/typescript:babel_config"),
            executable = False,
        ),
        "_default_deps": attr.label_list(
            default = [
                "@npm//@babel/plugin-proposal-class-properties",
                "@npm//@bazel/typescript",
                "@npm//@babel/preset-typescript",
                "@npm//@babel/preset-env",
                "@npm//@types/jest",
            ],
        ),
    },
    test = True,
)
tools/coverage/typescript/jest.config.js
module.exports = {
  testEnvironment: 'node',
  coverageThreshold: {
    global: {
      branches: 100,
      functions: 100,
      lines: 100,
      statements: 100,
    },
  },
  clearMocks: true,
  collectCoverageFrom: ['**/*.{js,ts}', '!**/*.test.{js,ts}'],
  resetMocks: true,
  resetModules: true,
  restoreMocks: true,
  verbose: true,
  collectCoverage: true,
};
tools/coverage/typescript/babel.config.js
module.exports = {
  presets: ['@babel/preset-typescript', ['@babel/preset-env']],
  plugins: [['@babel/plugin-proposal-class-properties', { loose: true }]],
};
Invoke the rule
"""."""
load("//tools/coverage/typescript:coverage.bzl", "ts_coverage_test")


ts_coverage_test(
    name = "some random_lib_ts_test",
    srcs = glob(
        ["*.ts"],
    ),
)
## ๐Ÿ”ฅ Exception or Error




โžœ  SomeProject โœ— bzl test //src/common/examples:proxy_lib_ts_test                  
INFO: Analyzed target //src/common/examples:proxy_lib_ts_test (0 packages loaded, 0 targets configured).
INFO: Found 1 test target...
FAIL: //src/common/examples:proxy_lib_ts_test (see /private/var/tmp/_bazel_some_user/38ca9198a898cdc09029e873f8977724/execroot/com_somecompany/bazel-out/darwin-fastbuild/testlogs/src/common/examples/proxy_lib_ts_test/test.log)
INFO: From Testing //src/common/examples:proxy_lib_ts_test:
==================== Test output for //src/common/examples:proxy_lib_ts_test:
/private/var/tmp/_bazel_some_user/38ca9198a898cdc09029e873f8977724/sandbox/darwin-sandbox/41/execroot/com_somecompany/bazel-out/darwin-fastbuild/bin/src/common/examples/proxy_lib_ts_test.coverage.sh.runfiles/com_somecompany
/private/var/tmp/_bazel_some_user/38ca9198a898cdc09029e873f8977724/sandbox/darwin-sandbox/41/execroot/com_somecompany/bazel-out/darwin-fastbuild/bin/src/common/examples/proxy_lib_ts_test.coverage.sh.runfiles/com_somecompany/src/common/examples/proxy_lib_ts_test.coverage.sh: line 9: 74235 Abort trap: 6           ../npm/jest/bin/jest.sh --runTestsByPath src/common/examples/environment.type.ts --runTestsByPath src/common/examples/index.test.ts --runTestsByPath src/common/examples/index.ts
================================================================================
Target //src/common/examples:proxy_lib_ts_test up-to-date:
  bazel-bin/src/common/examples/proxy_lib_ts_test.coverage.sh
INFO: Elapsed time: 6.839s, Critical Path: 6.50s
INFO: 2 processes: 2 darwin-sandbox.
INFO: Build completed, 1 test FAILED, 2 total actions
//src/common/examples:proxy_lib_ts_test                                  FAILED in 1.7s
  /private/var/tmp/_bazel_some_user/38ca9198a898cdc09029e873f8977724/execroot/com_somecompany/bazel-out/darwin-fastbuild/testlogs/src/common/examples/proxy_lib_ts_test/test.log
INFO: Build completed, 1 test FAILED, 2 total actions
## ๐ŸŒ Your Environment **Operating System:**
  
macOS Catalina 10.15.15
  

Output of bazel version:

  
2.2.0
  

Rules_nodejs version:

(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
1.4.1
  

Anything else relevant?

help wanted investigation typescript

All 15 comments

I am getting same Abort trap: 6 error on macOS when running jest via bazel test command

_jest.bzl_

load("@npm//jest-cli:index.bzl", _jest_test = "jest_test")

def jest_test(name, srcs, deps, jest_config, **kwargs):
    "A macro around the autogenerated jest_test rule"
    args = [
        "--no-cache",
        "--no-watchman",
        "--ci",
        "--colors",
    ]
    args.extend(["--config", "$(location %s)" % jest_config])

    for src in srcs:
        args.extend(["--runTestsByPath", "$(locations %s)" % src])

    _jest_test(
        name = name,
        data = [jest_config] + srcs + deps,
        args = args,
        **kwargs
    )

_jest.config.js_

module.exports = {
    /**
     * It's a TypeScript preprocessor with source map support for Jest that lets you use Jest to test projects written in TypeScript
     */
    preset: "ts-jest",

    /**
     * A list of paths to modules that run some code to configure or set up the testing environment
     * Each setupFile will be run once per test file
     */
    setupFiles: ["./src/jest/setup.ts"],

    /**
     * A list of paths to modules that run some code to configure or set up the testing framework
     * before each test file in the suite is executed
     */
    // setupFilesAfterEnv: ["./src/jest/testSetup.ts"],

    /**
     * A map from regular expressions to module names
     */
    moduleNameMapper: {
      "src/(.*)$": "<rootDir>/src/$1",
    },
  };

_BUILD.bazel_

load("//app/frontend:rules/jest.bzl", "jest_test")

jest_test(
    name = "test_unit",
    srcs = [":ts_test_source", "//app/frontend:tsconfig.json"],
    jest_config = "//app/frontend:jest.config.js",
    deps = [
        "@npm//:node_modules"
    ],
)

and from app directory running

bazel test test_unit --test_output=all

I get this error:

(22:47:51) INFO: From Testing //app/frontend:test_unit:
==================== Test output for //app/frontend:test_unit:
ts-jest[config] (WARN) Unable to find the root of the project where ts-jest has been installed.
external/bazel_tools/tools/test/test-setup.sh: line 310:  9706 Abort trap: 6           "${TEST_PATH}" "$@" 2>&1
================================================================================
Target //app/frontend:test_unit up-to-date:
  bazel-bin/app/frontend/test_unit.sh
  bazel-bin/app/frontend/test_unit_loader.js
  bazel-bin/app/frontend/test_unit_require_patch.js
(22:47:51) INFO: Elapsed time: 16.019s, Critical Path: 15.17s
(22:47:51) INFO: 2 processes: 2 darwin-sandbox.
(22:47:51) INFO: Build completed, 1 test FAILED, 2 total actions
//app/frontend:test_unit                                               FAILED in 2.3s

or this error

(23:31:55) INFO: From Testing //app/frontend:test_unit:
==================== Test output for //app/frontend:test_unit:
ts-jest[config] (WARN) Unable to find the root of the project where ts-jest has been installed.
external/bazel_tools/tools/test/test-setup.sh: line 310: 43422 Segmentation fault: 11  "${TEST_PATH}" "$@" 2>&1
================================================================================
Target //app/frontend:test_unit up-to-date:
  bazel-bin/app/frontend/test_unit.sh
  bazel-bin/app/frontend/test_unit_loader.js
  bazel-bin/app/frontend/test_unit_require_patch.js
(23:31:55) INFO: Elapsed time: 16.491s, Critical Path: 15.62s
(23:31:55) INFO: 2 processes: 2 darwin-sandbox.
(23:31:55) INFO: Build completed, 1 test FAILED, 2 total actions
//app/frontend:test_unit                                               FAILED in 2.9s

I am getting this error inconsistently, sometimes it passes tests, sometimes it fails with the above error ^ without any configuration changes.
Any help would be appreciated ๐Ÿ™

Check your jest version. In the example there's a patch required over a certain version.

We also have the same issue.

Check your jest version. In the example there's a patch required over a certain version.

I'm quite sure that the patch is irrelevant to the segfault or sigabrt.

It seems relevant to the interaction between the node and the darwin sandbox, we can consistently reproduce the issue when running the test in the sandbox, but won't trigger the issue if run the test in the standalone mode, --spawn_strategy=standalone.

The most interesting part is that there is no core dump or stack trace from node.

No wonder there is no core dump from node, it's terminated by the OS directly.

Process:               node [96859]
Path:                  /private/var/tmp/*/node
Identifier:            node
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        bash [96824]
Responsible:           iTerm2 [1334]
User ID:               501

Date/Time:             2020-08-24 11:06:45.233 +0800
OS Version:            Mac OS X 10.15.6 (19G73)
Report Version:        12
Bridge OS Version:     3.0 (14Y908)
Anonymous UUID:        84B31A84-5BDF-8B19-0FF9-8897C2A03C54

Sleep/Wake UUID:       1A5E3674-0E6E-47FD-AD8A-4B77CACCBB7A

Time Awake Since Boot: 180000 seconds
Time Since Wake:       27000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
node(96859,0x105cd6dc0) malloc: Incorrect checksum for freed object 0x102b153d8: probably modified after being freed.
Corrupt value: 0x707865


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff6a2b433a __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff6a370e60 pthread_kill + 430
2   libsystem_c.dylib               0x00007fff6a23b808 abort + 120
3   libsystem_malloc.dylib          0x00007fff6a33150b malloc_vreport + 548
4   libsystem_malloc.dylib          0x00007fff6a342d27 malloc_zone_error + 183
5   libsystem_malloc.dylib          0x00007fff6a329081 tiny_free_list_remove_ptr + 690
6   libsystem_malloc.dylib          0x00007fff6a328279 tiny_free_no_lock + 1018
7   libsystem_malloc.dylib          0x00007fff6a327d8b free_tiny + 459
8   node                            0x0000000100892240 uv__free + 27
9   node                            0x0000000100896c58 uv__fs_work + 260
10  node                            0x00000001008991d2 uv_fs_realpath + 191
11  node                            0x000000010008bd0c node::fs::RealPath(v8::FunctionCallbackInfo<v8::Value> const&) + 759
12  node                            0x00000001001e1480 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 544
13  node                            0x00000001001e0a5f v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 543
14  node                            0x00000001001e0160 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 272
15  node                            0x000000010092fcd9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
16  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
17  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
18  node                            0x00000001008a98bc Builtins_ArgumentsAdaptorTrampoline + 188
19  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
20  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
21  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
22  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
23  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
24  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
25  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
26  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
27  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
28  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
29  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
30  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
31  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
32  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
33  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
34  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
35  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
36  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
37  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
38  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
39  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
40  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
41  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
42  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
43  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
44  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
45  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
46  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
47  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
48  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
49  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
50  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
51  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
52  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
53  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
54  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
55  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
56  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
57  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
58  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
59  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
60  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
61  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
62  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
63  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
64  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
65  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
66  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
67  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
68  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
69  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
70  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
71  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
72  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
73  node                            0x00000001008a98bc Builtins_ArgumentsAdaptorTrampoline + 188
74  node                            0x00000001008b0224 Builtins_InterpreterEntryTrampoline + 676
75  node                            0x00000001008da413 Builtins_AsyncFunctionAwaitResolveClosure + 51
76  node                            0x00000001008fecd2 Builtins_PromiseFulfillReactionJob + 50
77  node                            0x00000001008cc846 Builtins_RunMicrotasks + 550
78  node                            0x00000001008ad778 Builtins_JSRunMicrotasksEntry + 120
79  node                            0x0000000100298fd2 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 674
80  node                            0x0000000100299508 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 88
81  node                            0x00000001002995da v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*, v8::internal::MaybeHandle<v8::internal::Object>*) + 74
82  node                            0x00000001002b8d4e v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) + 446
83  node                            0x00000001000018cf node::InternalCallbackScope::Close() + 267
84  node                            0x0000000100001ae6 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) + 317
85  node                            0x0000000100013e54 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) + 132
86  node                            0x0000000100080f30 node::fs::FSReqCallback::Reject(v8::Local<v8::Value>) + 142
87  node                            0x0000000100081381 node::fs::AfterStat(uv_fs_s*) + 72
88  node                            0x0000000100891702 uv__work_done + 178
89  node                            0x0000000100894dea uv__async_io + 334
90  node                            0x00000001008a57a7 uv__io_poll + 1739
91  node                            0x0000000100895276 uv_run + 336
92  node                            0x00000001000b48cc node::NodeMainInstance::Run() + 458
93  node                            0x000000010005b750 node::Start(int, char**) + 294
94  libdyld.dylib                   0x00007fff6a16ccc9 start + 1

Thread 1:
0   libsystem_kernel.dylib          0x00007fff6a2b2766 kevent + 10
1   node                            0x00000001008a542b uv__io_poll + 847
2   node                            0x0000000100895276 uv_run + 336
3   node                            0x00000001000d2faa node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Run() + 292
4   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
5   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 2:
0   libsystem_kernel.dylib          0x00007fff6a2b0882 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff6a371425 _pthread_cond_wait + 698
2   node                            0x00000001008a09d8 uv_cond_wait + 9
3   node                            0x00000001000d30f8 node::TaskQueue<v8::Task>::BlockingPop() + 58
4   node                            0x00000001000d1817 node::(anonymous namespace)::PlatformWorkerThread(void*) + 318
5   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
6   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 3:
0   libsystem_kernel.dylib          0x00007fff6a2b0882 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff6a371425 _pthread_cond_wait + 698
2   node                            0x00000001008a09d8 uv_cond_wait + 9
3   node                            0x00000001000d30f8 node::TaskQueue<v8::Task>::BlockingPop() + 58
4   node                            0x00000001000d1817 node::(anonymous namespace)::PlatformWorkerThread(void*) + 318
5   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
6   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 4:
0   libsystem_kernel.dylib          0x00007fff6a2b0882 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff6a371425 _pthread_cond_wait + 698
2   node                            0x00000001008a09d8 uv_cond_wait + 9
3   node                            0x00000001000d30f8 node::TaskQueue<v8::Task>::BlockingPop() + 58
4   node                            0x00000001000d1817 node::(anonymous namespace)::PlatformWorkerThread(void*) + 318
5   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
6   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 5:
0   libsystem_kernel.dylib          0x00007fff6a2b0882 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff6a371425 _pthread_cond_wait + 698
2   node                            0x00000001008a09d8 uv_cond_wait + 9
3   node                            0x00000001000d30f8 node::TaskQueue<v8::Task>::BlockingPop() + 58
4   node                            0x00000001000d1817 node::(anonymous namespace)::PlatformWorkerThread(void*) + 318
5   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
6   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 6:
0   libsystem_kernel.dylib          0x00007fff6a2ade36 semaphore_wait_trap + 10
1   node                            0x00000001008a0ebd uv_sem_wait + 16
2   node                            0x00000001001126c8 node::inspector::(anonymous namespace)::StartIoThreadMain(void*) + 18
3   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
4   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 7:
0   libsystem_kernel.dylib          0x00007fff6a2b0882 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff6a371425 _pthread_cond_wait + 698
2   node                            0x00000001008a09d8 uv_cond_wait + 9
3   node                            0x00000001008919ad worker + 71
4   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
5   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 8:
0   libsystem_kernel.dylib          0x00007fff6a2b0882 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff6a371425 _pthread_cond_wait + 698
2   node                            0x00000001008a09d8 uv_cond_wait + 9
3   node                            0x00000001008919ad worker + 71
4   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
5   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 9:
0   libsystem_kernel.dylib          0x00007fff6a2b0882 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff6a371425 _pthread_cond_wait + 698
2   node                            0x00000001008a09d8 uv_cond_wait + 9
3   node                            0x00000001008919ad worker + 71
4   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
5   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 10:
0   libsystem_kernel.dylib          0x00007fff6a2b0882 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff6a371425 _pthread_cond_wait + 698
2   node                            0x00000001008a09d8 uv_cond_wait + 9
3   node                            0x00000001008919ad worker + 71
4   libsystem_pthread.dylib         0x00007fff6a371109 _pthread_start + 148
5   libsystem_pthread.dylib         0x00007fff6a36cb8b thread_start + 15

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000105cd6dc0  rcx: 0x00007ffeefbef2c8  rdx: 0x0000000000000000
  rdi: 0x0000000000000307  rsi: 0x0000000000000006  rbp: 0x00007ffeefbef2f0  rsp: 0x00007ffeefbef2c8
   r8: 0x0000000000000000   r9: 0x0000000000000000  r10: 0x0000000105cd6dc0  r11: 0x0000000000000246
  r12: 0x0000000000000307  r13: 0x0000000000000043  r14: 0x0000000000000006  r15: 0x0000000000000016
  rip: 0x00007fff6a2b433a  rfl: 0x0000000000000246  cr2: 0x00007fff908b8e28

Logical CPU:     0
Error Code:      0x02000148
Trap Number:     133


Binary Images:
       0x100000000 -        0x10184dab3 +node (0) <E06D4ECC-C419-3D55-B6DC-B76DA9390B1E> /private/var/tmp/*/node
       0x1028f5000 -        0x1028f8fff +fsevents.node (0) <F057B45F-EFFD-358D-B4D0-EEA322C3E87D> /var/tmp/*/fsevents.node
       0x105c0c000 -        0x105c9df47  dyld (750.6) <34A11073-9E4C-38C3-9293-7D566ABAE8B6> /usr/lib/dyld
    0x7fff2bd05000 -     0x7fff2bd05fff  com.apple.Accelerate (1.11 - Accelerate 1.11) <4F9977AE-DBDB-3A16-A536-AC1F9938DCDD> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
    0x7fff2bd1d000 -     0x7fff2c373fff  com.apple.vImage (8.1 - 524.2.1) <EA6F5FF2-7A1B-35D5-A5A3-D2B3386ECB75> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
    0x7fff2c374000 -     0x7fff2c5dbff7  libBLAS.dylib (1303.60.1) <C6C2D42F-7456-3DBF-8BE2-9AA06EFC78FD> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
    0x7fff2c5dc000 -     0x7fff2caaffef  libBNNS.dylib (144.100.2) <99C61C48-B14C-3DA6-8C31-6BF72DA0A3A9> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib
    0x7fff2cab0000 -     0x7fff2ce4bfff  libLAPACK.dylib (1303.60.1) <5E3E3867-50C3-3E6A-9A2E-007CE77A4641> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
    0x7fff2ce4c000 -     0x7fff2ce61fec  libLinearAlgebra.dylib (1303.60.1) <3D433800-0099-33E0-8C81-15F83247B2C9> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib
    0x7fff2ce62000 -     0x7fff2ce67ff3  libQuadrature.dylib (7) <371F36A7-B12F-363E-8955-F24F7C2048F6> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib
    0x7fff2ce68000 -     0x7fff2ced8fff  libSparse.dylib (103) <B8A10D0C-4577-343D-B310-A3E81265D107> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib
    0x7fff2ced9000 -     0x7fff2ceebfef  libSparseBLAS.dylib (1303.60.1) <B147FEF6-A0DB-3830-BF06-45BEC58DB576> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib
    0x7fff2ceec000 -     0x7fff2d0c3fd7  libvDSP.dylib (735.140.1) <D63DC0A5-B8B4-3562-A574-E73BC3B57407> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
    0x7fff2d0c4000 -     0x7fff2d186fef  libvMisc.dylib (735.140.1) <3601FDE3-B142-398D-987D-8151A51F0A96> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
    0x7fff2d187000 -     0x7fff2d187fff  com.apple.Accelerate.vecLib (3.11 - vecLib 3.11) <F6C5613D-2284-342B-9160-9731F78B4DE5> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
    0x7fff2e8ed000 -     0x7fff2ec7cffa  com.apple.CFNetwork (1128.0.1 - 1128.0.1) <C524C617-2CEF-340C-8CE2-98EAF91CF6A8> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
    0x7fff3007e000 -     0x7fff304fdfeb  com.apple.CoreFoundation (6.9 - 1677.104) <C0D70026-EDBE-3CBD-B317-367CF4F1C92F> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff31466000 -     0x7fff31466fff  com.apple.CoreServices (1069.24 - 1069.24) <AA140158-E909-34C2-B2F5-20EBC93E0056> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x7fff31467000 -     0x7fff314ecfff  com.apple.AE (838.1 - 838.1) <9F7FDA11-AA47-3FF4-80D6-32A5335555DF> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
    0x7fff314ed000 -     0x7fff317ceff7  com.apple.CoreServices.CarbonCore (1217 - 1217) <C1521E48-5E78-364A-8FA6-C4049CA4C66D> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
    0x7fff317cf000 -     0x7fff3181cffd  com.apple.DictionaryServices (1.2 - 323.6) <78832B5D-E126-3E28-89EC-8CA69AC5DD47> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
    0x7fff3181d000 -     0x7fff31825ff7  com.apple.CoreServices.FSEvents (1268.100.1 - 1268.100.1) <29909C83-DF5F-3751-A35B-405860DBA937> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents
    0x7fff31826000 -     0x7fff31a60ff6  com.apple.LaunchServices (1069.24 - 1069.24) <4760C0FA-6EDB-3CE4-AD62-5C4520A7D90B> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
    0x7fff31a61000 -     0x7fff31af9ff1  com.apple.Metadata (10.7.0 - 2076.7) <0973F7E5-D58C-3574-A3CE-4F12CAC2D4C7> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
    0x7fff31afa000 -     0x7fff31b27fff  com.apple.CoreServices.OSServices (1069.24 - 1069.24) <4A42E711-6617-353A-B7DC-3F7AAF815A16> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
    0x7fff31b28000 -     0x7fff31b8ffff  com.apple.SearchKit (1.4.1 - 1.4.1) <757DA392-8E1A-3266-AF15-09B79B036621> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
    0x7fff31b90000 -     0x7fff31bb4ff5  com.apple.coreservices.SharedFileList (131.4 - 131.4) <5F518E73-EA2F-389A-A924-046374F5F15B> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList
    0x7fff323fa000 -     0x7fff32400fff  com.apple.DiskArbitration (2.7 - 2.7) <63923E3F-1489-3762-B5EB-5CE28A35FF50> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    0x7fff3273b000 -     0x7fff32b00fff  com.apple.Foundation (6.9 - 1677.104) <2EF4C4DA-423B-3AFE-ACD1-7DAE64E47603> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff32e74000 -     0x7fff32f18ff3  com.apple.framework.IOKit (2.0.2 - 1726.140.1) <31CA30A9-B32D-37A8-B5C8-20999D5D51BF> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff36a1f000 -     0x7fff36a2bffe  com.apple.NetFS (6.0 - 4.0) <024195B7-00F1-30D3-A407-11DC3E262C05> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
    0x7fff3960e000 -     0x7fff3962afff  com.apple.CFOpenDirectory (10.15 - 220.40.1) <1C7F51F3-43D9-3E4A-93C9-A74C6BCAE2CE> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
    0x7fff3962b000 -     0x7fff39636ffd  com.apple.OpenDirectory (10.15 - 220.40.1) <3BB64E34-C2D9-3172-BBD8-D360FE4B2737> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
    0x7fff3c9d1000 -     0x7fff3cd1aff1  com.apple.security (7.0 - 59306.140.5) <EB9E9E2A-B53B-36EE-B9CE-EEB99B603CB1> /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x7fff3cd1b000 -     0x7fff3cda3ffb  com.apple.securityfoundation (6.0 - 55236.60.1) <407FE3EC-3EC2-31DF-B988-43B13D6D4A75> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
    0x7fff3cdd2000 -     0x7fff3cdd6ff8  com.apple.xpc.ServiceManagement (1.0 - 1) <279E7AA9-B23D-3E32-946B-5559EDC56C86> /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
    0x7fff3da82000 -     0x7fff3dafcff7  com.apple.SystemConfiguration (1.19 - 1.19) <84F9B3BB-F7AF-3B7C-8CD0-D3C22D19619F> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
    0x7fff41a6c000 -     0x7fff41b31fe7  com.apple.APFS (1412.141.1 - 1412.141.1) <C86A3423-E61C-335A-9D17-0B3CE5BB6467> /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS
    0x7fff439bf000 -     0x7fff439cefd7  com.apple.AppleFSCompression (119.100.1 - 1.0) <B0E6D541-1850-384B-B397-CC73503C20B2> /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression
    0x7fff4518f000 -     0x7fff45198ff7  com.apple.coreservices.BackgroundTaskManagement (1.0 - 104) <AED997B4-B67E-3216-AA6D-5BB5216905E6> /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement
    0x7fff47fa0000 -     0x7fff47fb0ff3  com.apple.CoreEmoji (1.0 - 107.1) <7374E3E4-907B-3691-ABAB-F7A27CCCF650> /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji
    0x7fff485f0000 -     0x7fff4865aff0  com.apple.CoreNLP (1.0 - 213) <BD3A01B7-9C7E-3ABF-B0B5-6D1131C95871> /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP
    0x7fff494d5000 -     0x7fff49503ffd  com.apple.CSStore (1069.24 - 1069.24) <ADE95A95-498F-3B41-8377-8B4896265A73> /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore
    0x7fff55777000 -     0x7fff55845ffd  com.apple.LanguageModeling (1.0 - 215.1) <0114A0C7-1FF7-3336-AAC1-A0DECA71CED6> /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling
    0x7fff55846000 -     0x7fff5588efff  com.apple.Lexicon-framework (1.0 - 72) <1A091676-EE6C-3393-B1B5-42A207CF0612> /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon
    0x7fff55895000 -     0x7fff5589aff3  com.apple.LinguisticData (1.0 - 353.18) <3B92F249-4602-325F-984B-D2DE61EEE4E1> /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData
    0x7fff56c03000 -     0x7fff56c4ffff  com.apple.spotlight.metadata.utilities (1.0 - 2076.7) <0237323B-EC78-3FBF-9FC7-5A1FE2B5CE25> /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities
    0x7fff57706000 -     0x7fff57710fff  com.apple.NetAuth (6.2 - 6.2) <E28A8847-C251-3BA6-A2C3-2A4A6B5FA18C> /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
    0x7fff6099c000 -     0x7fff609acff3  com.apple.TCC (1.0 - 1) <FFC71AC3-245B-37B2-A57C-15104BF46743> /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
    0x7fff6408e000 -     0x7fff64090ff3  com.apple.loginsupport (1.0 - 1) <0E8CE493-2629-3F47-8C1A-BFA1C0B8D7EC> /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport
    0x7fff66bae000 -     0x7fff66be2fff  libCRFSuite.dylib (48) <602A4F18-1783-3B69-9DB6-CCBF4703476B> /usr/lib/libCRFSuite.dylib
    0x7fff66be5000 -     0x7fff66beffff  libChineseTokenizer.dylib (34) <3F5BC40A-C2CA-3CBE-9D97-E257DEA6BA63> /usr/lib/libChineseTokenizer.dylib
    0x7fff66c7b000 -     0x7fff66c7dff7  libDiagnosticMessagesClient.dylib (112) <C94F3B7B-1854-38EB-9778-834501C53B3F> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff67151000 -     0x7fff67152fff  libSystem.B.dylib (1281.100.1) <001B3B7F-D02C-31D3-B961-1ED445D5A266> /usr/lib/libSystem.B.dylib
    0x7fff671df000 -     0x7fff671e0fff  libThaiTokenizer.dylib (3) <CDB63DB5-25A3-3DC7-B226-2D9E2D1EB786> /usr/lib/libThaiTokenizer.dylib
    0x7fff671f8000 -     0x7fff6720efff  libapple_nghttp2.dylib (1.39.2) <07FEC48A-87CF-32A3-8194-FA70B361713A> /usr/lib/libapple_nghttp2.dylib
    0x7fff67243000 -     0x7fff672b5ff7  libarchive.2.dylib (72.140.1) <AC311FBA-F2DD-3595-AA76-769F912942B8> /usr/lib/libarchive.2.dylib
    0x7fff67353000 -     0x7fff67353ff3  libauto.dylib (187) <B6124448-7690-34AE-8939-ED84AAC630CE> /usr/lib/libauto.dylib
    0x7fff67419000 -     0x7fff67429ffb  libbsm.0.dylib (60.100.1) <00BFFB9A-2FFE-3C24-896A-251BC61917FD> /usr/lib/libbsm.0.dylib
    0x7fff6742a000 -     0x7fff67436fff  libbz2.1.0.dylib (44) <14CC4988-B6D4-3879-AFC2-9A0DDC6388DE> /usr/lib/libbz2.1.0.dylib
    0x7fff67437000 -     0x7fff67489fff  libc++.1.dylib (902.1) <59A8239F-C28A-3B59-B8FA-11340DC85EDC> /usr/lib/libc++.1.dylib
    0x7fff6748a000 -     0x7fff6749fffb  libc++abi.dylib (902) <E692F14F-C65E-303B-9921-BB7E97D77855> /usr/lib/libc++abi.dylib
    0x7fff674a0000 -     0x7fff674a0fff  libcharset.1.dylib (59) <72447768-9244-39AB-8E79-2FA14EC0AD33> /usr/lib/libcharset.1.dylib
    0x7fff674a1000 -     0x7fff674b2fff  libcmph.dylib (8) <E72A20DB-2E86-378D-A237-EB9A1370F989> /usr/lib/libcmph.dylib
    0x7fff674b3000 -     0x7fff674cafd7  libcompression.dylib (87) <64C91066-586D-38C0-A2F3-3E60A940F859> /usr/lib/libcompression.dylib
    0x7fff677a4000 -     0x7fff677baff7  libcoretls.dylib (167) <770A5B96-936E-34E3-B006-B1CEC299B5A5> /usr/lib/libcoretls.dylib
    0x7fff677bb000 -     0x7fff677bcfff  libcoretls_cfhelpers.dylib (167) <ED52EF99-04FC-3576-9E96-DBA416154838> /usr/lib/libcoretls_cfhelpers.dylib
    0x7fff67ee2000 -     0x7fff67ee2fff  libenergytrace.dylib (21) <162DFCC0-8F48-3DD0-914F-FA8653E27B26> /usr/lib/libenergytrace.dylib
    0x7fff67f09000 -     0x7fff67f0bfff  libfakelink.dylib (149.1) <36146CB2-E6A5-37BB-9EE8-1B4034D8F3AD> /usr/lib/libfakelink.dylib
    0x7fff67f1a000 -     0x7fff67f1ffff  libgermantok.dylib (24) <BFAFD35B-D68C-30BF-80F2-FAEB26FB6A80> /usr/lib/libgermantok.dylib
    0x7fff67f2a000 -     0x7fff6801afff  libiconv.2.dylib (59) <18311A67-E4EF-3CC7-95B3-C0EDEE3A282F> /usr/lib/libiconv.2.dylib
    0x7fff6801b000 -     0x7fff68272fff  libicucore.A.dylib (64260.0.1) <8AC2CB07-E7E0-340D-A849-186FA1F27251> /usr/lib/libicucore.A.dylib
    0x7fff6828c000 -     0x7fff6828dfff  liblangid.dylib (133) <30CFC08C-EF36-3CF5-8AEA-C1CB070306B7> /usr/lib/liblangid.dylib
    0x7fff6828e000 -     0x7fff682a6ff3  liblzma.5.dylib (16) <C131EF18-2CDD-3271-8A30-A8760D4FE166> /usr/lib/liblzma.5.dylib
    0x7fff682be000 -     0x7fff68365ff7  libmecab.dylib (883.11) <2DF2B2E9-438D-326E-89C8-DD5247ABFE08> /usr/lib/libmecab.dylib
    0x7fff68366000 -     0x7fff685c8ff1  libmecabra.dylib (883.11) <787FF18A-7440-3C30-A10C-7A34C63D3080> /usr/lib/libmecabra.dylib
    0x7fff68a94000 -     0x7fff68f10ff5  libnetwork.dylib (1880.120.4) <F2B8AAA5-E093-37F1-885B-EDCD9783F1C0> /usr/lib/libnetwork.dylib
    0x7fff68fb1000 -     0x7fff68fe4fde  libobjc.A.dylib (787.1) <6DF81160-5E7F-3E31-AA1E-C875E3B98AF6> /usr/lib/libobjc.A.dylib
    0x7fff68ff7000 -     0x7fff68ffbfff  libpam.2.dylib (25.100.1) <0502F395-8EE6-3D2A-9239-06FD5622E19E> /usr/lib/libpam.2.dylib
    0x7fff68ffe000 -     0x7fff69034ff7  libpcap.A.dylib (89.120.1) <A748C246-1484-3CBC-94DD-B4C47877AA78> /usr/lib/libpcap.A.dylib
    0x7fff6912c000 -     0x7fff69316ff7  libsqlite3.dylib (308.5) <35A2BD9F-4E33-30DE-A994-4AB585AC3AFE> /usr/lib/libsqlite3.dylib
    0x7fff69567000 -     0x7fff6956affb  libutil.dylib (57) <F01467F6-23A7-37EE-A170-33CE1577B41D> /usr/lib/libutil.dylib
    0x7fff6956b000 -     0x7fff69578ff7  libxar.1.dylib (425.2) <EE964412-9E25-30B3-BCC0-CCEFBCC8094B> /usr/lib/libxar.1.dylib
    0x7fff6957e000 -     0x7fff69660ff7  libxml2.2.dylib (33.4) <EFA77CC6-9139-37B3-98D4-B0E526110EE3> /usr/lib/libxml2.2.dylib
    0x7fff69664000 -     0x7fff6968cfff  libxslt.1.dylib (16.9) <34A45627-DA5B-37D2-9609-65B425E0010A> /usr/lib/libxslt.1.dylib
    0x7fff6968d000 -     0x7fff6969fff3  libz.1.dylib (76) <793D9643-CD83-3AAC-8B96-88D548FAB620> /usr/lib/libz.1.dylib
    0x7fff69f4e000 -     0x7fff69f53ff3  libcache.dylib (83) <5940876E-AC8A-3BE0-80B3-DE3FB14E257A> /usr/lib/system/libcache.dylib
    0x7fff69f54000 -     0x7fff69f5ffff  libcommonCrypto.dylib (60165.120.1) <C095BD55-1D27-337F-9B02-885E1C7FF87A> /usr/lib/system/libcommonCrypto.dylib
    0x7fff69f60000 -     0x7fff69f67fff  libcompiler_rt.dylib (101.2) <6E80AC11-A277-31FA-AEEF-E5A528274C77> /usr/lib/system/libcompiler_rt.dylib
    0x7fff69f68000 -     0x7fff69f71ff7  libcopyfile.dylib (166.40.1) <EB5E0BC8-873D-3546-A40E-C36DC46FA8F6> /usr/lib/system/libcopyfile.dylib
    0x7fff69f72000 -     0x7fff6a004fdb  libcorecrypto.dylib (866.140.1) <0B6C52DB-5A50-3FCD-8B5E-C0C2F35857E3> /usr/lib/system/libcorecrypto.dylib
    0x7fff6a111000 -     0x7fff6a151ff0  libdispatch.dylib (1173.100.2) <EAD535EE-1270-39A9-A254-95CF117FF3B0> /usr/lib/system/libdispatch.dylib
    0x7fff6a152000 -     0x7fff6a188fff  libdyld.dylib (750.6) <24C41E8B-6B33-30C7-94C9-02D2BD051D66> /usr/lib/system/libdyld.dylib
    0x7fff6a189000 -     0x7fff6a189ffb  libkeymgr.dylib (30) <6F582FDB-EB1A-3ED2-A989-B750643E2647> /usr/lib/system/libkeymgr.dylib
    0x7fff6a18a000 -     0x7fff6a196ff3  libkxld.dylib (6153.141.1) <756B1F0D-2E37-31A7-A6F0-2E5C22E62C3D> /usr/lib/system/libkxld.dylib
    0x7fff6a197000 -     0x7fff6a197ff7  liblaunch.dylib (1738.140.1) <AFBCBDD3-0B55-3ECD-8E04-A73A3A57356B> /usr/lib/system/liblaunch.dylib
    0x7fff6a198000 -     0x7fff6a19dff7  libmacho.dylib (959.0.1) <1B0296B5-3FD0-342C-BCC2-9886351A4391> /usr/lib/system/libmacho.dylib
    0x7fff6a19e000 -     0x7fff6a1a0ff3  libquarantine.dylib (110.40.3) <67FE2676-F9E8-3797-AEE5-F5F9D191CFA3> /usr/lib/system/libquarantine.dylib
    0x7fff6a1a1000 -     0x7fff6a1a2ff7  libremovefile.dylib (48) <5CEBDAB2-988A-3B66-87BC-3C45D1C08730> /usr/lib/system/libremovefile.dylib
    0x7fff6a1a3000 -     0x7fff6a1baff3  libsystem_asl.dylib (377.60.2) <7A07FF86-658E-35D7-8136-829737E98B7B> /usr/lib/system/libsystem_asl.dylib
    0x7fff6a1bb000 -     0x7fff6a1bbff7  libsystem_blocks.dylib (74) <0D53847E-AF5F-3ACF-B51F-A15DEA4DEC58> /usr/lib/system/libsystem_blocks.dylib
    0x7fff6a1bc000 -     0x7fff6a243fff  libsystem_c.dylib (1353.100.2) <AF7873B0-AC4A-3C67-89BB-B8DA87718DAE> /usr/lib/system/libsystem_c.dylib
    0x7fff6a244000 -     0x7fff6a247ffb  libsystem_configuration.dylib (1061.141.1) <0EE84C33-64FD-372B-974A-AF7A136F2068> /usr/lib/system/libsystem_configuration.dylib
    0x7fff6a248000 -     0x7fff6a24bfff  libsystem_coreservices.dylib (114) <08B89E9B-C5B2-3E73-8964-03E58692B21F> /usr/lib/system/libsystem_coreservices.dylib
    0x7fff6a24c000 -     0x7fff6a254fff  libsystem_darwin.dylib (1353.100.2) <BD5BAD5B-AC3F-371A-B4FC-ADF86D6DCE51> /usr/lib/system/libsystem_darwin.dylib
    0x7fff6a255000 -     0x7fff6a25cfff  libsystem_dnssd.dylib (1096.100.3) <01E0965B-83E5-356C-AC1F-C723F5AAB483> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff6a25d000 -     0x7fff6a25effb  libsystem_featureflags.dylib (17) <6317641E-B43F-36A3-974E-6073786B94B9> /usr/lib/system/libsystem_featureflags.dylib
    0x7fff6a25f000 -     0x7fff6a2acff7  libsystem_info.dylib (538) <4DD813CB-D7B0-3AB5-9054-D2E4FF7A64B9> /usr/lib/system/libsystem_info.dylib
    0x7fff6a2ad000 -     0x7fff6a2d9ff7  libsystem_kernel.dylib (6153.141.1) <2B6311E6-6240-3EF7-8C87-475B66F7452C> /usr/lib/system/libsystem_kernel.dylib
    0x7fff6a2da000 -     0x7fff6a321fff  libsystem_m.dylib (3178) <77A9D888-36E9-3968-8103-C82FFFC60B9E> /usr/lib/system/libsystem_m.dylib
    0x7fff6a322000 -     0x7fff6a349fff  libsystem_malloc.dylib (283.100.6) <059F4DBD-856A-3A59-8B20-FD4B6918C5F2> /usr/lib/system/libsystem_malloc.dylib
    0x7fff6a34a000 -     0x7fff6a357ffb  libsystem_networkextension.dylib (1095.140.2) <4CCE78C9-1DC4-3375-9828-D5BD739D23F3> /usr/lib/system/libsystem_networkextension.dylib
    0x7fff6a358000 -     0x7fff6a361ff7  libsystem_notify.dylib (241.100.2) <DEAD75F2-DD34-3E8F-82DE-344625A2C25E> /usr/lib/system/libsystem_notify.dylib
    0x7fff6a362000 -     0x7fff6a36afef  libsystem_platform.dylib (220.100.1) <97E825F6-D823-366C-9FF3-B1C8EA891044> /usr/lib/system/libsystem_platform.dylib
    0x7fff6a36b000 -     0x7fff6a375fff  libsystem_pthread.dylib (416.100.3) <80B053AA-B6F7-3B59-BC44-78A5A4F7368F> /usr/lib/system/libsystem_pthread.dylib
    0x7fff6a376000 -     0x7fff6a37aff3  libsystem_sandbox.dylib (1217.140.4) <20BF94E2-DAB8-3EBE-AACE-99DF84C1C391> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff6a37b000 -     0x7fff6a37dfff  libsystem_secinit.dylib (62.100.2) <28EDEB6F-899B-373D-B761-4C20D39285D9> /usr/lib/system/libsystem_secinit.dylib
    0x7fff6a37e000 -     0x7fff6a385ffb  libsystem_symptoms.dylib (1238.120.1) <22800D8C-5C2A-3171-8C29-311BBE67F198> /usr/lib/system/libsystem_symptoms.dylib
    0x7fff6a386000 -     0x7fff6a39cff2  libsystem_trace.dylib (1147.120) <DC00C77E-4709-31F0-B913-CF09559B7A6F> /usr/lib/system/libsystem_trace.dylib
    0x7fff6a39e000 -     0x7fff6a3a3ff7  libunwind.dylib (35.4) <42B7B509-BAFE-365B-893A-72414C92F5BF> /usr/lib/system/libunwind.dylib
    0x7fff6a3a4000 -     0x7fff6a3d9ffe  libxpc.dylib (1738.140.1) <58E276A9-EE11-3F02-9D3E-5371E604E677> /usr/lib/system/libxpc.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 117643165
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=496.4M resident=0K(0%) swapped_out_or_unallocated=496.4M(100%)
Writable regions: Total=207.8M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=207.8M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                    8K        1 
MALLOC                            73.1M       30 
MALLOC guard page                   16K        4 
Memory Tag 255                   182.5M      245 
STACK GUARD                       56.0M       11 
Stack                             80.1M       12 
VM_ALLOCATE                          4K        1 
__DATA                            6849K      123 
__DATA_CONST                        20K        1 
__LINKEDIT                       404.1M        4 
__OBJC_RO                         32.3M        1 
__OBJC_RW                         1908K        2 
__TEXT                            92.4M      121 
__UNICODE                          564K        1 
shared memory                        8K        2 
===========                     =======  ======= 
TOTAL                            929.6M      559 

Based on the libuv's realpath implementation, when running in sandbox, the realpath can easily exceed the max path size on darwin (uv__fs_pathmax_size returns 256) and cause the error.

UPDATE: I can't reproduce this issue in a standalone script, there must be some other factors in play.

static ssize_t uv__fs_realpath(uv_fs_t* req) {
  char* buf;

#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
  buf = realpath(req->path, NULL);
  if (buf == NULL)
    return -1;
#else
  ssize_t len;

  len = uv__fs_pathmax_size(req->path);
  buf = uv__malloc(len + 1);

  if (buf == NULL) {
    errno = ENOMEM;
    return -1;
  }

  if (realpath(req->path, buf) == NULL) {
    uv__free(buf);
    return -1;
  }
#endif

  req->ptr = buf;

  return 0;
}

Ok, finally. Here is the script to reproduce this.

$ node
Welcome to Node.js v12.12.0.
Type ".help" for more information.
> fs.realpathSync.native('/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/node_modules/jest-message-util/node_modules/@babel/highlight/node_modules/escape-string-regexp')
node(93279,0x10aa45dc0) malloc: Incorrect checksum for freed object 0x1049113a8: probably modified after being freed.
Corrupt value: 0x2000000000707865
node(93279,0x10aa45dc0) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6
$ name=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/node_modules/jest-message-util/node_modules/@babel/highlight/node_modules/escape-string-regexp
$ while [[ $name != "/" ]]; do echo "$name=$(realpath $name)"; name=$(dirname $name); done
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/node_modules/jest-message-util/node_modules/@babel/highlight/node_modules/escape-string-regexp=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/bazel-out/darwin-fastbuild/bin/examples/jest_test/adds/ts_default_test.sh.runfiles/npm/node_modules/jest-message-util/node_modules/@babel/highlight/node_modules/escape-string-regexp
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/node_modules/jest-message-util/node_modules/@babel/highlight/node_modules=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/bazel-out/darwin-fastbuild/bin/examples/jest_test/adds/ts_default_test.sh.runfiles/npm/node_modules/jest-message-util/node_modules/@babel/highlight/node_modules
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/node_modules/jest-message-util/node_modules/@babel/highlight=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/bazel-out/darwin-fastbuild/bin/examples/jest_test/adds/ts_default_test.sh.runfiles/npm/node_modules/jest-message-util/node_modules/@babel/highlight
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/node_modules/jest-message-util/node_modules/@babel=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/bazel-out/darwin-fastbuild/bin/examples/jest_test/adds/ts_default_test.sh.runfiles/npm/node_modules/jest-message-util/node_modules/@babel
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/node_modules/jest-message-util/node_modules=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/bazel-out/darwin-fastbuild/bin/examples/jest_test/adds/ts_default_test.sh.runfiles/npm/node_modules/jest-message-util/node_modules
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/node_modules/jest-message-util=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/bazel-out/darwin-fastbuild/bin/examples/jest_test/adds/ts_default_test.sh.runfiles/npm/node_modules/jest-message-util
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/node_modules=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/<redacted>/bazel-out/darwin-fastbuild/bin/examples/jest_test/adds/ts_default_test.sh.runfiles/npm/node_modules
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/j=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot/j
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152/execroot
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox/152
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox/darwin-sandbox
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4/sandbox
/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4=/private/var/tmp/<redacted>/2c310f5e12db7712fb134e7a8589fca4
/private/var/tmp/<redacted>=/private/var/tmp/<redacted>
/private/var/tmp=/private/var/tmp
/private/var=/private/var
/private=/private

The realpath for the module was actual 282 chars long.

Reported to libuv as https://github.com/libuv/libuv/issues/2965 and node as https://github.com/nodejs/node/issues/34900.

Patch for libuv is underway, no idea when it will be backported to nodejs LTS versions.

Wow, nice job digging to the root cause!

node v14.9.0 is out with the patch.

The patch is backported to

  • Node.js v10.22.1 (LTS)
  • Node.js v12.18.4 (LTS)

in https://nodejs.org/en/blog/vulnerability/september-2020-security-releases.

Anything left to do here?

Awesome @ashi009! You really dig into this one ๐Ÿ˜ƒ

@alexeagle it doesn't look like there's anything to do here. I couldn't identify the location of the error so thought it might be a in rules_nodejs or bazel core. Thanks for keeping it open so we could dig in.

Should the default node version be updated? I run into this issue and it took me some time to figure out what was going on.

What about 12.18.4 from 12.13.0?

@vdeantoni It would be nice if you could send a PR for this change. I'm still waiting for my new employer to sign the CLA...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samertm picture samertm  ยท  7Comments

uri-canva picture uri-canva  ยท  7Comments

Jaspaul picture Jaspaul  ยท  7Comments

rzhw picture rzhw  ยท  5Comments

Globegitter picture Globegitter  ยท  5Comments