[compiler-rt] [sanitizer][fuchsia] Fix fuchsia buildbot failure after 64790064e82467b43c04a70b6e9873e6939be81f (PR #82202)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 17:24:11 PST 2024


PiJoules wrote:

> 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
> 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 https://github.com/llvm/llvm-project/pull/82566

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


More information about the llvm-commits mailing list