Fix cmp_backtraces test 66/228966/2
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Thu, 26 Mar 2020 13:23:28 +0000 (14:23 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Thu, 2 Apr 2020 12:43:29 +0000 (14:43 +0200)
Change-Id: Ia628adfb80a4945d34e9847e864c903106dba3e6

tests/system/cmp_backtraces/cmp_backtraces.sh.template

index 417cadd..5795397 100755 (executable)
@@ -44,8 +44,14 @@ wait_for_app minicoredumper
 
 untar_file ${BASE_DIR} ${CORE_MINI}.tar
 
-gdb ${CRASH_WORKER_SYSTEM_TESTS}/utils/kenny ${BASE_DIR}/${CORE_ORIG}  -ex "thread apply all bt" -ex "q" 2> /dev/null | grep -e '^#' > ${BASE_DIR}/${THREADS_ORIG}
-gdb ${CRASH_WORKER_SYSTEM_TESTS}/utils/kenny ${BASE_DIR}/${CORE_MINI}  -ex "thread apply all bt" -ex "q" 2> /dev/null | grep -e '^#' > ${BASE_DIR}/${THREADS_MINI}
+# We want to compare if the call stack from the original dump is the same as
+# the one from the minidump. GDB can also sometimes display the type of
+# argument based on the data stored in the heap. Unfortunately, the minidump does
+# not contain heap, and this causes differences in result. Therefore, the GDB
+# result is filtered so that we can compare the two call stacks.
+
+gdb ${CRASH_WORKER_SYSTEM_TESTS}/utils/kenny ${BASE_DIR}/${CORE_ORIG}  -ex "thread apply all bt" -ex "q" 2> /dev/null | grep -e '^#' | sed 's/: [0-9]\+\(x[0-9]\+\( <[^>]\+>\)\?\)\?/: 0/g' > ${BASE_DIR}/${THREADS_ORIG}
+gdb ${CRASH_WORKER_SYSTEM_TESTS}/utils/kenny ${BASE_DIR}/${CORE_MINI}  -ex "thread apply all bt" -ex "q" 2> /dev/null | grep -e '^#' | sed 's/: [0-9]\+\(x[0-9]\+\( <[^>]\+>\)\?\)\?/: 0/g' > ${BASE_DIR}/${THREADS_MINI}
 
 if ! diff ${BASE_DIR}/${THREADS_ORIG} ${BASE_DIR}/${THREADS_MINI} > /dev/null; then
     fail "backtraces are different"