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

JIT test GenericCatchInterfaceProgram fails in Checked NativeAOT #90848

Closed
agocke opened this issue Aug 19, 2023 · 13 comments · Fixed by #90867
Closed

JIT test GenericCatchInterfaceProgram fails in Checked NativeAOT #90848

agocke opened this issue Aug 19, 2023 · 13 comments · Fixed by #90867
Assignees
Labels
area-NativeAOT-coreclr disabled-test The test is disabled in source code against the issue
Milestone

Comments

@agocke
Copy link
Member

agocke commented Aug 19, 2023

Stack trace:

00:15:44.971 Running test: JIT/Generics/Exceptions/GenericCatchInterfaceProgram/GenericCatchInterfaceProgram.dll
Unhandled Exception: System.Diagnostics.DebugProvider+DebugAssertException: IsInstanceOfClass called with interface MethodTable
   at System.Diagnostics.DebugProvider.Fail(String, String) + 0x35
   at System.Diagnostics.Debug.Fail(String, String) + 0x30
   at System.Runtime.TypeCast.IsInstanceOfClass(MethodTable*, Object) + 0x75
   at System.Runtime.EH.FindFirstPassHandler(Object, UInt32, StackFrameIterator&, UInt32&, Byte*&) + 0x108
   at System.Runtime.EH.DispatchEx(StackFrameIterator&, EH.ExInfo&) + 0x13f
   at System.Runtime.EH.RhThrowEx(Object, EH.ExInfo&) + 0x4e
   at GenericCatchInterfaceProgram.Main() + 0x27
   at Program.<<Main>$>g__TestExecutor23|0_24(StreamWriter tempLogSw, StreamWriter statsCsvSw, Program.<>c__DisplayClass0_0&) + 0xa5
   at Program.<Main>$(String[] args) + 0x338
   at JIT!<BaseAddress>+0x477a6c
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 19, 2023
@ghost
Copy link

ghost commented Aug 19, 2023

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

Issue Details

Stack trace:

00:15:44.971 Running test: JIT/Generics/Exceptions/GenericCatchInterfaceProgram/GenericCatchInterfaceProgram.dll
Unhandled Exception: System.Diagnostics.DebugProvider+DebugAssertException: IsInstanceOfClass called with interface MethodTable
   at System.Diagnostics.DebugProvider.Fail(String, String) + 0x35
   at System.Diagnostics.Debug.Fail(String, String) + 0x30
   at System.Runtime.TypeCast.IsInstanceOfClass(MethodTable*, Object) + 0x75
   at System.Runtime.EH.FindFirstPassHandler(Object, UInt32, StackFrameIterator&, UInt32&, Byte*&) + 0x108
   at System.Runtime.EH.DispatchEx(StackFrameIterator&, EH.ExInfo&) + 0x13f
   at System.Runtime.EH.RhThrowEx(Object, EH.ExInfo&) + 0x4e
   at GenericCatchInterfaceProgram.Main() + 0x27
   at Program.<<Main>$>g__TestExecutor23|0_24(StreamWriter tempLogSw, StreamWriter statsCsvSw, Program.<>c__DisplayClass0_0&) + 0xa5
   at Program.<Main>$(String[] args) + 0x338
   at JIT!<BaseAddress>+0x477a6c
Author: agocke
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@jkotas
Copy link
Member

jkotas commented Aug 19, 2023

Regression introduced by #90234

@agocke agocke added this to the 9.0.0 milestone Aug 19, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Aug 19, 2023
@agocke agocke added this to AppModel Aug 19, 2023
@VSadov
Copy link
Member

VSadov commented Aug 21, 2023

Interesting. I did not realize it is possible to use non-class types in the catch (arrays, interfaces).

@VSadov
Copy link
Member

VSadov commented Aug 21, 2023

What is the easiest/right way to run this test? It looks like it does not run as a part of regular src\tests\run.cmd

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 21, 2023
@jkotas jkotas added the disabled-test The test is disabled in source code against the issue label Aug 21, 2023
@jkotas
Copy link
Member

jkotas commented Aug 21, 2023

The test was disabled in https://github.com/dotnet/runtime/pull/89421/files#diff-72d87bb5dc27f15b0bfbc2423cff89c3085f4109dc8cd5d83e1724d828ebbde0R703-R705 . It will run once you revert these lines - make sure to include the revert in your PR.

@VSadov
Copy link
Member

VSadov commented Aug 21, 2023

If I remove the suppression lines in src/tests/issues.targets I do not see the test failure (with or without my fix).

The way I run tests is:

taskkill /f /im dotnet.exe
git clean -xdf
build clr+libs -rc Checked -lc Release & src\tests\build.cmd nativeaot Checked tree nativeaot &  src\tests\run.cmd runnativeaottests Checked

I assume it is some kind of recently enabled test (since it did not catch the regression).
Is there some other switch that is needed to enable it?

@jkotas
Copy link
Member

jkotas commented Aug 21, 2023

tree nativeaot is only going to run the tests in nativeaot subdirectory. You need to remove that argument to run all tests.

@VSadov
Copy link
Member

VSadov commented Aug 21, 2023

Right, that makes sense. Will try running without tree nativeaot.
The switch used to be necessary some time ago, so I added it to the list of commands that I use.

@VSadov
Copy link
Member

VSadov commented Aug 21, 2023

Hmm. It takes a lot longer, but there are still no failures, other than SmokeTests\HardwareIntrinsics\X64Avx512, which always fails.

The command I used:

build clr+libs -rc Checked -lc Release & src\tests\build.cmd nativeaot Checked &  src\tests\run.cmd runnativeaottests Checked

@jkotas
Copy link
Member

jkotas commented Aug 21, 2023

Hmm, you are right - the failure shows up in the console output:

 C:\runtime\artifacts\tests\coreclr\windows.x64.Checked\JIT\Methodical\Methodical_ro\Methodical_ro.cmd >C:\runtime\art
  ifacts\tests\coreclr\windows.x64.Checked\JIT\Methodical\Methodical_ro\Methodical_ro.log
  Unhandled Exception: System.Diagnostics.DebugProvider+DebugAssertException: IsInstanceOfClass called with interface M
  ethodTable
     at System.Diagnostics.DebugProvider.Fail(String, String) + 0x36
     at System.Diagnostics.Debug.Fail(String, String) + 0x32
     at System.Runtime.TypeCast.IsInstanceOfClass(MethodTable*, Object) + 0x72
     at System.Runtime.EH.FindFirstPassHandler(Object, UInt32, StackFrameIterator&, UInt32&, Byte*&) + 0xfb
     at System.Runtime.EH.DispatchEx(StackFrameIterator&, EH.ExInfo&) + 0x131
     at System.Runtime.EH.RhThrowEx(Object, EH.ExInfo&) + 0x4b
     at GenericCatchInterfaceProgram.Main() + 0x2a
     at Program.<<Main>$>g__TestExecutor23|0_24(StreamWriter tempLogSw, StreamWriter statsCsvSw, Program.<>c__DisplayCl
  ass0_0&) + 0xa7
     at Program.<Main>$(String[] args) + 0x337
     at JIT.Generics!<BaseAddress>+0x26a500
  C:\runtime\artifacts\tests\coreclr\windows.x64.Checked\JIT\opt\JIT.opt\JIT.opt.cmd >C:\runtime\artifacts\tests\corecl
  r\windows.x64.Checked\JIT\opt\JIT.opt\JIT.opt.log

But the test is not marked as failed in the summary at the end. Looks like a bug in the test infrastructure.

@VSadov
Copy link
Member

VSadov commented Aug 21, 2023

I am also able to repro this by running directly
artifacts\tests\coreclr\windows.x64.Checked\JIT\Generics\JIT.Generics\native\JIT.Generics.exe

That is enough for me to verify the fix and the sensitivity of the test to the fix.

But the test is not marked as failed in the summary at the end. Looks like a bug in the test infrastructure.

Looks like it.
Also it is possible that it is a results reporting issue specific to local runs only, since somehow the bug was found in the CI.

@jkotas
Copy link
Member

jkotas commented Aug 21, 2023

Could you please open a new issue on the test failure reporting problem?

@VSadov
Copy link
Member

VSadov commented Aug 21, 2023

Yes, will open an issue on that.

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 21, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-NativeAOT-coreclr disabled-test The test is disabled in source code against the issue
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants