Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coreclr is crashing with a segfault. #6375

Closed
matthid opened this issue Jul 22, 2016 · 6 comments
Closed

coreclr is crashing with a segfault. #6375

matthid opened this issue Jul 22, 2016 · 6 comments

Comments

@matthid
Copy link

matthid commented Jul 22, 2016

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 [email protected]: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 [email protected](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.

@janvorli
Copy link
Member

CoreCLR doesn't work in bash on Windows yet. @jkotas do we know some details on the Windows teams work on the issue?

@jkotas
Copy link
Member

jkotas commented Jul 22, 2016

This crash looks like duplicate of https://github.com/dotnet/coreclr/issues/5837. I do not think it has anything to do bash on Windows.

@jkotas
Copy link
Member

jkotas commented Jul 22, 2016

cc @gkhanna79

@matthid
Copy link
Author

matthid commented Jul 22, 2016

@janvorli Thanks for the fast answer. Note that I'm not using the "ubuntu bash for windows", but the git bash distributed with Visual Studio 2015.

Running the binaries in cmd fails with the same crash. Trying now if building on cmd generates a working executable. Just for completeness sake I even published and build all packages again manually with cmd and still "dotnet has stopped working".

@jkotas Yes the stack looks the same

@matthid
Copy link
Author

matthid commented Jul 22, 2016

Thanks will try to use the suggested workaround

@matthid
Copy link
Author

matthid commented Jul 22, 2016

Thank you all again, the workaround is working fine!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants