]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
msg/async: open() should be called with connection locked 33015/head
authorRoman Penyaev <rpenyaev@suse.de>
Fri, 31 Jan 2020 15:49:04 +0000 (16:49 +0100)
committerRoman Penyaev <rpenyaev@suse.de>
Fri, 31 Jan 2020 16:06:46 +0000 (17:06 +0100)
commit7d74c7be85a82f529441fe072d7f7cfd6edba8df
tree829349dffa953491e082f5cc0baeffdf124f295b
parentdcb2035cca41596a843561baf288be4e77aa0cd4
msg/async: open() should be called with connection locked

open() function unlocks connection->lock and obviously expects it to
be locked. Usually double unlock can be stayed unnoticed, unless CPU
is intel with TSX support, which eventually ends up with pthread
__lll_unlock_elision call and `xend` instruction, which aborts an
entire application with a page fault with the following backtrace:

  __lll_unlock_elision () from /lib64/libpthread.so.0
  __gthread_mutex_unlock(pthread_mutex_t*) () from /root/devel/ceph-upstream/build/lib/libceph-common.so.2
  std::mutex::unlock() () from /root/devel/ceph-upstream/build/lib/libceph-common.so.2
  ProtocolV1::open(ceph_msg_connect_reply&, ceph::buffer::v14_2_0::list&) () from /root/devel/ceph-upstream/build/lib/libceph-common.so.2
  ProtocolV1::handle_connect_message_2() () from /root/devel/ceph-upstream/build/lib/libceph-common.so.2
  ProtocolV1::handle_connect_message_1(char*, int) () from /root/devel/ceph-upstream/build/lib/libceph-common.so.2

So be nice, don't let double unlock happen.

Signed-off-by: Roman Penyaev <rpenyaev@suse.de>
src/msg/async/ProtocolV1.cc