[all-commits] [llvm/llvm-project] fd9f7b: [lsan][test] Obtaining page size using sysconf(_SC...

Ami-zhang via All-commits all-commits at lists.llvm.org
Sun Apr 23 23:28:16 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd9f7b90109b3fb9a3ac8df5eb4dd966a359c2f4
      https://github.com/llvm/llvm-project/commit/fd9f7b90109b3fb9a3ac8df5eb4dd966a359c2f4
  Author: zhanglimin <zhanglimin at loongson.cn>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M compiler-rt/test/lsan/TestCases/Linux/leak_check_segv.cpp

  Log Message:
  -----------
  [lsan][test] Obtaining page size using sysconf(_SC_PAGESIZE)

The effectiveness of the mprotect function depends on whether
the first argument is aligned to a page boundary. If mprotect
doesn't work, the kernel will not generate a SIGSEGV signal for
the process when the calling process tries to access memory in
a manner that violates the protection. If so, this test fails.

The problem for this test is that it uses a fixed 4 kB page size
and is aligned. This fails when the page size is not 4 kB. For
example, this fails on LoongArch which uses a 16 kB pagesize.

Reviewed By: SixWeining, xen0n, MaskRay, vitalybuka

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




More information about the All-commits mailing list