From a950ac230ec900c53fa74f46c18f86a459c80831 Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Thu, 11 Apr 2019 15:00:25 +1000 Subject: [PATCH] crush/CrushCompiler: Fix __replacement_assert When compiled with _GLIBCXX_ASSERTIONS we see an assert due to UB of passing the address of an empty vector. Use vector's data member function instead of address of array syntax. Fixes: http://tracker.ceph.com/issues/39174 Signed-off-by: Brad Hubbard --- src/crush/CrushCompiler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crush/CrushCompiler.cc b/src/crush/CrushCompiler.cc index 811852e25b30f..d9a0e26b32f03 100644 --- a/src/crush/CrushCompiler.cc +++ b/src/crush/CrushCompiler.cc @@ -751,7 +751,7 @@ int CrushCompiler::parse_bucket(iter_t const& i) ceph_assert(id != 0); int idout; int r = crush.add_bucket(id, alg, hash, type, size, - &items[0], &weights[0], &idout); + items.data(), weights.data(), &idout); if (r < 0) { if (r == -EEXIST) err << "Duplicate bucket id " << id << std::endl; -- 2.39.5