Fix checkStack() to perform the necessary checks.#194
Fix checkStack() to perform the necessary checks.#194sashanicolas wants to merge 1 commit intomasterfrom
Conversation
Fix test_stack_* expected stacks.
hainest
left a comment
There was a problem hiding this comment.
Overall, this is a substantial improvement on the old checks. My concern is that when we enable optimizations in the mutatee that inlining will destroy our assumed stack order. Will the subsequence approach still work for that in a meaningful way?
| logerror("**Failed** test %d (%s)\n", test_num, test_name); | ||
| logerror(" Possibly duplicate (case of wrong recursion) in collected stack. "); | ||
| failed = true; | ||
| } |
There was a problem hiding this comment.
Would it be good to also add a check that the PC and FP addresses in the computed stack are in strictly decreasing order? That could be done using std::is_sorted.
There was a problem hiding this comment.
The PC does not follow strictly decreasing order, as we don't know where the functions will be placed in memory, neither the base address of different libraries. So kill() could have a higher address compared to any test_stack_mutatee() or test_stack_func*(), while it is usually the last frame in these tests. But the FP for sure.
Fix test_stack_* expected stacks.