[jira] [Commented] (PROTON-1115) c++: memory leak in ssl examples

2016-02-02 Thread Alan Conway (JIRA)

[ 
https://issues.apache.org/jira/browse/PROTON-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15128646#comment-15128646
 ] 

Alan Conway commented on PROTON-1115:
-

The calls to impl ctor/delete look good now. The fedora 23 valgrind errors 
definitely look like a leak during connection setup:

==17807==by 0x5360AA4: ssl3_get_server_certificate (s3_clnt.c:1228)
==17807==by 0x5365921: ssl3_connect (s3_clnt.c:345)
==17807==by 0x536F453: ssl23_get_server_hello (s23_clnt.c:799)
==17807==by 0x536F453: ssl23_connect (s23_clnt.c:228)

However this could be a problem in the C layer.

> c++: memory leak in ssl examples
> 
>
> Key: PROTON-1115
> URL: https://issues.apache.org/jira/browse/PROTON-1115
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Affects Versions: 0.12.0
>Reporter: Alan Conway
>Assignee: Cliff Jansen
>
> The ssl C++ examples are leaking memory, valgrind output for for ssl follows, 
> the ssl_client_certs example has the same leak.
> Putting printfs in ssl_domain_impl shows it is constructed 34 times and freed 
> 21 times. This might explain the leak, but also seems like an unreasonably 
> large number of ssl_domains for such a simple test.
> {code}
> [aconway@wallace cpp (master $=)]$ pwd; valgrind  --leak-check=full 
> ./ssl_client_cert 'amqps://127.0.0.1:19108/examples' 
> '/home/aconway/proton/examples/cpp/ssl_certs'
> /home/aconway/proton/debug/examples/cpp
> ==16788== Memcheck, a memory error detector
> ==16788== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
> ==16788== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
> ==16788== Command: ./ssl_client_cert amqps://127.0.0.1:19108/examples 
> /home/aconway/proton/examples/cpp/ssl_certs
> ==16788== 
> Inbound server connection connected via SSL.  Protocol: TLSv1/SSLv3
> Inbound client certificate identity CN=test_client
> Outgoing client connection connected via SSL.  Server certificate identity 
> CN=test_server
> Hello World!
> ==16788== 
> ==16788== HEAP SUMMARY:
> ==16788== in use at exit: 185,521 bytes in 3,585 blocks
> ==16788==   total heap usage: 33,114 allocs, 29,529 frees, 3,858,750 bytes 
> allocated
> ==16788== 
> ==16788== 4,913 (200 direct, 4,713 indirect) bytes in 1 blocks are definitely 
> lost in loss record 775 of 780
> ==16788==at 0x4C28C50: malloc (in 
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==16788==by 0x5615997: CRYPTO_malloc (mem.c:342)
> ==16788==by 0x56ECA43: asn1_item_ex_combine_new (tasn_new.c:179)
> ==16788==by 0x56EF4F0: ASN1_item_ex_d2i (tasn_dec.c:390)
> ==16788==by 0x56EFACA: ASN1_item_d2i (tasn_dec.c:146)
> ==16788==by 0x5356AA4: ssl3_get_server_certificate (s3_clnt.c:1228)
> ==16788==by 0x535B921: ssl3_connect (s3_clnt.c:345)
> ==16788==by 0x5365453: ssl23_get_server_hello (s23_clnt.c:799)
> ==16788==by 0x5365453: ssl23_connect (s23_clnt.c:228)
> ==16788==by 0x5365DE1: ssl23_read (s23_lib.c:133)
> ==16788==by 0x53882D4: ssl_read (bio_ssl.c:165)
> ==16788==by 0x56BE06B: BIO_read (bio_lib.c:210)
> ==16788==by 0x5113EB5: process_input_ssl (openssl.c:917)
> ==16788==by 0x50FBA9A: transport_consume (transport.c:1751)
> ==16788==by 0x50FEFEF: pn_transport_process (transport.c:2860)
> ==16788==by 0x5103E99: pni_connection_readable (connection.c:164)
> ==16788==by 0x510DF7D: pn_selectable_readable (selectable.c:204)
> ==16788==by 0x51052CE: pni_handle_quiesced (iohandler.c:41)
> ==16788==by 0x5105505: pn_iodispatch (iohandler.c:103)
> ==16788==by 0x51037B4: pn_handler_dispatch (handler.c:102)
> ==16788==by 0x4E84386: proton::(anonymous 
> namespace)::override_handler::on_unhandled(proton::proton_event&) 
> (container_impl.cpp:107)
> ==16788==by 0x4EA048F: 
> proton::proton_handler::on_reactor_quiesced(proton::proton_event&) 
> (proton_handler.cpp:32)
> ==16788==by 0x4E9F838: 
> proton::proton_event::dispatch(proton::proton_handler&) (proton_event.cpp:105)
> ==16788==by 0x4E84210: proton::(anonymous 
> namespace)::handler_context::dispatch(pn_handler_t*, pn_event_t*, 
> pn_event_type_t) (container_impl.cpp:71)
> ==16788==by 0x51037B4: pn_handler_dispatch (handler.c:102)
> ==16788==by 0x51030F4: pn_reactor_process (reactor.c:404)
> ==16788==by 0x51034DF: pn_reactor_run (reactor.c:480)
> ==16788==by 0x4EA1993: proton::reactor::run() (reactor.cpp:36)
> ==16788==by 0x4E83F11: proton::container::run() (container.cpp:64)
> ==16788==by 0x405B0D: main (ssl_client_cert.cpp:137)
> ==16788== 
> ==16788== 4,913 (200 direct, 4,713 indirect) bytes in 1 blocks are definitely 
> lost in loss record 776 of 780
> ==16788==at 0x4C28C50: malloc (in 
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==16788==by 0x5615997: 

[jira] [Commented] (PROTON-1115) c++: memory leak in ssl examples

2016-02-02 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PROTON-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15128266#comment-15128266
 ] 

ASF subversion and git services commented on PROTON-1115:
-

Commit e4d580b187b74d91ddc4172e32aa98c610a9e510 in qpid-proton's branch 
refs/heads/master from Clifford Jansen
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=e4d580b ]

PROTON-1115: temporary valgrind exclusion to allow normal CI testing


> c++: memory leak in ssl examples
> 
>
> Key: PROTON-1115
> URL: https://issues.apache.org/jira/browse/PROTON-1115
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Affects Versions: 0.12.0
>Reporter: Alan Conway
>Assignee: Cliff Jansen
>
> The ssl C++ examples are leaking memory, valgrind output for for ssl follows, 
> the ssl_client_certs example has the same leak.
> Putting printfs in ssl_domain_impl shows it is constructed 34 times and freed 
> 21 times. This might explain the leak, but also seems like an unreasonably 
> large number of ssl_domains for such a simple test.
> {code}
> [aconway@wallace cpp (master $=)]$ pwd; valgrind  --leak-check=full 
> ./ssl_client_cert 'amqps://127.0.0.1:19108/examples' 
> '/home/aconway/proton/examples/cpp/ssl_certs'
> /home/aconway/proton/debug/examples/cpp
> ==16788== Memcheck, a memory error detector
> ==16788== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
> ==16788== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
> ==16788== Command: ./ssl_client_cert amqps://127.0.0.1:19108/examples 
> /home/aconway/proton/examples/cpp/ssl_certs
> ==16788== 
> Inbound server connection connected via SSL.  Protocol: TLSv1/SSLv3
> Inbound client certificate identity CN=test_client
> Outgoing client connection connected via SSL.  Server certificate identity 
> CN=test_server
> Hello World!
> ==16788== 
> ==16788== HEAP SUMMARY:
> ==16788== in use at exit: 185,521 bytes in 3,585 blocks
> ==16788==   total heap usage: 33,114 allocs, 29,529 frees, 3,858,750 bytes 
> allocated
> ==16788== 
> ==16788== 4,913 (200 direct, 4,713 indirect) bytes in 1 blocks are definitely 
> lost in loss record 775 of 780
> ==16788==at 0x4C28C50: malloc (in 
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==16788==by 0x5615997: CRYPTO_malloc (mem.c:342)
> ==16788==by 0x56ECA43: asn1_item_ex_combine_new (tasn_new.c:179)
> ==16788==by 0x56EF4F0: ASN1_item_ex_d2i (tasn_dec.c:390)
> ==16788==by 0x56EFACA: ASN1_item_d2i (tasn_dec.c:146)
> ==16788==by 0x5356AA4: ssl3_get_server_certificate (s3_clnt.c:1228)
> ==16788==by 0x535B921: ssl3_connect (s3_clnt.c:345)
> ==16788==by 0x5365453: ssl23_get_server_hello (s23_clnt.c:799)
> ==16788==by 0x5365453: ssl23_connect (s23_clnt.c:228)
> ==16788==by 0x5365DE1: ssl23_read (s23_lib.c:133)
> ==16788==by 0x53882D4: ssl_read (bio_ssl.c:165)
> ==16788==by 0x56BE06B: BIO_read (bio_lib.c:210)
> ==16788==by 0x5113EB5: process_input_ssl (openssl.c:917)
> ==16788==by 0x50FBA9A: transport_consume (transport.c:1751)
> ==16788==by 0x50FEFEF: pn_transport_process (transport.c:2860)
> ==16788==by 0x5103E99: pni_connection_readable (connection.c:164)
> ==16788==by 0x510DF7D: pn_selectable_readable (selectable.c:204)
> ==16788==by 0x51052CE: pni_handle_quiesced (iohandler.c:41)
> ==16788==by 0x5105505: pn_iodispatch (iohandler.c:103)
> ==16788==by 0x51037B4: pn_handler_dispatch (handler.c:102)
> ==16788==by 0x4E84386: proton::(anonymous 
> namespace)::override_handler::on_unhandled(proton::proton_event&) 
> (container_impl.cpp:107)
> ==16788==by 0x4EA048F: 
> proton::proton_handler::on_reactor_quiesced(proton::proton_event&) 
> (proton_handler.cpp:32)
> ==16788==by 0x4E9F838: 
> proton::proton_event::dispatch(proton::proton_handler&) (proton_event.cpp:105)
> ==16788==by 0x4E84210: proton::(anonymous 
> namespace)::handler_context::dispatch(pn_handler_t*, pn_event_t*, 
> pn_event_type_t) (container_impl.cpp:71)
> ==16788==by 0x51037B4: pn_handler_dispatch (handler.c:102)
> ==16788==by 0x51030F4: pn_reactor_process (reactor.c:404)
> ==16788==by 0x51034DF: pn_reactor_run (reactor.c:480)
> ==16788==by 0x4EA1993: proton::reactor::run() (reactor.cpp:36)
> ==16788==by 0x4E83F11: proton::container::run() (container.cpp:64)
> ==16788==by 0x405B0D: main (ssl_client_cert.cpp:137)
> ==16788== 
> ==16788== 4,913 (200 direct, 4,713 indirect) bytes in 1 blocks are definitely 
> lost in loss record 776 of 780
> ==16788==at 0x4C28C50: malloc (in 
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==16788==by 0x5615997: CRYPTO_malloc (mem.c:342)
> ==16788==by 0x56ECA43: asn1_item_ex_combine_new (tasn_new.c:179)
> ==16788==by 0x56EF4F0: 

[jira] [Commented] (PROTON-1115) c++: memory leak in ssl examples

2016-02-02 Thread Cliff Jansen (JIRA)

[ 
https://issues.apache.org/jira/browse/PROTON-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15128272#comment-15128272
 ] 

Cliff Jansen commented on PROTON-1115:
--

Since PROTON-1119, I see exactly two ssl_domain_impl constructor calls and two 
matching delete()'s.

The valgrind errors appear exactly the same.  They appear to occur during IO 
activity as opposed to IO setup/configuration.

I have checked in a temporary change to turn off valgrind for SSL so that CI 
stops blowing up everywhere.  But I will leave this JIRA open pending further 
investigation.


> c++: memory leak in ssl examples
> 
>
> Key: PROTON-1115
> URL: https://issues.apache.org/jira/browse/PROTON-1115
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: cpp-binding
>Affects Versions: 0.12.0
>Reporter: Alan Conway
>Assignee: Cliff Jansen
>
> The ssl C++ examples are leaking memory, valgrind output for for ssl follows, 
> the ssl_client_certs example has the same leak.
> Putting printfs in ssl_domain_impl shows it is constructed 34 times and freed 
> 21 times. This might explain the leak, but also seems like an unreasonably 
> large number of ssl_domains for such a simple test.
> {code}
> [aconway@wallace cpp (master $=)]$ pwd; valgrind  --leak-check=full 
> ./ssl_client_cert 'amqps://127.0.0.1:19108/examples' 
> '/home/aconway/proton/examples/cpp/ssl_certs'
> /home/aconway/proton/debug/examples/cpp
> ==16788== Memcheck, a memory error detector
> ==16788== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
> ==16788== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
> ==16788== Command: ./ssl_client_cert amqps://127.0.0.1:19108/examples 
> /home/aconway/proton/examples/cpp/ssl_certs
> ==16788== 
> Inbound server connection connected via SSL.  Protocol: TLSv1/SSLv3
> Inbound client certificate identity CN=test_client
> Outgoing client connection connected via SSL.  Server certificate identity 
> CN=test_server
> Hello World!
> ==16788== 
> ==16788== HEAP SUMMARY:
> ==16788== in use at exit: 185,521 bytes in 3,585 blocks
> ==16788==   total heap usage: 33,114 allocs, 29,529 frees, 3,858,750 bytes 
> allocated
> ==16788== 
> ==16788== 4,913 (200 direct, 4,713 indirect) bytes in 1 blocks are definitely 
> lost in loss record 775 of 780
> ==16788==at 0x4C28C50: malloc (in 
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==16788==by 0x5615997: CRYPTO_malloc (mem.c:342)
> ==16788==by 0x56ECA43: asn1_item_ex_combine_new (tasn_new.c:179)
> ==16788==by 0x56EF4F0: ASN1_item_ex_d2i (tasn_dec.c:390)
> ==16788==by 0x56EFACA: ASN1_item_d2i (tasn_dec.c:146)
> ==16788==by 0x5356AA4: ssl3_get_server_certificate (s3_clnt.c:1228)
> ==16788==by 0x535B921: ssl3_connect (s3_clnt.c:345)
> ==16788==by 0x5365453: ssl23_get_server_hello (s23_clnt.c:799)
> ==16788==by 0x5365453: ssl23_connect (s23_clnt.c:228)
> ==16788==by 0x5365DE1: ssl23_read (s23_lib.c:133)
> ==16788==by 0x53882D4: ssl_read (bio_ssl.c:165)
> ==16788==by 0x56BE06B: BIO_read (bio_lib.c:210)
> ==16788==by 0x5113EB5: process_input_ssl (openssl.c:917)
> ==16788==by 0x50FBA9A: transport_consume (transport.c:1751)
> ==16788==by 0x50FEFEF: pn_transport_process (transport.c:2860)
> ==16788==by 0x5103E99: pni_connection_readable (connection.c:164)
> ==16788==by 0x510DF7D: pn_selectable_readable (selectable.c:204)
> ==16788==by 0x51052CE: pni_handle_quiesced (iohandler.c:41)
> ==16788==by 0x5105505: pn_iodispatch (iohandler.c:103)
> ==16788==by 0x51037B4: pn_handler_dispatch (handler.c:102)
> ==16788==by 0x4E84386: proton::(anonymous 
> namespace)::override_handler::on_unhandled(proton::proton_event&) 
> (container_impl.cpp:107)
> ==16788==by 0x4EA048F: 
> proton::proton_handler::on_reactor_quiesced(proton::proton_event&) 
> (proton_handler.cpp:32)
> ==16788==by 0x4E9F838: 
> proton::proton_event::dispatch(proton::proton_handler&) (proton_event.cpp:105)
> ==16788==by 0x4E84210: proton::(anonymous 
> namespace)::handler_context::dispatch(pn_handler_t*, pn_event_t*, 
> pn_event_type_t) (container_impl.cpp:71)
> ==16788==by 0x51037B4: pn_handler_dispatch (handler.c:102)
> ==16788==by 0x51030F4: pn_reactor_process (reactor.c:404)
> ==16788==by 0x51034DF: pn_reactor_run (reactor.c:480)
> ==16788==by 0x4EA1993: proton::reactor::run() (reactor.cpp:36)
> ==16788==by 0x4E83F11: proton::container::run() (container.cpp:64)
> ==16788==by 0x405B0D: main (ssl_client_cert.cpp:137)
> ==16788== 
> ==16788== 4,913 (200 direct, 4,713 indirect) bytes in 1 blocks are definitely 
> lost in loss record 776 of 780
> ==16788==at 0x4C28C50: malloc (in 
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==16788==by 0x5615997: CRYPTO_malloc (mem.c:342)
>