https://bz.apache.org/bugzilla/show_bug.cgi?id=69738
Bug ID: 69738
Summary: memory-leaks (apache benchmark) ab with some options
Product: Apache httpd-2
Version: 2.5-HEAD
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: support
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
When we use some options strdup(opt_arg) is affected and allocated memory will
not free. When we build the project with address sanitizers:
$ export CC="clang"
$ export CXX="clang++"
$ export CFLAGS="-pipe -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -fsanitize=address,leak"
$ svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr
$ <some buildconf calls>
$ ./configure --with-included-apr --host=x86_64-linux-gnu
--build=x86_64-linux-gnu --enable-layout=Debian --enable-so
--with-program-name=apache2 --enable-suexec --with-suexec-caller=www-data
--with-suexec-bin=/usr/lib/apache2/suexec --with-suexec-docroot=/var/www
--with-suexec-userdir=public_html
--with-suexec-logfile=/var/log/apache2/suexec.log --with-suexec-uidmin=100
--enable-suexec=shared --enable-log-config=static
--with-pcre=/usr/bin/pcre2-config --enable-pie
--enable-mpms-shared=all --with-mpm=prefork --enable-mods-shared="all brotli
cgi ident authnz_fcgi imagemap cern_meta proxy_fdpass proxy_http2 bucketeer
case_filter case_filter_in" --enable-mods-static="unixd logio watchdog version"
$ make
we got the leaks for running ./ab:
with -Z option
=================================================================
==322090==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 12 byte(s) in 1 object(s) allocated from:
#0 0x56eb7ee7591a in strdup (/upstream/httpd/support/ab+0xbd91a) (BuildId:
bad7eb3246d2c5666fc10dbd279fefc2f77f4efc)
#1 0x56eb7eed0fd6 in main2 /upstream/httpd/support/ab.c:3275:30
#2 0x56eb7eee975d in main /upstream/httpd/support/../ab_harness.c:46:5
#3 0x70a8fd7d6249 in __libc_start_call_main
csu/../sysdeps/nptl/libc_start_call_main.h:58:16
SUMMARY: AddressSanitizer: 12 byte(s) leaked in 1 allocation(s).
with -m option
=================================================================
==322043==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 3 byte(s) in 1 object(s) allocated from:
#0 0x5e7fb0d1691a in strdup (/upstream/httpd/support/ab+0xbd91a) (BuildId:
3dcc8201307729ba0815e987af7868bee098af78)
#1 0x5e7fb0d71f80 in main /upstream/httpd/support/ab.c:3271:45
#2 0x7e435af2d249 in __libc_start_call_main
csu/../sysdeps/nptl/libc_start_call_main.h:58:16
SUMMARY: AddressSanitizer: 3 byte(s) leaked in 1 allocation(s).
with -E option
=================================================================
==322050==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 3 byte(s) in 1 object(s) allocated from:
#0 0x5fd9575e491a in strdup (/upstream/httpd/support/ab+0xbd91a) (BuildId:
3dcc8201307729ba0815e987af7868bee098af78)
#1 0x5fd957640023 in main /upstream/httpd/support/ab.c:3278:28
#2 0x799158bbe249 in __libc_start_call_main
csu/../sysdeps/nptl/libc_start_call_main.h:58:16
SUMMARY: AddressSanitizer: 3 byte(s) leaked in 1 allocation(s).
with Host: option
==322093==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 341 byte(s) in 5 object(s) allocated from:
#0 0x64a46dce091a in strdup (/upstream/httpd/support/ab+0xbd91a) (BuildId:
bad7eb3246d2c5666fc10dbd279fefc2f77f4efc)
#1 0x64a46dd3b3ef in main2 /upstream/httpd/support/ab.c:3193:28
#2 0x64a46dd5475d in main /upstream/httpd/support/../ab_harness.c:46:5
#3 0x7bbfadc3a249 in __libc_start_call_main
csu/../sysdeps/nptl/libc_start_call_main.h:58:16
I suggest just replace any *strdup(opt_arg)* on just *opt_arg* such as many
cases (for instance option -x, -y and etc) to avoid memory leaks.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]