Skip to content
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

Low-Hanging Fruits in SV-COMP No-Overflow: CWE190-*-square*.i #1244

Closed
michael-schwarz opened this issue Nov 9, 2023 · 0 comments · Fixed by #1253
Closed

Low-Hanging Fruits in SV-COMP No-Overflow: CWE190-*-square*.i #1244

michael-schwarz opened this issue Nov 9, 2023 · 0 comments · Fixed by #1253
Assignees
Labels
feature precision sv-comp SV-COMP (analyses, results), witnesses
Milestone

Comments

@michael-schwarz
Copy link
Member

I compared our results with Mopsa and noticed that there is >100 simple CWE tasks where we fail to show that no overflow can occur, even though the code looks simple enough:
https://sv-comp.sosy-lab.org/2023/results/results-verified/META_NoOverflows.table.html#/table?filter=9(0*status*(category(in(unknown,error)))),13(0*status*(category(in(correct))))

The core boils down to the following check, which is a bit nasty as it requires relationality through a call of a library function abs (similar to what was done in #1041), and us implementing some sort of constant folding for functions like sqrt. However, this should definitely be within reach.

int data;
if (data > (-0x7fffffff - 1) && abs(data) < (long)sqrt((double)0x7fffffff))
{
    int result = data * data;
    printIntLine(result);
}

Maybe @stilscher this is something for you? It would be a good way to get comfortable with implementing analyses and should be doable in an afternoon or a rainy weekend.

@michael-schwarz michael-schwarz added this to the SV-COMP 2024 milestone Nov 9, 2023
@michael-schwarz michael-schwarz changed the title Low-Hanging Fruits in SV-COMP No-Overflow: CWE190-*-square.i Low-Hanging Fruits in SV-COMP No-Overflow: CWE190-*-square.i Nov 9, 2023
@michael-schwarz michael-schwarz changed the title Low-Hanging Fruits in SV-COMP No-Overflow: CWE190-*-square.i Low-Hanging Fruits in SV-COMP No-Overflow: CWE190-*-square*.i Nov 9, 2023
@sim642 sim642 added the sv-comp SV-COMP (analyses, results), witnesses label Nov 9, 2023
@stilscher stilscher self-assigned this Nov 9, 2023
sim642 added a commit to sim642/opam-repository that referenced this issue Nov 24, 2023
nberth pushed a commit to nberth/opam-repository that referenced this issue Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature precision sv-comp SV-COMP (analyses, results), witnesses
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants