Skip to main content

OCaml 5.5.2

Release Date: October 23, 2026

OCaml 5.5.2, released on October 23, 2026, is a patch release that repairs a miscompilation, fixes dead-code elimination of unused atomic loads, and closes six security advisories in the standard library and runtime. It is a drop-in replacement for 5.5.1 with no language or API changes.

Security Fixes

  • Unix.map_file overflow — integer overflow when computing the data size is now rejected (OSEC-2026-22).
  • Str.string_partial_match — captured groups are validated before being returned (OSEC-2026-21).
  • Marshal demarshaling — multiple issues in Marshal.from_channel, Marshal.from_string and Marshal.from_bytes were fixed (OSEC-2026-23).
  • Windows command quoting — several quoting issues were corrected (OSEC-2026-24).
  • Runtime events decoding — decoding of event messages read from ring buffers is now hardened (OSEC-2026-25).
  • Custom events cache integrity — the cache can no longer be corrupted by concurrent event activity (OSEC-2026-26).

Correctness Fixes

  • Pattern-matching miscompilation — certain combinations of immediate ranges and redundant patterns produced wrong code; the fix is credited to a report by Alperer Keleş and review by Vincent Laviron and Florian Angeletti (#15185, #15187).
  • Atomic load elimination — dead-code elimination no longer removes atomic loads whose results are unused, which had left lock-free code vulnerable to reordering (#15045).
  • macOS availability detection — functions available in the future are detected correctly, which matters for binaries built against older SDKs (#15067, #15071).
  • Runtime events ring buffer — the library no longer loops forever when a user event is larger than half the ring buffer (#15043, #15076).

Why It Matters

Six advisories in a single patch is the headline. Four of them touch input paths that untrusted data reaches directly: Marshal payloads, Unix.map_file offsets, Str match groups and Windows command strings. The miscompilation fix is equally pressing for anyone matching on integer ranges, because the bug produced incorrect code silently rather than failing at compile time.

Update a 5.5 switch with opam update && opam upgrade ocaml-base-compiler, or install ocaml-base-compiler.5.5.2 directly, then rebuild native artifacts instead of reusing a cached switch.

Other Versions

We use cookies for ads and analytics.