Slazanger / SMT

Slazanger's Eve Map Tool
MIT License
264 stars 77 forks source link

Attempting to import jump bridges crashes SMT #95

Closed michaelmdresser closed 1 year ago

michaelmdresser commented 2 years ago

I have a list of jump bridges (newline-delimeted) in the form:

<url=showinfo:XXXXX//XXXXXXXXXXXXX>Gate name XXXXX</url>
<url=showinfo:XXXXX//XXXXXXXXXXXXX>Gate name XXXXX</url>
...

When I copy this list into my system clipboard and then attempt to import it into SMT with "Import from clipboard" in the Jump Bridges tab, there is a brief (~1s) pause and then SMT crashes. If I try to copy just one line and import it, the same behavior occurs. I have no Jump Bridges currently imported into SMT. Clearing the bridges before importing does not change the behavior.

Following other instructions I've found, I've also tried importing them in the direct copy-from-chat form, like this:

[XX:XX:XX] Character Name > <url=showinfo:XXXXX//XXXXXXXXXXXXX>Gate name XXXXX</url>

The same behavior occurs (crash after ~1s).

michaelmdresser commented 2 years ago

I am fairly certain I am running SMT v1.11 (the name of the folder on disk is SMT_1.11).

Slazanger commented 2 years ago

can you post the string here that causes the crash

michaelmdresser commented 2 years ago

Trying to import just one, here's what I have in my clipboard:

<url=showinfo:35841//1038476929223>MJ-5F9 » C3J0-O - Jump Gate</url>
Slazanger commented 2 years ago

That imports fine for me, could you grab the .net error event for the crash, if you open up the event viewer in windows, then windows logs -> application, there will be 2 entries at the time it crashed.. can you post the .net error one. Thanks

michaelmdresser commented 2 years ago

I have a theory about what's going wrong. I've been copying these values out of a GUI app running inside WSL. It may be using \n instead of \r\n for line endings. If I copy values from inside a regular Windows app (e.g. my issue comment above or Notepad) the import works.

Here's the .NET error that shows up when I import after copying from the WSL app.

Application: SMT.exe
CoreCLR Version: 6.0.722.32202
.NET Version: 6.0.7
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException (0x800401D3): Data on clipboard is invalid (0x800401D3 (CLIPBRD_E_BAD_DATA))
   at System.Runtime.InteropServices.ComTypes.IDataObject.GetData(FORMATETC& format, STGMEDIUM& medium)
   at System.Windows.DataObject.OleConverter.GetDataFromOleHGLOBAL(String format, DVASPECT aspect, Int32 index)
   at System.Windows.DataObject.OleConverter.GetDataFromBoundOleDataObject(String format, DVASPECT aspect, Int32 index)
   at System.Windows.DataObject.OleConverter.GetData(String format, Boolean autoConvert, DVASPECT aspect, Int32 index)
   at System.Windows.DataObject.OleConverter.GetData(String format, Boolean autoConvert)
   at System.Windows.DataObject.GetData(String format, Boolean autoConvert)
   at System.Windows.Clipboard.GetDataInternal(String format)
   at System.Windows.Clipboard.GetText(TextDataFormat format)
   at SMT.MainWindow.ImportPasteJumpGatesBtn_Click(Object sender, RoutedEventArgs e) in D:\Projects\SMT\SMT\MainWindow.xaml.cs:line 1411
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs 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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs 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.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.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   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.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at XamlGeneratedNamespace.GeneratedApplication.Main()
Slazanger commented 2 years ago

That's a conversion issue by the look of it.. What app are you running under WSL; I'll try it here

michaelmdresser commented 2 years ago

Emacs, running under VcXsrv for native GUI. Getting it set up can be finnicky -- no need to put yourself out over it. I can workaround it by pasting my imports into a Windows-native app and then importing into SMT.

With that said, if you would like to pursue this further I've tried to get as much info as possible. I'd be happy to try a test build because I know reproducing my environment will be needlessly involved.


I found a thing called Clipview that might help. Here's what it shows when I copy a line out of Emacs:

image image

I also tried Free Clipboard Viewer and got the following:

image image image image image

Slazanger commented 1 year ago

this was fixed with 1.21

michaelmdresser commented 5 months ago

Thank you for the support! SMT is awesome