Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Crash of Windows Form Button with "Telescope" Unicode symbol ("🔭") #18587

@AlexeyBobkov

Description

@AlexeyBobkov

Steps to Reproduce

  1. Clone the code from https://github.com/AlexeyBobkov/MonoIssue1.git
    (it is a small Microsoft Visual C# 2008 Express project)
  2. Open in MonoDevelop, compile and run.
  3. Obtain the exception.

If you replace the "Telescope" symbol (U+1F52D) in the line 27, file Form1.cs, with some usual symbol, it will work. Even certain non-printable symbols, like U+02B9C "⮜", don't cause the program to crash, though they are printed like a "square".

Current Behavior

Under Linux Mono, exception:
System.Exception: Generic Error [GDI+ status: GenericError]
...
(see full stack trace below)

Under both Windows native .Net and Windows Mono, works fine.

Expected Behavior

Application is expected to start without exception

On which platforms did you notice this

[ ] macOS
[ X] Linux
[ ] Windows

Version Used:

=== MonoDevelop ===

Version 7.8.4 (build 2)
Installation UUID: 1f2fa684-14e5-447e-8a20-da17010eadbf
GTK+ 2.24.32 (Ambiant-MATE theme)

=== Mono Framework MDK ===

Runtime:
Mono 6.8.0.96 (tarball Wed Jan 15 10:08:18 UTC 2020) (64-bit)

=== NuGet ===

Version: 4.8.2.5835

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /usr/lib/mono/msbuild/15.0/bin/Sdks

=== Build Information ===

Release ID: 708040002
Git revision: 622db12503514afdb641c31615408bfe905a7312
Build date: 2019-07-17 17:02:07-04

=== Operating System ===

Linux
Linux 5.3.0-26-generic #28~18.04.1-Ubuntu SMP Wed Dec 18 16:40:14 UTC 2019 x86_64

Stacktrace

System.Exception: Generic Error [GDI+ status: GenericError]
at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status status) [0x00079] in :0
at System.Drawing.Graphics.DrawRectangle (System.Drawing.Pen pen, System.Int32 x, System.Int32 y, System.Int32 width, System.Int32 height) [0x00025] in :0
at (wrapper remoting-invoke-with-check) System.Drawing.Graphics.DrawRectangle(System.Drawing.Pen,int,int,int,int)
at System.Windows.Forms.Theming.Default.ButtonPainter.Draw (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.Theming.ButtonThemeState state, System.Drawing.Color backColor, System.Drawing.Color foreColor) [0x002c8] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.Theming.ThemeElements.DrawButton (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.Theming.ButtonThemeState state, System.Drawing.Color backColor, System.Drawing.Color foreColor) [0x0000a] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.ThemeWin32Classic.DrawButtonBackground (System.Drawing.Graphics g, System.Windows.Forms.Button button, System.Drawing.Rectangle clipArea) [0x0003f] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.ThemeVisualStyles.DrawButtonBackground (System.Drawing.Graphics g, System.Windows.Forms.Button button, System.Drawing.Rectangle clipArea) [0x0000f] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.ThemeWin32Classic.DrawButton (System.Drawing.Graphics g, System.Windows.Forms.Button b, System.Drawing.Rectangle textBounds, System.Drawing.Rectangle imageBounds, System.Drawing.Rectangle clipRectangle) [0x00000] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.Button.Draw (System.Windows.Forms.PaintEventArgs pevent) [0x00043] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.ButtonBase.OnPaint (System.Windows.Forms.PaintEventArgs pevent) [0x00000] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m) [0x0007c] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x001a4] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x00037] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00000] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x0000b] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0
at System.Windows.Forms.NativeWindow.WndProc (System.IntPtr hWnd, System.Windows.Forms.Msg msg, System.IntPtr wParam, System.IntPtr lParam) [0x00085] in <1ad3b9c5e8484f3cb4aaaf843739b786>:0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions