Merge pull request #14010 from mshinwell/string-ops-machtypes#25
Open
dijkstracula wants to merge 1 commit into
Open
Merge pull request #14010 from mshinwell/string-ops-machtypes#25dijkstracula wants to merge 1 commit into
dijkstracula wants to merge 1 commit into
Conversation
Fix miscompilation / liveness errors for string operations
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport ocaml/ocaml#14010
to
5.4.0-semgrep.The fix preserves address-typed Cmm expressions when computing addresses for
string/bytes operations and unaligned loads and stores. Without this distinction,
Flambda may fail to preserve the liveness relationship between an interior
address and its underlying allocation, resulting in GC-related memory
corruption.
This was encountered as nondeterministic corruption in an allocation-heavy
property test.
Backport Notes
The compiler change applies cleanly to OCaml 5.4. No source adaptation was
required: the resulting
asmcomp/cmm_helpers.mlpatch matches upstream ocaml#14010exactly.
The conflicting upstream
Changesentry was omitted because it recordsinclusion in an upstream OCaml release, whereas this is a Semgrep-fork
backport.
No other fork code is changed.
Validation
./configure --enable-flambda && make -j8version: 5.4.0+semgrep-fork@23106c6472flambda: truecompiler at
-O3.each: 20,000,000 total cases passed.
The only changed source file is /Users/ntaylor/code/ocaml/asmcomp/cmm_helpers.ml:154.