My issue:
I am running Nginx (1.26.3 version-stable) as reverse proxy along with NTLM module for my small Azure DevOps on-prem cluster (2 app tiers, 1 search server, 1 SQL Server).
Since some time I am getting segfaults errors along with terminated working process as below:
[944987.909723] nginx[700512]: segfault at 28 ip 0000000000442d7c sp 00007fffb0a70ca0 error 4 in nginx[413000+b1000] likely on CPU 0 (core 0, socket 0)
[944987.910787] Code: c5 ff ff ff ff e9 c9 fd ff ff 48 c7 c5 ff ff ff ff e9 bd fd ff ff 53 48 8b 1f f6 47 09 04 74 0f 48 8b 83 90 00 00 00 48 89 df <ff> 50 28 5b c3 48 89 df e8 88 f9 ff ff 48 83 f8 fe 74 f0 48 8b 83
[944988.684438] nginx[701522]: segfault at 28 ip 00000000004661f3 sp 00007fffb0a70ca0 error 4 in nginx[413000+b1000] likely on CPU 1 (core 1, socket 0)
[944988.685217] Code: 09 f7 e9 63 ff ff ff 48 89 df ff 53 38 4c 89 e7 e8 d4 f5 fe ff eb a8 53 48 8b 07 48 8b 00 48 8b 48 48 48 8b 58 08 48 8b 53 50 <48> 8b 52 28 48 89 42 10 0f b6 57 09 83 e2 14 80 fa 14 74 19 f6 47
And here:
2025/03/30 21:00:02 [alert] 699285#699285: connection already closed
2025/03/30 21:00:02 [alert] 699285#699285: connection already closed
2025/03/30 21:00:02 [notice] 613185#613185: signal 17 (SIGCHLD) received from 699285
2025/03/30 21:00:02 [notice] 613185#613185: signal 17 (SIGCHLD) received from 699285
2025/03/30 21:00:02 [notice] 613185#613185: signal 17 (SIGCHLD) received from 699285
2025/03/30 21:00:02 [alert] 613185#613185: worker process 699285 exited on signal 11
2025/03/30 21:00:02 [alert] 613185#613185: worker process 699285 exited on signal 11
2025/03/30 21:00:02 [alert] 613185#613185: worker process 699285 exited on signal 11
2025/03/30 21:00:02 [alert] 613185#613185: worker process 699285 exited on signal 11
2025/03/30 21:00:02 [notice] 613185#613185: start worker process 700202
2025/03/30 21:00:02 [notice] 613185#613185: start worker process 700202
2025/03/30 21:00:02 [notice] 613185#613185: start worker process 700202
2025/03/30 21:00:02 [notice] 613185#613185: signal 29 (SIGIO) received
2025/03/30 21:00:02 [notice] 613185#613185: signal 29 (SIGIO) received
2025/03/30 21:00:02 [notice] 613185#613185: signal 29 (SIGIO) received
2025/03/30 21:00:04 [alert] 699354#699354: connection already closed
2025/03/30 21:00:04 [alert] 699354#699354: connection already closed
2025/03/30 21:00:04 [alert] 699354#699354: connection already closed
2025/03/30 21:00:04 [alert] 699354#699354: connection already closed
2025/03/30 21:00:04 [notice] 613185#613185: signal 17 (SIGCHLD) received from 699354
2025/03/30 21:00:04 [notice] 613185#613185: signal 17 (SIGCHLD) received from 699354
2025/03/30 21:00:04 [notice] 613185#613185: signal 17 (SIGCHLD) received from 699354
Blockquote
How I encountered the problem:
Problem appeared when I have only enabled proxying SSH connections to backend servers declared in upstream directive.
Solutions I’ve tried:
I tried to debug the issue with gdb but it was not leading me anywhere. I have tried with various PIDs (sudo gdb -p proc_id).
My config:
That’s my primary nginx.conf
#user nobody;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
error_log logs/error.log debug;pid sbin/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 65535;events {
worker_connections 4096;
}#SSH block
stream {
upstream ssh_backend {
least_conn;
server server1.domain.local:22;
server server2.domain.local:22;
}server { listen 22; proxy_pass ssh_backend; proxy_timeout 1h; proxy_connect_timeout 600s; }
}
http {
include mime.types;
include /usr/local/nginx/conf_templates/*.conf;
default_type application/octet-stream;log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" "http_user_agent" ' '$request_length $request_time $upstream_addr ' '$upstream_response_length $upstream_response_time $upstream_status '; access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; proxy_read_timeout 1800s; proxy_send_timeout 1800s; proxy_connect_timeout 60s; proxy_next_upstream error timeout http_502 http_504; proxy_next_upstream_tries 3; #gzip on; server_names_hash_bucket_size 128; client_max_body_size 200M; upstream qa_azure_devops { least_conn; server server1.domain.local:443 max_fails=3 fail_timeout=30s; server server2.domain.local:443 max_fails=3 fail_timeout=30s; ntlm; } server { listen 443 ssl; server_name qa.azuredevops.domain.local; ssl_certificate /etc/pki/tls/certs/qa-azuredevops-swdc.cer; ssl_certificate_key /etc/pki/tls/private/qa-azuredevops-swdc.key; ssl_protocols TLSv1.2 TLSv1.3; ssl_session_timeout 4h; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass https://qa_azure_devops; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Authorization $http_authorization; proxy_set_header Connection 'Keep-Alive'; proxy_set_header X-Forwarded-Proto $scheme; add_header X-Upstream-Server $upstream_addr; proxy_ssl_server_name on; proxy_http_version 1.1; proxy_set_header Connection ""; } }
}
Kindly please for help !