From e56350c4adc1a8f08d08691403b54fd5a398dee6 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 30 May 2024 17:26:25 +0000 Subject: [PATCH] fdtrack: make it clearer that there's more information available. A lot of people who see these via pitot or whatever don't even think to look at the real tombstone. Make it explicit that this is what they should do next. Also, since we have the numbers, say exactly what we mean by "most common". Bug: http://b/338882189 Change-Id: Ia21848a40e82cb2486538a7578501e2ec0948e1c --- libfdtrack/fdtrack.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libfdtrack/fdtrack.cpp b/libfdtrack/fdtrack.cpp index 57b9d3742..3627c847c 100644 --- a/libfdtrack/fdtrack.cpp +++ b/libfdtrack/fdtrack.cpp @@ -281,11 +281,13 @@ static void fdtrack_dump_impl(bool fatal) { if (!stack) { async_safe_format_buffer(buf, sizeof(buf), - "aborting due to fd leak: failed to find most common stack"); + "aborting due to fd leak: see \"open files\" in the tombstone; " + "no stacks?!"); } else { char* p = buf; p += async_safe_format_buffer(buf, sizeof(buf), - "aborting due to fd leak: most common stack =\n"); + "aborting due to fd leak: see \"open files\" in the tombstone; " + "most common stack (%zu/%zu) is\n", max, stacks.count); for (size_t i = 0; i < stack->stack_depth; ++i) { ssize_t bytes_left = buf + sizeof(buf) - p;