Skip to content

.NET 10: csc fails with Failed to create CoreCLR, HRESULT: 0x80070008 #120967

Closed

Description

@rolfbjarne

Description

csc fails to run with:

Failed to create CoreCLR, HRESULT: 0x80070008

Reproduction Steps

Repro script:

#!/bin/bash -ex

curl -LO https://ci.dot.net/public/Sdk/10.0.100-rtm.25520.117/dotnet-sdk-10.0.100-osx-arm64.tar.gz
mkdir dotnet
cd dotnet
tar xvf ../dotnet-sdk-10.0.100-osx-arm64.tar.gz
cd ..
DOTNET_ROOT=$(pwd)/dotnet ./dotnet/sdk/10.0.100/Roslyn/bincore/csc --help

This is a simplified version of what we're running into, here's a binlog of that: msbuild.binlog.zip

Expected behavior

csc succeeds

Actual behavior

+ ./dotnet/sdk/10.0.100/Roslyn/bincore/csc --help
Failed to create CoreCLR, HRESULT: 0x80070008

Regression?

Yes, this started happening in this maestro bump: dotnet/macios#24064 (first commit)

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. added
    untriaged
    on Oct 22, 2025
  2. added
    needs-area-label
    on Oct 22, 2025
  3. changed the title [-]csc fails with Failed to create CoreCLR, HRESULT: 0x80070008[/-] [+].NET 10: csc fails with Failed to create CoreCLR, HRESULT: 0x80070008[/+] on Oct 22, 2025
  4. MihuBot commented on Oct 22, 2025

    @MihuBot

    I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):

  5. jjonescz commented on Oct 22, 2025

    @jjonescz
    Member

    0x80070008 seems to mean "ERROR_NOT_ENOUGH_MEMORY"
    There doesn't seem to be anything interesting changed between 20.105 and 20.117 versions of the SDK (dotnet/dotnet@5aef8ea...50d7970), so I guess this might be a problem in your pipeline, like insufficient disk space on the CI machines

  6. rolfbjarne commented on Oct 22, 2025

    @rolfbjarne
    MemberAuthor

    I guess this might be a problem in your pipeline, like insufficient disk space on the CI machines

    I can reproduce locally, and I have plenty of disk space available.

  7. jjonescz commented on Oct 22, 2025

    @jjonescz
    Member

    Thanks. Looks like some issue with the apphost then. @agocke how do we investigate further what is the failure here?

    Since this seems to be macOS specific, it might be something with signing, but as I said above, there don't seem to be any interesting changes between the relevant .NET builds.

    Note: confirmed with @rolfbjarne offline that renaming the csc apphost makes the build work again since it falls back to using dotnet exec csc.dll instead of the csc apphost, hence my conclusion that this is some problem with the apphost.

  8. added and removed
    needs-area-label
    on Oct 22, 2025
  9. dotnet-policy-service commented on Oct 22, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
    See info in area-owners.md if you want to be subscribed.

  10. vitek-karas commented on Oct 22, 2025

    @vitek-karas
    Member

    Can you enable COREHOST tracing and repro it? The trace will give lot more detail on what's happening in the apphost.
    https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#corehost_trace

  11. rolfbjarne commented on Oct 22, 2025

    @rolfbjarne
    MemberAuthor

    Can you enable COREHOST tracing and repro it? The trace will give lot more detail on what's happening in the apphost. learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#corehost_trace

    host_trace.txt.zip

    I executed this using the repro from the initial description:

    DOTNET_HOST_TRACEFILE=host_trace.txt DOTNET_HOST_TRACE=1 DOTNET_ROOT=$(pwd)/dotnet ./dotnet/sdk/10.0.100/Roslyn/bincore/csc --help
    
  12. agocke commented on Oct 22, 2025

    @agocke
    Member

    @AaronRobinsonMSFT can you take a first look? I don’t think we changed anything significant recently so it smells like it might be miscompilation.

  13. agocke commented on Oct 22, 2025

    @agocke
    Member

    Actually if the error is “out of disk space” that sounds suspiciously like #120653

  14. 1 remaining item

  15. removed
    untriaged
    on Oct 22, 2025
  16. added this to the 10.0.0 milestone on Oct 22, 2025
  17. AaronRobinsonMSFT commented on Oct 22, 2025

    @AaronRobinsonMSFT
    Member
  18. jaredpar commented on Oct 22, 2025

    @jaredpar
    Member

    dotnet does work because it does have them.

    Why does lack of enitlements lead to an out of disk space error message?

  19. agocke commented on Oct 22, 2025

    @agocke
    Member

    The OS is likely erroring out in a system call and this is flowing through a weird code path. We should try and figure out if there's a better error message we can produce.

  20. agocke commented on Oct 22, 2025

    @agocke
    Member

    This is going to be slightly difficult to figure out because one of things we can't do without entitlements is run it under a debugger

  21. MichalPetryka commented on Oct 22, 2025

    @MichalPetryka
    Contributor

    The OS is likely erroring out in a system call and this is flowing through a weird code path. We should try and figure out if there's a better error message we can produce.

    Does the OS maybe return the OOM error when the process is forbidden from allocating executable memory?

  22. rolfbjarne commented on Oct 22, 2025

    @rolfbjarne
    MemberAuthor

    This is going to be slightly difficult to figure out because one of things we can't do without entitlements is run it under a debugger

    You can resign an executable locally using a placeholder certificate and then you can run with lldb.

    $ codesign -f -s "-" ./dotnet/sdk/10.0.100/Roslyn/bincore/csc
    

    and now you should be able to run the csc binary with lldb (and it won't have any entitlements either).

  23. rolfbjarne commented on Oct 23, 2025

    @rolfbjarne
    MemberAuthor

    We got a bump to 10.0.100-rtm.25521.107 a few hours ago, which worked fine! NVM, I got our PRs mixed up, it's too early in the morning here.

  24. rmarinho commented on Oct 23, 2025

    @rmarinho
    Member

    Maui hitting this too dotnet/maui#32162

    When I tried to move to barid 288228

  25. am11 commented on Oct 23, 2025

    @am11
    Member

    Reproduction Steps

    It repros with https://ci.dot.net/public/Sdk/10.0.100-rtm.25520.117/dotnet-sdk-10.0.100-osx-arm64.tar.gz but not with (the newer) https://ci.dot.net/public/Sdk/10.0.100-rtm.25523.103/dotnet-sdk-10.0.100-osx-arm64.tar.gz.

    25520.117 might be a faulty build?

  26. jjonescz commented on Oct 23, 2025

    @jjonescz
    Member

    The fix dotnet/dotnet#3052 was merged yesterday, that should explain why 25523.103 works :)

  27. locked and limited conversation to collaborators on Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions