You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Dinesh Premalal <xy...@gmail.com> on 2007/02/23 05:48:52 UTC

[Axis2] Memory leak in process_http_post_request

I'm sure this one is already known, but its a severe one.  In
axis2_http_transport_utils_process_http_post_request(), there is a
soap_builder and two soap_body s that get constructed and never free'd.

It appears as if soap_body is owned by a soap_envelope, which has ownership
transferred to the msg_ctx.  However, in axis2_msg_ctx_free(), the line
AXIOM_SOAP_ENVELOPE_FREE(msg_ctx->soap_envelope, env); is commented out.
Uncommenting it causes crashes.

Also, inserting AXIOM_SOAP_BUILDER_FREE(soap_builder, env) at the end of
axis2_http_transport_utils_process_http_post_request() also causes crashes.

In both cases, it appears to my initial observation to be a cause of a
double free.  I'm wondering what the status of these leaks (and the one from
my previous message) is?  I'm prepared to take them on, unless someone has
already made progress on fixing them.  If not, any pointers on where to
start would be welcome.

For the record, here is a valgrind output related to these issues:

==4430== 8175027 (5800 direct, 8169227 indirect) bytes in 290 blocks are
definitely lost in loss record 1500 of 4864
==4430==    at 0x1B90459D: malloc (vg_replace_malloc.c:130)
==4430==    by 0x81B6FEE: axis2_allocator_malloc_impl (in
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x81AD281: axiom_soap_body_create (in
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x81AFB5B: axiom_soap_builder_construct_node (in
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x81AF50C: axiom_soap_builder_create_om_element (in
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x81AF346: axiom_soap_builder_next (in
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x81AE143: axiom_soap_envelope_get_body (in
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x8173B31: axiom_soap_body_disp_find_svc
(soap_body_disp.c:97)
==4430==    by 0x816021B: axis2_msg_ctx_find_svc (msg_ctx.c:1944)
==4430==    by 0x817357C: axis2_disp_invoke (disp.c:224)
==4430==    by 0x8173F64: axiom_soap_body_disp_invoke (soap_body_disp.c:233)
==4430==    by 0x816FD01: axis2_phase_invoke (phase.c:362)
==4430==
==4430==
==4430== 2385599 (5916 direct, 2379683 indirect) bytes in 87 blocks are
definitely lost in loss record 1506 of 4864
==4430==    at 0x1B90459D: malloc (vg_replace_malloc.c:130)
==4430==    by 0x81B6FEE: axis2_allocator_malloc_impl (in
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x81AEE68: axiom_soap_builder_create (in
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x81929E9: axis2_http_transport_utils_create_soap_msg
(http_transport_utils.c:1178)
==4430==    by 0x818B311: axis2_http_transport_sender_write_message
(http_transport_sender.c:639)
==4430==    by 0x818A535: axis2_http_transport_sender_invoke
(http_transport_sender.c:280)
==4430==    by 0x814F9F8: axis2_engine_send (engine.c:330)
==4430==    by 0x8184D33: axis2_mep_client_two_way_send (mep_client.c:637)
==4430==    by 0x81864F2: axis2_op_client_worker_func (op_client.c:758)
==4430==    by 0x81C168E: dummy_worker (in
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x1B93AE50: pthread_start_thread (in /lib/libpthread-0.10.so)
==4430==    by 0x1BB488A9: clone (in /lib/libc-2.3.2.so)


Thanks again,
Jared

Re: [Axis2] Memory leak in process_http_post_request

Posted by Dinesh Premalal <xy...@gmail.com>.
Hi Jared,
   Samisa has fixed many memory leaks in both server side and the
   client side few moths back. We have noticed that there are some
   newly introduced memory leaks in the code. BTW hope to fix them
   before Axis2/C 1.0 release.Appreciate your effort on finding
   details about this memory leak. We are encouraging you to dig into 
   Axis2/C code base. Could you please raise a jira regarding this
   issue. 

thanks,
Dinesh

ps: please make sure to add "[Axis2]" prefix to address axis2/C
related matters. BTW This is not a hard and fast rule, but it's a
convention that we followed :)

-- 
Dinesh Premalal
dinesh@wso2.com
WSO2, Inc.; http://www.wso2.com/
GPG Key ID : A255955C
GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255 955C

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org