Skip to content
Snippets Groups Projects
Commit be0c1af6 authored by Josh Gao's avatar Josh Gao
Browse files

debuggerd_client: improve error logging.

system_server is sometimes failing to dump with the following error:

    libdebuggerd_client: received packet of unexpected length from tombstoned: expected 128, received -1

Improve the logging to try to figure out what's going on.

Bug: http://b/114139908
Test: treehugger
Change-Id: Iee1bdc0891b9fc7bd80a330495ec22a530febddb
parent ebb631b0
No related branches found
No related tags found
No related merge requests found
...@@ -143,11 +143,15 @@ bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int ...@@ -143,11 +143,15 @@ bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int
ssize_t rc = ssize_t rc =
TEMP_FAILURE_RETRY(recv(set_timeout(sockfd.get()), &response, sizeof(response), MSG_TRUNC)); TEMP_FAILURE_RETRY(recv(set_timeout(sockfd.get()), &response, sizeof(response), MSG_TRUNC));
if (rc == 0) { if (rc == 0) {
LOG(ERROR) << "libdebuggerd_client: failed to read response from tombstoned: timeout reached?"; LOG(ERROR) << "libdebuggerd_client: failed to read initial response from tombstoned: "
<< "timeout reached?";
return false;
} else if (rc == -1) {
PLOG(ERROR) << "libdebuggerd_client: failed to read initial response from tombstoned";
return false; return false;
} else if (rc != sizeof(response)) { } else if (rc != sizeof(response)) {
LOG(ERROR) LOG(ERROR) << "libdebuggerd_client: received packet of unexpected length from tombstoned while "
<< "libdebuggerd_client: received packet of unexpected length from tombstoned: expected " "reading initial response: expected "
<< sizeof(response) << ", received " << rc; << sizeof(response) << ", received " << rc;
return false; return false;
} }
...@@ -164,11 +168,15 @@ bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int ...@@ -164,11 +168,15 @@ bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int
rc = TEMP_FAILURE_RETRY(recv(set_timeout(sockfd.get()), &response, sizeof(response), MSG_TRUNC)); rc = TEMP_FAILURE_RETRY(recv(set_timeout(sockfd.get()), &response, sizeof(response), MSG_TRUNC));
if (rc == 0) { if (rc == 0) {
LOG(ERROR) << "libdebuggerd_client: failed to read response from tombstoned: timeout reached?"; LOG(ERROR) << "libdebuggerd_client: failed to read status response from tombstoned: "
"timeout reached?";
return false;
} else if (rc == -1) {
PLOG(ERROR) << "libdebuggerd_client: failed to read status response from tombstoned";
return false; return false;
} else if (rc != sizeof(response)) { } else if (rc != sizeof(response)) {
LOG(ERROR) LOG(ERROR) << "libdebuggerd_client: received packet of unexpected length from tombstoned while "
<< "libdebuggerd_client: received packet of unexpected length from tombstoned: expected " "reading confirmation response: expected "
<< sizeof(response) << ", received " << rc; << sizeof(response) << ", received " << rc;
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment