[quic] ngx_quic_input_handler Segmentation fault because c->udp->dgram is null

Vladimir Homutov vl at nginx.com
Fri Jan 28 08:58:39 UTC 2022

On Fri, Jan 28, 2022 at 03:29:06AM +0000, Gao,Yan(媒体云) wrote:
> > first time you get there with main nginx connection, when a first QUIC
> > packet arrives. Thus test c->quic. and if it is NULL it means we need
> > to create main quic connection and proceed with the handshake.
> > When the handshake is complete, a stream will be created, and the
> > ngx_quic_init_stream_handler() will be called which will invoke
> > listening handler, and we will return into ngx_http_v3_init() with
> > stream connection that has c->quic set and follow the other path.
> Yes, I understand. But what you said, as stream connection that has c->quic set, when main nginx connection c->quic set?
> ngx_ssl_shutdown and ngx_http_v3_init check c->quic == NULL, but it is never set.
> No problem?

c->quic is never set on main connection (it is not really needed there).
ngx_http_v3_init() is first called with main connection, and later it is
called with _another_ connection that is a stream, and it has c->quic set.

ngx_ssl_shutdown() is not supposed to do something on stream
connections, ssl object is shared with main connection. all necessary
cleanup will be done by main connection handlers.

More information about the nginx-devel mailing list