Repository navigation
merge3 --resolve no longer crashes a -prod build - #26
Merged
Merged
Conversation
With `first` on the heap, V makes `if decisions.len == 0 { first } else
{ flatxml.merge3(...)! }` a pointer, and in the else branch that pointer
is to a value of the block, gone when it ends. An optimizing C compiler
reuses the place, so the edit read back is nil and writing the result
crashes on every --resolve, with the same source fine without -prod.
An assignment in an `if` statement copies the value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
merge3 --resolvecrashes on every run of a-prodbuild: exit 139 on Linux, 0xC0000005 from the Windows binary CI builds. The merge itself finishes; the crash is writing the result. Reports and merges without--resolveare fine, and so is any build without-prod.Cause.
firstescapes to the heap, because&first.oursis taken, so V typesif decisions.len == 0 { first } else { flatxml.merge3(...)! }as a pointer. The generated C for the else branch is__if_val_3 = &__or_val_5;, the address of a local of that block. Optimized, the slot is reused andres.m3.editis read back as nil. It is a V code generation fault, and this is the one place in arxmodel's generated C that has it.Fix. An
ifstatement assigning tom3, which copies the value.Checked, with the pinned V:
scripts/merge3_cli_test.shon a Linux-prodbuild: exit 139 atmain, passes here.v test arxmodel: 19 of 19.-prodbuild of this change: plain merges are byte-identical to the build before merge3 reports conflicts as JSON and takes decisions on them #25's follow-ups, and all ours, all theirs and half and half give the same results as that build.Not in this PR. CI did not see this because
merge3never runs on a-prodbinary: thetestjob's binary is a debug build, and thewindowsjob runs onlycheckandmerge. Addingscripts/merge3_cli_test.sh dist/arxmodel.exeto thewindowsjob would close that; a workflow edit is not something this token can push.v fmt -verifyreportsarxmodel/compare.vonmaintoo, at a line this does not touch; it is left alone.🤖 Generated with Claude Code