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

CctorForWrite failing with NativeAOT #84400

Closed
MichalStrehovsky opened this issue Apr 6, 2023 · 4 comments
Closed

CctorForWrite failing with NativeAOT #84400

MichalStrehovsky opened this issue Apr 6, 2023 · 4 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Comments

@MichalStrehovsky
Copy link
Member

This:

Gets generated as:

13:     public static int Main()
    14:     {
00007FF635E301F0 55                   push        rbp  
00007FF635E301F1 56                   push        rsi  
00007FF635E301F2 48 83 EC 28          sub         rsp,28h  
00007FF635E301F6 48 8D 6C 24 30       lea         rbp,[rsp+30h]  
    15:         try
    16:         {
    17:             ClassWithCctor.StaticField = Call();
00007FF635E301FB E8 3A 0E E4 FF       call        __GetNonGCStaticBase_repro_ClassWithCctor (07FF635C7103Ah)  
00007FF635E30200 48 8B F0             mov         rsi,rax  
00007FF635E30203 E8 B8 FF FF FF       call        repro_CCC__Call (07FF635E301C0h)  
00007FF635E30208 89 06                mov         dword ptr [rsi],eax  
    22:         }
    

Notice we grab the cctor base before the call, hitting exactly what the test is testing we shouldn't be doing.

Not sure what effect #83911 is going to have on this, but it's failing right now. I'm surprised we're not seeing it in ReadyToRun testing because this is a ReadyToRun pattern. (We're not seeing this in NativeAOT testing because we're still in the process of standing up these tests in regular testing.)

Cc @markples

@MichalStrehovsky MichalStrehovsky added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 6, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Apr 6, 2023
@ghost
Copy link

ghost commented Apr 6, 2023

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

Issue Details

This:

Gets generated as:

13:     public static int Main()
    14:     {
00007FF635E301F0 55                   push        rbp  
00007FF635E301F1 56                   push        rsi  
00007FF635E301F2 48 83 EC 28          sub         rsp,28h  
00007FF635E301F6 48 8D 6C 24 30       lea         rbp,[rsp+30h]  
    15:         try
    16:         {
    17:             ClassWithCctor.StaticField = Call();
00007FF635E301FB E8 3A 0E E4 FF       call        __GetNonGCStaticBase_repro_ClassWithCctor (07FF635C7103Ah)  
00007FF635E30200 48 8B F0             mov         rsi,rax  
00007FF635E30203 E8 B8 FF FF FF       call        repro_CCC__Call (07FF635E301C0h)  
00007FF635E30208 89 06                mov         dword ptr [rsi],eax  
    22:         }
    

Notice we grab the cctor base before the call, hitting exactly what the test is testing we shouldn't be doing.

Not sure what effect #83911 is going to have on this, but it's failing right now. I'm surprised we're not seeing it in ReadyToRun testing because this is a ReadyToRun pattern. (We're not seeing this in NativeAOT testing because we're still in the process of standing up these tests in regular testing.)

Cc @markples

Author: MichalStrehovsky
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@markples
Copy link
Member

markples commented Apr 6, 2023

R2R issue for this is #84007

@MichalStrehovsky
Copy link
Member Author

R2R issue for this is #84007

Oh, I did see the test was introduced in a PR from January but I thought we would have dealt with a possible R2R issue in the 3 months since then. I didn't realize the January PR only merged last week. It's probably a dupe of the R2R issue.

@kunalspathak
Copy link
Member

Closing it for the duplicate.

@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Apr 10, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

No branches or pull requests

3 participants