I have a fairly simple C++ program which only takes one argument that is a Base64 encoded string. I can call the program.
I am now trying to call this program using Node.js' child_process.spawn(), but it is throwing an "E2BIG" error when I pass in the same Base64 string.
The Base64 string I am testing with is 305016 bytes in length.
Running getconf ARG_MAX on my Linux box returns 2097152.
Why does child_process throw the error?
Try to strace it to see if Node.js is making the system call or not - i.e., check is it an internal Node.js limitation or is it the Linux system which is rejecting it.
The strcpy used by libuv in Node.js can return E2BIG.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With