markdwags / Razor

Razor is a free tool designed to help with simple tasks while playing Ultima Online.
https://www.razorce.com
GNU General Public License v3.0
139 stars 97 forks source link

[BUG] UOClassic: Popout script editor crashes and becomes unusable #188

Closed gdavis closed 2 years ago

gdavis commented 2 years ago

Summary On UO Outlands, if you use the popout script editor, and let a script run for a long time, the editor pane of the popout window will crash and you will be unable to edit code until you restart the client.

Steps to Reproduce

  1. Open UO Classic on Outlands
  2. Open the popout editor for a script. Use a long running script, usually around ~20 or so the issue will occur. I was using this script for lumberjacking, but happens for any script as I've been able to consistently reproduce.
  3. Wait
  4. Observe the editor pane will eventually crash with the following exception:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentNullException: Value cannot be null. (Parameter 'brush')
   at System.Drawing.Graphics.FillRectangle(Brush brush, Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Drawing.Graphics.FillRectangle(Brush brush, Rectangle rect)
   at FastColoredTextBoxNS.FastColoredTextBox.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at FastColoredTextBoxNS.FastColoredTextBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
System.Private.CoreLib
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
ClassicUO
    Assembly Version: 1.0.0.5
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Runtime
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
FNA
    Assembly Version: 21.11.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Runtime.InteropServices.RuntimeInformation
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Xml.ReaderWriter
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Private.Xml
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Runtime.InteropServices
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.IO.FileSystem
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Memory
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Security.Cryptography.Algorithms
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Threading
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Threading.Thread
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Private.Uri
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Text.Encoding.Extensions
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Collections
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Runtime.Loader
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Console
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Text.RegularExpressions
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Collections.Concurrent
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Linq
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.ComponentModel.TypeConverter
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.ObjectModel
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Collections.Specialized
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.IO.MemoryMappedFiles
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Threading.Tasks.Parallel
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Diagnostics.Tracing
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.IO.FileSystem.Watcher
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.ComponentModel
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
cuoapi
    Assembly Version: 1.0.0.5
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
Razor
    Assembly Version: 1.7.1.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Windows.Forms
    Assembly Version: 5.0.8.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Windows.Forms.Primitives
    Assembly Version: 5.0.8.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Diagnostics.TraceSource
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.ComponentModel.Primitives
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Drawing.Primitives
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Drawing.Common
    Assembly Version: 5.0.0.2
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
Microsoft.Win32.Primitives
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.ComponentModel.EventBasedAsync
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Resources.Extensions
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
netstandard
    Assembly Version: 2.1.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Drawing
    Assembly Version: 5.0.8.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Runtime.Extensions
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
Ultima
    Assembly Version: 0.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
Microsoft.Win32.SystemEvents
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Buffers
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Collections.NonGeneric
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Threading.ThreadPool
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
FastColoredTextBox
    Assembly Version: 2.16.23.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Diagnostics.Process
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Windows.Extensions
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Runtime.Serialization.Formatters
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Net.Primitives
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
MP3Sharp
    Assembly Version: 1.0.0.5
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Net.Sockets
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Security.Cryptography.Primitives
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Runtime.CompilerServices.Unsafe
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
Microsoft.Win32.Registry
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Net.NameResolution
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Threading.Overlapped
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Data.Common
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Net.Ping
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Reflection.Emit.ILGeneration
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Reflection.Emit.Lightweight
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Reflection.Primitives
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Diagnostics.StackTrace
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------
System.Reflection.Metadata
    Assembly Version: 5.0.0.0
    Win32 Version: n/a
    CodeBase: 
----------------------------------------

************** JIT Debugging **************

After this exception, the editor window will look like this and be unusable: ScriptEditorCrash

markdwags commented 2 years ago

Based on testing, it appears this issue may only be happening on the Outlands compiled version. I ran local tests for an hour with no errors, but another tester using the Outlands version had an issue. I'm going to close this as they've been made aware, it can be reopened if it can be replicated in the main version.