[Mono-list] MonoDevelop GTK# and Pascal library

Bauglir doe32 at email.cz
Fri Apr 22 12:03:08 EDT 2011


Hi,
I'm developing a library in Pascal and I'm testing it. I'm having no issues
on Lazarus, Delphi (Pascal) and SharpDevelop (C#) on Windows and Lazarus on
Kubuntu. But Running application created in MonoDevelop GTK# on Kubuntu
fails.

So I've created a simpliest library in pascal:
----------------------------------------------------
library libtmp2;
procedure testProc; stdcall;
begin
end;

exports
  testProc;
begin
end.
----------------------------------------------------
which exports one void function called testProc doing nothing.

And in MonoDevelop I've created class (the same way I've create id in
SharpDevelop for Windows)
public static class TestLib {
 
[DllImport("/home/bauglir/Desktop/Documents/Mono/Test1/Test1/bin/Debug/libproject1.so", 
      CallingConvention=CallingConvention.StdCall)]
  public static extern void testProc();
}

but calling 
TestLib.testProc(); 
fails:


Debug info from gdb:

[Thread debugging using libthread_db enabled]
[New Thread 0xb6c5ab70 (LWP 17624)]
[New Thread 0xb6c8bb70 (LWP 17623)]
0xb77ba416 in __kernel_vsyscall ()
  3 Thread 0xb6c8bb70 (LWP 17623)  0xb77ba416 in __kernel_vsyscall ()
  2 Thread 0xb6c5ab70 (LWP 17624)  0xb77ba416 in __kernel_vsyscall ()
* 1 Thread 0xb74ef6f0 (LWP 17620)  0xb77ba416 in __kernel_vsyscall ()

Thread 3 (Thread 0xb6c8bb70 (LWP 17623)):
#0  0xb77ba416 in __kernel_vsyscall ()
#1  0xb76b6de6 in nanosleep () from /lib/libpthread.so.0
#2  0x081e5238 in ?? ()
#3  0xb76aecc9 in start_thread () from /lib/libpthread.so.0
#4  0xb75f669e in clone () from /lib/libc.so.6

Thread 2 (Thread 0xb6c5ab70 (LWP 17624)):
#0  0xb77ba416 in __kernel_vsyscall ()
#1  0xb76b5895 in sem_wait@@GLIBC_2.1 () from /lib/libpthread.so.0
#2  0x08200ae8 in mono_sem_wait ()
#3  0x081163f8 in ?? ()
#4  0x081b11db in ?? ()
#5  0x081e8e4e in ?? ()
#6  0x08214f85 in ?? ()
#7  0xb76aecc9 in start_thread () from /lib/libpthread.so.0
#8  0xb75f669e in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb74ef6f0 (LWP 17620)):
#0  0xb77ba416 in __kernel_vsyscall ()
#1  0xb76b65cb in read () from /lib/libpthread.so.0
#2  0x080d4ede in ?? ()
#3  0x0810ffeb in ?? ()
#4  <signal handler called>
#5  0x00000005 in ?? ()
#6  0xb5bd3c9c in ?? () from
/home/bauglir/Desktop/Documents/Mono/Test1/Test1/bin/Debug/libproject1.so
#7  0xb5bd431e in ?? () from
/home/bauglir/Desktop/Documents/Mono/Test1/Test1/bin/Debug/libproject1.so
#8  0xb5bed95d in ?? () from
/home/bauglir/Desktop/Documents/Mono/Test1/Test1/bin/Debug/libproject1.so
#9  0xb77c96ec in ?? () from /lib/ld-linux.so.2
#10 0xb77c9809 in ?? () from /lib/ld-linux.so.2
#11 0xb77cd899 in ?? () from /lib/ld-linux.so.2
#12 0xb77c9306 in ?? () from /lib/ld-linux.so.2
#13 0xb77cd0e6 in ?? () from /lib/ld-linux.so.2
#14 0xb76c3c0b in ?? () from /lib/libdl.so.2
#15 0xb77c9306 in ?? () from /lib/ld-linux.so.2
#16 0xb76c409c in ?? () from /lib/libdl.so.2
#17 0xb76c3b41 in dlopen () from /lib/libdl.so.2
#18 0x08205e4f in ?? ()
#19 0x081a2864 in ?? ()
#20 0x081a2c66 in mono_lookup_pinvoke_call ()
#21 0x081c5c09 in ?? ()
#22 0x0808a055 in ?? ()
#23 0x0805efa8 in ?? ()
#24 0x080606bf in ?? ()
#25 0x080614c8 in ?? ()
#26 0x0813c890 in mono_runtime_invoke ()
#27 0x081421a4 in mono_runtime_invoke_array ()
#28 0x08130f09 in ?? ()
#29 0xb5dc7818 in ?? ()
#30 0xb5dc7013 in ?? ()
#31 0xb5dc6ede in ?? ()
#32 0xb5bf582b in ?? ()
#33 0xb5bf568d in ?? ()
#34 0xb5bf5652 in ?? ()
#35 0xb5bf561f in ?? ()
#36 0xb5bf54ec in ?? ()
#37 0xb5bf4226 in ?? ()
#38 0xb5dc946b in ?? ()
#39 0xb5ee8412 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#40 0xb5efef78 in ?? () from /usr/lib/libgobject-2.0.so.0
#41 0xb5efffac in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#42 0xb5f00452 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#43 0xb64be2ca in gtk_button_clicked () from /usr/lib/libgtk-x11-2.0.so.0
#44 0xb64bf888 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#45 0xb5ef7f2c in g_cclosure_marshal_VOID__VOID () from
/usr/lib/libgobject-2.0.so.0
#46 0xb5ee6a87 in ?? () from /usr/lib/libgobject-2.0.so.0
#47 0xb5ee8412 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#48 0xb5efe42a in ?? () from /usr/lib/libgobject-2.0.so.0
#49 0xb5efffac in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#50 0xb5f00452 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#51 0xb64be36a in gtk_button_released () from /usr/lib/libgtk-x11-2.0.so.0
#52 0xb64be3b3 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#53 0xb657c284 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#54 0xb5ee6a87 in ?? () from /usr/lib/libgobject-2.0.so.0
#55 0xb5ee8412 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#56 0xb5efe7d6 in ?? () from /usr/lib/libgobject-2.0.so.0
#57 0xb5effe2b in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#58 0xb5f00452 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#59 0xb66aab96 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#60 0xb657485d in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
#61 0xb6575c17 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#62 0xb640636a in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#63 0xb770e855 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#64 0xb7712668 in ?? () from /lib/libglib-2.0.so.0
#65 0xb7712ba7 in g_main_loop_run () from /lib/libglib-2.0.so.0
#66 0xb65761d9 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#67 0xb5dd2eee in ?? ()
#68 0xb5dd2eb3 in ?? ()
#69 0xb705e1f0 in ?? ()
#70 0xb705e26c in ?? ()
#71 0x08061328 in ?? ()
#72 0x0813c890 in mono_runtime_invoke ()
#73 0x081403de in mono_runtime_exec_main ()
#74 0x081406e2 in mono_runtime_run_main ()
#75 0x080b2f99 in mono_main ()
#76 0x08059385 in ?? ()
#77 0xb753cce7 in __libc_start_main () from /lib/libc.so.6
#78 0x080592c1 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.
=================================================================

The application was terminated by a signal: SIGIOT




Does anyone have any idea what's wrong there?

Thanks
Brona


        

--
View this message in context: http://mono.1490590.n4.nabble.com/MonoDevelop-GTK-and-Pascal-library-tp3468212p3468212.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list