Skip to content

Commit

Permalink
Disable options_settable_test in UBSAN and fix UBSAN failure in blob_…
Browse files Browse the repository at this point in the history
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 facebook#3477

Differential Revision: D6928681

Pulled By: siying

fbshipit-source-id: e31dd300fcdecdfd4f6af279a0987fd0cdec5122
  • Loading branch information
siying authored and facebook-github-bot committed Feb 7, 2018
1 parent 1336a77 commit 821e0b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)/')
Expand Down
4 changes: 4 additions & 0 deletions db/snapshot_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 821e0b1

Please sign in to comment.