apache / rocketmq-client-cpp

Apache RocketMQ cpp client
https://rocketmq.apache.org/
Apache License 2.0
366 stars 158 forks source link

Core dump on runtime #321

Open YunL0ngLee opened 4 years ago

YunL0ngLee commented 4 years ago

OS: Centos7

client version:2.2.0

RocketMQ version:4.7.1

----------------------test code-------------------------------

include

include

include

include

include "CPushConsumer.h"

include "CMessageExt.h"

include <boost/asio.hpp>

using namespace std;

// consume message int doConsumeMessage(struct CPushConsumer consumer, CMessageExt msgExt) { cout << "[Consume Message] " << "MsgTopic:" << GetMessageTopic(msgExt) << ", MsgTags:" << GetMessageTags(msgExt) << ", MsgKeys:" << GetMessageKeys(msgExt) << ", MsgBody:" << GetMessageBody(msgExt) << endl;

return E_CONSUME_SUCCESS;

}

int main(int argc, char argv[]) { cout << "Push consumer Initializing...." << endl; // create push consumer and set some values for it CPushConsumer consumer = CreatePushConsumer("AccountBalance"); SetPushConsumerNameServerAddress(consumer, "localhost:9876"); Subscribe(consumer, "AccountBalance", ""); // register message callback RegisterMessageCallback(consumer, doConsumeMessage); // start push consumer StartPushConsumer(consumer); cout << "Push consumer start, and listening message within 1min..." << endl; for (int i = 0; i < 6; i++) { cout << "Already Running: " << (i 10) << "S" << endl; usleep(10000000); } // shutdown push consumer ShutdownPushConsumer(consumer); // destroy push consumer DestroyPushConsumer(consumer); cout << "PushConsumer Shutdown!" << endl;

return 0;

}

----------------------end-------------------------------

GDB LOG: GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-115.el7 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/eddid/Test/kafkatest/src/a.out...(no debugging symbols found)...done. [New LWP 60581] [New LWP 60583] [New LWP 60584] [New LWP 60582] [New LWP 60590] [New LWP 60593] [New LWP 60585] [New LWP 60586] [New LWP 60579] [New LWP 60577] [New LWP 60591] [New LWP 60580] [New LWP 60594] [New LWP 60574] [New LWP 60595] [New LWP 60573] [New LWP 60575] [New LWP 60589] [New LWP 60578] [New LWP 60587] [New LWP 60588] [New LWP 60576] [New LWP 60592] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `./a.out'. Program terminated with signal 11, Segmentation fault.

0 0x0000000000405972 in boost::system::error_category::operator==(boost::system::error_category const&) const ()

Missing separate debuginfos, use: debuginfo-install glibc-2.17-292.el7.x86_64 libgcc-4.8.5-39.el7.x86_64 libstdc++-4.8.5-39.el7.x86_64 zlib-1.2.7-18.el7.x86_64 (gdb) bt

0 0x0000000000405972 in boost::system::error_category::operator==(boost::system::error_category const&) const ()

1 0x0000000000405dd1 in boost::system::error_category::equivalent(boost::system::error_code const&, int) const ()

2 0x00007f884839103a in rocketmq::TcpRemotingClient::handleAsyncRequestTimeout(boost::system::error_code const&, int) () from /usr/local/lib/librocketmq.so

3 0x00007f8848392aa1 in boost::asio::detail::wait_handler<boost::_bi::bind_t<void, boost::_mfi::mf2<void, rocketmq::TcpRemotingClient, boost::system::error_code const&, int>, boost::_bi::list3<boost::_bi::value<rocketmq::TcpRemotingClient>, boost::arg<1> ()(), boost::_bi::value > > >::do_complete(boost::asio::detail::task_io_service, boost::asio::detail::task_io_service_operation, boost::system::error_code const&, unsigned long) () from /usr/local/lib/librocketmq.so

4 0x00007f88482e342a in boost::asio::detail::task_io_service::run(boost::system::error_code&) ()

from /usr/local/lib/librocketmq.so

5 0x00007f884838e71e in rocketmq::TcpRemotingClient::boost_asio_work() ()

from /usr/local/lib/librocketmq.so

6 0x00007f88483e1ede in thread_proxy () from /usr/local/lib/librocketmq.so

7 0x00007f8847ecae65 in start_thread () from /lib64/libpthread.so.0

8 0x00007f8846db288d in clone () from /lib64/libc.so.6

I think cause it due to used boost.Is it a bug?

ifplusor commented 3 years ago

@YunL0ngLee Could you test this case in re_dev branch?