Push full warning signature instead of its hash only.
A previous change computed a signature including the function name and offset, but failed to send it to the crash server. This fixes the problem. BUG=chromium:328948 TEST=none Change-Id: I2ff2e548ee1a8feebd6352433c9bd0f96076f15d Reviewed-on: https://chromium-review.googlesource.com/180561 Reviewed-by: Luigi Semenzato <semenzato@chromium.org> Tested-by: Luigi Semenzato <semenzato@chromium.org> Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
This commit is contained in:
parent
82deea83b0
commit
b20c9ef8e9
2 changed files with 11 additions and 11 deletions
|
@ -28,19 +28,19 @@ KernelWarningCollector::~KernelWarningCollector() {
|
|||
}
|
||||
|
||||
bool KernelWarningCollector::LoadKernelWarning(std::string *content,
|
||||
std::string *hash_string) {
|
||||
std::string *signature) {
|
||||
FilePath kernel_warning_path(kKernelWarningPath);
|
||||
if (!base::ReadFileToString(kernel_warning_path, content)) {
|
||||
LOG(ERROR) << "Could not open " << kKernelWarningPath;
|
||||
return false;
|
||||
}
|
||||
/* Verify that the first line contains an 8-digit hex hash. */
|
||||
*hash_string = content->substr(0, 8);
|
||||
std::vector<uint8> output;
|
||||
if (!base::HexStringToBytes(*hash_string, &output)) {
|
||||
LOG(ERROR) << "Bad hash " << *hash_string << " in " << kKernelWarningPath;
|
||||
/* The signature is in the first line. */
|
||||
std::string::size_type end_position = content->find('\n');
|
||||
if (end_position == std::string::npos) {
|
||||
LOG(ERROR) << "unexpected kernel warning format";
|
||||
return false;
|
||||
}
|
||||
*signature = content->substr(0, end_position);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -62,8 +62,8 @@ bool KernelWarningCollector::Collect() {
|
|||
}
|
||||
|
||||
std::string kernel_warning;
|
||||
std::string warning_hash;
|
||||
if (!LoadKernelWarning(&kernel_warning, &warning_hash)) {
|
||||
std::string warning_signature;
|
||||
if (!LoadKernelWarning(&kernel_warning, &warning_signature)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ bool KernelWarningCollector::Collect() {
|
|||
return true;
|
||||
}
|
||||
|
||||
AddCrashMetaData(kKernelWarningSignatureKey, warning_hash);
|
||||
AddCrashMetaData(kKernelWarningSignatureKey, warning_signature);
|
||||
WriteCrashMetaData(
|
||||
root_crash_directory.Append(
|
||||
StringPrintf("%s.meta", dump_basename.c_str())),
|
||||
|
|
|
@ -24,8 +24,8 @@ class KernelWarningCollector : public CrashCollector {
|
|||
friend class KernelWarningCollectorTest;
|
||||
FRIEND_TEST(KernelWarningCollectorTest, CollectOK);
|
||||
|
||||
// Reads the full content of the kernel warn dump and the warning hash.
|
||||
bool LoadKernelWarning(std::string *hash, std::string *content);
|
||||
// Reads the full content of the kernel warn dump and its signature.
|
||||
bool LoadKernelWarning(std::string *content, std::string *signature);
|
||||
};
|
||||
|
||||
#endif // _CRASH_REPORTER_KERNEL_WARNING_COLLECTOR_H_
|
||||
|
|
Loading…
Reference in a new issue