[all-commits] [llvm/llvm-project] 2efc09: [scudo][standalone] Fix tests under ASan/UBSan

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Wed Sep 23 12:08:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2efc09c90914a6c887cb772130d6b375a1713472
      https://github.com/llvm/llvm-project/commit/2efc09c90914a6c887cb772130d6b375a1713472
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/string_utils.cpp
    M compiler-rt/lib/scudo/standalone/tests/combined_test.cpp

  Log Message:
  -----------
  [scudo][standalone] Fix tests under ASan/UBSan

Fix a potential UB in `appendSignedDecimal` (with -INT64_MIN) by making
it a special case.

Fix the terrible test cases for `isOwned`: I was pretty sloppy on those
and used some stack & static variables, but since `isOwned` accesses
memory prior to the pointer to check for the validity of the Scudo
header, it ended up being detected as some global and stack buffer out
of bounds accesses. So not I am using buffers with enough room so that
the test will not access memory prior to the variables.

With those fixes, the tests pass on the ASan+UBSan Fuchsia build.

Thanks to Roland for pointing those out!

Differential Revision: https://reviews.llvm.org/D88170




More information about the All-commits mailing list