[PATCH] D78530: Add missing call to `Symbolizer::LateInitialize()` in UBSan's standalone init.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 19:00:23 PDT 2020


delcypher created this revision.
delcypher added reviewers: vitalybuka, kubamracek, yln, samsonov.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.
delcypher added a reviewer: vsk.

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

861b69faee5df8d4e13ef316c7474a10e4069e81 <https://reviews.llvm.org/rG861b69faee5df8d4e13ef316c7474a10e4069e81> (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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78530

Files:
  compiler-rt/lib/ubsan/ubsan_init.cpp


Index: compiler-rt/lib/ubsan/ubsan_init.cpp
===================================================================
--- compiler-rt/lib/ubsan/ubsan_init.cpp
+++ compiler-rt/lib/ubsan/ubsan_init.cpp
@@ -41,6 +41,7 @@
   AndroidLogInit();
   InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir);
   CommonInit();
+  Symbolizer::LateInitialize();
 }
 
 void __ubsan::InitAsStandalone() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78530.258884.patch
Type: text/x-patch
Size: 403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200421/ef98da11/attachment.bin>


More information about the llvm-commits mailing list