Bug 315974 (MONO65571) - [TESTCASE] ModuleBuilder.GetMethod().Invoke() on a DefinePInvokeMethod causes a assert error in reflection.c
Summary: [TESTCASE] ModuleBuilder.GetMethod().Invoke() on a DefinePInvokeMethod causes...
Status: RESOLVED FIXED
Alias: MONO65571
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Zoltan Varga
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-09 01:47 UTC by Geoff Norton
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:53:02 UTC


---- Reported by grompf@sublimeintervention.com 2004-09-08 18:47:49 MST ----

The following test case causes:
** ERROR **: file reflection.c: line 8060 (mono_reflection_lookup_dynamic_token): assertion 
failed: (obj)
aborting...

On CVS HEAD on OSX and 1.0.1 on x86.

using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Threading;

namespace Apple.Foundation {
        public class Test {
                static void Main() {
                        AssemblyName an = new AssemblyName();
                        an.Name = "Apple.ObjCMessaging";
                        AssemblyBuilder builder = 
AppDomain.CurrentDomain.DefineDynamicAssembly(an, AssemblyBuilderAccess.Run);
                        ModuleBuilder module = builder.DefineDynamicModule("MessageModule");
                        MethodBuilder method = module.DefinePInvokeMethod("printf", "libc.so",
MethodAttributes.PinvokeImpl | MethodAttributes.Static | MethodAttributes.Public, 
CallingConventions.Standard, typeof(void), new Type[]{typeof(string)}, CallingConvention.Winapi, 
CharSet.Auto);
                        method.SetImplementationFlags (MethodImplAttributes.PreserveSig | 
method.GetMethodImplementationFlags());
                        module.CreateGlobalFunctions();
                        Console.WriteLine ("Invoking");
                        module.GetMethod("printf").Invoke(null, new object[]{"HelloWorld!"});
                }
        }
}



---- Additional Comments From miguel@ximian.com 2004-09-08 18:50:05 MST ----

Zoltan, could you look into this one?



---- Additional Comments From vargaz@freemail.hu 2004-09-09 08:54:32 MST ----

Fixed in CVS and 1.0


Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>OSX 10.3.4</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".