From bc89edc3c33f53f427bc540e8c9550aae8635b84 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 9 Oct 2024 14:55:58 -0400 Subject: [PATCH] kernel/vm: Add some more information to the commitment <= size check. May help with diagnosing #19155. --- src/system/kernel/vm/VMCache.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/vm/VMCache.cpp b/src/system/kernel/vm/VMCache.cpp index a5daae8b57..ae86c643ba 100644 --- a/src/system/kernel/vm/VMCache.cpp +++ b/src/system/kernel/vm/VMCache.cpp @@ -1090,7 +1090,11 @@ VMCache::SetMinimalCommitment(off_t commitment, int priority) // If we don't have enough committed space to cover through to the new end // of the area... if (committed_size < commitment) { - ASSERT(commitment <= ROUNDUP(virtual_end - virtual_base, B_PAGE_SIZE)); +#if KDEBUG + const off_t size = ROUNDUP(virtual_end - virtual_base, B_PAGE_SIZE); + ASSERT_PRINT(commitment <= size, "cache %p, commitment %" B_PRIdOFF ", size %" B_PRIdOFF, + this, commitment, size); +#endif // try to commit more memory status = Commit(commitment, priority);