-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.lib / srcIssues and PRs related to general changes in the lib or src directory.Issues and PRs related to general changes in the lib or src directory.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.
Description
- Version: v11.0.0
- Platform: all
- Subsystem:
worker, process, src
Sample test case to reproduce the issue:
'use strict'
const { Worker, isMainThread, parentPort } = require('worker_threads')
if (isMainThread) {
const count = process.argv[2] / 1
for(var i=0;i<count;i++)
new Worker(__filename)
process.exit(0)
} else {
setInterval(() => {
parentPort.postMessage('Hello, world!')
}, 1)
}
The flakiness of the test is largely influenced by the thread scheduling order / number of CPUs / load on the system.
First reported in AIX and Linux through sequential/test-cli-syntax.js
. The more you run, the more variety of scenarios you get: SIGSEGV, SIGABRT, SIGILL... depends on at what point the main and the worker threads are.
The root cause is that there is no specified order / identified ownership of C++ global objects that being destructed between threads.
Refs: #24403
gsbelarus
Metadata
Metadata
Assignees
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.lib / srcIssues and PRs related to general changes in the lib or src directory.Issues and PRs related to general changes in the lib or src directory.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.