Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion error thrown in internal/child_process.js on Linux #4205

Closed
Trott opened this issue Dec 8, 2015 · 3 comments
Closed

Assertion error thrown in internal/child_process.js on Linux #4205

Trott opened this issue Dec 8, 2015 · 3 comments
Labels
child_process Issues and PRs related to the child_process subsystem. cluster Issues and PRs related to the cluster subsystem.

Comments

@Trott
Copy link
Member

Trott commented Dec 8, 2015

On Linux using current master, this code:

'use strict';
const common = require('../common');
const net = require('net');
const cluster = require('cluster');
cluster.schedulingPolicy = cluster.SCHED_NONE;

if (cluster.isMaster) {
  var worker1, worker2;

  worker1 = cluster.fork();
  worker1.on('message', common.mustCall(function() {
    worker2 = cluster.fork();
    worker1.disconnect();
    worker2.disconnect();
  }));

  return;
}

var server = net.createServer();

server.listen(common.PORT, function() {
  process.send('listening');
});

...results in this output...

assert.js:90
  throw new assert.AssertionError({
  ^
AssertionError: null == true
    at process.target._send (internal/child_process.js:520:5)
    at process.<anonymous> (internal/child_process.js:486:12)
    at emitTwo (events.js:94:20)
    at process.emit (events.js:174:7)
    at handleMessage (internal/child_process.js:687:10)
    at Pipe.channel.onread (internal/child_process.js:439:11)

(The script still exits with a successful return code so the script above is not sufficient for testing on the Node CI infrastructure.)

@Trott Trott added cluster Issues and PRs related to the cluster subsystem. child_process Issues and PRs related to the child_process subsystem. labels Dec 8, 2015
@cjihrig
Copy link
Contributor

cjihrig commented Dec 8, 2015

Can you put the worker2.disconnect(); inside of a worker2.on('online', ...)

@Trott
Copy link
Member Author

Trott commented Dec 8, 2015

@cjihrig Is the idea to fix an error in the script? The issue is that the error being thrown is an AssertionError, so the script is creating a condition in Node core that the author (who put the assertion there) believed and expected to be impossible to create.

@Trott
Copy link
Member Author

Trott commented Dec 9, 2015

@cjihrig And if you were asking to get troubleshooting info: I made the change you suggest and the AssertionError still gets thrown.

Trott added a commit to Trott/io.js that referenced this issue Dec 24, 2015
It is possible that the internal hnadleMessage() might try to send to
a channel that has been closed. The result can be an AssertionError.
Guard against this.

Fixes: nodejs#4205
@Trott Trott closed this as completed in 57a51a0 Dec 27, 2015
Fishrock123 pushed a commit to Fishrock123/node that referenced this issue Jan 6, 2016
It is possible that the internal hnadleMessage() might try to send to
a channel that has been closed. The result can be an AssertionError.
Guard against this.

Fixes: nodejs#4205
PR-URL: nodejs#4418
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
MylesBorins pushed a commit that referenced this issue Jan 13, 2016
It is possible that the internal hnadleMessage() might try to send to
a channel that has been closed. The result can be an AssertionError.
Guard against this.

Fixes: #4205
PR-URL: #4418
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
MylesBorins pushed a commit that referenced this issue Jan 19, 2016
It is possible that the internal hnadleMessage() might try to send to
a channel that has been closed. The result can be an AssertionError.
Guard against this.

Fixes: #4205
PR-URL: #4418
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
mscdex pushed a commit to mscdex/io.js that referenced this issue Feb 9, 2016
It is possible that the internal hnadleMessage() might try to send to
a channel that has been closed. The result can be an AssertionError.
Guard against this.

Fixes: nodejs#4205
PR-URL: nodejs#4418
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
mscdex pushed a commit that referenced this issue Feb 11, 2016
It is possible that the internal handleMessage() might try to send to
a channel that has been closed. The result can be an AssertionError.
Guard against this.

Fixes: #4205
PR-URL: #5153
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this issue Feb 11, 2016
It is possible that the internal handleMessage() might try to send to
a channel that has been closed. The result can be an AssertionError.
Guard against this.

Fixes: #4205
PR-URL: #5153
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
scovetta pushed a commit to scovetta/node that referenced this issue Apr 2, 2016
It is possible that the internal hnadleMessage() might try to send to
a channel that has been closed. The result can be an AssertionError.
Guard against this.

Fixes: nodejs#4205
PR-URL: nodejs#4418
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
jBarz pushed a commit to ibmruntimes/node that referenced this issue Nov 4, 2016
It is possible that the internal handleMessage() might try to send to
a channel that has been closed. The result can be an AssertionError.
Guard against this.

Fixes: nodejs/node#4205
PR-URL: nodejs/node#5153
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem. cluster Issues and PRs related to the cluster subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants