Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

[Find all references] Does not work on a large solution #822

Closed
vasily-kirichenko opened this issue Nov 4, 2014 · 6 comments
Closed

[Find all references] Does not work on a large solution #822

vasily-kirichenko opened this issue Nov 4, 2014 · 6 comments

Comments

@vasily-kirichenko
Copy link
Contributor

[VFPT][Information 10:30:39 AM] Trying to find symbol 'val toHex' declared at 'L:\stash\klsrl.core\Source\KlSrl.FSharp.Utils\Collections.fs' from current file 'L:\stash\klsrl.core\Source\KlSrl.FSharp.Utils\Collections.fs'...
[VFPT][Error 10:30:41 AM] The following exception: System.ArgumentException: mkTypeDefOrRefOrSpecTag
Parameter name: x
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.BinaryConstants.mkTypeDefOrRefOrSpecTag(Int32 x)
   at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.seekReadInterfaceImplRowUncached@1247.Invoke(Int32 arg00@)
   at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.readTaggedIdx[a](FSharpFunc`2 f, Int32 nbits, Boolean big, InputChannel is)
   at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.seekReadInterfaceImplRowUncached(FSharpRef`1 ctxtH, Int32 idx)
   at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.ctxt@3994-8.Invoke(Int32 idx)
   at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.seekReadIndexedRows$cont@927[a,b,c](FSharpFunc`2 rowReader, FSharpFunc`2 rowConverter, Int32 numRows, FSharpFunc`2 keyFunc, FSharpFunc`2 keyComparer, Unit unitVar)
   at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.seekReadIndexedRows[a,b,c](Int32 numRows, FSharpFunc`2 rowReader, FSharpFunc`2 keyFunc, FSharpFunc`2 keyComparer, Boolean binaryChop, FSharpFunc`2 rowConverter)
   at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.seekReadInterfaceImpls(ILReaderContext ctxt, Int32 numtypars, Int32 tidx)
   at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.rest@1838.Invoke(Unit unitVar)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at Microsoft.FSharp.Compiler.Import.entities@431-2.Invoke(Tuple`2 tupledArg)
   at Microsoft.FSharp.Compiler.Import.multisetDiscriminateAndMap@377.GenerateNext(IEnumerable`1& next)
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at Microsoft.FSharp.Compiler.Import.multisetDiscriminateAndMap[Key,Value,a](FSharpFunc`2 nodef, FSharpFunc`2 tipf, FSharpList`1 items)
   at Microsoft.FSharp.Compiler.Import.ImportILTypeDefList[a](FSharpFunc`2 amap, range m, CompilationPath cpath, FSharpList`1 enc, FSharpList`1 items)
   at Microsoft.FSharp.Compiler.Import.modty@429.Invoke(Unit unitVar)
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at Microsoft.FSharp.Compiler.Tast.Entity.get_DemangledModuleOrNamespaceName()
   at Microsoft.FSharp.Compiler.Nameres.modrefsMap@665.Invoke(EntityRef modref)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.NameMapModule.ofKeyedList@827.Invoke(a x, FSharpMap`2 acc)
   at Microsoft.FSharp.Collections.ListModule.FoldBack[T,TState](FSharpFunc`2 folder, FSharpList`1 list, TState state)
   at Microsoft.FSharp.Compiler.Nameres.AddModuleOrNamespaceRefsToNameEnv(TcGlobals g, ImportMap amap, range m, Boolean root, AccessorDomain ad, NameResolutionEnv nenv, FSharpList`1 modrefs)
   at Microsoft.FSharp.Compiler.Nameres.AddModuleOrNamespaceContentsToNameEnv(TcGlobals g, ImportMap amap, AccessorDomain ad, range m, NameResolutionEnv nenv, EntityRef modref)
   at Microsoft.FSharp.Compiler.Nameres.AddModulesAndNamespacesContentsToNameEnv@719.Invoke(EntityRef modref, NameResolutionEnv acc)
   at Microsoft.FSharp.Collections.ListModule.FoldBack[T,TState](FSharpFunc`2 folder, FSharpList`1 list, TState state)
   at Microsoft.FSharp.Compiler.TypeChecker.ModifyNameResEnv(FSharpFunc`2 f, TcEnv env)
   at Microsoft.FSharp.Compiler.TypeChecker.OpenModulesOrNamespaces(TcResultsSink tcSink, TcGlobals g, ImportMap amap, range scopem, TcEnv env, FSharpList`1 mvvs)
   at Microsoft.FSharp.Compiler.TypeChecker.TcOpenDecl(TcResultsSink tcSink, TcGlobals g, ImportMap amap, range m, range scopem, TcEnv env, FSharpList`1 longId)
   at Microsoft.FSharp.Compiler.TypeChecker.TcModuleOrNamespaceElement@15028-1.Invoke(Unit unitVar)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.catch@654.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ReraiseIfWatsonable(Exception exn)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.ErrorRecovery(ErrorLogger x, Exception exn, range m)
   at Microsoft.FSharp.Compiler.TypeChecker.TcModuleOrNamespaceElement@15027-18.Invoke(Exception _arg3)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.catch@654.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ReraiseIfWatsonable(Exception exn)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.ErrorRecovery(ErrorLogger x, Exception exn, range m)
   at Microsoft.FSharp.Compiler.TypeChecker.TcModuleOrNamespaceElement@15027-18.Invoke(Exception _arg3)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.catch@654.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ReraiseIfWatsonable(Exception exn)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.ErrorRecovery(ErrorLogger x, Exception exn, range m)
   at Microsoft.FSharp.Compiler.TypeChecker.TcModuleOrNamespaceElement@15027-18.Invoke(Exception _arg3)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.catch@654.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ReraiseIfWatsonable(Exception exn)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.ErrorRecovery(ErrorLogger x, Exception exn, range m)
   at Microsoft.FSharp.Compiler.Build.TypecheckOneInputEventually@5211-12.Invoke(Exception _arg4)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.bind@645.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.loop@629-20[a](Int64 timeShareInMilliseconds, FSharpFunc`2 runner, Stopwatch sw, Eventually`1 e)
   at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library.EventuallyModule.runTimeShare@626-1.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.IncrementalFSharpBuild.clo@1408-187.Invoke(FSharpFunc`2 f)
   at Microsoft.FSharp.Compiler.IncrementalFSharpBuild.-ctor@1543-61.Invoke(TypeCheckAccumulator tcAcc, Tuple`4 tupledArg)
   at Microsoft.FSharp.Compiler.IncrementalBuild.Vector.BoxingScanLeft@891-1.Invoke(a a, b i)
   at Microsoft.FSharp.Compiler.IncrementalBuild.Action.Execute()
   at Microsoft.FSharp.Compiler.IncrementalBuild.newBt@758.Invoke(Action action, PartialBuild bt)
   at Microsoft.FSharp.Compiler.IncrementalBuild.Scan@522.Invoke(Int32 slot)
   at Microsoft.FSharp.Collections.ListModule.TryPick[T,TResult](FSharpFunc`2 chooser, FSharpList`1 list)
   at Microsoft.FSharp.Compiler.IncrementalBuild.VisitVector@508-1[acc](PartialBuild bt, FSharpFunc`2 actionFunc, Dictionary`2 seen, FSharpOption`1 optSlot, VectorBuildRule ve, acc acc)
   at Microsoft.FSharp.Compiler.IncrementalBuild.Eval@752(Target target, PartialBuild bt, Int32 gen)
   at Microsoft.FSharp.Compiler.IncrementalFSharpBuild.IncrementalBuilder.EvalAndKeepOutput(INode output, FSharpOption`1 optSlot)
   at Microsoft.FSharp.Compiler.IncrementalFSharpBuild.build@1672-8.Invoke(FSharpOption`1 optSlot)
   at Microsoft.FSharp.Compiler.IncrementalFSharpBuild.IncrementalBuilder.GetCheckResultsAndImplementationsForProject()
   at Microsoft.FSharp.Compiler.SourceCodeServices.BackgroundCompiler.ParseAndCheckProjectImpl(FSharpProjectOptions options)
   at <StartupCode$FSharp-Compiler-Service>.$Service.ParseAndCheckProject@2156.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.SourceCodeServices.Reactor.EnqueueAndAwaitOpAsync@203.Invoke(Unit unitVar0) occurs for file 'L:\stash\klsrl.core\Source\KlSrl.FSharp.Utils\Collections.fs' and options '{ProjectFileName =

And Find All Refs returns nothing. I'm tired with this bug :(

@dsyme
Copy link
Contributor

dsyme commented Nov 5, 2014

Hi @vasily-kirichenko

This bug looks like either a badly formed .NET binary, or else a .NET binary has been read while it is being written. It's also possible it could be a bug in ilread.fs though that seems unlikely.

Finding out which will involve one or all of

  • a consistent repro, preferably one where we can snapshot the .NET binary being read
  • some extra logging, particularly in ilread.fs
  • some careful review of the code in ilread.fs that reads binaries into memory

@dsyme
Copy link
Contributor

dsyme commented Nov 5, 2014

OK, I can repro this consistently now. It seems likely like there is a bug in the IL binary reader - at least when using memory channels for

"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\mscorlib.dll"

I'll loko into it

@vasily-kirichenko
Copy link
Contributor Author

I'm very excited to hear this :) Thanks a lot!

@dsyme
Copy link
Contributor

dsyme commented Nov 5, 2014

I've determined the problem here, and will work on a fix

@vasily-kirichenko
Copy link
Contributor Author

Thanks! I'll install VFPT built from current master and check that the bug does not appear any more. It can take some time, so I'm not closing this issue right now.

@dungpa
Copy link
Contributor

dungpa commented Nov 6, 2014

Closing as being fixed upstream.

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

No branches or pull requests

3 participants