-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potentially missing test cases generated from a simple loop #88
Comments
If you are running SymCC (or SymQEMU) with the QSYM backend, then QSYM may be pruning the iterations of the loop. This would also explain why the unrolled loop does not show this behaviour: since it will (presumably) generate multiple branches (instead of one in a loop), each branch will be considered new by QSYM. See here. |
Thanks @julihoh for your explanation. It makes sense to me now. It seems the QSYM backend applies some heuristics like the "loop bucketing" idea of AFL -- AFL only retains branches having specific "hit counts" like 1, 2, 3, 4, 8, 16, 32, .... |
Exactly. Always happy to help :) |
Just a quick update. I recently re-ran the same example using the simple backend instead of QSYM and it works as expected: the Z3-based backend generates exactly 5 test cases. |
Hello SymCC maintainers,
I have been trying to test how SymCC works on loops. To that end, I wrote a simple C program based on this example: https://github.com/AdaLogics/adacc/blob/master/examples/afl-sample.c. Following is my modified program (stored in example.c) and the function of interest is foo.
I compiled this program and ran SymCC using the following commands
I expected that SymCC would generate 5 test cases ("Axxx", "xBxx", "xxCx", "xxxD", and "BOOM"). However, somehow SymCC only generated 4 test cases, the string "xxxD" was missing.
It looked strange to me so I thought something had gone wrong. I modified the program and manually unrolled the loop 4 times; the modified foo function is listed below
Interestingly, when I ran SymCC with the new program, which was saved into example_loop_unrolled.c, SymCC generated 5 test cases as expected. The commands are similar to the above ones
So I suspect that there are some issues in the loop-handling code of SymCC. Could you please confirm?
Thanks,
Thuan
The text was updated successfully, but these errors were encountered: