Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: identify the possible incompatibility of rocksdb and tcmalloc #17788

Merged
merged 6 commits into from Sep 20, 2017

Commits on Sep 19, 2017

  1. cmake: enable find_package(perftools) to check non-default dir

    so it checks $ENV{GPERF_ROOT} first.
    
    Signed-off-by: Kefu Chai <kchai@redhat.com>
    tchaikov committed Sep 19, 2017
    Copy the full SHA
    da8ce07 View commit details
    Browse the repository at this point in the history
  2. cmake: extract BuildRocksDB into BuildRocksDB.cmake

    Signed-off-by: Kefu Chai <kchai@redhat.com>
    tchaikov committed Sep 19, 2017
    Copy the full SHA
    aa60362 View commit details
    Browse the repository at this point in the history
  3. cmake: detect gperf-tools' version

    Signed-off-by: Kefu Chai <kchai@redhat.com>
    tchaikov committed Sep 19, 2017
    Copy the full SHA
    58179f0 View commit details
    Browse the repository at this point in the history
  4. cmake: detect rocksdb's version

    Signed-off-by: Kefu Chai <kchai@redhat.com>
    tchaikov committed Sep 19, 2017
    Copy the full SHA
    987c1b3 View commit details
    Browse the repository at this point in the history
  5. cmake: requires rockdb version 5.8

    we've updated the rockdb wrapper on ceph side to be compatible with
    the latest version of rocksdb upstream. so ceph is not compatible with
    older version of rocksdb.
    
    Signed-off-by: Kefu Chai <kchai@redhat.com>
    tchaikov committed Sep 19, 2017
    Copy the full SHA
    c999abd View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2017

  1. cmake: error out if rocksdb is incompatible w/ tcmalloc

    the commit d406f228 in gperf implements a c11 feature used by a
    recent change in rocksdb: 16e03882, which uses aligned_alloc().
    and 16e03882 in rocksdb was merged after v5.7 was tagged, while
    16e03882 in gperf was merged after v2.6.1 was tagged.
    
    because aligned_alloc() is not implemented by tcmalloc until the
    not-yet-released 2.6.2, if we call aligned_alloc() in an application
    linked against tcmalloc, what gets called will be the glibc's
    aligned_alloc(). but if we free() the memory chunk allocated by
    aligned_alloc(), the tcmalloc's implementation kicks in, then
    InvalidFree() is called, because the memory chunk being freed was
    allocated by tcmalloc. in short, "mixing allocators", quote from
    Dan Mick.
    
    in rocksdb, aligned_alloc() is used if _ISOC11_SOURCE is defined, this
    makes sense, because aligned_alloc() is a C11 function. we could avoid
    using it by not defining _ISOC11_SOURCE. but as long as _GNU_SOURCE is
    defined, glibc defines _ISOC11_SOURCE. and libstdc++ requires
    _GNU_SOURCE, because it uses a fair amount of GNU extensions.
    
    Fixes: http://tracker.ceph.com/issues/21422
    Signed-off-by: Kefu Chai <kchai@redhat.com>
    tchaikov committed Sep 20, 2017
    Copy the full SHA
    ff8d6a7 View commit details
    Browse the repository at this point in the history