process.exit() hangs: join of V8 worker parked waiting for main-thread GC
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
Start with src/node_platform.cc and trace WorkerThreadsTaskRunner::Shutdown() alongside the V8 worker’s collection wait described in the thread stacks. Reproduce with the supplied script using node --max-old-space-size=24 exit.mjs, then compare behavior with v24.22.3. Done means process.exit(0) terminates reliably under the reported allocation-heavy workload.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
v26.13.1
Platform
Linux 7.0.0-43-generic #43-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 23 13:25:25 UTC 2026 x86_64
Darwin 27.0.0 arm64 (seen once)
Subsystem
process, src/node_platform.cc
What steps will reproduce the bug?
Allocation-heavy code with fresh hot functions, then process.exit():
import process from "node:process";
const end = Date.now() + 300;
let keep = [];
let n = 0;
while (Date.now() < end) {
const f = new Function("x", `let s = ${n++}; for (let i = 0; i < x; i++) s += i * 3; return [s, "${"y".repeat(64)}"];`);
for (let k = 0; k < 8; k++) keep.push(f(16));
if (keep.length > 1e5) keep = [];
}
process.exit(0);
$ node --max-old-space-size=24 exit.mjs
How often does it reproduce? Is there a required condition?
The script above: rare, hung once on darwin-arm64.
Frequent: a jco-transpiled WASI 0.2 program (jco 1.42.0) that builds 200k
strings and then calls process.exit(0) hangs in 15 of 200 runs (16 in
parallel, 8 cores) on v26.13.1, 0 of 200 on v24.22.3. Each run printed all
of its output first.
What is the expected behavior? Why is that the expected behavior?
process.exit() terminates, as on v24.
What do you see instead?
Deadlock, 0% CPU. process.exit() reaches WorkerThreadsTaskRunner::Shutdown()
and joins the platform workers. One worker is in a concurrent Sparkplug job
whose allocation asked for a GC and is parked in
CollectionBarrier::AwaitCollectionBackground(). Only the main thread can run
that GC, and it is blocked in uv_thread_join().
Thread 1 "node-MainThread":
uv_thread_join
node::WorkerThreadsTaskRunner::Shutdown()
node::NodePlatform::Shutdown()
node::DisposePlatform()
node::DefaultProcessExitHandlerInternal()
node::Environment::Exit()
Thread 3 "node-V8Worker":
absl::CondVar::WaitCommon
v8::internal::CollectionBarrier::AwaitCollectionBackground()
v8::internal::HeapAllocator::CollectGarbageAndRetryAllocation
v8::internal::LocalHeap::AllocateRawWith<1>
v8::internal::FactoryBase<LocalFactory>::NewCode
v8::internal::Factory::CodeBuilder::BuildInternal()
v8::internal::baseline::BaselineCompiler::Build()
v8::internal::baseline::ConcurrentBaselineCompiler::JobDispatcher::Run
node::(anonymous namespace)::PlatformWorkerThread
Same stacks in every hang.
Additional information
Not seen on v24.22.3.
- Ngôn ngữ chính
- JavaScript
- Star
- 124k
- Fork
- 38k
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 266
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nodejs/node
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Maintainer thường phản hồi trong vòng 1 ngày
-
fs: document readStream.start and readStream.endCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởdoc
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
nodejs/node#67848 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
doc: document the Buffer.prototype.*Slice() methodsCó thể đã có người làm @AyushCipher đã nhận hôm nay. Đang mởdoc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
nodejs/node#67847 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`styleText` fast path bypasses `options` and `options.validateStream` validationCó thể đã có người làm @GBra-4-669 đã nhận 8 ngày trước. Đang mởutil
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
riscv64
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nodejs/node#67655 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug triage needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Resource]: PersephoneĐang mởresource-submission validation-passed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
hesreallyhim/awesome-claude-code#3773 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
tabatkins/railroad-diagrams#129 ·
-
web: api() turns a null or object-valued error body into a TypeError or "[object Object]" and loses the statusCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
OCM: shares using the `embedded` protocol are rejected with "Missing sharedSecret in protocol"Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày