Repository navigation
Not planned
Labels
type: bugfixCorrects defective behavior.
Description
Hi ,
I tried to build nginx with quiche as explained below and tried to run curl with http3 but noticing below cores
[https://github.com/cloudflare/quiche/tree/master/nginx]
nginx -V
root@ubuntu:/tmp/cores# /src/nginx-1.16.1/objs/nginx -V
nginx version: nginx/1.16.1 (quiche-ab2b44fa)
built by gcc 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
built with OpenSSL 1.1.1 (compatible; BoringSSL) (running with BoringSSL)
TLS SNI support enabled
configure arguments: --prefix=/src/nginx-1.16.1 --build=quiche-ab2b44fa --with-http_ssl_module --with-http_v2_module --with-http_v3_module --with-openssl=../quiche/quiche/deps/boringssl --with-quiche=../quiche
curl command and version
root@ubuntu:/tmp/cores# curl -V
curl 8.3.0-DEV (x86_64-pc-linux-gnu) libcurl/8.3.0-DEV OpenSSL/1.1.1s zlib/1.2.11 brotli/1.0.9 msh3/0.6.0.0
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP3 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe UnixSockets
root@ubuntu:/tmp/cores# curl -k -v --http3-only -# -o /tmp/index.html https://127.0.0.1:5443/index.html
below is the nginx bt
(gdb) bt
#0 0x000055d6712442c2 in ngx_quic_write_handler (wev=<optimized out>) at src/event/ngx_event_quic.c:411
#1 0x000055d67123456f in ngx_event_process_posted (cycle=cycle@entry=0x55d6737d0700, posted=0x55d6717a0280 <ngx_posted_events>)
at src/event/ngx_event_posted.c:34
#2 0x000055d67123405c in ngx_process_events_and_timers (cycle=cycle@entry=0x55d6737d0700) at src/event/ngx_event.c:267
#3 0x000055d67123bf51 in ngx_worker_process_cycle (cycle=0x55d6737d0700, data=<optimized out>) at src/os/unix/ngx_process_cycle.c:750
#4 0x000055d67123a431 in ngx_spawn_process (cycle=cycle@entry=0x55d6737d0700,
proc=proc@entry=0x55d67123be67 <ngx_worker_process_cycle>, data=data@entry=0x4, name=name@entry=0x55d6715d8236 "worker process",
respawn=respawn@entry=-3) at src/os/unix/ngx_process.c:199
#5 0x000055d67123b537 in ngx_start_worker_processes (cycle=cycle@entry=0x55d6737d0700, n=8, type=type@entry=-3)
at src/os/unix/ngx_process_cycle.c:359
#6 0x000055d67123c62d in ngx_master_process_cycle (cycle=cycle@entry=0x55d6737d0700) at src/os/unix/ngx_process_cycle.c:131
#7 0x000055d671214e0f in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:382
(gdb) quit
nginx error log file
2023/09/06 11:26:06 [alert] 240245#0: worker process 240272 exited on signal 11 (core dumped)
2023/09/06 11:26:08 [alert] 240245#0: worker process 240274 exited on signal 11 (core dumped)
2023/09/06 11:26:12 [alert] 240245#0: worker process 240276 exited on signal 11 (core dumped)
2023/09/06 11:26:26 [alert] 240245#0: worker process 240247 exited on signal 11 (core dumped)
2023/09/06 11:26:27 [alert] 240245#0: worker process 240303 exited on signal 11 (core dumped)
2023/09/06 11:26:29 [alert] 240245#0: worker process 240305 exited on signal 11 (core dumped)
2023/09/06 11:26:33 [alert] 240245#0: worker process 240307 exited on signal 11 (core dumped)
2023/09/06 11:31:05 [alert] 240245#0: worker process 240250 exited on signal 11 (core dumped)
2023/09/06 11:31:06 [alert] 240245#0: worker process 241691 exited on signal 11 (core dumped)
2023/09/06 11:31:08 [alert] 240245#0: worker process 241692 exited on signal 11 (core dumped)
2023/09/06 11:31:12 [alert] 240245#0: worker process 241693 exited on signal 11 (core dumped)
2023/09/06 11:38:52 [alert] 240245#0: worker process 241694 exited on signal 11 (core dumped)
2023/09/06 11:38:53 [alert] 240245#0: worker process 241734 exited on signal 11 (core dumped)
2023/09/06 11:38:55 [alert] 240245#0: worker process 241735 exited on signal 11 (core dumped)
2023/09/06 11:38:59 [alert] 240245#0: worker process 241736 exited on signal 11 (core dumped)
root@ubuntu:/tmp/cores#
am i missing anything here?
Metadata
Metadata
Assignees
Labels
type: bugfixCorrects defective behavior.
Activity
[-]Cores on nginx when built with quiche[/-][+]Cores on nginx-quiche while running curl command[/+]Ryenum commentedon Dec 3, 2023
Hello, I encountered some problems when configuring the quic service of NGINX. My configuration is the same as that of the official website, but I still cannot use the quic protocol when accessing the server. The h2 protocol is still used. Here is my compilation information:
nginx version: nginx/1.16.1 (quiche-83d9168a)
built by gcc 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
built with OpenSSL 1.1.1 (compatible; BoringSSL) (running with BoringSSL)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --build=quiche-83d9168a --with-http_v3_module --with-http_v2_module --with-quiche=/quiche --with-http_ssl_module --with-openssl=/quiche/quiche/deps/boringssl --add-module=/connect
devkdas commentedon Dec 4, 2023
i build nginx with below args
Can you share the nginx conf file and command you are using to connect to nginx?
Ryenum commentedon Dec 4, 2023
This is my configuration information:
server {
# Enable QUIC and HTTP/3.
listen 443 quic reuseport;
server_name test.cn;
Can you help me see what the problem is?
devkdas commentedon Dec 4, 2023
can you add below header also
and can you send
netstat -alpn | grep nginxoutputRyenum commentedon Dec 4, 2023
Here are the details:
root@learn:/quiche# netstat -alpn |grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 20157/nginx: master
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 20157/nginx: master
udp 0 0 0.0.0.0:443 0.0.0.0:* 20157/nginx: master
unix 3 [ ] 流 已连接 928126 20157/nginx: master
unix 3 [ ] 流 已连接 928127 20157/nginx: master
devkdas commentedon Dec 4, 2023
can you try below config
it works for me
Ryenum commentedon Dec 4, 2023
After using this configuration, he compiled without problems, but the access times error "404".Is there something I'm missing?
devkdas commentedon Dec 4, 2023
can you send me client output
Ryenum commentedon Dec 4, 2023
Here are details:
"192.168.227.1 - - [04/Dec/2023:20:12:08 +0800] "GET / HTTP/1.1" 404 555 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
192.168.227.1 - - [04/Dec/2023:20:14:18 +0800] "GET / HTTP/2.0" 404 555 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36""
devkdas commentedon Dec 4, 2023
seems to me this is nginx error log file output
Ryenum commentedon Dec 4, 2023
I don't quite understand what you mean. Here is the message I get back when I pass the "crul" command, hopefully I understood it correctly:
C:\Users\dell>curl -v https://ryetong.cn
- schannel: remote party requests renegotiation
- schannel: renegotiating SSL/TLS connection
- schannel: SSL/TLS connection renegotiated
<title>404 Not Found</title>< HTTP/1.1 404 Not Found
< Server: nginx/1.16.1
< Date: Mon, 04 Dec 2023 12:48:01 GMT
< Content-Type: text/html
< Content-Length: 153
< Connection: keep-alive
< X-protocol: HTTP/1.1
<
404 Not Found
nginx/1.16.1 * Connection #0 to host ryetong.cn left intact
C:\Users\dell>curl -v https://test.cn
- schannel: remote party requests renegotiation
- schannel: renegotiating SSL/TLS connection
- schannel: SSL/TLS connection renegotiated
<title>404 Not Found</title>< HTTP/1.1 404 Not Found
< Server: nginx/1.16.1
< Date: Mon, 04 Dec 2023 12:50:02 GMT
< Content-Type: text/html
< Content-Length: 153
< Connection: keep-alive
< X-protocol: HTTP/1.1
<
404 Not Found
nginx/1.16.1 * Connection #0 to host ryetong.cn left intact
devkdas commentedon Dec 4, 2023
i think you didn't even tried with http3
try as
curl --http3-only -v -k https://ryetong.cn:5443/devkdas commentedon Dec 4, 2023
and does your curl support quic?
curl -V output ?
Ryenum commentedon Dec 4, 2023
Sorry, my "curl" does not support http3:
curl: option --http3-only: the installed libcurl version doesn't support this
curl: try 'curl --help' for more information
devkdas commentedon Dec 4, 2023
try to install curl with h3 support
pplabs-fute commentedon Dec 5, 2023
@Karthikdasari0423 Have you solved this coredump problem? How to solve it?
devkdas commentedon Dec 5, 2023
@pplabs-fute yes,just install with https://github.com/bagder/quiche.git instaed of original one
pplabs-fute commentedon Dec 5, 2023
@Karthikdasari0423 ok,thanks;
Hi-Im-Jony commentedon Mar 23, 2024
Hey, I've had this issue too for a long time and it seems that using this fork to build nginx fixes the issue - so thanks haha.
Do you have any idea why this fork works but the official repo doesn't? And how did you find out this fork works?
devkdas commentedon Apr 13, 2024
@bagder Seems to me you have deleted https://github.com/bagder/quiche.git
Could you pls add back if you archived or made it private?
Many people are using your repo as it is stable in building nginx with quiche support
bagder commentedon Apr 15, 2024
Sorry, my fork is gone.
devkdas commentedon Apr 15, 2024
okay, got it.
Thanks @bagder
mpiraux commentedon Apr 23, 2024
I've been looking into this issue and was able to solve it by changing this piece of code:
quiche/nginx/nginx-1.16.patch
Lines 1050 to 1054 in 1780aec
The segfault comes from the
quic_blocked_eventsqueue which is uninitialised. But the fix is not to initialise it per se.The real problem seems to me that consulting the write event of the listening connection is not appropriate to determine whether the connection socket is ready to write.
Changing the if condition to
if (!c->write->ready)makes the code run and the QUIC connection go on.@bagder could you kindly confirm this is the fix you undertook? Thanks :)
bagder commentedon Apr 23, 2024
I did not (on purpose) fix this. I suspect maybe my fork was just out of date.
devkdas commentedon Apr 23, 2024
@mpiraux Does your below fork works for building nginx with quiche support?
https://github.com/mpiraux/quiche
and i have a backup of @bagder fork and as @bagder said it is out of date.
devkdas commentedon Apr 23, 2024
and this code is not even present in @bagder fork
ghedo commentedon Nov 25, 2026
Closing because the nginx patch no longer exists. The crash came from the
quic_blocked_eventshandling innginx/nginx-1.16.patch, and e434e42 removed the patch in 0.23.0, since nginx has supported QUIC natively since 1.25.0.