You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/13 08:10:52 UTC
[GitHub] [pulsar] paladin-dalao opened a new issue #13267: Pulsar CPP client mem leak
paladin-dalao opened a new issue #13267:
URL: https://github.com/apache/pulsar/issues/13267
**Describe the bug**
pulsar host can't connect successfuly,
send pulsar will mem leak
**To Reproduce**
Steps to reproduce the behavior:
1. Config pulsar host can't connect successfully
2. Send a msg
**Expected behavior**
If Pulsar fails to connect, each message will leak memory
Code:
```c++
m_conf = pulsar_client_configuration_create();
pulsar_client_configuration_set_logger(m_conf, PulsarProducer::pulsar_logger, (void*)this);
m_client = pulsar_client_create(service_url.c_str(), m_conf);
pulsar_result err = pulsar_client_create_producer(m_client, topic.c_str(), producer_conf, &producer);
if (err != pulsar_result_Ok) {
LOG_ERROR("Failed to create producer: %s\n", pulsar_result_str(err));
pulsar_producer_configuration_free(producer_conf);
return NULL;
}
```
**Screenshots**
valgrind
==00:00:41:04.793 10873== 592 bytes in 1 blocks are possibly lost in loss record 2,589 of 2,878
==00:00:41:04.793 10873== at 0x4C2BFD9: calloc (vg_replace_malloc.c:762)
==00:00:41:04.793 10873== by 0x4012774: _dl_allocate_tls (in /usr/lib64/ld-2.17.so)
==00:00:41:04.793 10873== by 0x505588B: pthread_create@@GLIBC_2.2.5 (in /usr/lib64/libpthread-2.17.so)
==00:00:41:04.793 10873== by 0x13AE17E: __gthread_create (gthr-default.h:662)
==00:00:41:04.793 10873== by 0x13AE17E: std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>) (thread.cc:142)
==00:00:41:04.793 10873== by 0xCDB4B1: thread<std::_Bind<std::_Mem_fn<void (pulsar::ExecutorService::*)(std::shared_ptr<boost::asio::io_service>)>(pulsar::ExecutorService*, std::shared_ptr<boost::asio::io_service>)> > (thread:135)
==00:00:41:04.793 10873== by 0xCDB4B1: pulsar::ExecutorService::ExecutorService() (ExecutorService.cc:30)
==00:00:41:04.793 10873== by 0xCDB716: construct<pulsar::ExecutorService> (shared_ptr_base.h:396)
==00:00:41:04.793 10873== by 0xCDB716: _S_construct<pulsar::ExecutorService> (alloc_traits.h:254)
==00:00:41:04.793 10873== by 0xCDB716: construct<pulsar::ExecutorService> (alloc_traits.h:393)
==00:00:41:04.793 10873== by 0xCDB716: _Sp_counted_ptr_inplace<> (shared_ptr_base.h:399)
==00:00:41:04.793 10873== by 0xCDB716: construct<std::_Sp_counted_ptr_inplace<pulsar::ExecutorService, std::allocator<pulsar::ExecutorService>, (__gnu_cxx::_Lock_policy)2u>, const std::allocator<pulsar::ExecutorService> > (new_allocator.h:120)
==00:00:41:04.793 10873== by 0xCDB716: _S_construct<std::_Sp_counted_ptr_inplace<pulsar::ExecutorService, std::allocator<pulsar::ExecutorService>, (__gnu_cxx::_Lock_policy)2u>, const std::allocator<pulsar::ExecutorService> > (alloc_traits.h:254)
==00:00:41:04.793 10873== by 0xCDB716: construct<std::_Sp_counted_ptr_inplace<pulsar::ExecutorService, std::allocator<pulsar::ExecutorService>, (__gnu_cxx::_Lock_policy)2u>, const std::allocator<pulsar::ExecutorService> > (alloc_traits.h:393)
==00:00:41:04.793 10873== by 0xCDB716: __shared_count<pulsar::ExecutorService, std::allocator<pulsar::ExecutorService> > (shared_ptr_base.h:502)
==00:00:41:04.793 10873== by 0xCDB716: __shared_ptr<std::allocator<pulsar::ExecutorService> > (shared_ptr_base.h:957)
==00:00:41:04.793 10873== by 0xCDB716: shared_ptr<std::allocator<pulsar::ExecutorService> > (shared_ptr.h:316)
==00:00:41:04.793 10873== by 0xCDB716: allocate_shared<pulsar::ExecutorService, std::allocator<pulsar::ExecutorService> > (shared_ptr.h:598)
==00:00:41:04.793 10873== by 0xCDB716: make_shared<pulsar::ExecutorService> (shared_ptr.h:614)
==00:00:41:04.793 10873== by 0xCDB716: pulsar::ExecutorServiceProvider::get() (ExecutorService.cc:91)
==00:00:41:04.793 10873== by 0xCC5BE9: pulsar::ConnectionPool::getConnectionAsync(std::string const&, std::string const&) (ConnectionPool.cc:83)
==00:00:41:04.793 10873== by 0xDA61FF: pulsar::BinaryProtoLookupService::getPartitionMetadataAsync(std::shared_ptr<pulsar::TopicName> const&) (BinaryProtoLookupService.cc:72)
==00:00:41:04.793 10873== by 0xCB7C84: pulsar::ClientImpl::createProducerAsync(std::string const&, pulsar::ProducerConfiguration, std::function<void (pulsar::Result, pulsar::Producer)>) (ClientImpl.cc:158)
==00:00:41:04.793 10873== by 0xCB2074: pulsar::Client::createProducerAsync(std::string const&, pulsar::ProducerConfiguration, std::function<void (pulsar::Result, pulsar::Producer)>) (Client.cc:65)
==00:00:41:04.793 10873== by 0xCB27D9: pulsar::Client::createProducer(std::string const&, pulsar::ProducerConfiguration const&, pulsar::Producer&) (Client.cc:53)
==00:00:41:04.793 10873== by 0xCA6AED: pulsar_client_create_producer (c_Client.cc:37)
==00:00:41:04.793 10873==
==00:00:41:04.793 10873== 592 bytes in 1 blocks are possibly lost in loss record 2,590 of 2,878
==00:00:41:04.793 10873== at 0x4C2BFD9: calloc (vg_replace_malloc.c:762)
==00:00:41:04.793 10873== by 0x4012774: _dl_allocate_tls (in /usr/lib64/ld-2.17.so)
==00:00:41:04.793 10873== by 0x505588B: pthread_create@@GLIBC_2.2.5 (in /usr/lib64/libpthread-2.17.so)
==00:00:41:04.793 10873== by 0xDC28CC: start_thread (posix_thread.ipp:50)
==00:00:41:04.793 10873== by 0xDC28CC: posix_thread<boost::asio::detail::resolver_service_base::work_io_service_runner> (posix_thread.hpp:45)
==00:00:41:04.793 10873== by 0xDC28CC: start_work_thread (resolver_service_base.ipp:122)
==00:00:41:04.793 10873== by 0xDC28CC: start_resolve_op (resolver_service_base.ipp:111)
==00:00:41:04.793 10873== by 0xDC28CC: void boost::asio::detail::resolver_service<boost::asio::ip::tcp>::async_resolve<std::_Bind<std::_Mem_fn<void (pulsar::ClientConnection::*)(boost::system::error_code const&, boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>)> (std::shared_ptr<pulsar::ClientConnection>, std::_Placeholder<1>, std::_Placeholder<2>)> >(std::shared_ptr<void>&, boost::asio::ip::basic_resolver_query<boost::asio::ip::tcp> const&, std::_Bind<std::_Mem_fn<void (pulsar::ClientConnection::*)(boost::system::error_code const&, boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>)> (std::shared_ptr<pulsar::ClientConnection>, std::_Placeholder<1>, std::_Placeholder<2>)>&) (resolver_service.hpp:83)
==00:00:41:04.793 10873== by 0xDAD709: async_resolve<std::_Bind<std::_Mem_fn<void (pulsar::ClientConnection::*)(const boost::system::error_code&, boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>)>(std::shared_ptr<pulsar::ClientConnection>, std::_Placeholder<1>, std::_Placeholder<2>)> > (resolver_service.hpp:117)
==00:00:41:04.793 10873== by 0xDAD709: async_resolve<std::_Bind<std::_Mem_fn<void (pulsar::ClientConnection::*)(const boost::system::error_code&, boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>)>(std::shared_ptr<pulsar::ClientConnection>, std::_Placeholder<1>, std::_Placeholder<2>)> > (basic_resolver.hpp:167)
==00:00:41:04.793 10873== by 0xDAD709: pulsar::ClientConnection::tcpConnectAsync() (ClientConnection.cc:470)
==00:00:41:04.793 10873== by 0xCC5D69: pulsar::ConnectionPool::getConnectionAsync(std::string const&, std::string const&) (ConnectionPool.cc:92)
==00:00:41:04.793 10873== by 0xDA61FF: pulsar::BinaryProtoLookupService::getPartitionMetadataAsync(std::shared_ptr<pulsar::TopicName> const&) (BinaryProtoLookupService.cc:72)
==00:00:41:04.793 10873== by 0xCB7C84: pulsar::ClientImpl::createProducerAsync(std::string const&, pulsar::ProducerConfiguration, std::function<void (pulsar::Result, pulsar::Producer)>) (ClientImpl.cc:158)
==00:00:41:04.793 10873== by 0xCB2074: pulsar::Client::createProducerAsync(std::string const&, pulsar::ProducerConfiguration, std::function<void (pulsar::Result, pulsar::Producer)>) (Client.cc:65)
==00:00:41:04.793 10873== by 0xCB27D9: pulsar::Client::createProducer(std::string const&, pulsar::ProducerConfiguration const&, pulsar::Producer&) (Client.cc:53)
==00:00:41:04.793 10873== by 0xCA6AED: pulsar_client_create_producer (c_Client.cc:37)
==00:00:41:04.793 10873== by 0xBAE2EA: PulsarProducer::newProducer(std::string const&) (pulsar_producer.cpp:108)
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
**Additional context**
Add any other context about the problem here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] batilak commented on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
batilak commented on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-1074184173
Any progress / solution / work-around for this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] paladin-dalao edited a comment on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
paladin-dalao edited a comment on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-1004737252
**8192 bytes lost in 2 blocks (one of them allocated at 34457959.603612), from following call stack:**
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_op.cc:52
??:?
/usr/local/include/boost/regex/v4/perl_matcher_non_recursive.hpp:109
/usr/local/include/boost/regex/v4/regex_match.hpp:50
/usr/local/include/boost/smart_ptr/detail/shared_count.hpp:371
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/NamespaceName.cc:85
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/NamespaceName.cc:66
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:790
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/TopicName.cc:194
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:574
**2624 bytes lost in 64 blocks (one of them allocated at 34457962.406991), from following call stack:**
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_op.cc:52
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.tcc:609
/usr/include/c++/4.8.2/bits/basic_string.h:356
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.h:275
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/LogUtils.cc:64
/usr/include/c++/4.8.2/bits/basic_string.h:539
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientConnection.cc:482
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:545
/usr/local/include/boost/asio/detail/impl/task_io_service.ipp:386
/usr/local/include/boost/system/error_code.hpp:365
**800904 bytes lost in 7701 blocks (one of them allocated at 34457987.092830), from following call stack:**
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_op.cc:52
/usr/local/include/boost/asio/detail/impl/strand_service.ipp:84
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:452
/usr/include/c++/4.8.2/functional:1336
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientImpl.cc:158 (discriminator 4)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:65 (discriminator 1)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:53 (discriminator 1)
/usr/include/c++/4.8.2/bits/basic_string.h:293 (discriminator 1)
/data/workspace/dev_external_merger_compile/gse-main/source/gse-data/server_data/exporter/pulsar/pulsar_producer.cpp:183
/data/workspace/dev_external_merger_compile/gse-main/source/gse-data/server_data/exporter/pulsar/pulsar_producer.cpp:213
1536 bytes lost in 64 blocks (one of them allocated at 34457962.560336), from following call stack:
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_op.cc:52
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:286
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:589
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ConnectionPool.cc:83 (discriminator 1)
/usr/include/c++/4.8.2/functional:1336
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientImpl.cc:158 (discriminator 4)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:65 (discriminator 1)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:53 (discriminator 1)
/usr/include/c++/4.8.2/bits/basic_string.h:293 (discriminator 1)
/data/workspace/dev_external_merger_compile/gse-main/source/gse-data/server_data/exporter/pulsar/pulsar_producer.cpp:183
**192 bytes lost in 8 blocks (one of them allocated at 34457959.630838), from following call stack:**
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_opnt.cc:44
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/atexit_thread.cc:131
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientConnection.cc:41 (discriminator 1)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientConnection.cc:467
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:790
/usr/include/c++/4.8.2/functional:1336
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientImpl.cc:158 (discriminator 4)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:65 (discriminator 1)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:53 (discriminator 1)
/usr/include/c++/4.8.2/bits/basic_string.h:293 (discriminator 1)
@BewareMyPower These are memleak callstack
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] BewareMyPower commented on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-1004918449
Could you try the code in master branch? It's compatible with older Pulsar broker.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] BewareMyPower commented on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-992405157
What's your C++ client version? I see
```
==00:00:41:04.793 10873== by 0xCDB4B1: thread<std::_Bind<std::_Mem_fn<void (pulsar::ExecutorService::*)(std::shared_ptr<boost::asio::io_service>)>(pulsar::ExecutorService*, std::shared_ptr<boost::asio::io_service>)> > (thread:135)
==00:00:41:04.793 10873== by 0xCDB4B1: pulsar::ExecutorService::ExecutorService() (ExecutorService.cc:30)
```
The constructor of `ExecutorService` starts a thread. However, some refactors have been introduced after #12427, please check again with latest master.
BTW, could you upload a (minimum) whole code file and the valgrind command so that I can try to reproduce it in my local env?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] paladin-dalao edited a comment on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
paladin-dalao edited a comment on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-993218032
> What's your C++ client version? I see
>
> ```
> ==00:00:41:04.793 10873== by 0xCDB4B1: thread<std::_Bind<std::_Mem_fn<void (pulsar::ExecutorService::*)(std::shared_ptr<boost::asio::io_service>)>(pulsar::ExecutorService*, std::shared_ptr<boost::asio::io_service>)> > (thread:135)
> ==00:00:41:04.793 10873== by 0xCDB4B1: pulsar::ExecutorService::ExecutorService() (ExecutorService.cc:30)
> ```
>
> The constructor of `ExecutorService` starts a thread. However, some refactors have been introduced after #12427, please check again with latest master.
>
> BTW, could you upload a (minimum) whole code file and the valgrind command so that I can try to reproduce it in my local env?
1 . gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
2. Test like this, create producer failed
```
#include <pulsar/c/client.h>
#include <stdio.h>
#include <string.h>
int main() {
pulsar_client_configuration_t *conf = pulsar_client_configuration_create();
pulsar_client_t *client = pulsar_client_create("pulsar://localhost:6650", conf);
pulsar_producer_configuration_t* producer_conf = pulsar_producer_configuration_create();
pulsar_producer_configuration_set_batching_enabled(producer_conf, 1);
pulsar_producer_t *producer;
for (int i = 0; i < 1000; i++) {
pulsar_result err = pulsar_client_create_producer(client, "my-topic", producer_conf, &producer);
if (err != pulsar_result_Ok) {
printf("Failed to create producer: %s\n", pulsar_result_str(err));
pulsar_producer_configuration_free(producer_conf);
continue;
}
pulsar_producer_close(producer);
pulsar_producer_free(producer);
pulsar_producer_configuration_free(producer_conf);
}
pulsar_client_close(client);
pulsar_client_free(client);
pulsar_client_configuration_free(conf);
}
```
@BewareMyPower
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] paladin-dalao commented on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
paladin-dalao commented on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-1005443344
>
104960 bytes lost in 64 blocks (one of them allocated at 34542804.906951), from following call stack:
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_op.cc:52
/usr/local/include/boost/asio/detail/impl/service_registry.hpp:81
/usr/local/include/boost/asio/detail/impl/service_registry.ipp:124
/usr/local/include/boost/asio/detail/posix_mutex.hpp:52 (discriminator 4)
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:452
/usr/include/c++/4.8.2/functional:1336
/data/pulsar-master/pulsar-client-cpp/lib/ClientImpl.cc:165 (discriminator 4)
/data/pulsar-master/pulsar-client-cpp/lib/Client.cc:65 (discriminator 1)
/data/pulsar-master/pulsar-client-cpp/lib/Client.cc:53 (discriminator 1)
/usr/include/c++/4.8.2/bits/basic_string.h:293 (discriminator 1)
Using the master code test, there is still a memory leak problem
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] paladin-dalao commented on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
paladin-dalao commented on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-1076421887
>
NO
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] paladin-dalao commented on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
paladin-dalao commented on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-1004737252
8192 bytes lost in 2 blocks (one of them allocated at 34457959.603612), from following call stack:
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_op.cc:52
??:?
/usr/local/include/boost/regex/v4/perl_matcher_non_recursive.hpp:109
/usr/local/include/boost/regex/v4/regex_match.hpp:50
/usr/local/include/boost/smart_ptr/detail/shared_count.hpp:371
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/NamespaceName.cc:85
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/NamespaceName.cc:66
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:790
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/TopicName.cc:194
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:574
2624 bytes lost in 64 blocks (one of them allocated at 34457962.406991), from following call stack:
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_op.cc:52
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.tcc:609
/usr/include/c++/4.8.2/bits/basic_string.h:356
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.h:275
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/LogUtils.cc:64
/usr/include/c++/4.8.2/bits/basic_string.h:539
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientConnection.cc:482
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:545
/usr/local/include/boost/asio/detail/impl/task_io_service.ipp:386
/usr/local/include/boost/system/error_code.hpp:365
800904 bytes lost in 7701 blocks (one of them allocated at 34457987.092830), from following call stack:
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_op.cc:52
/usr/local/include/boost/asio/detail/impl/strand_service.ipp:84
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:452
/usr/include/c++/4.8.2/functional:1336
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientImpl.cc:158 (discriminator 4)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:65 (discriminator 1)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:53 (discriminator 1)
/usr/include/c++/4.8.2/bits/basic_string.h:293 (discriminator 1)
/data/workspace/dev_external_merger_compile/gse-main/source/gse-data/server_data/exporter/pulsar/pulsar_producer.cpp:183
/data/workspace/dev_external_merger_compile/gse-main/source/gse-data/server_data/exporter/pulsar/pulsar_producer.cpp:213
1536 bytes lost in 64 blocks (one of them allocated at 34457962.560336), from following call stack:
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_op.cc:52
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:286
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:589
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ConnectionPool.cc:83 (discriminator 1)
/usr/include/c++/4.8.2/functional:1336
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientImpl.cc:158 (discriminator 4)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:65 (discriminator 1)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:53 (discriminator 1)
/usr/include/c++/4.8.2/bits/basic_string.h:293 (discriminator 1)
/data/workspace/dev_external_merger_compile/gse-main/source/gse-data/server_data/exporter/pulsar/pulsar_producer.cpp:183
192 bytes lost in 8 blocks (one of them allocated at 34457959.630838), from following call stack:
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/new_opnt.cc:44
/data/gse/gse_com_lib_src/gcc-4.8.2/x86_64-redhat-linux/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/atexit_thread.cc:131
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientConnection.cc:41 (discriminator 1)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientConnection.cc:467
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:790
/usr/include/c++/4.8.2/functional:1336
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/ClientImpl.cc:158 (discriminator 4)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:65 (discriminator 1)
/data/workroom/pulsar-2.6.4/pulsar-client-cpp/lib/Client.cc:53 (discriminator 1)
/usr/include/c++/4.8.2/bits/basic_string.h:293 (discriminator 1)
@BewareMyPower These are memleak callstack
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] github-actions[bot] commented on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-1051439365
The issue had no activity for 30 days, mark with Stale label.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] paladin-dalao commented on issue #13267: Pulsar CPP client mem leak
Posted by GitBox <gi...@apache.org>.
paladin-dalao commented on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-993218032
> What's your C++ client version? I see
>
> ```
> ==00:00:41:04.793 10873== by 0xCDB4B1: thread<std::_Bind<std::_Mem_fn<void (pulsar::ExecutorService::*)(std::shared_ptr<boost::asio::io_service>)>(pulsar::ExecutorService*, std::shared_ptr<boost::asio::io_service>)> > (thread:135)
> ==00:00:41:04.793 10873== by 0xCDB4B1: pulsar::ExecutorService::ExecutorService() (ExecutorService.cc:30)
> ```
>
> The constructor of `ExecutorService` starts a thread. However, some refactors have been introduced after #12427, please check again with latest master.
>
> BTW, could you upload a (minimum) whole code file and the valgrind command so that I can try to reproduce it in my local env?
1 . gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
2. Test like this, create producer failed
```
#include <pulsar/c/client.h>
#include <stdio.h>
#include <string.h>
int main() {
pulsar_client_configuration_t *conf = pulsar_client_configuration_create();
pulsar_client_t *client = pulsar_client_create("pulsar://localhost:6650", conf);
pulsar_producer_configuration_t* producer_conf = pulsar_producer_configuration_create();
pulsar_producer_configuration_set_batching_enabled(producer_conf, 1);
pulsar_producer_t *producer;
for (int i = 0; i < 1000; i++) {
pulsar_result err = pulsar_client_create_producer(client, "my-topic", producer_conf, &producer);
if (err != pulsar_result_Ok) {
printf("Failed to create producer: %s\n", pulsar_result_str(err));
pulsar_producer_configuration_free(producer_conf);
continue;
}
pulsar_producer_close(producer);
pulsar_producer_free(producer);
pulsar_producer_configuration_free(producer_conf);
}
pulsar_client_close(client);
pulsar_client_free(client);
pulsar_client_configuration_free(conf);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org