Skip to content

Fix static analysis findings in GC bridge and NativeAOT runtime#127893

Open
Copilot wants to merge 11 commits intomainfrom
copilot/fix-static-analysis-issues
Open

Fix static analysis findings in GC bridge and NativeAOT runtime#127893
Copilot wants to merge 11 commits intomainfrom
copilot/fix-static-analysis-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

Note

This PR description was generated with AI assistance.

Summary

  • Fixed allocator mismatch in src/coreclr/gc/gcbridge.cpp by replacing free with delete[] for memory allocated via new[].
  • Fixed potential null-dereference path in NativeAOT stress log by replacing heap-allocated CrstStatic with inline minipal_mutex, and asserting that minipal_mutex_init succeeds (bool success; success = minipal_mutex_init(&theLog.lock); _ASSERTE(success);).
  • Fixed invalid handle cleanup in src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp by guarding CloseHandle calls for hMap and hFile.

Validation

  • Baseline build before edits: ./build.sh clr+libs+host (pass)
  • Post-change build: ./build.sh clr+libs+host (pass)
  • Parallel validation:
    • Code Review: pass (no remaining comments)
    • CodeQL: no alerts (analysis skipped due to DB size limit)

Notes

  • Changes to src/coreclr/inc/stresslog.h and src/coreclr/utilcode/stresslog.cpp were reverted per reviewer feedback; those files remain unchanged from upstream.
  • No focused runtime test suite was run for these specific low-level internal changes in this environment; full component build succeeded before and after changes.

Copilot AI and others added 2 commits May 6, 2026 23:49
Comment thread src/coreclr/nativeaot/Runtime/stressLog.cpp Outdated
@jkotas jkotas marked this pull request as ready for review May 7, 2026 00:01
@jkotas jkotas requested a review from MichalStrehovsky as a code owner May 7, 2026 00:01
Copilot AI review requested due to automatic review settings May 7, 2026 00:01
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

@jkotas jkotas requested a review from BrzVlad May 7, 2026 00:03
@jkotas jkotas closed this May 7, 2026
@jkotas jkotas reopened this May 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI requested a review from jkotas May 7, 2026 00:23
Copilot finished work on behalf of jkotas May 7, 2026 00:23
Comment thread src/coreclr/nativeaot/Runtime/stressLog.cpp Outdated
Copilot AI review requested due to automatic review settings May 7, 2026 00:29
Comment thread src/coreclr/nativeaot/Runtime/inc/stressLog.h
Copilot finished work on behalf of jkotas May 7, 2026 00:55
Copilot AI requested a review from jkotas May 7, 2026 00:55
Comment thread src/coreclr/inc/stresslog.h Outdated
Copilot AI requested review from Copilot and removed request for Copilot May 7, 2026 01:33
Copilot AI requested review from Copilot and removed request for Copilot May 7, 2026 01:35
Copilot finished work on behalf of jkotas May 7, 2026 01:36
Copilot AI requested a review from jkotas May 7, 2026 01:36
@jkotas
Copy link
Copy Markdown
Member

jkotas commented May 7, 2026

@copilot Revert last two commits. They do not look like an improvement

Copilot AI requested review from Copilot and removed request for Copilot May 7, 2026 01:56
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 7, 2026

@copilot Revert last two commits. They do not look like an improvement

Done in commit cf6e7797. Both src/coreclr/inc/stresslog.h and src/coreclr/utilcode/stresslog.cpp have been reverted to their state before those two commits.

Copilot finished work on behalf of jkotas May 7, 2026 01:57
Comment thread src/coreclr/inc/stresslog.h
Copilot AI requested review from Copilot and removed request for Copilot May 7, 2026 02:03
Copilot finished work on behalf of jkotas May 7, 2026 02:04
Copilot AI requested a review from jkotas May 7, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants