Subtleties of the ANSI / ISO C standard
@inproceedings{Krebbers2012SubtletiesOT, title={Subtleties of the ANSI / ISO C standard}, author={Robbert Krebbers and Freek Wiedijk}, year={2012} }
In our Formalin project to formalize C11 (the ANSI/ISO standard of the C programming language) we discovered many subtleties that make formalization of this standard difficult. We discuss some of these subtleties and indicate how they may be addressed in a formal C semantics. Furthermore, we argue that the C standard does not allow Turing complete implementations, and that its evaluation semantics does not preserve typing. Finally, we claim that no strictly conforming programs exist. That is…
7 Citations
Towards optimization-safe systems
- Computer Science
- 2013
A novel model is proposed, which views unstable code as optimizations that are valid only under the assumption that the program is well-defined, and introduces a new static checker called Stack that precisely identifies unstable code.
A differential approach to undefined behavior detection
- Computer ScienceCommun. ACM
- 2014
A new static checker called STACK is introduced that precisely identifies undefined behavior bugs in systems programming languages such as C/C++ by finding "unstable code" in terms of optimizations that leverage undefined behavior.
Hyperkernel: Push-Button Verification of an OS Kernel
- Computer ScienceSOSP
- 2017
Experience shows that Hyperkernel can avoid bugs similar to those found in xv6, and that the verification of Hyper kernel can be achieved with a low proof burden.
Towards optimization-safe systems: analyzing the impact of undefined behavior
- Computer ScienceSOSP
- 2013
A novel model is proposed, which views unstable code in terms of optimizations that leverage undefined behavior, and a new static checker called Stack is introduced that precisely identifies unstable code.
ISO / IEC JTC 1 / SC 22 / WG 14 N 2311 , 2018-1109 Exploring C Semantics and Pointer Provenance
- Computer Science
- 2018
This paper aims to reconcile the ISO C standard, mainstream compiler behaviour, and the semantics relied on by the corpus of existing C code, and presents two coherent proposals, tracking provenance via integers and not; both address many design questions.
Exploring C semantics and pointer provenance
- Computer ScienceProc. ACM Program. Lang.
- 2019
This paper aims to reconcile the ISO C standard, mainstream compiler behaviour, and the semantics relied on by the corpus of existing C code, and presents two coherent proposals, tracking provenance via integers and not; both address many design questions.
C provenance semantics: examples
- Computer Science
- 2019
The design of provenance semantics for C is discussed, looking at a series of examples of Exploring C Semantics and Pointer Provenance and also the provenance-via-integers (PVI) model.
References
SHOWING 1-10 OF 27 REFERENCES
A Formalization of the C99 Standard in HOL, Isabelle and Coq
- Computer ScienceCalculemus/MKM
- 2011
The Formalin project to create a formal version of the C99 standard for the C programming language, which means that the C preprocessor, the C standard library, floating point arithmetic, and 'dirty' C features like signal handling and volatile variables are treated.
Mechanized Semantics for the Clight Subset of the C Language
- Computer ScienceJournal of Automated Reasoning
- 2009
The formal semantics of a large subset of the C language called Clight is presented, which includes pointer arithmetic, struct and union types, C loops and structured switch statements, and is mechanized using the Coq proof assistant.
A Formal Semantics for the C Programming Language
- Computer Science
- 2000
A formal denotational semantics for the ANSI C programming language is proposed, with emphasis on its accuracy and completeness with respect to the standard, and is demonstrated that a programming language as useful in practice and as inherently complicated as C can nonetheless be defined formally.
An executable formal semantics of C with applications
- Computer SciencePOPL '12
- 2012
The semantics is shown capable of automatically finding program errors, both statically and at runtime, and it is also used to enumerate nondeterministic behavior.
seL4: formal verification of an OS kernel
- Computer ScienceSOSP '09
- 2009
To the knowledge, this is the first formal proof of functional correctness of a complete, general-purpose operating-system kernel.
Undefined behavior: what happened to my code?
- Computer ScienceAPSys
- 2012
It is argued that the research community should help address the problems that arise from undefined behavior, and not dismiss them as esoteric C implementation issues, because they do happen in real-world systems.
Formal Verification of a C-like Memory Model and Its Uses for Verifying Program Transformations
- Computer ScienceJournal of Automated Reasoning
- 2008
This article presents the formal verification, using the Coq proof assistant, of a memory model for low-level imperative languages such as C and compiler intermediate languages that supports reasoning over transformations of such programs.
VCC: A Practical System for Verifying Concurrent C
- Computer ScienceTPHOLs
- 2009
This paper motivates VCC, describes the verification methodology, the architecture of VCC is described, and the experience using VCC to verify the Microsoft Hyper-V hypervisor is reported on.
Compiler verification in the context of pervasive system verification
- Computer Science
- 2008
This thesis presents the formal verification of the compiling specification for a simple, non-optimizing compiler from the C-like programming language C0 to VAMP assembly code. The main result is a…
Finding and understanding bugs in C compilers
- Computer SciencePLDI '11
- 2011
Csmith, a randomized test-case generation tool, is created and spent three years using it to find compiler bugs, and a collection of qualitative and quantitative results about the bugs it found are presented.