From a2ab1b148473366afcfc4d962bfb57c7ba49eca3 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Fri, 6 Aug 2021 17:02:10 -0700 Subject: [PATCH] Disable call to sqlite3_enable_shared_cache under ThreadSanitizer See https://sqlite.org/forum/forumpost/54424d80ee for details. --- src/input/readers/sqlite/SQLite.cc | 2 ++ src/logging/writers/sqlite/SQLite.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/input/readers/sqlite/SQLite.cc b/src/input/readers/sqlite/SQLite.cc index 0785ae226b..f37001d3c3 100644 --- a/src/input/readers/sqlite/SQLite.cc +++ b/src/input/readers/sqlite/SQLite.cc @@ -82,7 +82,9 @@ bool SQLite::DoInit(const ReaderInfo& info, int arg_num_fields, const threading: // Allow connections to same DB to use single data/schema cache. Also // allows simultaneous writes to one file. +#ifndef ZEEK_TSAN sqlite3_enable_shared_cache(1); +#endif if ( Info().mode != MODE_MANUAL ) { diff --git a/src/logging/writers/sqlite/SQLite.cc b/src/logging/writers/sqlite/SQLite.cc index faf80547c2..885eb20b78 100644 --- a/src/logging/writers/sqlite/SQLite.cc +++ b/src/logging/writers/sqlite/SQLite.cc @@ -122,7 +122,9 @@ bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields, // Allow connections to same DB to use single data/schema cache. Also // allows simultaneous writes to one file. +#ifndef ZEEK_TSAN sqlite3_enable_shared_cache(1); +#endif num_fields = arg_num_fields; fields = arg_fields;