You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Rafal Metkowski <ra...@ais.pl> on 2008/07/16 15:22:30 UTC

SSL related memory leak ?

Hi,

I've written small client using Axis2C and I've noticed memory leaks
when connecting to service with https.

I've checked with the valgrind and got following results:
valgrind --leak-check=full
==8057== 58,000 (292 direct, 57,708 indirect) bytes in 1 blocks are
definitely lost in loss record 9 of 9
==8057==    at 0x4006AEE: malloc (vg_replace_malloc.c:207)
==8057==    by 0x7B4E4CD: (within /lib/libcrypto.so.0.9.8g)
==8057==    by 0x7B4EB4E: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8g)
==8057==    by 0x34C529: SSL_new (in /lib/libssl.so.0.9.8g)
==8057==    by 0x40EB9C2: axis2_ssl_utils_initialize_ssl (ssl_utils.c:133)
==8057==    by 0x40EB7E6: axutil_stream_create_ssl (ssl_stream.c:104)
==8057==    by 0x40EABB1: axis2_http_client_send (http_client.c:216)
==8057==    by 0x40E8A9D: axis2_http_sender_send (http_sender.c:1064)
==8057==    by 0x40E32B4: axis2_http_transport_sender_write_message
(http_transport_sender.c:771)
==8057==    by 0x40E3AC3: axis2_http_transport_sender_invoke
(http_transport_sender.c:306)
==8057==    by 0x407DF6A: axis2_engine_send (engine.c:176)
==8057==    by 0x40A5BAB: axis2_op_client_two_way_send (op_client.c:1157)
.......
==8057== LEAK SUMMARY:
==8057==    definitely lost: 332 bytes in 4 blocks.
==8057==    indirectly lost: 57,900 bytes in 596 blocks.
==8057==      possibly lost: 0 bytes in 0 blocks.
==8057==    still reachable: 28,292 bytes in 1,887 blocks.
==8057==         suppressed: 0 bytes in 0 blocks.

As I expected when I changed https to plain http the problem disapeared:
==9065== LEAK SUMMARY:
==9065==    definitely lost: 40 bytes in 3 blocks.
==9065==    indirectly lost: 192 bytes in 6 blocks.
==9065==      possibly lost: 0 bytes in 0 blocks.
==9065==    still reachable: 300 bytes in 3 blocks.
==9065==         suppressed: 0 bytes in 0 blocks.

I looked at the code and it seems axis2_ssl_utils_cleanup_ssl function 
isn't called in case of successful connection.
Is it a bug in Axis2C or am I missing something ?

Thanks for help

Rafal Metkowski


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


Re: SSL related memory leak ?

Posted by Rajika Kumarasiri <ra...@gmail.com>.
On Wed, Jul 16, 2008 at 6:52 PM, Rafal Metkowski <ra...@ais.pl> wrote:

>
> Hi,
>
> I've written small client using Axis2C and I've noticed memory leaks
> when connecting to service with https.
>
> I've checked with the valgrind and got following results:
> valgrind --leak-check=full
> ==8057== 58,000 (292 direct, 57,708 indirect) bytes in 1 blocks are
> definitely lost in loss record 9 of 9
> ==8057==    at 0x4006AEE: malloc (vg_replace_malloc.c:207)
> ==8057==    by 0x7B4E4CD: (within /lib/libcrypto.so.0.9.8g)
> ==8057==    by 0x7B4EB4E: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8g)
> ==8057==    by 0x34C529: SSL_new (in /lib/libssl.so.0.9.8g)
> ==8057==    by 0x40EB9C2: axis2_ssl_utils_initialize_ssl (ssl_utils.c:133)
> ==8057==    by 0x40EB7E6: axutil_stream_create_ssl (ssl_stream.c:104)
> ==8057==    by 0x40EABB1: axis2_http_client_send (http_client.c:216)
> ==8057==    by 0x40E8A9D: axis2_http_sender_send (http_sender.c:1064)
> ==8057==    by 0x40E32B4: axis2_http_transport_sender_write_message
> (http_transport_sender.c:771)
> ==8057==    by 0x40E3AC3: axis2_http_transport_sender_invoke
> (http_transport_sender.c:306)
> ==8057==    by 0x407DF6A: axis2_engine_send (engine.c:176)
> ==8057==    by 0x40A5BAB: axis2_op_client_two_way_send (op_client.c:1157)
> .......
> ==8057== LEAK SUMMARY:
> ==8057==    definitely lost: 332 bytes in 4 blocks.
> ==8057==    indirectly lost: 57,900 bytes in 596 blocks.
> ==8057==      possibly lost: 0 bytes in 0 blocks.
> ==8057==    still reachable: 28,292 bytes in 1,887 blocks.
> ==8057==         suppressed: 0 bytes in 0 blocks.
>
> As I expected when I changed https to plain http the problem disapeared:
> ==9065== LEAK SUMMARY:
> ==9065==    definitely lost: 40 bytes in 3 blocks.
> ==9065==    indirectly lost: 192 bytes in 6 blocks.
> ==9065==      possibly lost: 0 bytes in 0 blocks.
> ==9065==    still reachable: 300 bytes in 3 blocks.
> ==9065==         suppressed: 0 bytes in 0 blocks.
>
> I looked at the code and it seems axis2_ssl_utils_cleanup_ssl function
> isn't called in case of successful connection.
> Is it a bug in Axis2C or am I missing something ?

There seems to be some memory leaks. Can you please raise a JIRA issue here.

http://issues.apache.org/jira/browse/AXIS2C

-Rajika


>
>
> Thanks for help
>
> Rafal Metkowski
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>


-- 
comp.lang.c - http://groups.google.com/group/comp.lang.c/topics