nemerle & GTK

10 views
Skip to first unread message

Basile Starynkevitch

unread,
Nov 13, 2009, 10:38:10 AM11/13/09
to Nemerle Forum
Hello All,


I am interested in Memerle (because I am an Ocaml enthusiast, and
because the reflective & macro-programming facilities are appealing to
me). My system of choice is Debian/Sid/AMD64 or Ubuntu/Karmic/AMD64

I am considering trying Nemerle to experiment some language witch its
own editor (that is some language implementation which input is not a
textual file, but has editing steps). This means I need a toolkit like
GTK.


But I am not able to compile the GTK example in Nemerle.


glinka.x86_64 ~/tmp 16:34 % ncc -pkg:gtk-sharp-2.0 vsedit.n
error: internal compiler error: got ArgumentException (type is not
TypeBuilder but System.MonoType
Parameter name: type)
at System.Reflection.Emit.TypeBuilder.GetMethod (System.Type type,
System.Reflection.MethodInfo method) [0x00000]
at Nemerle.Compiler.ILEmitter.FrameworkGetMethod (System.Type t,
System.Reflection.MethodInfo m) [0x00000]
at Nemerle.Compiler.ILEmitter.GetMethodInfo (Nemerle.Compiler.TyVar
from_type, IMethod meth, Nemerle.Core.list`1 typars) [0x00000]
at Nemerle.Compiler.ILEmitter.emit (Nemerle.Compiler.Typedtree.TExpr
expr) [0x00000]
at Nemerle.Compiler.ILEmitter.emit (Nemerle.Compiler.Typedtree.TExpr
expr) [0x00000]
at Nemerle.Compiler.ILEmitter.emit (Nemerle.Compiler.Typedtree.TExpr
expr) [0x00000]
at Nemerle.Compiler.ILEmitter.Run () [0x00000]
at Nemerle.Compiler.MethodBuilder+_N__N_l29281_29413.apply_void ()
[0x00000]
at Nemerle.Compiler.TypeBuilder.FinalizeType () [0x00000]
at Nemerle.Compiler.TypeBuilder.EmitImplementation () [0x00000]
at Nemerle.Compiler.TypeBuilder+_N__N_l28388_28414.apply_void ()
[0x00000]
at Nemerle.Compiler.Solver.Enqueue (Nemerle.Builtins.FunctionVoid
action) [0x00000]
at Nemerle.Compiler.TypesManager.EmitDecls () [0x00000]
at Nemerle.Compiler.Passes.Run () [0x00000]
at Nemerle.CommandlineCompiler.MainClass.main_with_catching ()
[0x00000]


The ncc is from Debian/Sid, the gtk-sharp-2.0 iand the mono also:

% mono -V
Mono JIT compiler version 2.4.2.3 (Debian 2.4.2.3+dfsg-2)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none

% ncc -V
Nemerle Compiler (ncc) version 0.9.3 (release)
(c) 2003-2005 University of Wroclaw, All rights reserved.


The gtk-sharp2 package is version 2.12.9

Comments are welcome


Regards

--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

emp...@gmail.com

unread,
Nov 13, 2009, 11:19:06 AM11/13/09
to Nemerle Forum
Sounds like a mono bug. Which version of mono you use ? I think you
need latest from svn

On Nov 13, 5:38 pm, Basile Starynkevitch <bas...@starynkevitch.net>
wrote:

Basile Starynkevitch

unread,
Nov 13, 2009, 1:38:22 PM11/13/09
to Nemerle Forum


On Nov 13, 5:19 pm, "empe...@gmail.com" <empe...@gmail.com> wrote:
> Sounds like a mono bug. Which version of mono you use ? I think you
> need latest from svn

Unfortunately, the latest mono from SVN does not work better

% /usr/local/bin/mono -V
Mono JIT compiler version 2.7 (/trunk/mono r146116 Fri Nov 13 12:02:21
MET 2009)
Copyright (C) 2002-2009 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC and Parallel Mark)
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none


The /usr/bin/ncc command should run

% /usr/local/bin/mono /usr/lib/nemerle/ncc.exe -pkg:gtk-sharp-2.0
vsedit.n
error: internal compiler error: got ArgumentException (type is not
TypeBuilder but System.MonoType
Parameter name: type)
at System.Reflection.Emit.TypeBuilder.GetMethod (System.Type type,
System.Reflection.MethodInfo method) [0x00000] in <filename unknown>:
0
at Nemerle.Compiler.ILEmitter.FrameworkGetMethod (System.Type t,
System.Reflection.MethodInfo m) [0x00000] in <filename unknown>:0
at Nemerle.Compiler.ILEmitter.GetMethodInfo (Nemerle.Compiler.TyVar
from_type, IMethod meth, Nemerle.Core.list`1 typars) [0x00000] in
<filename unknown>:0
at Nemerle.Compiler.ILEmitter.emit (Nemerle.Compiler.Typedtree.TExpr
expr) [0x00000] in <filename unknown>:0
at Nemerle.Compiler.ILEmitter.emit (Nemerle.Compiler.Typedtree.TExpr
expr) [0x00000] in <filename unknown>:0
at Nemerle.Compiler.ILEmitter.emit (Nemerle.Compiler.Typedtree.TExpr
expr) [0x00000] in <filename unknown>:0
at Nemerle.Compiler.ILEmitter.Run () [0x00000] in <filename unknown>:
0
at Nemerle.Compiler.MethodBuilder+_N__N_l29281_29413.apply_void ()
[0x00000] in <filename unknown>:0
at Nemerle.Compiler.TypeBuilder.FinalizeType () [0x00000] in
<filename unknown>:0
at Nemerle.Compiler.TypeBuilder.EmitImplementation () [0x00000] in
<filename unknown>:0
at Nemerle.Compiler.TypeBuilder+_N__N_l28388_28414.apply_void ()
[0x00000] in <filename unknown>:0
at Nemerle.Compiler.Solver.Enqueue (Nemerle.Builtins.FunctionVoid
action) [0x00000] in <filename unknown>:0
at Nemerle.Compiler.TypesManager.EmitDecls () [0x00000] in <filename
unknown>:0
at Nemerle.Compiler.Passes.Run () [0x00000] in <filename unknown>:0
at Nemerle.CommandlineCompiler.MainClass.main_with_catching ()
[0x00000] in <filename unknown>:0

So that does not seems to be only a mono issue.

Thanks for helping.

Regards.

Basile Starynkevitch

unread,
Nov 13, 2009, 2:32:15 PM11/13/09
to Nemerle Forum


On Nov 13, 7:38 pm, Basile Starynkevitch <bas...@starynkevitch.net>
wrote:
> On Nov 13, 5:19 pm, "empe...@gmail.com" <empe...@gmail.com> wrote:
>
> > Sounds like a mono bug. Which version of mono you use ? I think you
> > need latest from svn
>
> Unfortunately, the latest mono from SVN does not work better
>
> % /usr/local/bin/mono -V
> Mono JIT compiler version 2.7 (/trunk/mono r146116 Fri Nov 13 12:02:21
> MET 2009)
> Copyright (C) 2002-2009 Novell, Inc and Contributors.www.mono-project.com
>         TLS:           __thread
>         GC:            Included Boehm (with typed GC and Parallel Mark)
>         SIGSEGV:       altstack
>         Notifications: epoll
>         Architecture:  amd64
>         Disabled:      none
>

And with that Mono, I am failing to build the latest Nemerle from SVN
% svn info .
Path: .
URL: http://nemerle.googlecode.com/svn/nemerle/trunk
Repository Root: http://nemerle.googlecode.com/svn
Repository UUID: c8a6711f-211a-0410-a8d5-2f220496d6d1
Revision: 8434
Node Kind: directory
Schedule: normal
Last Changed Author: v...@rsdn.ru
Last Changed Rev: 8434
Last Changed Date: 2009-11-11 21:09:20 +0100 (Wed, 11 Nov 2009)


I configured it with

bash ./configure --mono-from=/usr/local/bin/ --enable-time


The build fails with

ERROR:reflection.c:2609:get_field_on_inst_generic_type: assertion
failed: (field_index >= 0 && field_index < dgclass->count_fields)
Stacktrace:

at (wrapper managed-to-native) System.MonoType.GetField
(System.MonoType*,string,System.Reflection.BindingFlags) <0x00051>
at (wrapper managed-to-native) System.MonoType.GetField
(System.MonoType*,string,System.Reflection.BindingFlags) <0x00051>
at System.MonoType.GetField (System.Reflection.FieldInfo) <0x00088>
at System.Reflection.Emit.TypeBuilder.GetField
(System.Type,System.Reflection.FieldInfo) <0x0001b>
at Nemerle.Compiler.ILEmitter.FrameworkGetField
(System.Type,System.Reflection.FieldInfo) <0x000e7>
at Nemerle.Compiler.ILEmitter.GetFieldInfo
(System.Type,Nemerle.Compiler.IField) <0x00047>
at Nemerle.Compiler.ILEmitter.emit
(Nemerle.Compiler.Typedtree.TExpr) <0x05b7b>
at Nemerle.Compiler.ILEmitter.emit
(Nemerle.Compiler.Typedtree.TExpr) <0x044d7>
at Nemerle.Compiler.ILEmitter.emit
(Nemerle.Compiler.Typedtree.TExpr) <0x01c27>
at Nemerle.Compiler.ILEmitter.emit
(Nemerle.Compiler.Typedtree.TExpr) <0x01e2b>
at Nemerle.Compiler.ILEmitter.emit
(Nemerle.Compiler.Typedtree.TExpr) <0x01e2b>
at Nemerle.Compiler.ILEmitter.emit
(Nemerle.Compiler.Typedtree.TExpr) <0x03a47>
at Nemerle.Compiler.ILEmitter.Run () <0x00127>
at Nemerle.Compiler.MethodBuilder/
_N__N_lambda__59337__59458.apply_void () <0x000c7>
at Nemerle.Compiler.TypeBuilder.FinalizeType () <0x000cd>
at Nemerle.Compiler.TypeBuilder.EmitImplementation () <0x001f3>
at Nemerle.Compiler.TypesManager/_N_emit_impl__52700.apply_void
(Nemerle.Compiler.TypeBuilder) <0x0005b>
at Nemerle.Compiler.TypesManager/_N_maybe_f__53272.apply_void
(Nemerle.Compiler.TypeBuilder) <0x00196>
at Nemerle.Collections.NList.Iter<object>
(Nemerle.Core.list`1<object>,Nemerle.Builtins.FunctionVoid`1<object>)
<0x000bf>
at Nemerle.Core.list`1<object>.Iter
(Nemerle.Builtins.FunctionVoid`1<object>) <0x00033>
at Nemerle.Compiler.TypesManager.Iter
(Nemerle.Core.list`1<Nemerle.Compiler.TypeBuilder>,Nemerle.Builtins.FunctionVoid`1<Nemerle.Compiler.TypeBuilder>)
<0x0008f>
at Nemerle.Compiler.TypesManager.Iter
(Nemerle.Builtins.FunctionVoid`1<Nemerle.Compiler.TypeBuilder>)
<0x0002f>
at Nemerle.Compiler.TypesManager.compile_all_tyinfos (bool)
<0x0018f>
at Nemerle.Compiler.TypesManager/
_N__N_lambda__52140__52243.apply_void () <0x00034>
at Nemerle.Compiler.Solver.Enqueue (Nemerle.Builtins.FunctionVoid)
<0x0004c>
at Nemerle.Compiler.TypesManager.EmitDecls () <0x0005b>
at Nemerle.Compiler.ManagerClass.Run () <0x0056f>
at Nemerle.CommandlineCompiler.MainClass.main_with_catching ()
<0x00153>
at Nemerle.CommandlineCompiler.MainClass.Main () <0x001ef>
at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0x00049>

Native stacktrace:

/usr/local/bin///mono [0x4883c6]
/lib/libpthread.so.0 [0x2b9de1a9b990]
/lib/libc.so.6(gsignal+0x35) [0x2b9de1f5df25]
/lib/libc.so.6(abort+0x180) [0x2b9de1f60d60]
/lib/libglib-2.0.so.0(g_assertion_message+0x100) [0x2b9de141bad0]
/lib/libglib-2.0.so.0 [0x2b9de141c052]
/usr/local/bin///mono [0x56dbac]
/usr/local/bin///mono(mono_field_get_object+0x165) [0x57ba05]
/usr/local/bin///mono [0x4e3f74]
[0x41f295b1]

Debug info from gdb:

Mono support loaded.
[Thread debugging using libthread_db enabled]
[New Thread 0x2aaaac222910 (LWP 11356)]
[New Thread 0x2aaaabfc1910 (LWP 11355)]
[New Thread 0x2aaaab0ae910 (LWP 11354)]
[New Thread 0x2aaaaaead910 (LWP 11353)]
[New Thread 0x2aaaaacac910 (LWP 11352)]
0x00002b9de1a9a90b in read () from /lib/libpthread.so.0
6 Thread 0x2aaaaacac910 (LWP 11352) 0x00002b9de1a97f89 in
pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
5 Thread 0x2aaaaaead910 (LWP 11353) 0x00002b9de1a97f89 in
pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
4 Thread 0x2aaaab0ae910 (LWP 11354) 0x00002b9de1a97f89 in
pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
3 Thread 0x2aaaabfc1910 (LWP 11355) 0x00002b9de1a9b131 in nanosleep
()
from /lib/libpthread.so.0
2 Thread 0x2aaaac222910 (LWP 11356) 0x00002b9de1a99c61 in sem_wait
()
from /lib/libpthread.so.0
* 1 Thread 0x2b9de24af0b0 (LWP 11351) 0x00002b9de1a9a90b in read ()
from /lib/libpthread.so.0

Thread 6 (Thread 0x2aaaaacac910 (LWP 11352)):
#0 0x00002b9de1a97f89 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/libpthread.so.0
#1 0x00000000005b4203 in GC_wait_marker () at pthread_support.c:1785
#2 0x00000000005b5f84 in GC_help_marker (my_mark_no=57) at mark.c:
1116
#3 0x00000000005b2f50 in GC_mark_thread (id=0x0) at pthread_support.c:
548
#4 0x00002b9de1a9373a in start_thread () from /lib/libpthread.so.0
#5 0x00002b9de1ff72fd in clone () from /lib/libc.so.6
#6 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x2aaaaaead910 (LWP 11353)):
#0 0x00002b9de1a97f89 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/libpthread.so.0
#1 0x00000000005b4203 in GC_wait_marker () at pthread_support.c:1785
#2 0x00000000005b5f84 in GC_help_marker (my_mark_no=57) at mark.c:
1116
#3 0x00000000005b2f50 in GC_mark_thread (id=0x1) at pthread_support.c:
548
#4 0x00002b9de1a9373a in start_thread () from /lib/libpthread.so.0
#5 0x00002b9de1ff72fd in clone () from /lib/libc.so.6
#6 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x2aaaab0ae910 (LWP 11354)):
#0 0x00002b9de1a97f89 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/libpthread.so.0
#1 0x00000000005b4203 in GC_wait_marker () at pthread_support.c:1785
#2 0x00000000005b5f84 in GC_help_marker (my_mark_no=57) at mark.c:
1116
#3 0x00000000005b2f50 in GC_mark_thread (id=0x2) at pthread_support.c:
548
#4 0x00002b9de1a9373a in start_thread () from /lib/libpthread.so.0
#5 0x00002b9de1ff72fd in clone () from /lib/libc.so.6
#6 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x2aaaabfc1910 (LWP 11355)):
#0 0x00002b9de1a9b131 in nanosleep () from /lib/libpthread.so.0
#1 0x00000000005a6b02 in collection_thread (unused=<value optimized
out>)
at collection.c:34
#2 0x00002b9de1a9373a in start_thread () from /lib/libpthread.so.0
#3 0x00002b9de1ff72fd in clone () from /lib/libc.so.6
#4 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x2aaaac222910 (LWP 11356)):
#0 0x00002b9de1a99c61 in sem_wait () from /lib/libpthread.so.0
#1 0x000000000056cb00 in finalizer_thread (unused=<value optimized
out>)
at gc.c:1022
#2 0x00000000004ee095 in start_wrapper (data=<value optimized out>)
at threads.c:721
#3 0x00000000005a1093 in thread_start_routine (args=0x255f970)
at wthreads.c:286
#4 0x00000000005b3e96 in GC_start_routine (arg=0x2aaaab0d4e70)
at pthread_support.c:1390
#5 0x00002b9de1a9373a in start_thread () from /lib/libpthread.so.0
#6 0x00002b9de1ff72fd in clone () from /lib/libc.so.6
#7 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x2b9de24af0b0 (LWP 11351)):
#0 0x00002b9de1a9a90b in read () from /lib/libpthread.so.0
#1 0x000000000048852b in mono_handle_native_sigsegv (
signal=<value optimized out>, ctx=<value optimized out>)
at mini-exceptions.c:1808
#2 <signal handler called>
#3 0x00002b9de1f5df25 in raise () from /lib/libc.so.6
#4 0x00002b9de1f60d60 in abort () from /lib/libc.so.6
#5 0x00002b9de141bad0 in IA__g_assertion_message
(domain=0x2b9de145951e "",
file=0x5d79f8 "reflection.c", line=<value optimized out>, func=
0x676470 "get_field_on_inst_generic_type", message=<value
optimized out>)
at /tmp/buildd/glib2.0-2.22.2/glib/gtestutils.c:1302
#6 0x00002b9de141c052 in IA__g_assertion_message_expr (domain=0x0,
file=
0x5d79f8 "reflection.c", line=2609, func=
0x676470 "get_field_on_inst_generic_type", expr=<value optimized
out>)
at /tmp/buildd/glib2.0-2.22.2/glib/gtestutils.c:1313
#7 0x000000000056dbac in get_field_on_inst_generic_type (
field=<value optimized out>) at reflection.c:2609
#8 0x000000000057ba05 in mono_field_get_object
(domain=0x2aaaab0d3db0, klass=
"Nil", field=0x3452928) at reflection.c:6444
#9 0x00000000004e3f74 in ves_icall_Type_GetField (type=<value
optimized out>,
name=0x2aaaad6f1380, bflags=24) at icall.c:3303
#10 0x0000000041f295b1 in ?? ()
#11 0x0000000002521e60 in ?? ()
#12 0x00002aaaae7ad220 in ?? ()
#13 0x00007fffa67586d0 in ?? ()
#14 0x0000000000000000 in ?? ()

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

Command terminated by signal 6
80.45user 0.86system 1:00.68elapsed 133%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (0major+30556minor)pagefaults 0swaps
make[3]: *** [out.stage1/Nemerle.stage1.dll] Error 134
###

Regards

emp...@gmail.com

unread,
Nov 13, 2009, 3:23:33 PM11/13/09
to Nemerle Forum
Can you please open a ticket to mono guys ?

On Nov 13, 9:32 pm, Basile Starynkevitch <bas...@starynkevitch.net>
> used by your...
>
> read more »

Basile STARYNKEVITCH

unread,
Nov 13, 2009, 3:51:39 PM11/13/09
to nemer...@googlegroups.com
emp...@gmail.com wrote:
> Can you please open a ticket to mono guys ?
>


I am not sure to inderstand what has failed. Is it the Mono runtime, the gmcs compiler, the Nemerle compiler?

Regards.

Ķaмĭļ ๏ Şκaļşκĭ

unread,
Nov 13, 2009, 4:17:31 PM11/13/09
to nemer...@googlegroups.com
On Fri, Nov 13, 2009 at 9:51 PM, Basile STARYNKEVITCH
<bas...@starynkevitch.net> wrote:
>
> emp...@gmail.com wrote:
>> Can you please open a ticket to mono guys ?
>>
>
>
> I am not sure to inderstand what has failed. Is it the Mono runtime, the gmcs compiler, the Nemerle compiler?
>

Looks like a failure in Mono runtime, which is caused by the way
Nemerle uses the runtime. This has happened several times in the past
and usually Mono folks were nice to fix this, but I guess everytime we
hit this, they say it is hard to fix.

> Regards.
>
>
> --
> Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mines, sont seulement les miennes} ***
>
> >
>



--
Kamil Skalski
http://kamil-skalski.pl

Basile Starynkevitch

unread,
Nov 13, 2009, 4:18:51 PM11/13/09
to Nemerle Forum
Reply all
Reply to author
Forward
0 new messages