You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
process.stdout may memleak if write file failed. #47948
docker run --tmpfs /run:rw,noexec,nosuid,size=1024k --entrypoint bash -ti --rm node:20-buster
Create a file named test.js.
// test.jsconstutil=require('util');constfs=require('fs');constcrypto=require('crypto');(async()=>{while(true){try{constcontent=util.format('%s%s\n',newDate(),crypto.randomBytes(1024*100).toString('hex'));process.stdout.write(content,err=>{if(err){console.error(err);}});}catch(e){// will print // write error: Error: ENOSPC: no space left on device, writeconsole.error('write error: ',e);}awaitnewPromise((resolve)=>{setTimeout(resolve,100);});}})();
Run it and rotate stdout to a file in the tmpfs.
node test.js > /run/test.log
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
Activity
[-]processs.stdout may memleak if write file failed.[/-][+]process.stdout may memleak if write file failed.[/+]fs: call the callback with an error if writeSync fails
fs: call the callback with an error if writeSync fails
fs: call the callback with an error if writeSync fails
fs: call the callback with an error if writeSync fails
fs: call the callback with an error if writeSync fails
fs: call the callback with an error if writeSync fails