pikeshpd
Posts: 1
Joined: Mon Feb 16, 2015 10:24 pm

WinForm TextBox causes crash.

Mon Feb 16, 2015 10:29 pm

WinForm TextBox causes crash. I created a very simple exe with a WinForm and two Button controls and it was fine but then I added a TextBox control and it crashed during startup with this error.

mono WindowsFormsApplication1.exe
Xlib: extension "RANDR" missing on display ":10.0".
* Assertion at mini-codegen.c:798, condition `i == sel' not met

Stacktrace:

at <unknown> <0xffffffff>
at System.Windows.Forms.TextBoxBase.Draw (System.Drawing.Graphics,System.Drawing.Rectangle) <0x000b3>
at System.Windows.Forms.TextBoxBase.OnPaintInternal (System.Windows.Forms.PaintEventArgs) <0x00063>
at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message&) <0x0017f>
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) <0x00223>
at System.Windows.Forms.TextBoxBase.WndProc (System.Windows.Forms.Message&) <0x0032f>
at System.Windows.Forms.TextBox.WndProc (System.Windows.Forms.Message&) <0x001eb>
at System.Windows.Forms.Control/ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) <0x0002b>
at System.Windows.Forms.Control/ControlNativeWindow.WndProc (System.Windows.Forms.Message&) <0x0003b>
at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x002e7>
at System.Windows.Forms.XplatUIX11.DispatchMessage (System.Windows.Forms.MSG&) <0x00023>
at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG&) <0x00033>
at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) <0x00bf3>
at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) <0x00067>
at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) <0x00033>
at WindowsFormsApplication1.Program.Main () <0x00043>
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:


Debug info from gdb:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xb6a0f430 (LWP 2879)]
0xb6e5aa3c in waitpid () from /lib/arm-linux-gnueabihf/libpthread.so.0
Id Target Id Frame
2 Thread 0xb6a0f430 (LWP 2879) "mono" 0xb6e58700 in [email protected]@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
* 1 Thread 0xb6f2e000 (LWP 2878) "mono" 0xb6e5aa3c in waitpid () from /lib/arm-linux-gnueabihf/libpthread.so.0

Thread 2 (Thread 0xb6a0f430 (LWP 2879)):
#0 0xb6e58700 in [email protected]@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
#1 0x001f8160 in mono_sem_wait (sem=0x2eaa1c, alertable=1) at mono-semaphore.c:116
#2 0x00176ed8 in finalizer_thread (unused=<optimized out>) at gc.c:1073
#3 0x0015c2a0 in start_wrapper_internal (data=0x105c128) at threads.c:609
#4 start_wrapper (data=0x105c128) at threads.c:654
#5 0x001ee228 in thread_start_routine (args=0x1017228) at wthreads.c:294
#6 0x001fc308 in inner_start_thread (arg=<optimized out>) at mono-threads-posix.c:49
#7 0xb6e51bfc in start_thread () from /lib/arm-linux-gnueabihf/libpthread.so.0
#8 0xb6dbe758 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
#9 0xb6dbe758 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0xb6f2e000 (LWP 2878)):
#0 0xb6e5aa3c in waitpid () from /lib/arm-linux-gnueabihf/libpthread.so.0
#1 0x000afec8 in mono_handle_native_sigsegv (signal=<optimized out>, ctx=<optimized out>) at mini-exceptions.c:2344
#2 <signal handler called>
#3 0xb6d20bfc in raise () from /lib/arm-linux-gnueabihf/libc.so.6
#4 0xb6d2497c in abort () from /lib/arm-linux-gnueabihf/libc.so.6
#5 0x000137ee in ?? ()
#6 0x000137ee in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

=================================================================
Got a SIGABRT 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

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: WinForm TextBox causes crash.

Tue Feb 17, 2015 10:02 am

pikeshpd wrote:Xlib: extension "RANDR" missing on display ":10.0".
You can ignore this warning (search the forum for 'Xlib: extension "RANDR" missing').
pikeshpd wrote:* Assertion at mini-codegen.c:798, condition `i == sel' not met
https://bugzilla.xamarin.com/show_bug.cgi?id=20239 (found by Google)

Edit: Came across also this http://www.raspberrypi.org/forums/viewt ... 95#p691394
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

hippy
Posts: 6228
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: WinForm TextBox causes crash.

Tue Feb 17, 2015 6:48 pm

-rst- wrote:Edit: Came across also this http://www.raspberrypi.org/forums/viewt ... 95#p691394
What confuses me there is that it is reportedly resolved, but seemingly not for mono on the Pi.

Also see : https://bugzilla.xamarin.com/show_bug.cgi?id=17013

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: WinForm TextBox causes crash.

Fri Feb 20, 2015 10:13 am

hippy wrote:
-rst- wrote:What confuses me there is that it is reportedly resolved, but seemingly not for mono on the Pi.
I guess plugwash explains this here http://www.raspberrypi.org/forums/viewt ... 95#p691394
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Sojaner
Posts: 1
Joined: Wed Apr 08, 2015 1:31 am

Re: WinForm TextBox causes crash.

Wed Apr 08, 2015 1:48 am

Hi everyone.
Recently I have stared coding for Pi using C# and I neede the latest version and I figured out that I can't update my version to latest using the Pi repo so after some searches on http://www.mono-project.com I came across this guide and by following it, I could install the latest version without any problem.

http://www.mono-project.com/docs/gettin ... all/linux/

I should mention that I have a Pi 2 board (with Raspbian Wheezy installed) so I can't test it on Pi 1 but thought maybe someone can try it and see if they have it compiled for non-v7 arm CPUs or not and let others know about it.

Here's a quick tip on what has mentioned on the link (for someone who just want to try it fast):
First do this:

Code: Select all

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
Then try to update the mono. (I have mono-complete installed)

Code: Select all

sudo apt-get update mono-complete
Hope it helps someone. :)

Piero1978
Posts: 16
Joined: Tue Sep 01, 2015 3:20 pm

Re: WinForm TextBox causes crash.

Wed Sep 02, 2015 4:49 pm

I've the same problem, I've tried the commands reported in the previous post, but nothing.
With a TextBox control, the application don't work.

dslocum
Posts: 5
Joined: Sat Oct 22, 2016 7:13 pm

Re: WinForm TextBox causes crash.

Thu Nov 03, 2016 5:30 pm

Piero1978 wrote:I've the same problem, I've tried the commands reported in the previous post, but nothing.
With a TextBox control, the application don't work.
Having the same issue. Any updates folks?

User avatar
simonmcc
Posts: 181
Joined: Mon Aug 19, 2013 10:07 pm

Re: WinForm TextBox causes crash.

Thu Dec 15, 2016 9:29 am

me too - seems to be no way around it. My text boxes are only used to display data, as it is a touchscreen app with no keyboard input, so I just replaced them with labels - now the app works properly!

I'd love to hear if anyone has found a proper fix to this!
simonmcc.blogspot.com/search/label/pi

Return to “Graphics programming”