Skip to content

Core dumped when creating tls.TLSSocket #14407

Closed
@cravler

Description

@cravler
  • 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.tlsIssues and PRs related to the tls subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions