Skip to content

Fix macOS clang release segfault in QCO constant propagation CtrlOp handling - #1902

Closed
LiRem101 with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-failing-github-actions-job
Closed

LiRem101 with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-failing-github-actions-job

Conversation

Copilot AI commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

The macOS-26-intel clang release CI job failed with a SEGFAULT in QCOConstantPropagationTest.testUnsatisfiableHybridCombination.
The crash was caused by mutating the control vector while iterating it in handleCtrlOp, which is undefined behavior and surfaced on clang/macOS.

  • Root cause
    • inCtrlValues was modified (std::erase) during iteration over the same container.
  • Change
    • Iterate over a snapshot (ctrlCandidates) and keep mutating inCtrlValues safely.
    • Scope is limited to mlir/lib/Dialect/QCO/Transforms/Optimizations/ConstantPropagation.cpp.
  • Code example
    const auto ctrlCandidates = inCtrlValues;
    for (const auto qCtrl : ctrlCandidates) {
      // existing logic; may erase from inCtrlValues
    }

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • I have disclosed the use of AI tools in the PR description as per our AI Usage Guidelines.
  • AI-assisted commits include an Assisted-by: [Model Name] via [Tool Name] footer.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

Copilot AI changed the title [WIP] Fix failing GitHub Actions job for macos-26-intel clang release Fix macOS clang release segfault in QCO constant propagation CtrlOp handling Jul 14, 2026
Copilot AI requested a review from LiRem101 July 14, 2026 22:08
@LiRem101

Copy link
Copy Markdown
Collaborator

I thought the Copilot analysis was on my fork and not here. Sorry for the unecessary pR.

@LiRem101 LiRem101 closed this Jul 14, 2026
@burgholzer
burgholzer deleted the copilot/fix-failing-github-actions-job branch July 15, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants