<div dir="ltr">Thanks.<br>I ended up using valgrind and got much closer to the answer.<br>Arguments I used:<br><code class="gmail-c-mrkdwn__code" style="box-sizing:inherit;color:rgb(232,145,45);font-variant-ligatures:none;word-break:normal;border-radius:3px;padding:2px 3px 1px;font-size:12px;line-height:1.50001;font-family:Monaco,Menlo,Consolas,"Courier New",monospace">valgrind --leak-check=full --show-leak-kinds=all --trace-children=yes --track-origins=yes --verbose --log-file=valgrind-output.txt /root/nginx/objs/nginx -c /etc/nginx/nginx.conf
</code><br>That led me to find that the HTTP and QUIC requests somehow end upsing the same pointer to http_connection_t, which seems obviously wrong.<br> <br>#0 ngx_SSL_early_cb_fn (s=0x55ae3ad5cae0, al=0x7fff1cf4c8f4, arg=0x7f3417bf4b00) at src/event/ngx_event_openssl.c:1949<br>#1 0x00007f3578bc2eba in ?? () from /lib/x86_64-linux-gnu/libssl.so.3<br>#2 0x00007f3578bb4b8c in ?? () from /lib/x86_64-linux-gnu/libssl.so.3<br>#3 0x00007f3578bb6608 in ?? () from /lib/x86_64-linux-gnu/libssl.so.3<br>#4 0x00007f3578b89d42 in SSL_read_early_data () from /lib/x86_64-linux-gnu/libssl.so.3<br><b>#5 0x000055ae379f85cb in ngx_ssl_try_early_data (c=0x7f3417bf4b00) at src/event/ngx_event_openssl.c:2229<br></b>#6 0x000055ae379f7f6f in ngx_ssl_handshake (c=0x7f3417bf4b00) at src/event/ngx_event_openssl.c:1998<br>#7 0x000055ae37a3f01d in ngx_http_ssl_handshake (rev=0x7f34175f33d0) at src/http/ngx_http_request.c:785<br>#8 0x000055ae379f0cca in ngx_epoll_process_events (cycle=0x55ae39d80390, timer=3101, flags=1) at src/event/modules/ngx_epoll_module.c:901<br>#9 0x000055ae379daacb in ngx_process_events_and_timers (cycle=0x55ae39d80390) at src/event/ngx_event.c:251<br>#10 0x000055ae379ed424 in ngx_worker_process_cycle (cycle=0x55ae39d80390, data=0x0) at src/os/unix/ngx_process_cycle.c:936<br>#11 0x000055ae379e8c49 in ngx_spawn_process (cycle=0x55ae39d80390, proc=0x55ae379ed2c3 <ngx_worker_process_cycle>, data=0x0, <br> name=0x55ae37fa1cc5 "worker process", respawn=-3) at src/os/unix/ngx_process.c:209<br>#12 0x000055ae379ebf69 in ngx_start_worker_processes (cycle=0x55ae39d80390, n=1, type=-3) at src/os/unix/ngx_process_cycle.c:525<br>#13 0x000055ae379eb480 in ngx_master_process_cycle (cycle=0x55ae39d80390) at src/os/unix/ngx_process_cycle.c:279<br>#14 0x000055ae3799d8d1 in main (argc=3, argv=0x7fff1cf4e498) at src/core/nginx.c:489<br>(gdb) continue<br>Continuing.<br><br>Breakpoint 1, ngx_SSL_early_cb_fn (s=0x55ae3ad5cae0, al=0x7fff1cf4d214, arg=0x7f3417bf4b00) at src/event/ngx_event_openssl.c:1949<br>1949 ngx_SSL_early_cb_fn(SSL *s, int *al, void *arg) {<br>#0 ngx_SSL_early_cb_fn (s=0x55ae3ad5cae0, al=0x7fff1cf4d214, arg=0x7f3417bf4b00) at src/event/ngx_event_openssl.c:1949<br>#1 0x00007f3578bc2eba in ?? () from /lib/x86_64-linux-gnu/libssl.so.3<br>#2 0x00007f3578bb4b8c in ?? () from /lib/x86_64-linux-gnu/libssl.so.3<br>#3 0x00007f3578bb6608 in ?? () from /lib/x86_64-linux-gnu/libssl.so.3<br><b>#4 0x000055ae37a1e1c4 in ngx_quic_crypto_input (c=0x7f3417bf4b00, data=0x7fff1cf4d680, level=ssl_encryption_initial) at src/event/quic/ngx_event_quic_ssl.c:412<br></b>#5 0x000055ae37a1dffc in ngx_quic_handle_crypto_frame (c=0x7f3417bf4b00, pkt=0x7fff1cf4d880, frame=0x7fff1cf4d6e0) at src/event/quic/ngx_event_quic_ssl.c:358<br>#6 0x000055ae37a0af0f in ngx_quic_handle_frames (c=0x7f3417bf4b00, pkt=0x7fff1cf4d880) at src/event/quic/ngx_event_quic.c:1242<br>#7 0x000055ae37a0a744 in ngx_quic_handle_payload (c=0x7f3417bf4b00, pkt=0x7fff1cf4d880) at src/event/quic/ngx_event_quic.c:1054<br>#8 0x000055ae37a0a12b in ngx_quic_handle_packet (c=0x7f3417bf4b00, conf=0x55ae39e42ae8, pkt=0x7fff1cf4d880) at src/event/quic/ngx_event_quic.c:946<br>#9 0x000055ae37a09630 in ngx_quic_handle_datagram (c=0x7f3417bf4b00, b=0x55ae3ac65f30, conf=0x55ae39e42ae8) at src/event/quic/ngx_event_quic.c:700<br>#10 0x000055ae37a07eb1 in ngx_quic_run (c=0x7f3417bf4b00, conf=0x55ae39e42ae8) at src/event/quic/ngx_event_quic.c:204<br>#11 0x000055ae37aace43 in ngx_http_v3_init_stream (c=0x7f3417bf4b00) at src/http/v3/ngx_http_v3_request.c:75<br>#12 0x000055ae37a3db4a in ngx_http_init_connection (c=0x7f3417bf4b00) at src/http/ngx_http_request.c:329<br>#13 0x000055ae37a0c3cd in ngx_quic_recvmsg (ev=0x7f34175f30d0) at src/event/quic/ngx_event_quic_udp.c:339<br>#14 0x000055ae379f0cca in ngx_epoll_process_events (cycle=0x55ae39d80390, timer=5653, flags=1) at src/event/modules/ngx_epoll_module.c:901<br>#15 0x000055ae379daacb in ngx_process_events_and_timers (cycle=0x55ae39d80390) at src/event/ngx_event.c:251<br>#16 0x000055ae379ed424 in ngx_worker_process_cycle (cycle=0x55ae39d80390, data=0x0) at src/os/unix/ngx_process_cycle.c:936<br>#17 0x000055ae379e8c49 in ngx_spawn_process (cycle=0x55ae39d80390, proc=0x55ae379ed2c3 <ngx_worker_process_cycle>, data=0x0, name=0x55ae37fa1cc5 "worker process", respawn=-3) at src/os/unix/ngx_process.c:209<br>#18 0x000055ae379ebf69 in ngx_start_worker_processes (cycle=0x55ae39d80390, n=1, type=-3) at src/os/unix/ngx_process_cycle.c:525<br>#19 0x000055ae379eb480 in ngx_master_process_cycle (cycle=0x55ae39d80390) at src/os/unix/ngx_process_cycle.c:279<br>#20 0x000055ae3799d8d1 in main (argc=3, argv=0x7fff1cf4e498) at src/core/nginx.c:489<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 21, 2023 at 5:03 PM Jeffrey Walton <<a href="mailto:noloader@gmail.com">noloader@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Dec 21, 2023 at 7:35 AM Clima Gabriel<br>
<<a href="mailto:clima.gabrielphoto@gmail.com" target="_blank">clima.gabrielphoto@gmail.com</a>> wrote:<br>
><br>
> Hello everyone,<br>
><br>
> My Nginx worker process has frequent segfaults on this codepath. (ngx_quic_create_stream)<br>
> Here are some observations I have made so far.<br>
> 1. The faults happen with tcmalloc and malloc so this is not the issue.<br>
> 2. master_process is on<br>
> 3. 1 worker is enough<br>
> 4. HTTP3 requests need to come in fairly frequently, at least 2 per second<br>
> 5. At least one http1 or http2 request needs to be received as well, regardless of what port<br>
><br>
> I would really appreciate any suggestions on where do I continue investigating this.<br>
><br>
> #0 0x00007ffb0b01876a in (anonymous namespace)::do_memalign(unsigned long, unsigned long) () from /lib64/libtcmalloc.so.4<br>
> #1 0x00007ffb0b037010 in tc_posix_memalign () from /lib64/libtcmalloc.so.4<br>
> [...]<br>
<br>
It's good you have debug symbols available.<br>
<br>
A 'bt full' may be more helpful so parameter values are available in<br>
the stack trace.<br>
<br>
Jeff<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="https://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">https://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div>