[Mono-bugs] [Bug 542690] New: Mono runtime crashes when evaluating F# values of generic type

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Sep 28 17:08:45 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=542690


           Summary: Mono runtime crashes when evaluating F# values of
                    generic type
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.4.x
          Platform: PC
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: bjorn.lisper at mdh.se
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User


Description of Problem:
With F# v. 1.9.6.16, fsi causes the Mono runtime to crash when trying to
evaluate a value of a user-defined generic type

Steps to reproduce the problem:
1. Start fsi in a console window.
2. Define a generic type at the fsi prompt, like:

> type Tree<'a> = Tree of 'a * Tree<'a> * Tree<'a> | Tip of 'a;;

type Tree<'a> =
  | Tree of 'a * Tree<'a> * Tree<'a>
  | Tip of 'a

3. Try to evaluate a value of type Tree<int>:

> Tip 13;;

Actual Results:

**
** ERROR:(class.c:5188):mono_class_get_field_default_value: assertion failed:
(cindex)
Stacktrace:

  at (wrapper managed-to-native) System.Reflection.MonoField.GetValueInternal
(object) <0x00004>
  at (wrapper managed-to-native) System.Reflection.MonoField.GetValueInternal
(object) <0xffffffff>
  at System.Reflection.MonoField.GetValue (object) <0x0004b>
  at Microsoft.FSharp.Reflection.Impl/getUnionTypeTagFields at 233.Invoke
(System.Reflection.FieldInfo,System.Reflection.FieldInfo) <0x0001b>
  at Microsoft.FSharp.Core.FastFunc`2<System.Reflection.FieldInfo,
System.Reflection.FieldInfo>.InvokeFast<int>
(Microsoft.FSharp.Core.FastFunc`2<System.Reflection.FieldInfo,
Microsoft.FSharp.Core.FastFunc`2<System.Reflection.FieldInfo,
int>>,System.Reflection.FieldInfo,System.Reflection.FieldInfo) <0x00047>
  at Microsoft.FSharp.Collections.ArrayModule.sortInPlaceWith<object>
(Microsoft.FSharp.Core.FastFunc`2<object,
Microsoft.FSharp.Core.FastFunc`2<object, int>>,object[]) <0x00066>
  at Microsoft.FSharp.Reflection.Impl.getUnionTypeTagFields
(System.Type,System.Reflection.BindingFlags) <0x00079>
  at Microsoft.FSharp.Reflection.Impl.getUnionTypeTagNameMap
(System.Type,System.Reflection.BindingFlags) <0x00026>
  at Microsoft.FSharp.Reflection.Impl.getUnionTagConverter
(System.Type,System.Reflection.BindingFlags) <0x0006c>
  at Microsoft.FSharp.Reflection.UnionCaseInfo.get_Name () <0x00043>
  at
Internal.Utilities.StructuredFormat.ReflectUtils/Value.GetValueInfoOfObject$cont at 316
(System.Reflection.BindingFlags,object,System.Type,Microsoft.FSharp.Core.Unit)
<0x000ac>
  at
Internal.Utilities.StructuredFormat.ReflectUtils/Value.GetValueInfoOfObject
(System.Reflection.BindingFlags,object) <0x000ba>
  at
Internal.Utilities.StructuredFormat.ReflectUtils/Value.GetValueInfo<object>
(System.Reflection.BindingFlags,object) <0x0001f>
  at Internal.Utilities.StructuredFormat.Display.anyL<object>
(Internal.Utilities.StructuredFormat.Display/ShowMode,System.Reflection.BindingFlags,Internal.Utilities.StructuredFormat.FormatOptions,object)
<0x0009a>
  at Internal.Utilities.StructuredFormat.Display.any_to_layout<object>
(Internal.Utilities.StructuredFormat.FormatOptions,object) <0x00032>
  at (wrapper static-rgctx-invoke)
Internal.Utilities.StructuredFormat.Display.static_rgctx_invoke_Layout_FormatOptions_FSI_0002/Tree`1<int>
(Internal.Utilities.StructuredFormat.FormatOptions,FSI_0002/Tree`1<int>)
<0xffffffff>
  at (wrapper runtime-invoke)
Internal.Utilities.StructuredFormat.Display.runtime_invoke_object_object_object
(object,intptr,intptr,intptr) <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke
(object,object[],System.Exception&) <0x00004>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke
(object,object[],System.Exception&) <0xffffffff>
  at System.Reflection.MonoMethod.Invoke
(object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
<0x000a4>
  at System.Reflection.MethodBase.Invoke (object,object[]) <0x00025>
  at Microsoft.FSharp.Compiler.Interactive.Shell.callGenericStaticMethod
(System.Type,string,Microsoft.FSharp.Collections.FSharpList`1<System.Type>,Microsoft.FSharp.Collections.FSharpList`1<object>)
<0x00077>
  at Microsoft.FSharp.Compiler.Interactive.Shell/ValuePrinting.printVal
(Microsoft.FSharp.Compiler.Interactive.Shell/ValuePrinting/PrintMode,Internal.Utilities.StructuredFormat.FormatOptions,object,System.Type)
<0x00101>
  at
Microsoft.FSharp.Compiler.Interactive.Shell/ValuePrinting.invokeExprPrinter
(Microsoft.FSharp.Compiler.Tastops/DisplayEnv,Microsoft.FSharp.Compiler.Tast/Val)
<0x0003f>
  at Microsoft.FSharp.Compiler.Interactive.Shell.EvalExpr
(Microsoft.FSharp.Compiler.Interactive.Shell/InteractionState,Microsoft.FSharp.Compiler.Ast/SynExpr)
<0x003c6>
  at Microsoft.FSharp.Compiler.Interactive.Shell/execInteraction at 1429.Invoke
(Microsoft.FSharp.Compiler.Interactive.Shell/InteractionState) <0x014f1>
  at Microsoft.FSharp.Compiler.Interactive.Shell.InteractiveCatch<object>
(Microsoft.FSharp.Core.FastFunc`2<object, Microsoft.FSharp.Core.Tuple`2<object,
Microsoft.FSharp.Compiler.Interactive.Shell/stepStatus>>,object) <0x00036>
  at Microsoft.FSharp.Compiler.Interactive.Shell.execInteraction
(bool,Microsoft.FSharp.Compiler.Build/TcConfig,Microsoft.FSharp.Compiler.Interactive.Shell/InteractionState,Microsoft.FSharp.Compiler.Ast/interaction)
<0x00040>
  at Microsoft.FSharp.Compiler.Interactive.Shell.execInteractions
(bool,Microsoft.FSharp.Compiler.Build/TcConfig,Microsoft.FSharp.Compiler.Interactive.Shell/InteractionState,Microsoft.FSharp.Core.Option`1<Microsoft.FSharp.Compiler.Ast/interaction>)
<0x00598>
  at
