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

Adds an over-approximation for syscall function #7937

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

feliperodri
Copy link
Collaborator

Resolves #7646.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@feliperodri feliperodri added the aws Bugs or features of importance to AWS CBMC users label Oct 4, 2023
@feliperodri feliperodri self-assigned this Oct 4, 2023
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (a531056) 78.75% compared to head (5b1db44) 78.62%.

❗ Current head 5b1db44 differs from pull request most recent head dc6b6a7. Consider uploading reports for the commit dc6b6a7 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7937      +/-   ##
===========================================
- Coverage    78.75%   78.62%   -0.14%     
===========================================
  Files         1701     1701              
  Lines       196224   195975     -249     
===========================================
- Hits        154540   154086     -454     
- Misses       41684    41889     +205     

see 75 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


int main()
{
long int rc;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this also use the APPLE env to change the type as in the definition ?

// https://man7.org/linux/man-pages/man2/syscall.2.html and
// https://www.gnu.org/software/libc/manual/html_node/System-Calls.html.
//
// sysno is the system call number. The remaining arguments are the arguments
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some system calls take pointer arguments and write data to the objects pointed to by these pointers.
To be overaproximating shouldn't this abstraction havoc all pointer arguments that were given to the syscall function ? This would maybe require handling this internally when typechecking calls to syscall.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@remi-delmas-3000
Copy link
Collaborator

remi-delmas-3000 commented Oct 13, 2023

Resolves #7646.

I wouldn't say it resolves the issue in that in does not model the side effects of the called function.

I think @tautschnig was suggesting to swtich on the syscall ID and call the function in question if we already have a model of it. Otherwise the syscall should havoc non-const pointer arguments to overapproximate effects of the call.

The CPROVER library has models for settime32/gettime32/semaphore, random, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a model of syscall to the C library
2 participants