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

Assertion: IncrementalBuild object has already been disposed! #4137

Closed
cartermp opened this issue Dec 18, 2017 · 9 comments
Closed

Assertion: IncrementalBuild object has already been disposed! #4137

cartermp opened this issue Dec 18, 2017 · 9 comments

Comments

@cartermp
Copy link
Contributor

cartermp commented Dec 18, 2017

On self-built VSIX, after opening VisualFSharp.sln and CompletionProviderTests.fs, I get the below assertion. I took no action in the IDE.

---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
IncrementalBuild object has already been disposed!

   at Microsoft.FSharp.Compiler.IncrementalBuilder.assertNotDisposed()
   at Microsoft.FSharp.Compiler.IncrementalBuilder.DecrementUsageCount()
   at <StartupCode$FSharp-Compiler-Private>.$Service.-ctor@2339-122.Invoke(Tuple`3 tupledArg)
   at Internal.Utilities.Collections.AgedLookup`3.strongDiscard(Value x)
   at <StartupCode$FSharp-Compiler-Private>.$InternalCollections.clo@110-11.Invoke(Value x)
   at Microsoft.FSharp.Primitives.Basics.List.iter[T](FSharpFunc`2 f, FSharpList`1 x)
   at Microsoft.FSharp.Collections.ListModule.Iterate[T](FSharpFunc`2 action, FSharpList`1 list)
   at Internal.Utilities.Collections.AgedLookup`3.AssignWithStrength[d,e](d tok, FSharpList`1 newdata, FSharpList`1 discard1)
   at <StartupCode$FSharp-Compiler-Private>.$Service.clo@2350-426.Invoke(Tuple`3 _arg3)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.CancellableModule.bind@711.Invoke(CancellationToken ct)
   at Microsoft.FSharp.Compiler.AbstractI......
<truncated>
---------------------------
Abort   Retry   Ignore   
---------------------------

Could this be related to #4121?

cc @dsyme @KevinRansom @dwed

@cartermp
Copy link
Contributor Author

The IDE seems to work fine when I ignore this. Unfortunately, the stack trace in the assertion is kind of useless

@cartermp
Copy link
Contributor Author

Related, after I was debugging CompletionProvider:

---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
   at Microsoft.FSharp.Compiler.CompileOps.TcImports.CheckDisposed()
   at Microsoft.FSharp.Compiler.CompileOps.TcImports.GetImportMap()
   at Microsoft.FSharp.Compiler.SourceCodeServices.Impl.cenv..ctor(TcGlobals g, CcuThunk thisCcu, TcImports tcImports)
   at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpSymbol.Create(TcGlobals g, CcuThunk thisCcu, TcImports tcImports, Item item)
   at <StartupCode$FSharp-Compiler-Private>.$Service.GetSymbolUseAtLocation@1235.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.SourceCodeServices.ErrorScope.Protect[a](range m, FSharpFunc`2 f, FSharpFunc`2 err)
   at Microsoft.FSharp.Compiler.SourceCodeServices.TypeCheckInfo.GetSymbolUseAtLocation(CompilationThreadToken ctok, Int32 line, String lineStr, Int32 colAtEndOfNames, FSharpList`1 names)
   at <StartupCode$FSharp-Compiler-Private>.$Service.GetSymbolUseAtLocation@1965-4.Invoke(CompilationThreadToken ctok, TypeCheckInfo scope)
   at <StartupCode$FSharp-Compiler-Private>.$Service.clo@1899-415.Invoke(CompilationThreadToken ctok)
   at <StartupCode$FSharp-Compiler-Private>.$Reactor.EnqueueAndAwaitOpAsync@174-2.Invoke(CompilationThreadToken ctok)
   at <StartupCode$FSharp-Compiler-Private>.$Reactor.loop@70-95.Invoke(FSharpOption`1 _arg2)
   at Microsoft.FSharp.Control.AsyncBuilderImpl.args@506-1.Invoke(a a)
   at <StartupCode$FSharp-Core>.$Control.loop@124-50(Trampoline this, FSharpFunc`2 action)
   at Microsoft.FSharp.Control.Trampoline.ExecuteAction(FSharpFunc`2 firstAction)
   at Microsoft.FSharp.Control.TrampolineHolder.Protect(FSharpFunc`2 firstAction)
   at <StartupCode$FSharp-Core>.$Control.AwaitWaitHandle@1326-2.Invoke(Object _arg5, Boolean timeOut)
   at System.Threading._ThreadPoolWaitOrTimerCallback.WaitOrTimerCallback_Context(Object state, Boolean timedOut)
   at System.Threading._ThreadPoolWaitOrTimerCallback.WaitOrTimerCallback_Context_t(Object state)
   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._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(Object state, Boolean timedOut)
---------------------------
Abort   Retry   Ignore   
---------------------------

@cartermp
Copy link
Contributor Author

I can't get this to repro reliably :(

@cartermp
Copy link
Contributor Author

cartermp commented Dec 18, 2017

Okay, this is making it impossible to write code in the editor. It seems to be triggered by any operation that needs typechecking, such as completion or document highlight.

@cartermp
Copy link
Contributor Author

cartermp commented Dec 18, 2017

Perhaps this is actually from here: #4132, as it's this built-in VSIX where I get the assertion.

@dhwed
Copy link
Contributor

dhwed commented Dec 18, 2017

@cartermp I saw this debug assert a lot before my changes in #4121, but I saw it less often after that change (probably just because invalidation happened less often).

@cartermp
Copy link
Contributor Author

cartermp commented Dec 18, 2017

It could be due to 351d06b, if you were working atop that. Might be unlikely, though, since I merged that at roughly the same time as your PR.

@dhwed
Copy link
Contributor

dhwed commented Dec 18, 2017

I saw this assert at 518e59b last Friday, which was before your 351d06b restructuring.

@cartermp
Copy link
Contributor Author

Closing as this was not reliable and I haven't seen it lately

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

No branches or pull requests

2 participants