Mir

helgrind: dubious: associated lock is not held by any thread: void boost::asio::detail::posix_event::signal_and_unlock<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&) (posix_event.hpp:62)

Bug #1243564 reported by Daniel van Vugt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Expired
Medium
Unassigned
boost1.53 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

helgrind: dubious: associated lock is not held by any thread: void boost::asio::detail::posix_event::signal_and_unlock<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&) (posix_event.hpp:62)

This seems to happen repeatedly...

==21450== ----------------------------------------------------------------
==21450==
==21450== Thread #10: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
==21450== at 0x4C2D518: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==21450== by 0x52ECFFA: void boost::asio::detail::posix_event::signal_and_unlock<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&) (posix_event.hpp:62)
==21450== by 0x52E9AFC: boost::asio::detail::task_io_service::wake_one_idle_thread_and_unlock(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&) (task_io_service.ipp:509)
==21450== by 0x52E9B2E: boost::asio::detail::task_io_service::wake_one_thread_and_unlock(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&) (task_io_service.ipp:518)
==21450== by 0x52E98EE: boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&) (task_io_service.ipp:403)
==21450== by 0x52E9383: boost::asio::detail::task_io_service::run(boost::system::error_code&) (task_io_service.ipp:153)
==21450== by 0x52E9C8E: boost::asio::io_service::run() (io_service.ipp:59)
==21450== by 0x5319727: mir::frontend::BasicConnector::start()::{lambda()#1}::operator()() const (published_socket_connector.cpp:103)
==21450== by 0x531AEB9: void std::_Bind_simple<mir::frontend::BasicConnector::start()::{lambda()#1} ()>::_M_invoke<>(std::_Index_tuple<>) (functional:1732)
==21450== by 0x531AE06: std::_Bind_simple<mir::frontend::BasicConnector::start()::{lambda()#1} ()>::operator()() (functional:1720)
==21450== by 0x531AD9F: std::thread::_Impl<std::_Bind_simple<mir::frontend::BasicConnector::start()::{lambda()#1} ()> >::_M_run() (thread:115)
==21450== by 0x5E7776F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==21450==

==21450== ----------------------------------------------------------------
==21450==
==21450== Thread #9: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
==21450== at 0x4C2D518: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==21450== by 0x52ECFFA: void boost::asio::detail::posix_event::signal_and_unlock<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&) (posix_event.hpp:62)
==21450== by 0x52E9AFC: boost::asio::detail::task_io_service::wake_one_idle_thread_and_unlock(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&) (task_io_service.ipp:509)
==21450== by 0x52E984B: boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&) (task_io_service.ipp:384)
==21450== by 0x52E9383: boost::asio::detail::task_io_service::run(boost::system::error_code&) (task_io_service.ipp:153)
==21450== by 0x52E9C8E: boost::asio::io_service::run() (io_service.ipp:59)
==21450== by 0x5319727: mir::frontend::BasicConnector::start()::{lambda()#1}::operator()() const (published_socket_connector.cpp:103)
==21450== by 0x531AEB9: void std::_Bind_simple<mir::frontend::BasicConnector::start()::{lambda()#1} ()>::_M_invoke<>(std::_Index_tuple<>) (functional:1732)
==21450== by 0x531AE06: std::_Bind_simple<mir::frontend::BasicConnector::start()::{lambda()#1} ()>::operator()() (functional:1720)
==21450== by 0x531AD9F: std::thread::_Impl<std::_Bind_simple<mir::frontend::BasicConnector::start()::{lambda()#1} ()> >::_M_run() (thread:115)
==21450== by 0x5E7776F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==21450== by 0x4C2EA06: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==21450==

Tags: helgrind
tags: added: helgrind
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Could be a false positive. --> medium

Changed in mir:
importance: Undecided → Medium
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

So long as helgrind has wrapped all your locking primitives (e.g. implements in terms of pthreads) then the Eraser algorithm it uses is very reliable and doesn't give false positives.

Although we have seen at least one such case where this happens -- std::atomic is not implemented in terms of locking primitives that helgrind understands. But std::atomic is the only case I'm aware of where Helgrind should give false positives.

Unfortunately, Helgrind was suggested so late in Mir's development that the code base was already full of a large number of races which will be very difficult to get on top of. And while we're not on top of it we can't automate it yet either.

Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

I can't get this to happen. Can you? If so, how?

This is a year old. Perhaps it was fixed or that the code changed so much that it takes some more effort.

Changed in mir:
status: New → Incomplete
Changed in boost1.53 (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for boost1.53 (Ubuntu) because there has been no activity for 60 days.]

Changed in boost1.53 (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Mir because there has been no activity for 60 days.]

Changed in mir:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.