Skip to content

Crash on reading from jobs table #3525

Closed

Description

@danielmewes

First encountered here: #3516 (comment)

On a cluster with a lot of shards, many of which are backfilling, I get this crash on the parsing server reliably upon running
r.db('rethinkdb').table('jobs'):

error: Error in src/rpc/connectivity/cluster.cc at line 117:
error: Guarantee failed: [!is_loopback()] Attempted to kill connection to myself.
error: Backtrace:
error: Wed Jan  7 18:39:37 2015

       1: backtrace_t::backtrace_t() at backtrace.cc:203
       2: lazy_backtrace_formatter_t::lazy_backtrace_formatter_t() at basic_string.h:269
       3: format_backtrace(bool) at backtrace.cc:197
       4: report_fatal_error(char const*, int, char const*, ...) at basic_string.h:287
       5: connectivity_cluster_t::connection_t::kill_connection() at cluster.cc:117
       6: mailbox_manager_t::mailbox_read_coroutine(connectivity_cluster_t::connection_t*, auto_drainer_t::lock_t, threadnum_t, unsigned long, std::vector<char, std::allocator<char> >*, long, mailbox_manager_t::force_yield_t) at mailbox.cc:286
       7: ./rethinkdb() [0x756d48] at 0x756d48 ()
       8: coro_t::run() at coroutines.cc:206
error: Exiting.

Activity

  1. added this to the 1.16 milestone on Jan 8, 2015
  2. danielmewes commented on Jan 8, 2015

    @danielmewes
    MemberAuthor

    Running in debug mode reveals the possible source of this:

    error: Error in ./src/containers/scoped.hpp at line 102:
    error: Assertion failed: [ptr_] 
    error: Backtrace:
    error: Backtrace:
    error: Wed Jan  7 19:04:42 2015
    
           1: rethinkdb_backtrace(void**, int) at rethinkdb_backtrace.cc:100
           2: backtrace_t::backtrace_t() at backtrace.cc:203
           3: lazy_backtrace_formatter_t::lazy_backtrace_formatter_t() at backtrace.cc:283
           4: format_backtrace(bool) at backtrace.cc:198
           5: report_fatal_error(char const*, int, char const*, ...) at errors.cc:83
           6: scoped_ptr_t<serializer_t>::operator->() const at scoped.hpp:102
           7: stores_lifetimer_t::is_gc_active() const at reactor_driver.hpp:68
           8: watchable_and_reactor_t::is_gc_active() const at reactor_driver.cc:292
           9: reactor_driver_t::is_gc_active() const at reactor_driver.cc:433
           10: jobs_manager_t::on_get_job_reports(signal_t*, mailbox_addr_t<void (std::vector<job_report_t, std::allocator<job_report_t> >)> const&) at manager.cc:97
           11: std::_Mem_fn<void (jobs_manager_t::*)(signal_t*, mailbox_addr_t<void (std::vector<job_report_t, std::allocator<job_report_t> >)> const&)>::operator()(jobs_manager_t*, signal_t*, mailbox_addr_t<void (std::vector<job_report_t, std::allocator<job_report_t> >)> const&) const at functional:550
           12: _ZNSt5_BindIFSt7_Mem_fnIM14jobs_manager_tFvP8signal_tRK14mailbox_addr_tIFvSt6vectorI12job_report_tSaIS6_EEEEEEPS1_St12_PlaceholderILi1EESH_ILi2EEEE6__callIvJOS3_OSA_EJLi0ELi1ELi2EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+0x9d at functional:1145
           13: _ZNSt5_BindIFSt7_Mem_fnIM14jobs_manager_tFvP8signal_tRK14mailbox_addr_tIFvSt6vectorI12job_report_tSaIS6_EEEEEEPS1_St12_PlaceholderILi1EESH_ILi2EEEEclIJS3_SA_EvEET0_DpOT_+0x5e at functional:1203
           14: std::_Function_handler<void (signal_t*, mailbox_addr_t<void (std::vector<job_report_t, std::allocator<job_report_t> >)>), std::_Bind<std::_Mem_fn<void (jobs_manager_t::*)(signal_t*, mailbox_addr_t<void (std::vector<job_report_t, std::allocator<job_report_t> >)> const&)> (jobs_manager_t*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, signal_t*, mailbox_addr_t<void (std::vector<job_report_t, std::allocator<job_report_t> >)>) at functional:1779
           15: std::function<void (signal_t*, mailbox_addr_t<void (std::vector<job_report_t, std::allocator<job_report_t> >)>)>::operator()(signal_t*, mailbox_addr_t<void (std::vector<job_report_t, std::allocator<job_report_t> >)>) const at functional:2160
           16: mailbox_t<void (mailbox_addr_t<void (std::vector<job_report_t, std::allocator<job_report_t> >)>)>::read_impl_t::read(read_stream_t*, signal_t*) at typed.hpp:157
           17: mailbox_manager_t::mailbox_read_coroutine(connectivity_cluster_t::connection_t*, auto_drainer_t::lock_t, threadnum_t, unsigned long, std::vector<char, std::allocator<char> >*, long, mailbox_manager_t::force_yield_t) at mailbox.cc:270
           18: ./rethinkdb() [0x157ffef] at 0x157ffef ()
           19: ./rethinkdb() [0x157fedc] at 0x157fedc ()
           20: callable_action_wrapper_t::run() at runtime_utils.cc:43
           21: coro_t::run() at coroutines.cc:197
           22: ./rethinkdb() [0x157f7bd] at 0x157f7bd ()
           23: mailbox_manager_t::on_message(connectivity_cluster_t::connection_t*, auto_drainer_t::lock_t, read_stream_t*) at mailbox.cc:232
           24: connectivity_cluster_t::run_t::handle(keepalive_tcp_conn_stream_t*, boost::optional<peer_id_t>, boost::optional<peer_address_t>, auto_drainer_t::lock_t, bool*) at cluster.cc:1128
           25: connectivity_cluster_t::run_t::connect_to_peer(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*) at cluster.cc:325
           26: std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*)>::operator()(connectivity_cluster_t::run_t*, peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*) const at functional:550
           27: _ZNKSt5_BindIFSt7_Mem_fnIMN22connectivity_cluster_t5run_tEFvPK14peer_address_tiN5boost8optionalI9peer_id_tEEN14auto_drainer_t6lock_tEPbP14co_semaphore_tEEPS2_S5_St12_PlaceholderILi1EES9_SB_SC_P18static_semaphore_tEE8__call_cIvJRlEJLi0ELi1ELi2ELi3ELi4ELi5ELi6EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+0x1db at functional:1154
           28: _ZNKSt5_BindIFSt7_Mem_fnIMN22connectivity_cluster_t5run_tEFvPK14peer_address_tiN5boost8optionalI9peer_id_tEEN14auto_drainer_t6lock_tEPbP14co_semaphore_tEEPS2_S5_St12_PlaceholderILi1EES9_SB_SC_P18static_semaphore_tEEclIJRlEvEET0_DpOT_+0x3d at functional:1217
           29: pmap_runner_one_arg_t<std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*)> (connectivity_cluster_t::run_t*, peer_address_t const*, std::_Placeholder<1>, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, static_semaphore_t*)>, long>::operator()() at pmap.hpp:21
           30: callable_action_instance_t<pmap_runner_one_arg_t<std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*)> (connectivity_cluster_t::run_t*, peer_address_t const*, std::_Placeholder<1>, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, static_semaphore_t*)>, long> >::run_action() at callable_action.hpp:31
           31: callable_action_wrapper_t::run() at runtime_utils.cc:43
           32: coro_t::run() at coroutines.cc:197
           33: void coro_t::spawn_now_dangerously<pmap_runner_one_arg_t<std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*)> (connectivity_cluster_t::run_t*, peer_address_t const*, std::_Placeholder<1>, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, static_semaphore_t*)>, long> >(pmap_runner_one_arg_t<std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*)> (connectivity_cluster_t::run_t*, peer_address_t const*, std::_Placeholder<1>, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, static_semaphore_t*)>, long>&&) at coroutines.hpp:52
           34: void pmap<std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*)> (connectivity_cluster_t::run_t*, peer_address_t const*, std::_Placeholder<1>, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, static_semaphore_t*)> >(long, long, std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*)> (connectivity_cluster_t::run_t*, peer_address_t const*, std::_Placeholder<1>, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, static_semaphore_t*)> const&) at pmap.hpp:44
           35: void pmap<std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*)> (connectivity_cluster_t::run_t*, peer_address_t const*, std::_Placeholder<1>, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, static_semaphore_t*)> >(long, std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t const*, int, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, co_semaphore_t*)> (connectivity_cluster_t::run_t*, peer_address_t const*, std::_Placeholder<1>, boost::optional<peer_id_t>, auto_drainer_t::lock_t, bool*, static_semaphore_t*)> const&) at pmap.hpp:54
           36: connectivity_cluster_t::run_t::join_blocking(peer_address_t, boost::optional<peer_id_t>, auto_drainer_t::lock_t) at cluster.cc:361
           37: std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t, boost::optional<peer_id_t>, auto_drainer_t::lock_t)>::operator()(connectivity_cluster_t::run_t*, peer_address_t, boost::optional<peer_id_t>, auto_drainer_t::lock_t) const at functional:550
           38: _ZNSt5_BindIFSt7_Mem_fnIMN22connectivity_cluster_t5run_tEFv14peer_address_tN5boost8optionalI9peer_id_tEEN14auto_drainer_t6lock_tEEEPS2_S3_MNS4_6detail11none_helperEiS9_EE6__callIvJEJLi0ELi1ELi2ELi3EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+0x159 at functional:1145
           39: _ZNSt5_BindIFSt7_Mem_fnIMN22connectivity_cluster_t5run_tEFv14peer_address_tN5boost8optionalI9peer_id_tEEN14auto_drainer_t6lock_tEEEPS2_S3_MNS4_6detail11none_helperEiS9_EEclIJEvEET0_DpOT_+0x26 at functional:1203
           40: callable_action_instance_t<std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t, boost::optional<peer_id_t>, auto_drainer_t::lock_t)> (connectivity_cluster_t::run_t*, peer_address_t, int boost::detail::none_helper::*, auto_drainer_t::lock_t)> >::run_action() at callable_action.hpp:31
           41: callable_action_wrapper_t::run() at runtime_utils.cc:43
           42: coro_t::run() at coroutines.cc:197
           43: void coro_t::spawn_now_dangerously<std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t, boost::optional<peer_id_t>, auto_drainer_t::lock_t)> (connectivity_cluster_t::run_t*, peer_address_t, int boost::detail::none_helper::*, auto_drainer_t::lock_t)> >(std::_Bind<std::_Mem_fn<void (connectivity_cluster_t::run_t::*)(peer_address_t, boost::optional<peer_id_t>, auto_drainer_t::lock_t)> (connectivity_cluster_t::run_t*, peer_address_t, int boost::detail::none_helper::*, auto_drainer_t::lock_t)>&&) at coroutines.hpp:52
           44: connectivity_cluster_t::run_t::join(peer_address_t const&) at cluster.cc:268
           45: initial_joiner_t::main_coro(connectivity_cluster_t::run_t*, auto_drainer_t::lock_t) at initial_join.cc:107
           46: boost::_mfi::mf2<void, initial_joiner_t, connectivity_cluster_t::run_t*, auto_drainer_t::lock_t>::operator()(initial_joiner_t*, connectivity_cluster_t::run_t*, auto_drainer_t::lock_t) const at mem_fn_template.hpp:280
           47: void boost::_bi::list3<boost::_bi::value<initial_joiner_t*>, boost::_bi::value<connectivity_cluster_t::run_t*>, boost::_bi::value<auto_drainer_t::lock_t> >::operator()<boost::_mfi::mf2<void, initial_joiner_t, connectivity_cluster_t::run_t*, auto_drainer_t::lock_t>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf2<void, initial_joiner_t, connectivity_cluster_t::run_t*, auto_drainer_t::lock_t>&, boost::_bi::list0&, int) at bind.hpp:392
           48: boost::_bi::bind_t<void, boost::_mfi::mf2<void, initial_joiner_t, connectivity_cluster_t::run_t*, auto_drainer_t::lock_t>, boost::_bi::list3<boost::_bi::value<initial_joiner_t*>, boost::_bi::value<connectivity_cluster_t::run_t*>, boost::_bi::value<auto_drainer_t::lock_t> > >::operator()() at bind_template.hpp:20
           49: callable_action_instance_t<boost::_bi::bind_t<void, boost::_mfi::mf2<void, initial_joiner_t, connectivity_cluster_t::run_t*, auto_drainer_t::lock_t>, boost::_bi::list3<boost::_bi::value<initial_joiner_t*>, boost::_bi::value<connectivity_cluster_t::run_t*>, boost::_bi::value<auto_drainer_t::lock_t> > > >::run_action() at callable_action.hpp:31
           50: callable_action_wrapper_t::run() at runtime_utils.cc:43
           51: coro_t::run() at coroutines.cc:197
           52: coro_t* coro_t::spawn_sometime<boost::_bi::bind_t<void, boost::_mfi::mf2<void, initial_joiner_t, connectivity_cluster_t::run_t*, auto_drainer_t::lock_t>, boost::_bi::list3<boost::_bi::value<initial_joiner_t*>, boost::_bi::value<connectivity_cluster_t::run_t*>, boost::_bi::value<auto_drainer_t::lock_t> > > >(boost::_bi::bind_t<void, boost::_mfi::mf2<void, initial_joiner_t, connectivity_cluster_t::run_t*, auto_drainer_t::lock_t>, boost::_bi::list3<boost::_bi::value<initial_joiner_t*>, boost::_bi::value<connectivity_cluster_t::run_t*>, boost::_bi::value<auto_drainer_t::lock_t> > >&&) at coroutines.hpp:58
           53: initial_joiner_t::initial_joiner_t(connectivity_cluster_t*, connectivity_cluster_t::run_t*, peer_address_set_t const&, int) at initial_join.cc:87
           54: do_serve(io_backender_t*, bool, base_path_t const&, metadata_persistence::cluster_persistent_file_t*, metadata_persistence::auth_persistent_file_t*, serve_info_t const&, os_signal_cond_t*) at serve.cc:281
           55: serve(io_backender_t*, base_path_t const&, metadata_persistence::cluster_persistent_file_t*, metadata_persistence::auth_persistent_file_t*, serve_info_t const&, os_signal_cond_t*) at serve.cc:527
           56: run_rethinkdb_serve(base_path_t const&, serve_info_t*, file_direct_io_mode_t, int, boost::optional<boost::optional<unsigned long> > const&, uuid_u const*, cluster_semilattice_metadata_t const*, directory_lock_t*, bool*) at command_line.cc:795
           57: run_rethinkdb_porcelain(base_path_t const&, name_string_t const&, std::set<name_string_t, std::less<name_string_t>, std::allocator<name_string_t> > const&, file_direct_io_mode_t, int, boost::optional<boost::optional<unsigned long> > const&, bool, serve_info_t*, directory_lock_t*, bool*) at command_line.cc:824
           58: _ZNSt5_BindIFPFvRK11base_path_tRK13name_string_tRKSt3setIS3_St4lessIS3_ESaIS3_EE21file_direct_io_mode_tiRKN5boost8optionalINSF_ImEEEEbP12serve_info_tP16directory_lock_tPbES0_S3_SA_SD_iSH_bSL_SN_SO_EE6__callIvJEJLi0ELi1ELi2ELi3ELi4ELi5ELi6ELi7ELi8ELi9EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+0x262 at functional:1145
           59: _ZNSt5_BindIFPFvRK11base_path_tRK13name_string_tRKSt3setIS3_St4lessIS3_ESaIS3_EE21file_direct_io_mode_tiRKN5boost8optionalINSF_ImEEEEbP12serve_info_tP16directory_lock_tPbES0_S3_SA_SD_iSH_bSL_SN_SO_EEclIJEvEET0_DpOT_+0x26 at functional:1203
           60: std::_Function_handler<void (), std::_Bind<void (*(base_path_t, name_string_t, std::set<name_string_t, std::less<name_string_t>, std::allocator<name_string_t> >, file_direct_io_mode_t, int, boost::optional<boost::optional<unsigned long> >, bool, serve_info_t*, directory_lock_t*, bool*))(base_path_t const&, name_string_t const&, std::set<name_string_t, std::less<name_string_t>, std::allocator<name_string_t> > const&, file_direct_io_mode_t, int, boost::optional<boost::optional<unsigned long> > const&, bool, serve_info_t*, directory_lock_t*, bool*)> >::_M_invoke(std::_Any_data const&) at functional:1779
           61: std::function<void ()>::operator()() const at functional:2160
           62: starter_t::run_wrapper(std::function<void ()> const&) at runtime.cc:61
           63: std::_Mem_fn<void (starter_t::*)(std::function<void ()> const&)>::operator()(starter_t*, std::function<void ()> const&) const at functional:550
           64: _ZNSt5_BindIFSt7_Mem_fnIM9starter_tFvRKSt8functionIFvvEEEEPS1_S4_EE6__callIvJEJLi0ELi1EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+0x70 at functional:1145
           65: _ZNSt5_BindIFSt7_Mem_fnIM9starter_tFvRKSt8functionIFvvEEEEPS1_S4_EEclIJEvEET0_DpOT_+0x26 at functional:1203
           66: std::_Function_handler<void (), std::_Bind<std::_Mem_fn<void (starter_t::*)(std::function<void ()> const&)> (starter_t*, std::function<void ()>)> >::_M_invoke(std::_Any_data const&) at functional:1779
           67: std::function<void ()>::operator()() const at functional:2160
           68: callable_action_instance_t<std::function<void ()>&>::run_action() at callable_action.hpp:31
           69: callable_action_wrapper_t::run() at runtime_utils.cc:43
           70: coro_t::run() at coroutines.cc:197
           71: coro_t* coro_t::spawn_sometime<std::function<void ()>&>(std::function<void ()>&&&) at coroutines.hpp:58
           72: starter_t::on_thread_switch() at runtime.cc:57
           73: linux_message_hub_t::on_event(int) at message_hub.cc:154
           74: epoll_event_queue_t::run() at epoll.cc:115
           75: linux_thread_pool_t::start_thread(void*) at thread_pool.cc:155
           76: /lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a) [0x7fabae4b2e9a] at 0x7fabae4b2e9a (/lib/x86_64-linux-gnu/libpthread.so.0)
           77: clone+0x6d at 0x7fabae1e02ed (/lib/x86_64-linux-gnu/libc.so.6)
    error: Exiting.
    

    I'm seeing one of these on each server

  3. added a commit that references this issue on Jan 8, 2015
    bb68f9b
  4. danielmewes commented on Jan 8, 2015

    @danielmewes
    MemberAuthor

    The code was just missing a check to handle the case where the serializer for a store hadn't been created yet.
    Fix in CR 2447.

  5. danielmewes commented on Jan 8, 2015

    @danielmewes
    MemberAuthor

    Actually that was premature. I'm still getting the original crash in release mode.

  6. danielmewes commented on Jan 8, 2015

    @danielmewes
    MemberAuthor

    There was another instance of the same problem in stores_lifetimer_t::get_sindex_jobs(). Updated the CR.

  7. danielmewes commented on Jan 8, 2015

    @danielmewes
    MemberAuthor

    There seems to be yet another one somewhere...

  8. danielmewes commented on Jan 8, 2015

    @danielmewes
    MemberAuthor

    report_t doesn't always initialize it's bool is_ready field. If it happened to contain a value > 1, deserialization would fail because it checks that the range of a bool is 0-1.

  9. danielmewes commented on Jan 8, 2015

    @danielmewes
    MemberAuthor

    Merged into next as of 5facb14

    We discovered some other object lifetime issues on the way, which @VeXocide is going to look into.

  10. added a commit that references this issue on Aug 7, 2026
    207e9e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions