[IronPython] IronPython 2.0 Alpha 1 on Mono

Joe Mason joe at notcharles.ca
Mon May 7 04:58:51 CEST 2007


Sanghyeon Seo <sanxiyn at gmail.com> wrote:

> After these, gmcs crashes inside Mono runtime with backtrace pointing
> to custom attribute resolution. Still investigating, but above three
> patches should help anyone trying to dig this on their own together
> with me. :)

The crash I'm getting is: 

** ERROR **: file reflection.c: line 2211 (create_typespec): assertion failed: (p-sig < 128)
aborting...
Stacktrace:

  at (wrapper managed-to-native) System.Reflection.Emit.ModuleBuilder.getToken (System.Reflection.Emit.ModuleBuilder,object) <0x00004>
  at (wrapper managed-to-native) System.Reflection.Emit.ModuleBuilder.getToken (System.Reflection.Emit.ModuleBuilder,object) <0xffffffff>
  at System.Reflection.Emit.ModuleBuilder.GetToken (System.Reflection.MemberInfo) <0x0000d>
  at System.Reflection.Emit.ModuleBuilderTokenGenerator.GetToken (System.Reflection.MemberInfo) <0x00016>
  ...

It's in Tuple.cs, which is full of autogenerated code:

        public static Type GetTupleType(int size) {
            #region Generated Tuple Get From Size

            // *** BEGIN GENERATED CODE ***

            if (size <= 128) {
                if (size <= 1) {
                    return typeof(Tuple<>);

Looks like Mono has a limit of 128 properties per object, and since each
Tuple has a get and set property for each individual element, you can
only have 64 elements, not 128 as the file tries to define.  (Even 64
crashed, so there must be some other property slots taken up by
something I'm not aware of.  It compiled when I deleted the last two
Tuple classes in the file, the ones with more than 32 template
parameters, making the max tuple size 32, and adjusted the GetTupleType
function to max out at 32 as well.  (I also had to adjust
CodeBlock.Generated.cs to match - the change to make was obvious from
the error messages.)

That was enough to get Microsoft.Scripting.dll to build.
Microsoft.Scripting.Vestigial.dll keeps giving me "error CS8100:
Internal error: could not find Invoke method!"  Haven't started to look
at that yet.  (I haven't gotten around to building mono from svn like
you mentioned - I just took out the "[NotNull]" constraints for now - so
this might even be fixed already.)

Joe



More information about the Ironpython-users mailing list