Skip to content

[scudo][fuchsia] Give dispatched VMOs a (temporary) name #97578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

fabio-d
Copy link
Contributor

@fabio-d fabio-d commented Jul 3, 2024

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

Instead of leaving them unnamed. Subsequent remap() calls will
set the actual final name.
@llvmbot
Copy link
Member

llvmbot commented Jul 3, 2024

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

Author: Fabio D'Urso (fabio-d)

Changes

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 --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,

@fabio-d fabio-d requested review from ChiaHungDuan and Caslyn July 4, 2024 11:17
@fabio-d fabio-d merged commit 042ef40 into llvm:main Jul 9, 2024
10 checks passed
@fabio-d fabio-d deleted the no-unnamed-vmos branch July 9, 2024 12:40
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
Instead of leaving them unnamed. Subsequent remap() calls will
set the actual final name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants