[all-commits] [llvm/llvm-project] 11ea40: [scudo] releaseToOSMaybe can fail if it can't allo...

ChiaHungDuan via All-commits all-commits at lists.llvm.org
Thu May 25 11:09:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 11ea40cff5413057d823a4b3ac5ac419b674dc56
      https://github.com/llvm/llvm-project/commit/11ea40cff5413057d823a4b3ac5ac419b674dc56
  Author: Chia-hung Duan <chiahungduan at google.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/primary32.h
    M compiler-rt/lib/scudo/standalone/primary64.h
    M compiler-rt/lib/scudo/standalone/release.h
    M compiler-rt/lib/scudo/standalone/tests/release_test.cpp

  Log Message:
  -----------
  [scudo] releaseToOSMaybe can fail if it can't allocate PageMap

PageMap is allocated with MAP_ALLOWNOMEM if there's no static buffer
left. So it can be failed and return nullptr without any assertion
triggered. Instead of crashing in the releaseToOSMaybe in the middle,
just return and let the program handles the page failure.

Reviewed By: cferris

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




More information about the All-commits mailing list