Skip to content
Snippets Groups Projects
  1. May 02, 2017
  2. Apr 14, 2017
    • Vedant Kumar's avatar
      [docs] UBSan: Mention that print_stacktrace=1 is unsupported on Darwin · 17b8d036
      Vedant Kumar authored
      Printing out stack traces along with UBSan diagnostics is unsupported on
      Darwin. That's because it isn't possible to use the fast unwinder or the
      slow unwinder.
      
      Apparently, it's inappropriate to use the fast unwinder for UBSan
      issues. I'm not exactly sure why (see the comment in ubsan_diag.cc).
      Forcing use of the fast unwinder produces decent results, AFAICT.
      
      Darwin also does not appear to have a slow unwinder suitable for use
      with the sanitizers. Apparently that's because of PR20800 [1][2]. But
      that bug has been fixed. I'm not sure if there is anything preventing
      use of the slow unwinder now.
      
      Currently, passing UBSAN_OPTIONS=print_stacktrace=1 does nothing on
      Darwin. This isn't good, but it might be a while before we can fix the
      situation, so we should at least document it.
      
      [1] https://github.com/google/sanitizers/issues/137
      "We can't use the slow unwinder on OSX now, because Clang produces
      incorrect unwind info for the ASan runtime functions on OSX
      (http://llvm.org/PR20800)."
      
      [2] https://bugs.llvm.org/show_bug.cgi?id=20800
      Bug 20800 - Invalid compact unwind info generated for a function without
      frame pointers on OSX
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300295 91177308-0d34-0410-b5e6-96231b3b80d8
      17b8d036
  3. Mar 20, 2017
  4. Mar 14, 2017
    • Vedant Kumar's avatar
      [ubsan] Add a nullability sanitizer · 60b8b697
      Vedant Kumar authored
      Teach UBSan to detect when a value with the _Nonnull type annotation
      assumes a null value. Call expressions, initializers, assignments, and
      return statements are all checked.
      
      Because _Nonnull does not affect IRGen, the new checks are disabled by
      default. The new driver flags are:
      
        -fsanitize=nullability-arg      (_Nonnull violation in call)
        -fsanitize=nullability-assign   (_Nonnull violation in assignment)
        -fsanitize=nullability-return   (_Nonnull violation in return stmt)
        -fsanitize=nullability          (all of the above)
      
      This patch builds on top of UBSan's existing support for detecting
      violations of the nonnull attributes ('nonnull' and 'returns_nonnull'),
      and relies on the compiler-rt support for those checks. Eventually we
      will need to update the diagnostic messages in compiler-rt (there are
      FIXME's for this, which will be addressed in a follow-up).
      
      One point of note is that the nullability-return check is only allowed
      to kick in if all arguments to the function satisfy their nullability
      preconditions. This makes it necessary to emit some null checks in the
      function body itself.
      
      Testing: check-clang and check-ubsan. I also built some Apple ObjC
      frameworks with an asserts-enabled compiler, and verified that we get
      valid reports.
      
      Differential Revision: https://reviews.llvm.org/D30762
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297700 91177308-0d34-0410-b5e6-96231b3b80d8
      60b8b697
  5. Feb 27, 2017
  6. Sep 20, 2016
  7. May 12, 2016
  8. Apr 26, 2016
  9. Apr 25, 2016
  10. Jan 30, 2016
  11. Dec 05, 2015
  12. Dec 04, 2015
Loading