-
Notifications
You must be signed in to change notification settings - Fork 508
Build failing when Adding Npgsql #7605
Comments
What is the Npgsql version that you are using? Would you mind to share the code and .csproj file that reproduces the issue? This crash looks like the infinite generic recursion that was fixed in more recent Npgsql versions: #6372 (comment) . |
Sorry I forgot to list those here. Here's my .fsproj file <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
<PackageReference Include="Npgsql" Version="4.0.7" />
<PackageReference Include="Npgsql.Fsharp" Version="1.10.0" />
</ItemGroup>
</Project> My Program.fs is just the Helloworld one, here it is: open System
[<EntryPoint>]
let main argv =
printfn "Hello World from F#!"
0 // return an integer exit code
|
It does not crash for me. Here is what I have done to try to reproduce this:
What is the Linux distro that you are seeing the crash on? |
You are missing
|
What is the crash that you are see with the latest change? |
It's the same one that we were having at the first place
|
I am not able to reproduce this crash. Does it deterministically crash for you, or is the crash intermittent? |
Intermittently. Were you able to compile it using the last commit too? Via docker compose? I'm already using docker into a OSX system. |
I was able to compile using docker compose. It compiled fine for me. The error I got was this one:
This is a known problem caused by extensive use of reflection on generics inside FSharp implementation of PrintfF that is not friendly to AOT compilation. Discussed in #2057 . |
Hi @jkotas, So I refactored the code in the issue repo with a C# and F# version.
|
Some progress on .rd.xml required to make Npgsql work was made in #6784 , but it was not fully solved.
I have not done anything special. Just run |
I was able to compile it too! I've to bump up the docker environment memory to 6GB. But for now I'm getting the same exception from #6784, @MichalStrehovsky Is this the stack trace that we are supposed to look at? Please regard to this branch of the F# version to reproduce it, if you want to.
|
@OshoNot Try adding Npgsql is essentially reflecting on the managed class constructor runner in CoreRT (an implementation detail of CoreRT that is not visible to reflection unless a switch is passed to the compiler). The class constructor runner in CoreCLR is in native code and stack trace doesn't show it. Stack frames that contain CoreRT implementation details are a bit of a pain because they are not useful anyway. I advocated just eliminating them so that we're more like CoreCLR in this matter, but instead we built a whole new feature that makes |
@MichalStrehovsky thanks for following up on this and for the explanations. What would you suggest we do here? This stack traversal code is non-essential - it's just a way to set up loggers with their class names - so I could just remove it. On the other hand, it does seem like something that should be fixed in CoreRT. |
Actually, thinking about this again, it seems like smelly practice inherited from the times before |
Awesome. It looks like a pretty fragile piece of code anyway - more aggressive inlining would change what the logger reports. Otherwise, the fix would be to check the result of |
Absolutely, this is quite ancient stuff. Is there any sense in keeping this open, to track fully supporting stack frame reflection in CoreRT? Also, can we also close #6784 as a dup of this (the F#-specific issues seem to be already tracked by #2057). |
@MichalStrehovsky, |
It is fully supported in a way. The "problem" with CoreRT is that most of the runtime is written in managed code (which is really a good thing) and the managed pieces become visible in places like this. Things that are in native code in CoreCLR get shielded from reflection and code like the one in Npgsql works. To really fix this, we would have to annotate managed code in CoreRT as "things that are in native code on CoreCLR" so that we can properly emulate what stack trace does. The I don't think we would ever want to go in that direction. |
@MichalStrehovsky OK, sounds like this and #6784 should be closed - will let you do the honors. |
Hello,
I keep getting the same problem when running the HelloWorld Sample with Npgsql.
Running
dotnet publish -r linux-x64 -c Release -v d
I get this error during the "Exec" task of the publish command:
Task "Exec" "/root/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27906-01/tools/ilc" @"obj/Release/netcoreapp2.1/linux-x64/native/DbPrototype.ilc.rsp" Killed 1:7>/root/.nuget/packages/microsoft.dotnet.ilcompiler/1.0.0-alpha-27906-01/build/Microsoft.NETCore.Native.targets(248,5): error MSB3073: The command ""/root/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27906-01/tools/ilc" @"obj/Release/netcoreapp2.1/linux-x64/native/DbPrototype.ilc.rsp"" exited with code 137. [/DbPrototype/DbPrototype.fsproj] Done executing task "Exec" -- FAILED. 1:7>Done building target "IlcCompile" in project "DbPrototype.fsproj" -- FAILED. 1:7>Done Building Project "/DbPrototype/DbPrototype.fsproj" (Publish target(s)) -- FAILED.
OS: Ubuntu 18.04 (All pre requisites installed based on Helloworld sample)
The text was updated successfully, but these errors were encountered: