[PATCH] [compiler-rt] atos symbolizer for OS X

Kuba Brecka kuba.brecka at gmail.com
Tue Dec 9 19:07:43 PST 2014


Hi everyone,

based on the discussion at https://groups.google.com/d/topic/address-sanitizer/2UaT7rvhvJ4/discussion about different symbolizers, especially on OS X, this patch implements a "fallback" symbolizer for OS X that uses the `atos` command line tool, which already ships with OS X. The main reason for that is to have easier deployment to machines that don't have llvm-symbolizer. Even though it was pointed out that `atos` may not be as accurate, having a backup symbolizer is still useful for issue suppressions, where one of the suppression types rely on having a working symbolizer.

As also discussed, the "real" long-term solution is to have internal_symbolizer (llvm-symbolizer built as a standalone static library) being built as part of the LLVM build, but that requires a significant amount of work. This `atos` patch is mostly meant to have something that works in the meantime.

I tried to keep the changes to existing code in sanitizer_symbolizer_posix_libcdep.cc minimal, so I reused the POSIXSymbolizer and added the AtosSymbolizer as another variant of an external symbolizer (a subclass of ExternalSymbolizerInterface). It would maybe make more sense to subclass SymbolizerProcess but that would require more refactoring. The POSIXSymbolizer class is also already very tied to how llvm-symbolizer works, and probably should also be refactored to allow using another tool/format.

That being said, this patch may be sub-optimal from the refactoring point of view, and I'll be glad to redo it properly, but first I'd like to ask if I'm on the right track or if this should be implemented in a completely different way.

Thanks,
Kuba

http://reviews.llvm.org/D6588

Files:
  lib/sanitizer_common/CMakeLists.txt
  lib/sanitizer_common/sanitizer_symbolizer.h
  lib/sanitizer_common/sanitizer_symbolizer_mac.cc
  lib/sanitizer_common/sanitizer_symbolizer_mac.h
  lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6588.17110.patch
Type: text/x-patch
Size: 16602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141210/4924acb3/attachment.bin>


More information about the llvm-commits mailing list