[compiler-rt] [scudo][fuchsia] Give dispatched VMOs a (temporary) name (PR #97578)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 06:58:41 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Fabio D'Urso (fabio-d)

<details>
<summary>Changes</summary>

Instead of leaving them unnamed. Subsequent remap() calls will
set the actual final name.


---
Full diff: https://github.com/llvm/llvm-project/pull/97578.diff


1 Files Affected:

- (modified) compiler-rt/lib/scudo/standalone/mem_map_fuchsia.cpp (+3) 


``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/mem_map_fuchsia.cpp b/compiler-rt/lib/scudo/standalone/mem_map_fuchsia.cpp
index fc793abf44cda..9d6df2bc69996 100644
--- a/compiler-rt/lib/scudo/standalone/mem_map_fuchsia.cpp
+++ b/compiler-rt/lib/scudo/standalone/mem_map_fuchsia.cpp
@@ -91,12 +91,15 @@ static bool IsNoMemError(zx_status_t Status) {
   return Status == ZX_ERR_NO_MEMORY || Status == ZX_ERR_NO_RESOURCES;
 }
 
+// Note: this constructor is only called by ReservedMemoryFuchsia::dispatch.
 MemMapFuchsia::MemMapFuchsia(uptr Base, uptr Capacity)
     : MapAddr(Base), WindowBase(Base), WindowSize(Capacity) {
   // Create the VMO.
   zx_status_t Status = _zx_vmo_create(Capacity, 0, &Vmo);
   if (UNLIKELY(Status != ZX_OK))
     dieOnError(Status, "zx_vmo_create", Capacity);
+
+  setVmoName(Vmo, "scudo:dispatched");
 }
 
 bool MemMapFuchsia::mapImpl(UNUSED uptr Addr, uptr Size, const char *Name,

``````````

</details>


https://github.com/llvm/llvm-project/pull/97578


More information about the llvm-commits mailing list