-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Assertion failed 'node->DefinesLocalAddr(this, size, &lcl, nullptr) && lvaGetDesc(lcl)->lvHiddenBufferStructArg' #68669
Comments
Tagging subscribers to this area: @JulieLeeMSFT Issue Detailspipeline: runtime-coreclr libraries-jitstress
@dotnet/jit-contrib
|
One part of the problem is that we end up with a runtime/src/coreclr/jit/morph.cpp Lines 11190 to 11193 in 11bff1a
It means we end up evaluating the retbuf into a temp and stop being able to recognize it. This seems to end up happening because in this case we have an isTmp local for the retbuf we are optimizing, and this local is address exposed besides as the ret buf:
[000198] S-C-G------ ▌ CALL void System.Reflection.TypeLoading.Ecma.MetadataExtensions.GetMethodDefinition
[000203] ----------- retbuf ├──▌ ADDR byref
[000202] -------N--- │ └──▌ FIELD struct _neverAccessThisExceptThroughMethodDefinitionProperty
[000191] ----------- │ └──▌ ADDR byref
[000192] -------N--- │ └──▌ LCL_VAR struct<System.Reflection.TypeLoading.Ecma.EcmaMethodDecoder, 32>(AX)(RB) V16 tmp14
[000200] n---------- arg1 ├──▌ OBJ struct<System.Reflection.Metadata.MethodDefinitionHandle, 4>
[000199] ----------- │ └──▌ ADDR byref
[000193] -------N--- │ └──▌ LCL_VAR struct<System.Reflection.Metadata.MethodDefinitionHandle, 4> V18 tmp16
[000196] --C-G------ arg2 └──▌ CALL ref System.Reflection.TypeLoading.Ecma.EcmaMethodDecoder.get_Reader
[000194] ----------- this └──▌ LCL_VAR_ADDR byref V16 tmp14 @kunalspathak said he would take a closer look. |
GTF_GLOB_REF is necessary on a GT_ADDR node only if the child actually uses a tree with this flag as a value (and not as a location). This removes the flag in a few more places by using IsLocalAddrExpr. Fixes dotnet#68669
#68741 at least fixes introducing the unnecessary temp which resolves the assert. However, I think we should leave this open just to investigate whether it is in general safe to do the ret buf optimization here. I suppose yes, since the local does end up marked as address exposed and will not actually be tracked. I have attached a SPMI context for the compile where it happens which I collected on git hash 5c2a738 (with the fix from #68741 applied). The above tree comes from around line 4334 in the JIT dump. |
GTF_GLOB_REF is necessary on a GT_ADDR node only if the child actually uses a tree with this flag as a value (and not as a location). This removes the flag in a few more places by using IsLocalAddrExpr. Fixes #68669
pipeline: runtime-coreclr libraries-jitstress
Test: System.Reflection.MetadataLoadContext.Tests
JitStress=1
Failed for both win-x64 and linux-arm
https://dev.azure.com/dnceng/public/_build/results?buildId=1741924&view=ms.vss-test-web.build-test-results-tab&runId=47086172&resultId=193772&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab
@dotnet/jit-contrib
The text was updated successfully, but these errors were encountered: