[Mono-bugs] [Bug 575955] New: Accessing 2D array cells in dynamically generated code causes crash (assert)
    bugzilla_noreply at novell.com 
    bugzilla_noreply at novell.com
       
    Mon Feb  1 17:49:53 EST 2010
    
    
  
http://bugzilla.novell.com/show_bug.cgi?id=575955
http://bugzilla.novell.com/show_bug.cgi?id=575955#c0
           Summary: Accessing 2D array cells in dynamically generated code
                    causes crash (assert)
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: PC
        OS/Version: Windows 7
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: aChrisSmith at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---
Description of Problem:
Accessing a 2D array's cell in the F# interactive window causes a Mono
assert/crash:
ERROR:reflection.c:11288:resolve_object: code should not be reached
Steps to reproduce the problem:
1. Download the latest F# CTP at:
http://www.microsoft.com/downloads/details.aspx?FamilyID=b55f0532-ac3c-4106-918c-5586a953a7da&displaylang=en
2. Run the F# interactive window (FSI.exe)
3. Enter the following code:
-----------------
// [1; 2]
let s = [1 .. 2]
// [ [1; 2]; [1; 2]; [1; 2] ]
let q = [s; s; s]
// q => int[,]
let a = array2D q;;
printfn "Access a cell"
let accessCell = a.[1,1];; // BANG
printfn "Update a cell"
a.[1,1] <- 3;;  // BANG
-----------------
Actual Results:
Crash / assert
Expected Results:
It works as expected. (Accessing the array cell and/or updating.)
How often does this happen? 
Every time.
Additional Information:
The code snippet compiles and JITs just fine, this only happens when in the F#
interactive window. This would indicate a bug in Reflection.Emit or dynamically
generated code.
Here is a full console session showing the bug in action:
---------------
C:\Program Files (x86)\FSharp-1.9.7.8\bin>type repro-6272.fs
module BugRepro
// [1; 2]
let s = [1 .. 2]
// [ [1; 2]; [1; 2]; [1; 2] ]
let q = [s; s; s]
// q => int[,]
let a = array2D q
printfn "Access a cell"
let accessCell = a.[1,1]
printfn "Update a cell"
a.[1,1] <- 3
C:\Program Files (x86)\FSharp-1.9.7.8\bin>mono fsc.exe repro-6272.fs
Microsoft F# Compiler, (c) Microsoft Corporation, All Rights Reserved
F# Version 1.9.7.8, compiling for .NET Framework Version v2.0.50727
C:\Program Files (x86)\FSharp-1.9.7.8\bin>mono repro-6272.exe
Access a cell
Update a cell
C:\Program Files (x86)\FSharp-1.9.7.8\bin>mono fsi.exe
Microsoft F# Interactive, (c) Microsoft Corporation, All Rights Reserved
F# Version 1.9.7.8, compiling for .NET Framework Version v2.0.50727
For help type #help;;
>
// [1; 2]
let s = [1 .. 2]
// [ [1; 2]; [1; 2]; [1; 2] ]
let q = [s; s; s]
// q => int[,]
let a = array2D q;;
val s : int list = [1; 2]
val q : int list list = [[1; 2]; [1; 2]; [1; 2]]
val a : int [,] = [[1; 2]
                   [1; 2]
                   [1; 2]]
> printfn "Access a cell"
let accessCell = a.[1,1];;
MonoArrayMethod
**
ERROR:reflection.c:11288:resolve_object: code should not be reached
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
C:\Program Files (x86)\FSharp-1.9.7.8\bin>mono fsi.exe
Microsoft F# Interactive, (c) Microsoft Corporation, All Rights Reserved
F# Version 1.9.7.8, compiling for .NET Framework Version v2.0.50727
For help type #help;;
> // [1; 2]
let s = [1 .. 2]
// [ [1; 2]; [1; 2]; [1; 2] ]
let q = [s; s; s]
// q => int[,]
let a = array2D q;;
val s : int list = [1; 2]
val q : int list list = [[1; 2]; [1; 2]; [1; 2]]
val a : int [,] = [[1; 2]
                   [1; 2]
                   [1; 2]]
> printfn "Update a cell"
a.[1,1] <- 3
;;
MonoArrayMethod
**
ERROR:reflection.c:11288:resolve_object: code should not be reached
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
-- 
Configure bugmail: http://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