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

shed more light on process exit 4 #1217

Closed
ozsay opened this issue Jun 8, 2021 · 4 comments
Closed

shed more light on process exit 4 #1217

ozsay opened this issue Jun 8, 2021 · 4 comments
Labels

Comments

@ozsay
Copy link

ozsay commented Jun 8, 2021

We are packing a CLI tool using pkg and we see that on some machines, the binary exits with code 4.

I saw this https://github.com/vercel/pkg/blob/master/prelude/bootstrap.js#L1505

I'm wondering on the possible reasons why it would happen.

we are building the binary on a linux machine (for both linux and macos).

Binary works on the linux machines but fails on some macos machines.

@pojntfx
Copy link

pojntfx commented Jun 8, 2021

Can reproduce this; see #1194 👍

pojntfx@bd5326fa913b:~/Projects/grpc-examples/mather.js/testing$ pkg -t host main.js 
> pkg@5.2.1
pojntfx@bd5326fa913b:~/Projects/grpc-examples/mather.js/testing$ ./main 
pojntfx@bd5326fa913b:~/Projects/grpc-examples/mather.js/testing$ echo $?
4
pojntfx@bd5326fa913b:~/Projects/grpc-examples/mather.js/testing$ export NODE_OPTIONS="--max_old_space_size=4096 --trace-exit"
pojntfx@bd5326fa913b:~/Projects/grpc-examples/mather.js/testing$ ./main 
(node:2980) WARNING: Exited the environment with code 4
    at exit (internal/process/per_thread.js:174:13)
    at _compile (pkg/prelude/bootstrap.js:1682:29)
    at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Module._load (internal/modules/cjs/loader.js:774:14)
    at runMain (pkg/prelude/bootstrap.js:1739:12)
    at internal/main/run_main_module.js:17:47
pojntfx@bd5326fa913b:~/Projects/grpc-examples/mather.js/testing$ export NODE_OPTIONS=--max_old_space_size=4096
pojntfx@bd5326fa913b:~/Projects/grpc-examples/mather.js/testing$ export NODE_OPTIONS=""
pojntfx@bd5326fa913b:~/Projects/grpc-examples/mather.js/testing$ ./main 
Hello, world!

@github-actions
Copy link

github-actions bot commented Sep 7, 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 Sep 7, 2021
@github-actions
Copy link

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.

@gclements-chwy
Copy link

I don't have an exact reason, but I can guess. You are trying to invoke a node instance with a size of max-old-space-size inside a node instance with a size of max-old-space-size and it goes boom.

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

No branches or pull requests

3 participants