Skip to content

OOM in test/parallel/test-stream-pipeline #353

Closed
@vweevers

Description

@vweevers

On Windows 10 with node 6.8.0 x64, multiple tests in test/parallel/test-stream-pipeline.js are failing with OOM errors.

> node test\parallel\test-stream-pipeline.js
TAP version 13
ok 1 - sync run
[..]
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

I suspect the failures are related to one another, but I do not fully understand what is happening, so let's start by diving into one of them:

{
var _server = http.createServer(function (req, res) {
var rs = new Readable({
read: function () {
rs.push('hello');
},
destroy: common.mustCall(function (err, cb) {
// prevents fd leaks by destroying http pipelines
cb();
})
});
pipeline(rs, res, function () {});
});
_server.listen(0, function () {
var req = http.request({
port: _server.address().port
});
req.end();
req.on('response', function (res) {
setImmediate(function () {
res.destroy();
_server.close();
});
});
});
}

I think this test goes into an endless loop. The use of setImmediate to destroy the HTTP response, means that read on L186 will be continuously called, tick after tick. But if that's true, why doesn't it happen on other versions/platforms too?

@mcollina any idea?


Because pipeline was introduced in node 10 and the error only occurs on node 6 (I did not yet test versions between 6 and 10), I reckoned readable-stream is the proper repo for this issue - correct me if I'm wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions