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

Refactoring IShiftOperators to take a TOther #71405

Merged
merged 2 commits into from
Jul 5, 2022

Conversation

tannergooding
Copy link
Member

This is failing locally, checking if CI provides any additional details.

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Jun 28, 2022

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

Issue Details

This is failing locally, checking if CI provides any additional details.

Author: tannergooding
Assignees: tannergooding
Labels:

area-System.Numerics, new-api-needs-documentation

Milestone: -

@tannergooding
Copy link
Member Author

@davidwrighton, @lambdageek seeing:

Assert failure(PID 27404 [0x00006b0c], Thread: 7640 [0x1dd8]): pMT != NULL

CORECLR! CoreLibBinder::GetExistingClass + 0x3E (0x00007ff9`d12f59ae)
CORECLR! CoreLibBinder::GetElementType + 0x1A (0x00007ff9`d131f90a)
CORECLR! SigPointer::GetTypeHandleThrowing + 0x937 (0x00007ff9`d1664dc7)
CORECLR! SigPointer::GetTypeHandleThrowing + 0x19B0 (0x00007ff9`d1665e40)
CORECLR! ClassLoader::LoadTypeDefOrRefOrSpecThrowing + 0x9B5 (0x00007ff9`d13fc4c5)
CORECLR! MethodTableBuilder::LoadExactInterfaceMap + 0x5D9 (0x00007ff9`d192d469)
CORECLR! ClassLoader::LoadExactParentAndInterfacesTransitively + 0x654 (0x00007ff9`d13cc344)
CORECLR! ClassLoader::LoadExactParents + 0x431 (0x00007ff9`d13cc7d1)
CORECLR! ClassLoader::DoIncrementalLoad + 0x78D (0x00007ff9`d13ee7fd)
CORECLR! ClassLoader::LoadTypeHandleForTypeKey_Body + 0xDDC (0x00007ff9`d140059c)
    File: C:\Users\tagoo\source\repos\runtime\src\coreclr\vm\binder.h Line: 393
    Image: C:\Users\tagoo\source\repos\runtime\artifacts\tests\coreclr\windows.x64.Debug\Tests\Core_Root\corerun.exe

I'm unsure what's "special" here that's causing the error. it seems to occur just by adding a generic type parameter to IShiftOperators

@tannergooding tannergooding added this to the 7.0.0 milestone Jun 29, 2022
@tannergooding
Copy link
Member Author

tannergooding commented Jun 29, 2022

Stack trace here is the following with it seemingly occurring just as part of startup:

