Hi,
I have a simple node script that uses exec to run node scripts.
After adding process.exit(1) calls to the child, its console.error
output sometimes goes missing.
That "sometimes" part is a bit vague for a bug report, so I'd
like to know whether this rings a bell for anyone here?
Since stderr output tends to be synchronous, this isn't expected
behaviour for me, but perhaps I'm missing something.
The code appended below seems to reproduce the issue
most of the time (though the bug seems very brittle against
code changes). Note that all of process.exit(1) in the child and
the indirection of calling the child via exec, and the child being
a node script seem necessary to trigger this behaviour:
$ node --version
v0.6.19
$ node missing-stderr-output.js child
stderr
$ node missing-stderr-output.js
{ [Error: Command failed: ] killed: false, code: 1, signal: null }
$ node missing-stderr-output.js simple
{ [Error: Command failed: cat: nothing: No such file or directory
] killed: false, code: 1, signal: null }
cat: nothing: No such file or directory
Uncommenting the console.log line sometimes outputs both
stdout and stderr, sometimes still none.
All of this is on windows, in an msys shell.
Claus
--
http://clausreinke.github.com/
// -------------------------------- missing-stderr-output.js
function has(arg) { return (process.argv.indexOf(arg)>-1) }
if (has('child')) {
// console.log('stdout');
console.error('stderr');
process.exit(1);
} else {
var cmd = has('simple')
? 'cat nothing'
: 'node missing-stderr-output.js child';
require('child_process').exec(cmd
,function(e,so,se){
console.log(e);
console.log(so);
console.log(se);
})
}
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en