IMPALA-5957: print memory address, not memory The bug is that the pointer was a uint8_t*, which C++ iostreams print as a C-style string. The intent was to instead print the memory address, which happens for void*. To avoid the subtlety, instead convert to uintptr_t and print as hex.
Change-Id: I89250646bf683dd2d636dcb37a66ceb0428af8b2 Reviewed-on: http://gerrit.cloudera.org:8080/8371 Reviewed-by: anujphadke <[email protected]> Reviewed-by: Dan Hecht <[email protected]> Tested-by: Impala Public Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/98f8b19c Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/98f8b19c Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/98f8b19c Branch: refs/heads/master Commit: 98f8b19c3bd0debfe25055aaecaf86e38b23c748 Parents: 5ebea0e Author: Tim Armstrong <[email protected]> Authored: Tue Oct 24 11:04:55 2017 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Wed Oct 25 00:48:44 2017 +0000 ---------------------------------------------------------------------- be/src/runtime/bufferpool/system-allocator.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/98f8b19c/be/src/runtime/bufferpool/system-allocator.cc ---------------------------------------------------------------------- diff --git a/be/src/runtime/bufferpool/system-allocator.cc b/be/src/runtime/bufferpool/system-allocator.cc index b3ba2b8..8dc4625 100644 --- a/be/src/runtime/bufferpool/system-allocator.cc +++ b/be/src/runtime/bufferpool/system-allocator.cc @@ -96,7 +96,8 @@ Status SystemAllocator::AllocateViaMMap(int64_t len, uint8_t** buffer_mem) { map_len -= fixup; } munmap(mem + len, map_len - len); - DCHECK_EQ(reinterpret_cast<uintptr_t>(mem) % HUGE_PAGE_SIZE, 0) << mem; + DCHECK_EQ(reinterpret_cast<uintptr_t>(mem) % HUGE_PAGE_SIZE, 0) + << std::hex << reinterpret_cast<uintptr_t>(mem); // Mark the buffer as a candidate for promotion to huge pages. The Linux Transparent // Huge Pages implementation will try to back the memory with a huge page if it is // enabled. MADV_HUGEPAGE was introduced in 2.6.38, so we similarly need to skip this
