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

execFileSync() causes different behaviour for some software #39354

Open
showengineer opened this issue Jul 11, 2021 · 4 comments
Open

execFileSync() causes different behaviour for some software #39354

showengineer opened this issue Jul 11, 2021 · 4 comments
Labels
child_process Issues and PRs related to the child_process subsystem.

Comments

@showengineer
Copy link

showengineer commented Jul 11, 2021

Version

v14.17.2

Platform

Linux SRV01 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux

Subsystem

child_process

What steps will reproduce the bug?

I'll use an example where this goes wrong.

  1. Compile test.c for your own platform
  2. Create a file, the length doesn't matter.
  3. Run the compiled binary using ./bin the_file with your favorite shell. Observe as it prints the size
  4. Run the compiled binary using child_process.execFileSync("./bin", "the_file");. Observe as it prints the size.

How often does it reproduce? Is there a required condition?

So far only when I run it as a script (node app.js)

What is the expected behavior?

Both output the same length.

What do you see instead?

When executed with execSync, the calculated length is always 0.

Additional information

No response

@Ayase-252 Ayase-252 added the child_process Issues and PRs related to the child_process subsystem. label Jul 13, 2021
@MicroDroid
Copy link

Where can I find test.c?

@showengineer
Copy link
Author

It's a clickable link. But here it is anyways: https://gist.github.com/0x2b00b1e5/367630379248098a8a6ed16226997a51

@MicroDroid
Copy link

Ah, the mobile app did not underline that; Got it 👍

@liuxingbaoyu
Copy link
Contributor

Have you tried using absolute paths?

child_process.execFileSync("./bin", "path/path/the_file");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem.
Projects
None yet
Development

No branches or pull requests

4 participants