revision-id: 10656b89448bf4230a52f63840adb60a6f113086 (fb-prod201803-7-g10656b89448) parent(s): 04d444a49926c91a3f83ae7c442af1e02183ef37 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2018-11-19 18:18:20 +0300 message: Issue #904: Crash in rocksdb::IOStatsContext::Reset, this=NULL Fix both code paths: - Change the test source code so it doesn't cause the "Unused variable" warning (which -Werror converted into error and caused CMake not to set HAVE_THREAD_LOCAL) - If the system doesn't seem to support HAVE_THREAD_LOCAL, refuse to compile (rather than producing a binary that crashes for some tests) --- storage/rocksdb/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 826c0e6603a..64299f91c32 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -47,10 +47,15 @@ CHECK_CXX_SOURCE_COMPILES(" #endif int main() { static __thread int tls; + tls=0; + return tls; } " HAVE_THREAD_LOCAL) if(HAVE_THREAD_LOCAL) ADD_DEFINITIONS(-DROCKSDB_SUPPORT_THREAD_LOCAL) +else() + MESSAGE(SEND_ERROR "The compiler failed the check for ROCKSDB_SUPPORT_THREAD_LOCAL. " + "MyRocks requires that feature.") endif() SET(ROCKSDB_SOURCES