annotate auto/have_headers @ 9309:92e14ce71b72

Configure: adjusted optimization level for Sun C. With "-fast" (and with "-xbuiltin=%all -xO4"), Sun C miscompiles ngx_http_script_add_copy_code(), which is inlined into ngx_http_script_compile(). From the assembly code it looks like the code uses uninitialized register when calculating new p value after memcpy: movq %r15,%rdi call _memcpy leaq (%r15,rbx),%rax movq (%r12),%rbx movb $0x0000000000000000,(%rax) Note that %rax is set to (%r15 + %rbx), but %rbx is only set after it is used. As such, "*p = '\0'" tries to modify an unrelated memory address, leading to a segmentation fault. The issue was seen in tests which use null-terminated complex values: proxy_ssl_certificate_vars.t, uwsgi_ssl_certificate_vars.t, stream_proxy_ssl_certificate_vars.t. Tested with Sun C compilers from Sun Studio 12.3, 12.4, 12.5, and 12.6. Restructuring code, such as splitting ngx_cpymem() with a separate "p += value->len" increment, fixes things, but it is not clear if its the only place where such miscompilation can happen. Fix is to use "-fast -xO3". Since IPO requires "-xO5", it is commented out.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 07 Aug 2024 03:56:23 +0300
parents d620f497c50f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
509
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 # Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 509
diff changeset
3 # Copyright (C) Nginx, Inc.
509
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 cat << END >> $NGX_AUTO_HEADERS_H
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 #ifndef $have
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 #define $have 1
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 #endif
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 END