Giter Site home page Giter Site logo

CSC : error CS0041: Unexpected error writing debug information -- 'Insufficient memory to continue the execution of the program.' about roslyn HOT 11 OPEN

TonyValenti avatar TonyValenti commented on July 18, 2024
CSC : error CS0041: Unexpected error writing debug information -- 'Insufficient memory to continue the execution of the program.'

from roslyn.

Comments (11)

jaredpar avatar jaredpar commented on July 18, 2024

This is very likely not a real OOM scenario but likely a fragmentation issue or just bug in the DIA writing layer that the compiler is exposing. To debug though going to need to know more about what compilation is happening under the hood here.

@roji is there a way to get a binary log for the build that is happening here or surface the compilation in some way?

from roslyn.

roji avatar roji commented on July 18, 2024

/cc @AndriySvyryd, any idea how to get a binlog for dotnet ef dbcontext optimize (or some other way to diagnose this)?

from roslyn.

AndriySvyryd avatar AndriySvyryd commented on July 18, 2024

@roji @jaredpar OOM happens when compiling the generated code, so logs from dotnet ef dbcontext optimize wouldn't be very useful.

@TonyValenti Perhaps you can share the code generated by dotnet ef dbcontext optimize?

The current theory is that this is caused by the large number of unqualified lambdas (many of which are transformed into expression trees) in a single method.
See dotnet/efcore#33483

from roslyn.

TonyValenti avatar TonyValenti commented on July 18, 2024

Here you go.
Context.Generated.zip

from roslyn.

jaredpar avatar jaredpar commented on July 18, 2024

@TonyValenti can you provide a compiler log of the build?

https://github.com/jaredpar/complog?tab=readme-ov-file#creating-compiler-logs

The generated code itself isn't going to be enough to track this down. Need to see it in the context of the greater build.

Note: that log will include basically all code in your project. So if it's not okay to share publicly please create a VS feedback ticket, share it there and put the link in this issue so I can assign it to my team.

from roslyn.

TonyValenti avatar TonyValenti commented on July 18, 2024

Here you go!
build.zip

from roslyn.

TonyValenti avatar TonyValenti commented on July 18, 2024

@jaredpar - Do you have everything you need?

from roslyn.

jaredpar avatar jaredpar commented on July 18, 2024

@TonyValenti thanks for checking. I can repro this on my machine now with the provided compiler log.

from roslyn.

jaredpar avatar jaredpar commented on July 18, 2024

@TonyValenti seems like my suspicion of this being an issue in DIA may be correct. Switching the compilation to use portable PDBs vs. Native PDBs causes the error to go away.

Short term you can flip to using <DebugType>Portable</DebugType> and that will get around the errorr

Note: is there a particular reason you're not already using portable PDBs? For .NET Core projects they're generally preferred.

from roslyn.

TonyValenti avatar TonyValenti commented on July 18, 2024

Hi @jaredpar -
I'm not explicitly setting DebugType type at all. But we do use PostSharp and it might set that (not sure though).

from roslyn.

jaredpar avatar jaredpar commented on July 18, 2024

@TonyValenti the projects all seemingly have this import pattern at the top

	<Import Project="..\..\UniversalMigrator.Shared\__Shared\Shared.props" />

That Shared.props file has <DebugType>full</DebugType>

Note: I'm not familiar with PostSharp so unsure if this is / isn't related to that.

from roslyn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.