Skip to content

Conversation

@tautschnig
Copy link
Collaborator

Add a library model for clock_gettime:

  • Model follows POSIX specification with proper error handling
  • Non-deterministic behavior covers both success and failure paths
  • Validates timespec structure with appropriate constraints
  • Sets errno correctly (EFAULT for null pointer, EINVAL on failure)

Fixes: #7639

  • 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.
  • n/a 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).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig force-pushed the clock_gettime branch 2 times, most recently from d40ffac to dc488bb Compare December 1, 2025 15:14
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.94%. Comparing base (8640fc9) to head (839387a).
⚠️ Report is 9 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8731      +/-   ##
===========================================
+ Coverage    79.93%   79.94%   +0.01%     
===========================================
  Files         1698     1699       +1     
  Lines       187698   187790      +92     
  Branches        73       73              
===========================================
+ Hits        150034   150132      +98     
+ Misses       37664    37658       -6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kroening
Copy link
Collaborator

kroening commented Dec 1, 2025

I'd rename clock_gettime-01/test.desc to something like clock_gettime/test1.desc -- we need to reduce the number of directories.

@tautschnig
Copy link
Collaborator Author

I'd rename clock_gettime-01/test.desc to something like clock_gettime/test1.desc -- we need to reduce the number of directories.

Ack, but I'd like to do this in a different PR - I'll have to check the maintenance scripts nicely cope with this. I'll create such a PR - if it goes in first I'll update this PR accordingly.

Add a library model for `clock_gettime`:
- Model follows POSIX specification with proper error handling
- Non-deterministic behavior covers both success and failure paths
- Validates timespec structure with appropriate constraints
- Sets errno correctly (EFAULT for null pointer, EINVAL on failure)

Fixes: diffblue#7639
@tautschnig tautschnig merged commit 1505c36 into diffblue:develop Dec 2, 2025
40 of 41 checks passed
@tautschnig tautschnig deleted the clock_gettime branch December 2, 2025 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CBMC doesn't have a model for clockid_t and clock_gettime

2 participants