Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Problem with worker_threads #775

Closed
pacop opened this issue Oct 2, 2019 · 6 comments
Closed

Problem with worker_threads #775

pacop opened this issue Oct 2, 2019 · 6 comments

Comments

@pacop
Copy link

pacop commented Oct 2, 2019

SO: Windows 7 and Ubuntu 18.04
Node: v12.2.0
Architecture: x86

//package.json
{
  "name": "a",
  "version": "0.1.0",
  "description": "proof",
  "bin": "a.js",
  "license": "UNLICENSED",
  "devDependencies": {
    "pkg": "^4.4.0"
  },
  "pkg": {
    "scripts": ["a.js","b.js"]
  }
}
// a.js
console.log("Starting a");
const {Worker} = require('worker_threads');
new Worker('./b.js');
console.log("Finishing a");
// b.js
console.log("Starting b");
console.log("Finishing b");

Expected result (obtained running node a.js):

Starting a
Finishing a
Starting b
finishing b

Result obtained using executable file generated by pkg:

Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
Finishing a
Starting a
(infinite loop)
#
# Fatal process OOM in insufficient memory to create an Isolate
#
<--- Last few GCs --->
<--- JS stacktrace --->
Segmentation fault
@pacop
Copy link
Author

pacop commented Oct 2, 2019

OS: Windows 7 and Ubuntu 18.04
Node: v10.15.3
Architecture: x86

$ ./a.exe
Starting a
Finishing a
pkg/prelude/bootstrap.js:52
    throw new Error('PKG_DUMMY_ENTRYPOINT EXPECTED');
    ^

Error: PKG_DUMMY_ENTRYPOINT EXPECTED
    at C:\snapshot\prueba\a.js.0 (pkg/prelude/bootstrap.js:52:11)
    at pkg/prelude/bootstrap.js:1516:3
    at readPrelude (internal/bootstrap/node.js:240:16)
    at internal/bootstrap/node.js:245:22
    at internal/bootstrap/node.js:252:8
    at startup (internal/bootstrap/node.js:253:6)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:659:3)

@github-actions
Copy link

github-actions bot commented Apr 1, 2021

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

@github-actions github-actions bot added the Stale label Apr 1, 2021
@pacop
Copy link
Author

pacop commented Apr 2, 2021

The issue still remains unfixed in current version.

@github-actions github-actions bot removed the Stale label Apr 3, 2021
@robertsLando
Copy link
Contributor

@jesec @erossignon thoughts on this?

erossignon added a commit to node-opcua/pkg that referenced this issue Apr 5, 2021
erossignon added a commit to node-opcua/pkg that referenced this issue Apr 5, 2021
erossignon added a commit to node-opcua/pkg that referenced this issue Apr 5, 2021
@erossignon
Copy link
Contributor

For me, it cannot be reproduced with the lastest main branch and may have been fixed somehow already.
@pacop , please challenge the unit test I wrote to help us reproduce.

erossignon added a commit to node-opcua/pkg that referenced this issue Apr 7, 2021
jesec pushed a commit that referenced this issue Apr 7, 2021
@robertsLando
Copy link
Contributor

Dup of #716

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants