crash-reporter: fix bug where we were sending "undefined" as all stack signatures
Also, move the logic for picking which extra parameters to send up above where mock sending ends so UserCrash detects this regression in the future. And merge unknown and undefined special strings into one to avoid confusion.
Change-Id: Ic55a0c5b473a0cef39eac2c1250d1607deffe050
BUG=8266
TEST=User/KernelCrash and CrashSender
Review URL: http://codereview.chromium.org/4139011
diff --git a/crash_reporter/crash_sender b/crash_reporter/crash_sender
index c01a52d..2e56dec 100644
--- a/crash_reporter/crash_sender
+++ b/crash_reporter/crash_sender
@@ -161,7 +161,7 @@
local payload="$(get_key_value "$1" "payload")"
if [ ! -r "${payload}" ]; then
lecho "Missing payload: ${payload}"
- echo "unknown"
+ echo "undefined"
return
fi
local kind="$(get_extension "${payload}")"
@@ -185,12 +185,12 @@
echo $(get_key_value "/etc/lsb-release" "CHROMEOS_RELEASE_BOARD")
}
-# Return the hardware class or "unknown".
+# Return the hardware class or "undefined".
get_hardware_class() {
if [ -r "${HWCLASS_PATH}" ]; then
cat "${HWCLASS_PATH}"
else
- echo "unknown"
+ echo "undefined"
fi
}
@@ -207,6 +207,18 @@
local write_payload_size="$(get_key_value "${meta_path}" "payload_size")"
local sig="$(get_key_value "${meta_path}" "sig")"
local send_payload_size="$(stat --printf=%s "${report_payload}" 2>/dev/null)"
+
+ local extra_key1="write_payload_size"
+ local extra_value1="${write_payload_size}"
+ local extra_key2="send_payload_size"
+ local extra_value2="${send_payload_size}"
+ if [ "${sig}" != "undefined" ]; then
+ extra_key1="sig"
+ extra_value1="${sig}"
+ extra_key2="sig2"
+ extra_value2="${sig}"
+ fi
+
lecho "Sending crash:"
lecho " Scheduled to send in ${sleep_time}s"
lecho " Metadata: ${meta_path} (${kind})"
@@ -217,7 +229,8 @@
lecho " URL: ${url}"
lecho " Board: ${board}"
lecho " HWClass: ${hwclass}"
- [ "${sig}" != "undefined" ] && lecho " Sig: ${sig}"
+ lecho " ${extra_key1}: ${extra_value1}"
+ lecho " ${extra_key2}: ${extra_value2}"
fi
lecho " Exec name: ${exec_name}"
if is_mock; then
@@ -239,17 +252,6 @@
local report_id="${TMP_DIR}/report_id"
local curl_stderr="${TMP_DIR}/curl_stderr"
- local extra_key1="write_payload_size"
- local extra_value1="${write_payload_size}"
- local extra_key2="send_payload_size"
- local extra_value2="${send_payload_size}"
- if [ "${sig}" != "unknown" ]; then
- extra_key1="sig"
- extra_value1="${sig}"
- extra_key2="sig2"
- extra_value2="${sig}"
- fi
-
set +e
curl "${url}" \
-F "prod=${CHROMEOS_PRODUCT}" \