apache / apache/incubator-pegasus

coredump in redis parser

Open
#844 0 comments 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
C++
Stars
2.1k
Forks
328
PR merge metrics
No merged PRs in 30d

Description

## Bug Report
### Pegasus Version 2.0.0
### Core Dump
```
(gdb) #0 operator++ (this=)
at /home/wutao1/app/include/c++/4.8.2/bits/stl_list.h:235
#1 __distance > (
__last=..., __first=...)
at /home/wutao1/app/include/c++/4.8.2/bits/stl_iterator_base_funcs.h:82
#2 distance > (
__last=..., __first=...)
at /home/wutao1/app/include/c++/4.8.2/bits/stl_iterator_base_funcs.h:118
#3 size (this=0x7f5fe9a40bc0)
at /home/wutao1/app/include/c++/4.8.2/bits/stl_list.h:874
#4 pegasus::proxy::redis_parser::process_geo_radius_result(pegasus::proxy::redis_parser::message_entry&, std::string const&, bool, bool, bool, int, std::list >&&) (
this=0x26b15998, entry=..., unit=..., WITHCOORD=false, WITHDIST=false,
WITHHASH=true, ec=0,
results=)
at /home/wutao1/pegasus-release/src/redis_protocol/proxy_lib/redis_parser.cpp:1095
#5 0x0000000000476858 in operator() (results=,
ec=, __closure=)
at /home/wutao1/pegasus-release/src/redis_protocol/proxy_lib/redis_parser.cpp:853
#6 std::_Function_handler >&&), pegasus::proxy::redis_parser::geo_radius(pegasus::proxy::redis_parser::message_entry&)::__lambda37>::_M_invoke(const std::_Any_data &, int, ) (__functor=...,
__args#0=, __args#1=)
at /home/wutao1/app/include/c++/4.8.2/functional:2071
#7 0x000000000049263f in operator() (results_=,
__closure=0xe57a5a0)
at /home/wutao1/pegasus-release/src/geo/lib/geo_client.cpp:527
#8 std::_Function_handler >, std::allocator > > >&&), pegasus::geo::geo_client::async_search_radial(const S2LatLng&, double, int, pegasus::geo::geo_client::SortType, int, pegasus::geo::geo_search_callback_t&&)::__lambda42>::_M_invoke(const std::_Any_data &, ) (
__functor=..., __args#0=)
at /home/wutao1/app/include/c++/4.8.2/functional:2071
#9 0x0000000000495041 in operator() (geo_hash_key=,
info=, value=,
geo_sort_key=, ret=, __closure=0x812bc20,
this=)
at /home/wutao1/pegasus-release/src/geo/lib/geo_client.cpp:886
#10 std::_Function_handler, std::allocator >&&, std::basic_string, std::allocator >&&, std::basic_string, std::allocator >&&, pegasus::pegasus_client::internal_info&&), pegasus::geo::geo_client::do_scan(pegasus::pegasus_client::pegasus_scanner_wrapper, std::shared_ptr, int, pegasus::geo::geo_client::scan_one_area_callback_t&&, std::list&)::__lambda49>::_M_invoke(const std::_Any_data &, int, , , , ) (__functor=...,
__args#0=, __args#1=,
__args#2=, __args#3=,
__args#4=)
at /home/wutao1/app/include/c++/4.8.2/functional:2071
#11 0x000000000054eb11 in pegasus::client::pegasus_client_impl::pegasus_scanner_impl::_async_next_internal (this=this@entry=0x3784d7a0)
at /home/wutao1/pegasus-release/src/client_lib/pegasus_scanner_impl.cpp:115
#12 0x000000000054f499 in pegasus::client::pegasus_client_impl::pegasus_scanner_impl::_on_scan_response (this=0x3784d7a0, err=..., req=,
resp=)
at /home/wutao1/pegasus-release/src/client_lib/pegasus_scanner_impl.cpp:230
#13 0x000000000054f95f in operator() (resp=,
req=, err=..., __closure=)
at /home/wutao1/pegasus-release/src/client_lib/pegasus_scanner_impl.cpp:205
#14 std::_Function_handler::_M_invoke(const std::_Any_data &, dsn::error_code, dsn::message_ex *, dsn::message_ex *) (__functor=..., __args#0=...,
__args#1=, __args#2=)
at /home/wutao1/app/include/c++/4.8.2/functional:2071
#15 0x0000000000528317 in operator() (__args#2=0x55453cb8,
__args#1=0x56d91436, __args#0=..., this=0x21ee37b0)
at /home/wutao1/app/include/c++/4.8.2/functional:2464
#16 operator() (resp=0x55453cb8, req=0x56d91436, err=...,
__closure=0x21ee37a0)
at /home/wutao1/pegasus-release/rdsn/src/dist/replication/client/partition_resolver.cpp:94
#17 std::_Function_handler::_M_invoke(const std::_Any_data &, dsn::error_code, dsn::message_ex *, dsn::message_ex *) (__functor=..., __args#0=...,
__args#1=0x56d91436, __args#2=0x55453cb8)
at /home/wutao1/app/include/c++/4.8.2/functional:2071
#18 0x00000000005f8d1c in operator() (__args#2=,
__args#1=, __args#0=..., this=)
at /home/wutao1/app/include/c++/4.8.2/functional:2464
#19 dsn::rpc_response_task::exec (this=)
at /home/wutao1/pegasus-release/rdsn/include/dsn/tool-api/task.h:480
#20 0x00000000005f68f9 in dsn::task::exec_internal (this=0x56d9161d)
at /home/wutao1/pegasus-release/rdsn/src/core/core/task.cpp:180
#21 0x00000000005f7241 in dsn::rpc_response_task::enqueue (this=0x56d9161d,
err=..., err@entry=..., reply=reply@entry=0x55453cb8)
at /home/wutao1/pegasus-release/rdsn/src/core/core/task.cpp:573
#22 0x0000000000646f47 in dsn::rpc_client_matcher::on_recv_reply (
this=0x2d90858, net=, key=,
reply=reply@entry=0x55453cb8, delay_ms=delay_ms@entry=0)
at /home/wutao1/pegasus-release/rdsn/src/core/core/rpc_engine.cpp:186
#23 0x000000000066a6ff in dsn::rpc_session::on_recv_message (
this=this@entry=0x2eb7040, msg=0x55453cb8, delay_ms=delay_ms@entry=0)
at /home/wutao1/pegasus-release/rdsn/src/core/core/network.cpp:411
#24 0x000000000065fd79 in on_message_read (msg=,
this=0x2eb7040)
at /home/wutao1/pegasus-release/rdsn/src/core/tools/common/asio_rpc_session.h:63
#25 operator() (length=, __closure=0x7f5fe9a412d0, ec=...)
at /home/wutao1/pegasus-release/rdsn/src/core/tools/common/asio_rpc_session.cpp:115
#26 operator() (this=0x7f5fe9a412d0)
at /home/wutao1/boost_1_58_0/output/include/boost/asio/detail/bind_handler.hpp:127
#27 asio_handler_invoke > (
function=...)
at /home/wutao1/boost_1_58_0/output/include/boost/asio/handler_invoke_hook.hpp:69
#28 invoke, dsn::tools::asio_rpc_session::do_read(int)::__lambda2> (context=..., function=...)
at /home/wutao1/boost_1_58_0/output/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#29 boost::asio::detail::reactive_socket_recv_op::do_complete(boost::asio::detail::io_service_impl *, boost::asio::detail::operation *, const boost::system::error_code &, std::size_t) (owner=,
base=)
at /home/wutao1/boost_1_58_0/output/include/boost/asio/detail/reactive_socket_recv_op.hpp:110
#30 0x00000000004a1379 in complete (bytes_transferred=,
ec=..., owner=..., this=)
at /home/wutao1/boost_1_58_0/output/include/boost/asio/detail/task_io_service_operation.hpp:38
#31 do_run_one (ec=..., this_thread=..., lock=..., this=0x2da20e0)
at /home/wutao1/boost_1_58_0/output/include/boost/asio/detail/impl/task_io_service.ipp:372
#32 boost::asio::detail::task_io_service::run (this=0x2da20e0, ec=...)
at /home/wutao1/boost_1_58_0/output/include/boost/asio/detail/impl/task_io_service.ipp:149
#33 0x0000000000657f86 in run (this=, ec=...)
at /home/wutao1/boost_1_58_0/output/include/boost/asio/impl/io_service.ipp:66
#34 operator() (__closure=0x2eadf30)
at /home/wutao1/pegasus-release/rdsn/src/core/tools/common/asio_net_provider.cpp:79
#35 _M_invoke<> (this=0x2eadf30)
at /home/wutao1/app/include/c++/4.8.2/functional:1732
#36 operator() (this=0x2eadf30)
at /home/wutao1/app/include/c++/4.8.2/functional:1720
#37 std::thread::_Impl >::_M_run(void) (this=0x2eadf18)
at /home/wutao1/app/include/c++/4.8.2/thread:115
#38 0x00007f5feb3d3600 in std::(anonymous namespace)::execute_native_thread_routine (__p=)
at /home/qinzuoyan/git.xiaomi/pegasus/toolchain/objdir/../gcc-4.8.2/libstdc++-v3/src/c++11/thread.cc:84
#39 0x00007f5febee5dc5 in start_thread () from /lib64/libpthread.so.0
#40 0x00007f5feab3d73d in clone () from /lib64/libc.so.6
```

Contributor guide

Open the contributing guide

Research direction

Start in src/redis_protocol/proxy_lib/redis_parser.cpp at process_geo_radius_result around line 1095, then trace the geo_radius callback around line 853 and the caller in src/geo/lib/geo_client.cpp around line 527. Reproduce the reported Redis geo-radius crash and identify a confirmed fix; done means the same WITHHASH path no longer produces a core dump.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, redis
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.