Skip to content

JIT: Change to a compile-time diagnostic for avoiding heap allocations - #137624

Merged
jakobbotsch merged 2 commits into
dotnet:mainfrom
jakobbotsch:fix-137487
Nov 18, 2026
Merged

jakobbotsch merged 2 commits into
dotnet:mainfrom
jakobbotsch:fix-137487

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

The LLM found a way to turn the assert in the heap allocators into a compile-time diagnostic, by redeclaring them with a deprecated attribute. This avoids potential dynamic linking issues on Linux.

Fix #137487

The LLM found a way to turn the assert in the heap allocators into a
compile-time diagnostic, by redeclaring them with a `deprecated`
attribute. This avoids potential dynamic linking issues on Linux.

Fix dotnet#137487
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 16, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 6 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch

Copy link
Copy Markdown
Member Author

PTAL @dotnet/jit-contrib

@jakobbotsch
jakobbotsch requested a review from a team November 17, 2026 07:23
@jakobbotsch

Copy link
Copy Markdown
Member Author

/ba-g Test failure is the one fixed by #137730

@jakobbotsch
jakobbotsch merged commit ef02271 into dotnet:main Nov 18, 2026
125 of 129 checks passed
@jakobbotsch
jakobbotsch deleted the fix-137487 branch November 18, 2026 10:28
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 19, 2026
jakobbotsch added a commit to jakobbotsch/runtime that referenced this pull request Nov 19, 2026
dotnet#137624 stopped `utilcode.h` from including `corhlprpriv.h` in the JIT.
As a result, `corhlpr.h` (and with it the UCRT `<assert.h>`) was first
included after `host.h`, replacing the JIT's `assert` with the CRT one.

Include `corhlpr.h` before `host.h` in `jit.h`, and mark `_wassert` as
deprecated in DEBUG MSVC builds so a later CRT `<assert.h>` that
replaces the JIT's `assert` fails the build.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: c6ad27fe-95af-450c-8689-8aba56c073cf
jakobbotsch added a commit that referenced this pull request Nov 19, 2026
#137624 stopped `utilcode.h` from including `corhlprpriv.h` in the JIT.
As a result, `corhlpr.h` (and with it the UCRT `<assert.h>`) was first
included after `host.h`, replacing the JIT's `assert` with the CRT one.

Remove the include eexcp.h from gcinfoencoder.h which is what ends up
defining C assert. It does not seem to be necessary anymore.

Deprecate the `_wassert` symbol to detect this happening in the future.

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libclrjit crashes on thread exit in hosts that replace global operator new (.NET 11 regression)

2 participants