From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14076 invoked by alias); 28 Apr 2014 08:15:10 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13601 invoked by uid 48); 28 Apr 2014 08:15:03 -0000 From: "thomas.sanchz at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/60966] std::call_once sometime hangs Date: Mon, 28 Apr 2014 08:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: thomas.sanchz at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg02049.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60966 --- Comment #6 from Thomas Sanchez --- Last comment on myself: I got some errors relates to the promise with valgrind but they do not cause an hangs ==30999== Thread 2: ==30999== Invalid read of size 4 ==30999== at 0x4E44A91: pthread_once (pthread_once.S:111) ==30999== by 0x4F4274: __gthread_once(int*, void (*)()) (gthr-default.h:699) ==30999== by 0x4FADBC: void std::call_once ()>&, bool&), std::__future_base::_State_base* const, std::reference_wrapper ()> >, std::reference_wrapper >(std::once_flag&, void (std::__future_base::_State_base::*&&)(std::function ()>&, bool&), std::__future_base::_State_base* const&&, std::reference_wrapper ()> >&&, std::reference_wrapper&&) (mutex:786) ==30999== by 0x4F75A2: std::__future_base::_State_base::_M_set_result(std::function ()>, bool) (future:358) ==30999== by 0x50B666: std::promise::set_value() (future:1197) ==30999== by 0x506E1F: HTTPP::HTTP::client::detail::Manager::check_handles(std::promise&) (Manager.cpp:87) ==30999== by 0x51D9A6: void std::_Mem_fn&)>::operator()&, void>(HTTPP::HTTP::client::detail::Manager*, std::promise&) const (in /home/daedric/perso/httpp/build/tests/client/Test_Client_promise) ==30999== by 0x51CFBE: void std::_Bind&)> (HTTPP::HTTP::client::detail::Manager*, std::reference_wrapper >)>::__call(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) (functional:1296) ==30999== by 0x51C4FF: void std::_Bind&)> (HTTPP::HTTP::client::detail::Manager*, std::reference_wrapper >)>::operator()<, void>() (functional:1355) ==30999== by 0x51B594: void boost::asio::asio_handler_invoke&)> (HTTPP::HTTP::client::detail::Manager*, std::reference_wrapper >)> >(std::_Bind&)> (HTTPP::HTTP::client::detail::Manager*, std::reference_wrapper >)>, ...) (handler_invoke_hook.hpp:64) ==30999== by 0x519E81: void boost_asio_handler_invoke_helpers::invoke&)> (HTTPP::HTTP::client::detail::Manager*, std::reference_wrapper >)>, std::_Bind&)> (HTTPP::HTTP::client::detail::Manager*, std::reference_wrapper >)> >(std::_Bind&)> (HTTPP::HTTP::client::detail::Manager*, std::reference_wrapper >)>&, std::_Bind&)> (HTTPP::HTTP::client::detail::Manager*, std::reference_wrapper >)>&) (handler_invoke_helpers.hpp:37) ==30999== by 0x51B6CE: boost::asio::detail::completion_handler&)> (HTTPP::HTTP::client::detail::Manager*, std::reference_wrapper >)> >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) (completion_handler.hpp:68) ==30999== Address 0xdbd3b54 is 132 bytes inside a block of size 136 free'd ==30999== at 0x4C2C2BC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==30999== by 0x504C41: __gnu_cxx::new_allocator, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (new_allocator.h:110) ==30999== by 0x5045F2: std::allocator_traits, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (alloc_traits.h:377) ==30999== by 0x505D85: std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>::_M_destroy() (shared_ptr_base.h:417) ==30999== by 0x4F2A51: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (shared_ptr_base.h:161) ==30999== by 0x4F1CC4: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (shared_ptr_base.h:546) ==30999== by 0x4F15F3: std::__shared_ptr::~__shared_ptr() (shared_ptr_base.h:781) ==30999== by 0x4F160D: std::shared_ptr::~shared_ptr() (shared_ptr.h:93) ==30999== by 0x50B491: std::promise::~promise() (future:1136) ==30999== by 0x5071C3: HTTPP::HTTP::client::detail::Manager::~Manager() (Manager.cpp:121) ==30999== by 0x4F2F2B: std::default_delete::operator()(HTTPP::HTTP::client::detail::Manager*) const (unique_ptr.h:67) ==30999== by 0x4F262F: std::unique_ptr >::reset(HTTPP::HTTP::client::detail::Manager*) (unique_ptr.h:262)