[Mono-bugs] [Bug 475327] New: An anon delegate inside of a templated function gets null reference in MutateHoistedGenericType

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 12 14:17:51 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=475327


           Summary: An anon delegate inside of a templated function gets
                    null reference in MutateHoistedGenericType
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.2.x
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: khester at pacificbiosciences.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.5)
Gecko/2008121622 Ubuntu/8.04 (hardy) Firefox/3.0.5

Using the official 2.2 tarball on a Ubuntu x86-64 system compiling the attached
small test function fails with a NullReferenceException in gmcs.  

>From looking at expression.cs, the problem seesm to be that array_data contains
a null.  (See fields below for stack traces, version info...)


Reproducible: Always

Steps to Reproduce:
1. Run 'gmcs TestMonoExt.cs' (attached)
2. Compiler crashes and prints attached stack track
3. If the line begining with long [] in TestMonoExt.cs is commented out, the
crash does not occur.
Actual Results:  
Compiler crashes with the following stack trace (I added --debug to
MONO_OPTIONS for extra clarity):

[MONO-2.0] khester at mp-homer01:/home/khester/development/software/dotnet$ gmcs
TestMonoExt.cs
TestMonoExt.cs(20,29): warning CS0219: The variable `idx' is assigned but its
value is never used
TestMonoExt.cs(16,23): warning CS0219: The variable `anonMeth' is assigned but
its value is never used

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at Mono.CSharp.ArrayCreation.MutateHoistedGenericType
(Mono.CSharp.AnonymousMethodStorey storey) [0x000a0] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/expression.cs:6254 
  at Mono.CSharp.Assign.MutateHoistedGenericType
(Mono.CSharp.AnonymousMethodStorey storey) [0x00000] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/assign.cs:402 
  at Mono.CSharp.StatementExpression.MutateHoistedGenericType
(Mono.CSharp.AnonymousMethodStorey storey) [0x00000] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/statement.cs:754 
  at Mono.CSharp.Block.MutateHoistedGenericType
(Mono.CSharp.AnonymousMethodStorey storey) [0x00073] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/statement.cs:2355 
  at Mono.CSharp.AnonymousExpression+AnonymousMethodMethod.Emit () [0x0004f] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/anonymous.cs:1242 
  at Mono.CSharp.TypeContainer.EmitType () [0x001a7] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/class.cs:2134 
  at Mono.CSharp.AnonymousMethodStorey.EmitType () [0x00133] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/anonymous.cs:369 
  at Mono.CSharp.TypeContainer.EmitType () [0x002b4] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/class.cs:2155 
  at Mono.CSharp.RootContext.EmitCode () [0x00026] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/rootcontext.cs:338 
  at Mono.CSharp.Driver.Compile () [0x00300] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/driver.cs:1715 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x0002f] in
/home/khester/development/software/nrt/packaging/pacbio-mono-runtime/sources-2.2-1/mono/mcs/mcs/driver.cs:302 



Expected Results:  
gmcs should not crash.

[MONO-2.0] khester at mp-homer01:/home/khester/development$ gmcs --version
Mono C# compiler version 2.2.0.0
[MONO-2.0] khester at mp-homer01:/home/khester/development$ mono --version
Mono JIT compiler version 2.2 (mono-2.2 Tue Feb 10 13:49:57 PST 2009)
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
[MONO-2.0] khester at mp-homer01:/home/khester/development$

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