Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FYI: When using bash for ~/.esvu/bin/v8 v8/d8 continues to run after parent program exits #58

Open
guest271314 opened this issue Jul 17, 2024 · 3 comments · May be fixed by guest271314/esvu#1 or #59

Comments

@guest271314
Copy link

Re

Some binaries may be exposed as batch/shell scripts to properly handling shared library loading.

When we use this

#!/usr/bin/env -S /home/user/.esvu/bin/v8

as a Native Messaging host called by chrome to launch d8, then terminate all instances of chrome, the script will still be running even after the parent program terminates.

When we use this

#!/usr/bin/env -S /home/user/.jsvu/engines/v8/v8

d8 terminates when the parent program, in this case, chrome, closes.

Not sure if this is known or not that using bash here (which is an alias for dash on my machine) causes this behaviour.

#!/usr/bin/env bash
"/home/user/.esvu/engines/v8/d8" --snapshot_blob="/home/user/.esvu/engines/v8/snapshot_blob.bin" "$@"
@devsnek
Copy link
Owner

devsnek commented Jul 17, 2024

@guest271314 I'm not entirely sure what you're trying to do but it sounds like something that exec might fix:

#!/usr/bin/env bash
exec "/home/user/.esvu/engines/v8/d8" --snapshot_blob="/home/user/.esvu/engines/v8/snapshot_blob.bin" "$@"

If you test this and it works for you, please consider opening a PR.

@guest271314
Copy link
Author

Using exec fixes the issue. Where in esvu source code is the v8 shell script generated?

@devsnek
Copy link
Owner

devsnek commented Jul 18, 2024

source = `#!/usr/bin/env bash\n${body} "$@"\n`;

guest271314 added a commit to guest271314/esvu that referenced this issue Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants