[Mono-list] Unhandled Exception at "System.Windows.Forms.DataGridViewButtonCell.GetValue"

qzhan15 qzhan2009 at gmail.com
Mon Jul 20 07:54:52 EDT 2009


To clarify my question:

Can anyone tell me why below code can't work with mono while the same
code runs well on VS2005?

using System;
using System.Runtime.InteropServices;

namespace test
{
	public class Test
	{
		[DllImport("user32.dll", EntryPoint="CharUpper")] 
		public static extern string CharUpperA(string lpsz);

		public static void Main(string[] argc)
		{
			System.Console.WriteLine(CharUpperA("abc"));
		}
	}
}

I have installed wine, and "libuser32.dll.so" (link to user32.dll.so) is
located at /usr/lib/wine, and already configure the ld.so.conf and run
ldconfig. then the "EntryPointNotFoundException" disappear but finally
aborted during executing the native method.

Stacktrace:

  at (wrapper managed-to-native) test.Test.CharUpperA (string) <0x00004>
  at (wrapper managed-to-native) test.Test.CharUpperA (string)
<0xffffffff>
  at test.Test.Main (string[]) [0x00000]
in /home/qzhan15/Projects/test/test/Test.cs:17
  at (wrapper runtime-invoke) test.Test.runtime_invoke_void_string[]
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	/usr/bin/mono [0x806d944]
	/usr/bin/mono [0x808616b]
	[0xb7fd2410]
	[0xb79172c6]
	[0xb7917228]
	[0xb79171b3]
	/usr/bin/mono(mono_runtime_exec_main+0xe5) [0x80bad75]
	/usr/bin/mono(mono_runtime_run_main+0x16b) [0x80bb4eb]
	/usr/bin/mono(mono_main+0x1727) [0x805c917]
	/usr/bin/mono [0x805ac62]
	/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7d6c775]
	/usr/bin/mono [0x805aba1]

Debug info from gdb:

(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0xb7d226e0 (LWP 15550)]
[New Thread 0xb7559b90 (LWP 15554)]
[New Thread 0xb757db90 (LWP 15551)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
0xb7fd2430 in __kernel_vsyscall ()
  3 Thread 0xb757db90 (LWP 15551)  0xb7fd2430 in __kernel_vsyscall ()
  2 Thread 0xb7559b90 (LWP 15554)  0xb7fd2430 in __kernel_vsyscall ()
  1 Thread 0xb7d226e0 (LWP 15550)  0xb7fd2430 in __kernel_vsyscall ()

Thread 3 (Thread 0xb757db90 (LWP 15551)):
#0  0xb7fd2430 in __kernel_vsyscall ()
#1  0xb7eec8f6 in nanosleep () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x081492e8 in ?? ()
#3  0xb7ee54ff in start_thread ()
from /lib/tls/i686/cmov/libpthread.so.0
#4  0xb7e3a49e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread 0xb7559b90 (LWP 15554)):
#0  0xb7fd2430 in __kernel_vsyscall ()
#1  0xb7ee90e5 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/i686/cmov/libpthread.so.0
#2  0x0814c607 in ?? ()
#3  0x0814f1f4 in ?? ()
#4  0x0814f25c in ?? ()
#5  0x08169b02 in ?? ()
#6  0x080d565a in ?? ()
#7  0x080f7639 in ?? ()
#8  0x081653b6 in ?? ()
#9  0x081833b5 in ?? ()
#10 0xb7ee54ff in start_thread ()
from /lib/tls/i686/cmov/libpthread.so.0
#11 0xb7e3a49e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb7d226e0 (LWP 15550)):
#0  0xb7fd2430 in __kernel_vsyscall ()
#1  0xb7e36a87 in syscall () from /lib/tls/i686/cmov/libc.so.6
#2  0x0806d9e7 in ?? ()
#3  0x0808616b in ?? ()
#4  <signal handler called>
#5  0xb737c040 in CharUpperA () from /usr/lib/wine/libuser32.dll.so
#6  0xb79172c6 in ?? ()
#7  0xb7917228 in ?? ()
#8  0xb79171b3 in ?? ()
#9  0x080bad75 in mono_runtime_exec_main ()
#10 0x080bb4eb in mono_runtime_run_main ()
#11 0x0805c917 in mono_main ()
#12 0x0805ac62 in ?? ()
#13 0xb7d6c775 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#14 0x0805aba1 in ?? ()
#0  0xb7fd2430 in __kernel_vsyscall ()

=================================================================
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.
=================================================================




On Mon, 2009-07-20 at 08:41 +0800, Qi Zhang wrote:
> Hi, I just find the application aborts with some specific operation :)
> The reason is: it invoked some native method in user32.dll
> (like "CreateCaret"...) 
> The question is why it didn't get a "DllNotFoundException" but an
> "EntryPointNotFoundException"?
> Thanks
> Qi
>    
> 
>  
> On Mon, Jul 20, 2009 at 8:24 AM, Qi Zhang <qzhan2009 at gmail.com> wrote:
>         Yes, there is no direct invoke in my code, thanks for help!
>          
>         BTW, I am able to run my application with Mono2.0 now.
>         
>         
>         
>         On Sun, Jul 19, 2009 at 2:30 AM, Petit Eric
>         <surfzoid at gmail.com> wrote:
>                 2009/7/18 Jonathan Pobst <monkey at jpobst.com>:
>                 > zhang qi wrote:
>                 >>
>                 >> Checked exception.txt of 1.9, the
>                 
>                 héhé didn't saw you have a so old version of mono ,
>                 1.9 :-)
>                 
>                 >>
>                 System.Windows.Forms.DataGridViewButtonCell.GetValue
>                 do exist, but 2.4
>                 >> didn't have this, seems the tool has issue or i run
>                 with a wrong
>                 >> method :)
>                 >> anyway, i will do upgrade.
>                 >>
>                 >> Thanks again.
>                 >
>                 > MoMA cannot find that you are using this method
>                 because it is not being used
>                 > directly.  That is, you aren't calling
>                 DataGridViewButtonCell.GetValue in
>                 > your code, but winforms is calling it behind the
>                 scenes.
>                 >
>                 > However, the good news is this is implemented in
>                 newer versions of Mono,
>                 > like 2.4.  It was implemented in r99681 in April
>                 2008.
>                 >
>                 > Jonathan
>                 >
>                 
>                 
>                 
>                 
>                 
>                 --
>                 
>                 Cordially.
>                 
>                 Small Eric Quotations of the days:
>                 ---------------------------------------------------------------------------
>                 If one day one reproaches you that your work is not a
>                 work of
>                 professional, say you that:
>                 Amateurs built the arch of Noah, and professionals the
>                 Titanic.
>                 ---------------------------------------------------------------------------
>                 
>                 Few people are done for independence, it is the
>                 privilege of the powerful ones.
>                 ---------------------------------------------------------------------------
>                 
>                 No key was wounded during the drafting of this
>                 message.
>                 
>         
>         
> 



More information about the Mono-list mailing list