Skip to content

Hard exception when destroying a HTTP/2 stream on aborted event #35306

@szmarczak

Description

@szmarczak
  • Version: 12.18.4, 10.22.1
  • Platform: Linux solus 5.6.19-158.current #1 SMP PREEMPT Sun Jul 26 14:17:01 UTC 2020 x86_64 GNU/Linux
  • Subsystem: http2

What steps will reproduce the bug?

const http2 = require('http2');

const server = http2.createServer((request, response) => {
    response.destroy();
});

server.listen(() => {
    const session = http2.connect(`http://localhost:${server.address().port}`);
    const request = session.request({
        ':method': 'POST'
    });
    
    request.once('aborted', () => {
        request.destroy();
    });
    
    setTimeout(() => {
        server.close();
    }, 100);
});

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

What do you see instead?

internal/http2/core.js:522
    if (stream[kSession][kType] === NGHTTP2_SESSION_SERVER &&
                        ^

TypeError: Cannot read property 'Symbol(type)' of undefined
    at Http2Stream.onStreamClose (internal/http2/core.js:522:25)

Additional information

This is fixed on Node.js 14.

Metadata

Metadata

Assignees

No one assigned

    Labels

    http2Issues or PRs related to the http2 subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions