Skip to content

Commit

Permalink
Fix static initialization order fiasco in velox
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookincubator/velox#12204

Replace global statics with local to avoid non-determinism
https://en.cppreference.com/w/cpp/language/siof

AddressSanitizer: initialization-order-fiasco fbcode/velox/common/memory/Memory.cpp:381 in facebook::velox::memory::deprecatedDefaultMemoryManager()
```

now: doesn't crash

Differential Revision: D68857074
  • Loading branch information
mkatsevVR authored and facebook-github-bot committed Jan 29, 2025
1 parent 4464129 commit 42e0de3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace facebook::velox;
using namespace facebook::presto;

TEST(VeloxToPrestoExceptionTranslatorTest, exceptionTranslation) {
config::globalConfig.exceptionUserStacktraceEnabled = true;
config::globalConfig().exceptionUserStacktraceEnabled = true;
for (const bool withContext : {false, true}) {
for (const bool withAdditionalContext : {false, true}) {
SCOPED_TRACE(fmt::format("withContext: {}", withContext));
Expand Down

0 comments on commit 42e0de3

Please sign in to comment.