Skip to content

[Sanitizer][Windows] Fix Windows buildbot failure after 64790064e82467b43c04a70b6e9873e6939be81f #82215

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 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler-rt/lib/sanitizer_common/sanitizer_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ class InternalMmapVectorNoCtor {
T *new_data =
(T *)MmapOrDie(new_capacity_bytes, "InternalMmapVector", raw_report);
internal_memcpy(new_data, data_, size_ * sizeof(T));
UnmapOrDie(data_, capacity_bytes_);
UnmapOrDie(data_, capacity_bytes_, raw_report);
data_ = new_data;
capacity_bytes_ = new_capacity_bytes;
}
Expand Down
7 changes: 2 additions & 5 deletions compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void *MmapOrDie(uptr size, const char *mem_type, bool raw_report) {
return rv;
}

void UnmapOrDie(void *addr, uptr size) {
void UnmapOrDie(void *addr, uptr size, bool raw_report) {
if (!size || !addr)
return;

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