DynamoDS / DynamoRevit

Dynamo Libraries for Revit
https://dynamobim.org
338 stars 188 forks source link

Crash report from Dynamo 2.3.0.5885 #2612

Open LuisaCPBR opened 4 years ago

LuisaCPBR commented 4 years ago

Issue Description

Please fill in the following information to help us reproduce the issue:

I was basically trying to set project information parameters without opening the Revit Files immagine

Like this: https://forum.dynamobim.com/t/open-files-from-a-directory-and-change-a-parameter-then-re-save-the-file/31326/9

What did you do?

after I disconected

Batch Set project parameters on Backgroud.zip

"ʳʰʸᵗʰᵐ|Applications.OpenDocumentFile" Dynamo crashed

What did you expect to see?

I expected to be able to change the project information parameters without having to open each and every file

What did you see instead?

(Fill in here)

What packages or external references (if any) were used?

Orchid GeniusLoci Rhythm BumbleBee

Stack Trace


Unable to locate managed object for given dsObject.

   at ProtoFFI.CLRObjectMarshaler.CreateCLRObject(StackValue dsObject, Context context, Interpreter dsi, Type type)
   at ProtoFFI.CLRObjectMarshaler.UnMarshal(StackValue dsObject, Context context, Interpreter dsi, Type expectedCLRType)
   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.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.Heap.GCDisposeObject(StackValue svPtr, Executive exe)
   at ProtoCore.DSASM.Heap.Sweep()
   at ProtoCore.DSASM.Heap.SingleStep(Boolean forceGC)
   at ProtoCore.DSASM.Heap.FullGC(IEnumerable`1 gcroots, Executive exe)
   at ProtoScript.Runners.LiveRunner.ApplyUpdate()
   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()

---
OS: `Microsoft Windows NT 10.0.18363.0`
CLR: `4.0.30319.42000`
Dynamo: `2.3.0.5885`
aparajit-pratap commented 4 years ago

@LuisaCPBR you mentioned you got the crash after you disconnected? Which node did you try to disconnect?

LuisaCPBR commented 4 years ago

Yes, after I disconnected "ʳʰʸᵗʰᵐ|Applications.OpenDocumentFile" Dynamo crashed

aparajit-pratap commented 4 years ago

@johnpierson any insights here or is it a Dynamo issue you think?

johnpierson commented 4 years ago

Short Version: Primarily a Dynamo issue regarding wrappers for Documents.


Long Version:

This is documented here, https://github.com/DynamoDS/DynamoRevit/issues/2582 and referenced in the Rhythm GitHub page here, https://github.com/johnpierson/RhythmForDynamo#known-issues.

Basically, you need to run in manual run mode and once you close a background document, you must close and reopen Dynamo for the next run.

Background opening documents is something Dynamo was never meant to do, but I found out that it mostly works if you are careful.

For quite some time I have been considering dropping those nodes though because the Dynamo team doesn't seem to want to prioritize giving Autodesk.Revit.DB.Document any element wrappers. 😞


@LuisaCPBR I would say to make sure you are in manual run mode or use Dynamo player for those workflows.

Amoursol commented 4 years ago

@ZiyunShang @AndyDu1985 - Is it possible to do a pass on Element Wrappers as future DynamoRevit work? There are a bunch missing inside of Dynamo, including the Document class that @johnpierson mentions above.

AndyDu1985 commented 4 years ago

Elements are those that derived from Autodesk.Revit.DB.Element, but Documentis not derived from it, so they are different. I will take a look at the Element Wrappers to see if it can also works on Document.

aparajit-pratap commented 4 years ago

@LuisaCPBR I was unable to reproduce the crash with your graph. Of course, I don't have the necessary input files you're using in your graph but I tried it with an arbitrary .rvt file and was unable to reproduce. It would help if you or @johnpierson could give clearer reproducible steps so that we can add guards in the Dynamo VM to avoid the crash. Thanks!

johnpierson commented 4 years ago

@aparajit-pratap

Steps to Reproduce:

aparajit-pratap commented 4 years ago

The stack trace I was able to reproduce using the steps above seems to be slightly different from the one from @LuisaCPBR. In any case, it seems that there is little that can be done on the Dynamo side. I would defer to the Dynamo 4 Revit team to fix at their end as the exception is thrown from Revit functions. @Amoursol could you move this issue to DynamoRevit repo?

Amoursol commented 4 years ago

@aparajit-pratap - Indeed, we can send across to D4R.

AndyDu1985 commented 4 years ago

In this case, seems the Document is become invalid. Could you check if the exception can be catched? @ZiyunShang

johnpierson commented 4 years ago

FWIW. these nodes will be removed from a very soon Rhythm release.

image the message folks will receive for a while


I simply cannot support them any longer without any help from the Dynamo team on this. It is unfortunate for the community to not have these kinds of nodes available in Rhythm anymore. But the overhead is far too much for me to absorb. It has become increasingly apparent that these kinds of interactions (background documents) are not a priority. My main suggestion to any user who is reading this is to revert to just using one python node for the entire workflow with open/close embedded within it as I mentioned here