From 821e0b168369aa95e84872a25ef0c409542ef947 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Wed, 7 Feb 2018 14:28:50 -0800 Subject: [PATCH] =?UTF-8?q?Disable=20options=5Fsettable=5Ftest=20in=20UBSA?= =?UTF-8?q?N=20and=20fix=20UBSAN=20failure=20in=20blob=5F=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: …db_test options_settable_test won't pass UBSAN so disable it. blob_db_test fails in UBSAN as SnapshotList doesn't initialize all the fields in dummy snapshot. Fix it. I don't understand why only blob_db_test fails though. Closes https://github.com/facebook/rocksdb/pull/3477 Differential Revision: D6928681 Pulled By: siying fbshipit-source-id: e31dd300fcdecdfd4f6af279a0987fd0cdec5122 --- Makefile | 4 ++++ db/snapshot_impl.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Makefile b/Makefile index d840bd642..e8a00bb2d 100644 --- a/Makefile +++ b/Makefile @@ -527,6 +527,10 @@ PARALLEL_TEST = \ transaction_test \ write_prepared_transaction_test \ +# options_settable_test doesn't pass with UBSAN as we use hack in the test +ifdef COMPILE_WITH_UBSAN + TESTS := $(shell echo $(TESTS) | sed 's/\boptions_settable_test\b//g') +endif SUBSET := $(TESTS) ifdef ROCKSDBTESTS_START SUBSET := $(shell echo $(SUBSET) | sed 's/^.*$(ROCKSDBTESTS_START)/$(ROCKSDBTESTS_START)/') diff --git a/db/snapshot_impl.h b/db/snapshot_impl.h index ad9c1a9fb..185daa4e1 100644 --- a/db/snapshot_impl.h +++ b/db/snapshot_impl.h @@ -45,6 +45,10 @@ class SnapshotList { list_.prev_ = &list_; list_.next_ = &list_; list_.number_ = 0xFFFFFFFFL; // placeholder marker, for debugging + // Set all the variables to make UBSAN happy. + list_.list_ = nullptr; + list_.unix_time_ = 0; + list_.is_write_conflict_boundary_ = false; count_ = 0; }