Skip to content

Commit 9f96f1c

Browse files
authored
[sanitizer] print both class id and corresponding size when region is exhausted (#116186)
1 parent 1b44c3a commit 9f96f1c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ class SizeClassAllocator64 {
185185
// recoverable.
186186
if (UNLIKELY(!EnsureFreeArraySpace(region, region_beg,
187187
new_num_freed_chunks))) {
188-
Report("FATAL: Internal error: %s's allocator exhausted the free list "
189-
"space for size class %zd (%zd bytes).\n", SanitizerToolName,
190-
class_id, ClassIdToSize(class_id));
188+
Report(
189+
"FATAL: Internal error: %s's allocator exhausted the free list "
190+
"space for size class %zu (%zu bytes).\n",
191+
SanitizerToolName, class_id, ClassIdToSize(class_id));
191192
Die();
192193
}
193194
for (uptr i = 0; i < n_chunks; i++)
@@ -763,8 +764,9 @@ class SizeClassAllocator64 {
763764
if (!region->exhausted) {
764765
region->exhausted = true;
765766
Printf("%s: Out of memory. ", SanitizerToolName);
766-
Printf("The process has exhausted %zuMB for size class %zu.\n",
767-
kRegionSize >> 20, ClassIdToSize(class_id));
767+
Printf(
768+
"The process has exhausted %zu MB for size class %zu (%zu bytes).\n",
769+
kRegionSize >> 20, class_id, ClassIdToSize(class_id));
768770
}
769771
return true;
770772
}

0 commit comments

Comments
 (0)