Skip to content

dotnet crash on macOS #356

Closed
Closed

Description

@enricosada

from @dustinmoris:

It seems like the latest Ionide version 3.34.0 causes dotnet to crash unexpectedly on macOS.
Steps to reproduce:

  • Open .NET Core F# project in VS Code with Ionide
  • A few seconds later I'll get a popup saying that dotnet crashed
    F# Intellisense stops working, etc.

When I revert back to version 3.33.0 then everything works fine again.

ref ionide/ionide-vscode-fsharp#1039

Ionide v3.33.0 => FSAC b692de8
Ionide v3.34.0 => FSAC bd342d2

Activity

  1. self-assigned this
    on Mar 21, 2019
  2. alfonsogarciacaro commented on Mar 28, 2019

    @alfonsogarciacaro
    Contributor

    This is affecting Fable too 😞

  3. enricosada commented on Mar 28, 2019

    @enricosada
    ContributorAuthor

    I’ll generate a test version with don’s fix and we’ll try if I’d enough.
    Otherwise we need to use previous FCS

  4. alfonsogarciacaro commented on Mar 28, 2019

    @alfonsogarciacaro
    Contributor

    Which fix? This? dotnet/fsharp#6380

  5. baronfel commented on Mar 28, 2019

    @baronfel
    Contributor

    dotnet/fsharp#6355 this is the interesting one. I'm ready to merge it into FCS and do a release as soon as it lands in master, though I suppose I could cherry pick it as it is and do a prerelease.

  6. enricosada commented on Mar 28, 2019

    @enricosada
    ContributorAuthor

    Yes, i want to use a FCS with that cherry picked.
    I didn’t yet got a way to get the stack trace of the stackoverflow on Mac, to see is the same error

  7. alfonsogarciacaro commented on Mar 28, 2019

    @alfonsogarciacaro
    Contributor

    Damn, I tried cherry-picking dotnet/fsharp@e5fcd48 into the FCS fork we're using, rebuilt and copied to assembly to Fable, but I'm still getting the SO exception :/

  8. alfonsogarciacaro commented on Mar 28, 2019

    @alfonsogarciacaro
    Contributor

    I noticed the cherry-pick hasn't updated the file timestamps and the CallFsYacc and CallFsLex targets were being skipped. This brought some hope, I run git clean -xfd and then built again, but still getting SO exceptions on macOS 😭

  9. alfonsogarciacaro commented on Mar 28, 2019

    @alfonsogarciacaro
    Contributor

    Anyways, I tried pushing a new fable-compiler with the updated FCS and @MangelMaxime reports it's now working for his project that used to crash before, so maybe it's an improvement at the end (I'm still getting the SO exception when trying to compile Fable itself on macOS). cc @ncave

  10. baronfel commented on Mar 28, 2019

    @baronfel
    Contributor

    My crashes were all related to lexing, so I'm hopeful that the fix solves my particular issue as well. I found that out by configuring my environment to take a core dump when the process crashed and loading the dump into lldb with the libsosplugin.dylib for macos.

  11. enricosada commented on Mar 29, 2019

    @enricosada
    ContributorAuthor

    @baronfel can you document in a gist or somewhere the process to get the dump + lldb? will be really useful

    I'll push a new FSAC with update FCS ( ref #359 )

  12. baronfel commented on Apr 2, 2019

    @baronfel
    Contributor

    I'm getting the same as @alfonsogarciacaro, my largeish work solution still stackoverflows on FCS 28 one the netcore runtime

  13. enricosada commented on Apr 24, 2019

    @enricosada
    ContributorAuthor

    there is a minimal repro with https://github.com/sjanahan/ionide-crash/tree/master thanks to @sjanahan

    crash in osx only

    the original codebase crashed also Rider (with stackoverflow backend-err.log ) but there is not yet a minimal repro for Rider

    Warning: No JetBrains.ExternalAnnotations packages found in the host ReSharperHost182
    Warning: Can't find external annotations for Default
    Warning: Can't find external annotations for Default
    Stack overflow in unmanaged: IP: 0x10744b82b, fault addr: 0x7000076f5fb8
    Stack overflow: IP: 0x10744b82b, fault addr: 0x7000076ecff8
    Stacktrace:
      at <unknown> <0xffffffff>
      at string.CtorCharArrayStartLength (char[],int,int) [0x00061] in <53dca12e92aa4e3387f3b954838dd249>:0
      <...>
      at string.CreateString (char[],int,int) [0x00000] in <53dca12e92aa4e3387f3b954838dd249>:0
      at (wrapper managed-to-managed) string..ctor (char[],int,int) [0x00000] in <53dca12e92aa4e3387f3b954838dd249>:0
      at Internal.Utilities.Text.Lexing.LexBuffer`1<char>.LexemeString (Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexer._fslex_tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,int,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00193] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
    
    ...... tons more of at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString
    
      at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexer.tripleQuoteString (Microsoft.FSharp.Compiler.AbstractIL.Internal.ByteBuffer,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Range/range, Microsoft.FSharp.Core.FSharpFunc`2<bool, Microsoft.FSharp.Core.FSharpFunc`2<byte[], Microsoft.FSharp.Compiler.Parser/token>>>,Microsoft.FSharp.Compiler.Range/range,Microsoft.FSharp.Compiler.Lexhelp/lexargs,bool,Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.LexFilter/LexFilterImpl.runWrappedLexerInConsistentLexbufState () [0x00031] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.LexFilter/LexFilterImpl.popNextTokenTup () [0x0001a] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.LexFilter/LexFilterImpl.peekNextTokenTup () [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.LexFilter/LexFilterImpl.pushCtxtSeqBlock (bool,Microsoft.FSharp.Compiler.LexFilter/AddBlockEnd) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.LexFilter/LexFilterImpl.hwTokenFetch (bool) [0x0466a] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.LexFilter/LexFilterImpl.Lexer<a_REF> (a_REF) [0x00021] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.LexFilter/LexFilter.popNextToken () [0x0001a] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.LexFilter.loop@2264-37 (Microsoft.FSharp.Compiler.LexFilter/LexFilter,Microsoft.FSharp.Core.Unit) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.LexFilter/LexFilter.Lexer<a_REF> (a_REF) [0x00002] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.SourceCodeServices.Parser/createLexerFunction@1534<a_REF>.Invoke (a_REF) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Internal.Utilities.Text.Parsing.Implementation.interpret<tok_REF> (Internal.Utilities.Text.Parsing.Tables`1<tok_REF>,Microsoft.FSharp.Core.FSharpFunc`2<Internal.Utilities.Text.Lexing.LexBuffer`1<char>, tok_REF>,Internal.Utilities.Text.Lexing.LexBuffer`1<char>,int) [0x0013c] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Internal.Utilities.Text.Parsing.Tables`1<tok_REF>.Interpret (Microsoft.FSharp.Core.FSharpFunc`2<Internal.Utilities.Text.Lexing.LexBuffer`1<char>, tok_REF>,Internal.Utilities.Text.Lexing.LexBuffer`1<char>,int) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.CompileOps.ParseInput (Microsoft.FSharp.Core.FSharpFunc`2<Internal.Utilities.Text.Lexing.LexBuffer`1<char>, Microsoft.FSharp.Compiler.Parser/token>,Microsoft.FSharp.Compiler.ErrorLogger/ErrorLogger,Internal.Utilities.Text.Lexing.LexBuffer`1<char>,Microsoft.FSharp.Core.FSharpOption`1<string>,string,System.Tuple`2<bool, bool>) [0x00070] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.SourceCodeServices.Parser/parseResult@1590.Invoke (Internal.Utilities.Text.Lexing.LexBuffer`1<char>) [0x0006b] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexhelp/usingLexbufForParsing@92<a_REF>.Invoke (Microsoft.FSharp.Core.Unit) [0x00000] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexhelp.reusingLexbufForParsing<a_REF> (Internal.Utilities.Text.Lexing.LexBuffer`1<char>,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, a_REF>) [0x00026] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.Lexhelp.usingLexbufForParsing<a_REF> (Internal.Utilities.Text.Lexing.LexBuffer`1<char>,string,Microsoft.FSharp.Core.FSharpFunc`2<Internal.Utilities.Text.Lexing.LexBuffer`1<char>, a_REF>) [0x0001a] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Compiler.SourceCodeServices.Parser.parseFile (string,string,Microsoft.FSharp.Compiler.SourceCodeServices.FSharpParsingOptions,string) [0x00066] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at <StartupCode$FSharp-Compiler-Service>.$Service/ParseFile@2505.Invoke (Microsoft.FSharp.Core.Unit) [0x0006a] in <5b5b17b04d124a0ca7450383b0175b5b>:0
      at Microsoft.FSharp.Control.AsyncBuilderImpl/callA@522<b_REF, a_REF>.Invoke (Microsoft.FSharp.Control.AsyncParams`1<b_REF>) [0x00051] in <5a7d678a904cf4daa74503838a677d5a>:0
      at Microsoft.FSharp.Control.AsyncBuilderImpl/queueAsync@434<a_REF>.Invoke (Microsoft.FSharp.Core.Unit) [0x00033] in <5a7d678a904cf4daa74503838a677d5a>:0
      at <StartupCode$FSharp-Core>.$Control.loop@124-50 (Microsoft.FSharp.Control.Trampoline,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Control.FakeUnitValue>) [0x00000] in <5a7d678a904cf4daa74503838a677d5a>:0
      at Microsoft.FSharp.Control.Trampoline.ExecuteAction (Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Control.FakeUnitValue>) [0x00017] in <5a7d678a904cf4daa74503838a677d5a>:0
      at Microsoft.FSharp.Control.TrampolineHolder.Protect (Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Control.FakeUnitValue>) [0x00031] in <5a7d678a904cf4daa74503838a677d5a>:0
      at <StartupCode$FSharp-Core>.$Control/-ctor@200-1.Invoke (object) [0x00017] in <5a7d678a904cf4daa74503838a677d5a>:0
      at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (object) [0x00007] in <53dca12e92aa4e3387f3b954838dd249>:0
      at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in <53dca12e92aa4e3387f3b954838dd249>:0
      at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in <53dca12e92aa4e3387f3b954838dd249>:0
      at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <53dca12e92aa4e3387f3b954838dd249>:0
      at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <53dca12e92aa4e3387f3b954838dd249>:0
      at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <53dca12e92aa4e3387f3b954838dd249>:0
      at (wrapper runtime-invoke) <Module>.runtime_invoke_bool (object,intptr,intptr,intptr) [0x0001e] in <53dca12e92aa4e3387f3b954838dd249>:0
    
  14. cartermp commented on Jul 31, 2019

    @cartermp
    Contributor

    Using latest Ionide on macOS with latest .NET SDK I don't see a crash in the repro project. @alfonsogarciacaro @baronfel do you still see this? Could perhaps the Fable codebase be a testbed for this? CoreCLR is making improvements at the runtime level that should help but it'd be great to have something that repros today: dotnet/coreclr#25932

  15. alfonsogarciacaro commented on Jul 31, 2019

    @alfonsogarciacaro
    Contributor

    Interestingly, I just tried to build Fable with Fable in my macOS and this time worked! But I still have the dotnet SDK pinned to 2.1.403 in global.json. Not sure, why it's working now 🤔

  16. cartermp commented on Jul 31, 2019

    @cartermp
    Contributor

    Could you try it with the latest? The compiler has had many improvements around this issue, and as of the latest bits (not available in FCS I think) we think we've smashed the bulk of them. But there are still places where the compiler emits too many .tail instructions and CoreCLR struggled with that. There's now work to improve that situation with CoreCLR.

  17. baronfel commented on Jul 31, 2019

    @baronfel
    Contributor

    Yeah, I need to update FCS again with July's work, but the most recent version has everything through June: https://github.com/fsharp/FSharp.Compiler.Service/releases/tag/30.0.0

    I've had no issues with stackoverflows for a few months now, so I'm generally happy.

  18. alfonsogarciacaro commented on Aug 1, 2019

    @alfonsogarciacaro
    Contributor

    The FCS version Fable uses is based in one branch of @ncave's fork that includes a slim checker that works a bit better with Fable watch mode. I tried to udpate it but unfortunately there are a few conflicts. I'll wait a bit to see if ncave can do magic or I'll try again later :)

  19. cartermp commented on Aug 1, 2019

    @cartermp
    Contributor

    Might be good to resolve this then. FWIW there will be even more fixes in a new FCS, mostly around utterly massive type definitions (e.g., hundreds of labels in a record field).

  20. ncave commented on Aug 2, 2019

    @ncave
  21. alfonsogarciacaro commented on Aug 2, 2019

    @alfonsogarciacaro
    Contributor

    Thanks @ncave! @cartermp I just built Fable (and Fable with Fable) with latest FCS bits and everything is still working on my macOS (and on Windows in Appveyor) :)

  22. Krzysztof-Cieslak commented on Aug 2, 2019

    @Krzysztof-Cieslak
    Member

    Ok, let's close this one. It seems everything is working at the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions