Skip to content

Commit d043b4b

Browse files
authored
[Sanitizer][Windows] Fix Windows buildbot failure after 6479006 (llvm#82215)
In llvm#77488, a param raw_report is added for function UnmapOrDie(), causes the Windows buildbot failure: - https://lab.llvm.org/buildbot/#/builders/127/builds/62395 - https://lab.llvm.org/buildbot/#/builders/265/builds/2662 This patch should fix the Windows buildbot failure.
1 parent d61864f commit d043b4b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ class InternalMmapVectorNoCtor {
599599
T *new_data =
600600
(T *)MmapOrDie(new_capacity_bytes, "InternalMmapVector", raw_report);
601601
internal_memcpy(new_data, data_, size_ * sizeof(T));
602-
UnmapOrDie(data_, capacity_bytes_);
602+
UnmapOrDie(data_, capacity_bytes_, raw_report);
603603
data_ = new_data;
604604
capacity_bytes_ = new_capacity_bytes;
605605
}

compiler-rt/lib/sanitizer_common/sanitizer_win.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void *MmapOrDie(uptr size, const char *mem_type, bool raw_report) {
144144
return rv;
145145
}
146146

147-
void UnmapOrDie(void *addr, uptr size) {
147+
void UnmapOrDie(void *addr, uptr size, bool raw_report) {
148148
if (!size || !addr)
149149
return;
150150

@@ -156,10 +156,7 @@ void UnmapOrDie(void *addr, uptr size) {
156156
// fails try MEM_DECOMMIT.
157157
if (VirtualFree(addr, 0, MEM_RELEASE) == 0) {
158158
if (VirtualFree(addr, size, MEM_DECOMMIT) == 0) {
159-
Report("ERROR: %s failed to "
160-
"deallocate 0x%zx (%zd) bytes at address %p (error code: %d)\n",
161-
SanitizerToolName, size, size, addr, GetLastError());
162-
CHECK("unable to unmap" && 0);
159+
ReportMunmapFailureAndDie(addr, size, GetLastError(), raw_report);
163160
}
164161
}
165162
}

0 commit comments

Comments
 (0)