﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
2588	Unable to compile Nginx with both dynamic module and ASAN at the same time	Ivan Shaverskyi		"We have Nginx module we'd like to test with ASAN. When trying to both add the keys needed for ASAN (per Development guide) and --add-dynamic-module once Nginx starts we get an error like so

{{{
==1==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
}}}

When we only add keys for ASAN everything seems fine. Is there something we're missing to build Nginx ASAN and dynamic module all at once or it is not supported yet?

Attaching slightly obfuscated Dockerfile for this issue (it's not the prettiest one, we quickly made it for testing)

''Also, I know it's supposed to be a different ticket but for some reason even when assembling Nginx with ASAN without dynamic module, when ASAN_OPTIONS=detect_leaks=1 is set, we fail on checking int stage in configure like so'' 

{{{
checking for int size ...==784==LeakSanitizer has encountered a fatal error.
}}}
"	defect	closed	minor		nginx-core	1.23.x	invalid	ASAN, Address Sanitizer, Dynamic Module		Linux ca01ad098466 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 GNU/Linux	"nginx version: nginx/1.23.2
built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
built with OpenSSL 1.1.1w  11 Sep 2023
TLS SNI support enabled
configure arguments: --with-cc-opt='-fsanitize=address -DNGX_DEBUG_PALLOC=1' --with-ld-opt=-fsanitize=address --with-compat --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module"
