CBMC Viewer
CBMC is a Bounded Model Checker for C. It can prove that (for computations of bounded depth) a C program exhibits no memory safe errors (no buffer overflows, no invalid pointers, etc), no undefined behaviors, and no failures of assertions in the code. CBMC Viewer is a tool that scans the output of CBMC and produces a browsable summary of its findings.
Example
Here is a simple example of using cbmc-viewer.
Running this example requires installing CBMC.
Installation on MacOS is just brew install cbmc.
Installation on other operation systems is described on the CBMC
release page.
Create a source file main.c containing
#include <stdlib.h>
static int global;
int main() {
int *ptr = malloc(sizeof(int));
assert(global > 0);
assert(*ptr > 0);
return 0;
}
and run the commands
goto-cc -o main.goto main.c
cbmc main.goto --trace --xml-ui > result.xml
cbmc main.goto --cover location --xml-ui > coverage.xml
cbmc main.goto --show-properties --xml-ui > property.xml
cbmc-viewer --goto main.goto --result result.xml --coverage coverage.xml --property property.xml --srcdir .
and open the report created by cbmc-viewer in a web browser with
open report/html/index.html
What you will see is
-
A coverage report summarizing what lines of source code were exercised by cbmc. In this case, coverage is 100%. Clicking on
main, you can see the source code formainannotated with coverage data (all lines are green because all lines were hit). -
A bug report summarizing what issues cbmc found with the code. In this case, the bugs are violations of the assertions because, for example, it is possible that the uninitialized integer allocated on the heap contains a negative value. For each bug, there is a link to
-
The line of code where the bug occurred.
-
An error trace showing the steps of the program leading to the bug. For each step, there a link to the line of code that generated the step, making it easy to follow the error trace and root cause the bug.
-
Documentation
The cbmc-viewer documentation includes a reference manual and a user guide. These documents are currently works in progress and will improve over time.
Installation
Most people should just follow the instructions on the release page.
Developers can install the package in Python "development mode" as follows.
- Clone the repository and install dependencies with
Installing ctags is optional. See the ctags discussion at the end of the release page.git clone https://github.com/awslabs/aws-viewer-for-cbmc.git cbmc-viewer apt install python3-pip python3-venv python3-jinja2 python3-voluptuous universal-ctags - Install development mode with
cd cbmc-viewer make develop export PATH=/tmp/cbmc-viewer/bin:$PATH - Uninstall development mode with
cd cbmc-viewer make undevelop
Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 License.
Metadata
Release files for cbmc-viewer 3.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cbmc_viewer-3.12.tar.gz | 57.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cbmc_viewer-3.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 129.3 kB
Release files / cbmc_viewer-3.12.tar.gz
| Download URL | cbmc_viewer-3.12.tar.gz |
|---|---|
| Size | 57.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c12560e0fa9dd18af4f0225c1f7de6dd82d3b8ba3153f795dd63fcdfca225403
|
|
BLAKE2b-256 checksum How to use checksums |
3316019f043924f142fc7f160ad907c037bfcd14b782c2f5441f86deb68d9fcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 13, 2026.
Transparency logRelease files / cbmc_viewer-3.12-py3-none-any.whl
| Download URL | cbmc_viewer-3.12-py3-none-any.whl |
|---|---|
| Size | 71.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce599ef6e75e3b2c463c2e5837284fd5ed3fcd7ea4270c31def6707106c82d33
|
|
BLAKE2b-256 checksum How to use checksums |
46a9f1f9a00c6208bf5fb9ee7a25c3ac4aeec5690332894861d4c9a78f0fe8bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 13, 2026.
Transparency log