March 25, 2013 10:23PM
i use valgrind to check memory leak, and have detected some error:

==2243== Invalid write of size 1
==2243== at 0x4A08088: memcpy (mc_replace_strmem.c:628)
==2243== by 0x4448C9: ngx_http_proxy_subs_headers (ngx_http_proxy_subs_filter.c:149)
==2243== by 0x45B2FB: ngx_http_proxy_create_request (ngx_http_proxy_module.c:1235)
==2243== by 0x43EA7E: ngx_http_upstream_init_request (ngx_http_upstream.c:505)
==2243== by 0x43EE92: ngx_http_upstream_init (ngx_http_upstream.c:446)
==2243== by 0x4361C0: ngx_http_read_client_request_body (ngx_http_request_body.c:59)
==2243== by 0x459972: ngx_http_proxy_handler (ngx_http_proxy_module.c:703)
==2243== by 0x42BD23: ngx_http_core_content_phase (ngx_http_core_module.c:1396)
==2243== by 0x4269A2: ngx_http_core_run_phases (ngx_http_core_module.c:877)
==2243== by 0x426A9D: ngx_http_handler (ngx_http_core_module.c:860)
==2243== by 0x430661: ngx_http_process_request (ngx_http_request.c:1874)
==2243== by 0x430D97: ngx_http_process_request_headers (ngx_http_request.c:1318)
==2243== Address 0x5a1f29a is not stack'd, malloc'd or (recently) free'd
==2243==
==2243== Invalid write of size 8
==2243== at 0x4A080B3: memcpy (mc_replace_strmem.c:628)
==2243== by 0x4448C9: ngx_http_proxy_subs_headers (ngx_http_proxy_subs_filter.c:149)
==2243== by 0x45B2FB: ngx_http_proxy_create_request (ngx_http_proxy_module.c:1235)
==2243== by 0x43EA7E: ngx_http_upstream_init_request (ngx_http_upstream.c:505)
==2243== by 0x43EE92: ngx_http_upstream_init (ngx_http_upstream.c:446)
==2243== by 0x4361C0: ngx_http_read_client_request_body (ngx_http_request_body.c:59)
==2243== by 0x459972: ngx_http_proxy_handler (ngx_http_proxy_module.c:703)
==2243== by 0x42BD23: ngx_http_core_content_phase (ngx_http_core_module.c:1396)
==2243== by 0x4269A2: ngx_http_core_run_phases (ngx_http_core_module.c:877)
==2243== by 0x426A9D: ngx_http_handler (ngx_http_core_module.c:860)
==2243== by 0x430661: ngx_http_process_request (ngx_http_request.c:1874)


due to ngx_copy() out of bound, and caused by my code. so, i modify the corrspongding code, it's running ok until now.

thanks for Maxim Dounin !
Subject Author Posted

nginx: worker process: malloc(): memory corruption: 0x0000000000b6bdb0 ***

honwel March 15, 2013 04:39AM

Re: nginx: worker process: malloc(): memory corruption: 0x0000000000b6bdb0 ***

Maxim Dounin March 15, 2013 06:10AM

Re: nginx: worker process: malloc(): memory corruption: 0x0000000000b6bdb0 ***

honwel March 15, 2013 07:37AM

Re: nginx: worker process: malloc(): memory corruption: 0x0000000000b6bdb0 ***

honwel March 25, 2013 10:23PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 266
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready