Skip to content

Commit

Permalink
Add missing call to Symbolizer::LateInitialize() in UBSan's standal…
Browse files Browse the repository at this point in the history
…one init.

Summary:
This fixes symbolization in Standalone UBSan mode for the Darwin simulators.

861b69f (rdar://problem/58789439) tried to fix
symbolization for all sanitizers on Darwin simulators but unfortunately it only
fixed the problem for TSan.

For UBSan in standalone mode the fix wasn't sufficient because UBSan's
standalone init doesn't call `Symbolizer::LateInitialize()` like ASan
and TSan do. This meant that `AtosSymbolizerProcess::LateInitialize()`
was never being called before
`AtosSymbolizerProcess::StartSymbolizerSubprocess()` which breaks an
invariant we expect to hold.

The missing call to `Symbolizer::LateInitialize()` during UBSan's
standalone init seems like an accidently omission so this patch simply
adds it.

rdar://problem/62083617

Reviewers: vitalybuka, kubamracek, yln, samsonov

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D78530
  • Loading branch information
delcypher committed Apr 22, 2020
1 parent 4ca2cad commit 564530e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler-rt/lib/ubsan/ubsan_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ static void CommonStandaloneInit() {
AndroidLogInit();
InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir);
CommonInit();
Symbolizer::LateInitialize();
}

void __ubsan::InitAsStandalone() {
Expand Down

0 comments on commit 564530e

Please sign in to comment.