Skip to content

[sanitizer][fuchsia] Fix fuchsia buildbot failure after 64790064e82467b43c04a70b6e9873e6939be81f #82202

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
Feb 19, 2024

Conversation

Enna1
Copy link
Contributor

@Enna1 Enna1 commented Feb 19, 2024

In #77488, a param raw_report is added for function UnmapOrDie().
But missing the corresponding change for fuchsia, causes the buildbot failure, see https://lab.llvm.org/buildbot/#/builders/98/builds/33593.
This patch should fix the fuchsia buildbot failure.

@Enna1 Enna1 changed the title [sanitizer][fuchsia] Fix fuchsia buildbot failure after 64790064e8246… [sanitizer][fuchsia] Fix fuchsia buildbot failure after 64790064e82467b43c04a70b6e9873e6939be81f Feb 19, 2024
@Enna1
Copy link
Contributor Author

Enna1 commented Feb 19, 2024

Ideally, we should add raw_report support for function UnmapOrDieVmar().
But I'm not familiar with fuchsia, and do not have a fuchsia environment to build and test...

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
index 2f291f7ca9ea..1558f83f871d 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
@@ -288,7 +288,7 @@ uptr ReservedAddressRange::MapOrDie(uptr fixed_addr, uptr map_size,
                           name ? name : name_, true);
 }
 
-void UnmapOrDieVmar(void *addr, uptr size, zx_handle_t target_vmar) {
+void UnmapOrDieVmar(void *addr, uptr size, zx_handle_t target_vmar, bool raw_report) {
   if (!addr || !size)
     return;
   size = RoundUpTo(size, GetPageSize());
@@ -301,12 +301,8 @@ void UnmapOrDieVmar(void *addr, uptr size, zx_handle_t target_vmar) {
     status = _zx_vmar_unmap(_zx_vmar_root_self(),
                             reinterpret_cast<uintptr_t>(addr), size);
   }
-  if (status != ZX_OK) {
-    Report("ERROR: %s failed to deallocate 0x%zx (%zd) bytes at address %p\n",
-           SanitizerToolName, size, size, addr);
-    CHECK("unable to unmap" && 0);
-  }
-
+  if (status != ZX_OK)
+    ReportMunmapFailureAndDie(addr, size, status, raw_report);
   DecreaseTotalMmap(size);
 }
 

@llvmbot
Copy link
Member

llvmbot commented Feb 19, 2024

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

Author: Enna1 (Enna1)

Changes

In #77488, a param raw_report is added for function UnmapOrDie().
But missing the corresponding change for fuchsia, causes the buildbot failure, see https://lab.llvm.org/buildbot/#/builders/98/builds/33593.
This patch fixes the fuchsia buildbot failure.


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

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp (+1-1)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
index 5f4f8c8c0078cd..2f291f7ca9ea10 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
@@ -413,7 +413,7 @@ void *MmapAlignedOrDieOnFatalError(uptr size, uptr alignment,
   return reinterpret_cast<void *>(addr);
 }
 
-void UnmapOrDie(void *addr, uptr size) {
+void UnmapOrDie(void *addr, uptr size, bool) {
   UnmapOrDieVmar(addr, size, gSanitizerHeapVmar);
 }
 

@Enna1 Enna1 merged commit 9b76515 into main Feb 19, 2024
@Enna1 Enna1 deleted the users/Enna1/fix-fuchsia-UnmapOrDie branch February 19, 2024 04:14
@PiJoules
Copy link
Contributor

Ideally, we should add raw_report support for function UnmapOrDieVmar(). But I'm not familiar with fuchsia, and do not have a fuchsia environment to build and test...

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
index 2f291f7ca9ea..1558f83f871d 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
@@ -288,7 +288,7 @@ uptr ReservedAddressRange::MapOrDie(uptr fixed_addr, uptr map_size,
                           name ? name : name_, true);
 }
 
-void UnmapOrDieVmar(void *addr, uptr size, zx_handle_t target_vmar) {
+void UnmapOrDieVmar(void *addr, uptr size, zx_handle_t target_vmar, bool raw_report) {
   if (!addr || !size)
     return;
   size = RoundUpTo(size, GetPageSize());
@@ -301,12 +301,8 @@ void UnmapOrDieVmar(void *addr, uptr size, zx_handle_t target_vmar) {
     status = _zx_vmar_unmap(_zx_vmar_root_self(),
                             reinterpret_cast<uintptr_t>(addr), size);
   }
-  if (status != ZX_OK) {
-    Report("ERROR: %s failed to deallocate 0x%zx (%zd) bytes at address %p\n",
-           SanitizerToolName, size, size, addr);
-    CHECK("unable to unmap" && 0);
-  }
-
+  if (status != ZX_OK)
+    ReportMunmapFailureAndDie(addr, size, status, raw_report);
   DecreaseTotalMmap(size);
 }
 

This is the correct change. Submitted this in #82566

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