Skip to content

Non-cancellable metadata access when importing a DLL #18235

@auduchinok

Description

@auduchinok
System.Exception: Token not available outside of Cancellable computation.
   at <StartupCode$FSharp-Compiler-Service>.$Cancellable.defThunk@1(String msg, Unit unitVar0) in C:\Developer\jetbrains-fsharp\src\Compiler\Utilities\Cancellable.fs:line 15
   at FSharp.Compiler.Cancellable.ensureToken(String msg) in C:\Developer\jetbrains-fsharp\src\Compiler\Utilities\Cancellable.fs:line 14
   at FSharp.Compiler.Cancellable.get_Token() in C:\Developer\jetbrains-fsharp\src\Compiler\Utilities\Cancellable.fs:line 19
   at JetBrains.ReSharper.Plugins.FSharp.FSharpAsyncUtil.UsingReadLockInsideFcs(IShellLocks locks, Action action, Func`1 upToDateCheck) in C:\Developer\resharper-fsharp\ReSharper.FSharp\src\FSharp\FSharp.ProjectModelBase\src\FSharpAsyncUtil.cs:line 40
   at JetBrains.ReSharper.Plugins.FSharp.Shim.AssemblyReader.ProjectFcsModuleReader.readData(FSharpFunc`2 f) in C:\Developer\resharper-fsharp\ReSharper.FSharp\src\FSharp\FSharp.Common\src\Shim\AssemblyReader\ProjectFcsModuleReader.fs:line 142
   at JetBrains.ReSharper.Plugins.FSharp.Shim.AssemblyReader.ProjectFcsModuleReader.FSharp.Compiler.AbstractIL.ILBinaryReader.ILModuleReader.get_ILModuleDef() in C:\Developer\resharper-fsharp\ReSharper.FSharp\src\FSharp\FSharp.Common\src\Shim\AssemblyReader\ProjectFcsModuleReader.fs:line 1358
   at FSharp.Compiler.CompilerImports.TcImports.OpenILBinaryModule(CompilationThreadToken ctok, String fileName, Range m) in C:\Developer\jetbrains-fsharp\src\Compiler\Driver\CompilerImports.fs:line 1635
And this is the stack from the debugger:
$Cancellable.defThunk@1() at C:/Developer/jetbrains-fsharp/src/Compiler/Utilities/Cancellable.fs:line 15
Cancellable.ensureToken() at C:/Developer/jetbrains-fsharp/src/Compiler/Utilities/Cancellable.fs:line 14
Cancellable.get_Token()
FSharpAsyncUtil.UsingReadLockInsideFcs()
ProjectFcsModuleReader.readData()
ProjectFcsModuleReader.FSharp.Compiler.AbstractIL.ILBinaryReader.ILModuleReader.get_ILModuleDef()
CompilerImports.TcImports.OpenILBinaryModule()
CompilerImports.TryRegisterAndPrepareToImportReferencedDll@2265-3.Invoke()
AsyncPrimitives.CallThenInvokeNoHijackCheck<Microsoft.FSharp.Core.FSharpOption<System.Tuple<FSharp.Compiler.CompilerImports.ImportedBinary, Microsoft.FSharp.Core.FSharpFunc<Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Collections.FSharpList<FSharp.Compiler.CompilerImports.AvailableImportedAssembly>>>>, FSharp.Compiler.CompilerConfig.ProjectAssemblyDataResult>()
Trampoline.Execute()
[email protected]()
QueueUserWorkItemCallback.WaitCallback_Context()
ExecutionContext.RunInternal()
ExecutionContext.Run()
QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
ThreadPoolWorkQueue.Dispatch()
_ThreadPoolWaitCallback.PerformWaitCallback()
[Native to Managed Transition]
[Application Domain Transition]
[Native to Managed Transition]

@majocha Could that be of interest for you? 🙂

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions