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

[RISC-V] Add missing jumpTable increment #98992

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

yurai007
Copy link
Contributor

@yurai007 yurai007 commented Feb 27, 2024

After #98671 we noticed that some of coreclr tests started crashing because of infinite recursion seen like:

root@3b821d4a686a:/runtime/artifacts/tests/coreclr/linux.riscv64.Checked/CoreMangLib/system/buffer/ASURT_99893# $CORE_ROOT/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true ASURT_99893.dll '' Process terminated. Encountered infinite recursion while looking up resource 'Arg_ResourceFileUnsupportedVersion' in System.Private.CoreLib. Verify the installation of .NET is complete and does not need repairing, and that the state of the process has not become corrupted.
   at System.Environment.FailFast(System.String)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_ResourceFileUnsupportedVersion()
   at System.Resources.ResourceReader._ReadResources()
   at System.Resources.ResourceReader.ReadResources()
   at System.Resources.ResourceReader..ctor(System.IO.Stream, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>, Boolean)
   at System.Resources.RuntimeResourceSet..ctor(System.IO.Stream, Boolean)
   at System.Resources.ManifestBasedResourceGroveler.CreateResourceSet(System.IO.Stream, System.Reflection.Assembly)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)
   at System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean)
   at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_ResourceFileUnsupportedVersion()
   at System.Resources.ResourceReader._ReadResources()
   at System.Resources.ResourceReader.ReadResources()
   at System.Resources.ResourceReader..ctor(System.IO.Stream, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>, Boolean)
   at System.Resources.RuntimeResourceSet..ctor(System.IO.Stream, Boolean)
   at System.Resources.ManifestBasedResourceGroveler.CreateResourceSet(System.IO.Stream, System.Reflection.Assembly)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)

This change fixes issue by adding missing jumpTable increment.

Part of #84834
cc @wscho77 @HJLeee @clamp03 @JongHeonChoi @t-mustafin @gbalykov @viewizard @ashaurtaev @brucehoult @sirntar @yurai007 @Bajtazar @bartlomiejko @rzsc @tomeksowi @amanasifkhalid

After dotnet#98671 we noticed that some of coreclr
tests started crashing because of infinite recursion seen like:

root@3b821d4a686a:/runtime/artifacts/tests/coreclr/linux.riscv64.Checked/CoreMangLib/system/buffer/ASURT_99893# $CORE_ROOT/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true ASURT_99893.dll ''
Process terminated. Encountered infinite recursion while looking up resource 'Arg_ResourceFileUnsupportedVersion' in System.Private.CoreLib. Verify the installation of .NET is complete and does not need repairing, and that the state of the process has not become corrupted.
   at System.Environment.FailFast(System.String)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_ResourceFileUnsupportedVersion()
   at System.Resources.ResourceReader._ReadResources()
   at System.Resources.ResourceReader.ReadResources()
   at System.Resources.ResourceReader..ctor(System.IO.Stream, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>, Boolean)
   at System.Resources.RuntimeResourceSet..ctor(System.IO.Stream, Boolean)
   at System.Resources.ManifestBasedResourceGroveler.CreateResourceSet(System.IO.Stream, System.Reflection.Assembly)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)
   at System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean)
   at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_ResourceFileUnsupportedVersion()
   at System.Resources.ResourceReader._ReadResources()
   at System.Resources.ResourceReader.ReadResources()
   at System.Resources.ResourceReader..ctor(System.IO.Stream, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>, Boolean)
   at System.Resources.RuntimeResourceSet..ctor(System.IO.Stream, Boolean)
   at System.Resources.ManifestBasedResourceGroveler.CreateResourceSet(System.IO.Stream, System.Reflection.Assembly)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)

This change fixes issue by adding missing jumpTable increment.
@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 Feb 27, 2024
@ghost
Copy link

ghost commented Feb 27, 2024

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

Issue Details

After #98671 we noticed that some of coreclr tests started crashing because of infinite recursion seen like:

root@3b821d4a686a:/runtime/artifacts/tests/coreclr/linux.riscv64.Checked/CoreMangLib/system/buffer/ASURT_99893# $CORE_ROOT/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true ASURT_99893.dll '' Process terminated. Encountered infinite recursion while looking up resource 'Arg_ResourceFileUnsupportedVersion' in System.Private.CoreLib. Verify the installation of .NET is complete and does not need repairing, and that the state of the process has not become corrupted.
   at System.Environment.FailFast(System.String)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_ResourceFileUnsupportedVersion()
   at System.Resources.ResourceReader._ReadResources()
   at System.Resources.ResourceReader.ReadResources()
   at System.Resources.ResourceReader..ctor(System.IO.Stream, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>, Boolean)
   at System.Resources.RuntimeResourceSet..ctor(System.IO.Stream, Boolean)
   at System.Resources.ManifestBasedResourceGroveler.CreateResourceSet(System.IO.Stream, System.Reflection.Assembly)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)
   at System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean)
   at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_ResourceFileUnsupportedVersion()
   at System.Resources.ResourceReader._ReadResources()
   at System.Resources.ResourceReader.ReadResources()
   at System.Resources.ResourceReader..ctor(System.IO.Stream, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceLocator>, Boolean)
   at System.Resources.RuntimeResourceSet..ctor(System.IO.Stream, Boolean)
   at System.Resources.ManifestBasedResourceGroveler.CreateResourceSet(System.IO.Stream, System.Reflection.Assembly)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)

This change fixes issue by adding missing jumpTable increment.

Part of #84834
cc @wscho77 @HJLeee @clamp03 @JongHeonChoi @t-mustafin @gbalykov @viewizard @ashaurtaev @brucehoult @sirntar @yurai007 @Bajtazar @bartlomiejko @rzsc @tomeksowi

Author: yurai007
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

Copy link
Member

@amanasifkhalid amanasifkhalid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, and thanks for the fix!

Copy link

@bartlomiejko bartlomiejko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@clamp03 clamp03 added the arch-riscv Related to the RISC-V architecture label Feb 27, 2024
@jakobbotsch jakobbotsch merged commit 235b562 into dotnet:main Feb 28, 2024
119 of 128 checks passed
@yurai007
Copy link
Contributor Author

@jakobbotsch: Thanks for merging! I have suggestion of very simple follow-up PR. Currently we have five CodeGen::genJumpTable functions that contains exactly same code iterating over jump tables (~80% of whole genJumpTable). If you agree, I could extract that code to one common function and reduce possibility of introducing similar bugs in future.

@jakobbotsch
Copy link
Member

Sure, if you're able to factor out common code then we'd happily a PR that does that (provided the replacement doesn't just come with ifdef soup :-)). codegencommon.cpp would be a good place to put it I think.

yurai007 added a commit to yurai007/runtime that referenced this pull request Feb 29, 2024
Moving same code used across all architectures to common codegen should simplify things
and reduce possibility of future regressions as noted in dotnet#98992.
jakobbotsch pushed a commit that referenced this pull request Feb 29, 2024
Moving same code used across all architectures to common codegen should simplify things
and reduce possibility of future regressions as noted in #98992.
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-riscv Related to the RISC-V architecture area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.