Release of OCaml 5.2.1

We have the pleasure of announcing the release of OCaml 5.2.1, dedicated to the memory of Niels Bohr and Paul Éluard on the anniversary of their deaths.

OCaml 5.2.1 is a collection of safe but import runtime time bug fixes backported from the 5.3 branch of OCaml.

The full list of changes is available above for more details.


Installation Instructions

The base compiler can be installed as an opam switch with the following commands:

opam update
opam switch create 5.2.1

The source code for the release is also directly available on:

See full changelog

Changes Since OCaml 5.2.0

Runtime System:

  • #13207: Be sure to reload the register caching the exception handler in caml_c_call and caml_c_call_stack_args, as its value may have been changed if the OCaml stack is expanded during a callback. (Miod Vallat, report by Vesa Karvonen, review by Gabriel Scherer and Xavier Leroy)

  • #13252: Rework register assignment in the interpreter code on m68k on Linux, due to the %a5 register being used by GLIBC. (Miod Vallat, report by Stéphane Glondu, review by Gabriel Scherer and Xavier Leroy)

  • #13268: Fix a call to test in configure.ac that was causing errors when LDFLAGS contains several words. (Stéphane Glondu, review by Miod Vallat)

  • #13234, #13267: Open runtime events file in read-write mode on ARMel (ARMv5) systems due to atomic operations limitations on that platform. (Stéphane Glondu, review by Miod Vallat and Vincent Laviron)

  • #13188: fix races in the FFI code coming from the use of Int_val(...) on rooted values inside blocking questions / without the runtime lock. (Calling Int_val(...) on non-rooted immediates is fine, but any access to rooted values must be done outside blocking sections / with the runtime lock.) (Etienne Millon, review by Gabriel Scherer, Jan Midtgaard, Olivier Nicole)

  • #13318: Fix regression in GC alarms, and fix them for Flambda. (Guillaume Munch-Maccagnoni, report by Benjamin Monate, review by Vincent Laviron and Gabriel Scherer)

  • #13140: POWER back-end: fix issue with call to caml_call_realloc_stack from a DLL (Xavier Leroy, review by Miod Vallat)

  • #13370: Fix a low-probability crash when calling Gc.counters. (Demi Marie Obenour, review by Gabriel Scherer)

  • #13402, #13512, #13549, #13553: Revise bytecode implementation of callbacks so that it no longer produces dangling registered bytecode fragments. (Xavier Leroy, report by Jan Midtgaard, analysis by Stephen Dolan, review by Miod Vallat)

  • #13502: Fix misindexing related to Gc.finalise_last that could prevent finalisers from being run. (Nick Roberts, review by Mark Shinwell)

  • #13520: Fix compilation of native-code version of systhreads. Bytecode fields were being included in the thread descriptors. (David Allsopp, review by Sébastien Hinderer and Miod Vallat)