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

Core dumped when creating tls.TLSSocket #14407

Closed
cravler opened this issue Jul 21, 2017 · 0 comments
Closed

Core dumped when creating tls.TLSSocket #14407

cravler opened this issue Jul 21, 2017 · 0 comments
Labels
http Issues or PRs related to the http subsystem. tls Issues and PRs related to the tls subsystem.

Comments

@cravler
Copy link

cravler commented Jul 21, 2017

  • Version: 8.2.0
  • Platform: Ubuntu 16.04 LTS 64-bit / Docker image

Script:

var fs = require('fs');
var tls = require('tls');
var net = require('net');
var http = require('http');

if ('server' == process.argv[2]) {

    var httpServer = http.createServer(function(request, response) {
        response.end('Waiting for a client');
    });

    httpServer.on('upgrade', function(request, socket, head) {
        socket.write(
            'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' +
            'Upgrade: websocket\r\n' +
            'Connection: Upgrade\r\n' +
            '\r\n'
        );

        new tls.TLSSocket(socket);

        console.log('>>> OK <<<');
    });

    var server = net.createServer();
    server.on('connection', function (connection) {
        httpServer.emit('connection', connection);
    });
    server.listen('5000');

} else {

    var request = http.request({
        host: 'localhost',
        port: '5000',
        headers: {
            'Connection': 'Upgrade',
            'Upgrade': 'websocket'
        }
    });
    request.end();

}

Core Dump:

/usr/local/bin/node[7]: ../src/stream_base.h:233:void node::StreamBase::Consume(): Assertion `(consumed_) == (false)' failed.
 1: node::Abort() [node]
 2: node::Assert(char const* const (*) [4]) [node]
 3: 0x14124d5 [node]
 4: node::TLSWrap::Wrap(v8::FunctionCallbackInfo<v8::Value> const&) [node]
 5: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [node]
 6: 0xb44b48 [node]
 7: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 8: 0x13cd803040bd
Aborted (core dumped)
@mscdex mscdex added tls Issues and PRs related to the tls subsystem. v8.x labels Jul 21, 2017
@addaleax addaleax added http Issues or PRs related to the http subsystem. and removed v8.x labels Jul 21, 2017
addaleax added a commit to addaleax/node that referenced this issue Jul 21, 2017
Reset the underlying socket of an HTTP stream to be marked as
unconsume after the HTTP parser no longer owns it.

Fixes: nodejs#14407
addaleax added a commit that referenced this issue Jul 27, 2017
Reset the underlying socket of an HTTP stream to be marked as
unconsume after the HTTP parser no longer owns it.

Fixes: #14407
PR-URL: #14410
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
MylesBorins pushed a commit that referenced this issue Sep 19, 2017
Reset the underlying socket of an HTTP stream to be marked as
unconsume after the HTTP parser no longer owns it.

Fixes: #14407
PR-URL: #14410
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants