Skip to content

Reenable Gc.compact in Gc tests #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,14 @@ property can be done in two different ways:
Issues
======

Race condition in major heap pool orphaning during `Gc.compact` (new, fixed, runtime)
-------------------------------------------------------------------------------------

A `Gc` stress test including `Gc.compact` could trigger hangs and segfaults,
[due to a race condition on orphaned major heap pools, which could leave
dangling heap pointers](https://github.com/ocaml/ocaml/issues/13739).


Tearing in `Array.sub` and `Array.copy` (new, fixed, runtime)
-------------------------------------------------------------

Expand Down
7 changes: 5 additions & 2 deletions src/gc/stm_tests_spec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,11 @@ let alloc_cmds, gc_cmds =
1, return (Major_slice 0); (* cornercase: "If n = 0, the GC will try to do enough work to ensure that the next automatic slice has no work to do" *)
1, return Major;
1, return Full_major;
(* 1, return Compact; *) (* Temporarily omit Gc.compact to silence the remaining issues: #470 and #480 *)
]) @ alloc_cmds in
] @
(if Sys.(ocaml_release.major,ocaml_release.minor) < (5,4)
then [] (* known problem with Compact on <= 5.3: https://github.com/ocaml/ocaml/issues/13739 *)
else [1, return Compact])
@ alloc_cmds) in
if Sys.(ocaml_release.major,ocaml_release.minor) > (5,3)
then (1, Gen.return Counters)::gc_cmds (* known problem with Counters on <= 5.2: https://github.com/ocaml/ocaml/pull/13370 *)
else gc_cmds in
Expand Down
Loading