Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AltJit hits "Assert failure: reserveUnwindInfo() can only be called before allocMem(), but allocMem() has already been called" #113840

Closed
jakobbotsch opened this issue Mar 24, 2025 · 1 comment · Fixed by #113842
Assignees
Labels
area-CodeGen-Interpreter-coreclr in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@jakobbotsch
Copy link
Member

Run any program with

DOTNET_AltJitName=clrjit_universal_arm64_x64.dll
DOTNET_AltJit=Main

Expected: clean result
Actual:

Assert failure(PID 42160 [0x0000a4b0], Thread: 22388 [0x5774]): reserveUnwindInfo() can only be called before allocMem(), but allocMem() has already been called. This may indicate the JIT has hit a NO_WAY assert after calling allocMem(), and is re-JITting. Set DOTNET_JitBreakOnBadCode=1 and rerun to get the real error.

CORECLR! CEEJitInfo::reserveUnwindInfo + 0x161 (0x00007ff9`96b3fbf1)
CLRJIT! Compiler::eeReserveUnwindInfo + 0x7D (0x00007ff9`8b359d9d)
CLRJIT! Compiler::unwindReserve + 0x107 (0x00007ff9`8b647c47)
CLRJIT! CodeGen::genEmitMachineCode + 0x7A (0x00007ff9`8b32e65a)
CLRJIT! CodeGenPhase::DoPhase + 0x12 (0x00007ff9`8b32b382)
CLRJIT! Phase::Run + 0x76 (0x00007ff9`8b53cfd6)
CLRJIT! CodeGen::genGenerateCode + 0xD9 (0x00007ff9`8b330c59)
CLRJIT! Compiler::compCompile + 0x221F (0x00007ff9`8b349fef)
CLRJIT! Compiler::compCompileHelper + 0x9FE (0x00007ff9`8b34c11e)
CLRJIT! Compiler::compCompile + 0x978 (0x00007ff9`8b34aef8)
    File: C:\dev\dotnet\runtime4\src\coreclr\vm\jitinterface.cpp:11396
    Image: C:\dev\dotnet\runtime4\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\corerun.exe

Introduced in commit range 13ec54f...b378823. Most likely culprit seems to be #112985, cc @janvorli

cc @dotnet/jit-contrib

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 24, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Mar 24, 2025
@jakobbotsch jakobbotsch added area-CodeGen-Interpreter-coreclr and removed area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels Mar 24, 2025
@jakobbotsch jakobbotsch added this to the 10.0.0 milestone Mar 24, 2025
@janvorli
Copy link
Member

It is very likely that my PR has introduced the problem. I am taking a look.

@janvorli janvorli self-assigned this Mar 24, 2025
janvorli added a commit to janvorli/runtime that referenced this issue Mar 24, 2025
I've made a mistake in my recent PR where the `ResetForJitRetry` method
on a new base class was not marked as virtual by accident. So the JIT
specific version was not executed and part of the state was not reset.

Close dotnet#113840
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-Interpreter-coreclr in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants