Skip to content

Segmentation fault on worker exit #63540

Description

@mohd-akram

Version

v26.2.0

Platform

Darwin Mohameds-Mini.lan 25.5.0 Darwin Kernel Version 25.5.0: Mon Apr 27 20:41:26 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T8132 arm64

Subsystem

No response

What steps will reproduce the bug?

package.json:

{
"type": "module",
"dependencies": {
"better-sqlite3": "12.10.0",
"typeorm": "1.0.0"
}
}

main.js:

import{Worker}from"worker_threads";constworker=newWorker("./job.js",{});

job.js:

import{isMainThread}from"worker_threads";import{DataSource}from"typeorm";asyncfunctionmain(){constds=awaitnewDataSource({type: "better-sqlite3",database: 'test.db',}).initialize();thrownewError("test failure");}if(!isMainThread)awaitmain();

Run node main.js

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

Every time.

What is the expected behavior? Why is that the expected behavior?

Does not crash with segmentation fault.

What do you see instead?

Segmentation fault.

Additional information

Thread 7 Crashed:: WorkerThread
0 ??? 0x1272b6e88 ???
1 node 0x102675db4 v8::internal::GlobalHandles::InvokeFirstPassWeakCallbacks() + 376
2 node 0x1026e8538 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) + 820
3 node 0x1026f4bd8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck, v8::internal::PerformIneffectiveMarkCompactCheck)::$_1::operator()() const + 512
4 node 0x1026f49c0 void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck, v8::internal::PerformIneffectiveMarkCompactCheck)::$_1>(heap::base::Stack*, void*, void const*) + 40
5 node 0x102efa7a0 PushAllRegistersAndIterateStack + 40
6 node 0x1026e5970 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck, v8::internal::PerformIneffectiveMarkCompactCheck) + 400
7 node 0x1026a0ea0 v8::internal::CppHeap::StartDetachingIsolate() + 76
8 node 0x1026f00d8 v8::internal::Heap::StartTearDown() + 32
9 node 0x102649110 v8::internal::Isolate::Deinit() + 168
10 node 0x102648f88 v8::internal::Isolate::Deinitialize(v8::internal::Isolate*) + 100
11 node 0x1023be838 node::MultiIsolatePlatform::DisposeIsolate(v8::Isolate*) + 28
12 node 0x10242a83c node::worker::WorkerThreadData::~WorkerThreadData() + 208
13 node 0x1024277ac node::worker::Worker::Run() + 736
14 node 0x10242ab98 node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_0::__invoke(void*) + 80
15 libsystem_pthread.dylib 0x185225c58 _pthread_start + 136
16 libsystem_pthread.dylib 0x185220c1c thread_start + 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions