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

Vladimir Homutov vl at nginx.com
Wed Jan 26 12:14:37 UTC 2022


On Wed, Jan 26, 2022 at 10:00:06AM +0000, Gao,Yan(媒体云) wrote:
> > the case you are describing is not what see in backtrace. And in
> > described case connection is main quic connection which has process
> > c->quic pointer set.
>
> I only find sc->quic = qs; in ngx_quic_create_stream,and this is stream connection, not the main quic connection.
> How the main quic connection c->quic set?

The main quic connection is created in ngx_quic_new_connection(), which
calls ngx_quic_open_sockets() and it sets c->udp for the first time.

When packet arrives, c->udp is updated by ngx_lookup_udp_connection().

The main connection does not have c->quic set; this is used in stream
connections. To access main connection from quic stream, c->quic->parent
may be used.

>
> And the local code at this position:
> changeset:   8813:c37ea624c307
> branch:      quic
> tag:         tip
> user:        Roman Arutyunyan <arut at nginx.com>
> date:        Fri Jan 21 11:20:18 2022 +0300
> summary:     QUIC: changed debug message.

can you confirm that the problem occured using this code and no other
patches? In any case, it would be useful to enable debug and get
debug log or at least reproduce on a binary without optimization to get
meaninigful backtrace.



More information about the nginx-devel mailing list