-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
极高概率出现此种异常
产生原因:在配置文件里面配置redis的连接,然后再在main里面初始化的时候再去进行主动连接
drogon::app().createDbClient("mysql", "127.0.0.1", 3306, "test", "root", "123456", 4);
drogon::app().createRedisClient("127.0.0.1", 6379, "test", "123456", 4);
下面是堆栈日志:
#1 0x00007ffff6fc2859 in __GI_abort () at abort.c:79
#2 0x00007ffff702d266 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7157298 "%s\n") at ../sysdeps/posix/libc_fatal.c:156
#3 0x00007ffff70352fc in malloc_printerr (str=str@entry=0x7ffff71595d0 "free(): double free detected in tcache 2") at malloc.c:5347
#4 0x00007ffff7036f6d in _int_free (av=0x7fffb4000020, p=0x7fffb4002a90, have_lock=0) at malloc.c:4201
#5 0x00007ffff74e81ac in ?? () from /lib/x86_64-linux-gnu/libhiredis.so.0.14
#6 0x0000555555b08cbf in drogon::nosql::RedisConnection::RedisConnection() ()__shared_count() ()
#7 0x0000555555b171f8 in void __gnu_cxx::new_allocatordrogon::nosql::RedisConnection::destroydrogon::nosql::RedisConnection(drogon::nosql::RedisConnection*) ()
#8 0x0000555555b1708b in void std::allocator_traits<std::allocatordrogon::nosql::RedisConnection >::destroydrogon::nosql::RedisConnection(std::allocatordrogon::nosql::RedisConnection&, drogon::nosql::RedisConnection*) ()
#9 0x0000555555b16d2d in std::_Sp_counted_ptr_inplace<drogon::nosql::RedisConnection, std::allocatordrogon::nosql::RedisConnection, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
#10 0x00005555555d0c6c in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#11 0x00005555555cf6b9 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::
#12 0x0000555555b09352 in std::__shared_ptr<drogon::nosql::RedisConnection, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() ()
#13 0x0000555555b09372 in std::shared_ptrdrogon::nosql::RedisConnection::~shared_ptr() ()
#14 0x0000555555b25346 in drogon::nosql::RedisConnection::disconnect()::{lambda()#1}::disconnect() ()_Function_base() ()
#15 0x0000555555b2876c in std::_Function_base::_Base_managerdrogon::nosql::RedisConnection::disconnect()::{lambda()#1}::_M_destroy(std::_Any_data&, std::integral_constant<bool, false>) ()
#16 0x0000555555b2780a in std::_Function_base::_Base_managerdrogon::nosql::RedisConnection::disconnect()::{lambda()#1}::_M_manager(std::_Any_data&, std::_Function_base::_Base_managerdrogon::nosql::RedisConnection::disconnect()::{lambda()#1} const&, std::_Manager_operation) ()
#17 0x00005555555cb981 in std::_Function_base::
#18 0x00005555555e8e32 in std::function<void ()>::~function() ()
#19 0x000055555597378a in std::function<void ()>::operator=(std::function<void ()>&&) ()
#20 0x0000555555b629c6 in trantor::MpscQueue<std::function<void ()> >::dequeue(std::function<void ()>&) ()
#21 0x0000555555b61bfd in trantor::EventLoop::doRunInLoopFuncs() ()
#22 0x0000555555b61111 in trantor::EventLoop::loop() ()
#23 0x0000555555b643fd in trantor::EventLoopThread::loopFuncs() ()
#24 0x0000555555b63ed7 in trantor::EventLoopThread::EventLoopThread(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)::{lambda()#1}::operator()() const ()
#25 0x0000555555b64f63 in void std::__invoke_impl<void, trantor::EventLoopThread::EventLoopThread(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)::{lambda()#1}>(std::__invoke_other, trantor::EventLoopThread::EventLoopThread(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)::{lambda()#1}&&) ()