[Mono-dev] NullReferenceException with mcs/gmcs

Felipe Almeida Lessa felipe.lessa at gmail.com
Mon Nov 14 18:54:38 EST 2005


Hello,

(sorry if I'm sending this again, but for me looks like the message
didn't make it to the list the last time I sent it)

I think I found a bug. I don't know if it's already known, so I'm
sending a message here instead of filling a bug report.

mcs and gmcs both are giving me the following stack trace when trying
to compile the "bug.cs" file attached ("mcs bug.cs"):

Unhandled Exception: System.NullReferenceException: Object reference
not set to an instance of an object
in <0x000a5> System.Reflection.Emit.ILGenerator:Emit (OpCode opcode,
System.Reflection.Emit.LocalBuilder lbuilder)
in <0x00120> Mono.CSharp.Try:DoEmit (Mono.CSharp.EmitContext ec)
in <0x00024> Mono.CSharp.Statement:Emit (Mono.CSharp.EmitContext ec)
in <0x000a8> Mono.CSharp.Block:DoEmit (Mono.CSharp.EmitContext ec)
in <0x00254> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext ec)
in <0x0001b> Mono.CSharp.EmitContext:EmitResolvedTopBlock
(Mono.CSharp.ToplevelBlock block, Boolean unreachable)
in <0x00068> Mono.CSharp.EmitContext:EmitTopBlock (IMethodData md,
Mono.CSharp.ToplevelBlock block, Mono.CSharp.InternalParameters ip)
in <0x001f2> Mono.CSharp.MethodData:Emit (Mono.CSharp.TypeContainer
container, Mono.CSharp.Attributable kind)
in <0x00029> Mono.CSharp.Method:Emit ()
in <0x0064d> Mono.CSharp.TypeContainer:EmitType ()
in <0x00225> Mono.CSharp.RootContext:EmitCode ()
in <0x00c63> Mono.CSharp.Driver:MainDriver (System.String[] args)
in <0x0000f> Mono.CSharp.Driver:Main (System.String[] args)

This stack trace makes me think this problem is with
System.Reflection.Emit, not the compilers. Also, this file is the
smallest test case I could write to show this problem.

My versions:
$ mcs --version
Mono C# compiler version 1.1.9.1
$ mono --version
Mono JIT compiler version 1.1.9.2, (C) 2002-2005 Novell, Inc and
Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC)
        SIGSEGV      : normal
        Globalization: normal
$ dpkg -l mono mono-\* | grep ^ii | awk '{print $2 "\t" $3}'
mono    1.1.9.2-1
mono-assemblies-base    1.1.9.2-1
mono-classlib-1.0       1.1.9.2-1
mono-classlib-1.0-dbg   1.1.9.2-1
mono-classlib-2.0       1.1.9.2-1
mono-classlib-2.0-dbg   1.1.9.2-1
mono-common     1.1.9.2-1
mono-devel      1.1.9.2-1
mono-gac        1.1.9.2-1
mono-gmcs       1.1.9.2-1
mono-jay        1.1.9.2-1
mono-jit        1.1.9.2-1
mono-mcs        1.1.9.2-1
mono-utils      1.1.9.2-1
mono-xsp        1.0.5-2


See ya,
Felipe.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.cs
Type: text/x-csharp
Size: 386 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051114/d456d795/attachment.bin 


More information about the Mono-devel-list mailing list