Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Npgsql causes compilation to fail or infinite loop #6052

@benaadams

Description

@benaadams

Npgsql 4.0.1 https://www.nuget.org/packages/Npgsql/ and using the NpgsqlFactory.Instance property causes compilation to fail

Seems to be some type recursion?

EXEC : error : [TEMPORARY EXCEPTION MESSAGE] ClassLoadValueClassTooLarge:
NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<
 NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<
 NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<
 NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<
 NpgsqlTypes.NpgsqlRange`1<System.String>>>>>>>>>>>>>
, Npgsql, Version=4.0.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7 [C:\GitHub\FrameworkBenchmarks\frameworks\CSharp\aspnetcore-corert\PlatformBenchmarks\PlatformBenchmarks.csproj]
  Internal.TypeSystem.TypeSystemException+TypeLoadException: [TEMPORARY EXCEPTION MESSAGE] ClassLoadValueClassTooLarge: NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<NpgsqlTypes.NpgsqlRange`1<System.String>>>>>>>>>>>>>, Npgsql, Version=4.0.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7
     at Internal.TypeSystem.ThrowHelper.ThrowTypeLoadException(ExceptionStringID id, String typeName, String assemblyName)
     at ILCompiler.DependencyAnalysis.EETypeNode.CheckCanGenerateEEType(NodeFactory factory, TypeDesc type)
     at ILCompiler.DependencyAnalysis.NodeFactory.<CreateNodeCaches>b__36_1(TypeDesc type)
     at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
     at ILCompiler.DependencyAnalysis.ReadyToRunGenericHelperNode.InstantiateDependencies(NodeFactory factory, Instantiation typeInstantiation, Instantiation methodInstantiation)
     at ILCompiler.DependencyAnalysis.ShadowConcreteMethodNode.GetStaticDependencies(NodeFactory factory)
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.GetStaticDependenciesImpl(DependencyNodeCore`1 node)
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes()
     at ILCompiler.ILScanner.ILCompiler.IILScanner.Scan()
     at ILCompiler.Program.Run(String[] args)
     at ILCompiler.Program.Main(String[] args)

Including it in the rd.xml

<Assembly Name="Npgsql" Dynamic="Required All" />

Instead seems like it infinite loops the compiler causing ever growing memory usage (killed it when if hit 5GB)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions