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

Drag/drop causes crashes #324

Closed
jonko0493 opened this issue Jan 14, 2024 · 4 comments · Fixed by #335
Closed

Drag/drop causes crashes #324

jonko0493 opened this issue Jan 14, 2024 · 4 comments · Fixed by #335
Assignees
Labels
bug Something isn't working critical Used for critical bugs (things that are causing crashes) eto change needed Issues that are blocked on changes required in the underlying Eto.Forms framework windows Used on issues that affect Windows specifically
Milestone

Comments

@jonko0493
Copy link
Member

1/14/2024 1:42:58 AM -08:00 - SERIAL LOOPS CRASH: BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.

   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
   at System.Windows.DataObject.SaveObjectToHandle(IntPtr handle, Object data, Boolean doNotReallocate)
   at System.Windows.DataObject.GetDataIntoOleStructsByTypeMedimHGlobal(String format, Object data, STGMEDIUM& medium, Boolean doNotReallocate)
   at System.Windows.DataObject.GetDataIntoOleStructs(FORMATETC& formatetc, STGMEDIUM& medium, Boolean doNotReallocate)
   at System.Windows.DataObject.System.Runtime.InteropServices.ComTypes.IDataObject.GetData(FORMATETC& formatetc, STGMEDIUM& medium)
   at System.Windows.WpfDataObjectExtensions.SetDataEx(IDataObject dataObject, String format, Object data)
   at Eto.Wpf.Forms.DataObjectHandler`2.SetString(String value, String type)
   at Eto.Forms.DataObject.SetString(String value, String type)
   at Eto.Forms.DataObject.SetObject(Object value, String type)
   at SerialLoops.Controls.ScriptCommandSectionTreeGridView.OnMouseMove(Object sender, MouseEventArgs e) in C:\Users\User\source\repos\SerialLoops\src\SerialLoops\Controls\ScriptCommandSectionTree.cs:line 216
   at Eto.Forms.Control.Callback.OnMouseMove(Control widget, MouseEventArgs e)
   at Eto.Wpf.Forms.WpfFrameworkElement`3.HandleMouseMove(Object sender, MouseEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   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.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.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 Eto.Wpf.Forms.ApplicationHandler.Run()
   at Eto.Forms.Application.Run(Form mainForm)
   at SerialLoops.Wpf.Program.Main(String[] args) in C:\Users\User\source\repos\SerialLoops\src\SerialLoops.Wpf\Program.cs:line 56

This is Eto's fault, not ours. Their drag/drop library uses the BinaryFormatter class, which is known to be insecure and so .NET has apparently started disabling its functions in later versions of the runtime. I have filed picoe/Eto#2607 to request that they fix this. This also makes upgrading to Eto latest an even greater priority.

@jonko0493 jonko0493 added bug Something isn't working critical Used for critical bugs (things that are causing crashes) labels Jan 14, 2024
@jonko0493 jonko0493 added this to the v0.3 milestone Jan 14, 2024
@jonko0493
Copy link
Member Author

Created picoe/Eto#2608 to try to get this fixed.

@jonko0493 jonko0493 moved this to Blocked in Serial Loops Jan 14, 2024
@jonko0493 jonko0493 moved this from Blocked to In PR in Serial Loops Jan 14, 2024
@jonko0493
Copy link
Member Author

The Eto folks have accepted the change. We should move to an upstream preview version until they do another release.

@jonko0493 jonko0493 moved this from In PR to In Progress in Serial Loops Jan 18, 2024
@jonko0493 jonko0493 self-assigned this Jan 18, 2024
@jonko0493 jonko0493 added the windows Used on issues that affect Windows specifically label Jan 24, 2024
@jonko0493
Copy link
Member Author

Looking more closely at the stack trace after upgrading to the latest Eto and finding that it still crashes, this is a Windows-specific bug as this lib lives in the Wpf project. What's more, while I fixed the BinaryFormatter in DragDropLib.cs, there are still underlying references to BinaryFormatter in some of the methods used in DragDropLib.Wpf.cs which is why the crashes are still occurring.

@jonko0493 jonko0493 added eto-change-needed eto change needed Issues that are blocked on changes required in the underlying Eto.Forms framework and removed eto-change-needed labels Jan 24, 2024
@jonko0493 jonko0493 moved this from In Progress to In PR in Serial Loops Jan 24, 2024
@jonko0493
Copy link
Member Author

Ultimately, this is going to have to be solved at a dotnet/wpf level, so we'll just disable the crash in the meantime.

@github-project-automation github-project-automation bot moved this from In PR to Done in Serial Loops Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical Used for critical bugs (things that are causing crashes) eto change needed Issues that are blocked on changes required in the underlying Eto.Forms framework windows Used on issues that affect Windows specifically
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant