havenprotocol / haven

Haven is an untraceable cryptocurrency that proposes a new way of achieving a stable fiat value storage while being traded at market value.
Other
58 stars 41 forks source link

High Memory Usage #35

Open blbruegg opened 5 years ago

blbruegg commented 5 years ago

I believe seed nodes being down have created this issue. Needs an exception written, null_ptr, deconstructor etc for when this arrises.
valgrind -v --leak-check=full --show-leak-kinds=all ./havend --log-level 3 ==15074== ==15074== ==15074== 3318 errors in context 774 of 775: ==15074== Use of uninitialised value of size 8 ==15074== at 0x4C34163: memcpy@GLIBC_2.2.5 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==15074== by 0x598C560: printf_fp_l (printf_fp.c:550) ==15074== by 0x5989A06: vfprintf (vfprintf.c:1642) ==15074== by 0x59B590F: vsnprintf (vsnprintf.c:114) ==15074== by 0xACC62B: std::convert_from_v(locale_struct const&, char, int, char const, ...) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0xAE4F16: std::ostreambuf_iterator<char, std::char_traits > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits > >::_M_insert_float(std::ostreambuf_iterator<char, std::char_traits >, std::ios_base&, char, char, double) const (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0xAE524F: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits > >::do_put(std::ostreambuf_iterator<char, std::char_traits >, std::ios_base&, char, double) const (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0xAF4834: std::ostream& std::ostream::_M_insert(double) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0x6A0F8A: epee::net_utils::network_throttle::tick() (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0x6A1299: epee::net_utils::network_throttle::_handle_trafic_exact(unsigned long, unsigned long) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0x58FDC5: epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > >::handle_read(boost::system::error_code const&, unsigned long) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0x55BCF6: void boost::asio::detail::strand_service::dispatch<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > >, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > > > >, boost::arg<1> ()(), boost::arg<2> ()()> >, boost::system::error_code, unsigned long> >(boost::asio::detail::strand_service::strand_impl&, boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > >, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > > > >, boost::arg<1> ()(), boost::arg<2> ()()> >, boost::system::error_code, unsigned long>&) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== ==15074== ==15074== 3536 errors in context 775 of 775: ==15074== Conditional jump or move depends on uninitialised value(s) ==15074== at 0x598C16F: printf_fp_l (printf_fp.c:484) ==15074== by 0x5989A06: vfprintf (vfprintf.c:1642) ==15074== by 0x59B590F: vsnprintf (vsnprintf.c:114) ==15074== by 0xACC62B: std::convert_from_v(locale_struct const&, char, int, char const, ...) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0xAE4F16: std::ostreambuf_iterator<char, std::char_traits > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits > >::_M_insert_float(std::ostreambuf_iterator<char, std::char_traits >, std::ios_base&, char, char, double) const (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0xAE524F: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits > >::do_put(std::ostreambuf_iterator<char, std::char_traits >, std::ios_base&, char, double) const (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0xAF4834: std::ostream& std::ostream::_M_insert(double) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0x6A0F8A: epee::net_utils::network_throttle::tick() (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0x6A1299: epee::net_utils::network_throttle::_handle_trafic_exact(unsigned long, unsigned long) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0x58FDC5: epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > >::handle_read(boost::system::error_code const&, unsigned long) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0x55BCF6: void boost::asio::detail::strand_service::dispatch<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > >, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > > > >, boost::arg<1> ()(), boost::arg<2> ()()> >, boost::system::error_code, unsigned long> >(boost::asio::detail::strand_service::strand_impl&, boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > >, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > > > >, boost::arg<1> ()(), boost::arg<2> ()()> >, boost::system::error_code, unsigned long>&) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== by 0x55C07A: boost::asio::detail::completion_handler<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, boost::_bi::bind_t<void, boost::_mfi::mf2<void, epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > >, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > > > >, boost::arg<1> ()(), boost::arg<2> ()()> >, boost::asio::detail::is_continuation_if_running>, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > >, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<epee::net_utils::connection<epee::levin::async_protocol_handler<nodetool::p2p_connection_context_t > > > >, boost::arg<1> ()(), boost::arg<2> ()()> > > >::do_complete(void, boost::asio::detail::scheduler_operation, boost::system::error_code const&, unsigned long) (in /home/yiimpserver/haven/build/release/bin/havend) ==15074== ==15074== ERROR SUMMARY: 134680 errors from 775 contexts (suppressed: 0 from 0)

simpleminers commented 5 years ago

I had the same issue and it keeps recurring, works for a while but consumes all system memory after.

blbruegg commented 5 years ago

Fixed with commit https://github.com/havenprotocol/haven/commit/2dd669485eadd1c792c7db9434307645f5903e22