summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Swiecki <robert@swiecki.net>2019-12-05 16:19:19 +0100
committerRobert Swiecki <robert@swiecki.net>2019-12-05 16:19:19 +0100
commit7bea63e9e04fb0d00ad06b287fd366d5385e832f (patch)
treea74cc98aed6a293500313c0d3e25aa41327d99a8
parent59c20cc8d96b042e2e3241aee460c7e822246d96 (diff)
downloadhonggfuzz-7bea63e9e04fb0d00ad06b287fd366d5385e832f.tar.gz
*/trace: don't fake frames if asan log parsing fails
-rw-r--r--linux/trace.c23
-rw-r--r--posix/arch.c11
2 files changed, 2 insertions, 32 deletions
diff --git a/linux/trace.c b/linux/trace.c
index e1e5fb0d..746be4f1 100644
--- a/linux/trace.c
+++ b/linux/trace.c
@@ -514,16 +514,6 @@ static void arch_traceAnalyzeData(run_t* run, pid_t pid) {
}
/*
- * If unwinder failed (zero frames), use PC from ptrace GETREGS if not zero.
- * If PC reg zero return and callers should handle zero hash case.
- */
- if (funcCnt <= 0) {
- /* Manually update major frame PC & frames counter */
- funcs[0].pc = (void*)(uintptr_t)pc;
- funcCnt = 1;
- }
-
- /*
* Calculate backtrace callstack hash signature
*/
run->backtrace = sanitizers_hashCallstack(run, funcs, funcCnt, false);
@@ -579,17 +569,6 @@ static void arch_traceSaveData(run_t* run, pid_t pid) {
}
/*
- * If unwinder failed (zero frames), use PC from ptrace GETREGS if not zero.
- * If PC reg zero, temporarily disable uniqueness flag since callstack
- * hash will be also zero, thus not safe for unique decisions.
- */
- if (funcCnt <= 0) {
- /* Manually update major frame PC & frames counter */
- funcs[0].pc = (void*)(uintptr_t)pc;
- funcCnt = 1;
- }
-
- /*
* Temp local copy of previous backtrace value in case worker hit crashes into multiple
* tids for same target master thread. Will be 0 for first crash against target.
*/
@@ -604,7 +583,7 @@ static void arch_traceSaveData(run_t* run, pid_t pid) {
* If unique flag is set and single frame crash, disable uniqueness for this crash
* to always save (timestamp will be added to the filename)
*/
- if (saveUnique && (funcCnt == 1)) {
+ if (saveUnique && (funcCnt == 0)) {
saveUnique = false;
}
diff --git a/posix/arch.c b/posix/arch.c
index 2373ce0f..930af3b2 100644
--- a/posix/arch.c
+++ b/posix/arch.c
@@ -120,15 +120,6 @@ static void arch_analyzeSignal(run_t* run, pid_t pid, int status) {
uint64_t crashAddr = 0;
char description[HF_STR_LEN] = {};
size_t funcCnt = sanitizers_parseReport(run, pid, funcs, &pc, &crashAddr, description);
- /*
- * If unwinder failed (zero frames), use PC from ptrace GETREGS if not zero.
- * If PC reg zero return and callers should handle zero hash case.
- */
- if (funcCnt <= 0) {
- /* Manually update major frame PC & frames counter */
- funcs[0].pc = (void*)(uintptr_t)pc;
- funcCnt = 1;
- }
/*
* Calculate backtrace callstack hash signature
@@ -140,7 +131,7 @@ static void arch_analyzeSignal(run_t* run, pid_t pid, int status) {
* to always save (timestamp will be added to the filename)
*/
bool saveUnique = run->global->io.saveUnique;
- if (saveUnique && (funcCnt == 1)) {
+ if (saveUnique && (funcCnt == 0)) {
saveUnique = false;
}