-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
spawnSync()
's maxBuffer
option is not ignored with stdio[3]: 'ignore'
#52338
Comments
IMO the correct behavior is console.log(error) // ENOBUFS
console.log(output[3]) // null instead of console.log(error) // undefined
console.log(output[2]) // null because |
I think there are two separate questions. The first is: should the The second thing is: regardless of what the correct behavior is there, |
I agree with you. I have run the case What steps will reproduce the bug, and it can be reproduced. however, on my computer, import {spawnSync} from 'node:child_process'
let {error, output} = spawnSync('node', ['./print.mjs', '3'], {
maxBuffer: 1,
stdio: ['pipe', 'pipe', 'pipe', 'ignore'],
})
// console.log(error) // ENOBUFS
console.log(output[2].toString()) // Error: EINVAL: invalid argument, write so I believe that for ignored file descriptors, besides |
You're correct. So actually there is no inconsistency with I have opened #52422 to continue the discussion, since this is rather different from what I initially reported. |
Version
v21.7.1
Platform
Linux my-laptop 6.5.0-26-generic #26-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar 5 21:19:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
child_process
What steps will reproduce the bug?
With
print.js
:Then
example.js
:How often does it reproduce? Is there a required condition?
No.
What is the expected behavior? Why is that the expected behavior?
Since
stdio[3]
isignore
, themaxBuffer
option should not apply to it. I.e. theENOBUFS
error should not be present. For example, this is what happens withstdio[2]
.What do you see instead?
The
ENOBUFS
error is present.Additional information
No response
The text was updated successfully, but these errors were encountered: