Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis服务端主动断开链接后异步发送请求会导致coredump #25

Closed
wciq1208 opened this issue Nov 25, 2016 · 4 comments
Closed

Comments

@wciq1208
Copy link

#0 0x00007ffff67e1d16 in strlen () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff7345d34 in __redisClusterAsyncSetError (str=0xffffffff00000001 <error: Cannot access memory at address 0xffffffff00000001>, type=-1, acc=0x1020300) at hircluster.c:3971
#2 redisClusterAsyncFormattedCommand (acc=acc@entry=0x1020300, fn=fn@entry=0x52f5a2 <UserFeature::GetFeatureForRedis(redisClusterAsyncContext*, void*, void*)>, privdata=privdata@entry=0xfb03b0, cmd=, len=40) at hircluster.c:4535
#3 0x00007ffff7346017 in redisClustervAsyncCommand (acc=0x1020300, fn=0x52f5a2 <UserFeature::GetFeatureForRedis(redisClusterAsyncContext*, void*, void*)>, privdata=0xfb03b0, format=, ap=) at hircluster.c:4602
#4 0x00007ffff734614a in redisClusterAsyncCommand (acc=, fn=, privdata=, format=) at hircluster.c:4615
#5 0x000000000052f4f2 in UserFeature::GetFeature (this=0xfd4960, tmpData=0x807ee000, server=...) at /home/wciq1208/ClionProjects/online-server-cpp/src/index/UserFeature.cpp:22
#6 0x00000000004fbd2b in Server::Handler (this=0xfd1a48, req=0x807dc000, arg=...) at /home/wciq1208/ClionProjects/online-server-cpp/src/process/Server.cpp:93
#7 0x00000000004fb81d in Server::EvHandler (req=0x807dc000, arg=0xfd1a48) at /home/wciq1208/ClionProjects/online-server-cpp/src/process/Server.cpp:43
#8 0x00007ffff799cd74 in evhttp_handle_request (req=0x807dc000, arg=) at http.c:3039
#9 0x00007ffff799afbd in evhttp_read_body (evcon=evcon@entry=0x7ff6a3c0, req=req@entry=0x807dc000) at http.c:1028
#10 0x00007ffff799b4da in evhttp_get_body (evcon=0x7ff6a3c0, req=0x807dc000) at http.c:1969
#11 0x00007ffff798c16a in bufferevent_readcb (fd=3, event=, arg=0xfcd400) at bufferevent_sock.c:186
#12 0x00007ffff7980252 in event_persist_closure (ev=, base=0x1038000) at event.c:1319
#13 event_process_active_single_queue (activeq=0xfb0140, base=0x1038000) at event.c:1363
#14 event_process_active (base=) at event.c:1438
#15 event_base_loop (base=0x1038000, flags=0) at event.c:1639
#16 0x0000000000551270 in HttpServer::createThread (this=0xfd1a48) at /home/wciq1208/ClionProjects/online-server-cpp/src/process/HttpServer.cpp:67
#17 0x000000000052efd8 in std::_Mem_fn_base<signed char (HttpServer::)(), true>::_M_call<Server&> (this=0xfc2470, __object=...) at /usr/include/c++/5/functional:628
#18 0x000000000052ef60 in std::_Mem_fn_base<signed char (HttpServer::
)(), true>::operator()<Server&, , void>(Server&) const (this=0xfc2470, __object=...) at /usr/include/c++/5/functional:610
#19 0x000000000052ef08 in std::_Mem_fn_base<signed char (HttpServer::)(), true>::operator()<Server, , void>(std::reference_wrapper) const (this=0xfc2470, __ref=...) at /usr/include/c++/5/functional:619
#20 0x000000000052eed3 in std::_Bind_simple<std::_Mem_fn<signed char (HttpServer::
)()> (std::reference_wrapper)>::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0xfc2468) at /usr/include/c++/5/functional:1531
#21 0x000000000052ed70 in std::_Bind_simple<std::_Mem_fn<signed char (HttpServer::)()> (std::reference_wrapper)>::operator()() (this=0xfc2468) at /usr/include/c++/5/functional:1520
#22 0x000000000052ecc0 in std::thread::_Impl<std::_Bind_simple<std::_Mem_fn<signed char (HttpServer::
)()> (std::reference_wrapper)> >::_M_run() (this=0xfc2450) at /usr/include/c++/5/thread:115
#23 0x00007ffff6deec80 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#24 0x00007ffff7bc16fa in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0

本来想尝试在disconnectcallback当中重连,但是发现回调函数只提供ac作为参数而没有acc,导致不能使用异步适配器

@deep011
Copy link
Contributor

deep011 commented Nov 25, 2016

你用的是release版,还是master分支?

@wciq1208
Copy link
Author

master分支

@deep011
Copy link
Contributor

deep011 commented Dec 5, 2016

能给我看你disconnectcallback的代码吗?

@deep011
Copy link
Contributor

deep011 commented Dec 6, 2016

问题已修复,请下载最新master代码。
另外,不要在disconnectcallback函数中尝试重建链接,hiredis-vip的异步api会自动修复链接的。

@deep011 deep011 closed this as completed Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants