[Mono-bugs] [Bug 381547] New: Bad IL codegen when running F# FSI console

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Apr 18 17:10:11 EDT 2008


           Summary: Bad IL codegen when running F# FSI console
           Product: Mono: Runtime
           Version: 1.9.0
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: chrsmith at microsoft.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Description of Problem:
A System.InvalidProgramException is thrown when compiling F# code through a F#
Interactive session.

Steps to reproduce the problem:
1. Download the latest F# research release (currently at:
2. Run 'mono fsi.exe'
3. Type the following lines into the console (the ';;' compiles the line of
code, and type "#q;;" to quit.)

let mapR a b f = List.init (b-a+1) (fun i -> f (i+a));;
mapR 1 2 (fun x -> x);;

Actual Results:
Evaluates and prints "[1; 2]"

Expected Results:
Crash (see below)

How often does this happen? 
Every time.

Additional Information:
If you need anything else, please let me know at:
chrsmith at Microsoft.com

C:\Users\chrsmith\MonoBug>mono "c:\Program Files\FSharp-\bin\fsi.exe"

MSR F# Interactive, (c) Microsoft Corporation, All Rights Reserved
F# Version, compiling for .NET Framework Version v2.0.50727

NOTE: See 'fsi --help' for flags
NOTE: Commands: #r <string>;;    reference (dynamically load) the given DLL.
NOTE:           #I <string>;;    add the given search path for referenced DLLs.
NOTE:           #use <string>;;  accept input from the given file.
NOTE:           #load <string> ...<string>;;
NOTE:                            load the given file(s) as a compilation unit.
NOTE:           #time;;          toggle timing on/off.
NOTE:           #types;;         toggle display of types on/off.
NOTE:           #quit;;          exit.
NOTE: Visit the F# website at http://research.microsoft.com/fsharp.
NOTE: Bug reports to fsbugs at microsoft.com. Enjoy!

> let mapR a b f = List.init (b-a+1) (fun i -> f (i+a));;

val mapR : int -> int -> (int -> 'a) -> 'a list

> mapR 1 2 (fun x -> x);;
System.InvalidProgramException: Invalid IL code in mapR at 1:.ctor
(int,Microsoft.FSharp.Core.FastFunc`2): IL_0000: ldloc.2

  at FSI_0002.mapR[Int32] (Int32 a, Int32 b, Microsoft.FSharp.Core.FastFunc`2
f) [0x00000]
  at <StartupCode$FSI_0003>.FSI_0003._main () [0x00000]
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x0000
stopped due to error
> #q;;

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list