My script tends to process many complicated custom nodes in multi Revit projects using Function Compose and List.Map but it crashes somewhere and returns the crash error: "Virtual machine of Dynamo...". I tested the script on a single project and it does a great job, but it fails if I feed it many projects at a time.
The script crashes.
Orchid, Clockwork for Dynamo, Rhythm, BimorphNodes, and various custom nodes.
The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone.
at validateNativeInstance(Void* ptr)
at Autodesk.Revit.RevitDBAPIManagedWeakPointer<ADocument>.getValidPtr()
at Autodesk.Revit.DB.Document.GetHashCode()
at System.Collections.Generic.Dictionary`2.Remove(TKey key)
at ProtoFFI.CLRObjectMarshaler.OnDispose(StackValue dsObject, Context context, Interpreter dsi)
at ProtoFFI.DisposeFunctionPointer.Execute(Context c, Interpreter dsi, List`1 s)
at ProtoCore.Lang.FFIFunctionEndPoint.Execute(Context c, List`1 formalParameters, StackFrame stackFrame, RuntimeCore runtimeCore)
at ProtoCore.CallSite.DispatchDispose(StackValue stackValue, RuntimeCore runtimeCore)
at ProtoCore.DSASM.Executive.CallDispose(ProcedureNode fNode, StackValue svThisPtr, Int32 classIndex)
at ProtoCore.DSASM.Heap.GCDisposeObject(StackValue svPtr, Executive exe)
at ProtoCore.DSASM.Heap.Sweep()
at ProtoCore.DSASM.Heap.SingleStep(Boolean forceGC)
at ProtoCore.DSASM.Executive.POP_helper(Instruction instruction, Int32& blockId, Int32& dimensions)
at ProtoCore.DSASM.Executive.POP_Handler(Instruction instruction)
at ProtoCore.DSASM.Executive.Execute(Int32 exeblock, Int32 entry, Language language)
at ProtoCore.DSASM.Executive.Execute(Int32 exeblock, Int32 entry, List`1 breakpoints, Language language)
at ProtoCore.DSASM.Interpreter.Run(Int32 codeblock, Int32 entry, Language lang, List`1 breakpoints)
at ProtoCore.Lang.JILFunctionEndPoint.Execute(Context c, List`1 formalParameters, StackFrame stackFrame, RuntimeCore runtimeCore)
at ProtoCore.CallSite.ExecWithZeroRI(List`1 functionEndPoint, Context c, List`1 formalParameters, StackFrame stackFrame, RuntimeCore runtimeCore, SingleRunTraceData previousTraceData, SingleRunTraceData newTraceData, FunctionEndPoint finalFep)
at ProtoCore.CallSite.ExecWithRISlowPath(List`1 functionEndPoint, Context c, List`1 formalParameters, List`1 replicationInstructions, StackFrame stackFrame, RuntimeCore runtimeCore, SingleRunTraceData previousTraceData, SingleRunTraceData newTraceData, FunctionEndPoint finalFunctionEndPoint)
at ProtoCore.CallSite.ExecWithRISlowPath(List`1 functionEndPoint, Context c, List`1 formalParameters, List`1 replicationInstructions, StackFrame stackFrame, RuntimeCore runtimeCore, SingleRunTraceData previousTraceData, SingleRunTraceData newTraceData, FunctionEndPoint finalFunctionEndPoint)
at ProtoCore.CallSite.Execute(List`1 functionEndPoint, Context c, List`1 formalParameters, List`1 replicationInstructions, StackFrame stackFrame, RuntimeCore runtimeCore)
at ProtoCore.CallSite.DispatchNew(Context context, List`1 arguments, List`1 partialReplicationGuides, DominantListStructure domintListStructure, StackFrame stackFrame, RuntimeCore runtimeCore)
at ProtoCore.Lang.FunctionPointerEvaluator.Evaluate(List`1 args, StackFrame stackFrame)
at ProtoCore.Lang.ArrayUtilsForBuiltIns.Evaluate(StackValue function, StackValue parameters, StackValue unpackParams, Interpreter runtime, StackFrame stackFrame)
at ProtoCore.Lang.BuiltInFunctionEndPoint.Execute(Context c, List`1 formalParameters, StackFrame stackFrame, RuntimeCore runtimeCore)
at ProtoCore.CallSite.ExecWithZeroRI(List`1 functionEndPoint, Context c, List`1 formalParameters, StackFrame stackFrame, RuntimeCore runtimeCore, SingleRunTraceData previousTraceData, SingleRunTraceData newTraceData, FunctionEndPoint finalFep)
at ProtoCore.CallSite.Execute(List`1 functionEndPoint, Context c, List`1 formalParameters, List`1 replicationInstructions, StackFrame stackFrame, RuntimeCore runtimeCore)
at ProtoCore.CallSite.DispatchNew(Context context, List`1 arguments, List`1 partialReplicationGuides, DominantListStructure domintListStructure, StackFrame stackFrame, RuntimeCore runtimeCore)
at ProtoCore.DSASM.Executive.Callr(Int32 blockDeclId, Int32 functionIndex, Int32 classIndex, Boolean& explicitCall, Boolean isDynamicCall, Boolean hasDebugInfo)
at ProtoCore.DSASM.Executive.CALLR_Handler(Instruction instruction)
at ProtoCore.DSASM.Executive.Execute(Int32 exeblock, Int32 entry, Language language)
at ProtoCore.DSASM.Executive.Execute(Int32 exeblock, Int32 entry, List`1 breakpoints, Language language)
at ProtoCore.DSASM.Executive.BounceUsingExecutive(Executive executive, Int32 exeblock, Int32 entry, StackFrame stackFrame, Int32 locals, Boolean fepRun, Executive exec, List`1 breakpoints)
at ProtoScript.Runners.ProtoScriptRunner.ExecuteLive(Core core, RuntimeCore runtimeCore)
at ProtoScript.Runners.LiveRunner.Execute(Boolean isCodeCompiled)
at ProtoScript.Runners.LiveRunner.CompileAndExecute(List`1 astList)
at ProtoScript.Runners.LiveRunner.CompileAndExecuteForDeltaExecution(List`1 astList)
at ProtoScript.Runners.LiveRunner.SynchronizeInternal(GraphSyncData syncData)
at ProtoScript.Runners.LiveRunner.UpdateGraph(GraphSyncData syncData)
at Dynamo.Scheduler.UpdateGraphAsyncTask.HandleTaskExecutionCore()
at Dynamo.Scheduler.AsyncTask.Execute()
Issue Description
My script crashes when I try to feed it with multi projects. I put my script in this drive link: https://drive.google.com/file/d/1ULbP7_SjCgQPPyNBk6hdwnlohWo-f0uy/view?usp=drive_link
Dynamo version
Dynamo:
2.13.1.3887Operating system
OS:
Microsoft Windows NT 10.0.22621.0What did you do?
My script tends to process many complicated custom nodes in multi Revit projects using Function Compose and List.Map but it crashes somewhere and returns the crash error: "Virtual machine of Dynamo...". I tested the script on a single project and it does a great job, but it fails if I feed it many projects at a time.
What did you expect to see?
I want the script works smoothly on multi-project without crashing
What did you see instead?
The script crashes.
What packages or external references (if any) were used?
Orchid, Clockwork for Dynamo, Rhythm, BimorphNodes, and various custom nodes.
Stack Trace
CLR:
4.0.30319.42000