question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sending text or commands via Torch GUI chat causes application crash.

See original GitHub issue

Torch Version: 1.1.207.007 SE Version: 1.182.019

Expected Behavior

The chat text should have been submitted and displayed to players on the server and in the console.

Observed Behavior

Torch crashed with lots of angry red text in the console. (console text pasted in the last section here)

Steps to Reproduce

  1. Run Torch and start a server.
  2. In the “Chat/Players” tab, put the cursor in the text field to the left of the “Send” button.
  3. Type some text or enter a command.
  4. Press the [Enter] key on the keyboard or click the “Send” button.

Other Information

Stacktrace: 20:48:02.3177 [FATAL] Torch: System.InvalidCastException: Unable to cast object of type ‘Microsoft.Windows.Themes.ClassicBorderDecorator’ to type ‘System.Windows.Controls.Border’. at Torch.Server.ChatControl.ChatHistory_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at Torch.ObservableList`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Torch.Managers.MultiplayerManager.SendMessage(String message, String author, Int64 playerId, String font) at Torch.Server.ChatControl.OnMessageEntered() at Torch.Server.ChatControl.Message_OnKeyDown(Object sender, KeyEventArgs 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.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey) at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled) at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers) at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param) 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 System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled) at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.ShowDialog() at Torch.Server.Program.RunServer(TorchConfig config) at Torch.Server.Program.Main(String[] args)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Varaxiancommented, Jul 28, 2017

Yup. Doesn’t matter. Run the compatibility tool.

On Jul 28, 2017 2:04 PM, “kurazarrh” notifications@github.com wrote:

@Varaxian https://github.com/varaxian I’m already running the .exe with the “Run as Administrator” box checked (which is what running the compatibility tool for access permissions will turn on), and I’ve tried running it in compatibility mode for everything available in the list: WinServ2008R2SP1, Vista, VistaSP1, VistaSP2, and Win7.

I’ve been doing some more digging, and it does appear to be related to making a call to the window manager. The important part of that stacktrace is right at the top:

System.InvalidCastException: Unable to cast object of type ‘Microsoft.Windows.Themes.ClassicBorderDecorator’ to type ‘System.Windows.Controls.Border’.

I’m thinking this was developed on a Win10 machine that supports that typecast action, whereas older OSes may not. Either that, or the issue lies in the Server version of the OS, which has a less-advanced window theme manager.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TorchAPI/Torch/issues/51#issuecomment-318737251, or mute the thread https://github.com/notifications/unsubscribe-auth/AXurF5HpA5GLcXKxnwDPig2kFJaB-ph8ks5sSjC6gaJpZM4Okqph .

0reactions
Jimmaclecommented, Aug 10, 2017

See #68, it appears to be an issue for people using the Windows Classic theme. Working on a fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Torch is not able to use GPU" : r/StableDiffusion
I tried getting Stable Diffusion running using this guide, but when I try running webui-user.bat, it's giving me this:
Read more >
stabilityai/stable-diffusion · How do I fix this error in the ...
RuntimeError: Couldn't install torch. Command: "C:\Ai\venv\Scripts\python.exe" -m pip install torch==1.12.1+cu113 torchvision==0.13 ...
Read more >
Diagnosing Native Crashes
You can distinguish execute-only memory violations from other crashes by the cause line. You can reproduce an instance of this type of crash...
Read more >
PyTorch 2.0
TorchInductor is a deep learning compiler that generates fast code for multiple accelerators and backends. For NVIDIA and AMD GPUs, it uses OpenAI...
Read more >
Abusing Terminal Emulators with ANSI Escape Characters
We found a way to cause a remote DoS on the terminal client's host. An ANSI escape characters injection vulnerability in OpenShift and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found