[Commits] 41893792e3d: Get first variant of fix for Issue #904

Sergei Petrunia psergey at askmonty.org
Sat Jan 5 18:06:41 EET 2019


revision-id: 41893792e3decc68eb68f952e2bc7239bb6e4d36 (fb-prod201801-181-g41893792e3d)
parent(s): 9c0e1c912bf37cec8867806e0a7e46033668a99a
author: Sergei Petrunia
committer: Sergei Petrunia
timestamp: 2019-01-05 19:06:41 +0300
message:

Get first variant of fix for Issue #904

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 1a5357a2dea..e1d13efd81f 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()
 
 


More information about the commits mailing list