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

SIGSEGV, last trace step: potential_peer_record #1802

Closed
serghd opened this issue Jun 17, 2019 · 3 comments
Closed

SIGSEGV, last trace step: potential_peer_record #1802

serghd opened this issue Jun 17, 2019 · 3 comments
Labels
3d Bug Classification indicating the existing implementation does not match the intention of the design

Comments

@serghd
Copy link

serghd commented Jun 17, 2019

GDB showed the next trace:

#0  0x000056411e528fb9 in graphene::net::potential_peer_record::potential_peer_record (this=0x58b7b3c5a0a4e) at /home/devuser/opt/blockchain/libraries/net/include/graphene/net/peer_database.hpp:46
No locals.
#1  graphene::net::detail::peer_database_impl::lookup_or_create_entry_for_endpoint (this=0x5643660227f0, endpointToLookup=...) at /home/devuser/opt/blockchain/libraries/net/peer_database.cpp:163
        iter = {<boost::operators_impl::forward_iterator_helper<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<graphene::net::potential_peer_record, std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_unique_tag>, boost::multi_index::detail::bucket_array<std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_index_global_iterator_tag>, graphene::net::potential_peer_record, long, graphene::net::potential_peer_record const*, graphene::net::potential_peer_record const&>> = {<boost::operators_impl::forward_iteratable<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<graphene::net::potential_peer_record, std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_unique_tag>, boost::multi_index::detail::bucket_array<std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_index_global_iterator_tag>, graphene::net::potential_peer_record const*, std::iterator<std::forward_iterator_tag, graphene::net::potential_peer_record, long, graphene::net::potential_peer_record const*, graphene::net::potential_peer_record const&> >> = {<boost::operators_impl::input_iteratable<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<graphene::net::potential_peer_record, std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_unique_tag>, boost::multi_index::detail::bucket_array<std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_index_global_iterator_tag>, graphene::net::potential_peer_record const*, std::iterator<std::forward_iterator_tag, graphene::net::potential_peer_record, long, graphene::net::potential_peer_record const*, graphene::net::potential_peer_record const&> >> = {<boost::operators_impl::equality_comparable1<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<graphene::net::potential_peer_record, std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_unique_tag>, boost::multi_index::detail::bucket_array<std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_index_global_iterator_tag>, boost::operators_impl::incrementable<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<graphene::net::potential_peer_record, std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_unique_tag>, boost::multi_index::detail::bucket_array<std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_index_global_iterator_tag>, boost::operators_impl::dereferenceable<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<graphene::net::potential_peer_record, std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_unique_tag>, boost::multi_index::detail::bucket_array<std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_index_global_iterator_tag>, graphene::net::potential_peer_record const*, std::iterator<std::forward_iterator_tag, graphene::net::potential_peer_record, long, graphene::net::potential_peer_record const*, graphene::net::potential_peer_record const&> > > >> = {<boost::operators_impl::incrementable<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<graphene::net::potential_peer_record, std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_unique_tag>, boost::multi_index::detail::bucket_
array<std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_index_global_iterator_tag>, boost::operators_impl::dereferenceable<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<graphene::net::potential_peer_record, std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_unique_tag>, boost::multi_index::detail::bucket_array<std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_index_global_iterator_tag>, graphene::net::potential_peer_record const*, std::iterator<std::forward_iterator_tag, graphene::net::potential_peer_record, long, graphene::net::potential_peer_record const*, graphene::net::potential_peer_record const&> > >> = {<boost::operators_impl::dereferenceable<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<graphene::net::potential_peer_record, std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_unique_tag>, boost::multi_index::detail::bucket_array<std::allocator<graphene::net::potential_peer_record> >, boost::multi_index::detail::hashed_index_global_iterator_tag>, graphene::net::potential_peer_record const*, std::iterator<std::forward_iterator_tag, graphene::net::potential_peer_record, long, graphene::net::potential_peer_record const*, graphene::net::potential_peer_record const&> >> = {<std::iterator<std::forward_iterator_tag, graphene::net::potential_peer_record, long, graphene::net::potential_peer_record const*, graphene::net::potential_peer_record const&>> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, node = 0x7f47c934cee0}
#2  0x000056411e529080 in graphene::net::peer_database::lookup_or_create_entry_for_endpoint (this=this@entry=0x564366021e70, endpointToLookup=...) at /home/devuser/opt/blockchain/libraries/net/peer_database.cpp:255
No locals.
#3  0x000056411e484b5a in graphene::net::detail::node_impl::connect_to_task (this=this@entry=0x564366021da0, new_peer=std::shared_ptr<graphene::net::peer_connection> (use count 3, weak count 2) = {...}, remote_endpoint=...) at /home/devuser/opt/blockchain/libraries/net/node.cpp:4285
        updated_peer_record = {endpoint = {_port = 5912, _ip = {_ip = 0}}, last_seen_time = {utc_seconds = 1559729921}, last_connection_disposition = {value = graphene::net::last_connection_failed}, last_connection_attempt_time = {utc_seconds = 1560736291}, number_of_successful_connection_attempts = 0, number_of_failed_connection_attempts = 309, last_error = {_value = {4.6856044711359216e-310, 4.6861188336866286e-310}, _valid = true}}
        __FUNCTION__ = "connect_to_task"
        connect_failed_exception = {_value = {4.6856044711359216e-310, 4.6861188336866286e-310}, _valid = true}
#4  0x000056411e485300 in graphene::net::detail::node_impl::<lambda()>::operator() (__closure=<optimized out>) at /home/devuser/opt/blockchain/libraries/net/node.cpp:4586
        new_peer = std::shared_ptr<graphene::net::peer_connection> (use count 3, weak count 2) = {get() = <optimized out>}
        new_weak_peer = <optimized out>
        this = <optimized out>
        new_weak_peer = <optimized out>
        this = <optimized out>
        new_peer = <optimized out>
#5  fc::detail::void_functor_run<graphene::net::detail::node_impl::initiate_connect_to(const peer_connection_ptr&)::<lambda()> >::run(void *, void *) (functor=<optimized out>, prom=0x7f47cc32ace0) at /home/devuser/opt/blockchain/libraries/fc/include/fc/thread/task.hpp:83
No locals.
#6  0x000056411e2babc5 in fc::task_base::run_impl (this=this@entry=0x7f47cc32ad00) at /home/devuser/opt/blockchain/libraries/fc/src/thread/task.cpp:43
        __FUNCTION__ = "run_impl"
#7  0x000056411e2bb3a5 in fc::task_base::run (this=this@entry=0x7f47cc32ad00) at /home/devuser/opt/blockchain/libraries/fc/src/thread/task.cpp:32
No locals.
#8  0x000056411e2b9015 in fc::thread_d::run_next_task (this=0x7f47d0000b20) at /home/devuser/opt/blockchain/libraries/fc/src/thread/thread_d.hpp:513
        next = 0x7f47cc32ad00
        next = <optimized out>
#9  fc::thread_d::process_tasks (this=this@entry=0x7f47d0000b20) at /home/devuser/opt/blockchain/libraries/fc/src/thread/thread_d.hpp:562
No locals.
#10 0x000056411e2b97b7 in fc::thread_d::start_process_tasks (my=...) at /home/devuser/opt/blockchain/libraries/fc/src/thread/thread_d.hpp:493
        p = <optimized out>
        self = 0x7f47d0000b20
        __FUNCTION__ = "start_process_tasks"
#11 0x000056411e5aed6f in make_fcontext ()
No symbol table info available.
#12 0x0000000000000000 in ?? ()
No symbol table info available.
@abitmore
Copy link
Member

Looks like a threading issue. Perhaps related to #1256 .

@pmconrad
Copy link
Contributor

Which version are you running? I can't make sense of these line numbers.

One thing I noticed is that node_impl::initiate_connect_to takes a reference to a shared pointer as argument, which looks wrong. Both invocations of initiate_connect_to look harmless though.

Another thing is that connect_to_task(new_peer, *new_peer->get_remote_endpoint()); dereferences an optional without checking if it's valid.

@abitmore abitmore added this to New -Awaiting Core Team Evaluation in Project Backlog via automation Sep 12, 2019
@abitmore abitmore added this to the Future Feature Release milestone Sep 12, 2019
@abitmore abitmore added the 3d Bug Classification indicating the existing implementation does not match the intention of the design label Sep 12, 2019
@abitmore abitmore removed this from the Future Feature Release milestone Jan 30, 2020
@abitmore abitmore removed this from New -Awaiting Core Team Evaluation in Project Backlog Jan 30, 2020
@abitmore
Copy link
Member

No progress. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3d Bug Classification indicating the existing implementation does not match the intention of the design
Projects
None yet
Development

No branches or pull requests

3 participants