aboutsummaryrefslogtreecommitdiff
path: root/kernel_warning_collector.cc
diff options
context:
space:
mode:
authorLuigi Semenzato <semenzato@chromium.org>2013-12-17 18:12:09 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-02-14 18:52:41 +0000
commit26096ac69251054ba5000b1e4b849aeb746b7e00 (patch)
treefb91e4c08191833884daa7254351761f1103008c /kernel_warning_collector.cc
parent647ca40cb84f095b4e684c8cbe32c971ed273d41 (diff)
downloadcrash_reporter-26096ac69251054ba5000b1e4b849aeb746b7e00.tar.gz
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>
Diffstat (limited to 'kernel_warning_collector.cc')
-rw-r--r--kernel_warning_collector.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel_warning_collector.cc b/kernel_warning_collector.cc
index f8188c7..34d29a5 100644
--- a/kernel_warning_collector.cc
+++ b/kernel_warning_collector.cc
@@ -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())),