Microsoft.FSharp.Compiler.Interactive.Shell.MainThreadProcessParsedInteraction
(bool,Microsoft.FSharp.Core.Option`1<Microsoft.FSharp.Compiler.Ast/interaction>,Microsoft.FSharp.Compiler.Interactive.Shell/InteractionState)
<0x00097>
  at Microsoft.FSharp.Compiler.Interactive.Shell/res at 1566-4.Invoke
(Microsoft.FSharp.Compiler.Interactive.Shell/InteractionState) <0x0001c>
  at
Microsoft.FSharp.Compiler.Interactive.Shell/runCodeOnMainThread at 1813-2<object>.Invoke
(Microsoft.FSharp.Core.Unit) <0x0001e>
  at
Microsoft.FSharp.Compiler.Interactive.Shell/RunCodeOnWinFormsMainThread at 520<object>.Invoke
() <0x00026>
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__
(object,intptr,intptr,intptr) <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke
(object,object[],System.Exception&) <0x00004>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke
(object,object[],System.Exception&) <0xffffffff>
  at System.Reflection.MonoMethod.Invoke
(object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
<0x000a4>
  at System.Reflection.MethodBase.Invoke (object,object[]) <0x00025>
  at System.Delegate.DynamicInvokeImpl (object[]) <0x0018a>
  at System.MulticastDelegate.DynamicInvokeImpl (object[]) <0x00034>
  at System.Delegate.DynamicInvoke (object[]) <0x00019>
  at System.Windows.Forms.XplatUIDriverSupport.ExecutionCallback (object)
<0x0003f>
  at System.Security.SecurityContext.Run
(System.Security.SecurityContext,System.Threading.ContextCallback,object)
<0x00106>
  at System.Threading.ExecutionContext.Run
(System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
<0x0002a>
  at System.Windows.Forms.XplatUIDriverSupport.ExecuteClientMessage
(System.Runtime.InteropServices.GCHandle) <0x00083>
  at System.Windows.Forms.XplatUIX11.GetMessage
(object,System.Windows.Forms.MSG&,intptr,int,int) <0x02adb>
  at System.Windows.Forms.XplatUI.GetMessage
(object,System.Windows.Forms.MSG&,intptr,int,int) <0x00029>
  at System.Windows.Forms.Application.RunLoop
(bool,System.Windows.Forms.ApplicationContext) <0x00add>
  at System.Windows.Forms.Application.Run
(System.Windows.Forms.ApplicationContext) <0x00052>
  at System.Windows.Forms.Application.Run () <0x00035>
  at Microsoft.FSharp.Compiler.Interactive.Shell/main at 1770-3.Run () <0x0004a>
  at Microsoft.FSharp.Compiler.Interactive.Shell.runLoop at 1832
(Microsoft.FSharp.Core.Unit) <0x000be>
  at Microsoft.FSharp.Compiler.Interactive.Shell.main () <0x004b2>
  at <StartupCode$Fsi>.$Microsoft.FSharp.Compiler.Interactive.Shell.main@ ()
<0x013a6>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        mono [0x80cbfb4]
        [0xffffe410]
        /lib/libc.so.6(abort+0x188) [0xb7cfe238]
        /usr/lib/libglib-2.0.so.0(g_assertion_message+0x129) [0xb7eeb049]
        /usr/lib/libglib-2.0.so.0 [0xb7eeb4dd]
        mono [0x819990a]
        mono(mono_field_static_get_value+0x5d) [0x816e6cd]
        mono [0x8178de2]
        [0xb4c666d0]
        [0xb4c664d4]
        [0xb4271ddc]
        [0xb4271d88]
        [0xb459b347]
        [0xb4271bea]
        [0xb4271b37]
        [0xb4271a1d]
        [0xb427196c]
        [0xb426fdad]
        [0xb426f693]
        [0xb426f4d8]
        [0xb426f273]
        [0xb426f123]
        [0xb426f0d9]
        [0xb426f049]
        mono(mono_runtime_invoke_array+0x38a) [0x8170b7a]
        mono [0x817906a]
        [0xb62d7f93]
        [0xb62d7aad]
        [0xb4591b0e]
        [0xb428eed0]
        [0xb428ebfa]
        [0xb428e970]
        [0xb42a9757]
        [0xb4589742]
        [0xb6132267]
        [0xb4588219]
        [0xb4592499]
        [0xb4591cc8]
        [0xb4591c1d]
        [0xb4591bf7]
        [0xb4591b3f]
        [0xb5d3ed10]
        mono(mono_runtime_invoke_array+0x38a) [0x8170b7a]
        mono [0x817906a]
        [0xb62d7f93]
        [0xb62d7aad]
        [0xb4591b0e]
        [0xb4591a7b]
        [0xb45918dd]
        [0xb45918a2]
        [0xb4591848]
        [0xb45913cf]
        [0xb459124b]
        [0xb4591124]
        [0xb4bf8074]
        [0xb4bf5592]
        [0xb4bf4ff6]
        [0xb4bf44c3]
        [0xb4bf409e]
        [0xb4bf3ffb]
        [0xb4bf3a17]
        [0xb61320bb]
        [0xb78fd86f]
        [0xb78fc1fa]
        mono(mono_runtime_exec_main+0xe5) [0x816e8a5]
        mono(mono_runtime_run_main+0x16d) [0x816f04d]
        mono(mono_main+0x18fa) [0x80b385a]
        mono [0x805af11]
        /lib/libc.so.6(__libc_start_main+0xe5) [0xb7ce85f5]
        mono [0x805ae41]

Debug info from gdb:

(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0xb7cd1900 (LWP 27044)]
[New Thread 0xb43ffb90 (LWP 27049)]
[New Thread 0xb50ffb90 (LWP 27048)]
[New Thread 0xb74fbb90 (LWP 27046)]
[New Thread 0xb78fbb90 (LWP 27045)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
0xffffe430 in __kernel_vsyscall ()
  5 Thread 0xb78fbb90 (LWP 27045)  0xffffe430 in __kernel_vsyscall ()
  4 Thread 0xb74fbb90 (LWP 27046)  0xffffe430 in __kernel_vsyscall ()
  3 Thread 0xb50ffb90 (LWP 27048)  0xffffe430 in __kernel_vsyscall ()
  2 Thread 0xb43ffb90 (LWP 27049)  0xffffe430 in __kernel_vsyscall ()
  1 Thread 0xb7cd1900 (LWP 27044)  0xffffe430 in __kernel_vsyscall ()

Thread 5 (Thread 0xb78fbb90 (LWP 27045)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e493e6 in nanosleep () from /lib/libpthread.so.0
#2  0x081a8c48 in ?? ()
#3  0xb7e42175 in start_thread () from /lib/libpthread.so.0
#4  0xb7d9fdae in clone () from /lib/libc.so.6

Thread 4 (Thread 0xb74fbb90 (LWP 27046)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e47ee5 in sem_wait@@GLIBC_2.1 () from /lib/libpthread.so.0
#2  0x080faad9 in ?? ()
#3  0x08133bf8 in ?? ()
#4  0x081af4f6 in ?? ()
#5  0x081ce155 in ?? ()
#6  0xb7e42175 in start_thread () from /lib/libpthread.so.0
#7  0xb7d9fdae in clone () from /lib/libc.so.6

Thread 3 (Thread 0xb50ffb90 (LWP 27048)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e493e6 in nanosleep () from /lib/libpthread.so.0
#2  0x081ae2f0 in ?? ()
#3  0x0813309b in ?? ()
#4  0xb5d37814 in ?? ()
#5  0xb5d3778d in ?? ()
#6  0xb5d37405 in ?? ()
#7  0xb79022b0 in ?? ()
#8  0x0816bf94 in mono_runtime_delegate_invoke ()
#9  0x08133c7f in ?? ()
#10 0x081af4f6 in ?? ()
#11 0x081ce155 in ?? ()
#12 0xb7e42175 in start_thread () from /lib/libpthread.so.0
#13 0xb7d9fdae in clone () from /lib/libc.so.6

Thread 2 (Thread 0xb43ffb90 (LWP 27049)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e45c15 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x081b8d91 in ?? ()
#3  0x081b8e14 in ?? ()
#4  0x081b9baa in ?? ()
#5  0x08130ba3 in ?? ()
#6  0xb4592e75 in ?? ()
#7  0xb45878d5 in ?? ()
#8  0xb4592942 in ?? ()
#9  0xb45928c3 in ?? ()
#10 0xb459285b in ?? ()
#11 0xb45903eb in ?? ()
#12 0xb4590352 in ?? ()
#13 0xb45902d4 in ?? ()
#14 0xb458fe36 in ?? ()
#15 0xb458fc92 in ?? ()
#16 0xb458fc49 in ?? ()
#17 0xb458faaf in ?? ()
#18 0xb62d8d6b in ?? ()
#19 0xb45e0395 in ?? ()
#20 0xb6132267 in ?? ()
#21 0xb45e01d8 in ?? ()
#22 0xb4bf3de3 in ?? ()
#23 0xb79022b0 in ?? ()
#24 0x0816bf94 in mono_runtime_delegate_invoke ()
#25 0x08133c7f in ?? ()
#26 0x081af4f6 in ?? ()
#27 0x081ce155 in ?? ()
#28 0xb7e42175 in start_thread () from /lib/libpthread.so.0
#29 0xb7d9fdae in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb7cd1900 (LWP 27044)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e48bab in read () from /lib/libpthread.so.0
#2  0x080cc156 in ?? ()
#3  <signal handler called>
#4  0xffffe430 in __kernel_vsyscall ()
#5  0xb7cfc900 in raise () from /lib/libc.so.6
#6  0xb7cfe238 in abort () from /lib/libc.so.6
#7  0xb7eeb049 in g_assertion_message () from /usr/lib/libglib-2.0.so.0
#8  0xb7eeb4dd in g_assertion_message_expr () from /usr/lib/libglib-2.0.so.0
#9  0x0819990a in ?? ()
#10 0x0816e6cd in mono_field_static_get_value ()
#11 0x08178de2 in ?? ()
#12 0xb4c666d0 in ?? ()
#13 0xb4c664d4 in ?? ()
#14 0xb4271ddc in ?? ()
#15 0xb4271d88 in ?? ()
#16 0xb459b347 in ?? ()
#17 0xb4271bea in ?? ()
#18 0xb4271b37 in ?? ()
#19 0xb4271a1d in ?? ()
#20 0xb427196c in ?? ()
#21 0xb426fdad in ?? ()
#22 0xb426f693 in ?? ()
#23 0xb426f4d8 in ?? ()
#24 0xb426f273 in ?? ()
#25 0xb426f123 in ?? ()
#26 0xb426f0d9 in ?? ()
#27 0xb426f049 in ?? ()
#28 0x08170b7a in mono_runtime_invoke_array ()
#29 0x0817906a in ?? ()
#30 0xb62d7f93 in ?? ()
#31 0xb62d7aad in ?? ()
#32 0xb4591b0e in ?? ()
#33 0xb428eed0 in ?? ()
#34 0xb428ebfa in ?? ()
#35 0xb428e970 in ?? ()
#36 0xb42a9757 in ?? ()
#37 0xb4589742 in ?? ()
#38 0xb6132267 in ?? ()
#39 0xb4588219 in ?? ()
#40 0xb4592499 in ?? ()
#41 0xb4591cc8 in ?? ()
#42 0xb4591c1d in ?? ()
#43 0xb4591bf7 in ?? ()
#44 0xb4591b3f in ?? ()
#45 0xb5d3ed10 in ?? ()
#46 0x08170b7a in mono_runtime_invoke_array ()
#47 0x0817906a in ?? ()
#48 0xb62d7f93 in ?? ()
#49 0xb62d7aad in ?? ()
#50 0xb4591b0e in ?? ()
#51 0xb4591a7b in ?? ()
#52 0xb45918dd in ?? ()
#53 0xb45918a2 in ?? ()
#54 0xb4591848 in ?? ()
#55 0xb45913cf in ?? ()
#56 0xb459124b in ?? ()
#57 0xb4591124 in ?? ()
#58 0xb4bf8074 in ?? ()
#59 0xb4bf5592 in ?? ()
#60 0xb4bf4ff6 in ?? ()
#61 0xb4bf44c3 in ?? ()
#62 0xb4bf409e in ?? ()
#63 0xb4bf3ffb in ?? ()
#64 0xb4bf3a17 in ?? ()
#65 0xb61320bb in ?? ()
#66 0xb78fd86f in ?? ()
#67 0xb78fc1fa in ?? ()
#68 0x0816e8a5 in mono_runtime_exec_main ()
#69 0x0816f04d in mono_runtime_run_main ()
#70 0x080b385a in mono_main ()
#71 0x0805af11 in ?? ()
#72 0xb7ce85f5 in __libc_start_main () from /lib/libc.so.6
#73 0x0805ae41 in ?? ()
#0  0xffffe430 in __kernel_vsyscall ()

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted

Expected Results:

The printout

val it : Tree<int> = Tip 13

How often does this happen?

It seems to happen every time. I tried several similar type definitions, and
the runtime crashed every time I tried to evaluate a value of that type.

Additional Information:

Works fine with the same version of F# (fsi) on Windows XP with .NET.

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