Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 41970 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Running this code as a whole causes a OutOfMemoryException, while in parts it works as expected:
type Enu = A=1
seq[ Enu.A ] |> Seq.windowed 1 |> Seq.map id
Should result in seq<Enu>, but results in OutOfMemoryException, when executed all at once.
On windows with fsi 14.0.23413.0 it works, on fedora with fsharpi version from repository it doesn't.
Mono JIT compiler version 4.2.3 (Stable 126.96.36.199/832de4b Tue Mar 15 11:39:54 EDT 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
LLVM: supported, not enabled.
The stack trace:
System.OutOfMemoryException: Out of memory
at (wrapper alloc) System.Object:AllocVector (intptr,intptr)
at <StartupCode$FSI_0002>.$FSI_0002.main@ () <0x40853530 + 0x00032> in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object,System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) <0x7f5f0d3f3940 + 0x000a3> in <filename unknown>:0
Stopped due to error
This could be tail optimization issue
There's a fix recently around tail call optimizations https://bugzilla.xamarin.com/show_bug.cgi?id=42606
Can you try if that fixes your issue?
Updating to 4.6.0 does not fix the issue.
not sure if I'm doing this right:
can you help me reproducing it?
Sure, I think what you are doing is executing the code in parts (using ;;) - which works.
However if you copy the entire snippet and execute it afterwards thusly
type Enu = A=1
seq[ Enu.A ] |> Seq.windowed 1 |> Seq.map id;;
it will throw an exception.
Hope this helps.
More info provided
mono 4.6 crashes with:
#6 0x002efd18 in mono_gc_make_descr_for_array (vector=1, numbits=1073741823, elem_size=<value temporarily unavailable, due to optimizations>) at sgen-descriptor.c:174
#7 0x002a9520 in mono_class_compute_gc_descriptor (klass=0x7efb0018) at object.c:1047
#8 0x002a7f2e in mono_class_vtable_full (domain=0x0, klass=0x7efb0018, error=0x0) at object.c:2068
#9 0x002aa3b1 in mono_class_vtable (domain=0x7d113470, klass=0x7efb0018) at object.c:1882
#10 0x000dfe41 in mono_method_to_ir (cfg=0x0, method=0x1, start_bblock=<value temporarily unavailable, due to optimizations>, end_bblock=<value temporarily unavailable, due to optimizations>, return_var=0x0, is_virtual_call=<value temporarily unavailable, due to optimizations>) at method-to-ir.c:11892
This looks like a SRE issue.
Zoltan, can you take a look?