Welcome! Log In Create A New Profile

Advanced

запуск тестов https://github.com/nginx/nginx-tests с включенным ASAN (address sanitizer)

Илья Шипицин
April 20, 2021 07:46AM
привет!

занимаюсь тестированием 3rd parties модулей.
один из вариантов тестирования - штатные тесты
https://github.com/nginx/nginx-tests

хотелось бы в том числе запускать их с ASAN.

но на nginx без модулей сейчас получается вот так (половина тестов
разваливается)

==3669==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 221184 byte(s) in 3 object(s) allocated from:
#0 0x5049a6 in __interceptor_malloc
(/home/ilia/nginx-1.19.10/objs/nginx+0x5049a6)
#1 0x5a11ff in ngx_alloc
/home/ilia/nginx-1.19.10/src/os/unix/ngx_alloc.c:22:9
#2 0x5b0104 in ngx_worker_process_init
/home/ilia/nginx-1.19.10/src/os/unix/ngx_process_cycle.c:900:17
#3 0x5af2c3 in ngx_worker_process_cycle
/home/ilia/nginx-1.19.10/src/os/unix/ngx_process_cycle.c:704:5
#4 0x5ad797 in ngx_start_worker_processes
/home/ilia/nginx-1.19.10/src/os/unix/ngx_process_cycle.c:344:9
#5 0x53866d in main /home/ilia/nginx-1.19.10/src/core/nginx.c:383:9
#6 0x7f1ec30db554 in __libc_start_main (/lib64/libc.so.6+0x22554)

SUMMARY: AddressSanitizer: 221184 byte(s) leaked in 3 allocation(s).


скажите, у вас есть практика запуска с asan ?


воспроизвести ошибку выше можно примерно так (для CentOS 7)


export NGINX_VERSION: 1.19.10

yum install -q -y epel-release
yum install -q -y centos-release-scl-rh
yum install -q -y devtoolset-9-toolchain devtoolset-9-libasan-devel
yum install -q -y which wget make gcc git openssl-devel
yum install -q -y "perl(Test::More)" 'perl(IO::Socket::SSL)'
'perl(Net::SSLeay)' 'perl(Protocol::WebSocket)' 'perl(IO::Compress::Gzip)'
'perl(JSON::PP)'
groupadd -r nginx
useradd -r -g nginx -d /var/cache/nginx nginx
usermod -o -u 0 nginx
groupmod -o -g 0 nginx

wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz
tar xf nginx-${NGINX_VERSION}.tar.gz
cd nginx-${NGINX_VERSION}
. /opt/rh/devtoolset-9/enable
./configure --with-debug --prefix=/etc/nginx
--sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/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
--with-cc-opt='-O1 -ggdb -fsanitize=address'
--with-ld-opt='-fsanitize=address'
make
git clone https://github.com/nginx/nginx-tests
cd nginx-tests
TEST_NGINX_BINARY=${CI_PROJECT_DIR}/nginx-${NGINX_VERSION}/objs/nginx
prove .
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

запуск тестов https://github.com/nginx/nginx-tests с включенным ASAN (address sanitizer)

Илья Шипицин April 20, 2021 07:46AM

Re: запуск тестов https://github.com/nginx/nginx-tests с включенным ASAN (address sanitizer)

Sergey Kandaurov April 20, 2021 09:28AM

Re: запуск тестов https://github.com/nginx/nginx-tests с включенным ASAN (address sanitizer)

Maxim Dounin April 20, 2021 09:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready