-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Strange exit after updated to node 8.0.0 #13325
Comments
Any chance you could provide a core dump, or code to reproduce? |
right now not... not so easy but will try in a couple of hours |
Ok seems I have a core dump 1.49 GB and 264 MB zipped |
Wherever you want – if you don’t want to share it with everyone (i.e. because your program contains non-public code or data), you can also send it or a link to it to my email address that’s listed in the readme (I’ll take a look at that in a few hours then). |
Thanks a lot... I've sent you an email. |
Hmm … maybe somebody from @nodejs/platform-macos would be able to take a look, too? Right now I don’t have the tooling to deal with macos core dumps beyond pretty trivial things. A full disassembly of the 8.0.0 macos executable might be helpful as well; the stack trace as it is shown in the original issue should not really be possible, because I don’t see any way for |
@adrai Where did you install your node binary from? |
I have got the coredump from @addaleax (who got this from @adrai) and opened it. I am not familiar with the async hooks enough to know why the assertion failed but there could be an overflow which caused See the stacktrace
|
@joyeecheung If you're feeling adventurous give https://github.com/nodejs/llnode a try:
|
@bnoordhuis Yeah I've been using it, frame |
Thanks, now we now it's the second argument on this line: https://github.com/nodejs/node/blob/v8.0.0/lib/internal/process/next_tick.js#L145 cc @AndreasMadsen @trevnorris (we don't have a async-hooks group yet, right?) |
@adrai could I get you to add this code to the beginning of your script (perhaps using the const async_hooks = require('async_hooks');
async_hooks.createHook({
init(id, type, triggerId, resource) {
if (triggerId < 0) {
process._rawDebug('init', {id, type, triggerId});
Error.stackTraceLimit = Infinity;
throw new Error('bad trigger id');
}
}
}).enable(); |
@AndreasMadsen Good idea. I would also turn the |
@addaleax Sure. const async_hooks = require('async_hooks');
async_hooks.createHook({
init(id, type, triggerId, resource) {
if (triggerId < 0 || id < 0) {
process._rawDebug('init', {id, type, triggerId});
Error.stackTraceLimit = Infinity;
throw new Error('bad trigger id');
}
}
}).enable(); |
I run to my notebook... :-) |
Is this ok?
|
@adrai Yes, I think so, but unfortunately the stack trace is truncated – if you set |
|
I can reproduce it like this: const restify = require('restify');
const jsonTargetClient = restify.createJSONClient({
url: 'http://localhost:4999',
version: '*'
});
jsonTargetClient.basicAuth('wrong', 'creds');
setInterval(() => {
console.log('send the request...');
jsonTargetClient.post({
path: '/the/path'
}, { a: 'bit of data' }, (err) => {
console.log('responded...');
console.error(err);
});
}, 1000); the output is: send the request...
responded...
{ UnauthorizedError
at ClientRequest.onResponse (/Users/adrai/Projects/iot-cloud/service-out/node_modules/restify/lib/clients/http_client.js:169:26)
at Object.onceWrapper (events.js:312:19)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:563:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
at Socket.socketOnData (_http_client.js:452:20)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at addChunk (_stream_readable.js:250:12)
at readableAddChunk (_stream_readable.js:237:11)
at Socket.Readable.push (_stream_readable.js:195:10)
at TCP.onread (net.js:586:20)
jse_shortmsg: '',
jse_info: {},
message: 'Unauthorized',
statusCode: 401,
body: {} }
send the request...
async_hooks.js:322
throw new RangeError('triggerId must be an unsigned integer');
^
RangeError: triggerId must be an unsigned integer
at emitInitS (async_hooks.js:322:11)
at setupInit (internal/process/next_tick.js:225:7)
at internalNextTick (internal/process/next_tick.js:269:5)
at ClientRequest._writeRaw (_http_outgoing.js:279:9)
at ClientRequest._send (_http_outgoing.js:255:15)
at ClientRequest.end (_http_outgoing.js:780:16)
at /Users/adrai/Projects/iot-cloud/service-out/node_modules/restify/lib/clients/string_client.js:108:17
at f (/Users/adrai/Projects/iot-cloud/service-out/node_modules/once/once.js:25:25)
at FunctionCall.doCallback_ (/Users/adrai/Projects/iot-cloud/service-out/node_modules/backoff/lib/function_call.js:162:20)
at FunctionCall.handleFunctionCallback_ (/Users/adrai/Projects/iot-cloud/service-out/node_modules/backoff/lib/function_call.js:181:14)
at f (/Users/adrai/Projects/iot-cloud/service-out/node_modules/once/once.js:25:25)
at ClientRequest.onSocket (/Users/adrai/Projects/iot-cloud/service-out/node_modules/restify/lib/clients/http_client.js:225:13)
at Object.onceWrapper (events.js:312:19)
at emitOne (events.js:120:20)
at ClientRequest.emit (events.js:210:7)
at tickOnSocket (_http_client.js:666:7)
at onSocketNT (_http_client.js:682:5)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9) Perhaps @retrohacker has an idea? |
With the following script: const http = require('http');
const restify = require('restify');
const stringClient = restify.createStringClient({
url: 'http://localhost:4999',
version: '*'
});
http.createServer(function (req, res) {
res.writeHead(401, {'Content-Type': 'text/plain'});
res.end('error');
}).listen(4999, function () {
setInterval(() => {
console.log('send the request...');
stringClient.post({
path: '/the/path'
}, 'data', () => {
console.log('responded...');
});
}, 100);
}); I can reproduce the crash with Node 8.0.0 but NOT with |
correlated with #13237 ? |
Weird: I am unable to reproduce with a fresh build of |
I can reproduce this, too (only on 8.0.0 as well, not master).
I don’t think so – that should be fixed in 8.0.0, and only affects you if you use async_hooks actively. |
Hmmm, the binary on nodejs.org aborts for me but a custom build of |
This still is an issue on So, as far as I can tell, the problem |
I hope there is someone who knows what would be the best for everyone... |
We had a suspicion this could happen with a custom |
@refack Sorry, my initial comment above was wrong, this is about not using a custom |
So I see a race on the kept alive socket between The Socket does not pass through the constructor to reset it's Somewhere we need to do another |
Under very specific circumstances the `http` implementation could be brought to crash, because the Agent did not re-assign the async id field properly after setting up a socket for reuse. Fixes: nodejs#13325
Any update? ETA on next 8.x release ;-) |
@adrai The fix should be ready to be merged tomorrow (we have a minimum waiting time for that kind of thing), and I think we’re planning for a release next week to fix up some things after the 8.0.0 release. |
thx a lot I use node.js since early 0.4 versions (I think 2011) but I'm always surprised by the awesome node.js community! |
Under very specific circumstances the `http` implementation could be brought to crash, because the Agent did not re-assign the async id field properly after setting up a socket for reuse. Fixes: #13325 PR-URL: #13348 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Note this fix did not fix the issue in Haraka (which isn't using http). |
@baudehlo can you open an issue and show us the error? (also if it appears to be exactly the same.) Since you are not using |
Will do. |
@AndreasMadsen - I am running into this in my backend servers on all 8.x versions to included 8.1.4.
Core dump available in s3 bucket |
@d3viant0ne please open a new issue. It is the same assert but most likely a different issue. |
No problem, thanks :) |
Updating to Node v9.4 seems to have solved my problem. |
Right now I don't know exactly what is causing the problem.... (I guess posting a http request to some endpoints)
The process exits with this:
Any guess?
The text was updated successfully, but these errors were encountered: