Bug 40069 - Native crash in Xutf8LookupString
Summary: Native crash in Xutf8LookupString
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: 4.4.0 (C7)
Hardware: PC Linux
: --- normal
Target Milestone: Community
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-04-03 10:30 UTC by martinlueck
Modified: 2017-09-01 11:56 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 40069 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description martinlueck 2016-04-03 10:30:25 UTC
Mono Version:

Mono JIT compiler version 4.4.0 (Stable 4.4.0.40/f8474c4 Mon Mar 28 12:22:29 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen



Bug description:

Keystrokes in a Windows.Forms window crash the application. This happens after 1-10 keystrokes, but ONLY if the X11 keyboard layout is changed. In this case the de_neo layout was used. Opening the application, but changing the layout before the first keystroke in the application window, always prevents crashing as well.

The application using the Windows.Forms library was KeePass in this case, and the crash already occurs when entering the password to the keepass database in the corresponding dialog window.



OS Info:

4.4.5-1-ARCH #1 SMP PREEMPT Thu Mar 10 07:38:19 CET 2016 x86_64 GNU/Linux


Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Windows.Forms.X11Keyboard.Xutf8LookupString (intptr,System.Windows.Forms.XEvent&,byte[],int,intptr&,System.Windows.Forms.XLookupStatus&) <0x000a4>
  at System.Windows.Forms.X11Keyboard.LookupString (System.Windows.Forms.XEvent&,int,System.Windows.Forms.XKeySym&,System.Windows.Forms.XLookupStatus&) <0x000bb>
  at System.Windows.Forms.X11Keyboard.EventToVkey (System.Windows.Forms.XEvent) <0x0003f>
  at System.Windows.Forms.X11Keyboard.ToUnicode (int,int,string&) <0x00347>
  at System.Windows.Forms.X11Keyboard.TranslateMessage (System.Windows.Forms.MSG&) <0x0011f>
  at System.Windows.Forms.XplatUIX11.TranslateMessage (System.Windows.Forms.MSG&) <0x00023>
  at System.Windows.Forms.XplatUI.TranslateMessage (System.Windows.Forms.MSG&) <0x0001f>
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) <0x00caf>
  at System.Windows.Forms.Form.ShowDialog (System.Windows.Forms.IWin32Window) <0x0087f>
  at System.Windows.Forms.Form.ShowDialog () <0x0000f>
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form.ShowDialog () <0x00053>
  at KeePass.Forms.MainForm.OpenDatabase (KeePassLib.Serialization.IOConnectionInfo,KeePassLib.Keys.CompositeKey,bool) <0x0060b>
  at KeePass.Forms.MainForm.OnFormLoad (object,System.EventArgs) <0x03483>
  at System.Windows.Forms.Form.OnLoad (System.EventArgs) <0x00071>
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs) <0x0007f>
  at System.Windows.Forms.Form.OnCreateControl () <0x0004f>
  at System.Windows.Forms.Control.CreateControl () <0x0011f>
  at System.Windows.Forms.Control.WmShowWindow (System.Windows.Forms.Message&) <0x00163>
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) <0x002d7>
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message&) <0x00013>
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message&) <0x0005b>
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message&) <0x00257>
  at KeePass.Forms.MainForm.WndProc (System.Windows.Forms.Message&) <0x001cb>
  at System.Windows.Forms.Control/ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) <0x00024>
  at System.Windows.Forms.Control/ControlNativeWindow.WndProc (System.Windows.Forms.Message&) <0x00036>
  at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x003b4>
  at System.Windows.Forms.XplatUIX11.SendMessage (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x003fb>
  at System.Windows.Forms.XplatUIX11.MapWindow (System.Windows.Forms.Hwnd,System.Windows.Forms.WindowType) <0x001e3>
  at System.Windows.Forms.XplatUIX11.CreateWindow (System.Windows.Forms.CreateParams) <0x00dd3>
  at System.Windows.Forms.XplatUI.CreateWindow (System.Windows.Forms.CreateParams) <0x0001f>
  at System.Windows.Forms.NativeWindow.CreateHandle (System.Windows.Forms.CreateParams) <0x0003f>
  at System.Windows.Forms.Control.CreateHandle () <0x00069>
  at System.Windows.Forms.Form.CreateHandle () <0x00027>
  at System.Windows.Forms.Control.CreateControl () <0x00087>
  at System.Windows.Forms.Control.SetVisibleCore (bool) <0x00083>
  at System.Windows.Forms.Form.SetVisibleCore (bool) <0x002fb>
  at KeePass.Forms.MainForm.SetVisibleCore (bool) <0x000a7>
  at System.Windows.Forms.Control.set_Visible (bool) <0x00032>
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.set_Visible (bool) <0x00067>
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) <0x00323>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) <0x0003f>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) <0x00033>
  at KeePass.Program.Main (string[]) <0x00cd3>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0x000c8>

Native stacktrace:

	mono() [0x4ac77f]
	mono() [0x50014e]
	mono() [0x428653]
	/usr/lib/libpthread.so.0(+0x10e80) [0x7fc2c709ee80]
	/usr/lib/libc.so.6(strlen+0x26) [0x7fc2c6b55646]
	/usr/lib/libX11.so.6(_XimLocalUtf8LookupString+0xeb) [0x7fc2bf5d7b1b]
	[0x41ebb945]

Debug info from gdb:


=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

[1]    2903 abort (core dumped)  keepass
Comment 1 martinlueck 2016-04-03 10:35:04 UTC
To clarify: Changing the keyboard layout back to the default layout before typing prevents the crashing. The crash occurs if at the moment of typing the layout is different.

Related reports in the web are

https://sourceforge.net/p/keepass/discussion/329221/thread/ef1c830e/

and (for a french non-standard keyboard layout)

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715152
Comment 2 martinlueck 2016-04-05 14:55:03 UTC
Also occurring in mono version Stable 4.2.2.30/996df3c.
Comment 3 Kamil Lorenc 2016-08-09 16:49:03 UTC
This is still the case as of version 4.4.1.0/4747417. In my case fault occurs always when pressing Windows key (Meta). I am using polish keyboard as my system default.  Additionally I was able to create stack trace with line numbers.

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Windows.Forms.X11Keyboard.Xutf8LookupString (intptr,System.Windows.Forms.XEvent&,byte[],int,intptr&,System.Windows.Forms.XLookupStatus&) <IL 0x0001a, 0x000a4>
  at System.Windows.Forms.X11Keyboard.LookupString (System.Windows.Forms.XEvent&,int,System.Windows.Forms.XKeySym&,System.Windows.Forms.XLookupStatus&) [0x00038] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/X11Keyboard.cs:1216
  at System.Windows.Forms.X11Keyboard.EventToVkey (System.Windows.Forms.XEvent) [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/X11Keyboard.cs:680
  at System.Windows.Forms.X11Keyboard.ToUnicode (int,int,string&) [0x0013c] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/X11Keyboard.cs:448
  at System.Windows.Forms.X11Keyboard.TranslateMessage (System.Windows.Forms.MSG&) [0x000c2] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/X11Keyboard.cs:384
  at System.Windows.Forms.XplatUIX11.TranslateMessage (System.Windows.Forms.MSG&) [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:6324
  at System.Windows.Forms.XplatUI.TranslateMessage (System.Windows.Forms.MSG&) [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUI.cs:1138
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) [0x00366] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Application.cs:940
  at System.Windows.Forms.Form.ShowDialog (System.Windows.Forms.IWin32Window) [0x001f7] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:1751
  at System.Windows.Forms.Form.ShowDialog () [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:1653
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form.ShowDialog () <IL 0x00032, 0x00053>
  at KeePass.Forms.MainForm.OpenDatabase (KeePassLib.Serialization.IOConnectionInfo,KeePassLib.Keys.CompositeKey,bool) <IL 0x00221, 0x0070f>
  at KeePass.Forms.MainForm.OnFormLoad (object,System.EventArgs) <IL 0x00e2a, 0x03d85>
  at System.Windows.Forms.Form.OnLoad (System.EventArgs) [0x00022] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:2084
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs) [0x00029] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:2902
  at System.Windows.Forms.Form.OnCreateControl () [0x00027] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:2029
  at System.Windows.Forms.Control.CreateControl () [0x000a3] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs:3543
  at System.Windows.Forms.Control.WmShowWindow (System.Windows.Forms.Message&) [0x00039] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs:5496
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) [0x001cf] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs:5080
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message&) [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollableControl.cs:653
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message&) [0x0003c] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/ContainerControl.cs:689
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message&) [0x0015c] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:2526
  at KeePass.Forms.MainForm.WndProc (System.Windows.Forms.Message&) <IL 0x0016f, 0x0020f>
  at System.Windows.Forms.Control/ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs:228
  at System.Windows.Forms.Control/ControlNativeWindow.WndProc (System.Windows.Forms.Message&) [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs:209
  at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) [0x0008e] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/NativeWindow.cs:240
  at System.Windows.Forms.XplatUIX11.SendMessage (intptr,System.Windows.Forms.Msg,intptr,intptr) [0x000d6] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:5502
  at System.Windows.Forms.XplatUIX11.MapWindow (System.Windows.Forms.Hwnd,System.Windows.Forms.WindowType) [0x00034] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:1615
  at System.Windows.Forms.XplatUIX11.CreateWindow (System.Windows.Forms.CreateParams) [0x00572] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:3056
  at System.Windows.Forms.XplatUI.CreateWindow (System.Windows.Forms.CreateParams) [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUI.cs:514
  at System.Windows.Forms.NativeWindow.CreateHandle (System.Windows.Forms.CreateParams) [0x00006] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/NativeWindow.cs:164
  at System.Windows.Forms.Control.CreateHandle () [0x0003a] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs:4215
  at System.Windows.Forms.Form.CreateHandle () [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:1913
  at System.Windows.Forms.Control.CreateControl () [0x0004b] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs:3529
  at System.Windows.Forms.Control.SetVisibleCore (bool) [0x00043] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs:4770
  at System.Windows.Forms.Form.SetVisibleCore (bool) [0x0007b] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:2380
  at KeePass.Forms.MainForm.SetVisibleCore (bool) <IL 0x0005b, 0x000af>
  at System.Windows.Forms.Control.set_Visible (bool) [0x0000c] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs:3200
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.set_Visible (bool) <IL 0x00033, 0x00067>
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) [0x00059] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Application.cs:823
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) [0x00014] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Application.cs:724
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) [0x00000] in /build/mono/src/mono-4.4.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Application.cs:707
  at KeePass.Program.Main (string[]) <IL 0x0054c, 0x00fc3>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00051, 0x000c8>
Comment 4 Anonymous 2016-10-03 11:58:43 UTC
Experience the same bug with KeePass 2.34. Currently Mono 4.6.1.3 is installed, but it did not just now appear but was present earlier as well.
When using the following Hello World Program from http://www.mono-project.com/docs/getting-started/mono-basics/, I can also recreate the crash:

using System;
using System.Windows.Forms;

public class HelloWorld : Form
{
    static public void Main ()
    {
        Application.Run (new HelloWorld ());
    }

    public HelloWorld ()
    {
        Text = "Hello Mono World";
    }
}

Compiling with:
mcs -debug hello.cs -pkg:dotnet

And executing with:
mono --debug hello.exe

The application window is created normally, but when pressing the Windows Key or the Menu Key, then the program is aborted and the following stacktrace is produced:

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Windows.Forms.X11Keyboard.Xutf8LookupString (intptr,System.Windows.Forms.XEvent&,byte[],int,intptr&,System.Windows.Forms.XLookupStatus&) <IL 0x0001a, 0x000a4>
  at System.Windows.Forms.X11Keyboard.LookupString (System.Windows.Forms.XEvent&,int,System.Windows.Forms.XKeySym&,System.Windows.Forms.XLookupStatus&) [0x00038] in /build/mono/src/mono-4.6.1/mcs/class/System.Windows.Forms/System.Windows.Forms/X11Keyboard.cs:1216
  at System.Windows.Forms.X11Keyboard.EventToVkey (System.Windows.Forms.XEvent) [0x00000] in /build/mono/src/mono-4.6.1/mcs/class/System.Windows.Forms/System.Windows.Forms/X11Keyboard.cs:680
  at System.Windows.Forms.X11Keyboard.ToUnicode (int,int,string&) [0x0013c] in /build/mono/src/mono-4.6.1/mcs/class/System.Windows.Forms/System.Windows.Forms/X11Keyboard.cs:448
  at System.Windows.Forms.X11Keyboard.TranslateMessage (System.Windows.Forms.MSG&) [0x000c2] in /build/mono/src/mono-4.6.1/mcs/class/System.Windows.Forms/System.Windows.Forms/X11Keyboard.cs:384
  at System.Windows.Forms.XplatUIX11.TranslateMessage (System.Windows.Forms.MSG&) [0x00000] in /build/mono/src/mono-4.6.1/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:6324
  at System.Windows.Forms.XplatUI.TranslateMessage (System.Windows.Forms.MSG&) [0x00000] in /build/mono/src/mono-4.6.1/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUI.cs:1138
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) [0x00366] in /build/mono/src/mono-4.6.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Application.cs:940
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) [0x00014] in /build/mono/src/mono-4.6.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Application.cs:724
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) [0x00000] in /build/mono/src/mono-4.6.1/mcs/class/System.Windows.Forms/System.Windows.Forms/Application.cs:707
  at HelloWorld.Main () [0x00006] in /tmp/hello.cs:8
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <IL 0x0004d, 0x000ba>

Native stacktrace:

        mono() [0x4b18ff]
        mono() [0x50769e]
        mono() [0x4297b3]
        /usr/lib/libpthread.so.0(+0x11080) [0x7f92f6f2e080]
        /usr/lib/libc.so.6(strlen+0x26) [0x7f92f69e8446]
        /usr/lib/libX11.so.6(_XimLocalUtf8LookupString+0xeb) [0x7f92f2160b1b]
        [0x4153a945]

Debug info from gdb:

[New LWP 7684]
[New LWP 7685]
Mono support loaded.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
0x00007f92f6f2dafb in waitpid () from /usr/lib/libpthread.so.0
  Id   Target Id         Frame
* 1    Thread 0x7f92f7a2d740 (LWP 7683) "Main" 0x00007f92f6f2dafb in waitpid () from /usr/lib/libpthread.so.0
  2    Thread 0x7f92f5fff700 (LWP 7684) "SGen worker" 0x00007f92f6f2a10f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
  3    Thread 0x7f92f3a50700 (LWP 7685) "Finalizer" 0x00007f92f6f2c4f7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0

Thread 3 (Thread 0x7f92f3a50700 (LWP 7685)):
#0  0x00007f92f6f2c4f7 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007f92f6f2c5a4 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x00000000005c47eb in ?? ()
#3  0x00000000005a3c9c in ?? ()
#4  0x000000000065f0aa in ?? ()
#5  0x00007f92f6f24454 in start_thread () from /usr/lib/libpthread.so.0
#6  0x00007f92f6a507df in clone () from /usr/lib/libc.so.6

Thread 2 (Thread 0x7f92f5fff700 (LWP 7684)):
#0  0x00007f92f6f2a10f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x000000000062d89f in ?? ()
#2  0x00007f92f6f24454 in start_thread () from /usr/lib/libpthread.so.0
#3  0x00007f92f6a507df in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7f92f7a2d740 (LWP 7683)):
#0  0x00007f92f6f2dafb in waitpid () from /usr/lib/libpthread.so.0
#1  0x00000000004b19d6 in ?? ()
#2  0x000000000050769e in ?? ()
#3  0x00000000004297b3 in ?? ()
#4  <signal handler called>
#5  0x00007f92f69e8446 in strlen () from /usr/lib/libc.so.6
#6  0x00007f92f2160b1b in _XimLocalUtf8LookupString () from /usr/lib/libX11.so.6
#7  0x000000004153a945 in ?? ()
#8  0x0000000000000000 in ?? ()

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted (core dumped)
Comment 5 Niels 2016-12-30 10:51:30 UTC
I am seeing the same issue using Mono 4.6.1.3 and Keepass 2.34 on Arch Linux when pressing the Windows (Meta) key:

----------

SendMessage (23068714, 0x112c, 0x4, 0x4)
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Windows.Forms.X11Keyboard.Xutf8LookupString (intptr,System.Windows.Forms.XEvent&,byte[],int,intptr&,System.Windows.Forms.XLookupStatus&) <0x000a4>
  at System.Windows.Forms.X11Keyboard.LookupString (System.Windows.Forms.XEvent&,int,System.Windows.Forms.XKeySym&,System.Windows.Forms.XLookupStatus&) <0x000c3>
  at System.Windows.Forms.X11Keyboard.EventToVkey (System.Windows.Forms.XEvent) <0x0003f>
  at System.Windows.Forms.X11Keyboard.ToUnicode (int,int,string&) <0x0035f>
  at System.Windows.Forms.X11Keyboard.TranslateMessage (System.Windows.Forms.MSG&) <0x00127>
  at System.Windows.Forms.XplatUIX11.TranslateMessage (System.Windows.Forms.MSG&) <0x00023>
  at System.Windows.Forms.XplatUI.TranslateMessage (System.Windows.Forms.MSG&) <0x0001f>
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) <0x00ce7>
  at System.Windows.Forms.Form.ShowDialog (System.Windows.Forms.IWin32Window) <0x008bf>
  at System.Windows.Forms.Form.ShowDialog () <0x0000f>
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form.ShowDialog () <0x00053>
  at KeePass.Forms.MainForm.OpenDatabase (KeePassLib.Serialization.IOConnectionInfo,KeePassLib.Keys.CompositeKey,bool) <0x0062b>
  at KeePass.Forms.MainForm.OnFormLoad (object,System.EventArgs) <0x038cf>
  at System.Windows.Forms.Form.OnLoad (System.EventArgs) <0x00071>
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs) <0x0007f>
  at System.Windows.Forms.Form.OnCreateControl () <0x0004f>
  at System.Windows.Forms.Control.CreateControl () <0x0011f>
  at System.Windows.Forms.Control.WmShowWindow (System.Windows.Forms.Message&) <0x00167>
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) <0x002d7>
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message&) <0x00013>
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message&) <0x0005b>
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message&) <0x00257>
  at KeePass.Forms.MainForm.WndProc (System.Windows.Forms.Message&) <0x001d3>
  at System.Windows.Forms.Control/ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) <0x00024>
  at System.Windows.Forms.Control/ControlNativeWindow.WndProc (System.Windows.Forms.Message&) <0x00036>
  at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x00374>
  at System.Windows.Forms.XplatUIX11.SendMessage (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x0044f>
  at System.Windows.Forms.XplatUIX11.MapWindow (System.Windows.Forms.Hwnd,System.Windows.Forms.WindowType) <0x001eb>
  at System.Windows.Forms.XplatUIX11.CreateWindow (System.Windows.Forms.CreateParams) <0x00d5b>
  at System.Windows.Forms.XplatUI.CreateWindow (System.Windows.Forms.CreateParams) <0x0001f>
  at System.Windows.Forms.NativeWindow.CreateHandle (System.Windows.Forms.CreateParams) <0x0003f>
  at System.Windows.Forms.Control.CreateHandle () <0x00069>
  at System.Windows.Forms.Form.CreateHandle () <0x00027>
  at System.Windows.Forms.Control.CreateControl () <0x00087>
  at System.Windows.Forms.Control.SetVisibleCore (bool) <0x00083>
  at System.Windows.Forms.Form.SetVisibleCore (bool) <0x00303>
  at KeePass.Forms.MainForm.SetVisibleCore (bool) <0x000ab>
  at System.Windows.Forms.Control.set_Visible (bool) <0x00032>
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.set_Visible (bool) <0x00067>
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) <0x0032f>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) <0x00057>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) <0x00033>
  at KeePass.Program.Main (string[]) <0x00d1b>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0x000c8>

Native stacktrace:

	mono() [0x4b18ff]
	mono() [0x50769e]
	mono() [0x4297b3]
	/usr/lib/libpthread.so.0(+0x11080) [0x7fda02947080]
	/usr/lib/libc.so.6(strlen+0x26) [0x7fda02401446]
	/usr/lib/libX11.so.6(_XimLocalUtf8LookupString+0xde) [0x7fd9fe44024e]
	[0x409f98f5]

Debug info from gdb:


=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

----------

Interestingly, occasionally the crash would not occur. On every nth attempt (where n is usually between 1 and 30 or so), I could press all keys without triggering the crash. I could never figure out a pattern to this. When keys led to a crash and when not seemed to be completely independent from system load, other programs running, where the mouse was located, or similar. It seemed to be entirely random.

So as a workaround, I started launching keepass using the script `false; while [ $? -ne 0 ]; do; keepass; done` which simply re-starts it over and over again until it stops crashing. (I would press the meta key as soon as the keepass window opens and keep doing that until it no longer closes, then type my password and continue normally.)

Then, recently, I came across https://sourceforge.net/p/keepass/bugs/1545/ in the Keepass bug tracker where another user points out that the relevant mono component (Windows.Form) is no longer maintained. He suggests executing mono with the `--verify-all` option to work around the issue. I.e. launch keepass like so:

# mono --verify-all /usr/share/keepass/KeePass.exe

Or change your /usr/bin/keepass launcher accordingly. This has worked perfectly for me thus far!

FWIW, from the mono docs:

       --verify-all
              Verifies  mscorlib  and assemblies in the global assembly cache for valid
              IL, and all user code for IL verifiability.