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

Crash when entering three dots into a code block node inside a custom node workspace #8911

Closed
Dewb opened this issue Jun 4, 2018 · 4 comments
Labels
2.x Issues related to 2.x versions of Dynamo. crash Related to a crash. error/warning/crash Issues mentioning a Dynamo error, warning or crash message tracked

Comments

@Dewb
Copy link
Contributor

Dewb commented Jun 4, 2018

Dynamo version

2.1.0.4395 (local build from Github head)

Operating system

Windows 10

What did you do?

  1. Run DynamoSandbox
  2. New Custom Node, enter any name/description/category, hit OK
  3. Add Code Block node with contents a = 1..10;
  4. Click back into CB node and change contents to a = 1...10; (adding a third dot)
  5. Click out of the CB node
  6. Node turns red and Dynamo crashes

Crash is only reproducible inside custom node workspaces, not a Home workspace.

What did you expect to see?

CB node should show the red error state, but Dynamo should not crash

What did you see instead?

The crash dialog with this exception:

Exception of type 'ProtoCore.Exceptions.CompilerInternalException' was thrown.

   at Dynamo.Engine.CodeGeneration.AstBuilder.CompileToAstNodes(NodeModel node, List`1 resultList, CompilationContext context, Boolean verboseLogging) in D:\dynamo\dynamo\src\DynamoCore\Engine\CodeGeneration\AstBuilder.cs:line 286
   at Dynamo.Engine.CodeGeneration.AstBuilder.CompileToAstNodes(IEnumerable`1 nodes, CompilationContext context, Boolean verboseLogging) in D:\dynamo\dynamo\src\DynamoCore\Engine\CodeGeneration\AstBuilder.cs:line 414
   at Dynamo.Engine.CodeGeneration.AstBuilder.CompileCustomNodeDefinition(Guid functionId, IEnumerable`1 returnKeys, String functionName, IEnumerable`1 funcBody, IEnumerable`1 outputNodes, IEnumerable`1 parameters, Boolean verboseLogging) in D:\dynamo\dynamo\src\DynamoCore\Engine\CodeGeneration\AstBuilder.cs:line 440
   at Dynamo.Engine.EngineController.GenerateGraphSyncDataForCustomNode(IEnumerable`1 nodes, CustomNodeDefinition definition, Boolean verboseLogging) in D:\dynamo\dynamo\src\DynamoCore\Engine\EngineController.cs:line 312
   at Dynamo.Models.DynamoModel.UpdateCustomNodeDefinition(CustomNodeDefinition definition) in D:\dynamo\dynamo\src\DynamoCore\Models\DynamoModel.cs:line 1314
   at Dynamo.Core.CustomNodeManager.OnDefinitionUpdated(CustomNodeDefinition obj) in D:\dynamo\dynamo\src\DynamoCore\Core\CustomNodeManager.cs:line 108
   at System.Action.Invoke()
   at Dynamo.Graph.Workspaces.CustomNodeWorkspaceModel.OnDefinitionUpdated() in D:\dynamo\dynamo\src\DynamoCore\Graph\Workspaces\CustomNodeWorkspaceModel.cs:line 278
   at System.Action`1.Invoke(T obj)
   at Dynamo.Graph.Nodes.NodeModel.OnNodeModified(Boolean forceExecute) in D:\dynamo\dynamo\src\DynamoCore\Graph\Nodes\NodeModel.cs:line 1194
   at Dynamo.Graph.Nodes.NodeModel.ConnectorsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in D:\dynamo\dynamo\src\DynamoCore\Graph\Nodes\NodeModel.cs:line 1116
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at Dynamo.Graph.Connectors.ConnectorModel.Connect(PortModel p) in D:\dynamo\dynamo\src\DynamoCore\Graph\Connectors\ConnectorModel.cs:line 183
   at Dynamo.Graph.Connectors.ConnectorModel.Make(NodeModel start, NodeModel end, Int32 startIndex, Int32 endIndex, Nullable`1 guid) in D:\dynamo\dynamo\src\DynamoCore\Graph\Connectors\ConnectorModel.cs:line 82
   at Dynamo.Graph.Nodes.CodeBlockNodeModel.LoadAndCreateConnectors(OrderedDictionary inportConnections, OrderedDictionary outportConnections, SaveContext context) in D:\dynamo\dynamo\src\DynamoCore\Graph\Nodes\CodeBlockNode.cs:line 1009
   at Dynamo.Graph.Nodes.CodeBlockNodeModel.SetCodeContent(String newCode, ElementResolver workspaceElementResolver) in D:\dynamo\dynamo\src\DynamoCore\Graph\Nodes\CodeBlockNode.cs:line 263
   at Dynamo.Graph.Nodes.CodeBlockNodeModel.UpdateValueCore(UpdateValueParams updateValueParams) in D:\dynamo\dynamo\src\DynamoCore\Graph\Nodes\CodeBlockNode.cs:line 323
   at Dynamo.Graph.Workspaces.WorkspaceModel.UpdateModelValue(IEnumerable`1 modelGuids, String propertyName, String value) in D:\dynamo\dynamo\src\DynamoCore\Graph\Workspaces\WorkspaceModel.cs:line 1537
   at Dynamo.Models.DynamoModel.UpdateModelValueImpl(UpdateModelValueCommand command) in D:\dynamo\dynamo\src\DynamoCore\Models\DynamoModelCommands.cs:line 525
   at Dynamo.Models.DynamoModel.ExecuteCommand(RecordableCommand command) in D:\dynamo\dynamo\src\DynamoCore\Models\DynamoModelCommands.cs:line 38
   at Dynamo.UI.Controls.CodeCompletionEditor.UpdateNodeValue(String property) in D:\dynamo\dynamo\src\DynamoCoreWpf\Views\CodeCompletion\CodeCompletionEditor.xaml.cs:line 145
   at Dynamo.UI.Controls.CodeBlockEditor.CommitChanges(UndoRedoRecorder recorder) in D:\dynamo\dynamo\src\DynamoCoreWpf\Views\CodeBlocks\CodeBlockEditor.cs:line 159
   at Dynamo.UI.Controls.CodeBlockEditor.OnCommitChange() in D:\dynamo\dynamo\src\DynamoCoreWpf\Views\CodeBlocks\CodeBlockEditor.cs:line 111
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at ICSharpCode.AvalonEdit.Editing.TextArea.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata)
   at System.Windows.DependencyObject.ClearValue(DependencyPropertyKey key)
   at System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.Input.FocusManager.SetFocusedElement(DependencyObject element, IInputElement value)
   at System.Windows.Input.KeyboardNavigation.UpdateFocusedElement(DependencyObject focusTarget)
   at System.Windows.FrameworkElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
   at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
   at System.Windows.UIElement.Focus()
   at Dynamo.Controls.DynamoView.OnRequestReturnFocusToView() in D:\dynamo\dynamo\src\DynamoCoreWpf\Views\Core\DynamoView.xaml.cs:line 201
   at Dynamo.ViewModels.DynamoViewModel.OnRequestReturnFocusToView() in D:\dynamo\dynamo\src\DynamoCoreWpf\ViewModels\Core\DynamoViewModelEvents.cs:line 147
   at Dynamo.ViewModels.DynamoViewModel.ExecuteCommand(RecordableCommand command) in D:\dynamo\dynamo\src\DynamoCoreWpf\Commands\DynamoCommands.cs:line 79
   at Dynamo.ViewModels.WorkspaceViewModel.StateMachine.InitiateWindowSelectionSequence() in D:\dynamo\dynamo\src\DynamoCoreWpf\ViewModels\Core\StateMachine.cs:line 945
   at Dynamo.ViewModels.WorkspaceViewModel.StateMachine.HandleLeftButtonDown(Object sender, MouseButtonEventArgs e) in D:\dynamo\dynamo\src\DynamoCoreWpf\ViewModels\Core\StateMachine.cs:line 613
   at Dynamo.Views.WorkspaceView.OnMouseLeftButtonDown(Object sender, MouseButtonEventArgs e) in D:\dynamo\dynamo\src\DynamoCoreWpf\Views\Core\WorkspaceView.xaml.cs:line 621
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at DynamoSandbox.DynamoCoreSetup.RunApplication(Application app) in D:\dynamo\dynamo\src\DynamoSandbox\DynamoCoreSetup.cs:line 60
@jnealb
Copy link
Collaborator

jnealb commented Jun 5, 2018

@Dewb Thank you: this is tracked with QNTM-4425 and is in the 2.1 backlog.

@jnealb jnealb closed this as completed Jun 5, 2018
@johnpierson johnpierson added 2.x Issues related to 2.x versions of Dynamo. crash Related to a crash. tracked labels Nov 20, 2018
@aparajit-pratap
Copy link
Contributor

Fixed in #9528. Closing.

@horatiubota horatiubota added the error/warning/crash Issues mentioning a Dynamo error, warning or crash message label Nov 11, 2019
@aparajit-pratap
Copy link
Contributor

aparajit-pratap commented Nov 11, 2019

Reopening as the issue is found to be still reproducible.

@aparajit-pratap
Copy link
Contributor

PR: #10127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues related to 2.x versions of Dynamo. crash Related to a crash. error/warning/crash Issues mentioning a Dynamo error, warning or crash message tracked
Projects
None yet
Development

No branches or pull requests

6 participants