Open
Description
Version
18.20.1
Platform
a c++ program can run corrcetly by cmd.But when we call this in node spawn with code 3221225477.run program by node child_process.spwan corrcetly,but it broked return 3221225477.
I used windebug to display access violation. Is there any difference between using node to pull up the memory allocation and using cmd to pull it up? Aren't they both independent memory spaces? Why can cmd execute it?
Subsystem
win10
What steps will reproduce the bug?
const { spawn } = require('child_process');
const cppProcess = spawn('./myProgram.exe');
cppProcess.stdout.on('data', (data) => {
console.log(stdout: ${data});
});
cppProcess.stderr.on('data', (data) => {
console.error(stderr: ${data});
});
cppProcess.on('close', (code) => {
if (code !== 0) {
console.error(C++ 程序发生错误,退出码 ${code});
} else {
console.log('C++ 程序正常退出');
}
});
cppProcess.on('error', (err) => {
console.error(启动 C++ 程序时出错: ${err.message});
});
How often does it reproduce? Is there a required condition?
must,but differentcomputer return different condition,it may run correctly
What is the expected behavior? Why is that the expected behavior?
run correctly like cmd way
What do you see instead?
return 3221225477,
mov qword ptr [rdi],rdx ds:00000000`00000000=?????????????????
Additional information
No response