Skip to content

Commit

Permalink
test: fix infinite spawn cycle in stdio test
Browse files Browse the repository at this point in the history
Fix parallel/test-stdio-closed introduced in commit b5f25a9 ("src:
ensure that file descriptors 0-2 are valid") to not keep spawning
child processes ad infinitum.

The test spawns itself as a child process but a missing return statement
made the child process spawn itself again, and again, and again.

It went unnoticed for some time because the child process exits almost
immediately afterwards, i.e. it didn't fill up the process table.  The
observable effect was an iojs process that was quietly consuming CPU
cyles in the background with a PID that was constantly changing.

Refs: nodejs#938
PR-URL: nodejs#948
Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
bnoordhuis committed Feb 25, 2015
1 parent 87e4bfd commit 506c7fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/parallel/test-stdio-closed.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if (process.argv[2] === 'child') {
process.exit(42);
});
});
return;
}

// Run the script in a shell but close stdout and stderr.
Expand Down

0 comments on commit 506c7fd

Please sign in to comment.