Skip to content

HTTP2 module crashes and sometimes segfaults when running tests against it #21416

@aaronjwood

Description

@aaronjwood
  • Version: 10.3.0, 10.4.0, 10.4.1, 10.5.0, 10.6.0
  • Platform: Linux + OSX
  • Subsystem: HTTP2

We're using the http2 module to implement a GRPC proxy that just passes things through. When running tests against our proxy module we hit this crash:

node[466]: ../src/node_http2.cc:781:static int node::http2::Http2Session::OnHeaderCallback(nghttp2_session*, const nghttp2_frame*, nghttp2_rcbuf*, nghttp2_rcbuf*, uint8_t, void*): Assertion `(stream) != (nullptr)' failed.
 1: node::Abort() [node]
 2: 0x876c55 [node]
 3: node::http2::Http2Session::OnHeaderCallback(nghttp2_session*, nghttp2_frame const*, nghttp2_rcbuf*, nghttp2_rcbuf*, unsigned char, void*) [node]
 4: nghttp2_session_mem_recv [node]
 5: node::http2::Http2Session::OnStreamRead(long, uv_buf_t const&) [node]
 6: 0x90a15e [node]
 7: 0x97b349 [node]
 8: 0x97b968 [node]
 9: 0x981848 [node]
10: uv_run [node]
11: node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) [node]
12: node::Start(int, char**) [node]
13: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
14: 0x845c25 [node]
Aborted (core dumped)

and occasionally we hit a bare segfault:

Segmentation fault (core dumped)

The test is being run inside a ubuntu 16.04 container. Some of our tests throw a lot of data at it such as these:

    test("It medium ping 400k msg",  () => {
        // loop polling for service to be ready
        return new Promise((resolve, reject)=> {
            cli.Echo({sequence: 1210, msg: "test".repeat(100000)}, function (err, resp) {
                expect(err).toBe(null);
                expect(resp.status).toBe(0);
                expect(resp.sequence).toBe("1210");
                expect(resp.msg).toBe("test".repeat(100000));
                resolve();
            });
        });
    });
    test("It concurrent ping 10k threads",  () => {
        // loop polling for service to be ready
        let PLIST = []
        // 100 parallel pings
        for (let i = 0; i < 1000; i=i+1) {
            PLIST.push(new Promise((resolve, reject)=> {
                cli.Echo({sequence: i, msg: "test"+(10000 - i)}, function (err, resp) {
                    expect(err).toBe(null);
                    expect(resp.status).toBe(0);
                    expect(resp.sequence).toBe("" + i);
                    expect(resp.msg).toBe("test"+(10000 - i));
                    resolve();
                });
            }))
        }
        return Promise.all(PLIST);
    });
    test("It concurrent ping 100 thread 4k msg",  () => {
        // loop polling for service to be ready
        let PLIST = []
        // 100 parallel pings
        for (let i = 0; i < 100; i=i+1) {
            PLIST.push(new Promise((resolve, reject)=> {
                cli.Echo({sequence: i, msg: "test".repeat(1000)}, function (err, resp) {
                    expect(err).toBe(null);
                    expect(resp.status).toBe(0);
                    expect(resp.sequence).toBe("" + i);
                    expect(resp.msg).toBe("test".repeat(1000));
                    resolve();
                });
            }))
        }
        return Promise.all(PLIST);
    });

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