You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 :/
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 😭
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
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.
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
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
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 🤔
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.
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 :)
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).
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) :)
Activity
alfonsogarciacaro commentedon Mar 28, 2019
This is affecting Fable too 😞
enricosada commentedon Mar 28, 2019
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
alfonsogarciacaro commentedon Mar 28, 2019
Which fix? This? dotnet/fsharp#6380
baronfel commentedon Mar 28, 2019
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.
enricosada commentedon Mar 28, 2019
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
alfonsogarciacaro commentedon Mar 28, 2019
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 :/
alfonsogarciacaro commentedon Mar 28, 2019
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 -xfdand then built again, but still getting SO exceptions on macOS 😭alfonsogarciacaro commentedon Mar 28, 2019
Anyways, I tried pushing a new
fable-compilerwith 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 @ncavebaronfel commentedon Mar 28, 2019
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.dylibfor macos.enricosada commentedon Mar 29, 2019
@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 )
baronfel commentedon Apr 2, 2019
I'm getting the same as @alfonsogarciacaro, my largeish work solution still stackoverflows on FCS 28 one the netcore runtime
enricosada commentedon Apr 24, 2019
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
cartermp commentedon Jul 31, 2019
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
alfonsogarciacaro commentedon Jul 31, 2019
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 🤔
cartermp commentedon Jul 31, 2019
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
.tailinstructions and CoreCLR struggled with that. There's now work to improve that situation with CoreCLR.baronfel commentedon Jul 31, 2019
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.
alfonsogarciacaro commentedon Aug 1, 2019
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 :)
cartermp commentedon Aug 1, 2019
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).
ncave commentedon Aug 2, 2019
@alfonsogarciacaro Fable FCS fork rebased to latest.
alfonsogarciacaro commentedon Aug 2, 2019
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) :)
Krzysztof-Cieslak commentedon Aug 2, 2019
Ok, let's close this one. It seems everything is working at the moment