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

Test failure Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.sh #82127

Closed
BruceForstall opened this issue Feb 14, 2023 · 3 comments · Fixed by #82209
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs
Milestone

Comments

@BruceForstall
Copy link
Member

https://dev.azure.com/dnceng-public/public/_build/results?buildId=169012&view=ms.vss-test-web.build-test-results-tab&runId=3405426&paneView=debug

Looks like it fails in all jitobjectstackallocation scenarios.

coreclr linux arm64 Checked jitobjectstackallocation @ (Ubuntu.1804.Arm64.Open)[email protected]/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8

export DOTNET_TieredCompilation=0
export DOTNET_DbgEnableMiniDump=1
export DOTNET_EnableCrashReport=1
export DOTNET_DbgMiniDumpName=$HELIX_DUMP_FOLDER/coredump.%d.dmp
export DOTNET_JitObjectStackAllocation=1
    Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.sh [FAIL]
      
      Return code:      1
      Raw output file:      /root/helix/work/workitem/uploads/Reports/Loader.classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.output.txt
      Raw output:
      BEGIN EXECUTION
      /root/helix/work/correlation/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false reabstraction.dll ''
      Expected: 100
      Actual: 255
      END EXECUTION - FAILED
      Test failed. Trying to see if dump file was created in /home/helixbot/dotnetbuild/dumps since 2/13/2023 12:01:11 AM
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/root/helix/work/correlation
      > /root/helix/work/workitem/e/Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.sh
      Expected: True
      Actual:   False
      Stack Trace:
           at Loader_classloader._DefaultInterfaceMethods_reabstraction_reabstraction_reabstraction_._DefaultInterfaceMethods_reabstraction_reabstraction_reabstraction_sh()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
      Output:
        
        Return code:      1
        Raw output file:      /root/helix/work/workitem/uploads/Reports/Loader.classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.output.txt
        Raw output:
        BEGIN EXECUTION
        /root/helix/work/correlation/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false reabstraction.dll ''
        Expected: 100
        Actual: 255
        END EXECUTION - FAILED
        Test failed. Trying to see if dump file was created in /home/helixbot/dotnetbuild/dumps since 2/13/2023 12:01:11 AM
        Test Harness Exitcode is : 1
        To run the test:
        > set CORE_ROOT=/root/helix/work/correlation
        > /root/helix/work/workitem/e/Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.sh
  Finished:    Loader.classloader.XUnitWrapper

@AndyAyersMS

@BruceForstall BruceForstall added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs labels Feb 14, 2023
@BruceForstall BruceForstall added this to the 8.0.0 milestone Feb 14, 2023
@ghost
Copy link

ghost commented Feb 14, 2023

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

Issue Details

https://dev.azure.com/dnceng-public/public/_build/results?buildId=169012&view=ms.vss-test-web.build-test-results-tab&runId=3405426&paneView=debug

Looks like it fails in all jitobjectstackallocation scenarios.

coreclr linux arm64 Checked jitobjectstackallocation @ (Ubuntu.1804.Arm64.Open)[email protected]/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8

export DOTNET_TieredCompilation=0
export DOTNET_DbgEnableMiniDump=1
export DOTNET_EnableCrashReport=1
export DOTNET_DbgMiniDumpName=$HELIX_DUMP_FOLDER/coredump.%d.dmp
export DOTNET_JitObjectStackAllocation=1
    Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.sh [FAIL]
      
      Return code:      1
      Raw output file:      /root/helix/work/workitem/uploads/Reports/Loader.classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.output.txt
      Raw output:
      BEGIN EXECUTION
      /root/helix/work/correlation/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false reabstraction.dll ''
      Expected: 100
      Actual: 255
      END EXECUTION - FAILED
      Test failed. Trying to see if dump file was created in /home/helixbot/dotnetbuild/dumps since 2/13/2023 12:01:11 AM
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/root/helix/work/correlation
      > /root/helix/work/workitem/e/Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.sh
      Expected: True
      Actual:   False
      Stack Trace:
           at Loader_classloader._DefaultInterfaceMethods_reabstraction_reabstraction_reabstraction_._DefaultInterfaceMethods_reabstraction_reabstraction_reabstraction_sh()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
      Output:
        
        Return code:      1
        Raw output file:      /root/helix/work/workitem/uploads/Reports/Loader.classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.output.txt
        Raw output:
        BEGIN EXECUTION
        /root/helix/work/correlation/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false reabstraction.dll ''
        Expected: 100
        Actual: 255
        END EXECUTION - FAILED
        Test failed. Trying to see if dump file was created in /home/helixbot/dotnetbuild/dumps since 2/13/2023 12:01:11 AM
        Test Harness Exitcode is : 1
        To run the test:
        > set CORE_ROOT=/root/helix/work/correlation
        > /root/helix/work/workitem/e/Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction/reabstraction.sh
  Finished:    Loader.classloader.XUnitWrapper

@AndyAyersMS

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr, blocking-clean-ci-optional

Milestone: 8.0.0

@AndyAyersMS
Copy link
Member

I'll take this one.

@AndyAyersMS
Copy link
Member

CORINFO_HELP_VIRTUAL_FUNC_PTR can now throw exceptions other than null pointer deref, so this bit of morph is now wrong:

if ((call->gtCallMoreFlags & GTF_CALL_M_SPECIAL_INTRINSIC) == 0 &&
(call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_VIRTUAL_FUNC_PTR)
#ifdef FEATURE_READYTORUN
|| call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR)
#endif
) &&
(call == fgMorphStmt->GetRootNode()))
{
// This is call to CORINFO_HELP_VIRTUAL_FUNC_PTR with ignored result.
// Transform it into a null check.
assert(call->gtArgs.CountArgs() >= 1);
GenTree* objPtr = call->gtArgs.GetArgByIndex(0)->GetNode();
GenTree* nullCheck = gtNewNullCheck(objPtr, compCurBB);
return fgMorphTree(nullCheck);
}

Not sure when this behavior changed.

AndyAyersMS added a commit to AndyAyersMS/runtime that referenced this issue Feb 15, 2023
The jit currently replaces calls to `CORINFO_HELP_VIRTUAL_FUNC_PTR`
whose results are unused with null pointer checks.

But this helper can now throw a variety of exceptions, so this
optimization is incorrect.

Fixes dotnet#82127.
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 15, 2023
@ghost ghost added in-pr There is an active PR which will close this issue when it is merged and removed in-pr There is an active PR which will close this issue when it is merged labels Feb 23, 2023
AndyAyersMS added a commit that referenced this issue Feb 23, 2023
…ace class lookups (#82209)

The jit currently replaces calls to `CORINFO_HELP_VIRTUAL_FUNC_PTR`
whose results are unused with null pointer checks.

But for interface classes this helper can throw a variety of exceptions, so this
optimization is incorrect.

Fixes #82127.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Feb 23, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 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 blocking-clean-ci-optional Blocking optional rolling runs
Projects
None yet
2 participants