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

child_process.exec hangs without executing command #27937

Closed
sugarlandsoftware opened this issue May 28, 2019 · 2 comments
Closed

child_process.exec hangs without executing command #27937

sugarlandsoftware opened this issue May 28, 2019 · 2 comments
Labels
invalid Issues and PRs that are invalid.

Comments

@sugarlandsoftware
Copy link

  • Version: v8.10.0
  • Platform: Linux 4.4.0-17763-Microsoft docs: Fix mixed content issues #379-Microsoft Wed Mar 06 19:16:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: child_process.exec
    Software spec:
  1. Windows 10 WSL running Ubuntu 18.04.2 LTS
  2. Apache Server 2.4.29 (Ubuntu)
  3. Xming X Server 6.9.0.31 (Windows 10)
  4. Firefox Quantum 67.0 (64-bit for Ubuntu)
  5. Node.js v8.10.0 for Ubuntu

The attached TestExec.html file runs TestExec.js, which executes TestExec.bash.
The user enters a string, which is written to TestExec.txt by the Bash script.
TestExec.bash is executed via child_process.exec.
TestExec2.js is a modified form of TestExec.js, with no dependencies on the HTML document.
TestExec2.js runs correctly from the command line, "node TestExec2.js".
However, TestExec.js hangs indefinitely, when child_process.exec("bash TestExec.bash arg") is called from Firefox.
(Note that the "puts called" message is never displayed in Firefox, indicating that puts() is never executed from child_process.exec [see TestExec_run.jpg screenshot])
Therefore, child_process.exec works at the command line, but not from Firefox, via the
TestExec.js script.
See 4 attached files:
TestExec html_jpg
TestExec js_jpg
TestExec2 js_jpg
TestExec bash_jpg
TestExec_run

@sugarlandsoftware
Copy link
Author

TestExec_run2

@bnoordhuis
Copy link
Member

However, TestExec.js hangs indefinitely, when child_process.exec("bash TestExec.bash arg") is called from Firefox.

You seem to be confusing Node.js with your browser. They're two completely separate things. child_process is not a thing in browsers, just like document isn't in Node.js.

I'm closing this out as not-a-bug. If you still have questions, please open an issue in the nodejs/help repo.

@bnoordhuis bnoordhuis added the invalid Issues and PRs that are invalid. label May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid.
Projects
None yet
Development

No branches or pull requests

2 participants