phuslu / nginx-ssl-fingerprint

high performance ja3 and http2 fingerprint for nginx.
BSD 2-Clause "Simplified" License
138 stars 23 forks source link

memory leaks in nginx after compiling with your patch #34

Closed emdaitaj closed 1 year ago

emdaitaj commented 1 year ago

nginx -t give lots of memroy leak messages when compiled with your patch (exactly with your guide) with youor own config :

`root@birds:~/tmp/nginx# ./objs/nginx -t -c ../nginx-ssl-fingerprint/nginx.conf

nginx: [emerg] open() "/usr/local/nginx/../nginx-ssl-fingerprint/nginx.conf" failed (2: No such file or directory) nginx: configuration file /usr/local/nginx/../nginx-ssl-fingerprint/nginx.conf test failed

================================================================= ==27166==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 1024 byte(s) in 1 object(s) allocated from:

0 0x7f14fddbf55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x555f3db0b97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x555f3da9e50c in ngx_create_pool src/core/ngx_palloc.c:23
#3 0x555f3da9a043 in main src/core/nginx.c:253
#4 0x7f14fda79d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

SUMMARY: AddressSanitizer: 1024 byte(s) leaked in 1 allocation(s).`

with my real usage config:

`root@birds:~# /usr/local/nginx/sbin/nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

================================================================= ==27178==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae05e in ngx_pcalloc src/core/ngx_palloc.c:302
#6 0x5599493afd49 in ngx_hash_init src/core/ngx_hash.c:396
#7 0x559949461271 in ngx_http_core_merge_loc_conf src/http/ngx_http_core_module.c:3724
#8 0x559949456e05 in ngx_http_merge_servers src/http/ngx_http.c:597
#9 0x559949456e05 in ngx_http_block src/http/ngx_http.c:270
#10 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#11 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#12 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#13 0x5599493a8789 in main src/core/nginx.c:292
#14 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae05e in ngx_pcalloc src/core/ngx_palloc.c:302
#6 0x559949469f51 in ngx_http_core_server src/http/ngx_http_core_module.c:2923
#7 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#8 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#9 0x559949456815 in ngx_http_block src/http/ngx_http.c:239
#10 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#11 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#12 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#13 0x5599493a8789 in main src/core/nginx.c:292
#14 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493add78 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493add78 in ngx_pnalloc src/core/ngx_palloc.c:140
#5 0x5599493e54d4 in ngx_conf_read_token src/core/ngx_conf_file.c:766
#6 0x5599493e54d4 in ngx_conf_parse src/core/ngx_conf_file.c:243
#7 0x55994946a63a in ngx_http_core_server src/http/ngx_http_core_module.c:2984
#8 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#9 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#10 0x559949456815 in ngx_http_block src/http/ngx_http.c:239
#11 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#12 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#13 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#14 0x5599493a8789 in main src/core/nginx.c:292
#15 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae05e in ngx_pcalloc src/core/ngx_palloc.c:302
#6 0x55994955dd2b in ngx_http_proxy_create_loc_conf src/http/modules/ngx_http_proxy_module.c:3318
#7 0x559949467bb9 in ngx_http_core_location src/http/ngx_http_core_module.c:3077
#8 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#9 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#10 0x55994946a63a in ngx_http_core_server src/http/ngx_http_core_module.c:2984
#11 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#12 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#13 0x559949456815 in ngx_http_block src/http/ngx_http.c:239
#14 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#15 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#16 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#17 0x5599493a8789 in main src/core/nginx.c:292
#18 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae626 in ngx_array_init src/core/ngx_array.h:44
#6 0x5599493ae626 in ngx_array_create src/core/ngx_array.c:22
#7 0x55994948ef66 in ngx_http_log_create_main_conf src/http/modules/ngx_http_log_module.c:1152
#8 0x5599494562e8 in ngx_http_block src/http/ngx_http.c:197
#9 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#10 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#11 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#12 0x5599493a8789 in main src/core/nginx.c:292
#13 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493ad50c in ngx_create_pool src/core/ngx_palloc.c:23
#3 0x5599493dc0c8 in ngx_init_cycle src/core/ngx_cycle.c:69
#4 0x5599493a8789 in main src/core/nginx.c:292
#5 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae05e in ngx_pcalloc src/core/ngx_palloc.c:302
#6 0x55994945e199 in ngx_http_core_create_loc_conf src/http/ngx_http_core_module.c:3554
#7 0x55994955612d in ngx_http_rewrite_if src/http/modules/ngx_http_rewrite_module.c:569
#8 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#9 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#10 0x55994946a63a in ngx_http_core_server src/http/ngx_http_core_module.c:2984
#11 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#12 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#13 0x559949456815 in ngx_http_block src/http/ngx_http.c:239
#14 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#15 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#16 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#17 0x5599493a8789 in main src/core/nginx.c:292
#18 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae842 in ngx_array_push src/core/ngx_array.c:76
#6 0x5599493e662a in ngx_conf_set_keyval_slot src/core/ngx_conf_file.c:1147
#7 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#8 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#9 0x5599494683a3 in ngx_http_core_location src/http/ngx_http_core_module.c:3227
#10 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#11 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#12 0x55994946a63a in ngx_http_core_server src/http/ngx_http_core_module.c:2984
#13 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#14 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#15 0x559949456815 in ngx_http_block src/http/ngx_http.c:239
#16 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#17 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#18 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#19 0x5599493a8789 in main src/core/nginx.c:292
#20 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae842 in ngx_array_push src/core/ngx_array.c:76
#6 0x5599494a2f80 in ngx_http_get_variable_index src/http/ngx_http_variables.c:579
#7 0x5599494901b9 in ngx_http_log_variable_compile src/http/modules/ngx_http_log_module.c:921
#8 0x5599494901b9 in ngx_http_log_compile_format src/http/modules/ngx_http_log_module.c:1691
#9 0x559949490b7b in ngx_http_log_init src/http/modules/ngx_http_log_module.c:1892
#10 0x5599494582e0 in ngx_http_block src/http/ngx_http.c:310
#11 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#12 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#13 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#14 0x5599493a8789 in main src/core/nginx.c:292
#15 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae9e4 in ngx_array_push_n src/core/ngx_array.c:126
#6 0x55994957ef8a in ngx_http_fastcgi_init_params src/http/modules/ngx_http_fastcgi_module.c:3479
#7 0x559949580b36 in ngx_http_fastcgi_merge_loc_conf src/http/modules/ngx_http_fastcgi_module.c:3276
#8 0x559949453e6c in ngx_http_merge_locations src/http/ngx_http.c:650
#9 0x559949456ed3 in ngx_http_merge_servers src/http/ngx_http.c:607
#10 0x559949456ed3 in ngx_http_block src/http/ngx_http.c:270
#11 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#12 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#13 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#14 0x5599493a8789 in main src/core/nginx.c:292
#15 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae05e in ngx_pcalloc src/core/ngx_palloc.c:302
#6 0x5599495137ab in ngx_http_headers_create_conf src/http/modules/ngx_http_headers_filter_module.c:645
#7 0x55994955612d in ngx_http_rewrite_if src/http/modules/ngx_http_rewrite_module.c:569
#8 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#9 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#10 0x5599494683a3 in ngx_http_core_location src/http/ngx_http_core_module.c:3227
#11 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#12 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#13 0x55994946a63a in ngx_http_core_server src/http/ngx_http_core_module.c:2984
#14 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#15 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#16 0x559949456815 in ngx_http_block src/http/ngx_http.c:239
#17 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#18 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#19 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#20 0x5599493a8789 in main src/core/nginx.c:292
#21 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493add78 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493add78 in ngx_pnalloc src/core/ngx_palloc.c:140
#5 0x5599494a2b79 in ngx_http_add_variable src/http/ngx_http_variables.c:458
#6 0x5599494a573a in ngx_http_variables_add_core_vars src/http/ngx_http_variables.c:2676
#7 0x55994946340d in ngx_http_core_preconfiguration src/http/ngx_http_core_module.c:3371
#8 0x5599494567d9 in ngx_http_block src/http/ngx_http.c:229
#9 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#10 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#11 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#12 0x5599493a8789 in main src/core/nginx.c:292
#13 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5b55c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

#1 0x55994941a97f in ngx_memalign src/os/unix/ngx_alloc.c:57
#2 0x5599493acff7 in ngx_palloc_block src/core/ngx_palloc.c:186
#3 0x5599493adca9 in ngx_palloc_small src/core/ngx_palloc.c:173
#4 0x5599493adca9 in ngx_palloc src/core/ngx_palloc.c:127
#5 0x5599493ae05e in ngx_pcalloc src/core/ngx_palloc.c:302
#6 0x559949581c90 in ngx_http_uwsgi_create_loc_conf src/http/modules/ngx_http_uwsgi_module.c:1506
#7 0x55994955612d in ngx_http_rewrite_if src/http/modules/ngx_http_rewrite_module.c:569
#8 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#9 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#10 0x55994946a63a in ngx_http_core_server src/http/ngx_http_core_module.c:2984
#11 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#12 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#13 0x559949456815 in ngx_http_block src/http/ngx_http.c:239
#14 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#15 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#16 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#17 0x5599493a8789 in main src/core/nginx.c:292
#18 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 10120 byte(s) in 202 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x5599496b788d in CRYPTO_zalloc (/usr/local/nginx/sbin/nginx+0x42d88d)

Indirect leak of 6464 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994941a7ec in ngx_alloc src/os/unix/ngx_alloc.c:22
#2 0x5599493ad325 in ngx_palloc_large src/core/ngx_palloc.c:220
#3 0x5599493adc20 in ngx_palloc src/core/ngx_palloc.c:131
#4 0x5599493afd9d in ngx_hash_init src/core/ngx_hash.c:403
#5 0x5599494a63ca in ngx_http_variables_init_vars src/http/ngx_http_variables.c:2784
#6 0x559949458307 in ngx_http_block src/http/ngx_http.c:316
#7 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#8 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#9 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#10 0x5599493a8789 in main src/core/nginx.c:292
#11 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 5349 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994941a7ec in ngx_alloc src/os/unix/ngx_alloc.c:22
#2 0x5599493ad325 in ngx_palloc_large src/core/ngx_palloc.c:220
#3 0x5599493adc20 in ngx_palloc src/core/ngx_palloc.c:131
#4 0x5599493b290e in ngx_create_temp_buf src/core/ngx_buf.c:22
#5 0x5599493e39c5 in ngx_conf_add_dump src/core/ngx_conf_file.c:132
#6 0x5599493e39c5 in ngx_conf_parse src/core/ngx_conf_file.c:225
#7 0x5599493e5dd5 in ngx_conf_include src/core/ngx_conf_file.c:841
#8 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#9 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#10 0x559949456815 in ngx_http_block src/http/ngx_http.c:239
#11 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#12 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#13 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#14 0x5599493a8789 in main src/core/nginx.c:292
#15 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 4544 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994941a7ec in ngx_alloc src/os/unix/ngx_alloc.c:22
#2 0x5599493ad325 in ngx_palloc_large src/core/ngx_palloc.c:220
#3 0x5599493adc20 in ngx_palloc src/core/ngx_palloc.c:131
#4 0x5599493afd9d in ngx_hash_init src/core/ngx_hash.c:403
#5 0x559949461271 in ngx_http_core_merge_loc_conf src/http/ngx_http_core_module.c:3724
#6 0x559949456e05 in ngx_http_merge_servers src/http/ngx_http.c:597
#7 0x559949456e05 in ngx_http_block src/http/ngx_http.c:270
#8 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#9 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#10 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#11 0x5599493a8789 in main src/core/nginx.c:292
#12 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 4280 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994941a7ec in ngx_alloc src/os/unix/ngx_alloc.c:22
#2 0x5599493ad325 in ngx_palloc_large src/core/ngx_palloc.c:220
#3 0x5599493adc20 in ngx_palloc src/core/ngx_palloc.c:131
#4 0x5599493ae05e in ngx_pcalloc src/core/ngx_palloc.c:302
#5 0x5599493b1623 in ngx_hash_keys_array_init src/core/ngx_hash.c:727
#6 0x5599494a5610 in ngx_http_variables_add_core_vars src/http/ngx_http_variables.c:2662
#7 0x55994946340d in ngx_http_core_preconfiguration src/http/ngx_http_core_module.c:3371
#8 0x5599494567d9 in ngx_http_block src/http/ngx_http.c:229
#9 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#10 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#11 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#12 0x5599493a8789 in main src/core/nginx.c:292
#13 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 4280 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994941a7ec in ngx_alloc src/os/unix/ngx_alloc.c:22
#2 0x5599493ad325 in ngx_palloc_large src/core/ngx_palloc.c:220
#3 0x5599493adc20 in ngx_palloc src/core/ngx_palloc.c:131
#4 0x5599493ae05e in ngx_pcalloc src/core/ngx_palloc.c:302
#5 0x5599493b15c2 in ngx_hash_keys_array_init src/core/ngx_hash.c:721
#6 0x5599494a5610 in ngx_http_variables_add_core_vars src/http/ngx_http_variables.c:2662
#7 0x55994946340d in ngx_http_core_preconfiguration src/http/ngx_http_core_module.c:3371
#8 0x5599494567d9 in ngx_http_block src/http/ngx_http.c:229
#9 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#10 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#11 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#12 0x5599493a8789 in main src/core/nginx.c:292
#13 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 4280 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994941a7ec in ngx_alloc src/os/unix/ngx_alloc.c:22
#2 0x5599493ad325 in ngx_palloc_large src/core/ngx_palloc.c:220
#3 0x5599493adc20 in ngx_palloc src/core/ngx_palloc.c:131
#4 0x5599493ae05e in ngx_pcalloc src/core/ngx_palloc.c:302
#5 0x5599493b1561 in ngx_hash_keys_array_init src/core/ngx_hash.c:716
#6 0x5599494a5610 in ngx_http_variables_add_core_vars src/http/ngx_http_variables.c:2662
#7 0x55994946340d in ngx_http_core_preconfiguration src/http/ngx_http_core_module.c:3371
#8 0x5599494567d9 in ngx_http_block src/http/ngx_http.c:229
#9 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#10 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#11 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#12 0x5599493a8789 in main src/core/nginx.c:292
#13 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 4096 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994941a7ec in ngx_alloc src/os/unix/ngx_alloc.c:22
#2 0x5599493ad325 in ngx_palloc_large src/core/ngx_palloc.c:220
#3 0x5599493adc20 in ngx_palloc src/core/ngx_palloc.c:131
#4 0x5599493ae842 in ngx_array_push src/core/ngx_array.c:76
#5 0x5599493b1e62 in ngx_hash_add_key src/core/ngx_hash.c:844
#6 0x5599494a2ca8 in ngx_http_add_variable src/http/ngx_http_variables.c:471
#7 0x5599494a573a in ngx_http_variables_add_core_vars src/http/ngx_http_variables.c:2676
#8 0x55994946340d in ngx_http_core_preconfiguration src/http/ngx_http_core_module.c:3371
#9 0x5599494567d9 in ngx_http_block src/http/ngx_http.c:229
#10 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#11 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#12 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#13 0x5599493a8789 in main src/core/nginx.c:292
#14 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 4096 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994941a7ec in ngx_alloc src/os/unix/ngx_alloc.c:22
#2 0x5599493ad325 in ngx_palloc_large src/core/ngx_palloc.c:220
#3 0x5599493adc20 in ngx_palloc src/core/ngx_palloc.c:131
#4 0x5599493ae842 in ngx_array_push src/core/ngx_array.c:76
#5 0x559949460434 in ngx_http_core_type src/http/ngx_http_core_module.c:3351
#6 0x5599493e49c4 in ngx_conf_parse src/core/ngx_conf_file.c:304
#7 0x55994945fd78 in ngx_http_core_types src/http/ngx_http_core_module.c:3294
#8 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#9 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#10 0x5599493e5dd5 in ngx_conf_include src/core/ngx_conf_file.c:841
#11 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#12 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#13 0x559949456815 in ngx_http_block src/http/ngx_http.c:239
#14 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#15 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#16 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#17 0x5599493a8789 in main src/core/nginx.c:292
#18 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 2921 byte(s) in 3 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994965eac2 in asn1_enc_save (/usr/local/nginx/sbin/nginx+0x3d4ac2)

Indirect leak of 2090 byte(s) in 6 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x559949741def in c2i_ASN1_BIT_STRING (/usr/local/nginx/sbin/nginx+0x4b7def)

Indirect leak of 1494 byte(s) in 60 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x559949657c3a in ASN1_STRING_set (/usr/local/nginx/sbin/nginx+0x3cdc3a)

Indirect leak of 1392 byte(s) in 5 object(s) allocated from:

0 0x7f1595e5ac18 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:164

#1 0x559949709bfb in OPENSSL_sk_insert (/usr/local/nginx/sbin/nginx+0x47fbfb)

Indirect leak of 1128 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994970a1d4 in OPENSSL_sk_dup (/usr/local/nginx/sbin/nginx+0x4801d4)

Indirect leak of 1024 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x5599496b788d in CRYPTO_zalloc (/usr/local/nginx/sbin/nginx+0x42d88d)
#2 0x55994955a280 in ngx_http_ssl_merge_srv_conf src/http/modules/ngx_http_ssl_module.c:725
#3 0x559949456d0d in ngx_http_merge_servers src/http/ngx_http.c:584
#4 0x559949456d0d in ngx_http_block src/http/ngx_http.c:270
#5 0x5599493e5145 in ngx_conf_handler src/core/ngx_conf_file.c:463
#6 0x5599493e5145 in ngx_conf_parse src/core/ngx_conf_file.c:319
#7 0x5599493dd4bc in ngx_init_cycle src/core/ngx_cycle.c:284
#8 0x5599493a8789 in main src/core/nginx.c:292
#9 0x7f1595b15d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Indirect leak of 504 byte(s) in 6 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994967161a in BUF_MEM_grow (/usr/local/nginx/sbin/nginx+0x3e761a)

Indirect leak of 352 byte(s) in 6 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994971b107 in x509_name_canon.part.0 (/usr/local/nginx/sbin/nginx+0x491107)

Indirect leak of 144 byte(s) in 9 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994965dad0 in asn1_primitive_new (/usr/local/nginx/sbin/nginx+0x3d3ad0)

Indirect leak of 32 byte(s) in 1 object(s) allocated from:

0 0x7f1595e5a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x55994970a183 in OPENSSL_sk_dup (/usr/local/nginx/sbin/nginx+0x480183)

SUMMARY: AddressSanitizer: 271582 byte(s) leaked in 321 allocation(s).`

i did not test if your patch is causing it or the nginx version your patch is made for (in the guide you clone an specific version of openssl and nginx) ,even if it's the latter we should change the nginx version so i though i must report this

my os:

root@birds:~# uname -a Linux birds 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux root@birds:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy

phuslu commented 1 year ago

I believe that the "memory leaking" is related with nginx.conf parsing, so it should only happen once and can be ignored. In our production, this module has not been observed a real memory leaking.