Merge "fdtrack: make it clearer that there's more information available." into main am: 3cd51b749d am: 4f4fc67f63

Original change: https://android-review.googlesource.com/c/platform/bionic/+/3108439

Change-Id: I91abbaa15393cc06ee18558eeb9f814a5ca4356d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Elliott Hughes 2024-05-30 19:55:39 +00:00 committed by Automerger Merge Worker
commit 494be60a89

View file

@ -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;