Repository navigation
Conversation
Inserting a ghost declaration, assignment, else-branch assignment or label rebuilt the CFG without Ast.mark_as_changed, so WP's per-function cache, which depends on Ast.self, kept proving the body as it was before the insertion. Every body edit now ends in commit_body_edit, which rebuilds and invalidates together. Ghost locals go into the blocals of the block holding them, with vdefined set, which Filecheck requires. Names in ghost expressions resolve through the enclosing blocks, then formals, then globals, instead of any local of the function. Mutating requests run Filecheck when AST_UTILS_CHECK_AST is set, and the regressions load the plug-in this tree built, with the check on. getRecursiveLogic lists recursive logic definitions with their components, because WP assumes each one without checking that it terminates. execSetWpConfig takes a step budget, and the ghost registries, written and never read, are gone.
A thread created by a helper called twice, or through a wrapper taking its start routine as a parameter, counted as running once, so a counter both instances increment raised no race candidate. Spawns now repeat whenever the creating function may run more than once. Atomic builtins and the C11 stdatomic types are atomic accesses, and a pair is dropped only when both sides are; compare-exchange writes its expected argument. Lock calls come from a table covering mutexes, spin locks, rwlocks, semaphores and condition waits. Lock order lists each pair once with capped sites, reports cycles between threads that may run together as deadlock candidates unless every acquisition is a read with no writer anywhere, and reports double locks and threads exiting with a lock held. Locks follow calls through per-function summaries and entry locksets, so a two-wrapper ABBA is a candidate. Measured at 0.68 s on a 39,005 line file.
Running EVA before WP removed runtime-error goals: Frama-C 33 defaults -rte-use-eva-results on, which emits no annotation on a function EVA analyzed, so an out-of-bounds write proved 5/5. Every Frama-C now runs with -rte-no-use-eva-results (5/6). A scoped EVA run starts under -lib-entry, run_wp resets -main and -lib-entry under main_eva_lock and withdraws eva_completed when that discards EVA, and an aborted EVA run is EVA_NOT_RUN. Fixing the first exposed a real overflow in test_abs.c. New gaps say what a proof rested on: an SV-COMP property the harness preconditions do not state, a threaded program, compile flags a database loses, pinned properties missing or unproved, and a contract a stub body also proves. check reports the recursive logic WP assumes and the verdict split by target. rte_pointer, builtin_models and a WP step budget are opt-in and enter the receipt only when set; sandboxes inherit the project's RTE switches. One-shot Frama-C runs get a null stdin, wait on the exit rather than the pipes, and kill their whole process group however they end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This applies what seven external Frama-C projects (acsl-skills, dawnr, Deadlock_and_Racer, FermatVerification-bench, fragma, seal, VerNFR) taught about ways check could report "proved" for something the run never established, and closes each one that reproduced here.
The two that changed real verdicts: Frama-C 33 defaults -rte-use-eva-results on, so running EVA before WP removed runtime-error goals from every function EVA analyzed (an out-of-bounds write proved 5/5; it is 5/6 now), and a scoped check started EVA from the globals' initializers instead of an unknown state. Fixing the first surfaced a real overflow in tests/fixtures/test_abs.c that EVA had been hiding, and its contract is corrected. The plug-in now invalidates WP's cache after inserting ghost code, which before let run_wp prove the body as it was before the insertion. New incomplete codes and two informational fields say what a proof rested on; docs/design/verdict-hardening/architecture.md has the design, including one rule a Codex review found unsound and that was replaced.
Verified with scripts/run-gates.sh: all 18 gates pass, unit 705/705 and the MCP stdio suite 175/175, against Frama-C 33.0 with Alt-Ergo 2.6.3. Each soundness fix has a test that was confirmed to fail without it. The two intermediate commits build and pass their own tests on their own.
Left out, with their reasons in the design docs: a verdict narrowed by target (established reports the split instead), cross-architecture machdep generation, and a prover memory cap, which needs measuring first.
Summary by cubic
Hardens
checkso a "proved" verdict can no longer claim more than the run established, and repairs the two adjacent holes that allowed it: the concurrency screen and ghost insertion.Verdict soundness
-rte-use-eva-resultson; every run now starts with-rte-no-use-eva-results, so EVA can no longer delete WP's runtime-error goals (an out-of-bounds write proved 5/5 before, 5/6 now).tests/fixtures/test_abs.c, whose contract is corrected.-lib-entryfrom an unknown global state instead of the globals' initializers, andrun_wpputs-mainand-lib-entryback, failing closed if the reset discards EVA's results.checkreports the recursive logic definitions WP assumes without a termination check and splits established verdicts by target.rte_pointerandbuiltin_models, and a WP step budget, enter the proof receipt only when set; sandboxes inherit the project's RTE switches.\oldonly where the printer adds it,pinnedadmits a stringified array, compile-database flags are split as a shell splits words, andanalyze_concurrencyis suggested only after both sequential analyses ran.Concurrency screening
__atomic_*,__sync_*and C11 atomic accesses no longer pair, SV-COMP atomic sections hold a pseudo-lock, onlystdatomic.htype names count as atomic, and a failed compare-exchange's expected argument is a write.continueinside a switch lands at the nearest loop instead of merging paths after the switch.Each soundness fix has a test confirmed to fail without it; all gates pass against Frama-C 33.0 with Alt-Ergo 2.6.3. Left out with reasons in the design docs: verdicts narrowed by target, cross-architecture machdep generation, and a prover memory cap.
Written for commit 0dc5973. Summary will update on new commits.