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

Annoying assertion when typing code #3795

Closed
cartermp opened this issue Oct 21, 2017 · 6 comments · Fixed by #4140
Closed

Annoying assertion when typing code #3795

cartermp opened this issue Oct 21, 2017 · 6 comments · Fixed by #4140

Comments

@cartermp
Copy link
Contributor

In a hive, type something like:

let z = 

Eventually, you'll see something like this:

---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
   at Microsoft.FSharp.Compiler.ErrorLogger.newIsInstalled@450.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.ErrorLogger.chkErrorLogger@451.DiagnosticSink(PhasedDiagnostic phasedError, Boolean isError)
   at Microsoft.FSharp.Compiler.LexFilter.LexFilterImpl.pushCtxt(TokenTup tokenTup, Context newCtxt)
   at Microsoft.FSharp.Compiler.LexFilter.LexFilterImpl.hwTokenFetch(Boolean useBlockRule)
   at Microsoft.FSharp.Compiler.LexFilter.loop@2262-33.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.SourceCodeServices.Parser.createLexerFunction@1485.Invoke(a arg00)
   at Microsoft.FSharp.Compiler.SourceCodeServices.Parser.matchBraces@1513-1.Invoke(FSharpList`1 stack)
   at Microsoft.FSharp.Compiler.Lexhelp.reusingLexbufForParsing[a](LexBuffer`1 lexbuf, FSharpFunc`2 f)
   at Microsoft.FSharp.Compiler.Lexhelp.usingLexbufForParsing[a](LexBuffer`1 lexbuf, String filename, FSharpFunc`2 f)
   at Microsoft.FSharp.Compiler.SourceCodeServices.Parser.matchBraces(String source, String fileName, FSharpParsingOptions options, String userOpName)
   at <StartupCode$FSharp-Compiler-Private>.$Service.MatchBraces@2853.Invoke(Unit unitVar)
   at Microsoft.FSharp.Control.AsyncBuilderImpl.callA@522.Invoke(AsyncParams`1 args)
   at <StartupCode$FSharp-Core>.$Control.loop@125-37.Invoke(FSharpFunc`2 action)
   at Microsoft.FSharp.Control.Trampoline.ExecuteAction(FSharpFunc`2 firstAction)
   at Microsoft.FSharp.Control.TrampolineHolder.Protect(FSharpFunc`2 firstAction)
   at Microsoft.FSharp.Control.TaskHelpers.continuation@1184.Invoke(Task`1 completedTask)
   at Microsoft.FSharp.Control.TaskHelpers.continueWith@1194.Invoke(Task`1 delegateArg0)
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
---------------------------
Abort   Retry   Ignore   
---------------------------

I have no idea what could be causing this.

@cartermp
Copy link
Contributor Author

It also seems to leave the editor in a somewhat broken state. Auto de-indentation doesn't work once this gets hit.

@cartermp cartermp added this to the VS 2017 Updates milestone Oct 21, 2017
@dsyme
Copy link
Contributor

dsyme commented Nov 6, 2017

Looking at this code, something in brace matching is using an error logger after it has been deactivated.

It's likely to be from this

        use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse
        use unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> DiscardErrorsLogger)

It may be harmless in this case because DiscardErrorsLogger carries no state, I'm not sure

@auduchinok I think this may be related to your PR for parsing on non-compiler threads - could you take a look?

@auduchinok
Copy link
Member

@dsyme I'll take a look.

@cartermp
Copy link
Contributor Author

I'm noticing this on a VSIX built on my install from release\net40\bin\VisualFSharpOpenSource.vsix. It's making constructing records intances basically impossible.

@vasily-kirichenko
Copy link
Contributor

It makes typing any code impossible. I've tested in release for a while.

@cartermp
Copy link
Contributor Author

cartermp commented Dec 17, 2017

Yeah, I noticed that it's basically anything where you hit space or enter after a token, or > following a -. Since it seems to be coming from the call stack, is this also present in Rider?

@cartermp cartermp changed the title Annoying assertion on master Annoying assertion when typing code Dec 17, 2017
@cartermp cartermp modified the milestones: VS 2017 Updates, 15.6 Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants