Skip to content

coreclr is crashing with a segfault. #6375

@matthid

Description

@matthid

Sorry I couldn't reproduce this on a smaller sample. It seems to have to do with this specific kind of assembly loading, Repro:

  1. Open git bash on windows 10 - 64 bit

  2. git clone git@github.com:matthid/FAKE.git

  3. cd FAKE

  4. git checkout 5e4d92144e8de9a65c9ed4a4c5640b3685ad7724

  5. ./build.sh -- wait and get a cup of coffee, if it fails with "The supplied buffer is not valid", try again until

    ---------------------------------------------------------------------
    Build Time Report
    ---------------------------------------------------------------------
    Target                        Duration
    ------                        --------
    Clean                         00:00:00.2523238
    RenameFSharpCompilerService   00:00:04.0286622
    SetAssemblyInfo               00:00:00.0516120
    BuildSolution                 00:00:26.5901468
    InstallDotnetCore             00:00:01.8710067
    DotnetRestore                 00:00:20.5580274
    DotnetBuild                   00:04:41.9870980
    Total:                        00:10:16.6322207
    Status:                       Failure
    ---------------------------------------------------------------------
    1) Fake.UnitTestCommon+FailedTestsException: NUnit test failed (2).
    at Fake.Testing.NUnit3.NUnit3(FSharpFunc`2 setParams, IEnumerable`1 assemblies) in C:\code\fake\src\app\FakeLib\UnitTest\NUnit\NUnit3.fs:line 298
    at FSI_0005.Build.clo@170-13.Invoke(Unit _arg8)
    at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 492
    ---------------------------------------------------------------------
    
  6. Now the error can be reproduced with

    1. cd integrationtests/scenarios/dotnetcore-reference-fake-core-targets/temp

      Note: If temp is missing just copy the before folder...

    2. ../../../../nuget/dotnetcore/Fake.netcore/current/Fake.netcore.exe run reference_fake-targets.fsx

I'm trying to use the AssemblyResolve event to resolve assemblies at runtime and it seems like coreclr doesn't like that, see fsprojects/FAKE#1281 (comment) for a screenshot.

I tried to debug this and got a native stacktrace, see fsprojects/FAKE#1281 (comment) . However it is not clear to me if this is a real coreclr bug or a bug in my code. Is there a way to diagnose this further? Adding COREHOST_TRACE=1 doesn't add any additional infos.

When adding --verbose (like ../../../../nuget/dotnetcore/Fake.netcore/current/Fake.netcore.exe --verbose run reference_fake-targets.fsx), you can see that we try to load Fake.Core.Environment.dll immediately before it crashes. Fake.Core.Environment is a dependency of Fake.Core.Targets.dll which loads with the same logic without problems.

Any help is appreciated.

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