> coreclr.dll!DbgAssertDialog(const char * szFile, int iLine, const char * szExpr) Line 599	C++
  coreclr.dll!CoreLibBinder::GetExistingClass(BinderClassID id) Line 393	C++
  coreclr.dll!CoreLibBinder::GetElementType(CorElementType type) Line 218	C++
  coreclr.dll!SigPointer::GetTypeHandleThrowing(Module * pModule, const SigTypeContext * pTypeContext, ClassLoader::LoadTypesFlag fLoadTypes, ClassLoadLevel level, int dropGenericArgumentLevel, const Substitution * pSubst, const ZapSig::Context * pZapSigContext, MethodTable * pMTInterfaceMapOwner) Line 1091	C++
  coreclr.dll!SigPointer::GetTypeHandleThrowing(Module * pModule, const SigTypeContext * pTypeContext, ClassLoader::LoadTypesFlag fLoadTypes, ClassLoadLevel level, int dropGenericArgumentLevel, const Substitution * pSubst, const ZapSig::Context * pZapSigContext, MethodTable * pMTInterfaceMapOwner) Line 1388	C++
  coreclr.dll!ClassLoader::LoadTypeDefOrRefOrSpecThrowing(Module * pModule, unsigned int typeDefOrRefOrSpec, const SigTypeContext * pTypeContext, ClassLoader::NotFoundAction fNotFoundAction, ClassLoader::PermitUninstantiatedFlag fUninstantiated, ClassLoader::LoadTypesFlag fLoadTypes, ClassLoadLevel level, int dropGenericArgumentLevel, const Substitution * pSubst, MethodTable * pMTInterfaceMapOwner) Line 2035	C++
  coreclr.dll!MethodTableBuilder::LoadExactInterfaceMap(MethodTable * pMT) Line 9208	C++
  coreclr.dll!ClassLoader::LoadExactParentAndInterfacesTransitively(MethodTable * pMT) Line 908	C++
  coreclr.dll!ClassLoader::LoadExactParents(MethodTable * pMT) Line 941	C++
  coreclr.dll!ClassLoader::DoIncrementalLoad(TypeKey * pTypeKey, TypeHandle typeHnd, ClassLoadLevel currentLevel) Line 2871	C++
  coreclr.dll!ClassLoader::LoadTypeHandleForTypeKey_Body(TypeKey * pTypeKey, TypeHandle typeHnd, ClassLoadLevel targetLevel) Line 3516	C++
  coreclr.dll!ClassLoader::LoadTypeHandleForTypeKey(TypeKey * pTypeKey, TypeHandle typeHnd, ClassLoadLevel targetLevel, const InstantiationContext * pInstContext) Line 3235	C++
  coreclr.dll!ClassLoader::LoadTypeDefThrowing(Module * pModule, unsigned int typeDef, ClassLoader::NotFoundAction fNotFoundAction, ClassLoader::PermitUninstantiatedFlag fUninstantiated, unsigned int tokenNotToLoad, ClassLoadLevel level, Instantiation * pTargetInstantiation) Line 2216	C++
  coreclr.dll!SigPointer::GetTypeHandleThrowing(Module * pModule, const SigTypeContext * pTypeContext, ClassLoader::LoadTypesFlag fLoadTypes, ClassLoadLevel level, int dropGenericArgumentLevel, const Substitution * pSubst, const ZapSig::Context * pZapSigContext, MethodTable * pMTInterfaceMapOwner) Line 1422	C++
  coreclr.dll!ClassLoader::LoadTypeDefOrRefOrSpecThrowing(Module * pModule, unsigned int typeDefOrRefOrSpec, const SigTypeContext * pTypeContext, ClassLoader::NotFoundAction fNotFoundAction, ClassLoader::PermitUninstantiatedFlag fUninstantiated, ClassLoader::LoadTypesFlag fLoadTypes, ClassLoadLevel level, int dropGenericArgumentLevel, const Substitution * pSubst, MethodTable * pMTInterfaceMapOwner) Line 2035	C++
  coreclr.dll!MethodTableBuilder::LoadExactInterfaceMap(MethodTable * pMT) Line 9208	C++
  coreclr.dll!ClassLoader::LoadExactParentAndInterfacesTransitively(MethodTable * pMT) Line 908	C++
  coreclr.dll!ClassLoader::LoadExactParents(MethodTable * pMT) Line 941	C++
  coreclr.dll!ClassLoader::DoIncrementalLoad(TypeKey * pTypeKey, TypeHandle typeHnd, ClassLoadLevel currentLevel) Line 2871	C++
  coreclr.dll!ClassLoader::LoadTypeHandleForTypeKey_Body(TypeKey * pTypeKey, TypeHandle typeHnd, ClassLoadLevel targetLevel) Line 3516	C++
  coreclr.dll!ClassLoader::LoadTypeHandleForTypeKey(TypeKey * pTypeKey, TypeHandle typeHnd, ClassLoadLevel targetLevel, const InstantiationContext * pInstContext) Line 3235	C++
  coreclr.dll!ClassLoader::EnsureLoaded(TypeHandle typeHnd, ClassLoadLevel level) Line 1021	C++
  coreclr.dll!CoreLibBinder::LoadPrimitiveType(CorElementType et) Line 1194	C++
  coreclr.dll!SystemDomain::LoadBaseSystemClasses() Line 1378	C++
  coreclr.dll!SystemDomain::Init() Line 1203	C++
  coreclr.dll!EEStartupHelper() Line 935	C++
  coreclr.dll!`EEStartup'::`9'::__Body::Run(void * p) Line 1073	C++
  coreclr.dll!EEStartup() Line 1075	C++
  coreclr.dll!EnsureEEStarted() Line 311	C++
  coreclr.dll!CorHost2::Start() Line 101	C++

Potentially related to the specializations that the built-in types have to reduce the cost of the interfaces?

@tannergooding
Copy link
Member Author

Should probably tag @trylek as well

@tannergooding
Copy link
Member Author

Logged #71441

@tannergooding tannergooding added the blocked Issue/PR is blocked on something - see comments label Jun 29, 2022
@jkotas jkotas removed the blocked Issue/PR is blocked on something - see comments label Jun 30, 2022
@tannergooding tannergooding marked this pull request as ready for review June 30, 2022 20:45
Copy link
Contributor

@dakersnar dakersnar left a comment

Choose a reason for hiding this comment

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

Looks good. All of our types here use int as TOther, right? Is the intent to allow users implementing the interface to use different types as the shiftAmount?

@@ -1373,6 +1373,9 @@ void SystemDomain::LoadBaseSystemClasses()
// We have delayed allocation of CoreLib's static handles until we load the object class
CoreLibBinder::GetModule()->AllocateRegularStaticHandles(DefaultDomain());

// Int32 has to be loaded first to break cycle in IShiftOperators
CoreLibBinder::LoadPrimitiveType(ELEMENT_TYPE_I4);
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

A change from Jan that fixes a VM bug that was preventing this change from working.

@tannergooding tannergooding merged commit 6b0d373 into dotnet:main Jul 5, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 4, 2022
@tannergooding tannergooding deleted the generic-math-shift branch November 11, 2022 15:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants