[Mono-bugs] [Bug 350285] New: AssemblyBuilder.GetName crashes when the (string) name is not set
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Dec 21 09:03:34 EST 2007
https://bugzilla.novell.com/show_bug.cgi?id=350285
Summary: AssemblyBuilder.GetName crashes when the (string) name
is not set
Product: Mono: Class Libraries
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: System
AssignedTo: mono-bugs at ximian.com
ReportedBy: rkvinge at novell.com
QAContact: mono-bugs at ximian.com
Found By: ---
Repro:
using System.Collections.Generic;
using System;
using System.Reflection;
using System.Reflection.Emit;
using Mono.Cecil;
class test
{
static void Main ()
{
AssemblyBuilder ab =
System.AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName (),
System.Reflection.Emit.AssemblyBuilderAccess.Save, ".");
ModuleBuilder mb = ab.DefineDynamicModule("tester",
"tesster.dll", false);
TypeBuilder tb = mb.DefineType ("T");
Type t = typeof (List<>).MakeGenericType (tb);
MethodInfo m = t.GetMethod ("AddRange");
Console.WriteLine (m.GetType ().FullName);
AssemblyDefinition a = AssemblyFactory.DefineAssembly("tester",
AssemblyKind.Dll);
MethodReference mr = a.MainModule.Import (m);
Console.WriteLine (mr.Name);
}
}
results in:
rolf at linux:~/test> mono test.exe
System.Reflection.MonoGenericMethod
(test.exe:32061): GLib-CRITICAL **: g_path_is_absolute: assertion `file_name !=
NULL' failed
Stacktrace:
at (wrapper managed-to-native) System.Reflection.Assembly.FillName
(System.Reflection.Assembly,System.Reflection.AssemblyName) <0x00004>
at (wrapper managed-to-native) System.Reflection.Assembly.FillName
(System.Reflection.Assembly,System.Reflection.AssemblyName) <0xffffffff>
at System.Reflection.Assembly.UnprotectedGetName () <0x00026>
at System.Reflection.Emit.AssemblyBuilder.UnprotectedGetName () <0x00013>
at System.Reflection.Assembly.GetName (bool) <0x0002d>
at System.Reflection.Assembly.GetName () <0x0000d>
at Mono.Cecil.ReflectionHelper.ImportAssembly (System.Reflection.Assembly)
<0x0001e>
at Mono.Cecil.ReflectionHelper.ImportSystemType
(System.Type,Mono.Cecil.ImportContext) <0x0010d>
at Mono.Cecil.ReflectionHelper.GetGenericType
(System.Type,Mono.Cecil.TypeReference,Mono.Cecil.ImportContext) <0x0008b>
at Mono.Cecil.ReflectionHelper.GetTypeSpec
(System.Type,Mono.Cecil.ImportContext) <0x0020f>
at Mono.Cecil.ReflectionHelper.ImportSystemType
(System.Type,Mono.Cecil.ImportContext) <0x0003f>
at Mono.Cecil.ReflectionHelper.ImportMethodBase
(System.Reflection.MethodBase,System.Type,Mono.Cecil.ImportContext) <0x00241>
at Mono.Cecil.ReflectionHelper.ImportMethodInfo
(System.Reflection.MethodInfo,Mono.Cecil.ImportContext) <0x00029>
at Mono.Cecil.ModuleDefinition.Import (System.Reflection.MethodBase)
<0x000b7>
at test.Main () <0x00124>
at (wrapper runtime-invoke) test.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
mono [0x817b26f]
mono [0x807f791]
[0xffffe440]
mono [0x80a5721]
mono [0x80a5f6a]
[0xb79928d1]
[0xb799288f]
[0xb7113aac]
[0xb7992856]
[0xb799281e]
[0xb7112c8f]
[0xb7112716]
[0xb7113944]
[0xb7112ad8]
[0xb7112648]
[0xb711081a]
[0xb7110532]
[0xb7110410]
[0xb7988365]
[0xb79881be]
mono(mono_runtime_exec_main+0xbb) [0x809e90b]
mono(mono_runtime_run_main+0x173) [0x809ec03]
mono(mono_main+0x6a9) [0x805ae39]
mono [0x805a282]
/lib/libc.so.6(__libc_start_main+0xe0) [0xb7d4efe0]
mono [0x805a1f1]
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list