[Mono-bugs] [Bug 543363] New: GetCustomAttributes crashes runtime

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Sep 30 20:41:34 EDT 2009


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


           Summary: GetCustomAttributes crashes runtime
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Macintosh
        OS/Version: Mac
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: johan.otto at justenough.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


Description of Problem:


Steps to reproduce the problem:
1. Declare your own custom attribute class, inherit from it to make a derived
attribute class. Add some properties and default + constructors
2. Serialize a custom class from XML.
3. When the XmlReflection importer reflects a property with more than one
custom attribute, the runtime crashes.


Actual Results:

1) Runtime crashes during a manged-to-native transition. More detail attached.
2) Not picking up XmlIgnore attributes when building the XmlTypeMapping.

Expected Results:

1) 


How often does this happen? 


Additional Information:

at (wrapper managed-to-native)
System.MonoCustomAttrs.GetCustomAttributesInternal
(System.Reflection.ICustomAttributeProvider,System.Type,bool) <0x00004>
  at (wrapper managed-to-native)
System.MonoCustomAttrs.GetCustomAttributesInternal
(System.Reflection.ICustomAttributeProvider,System.Type,bool) <IL 0x00023,
0xffffffff>
  at System.MonoCustomAttrs.GetCustomAttributesBase
(System.Reflection.ICustomAttributeProvider,System.Type) <IL 0x0001c, 0x00046>
  at System.MonoCustomAttrs.GetCustomAttributes
(System.Reflection.ICustomAttributeProvider,bool) <IL 0x00019, 0x00025>
  at System.Reflection.MonoProperty.GetCustomAttributes (bool) <IL 0x00002,
0x00012>
  at System.Xml.Serialization.XmlAttributes..ctor
(System.Reflection.ICustomAttributeProvider) <IL 0x00034, 0x00061>
  at System.Xml.Serialization.XmlReflectionImporter.GetReflectionMembers
(System.Type) <IL 0x0022c, 0x00572>
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping
(System.Xml.Serialization.TypeData,System.Xml.Serialization.XmlRootAttribute,string)
<IL 0x0007c, 0x00197>
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping
(System.Xml.Serialization.TypeData,System.Xml.Serialization.XmlRootAttribute,string)
<IL 0x00072, 0x0009e>
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping
(System.Type,System.Xml.Serialization.XmlRootAttribute,string) <IL 0x00045,
0x00034>
  at System.Xml.Serialization.XmlSerializer..ctor
(System.Type,System.Xml.Serialization.XmlAttributeOverrides,System.Type[],System.Xml.Serialization.XmlRootAttribute,string)
<IL 0x0004e, 0x00089>
  at System.Xml.Serialization.XmlSerializer..ctor (System.Type) <IL 0x00006,
0x0001b>
  at Kinetic.Library.Xml.XmlUtil.CreateXmlSerializer
(Kinetic.Library.Xml.XmlSerializeSettings,int&) [0x00028] in
/Users/johanotto/Projects/Kinetic/library/XML/Xml.cs:288
  at Kinetic.Library.Xml.XmlUtil.CreateXmlSerializer
(Kinetic.Library.Xml.XmlSerializeSettings) [0x00002] in
/Users/johanotto/Projects/Kinetic/library/XML/Xml.cs:183
  at Kinetic.Library.Xml.XmlUtil.ConvertFromXml
(Kinetic.Library.Xml.XmlSerializeSettings) [0x00079] in
/Users/johanotto/Projects/Kinetic/library/XML/Xml.cs:527
  at Kinetic.Library.Xml.XmlFragment.ToObject<object>
(Kinetic.Library.Xml.XmlSerializeSettings) <0x00055>
  at Kinetic.Library.Xml.XmlFragment.Deserialize<object> (System.Xml.XmlNode)
<0x000ae>
  at Kinetic.Library.DataAccess.Web.WebInputOutputBase.GetImpl<object>
(string,Kinetic.Library.DataAccess.Web.GetMethodHandler,object[]&) <0x001ff>
  at Kinetic.Library.DataAccess.Web.WebInputOutputBase.Get<object>
(Kinetic.Library.DataAccess.Web.GetMethodHandler,Kinetic.Library.Business.BusinessObject)
<0x00065>
  at Kinetic.Business.Customers.Mechanism.CustomersWebInputOutput.GetCustomer
(Kinetic.Business.Customers.Customer) [0x00011] in
/Users/johanotto/Projects/Kinetic/Business/Customers/Mechanism/CustomersWebInputOutput.cs:3184
  at Kinetic.Business.Customers.Mechanism.CustomersWebInputOutput.GetCustomer
() [0x00000] in /Users/johanotto/Projects/Kinetic/Business/CustomersWeb request
ended. -> GetCustomer
Converting fetched data to business objects.
-> Elapsed: 4s 448ms                -    Total Time: 4s 466ms                - 
  Decompressing stream.... (2 / 3)
Xml Fragment: -> Decompressing from 382 Bytes to 353 Bytes. Ratio 108.22 % 
/Mechanism/CustomersWebInputOutput.cs:3215
  at Kinetic.Business.Customers.CustomersProcess.GetCustomer () [0x00000] in
/Users/johanotto/Projects/Kinetic/Business/Customers/CustomersProcess.cs:3712
  at Kinetic.IPhone.AppDelegate.ButtonTouchDown (object,System.EventArgs)
[0x00042] in /Users/johanotto/Projects/Kinetic/IPhone/Application/Main.cs:58
  at MonoTouch.UIKit.UIControlEventProxy.Activated () <IL 0x00011, 0x0001e>
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__
(object,intptr,intptr,intptr) <IL 0x00043, 0xffffffff>
  at (wrapper managed-to-native)
MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr)
<0x00004>
  at (wrapper managed-to-native)
MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr)
<IL 0x0009f, 0xffffffff>
  at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <IL 0x0003e,
0x00089>
  at MonoTouch.UIKit.UIApplication.Main (string[]) <IL 0x00003, 0x00014>
  at Kinetic.IPhone.Application.Main (string[]) [0x00000] in
/Users/johanotto/Projects/Kinetic/IPhone/Application/Main.cs:21
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object
(object,intptr,intptr,intptr) <IL 0x00044, 0xffffffff>

Native stacktrace:

    0   JustEnough                          0x0009222a
mono_handle_native_sigsegv + 266
    1   JustEnough                          0x0000637a
mono_sigsegv_signal_handler + 298
    2   libSystem.B.dylib                   0x9325c2bb _sigtramp + 43
    3   ???                                 0xffffffff 0x0 + 4294967295
    4   JustEnough                          0x0016ebb1 mono_param_get_objects +
2801
    5   JustEnough                          0x0016ed14
mono_custom_attrs_construct + 132
    6   JustEnough                          0x00170977
mono_reflection_get_custom_attrs_by_type + 359
    7   JustEnough                          0x0010ec41
ves_icall_System_Environment_get_UserName + 4897
    8   ???                                 0x03e7f6b8 0x0 + 65533624
    9   ???                                 0x03e7f5ff 0x0 + 65533439
    10  ???                                 0x079272b6 0x0 + 127038134
    11  ???                                 0x07b76f73 0x0 + 129462131
    12  ???                                 0x07926c8a 0x0 + 127036554
    13  ???                                 0x079694e3 0x0 + 127309027
    14  ???                                 0x07968348 0x0 + 127304520
    15  ???                                 0x079673ef 0x0 + 127300591
    16  ???                                 0x07967295 0x0 + 127300245
    17  ???                                 0x07b76ca2 0x0 + 129461410
    18  ???                                 0x07b76c0c 0x0 + 129461260
    19  ???                                 0x07b76967 0x0 + 129460583
    20  ???                                 0x07b768c3 0x0 + 129460419
    21  ???                                 0x07b76478 0x0 + 129459320
    22  ???                                 0x07b7614e 0x0 + 129458510
    23  ???                                 0x07b3c0e7 0x0 + 129220839
    24  ???                                 0x0796dd50 0x0 + 127327568
    25  ???                                 0x0796db3e 0x0 + 127327038
    26  ???                                 0x0796dab2 0x0 + 127326898
    27  ???                                 0x0796d9a0 0x0 + 127326624
    28  ???                                 0x0796d8f7 0x0 + 127326455
    29  ???                                 0x03e8be53 0x0 + 65584723
    30  ???                                 0x03e8bd0f 0x0 + 65584399
    31  ???                                 0x03e810d8 0x0 + 65540312
    32  JustEnough                          0x0000c67d mono_jit_compile_method
+ 317
    33  JustEnough                          0x001f2182 monotouch_trampoline +
1552
    34  UIKit                               0x0167f459
objc_category_name_CALayer_TextEffectsLayerOrdering + 42073
    35  UIKit                               0x016e2ba2 UIDrawNavBarBackground +
140134
    36  UIKit                               0x016e4dc3 UIDrawNavBarBackground +
148871
    37  UIKit                               0x016e3d29 UIDrawNavBarBackground +
144621
    38  UIKit                               0x01698d87 _UIWindowVisible + 9675
    39  UIKit                               0x0168281c
UIApplicationInstantiateSingleton + 13083
    40  UIKit                               0x016890b5
_UIApplicationLinkedOnOrAfter + 5183
    41  GraphicsServices                    0x01096ef1
GSEventIsChordingHandEvent + 1637
    42  CoreFoundation                      0x008aab80 CFRunLoopRunSpecific +
3888
    43  CoreFoundation                      0x008a9c48 CFRunLoopRunInMode + 88
    44  GraphicsServices                    0x010957ad GSEventRunModal + 217
    45  GraphicsServices                    0x01095872 GSEventRun + 115
    46  UIKit                               0x0168a003 UIApplicationMain + 1157
    47  ???                                 0x03e85759 0x0 + 65558361
    48  ???                                 0x03e85692 0x0 + 65558162
    49  ???                                 0x03e84ef5 0x0 + 65556213
    50  ???                                 0x03e84ec9 0x0 + 65556169
    51  ???                                 0x03e84e63 0x0 + 65556067
    52  JustEnough                          0x0000c67d mono_jit_compile_method
+ 317
    53  JustEnough                          0x00159a4b mono_runtime_exec_main +
251
    54  JustEnough                          0x0015c675 mono_runtime_run_main +
405
    55  JustEnough                          0x001f41d9 main + 463
    56  JustEnough                          0x00001e16 start + 54
    57  ???                                 0x00000001 0x0 + 1

Debug info from gdb:

warning: Trying to remove a section from the ordered section list that did not
exist at 0x2d2000.
warning: Could not find object file
"/var/folders/qK/qKvZ0ty1F1aU60kEyE9y3++++TI/-Tmp-/tmp7f14c27f.tmp/main.o" - no
debug information available for
"/var/folders/qK/qKvZ0ty1F1aU60kEyE9y3++++TI/-Tmp-/tmp7f14c27f.tmp/main.m".

Attaching to process 8852.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ......................................
done
0x93213f95 in read$UNIX2003 ()
  9 process 8852 thread 0x4d0b  0x931f746e in __semwait_signal ()
  8 process 8852 thread 0x5803  0x931f746e in __semwait_signal ()
  7 process 8852 thread 0x5303  0x93256e0e in poll$UNIX2003 ()
  6 process 8852 thread 0x5003  0x931f746e in __semwait_signal ()
  5 process 8852 thread 0x2703  0x931f0286 in mach_msg_trap ()
  4 process 8852 thread 0x2603  0x931f02c2 in semaphore_wait_trap ()
  3 process 8852 thread 0x2203  0x931f746e in __semwait_signal ()
  2 process 8852 thread 0x1103  0x931f0286 in mach_msg_trap ()
* 1 process 8852 thread 0x20b  0x93213f95 in read$UNIX2003 ()

Thread 9 (process 8852 thread 0x4d0b):
#0  0x931f746e in __semwait_signal ()
#1  0x932223e6 in _pthread_cond_wait ()
#2  0x932479f8 in pthread_cond_timedwait$UNIX2003 ()
#3  0x001aba52 in _wapi_handle_timedwait_signal_handle (handle=0x3ea0684,
timeout=0xb0352e08, alertable=1, poll=0) at
./../../../mono/io-layer/handles.c:1609
#4  0x001c070d in WaitForSingleObjectEx (handle=0x3ea0684, timeout=1000,
alertable=1) at ../../../../mono/io-layer/wait.c:207
#5  0x00186dab in async_invoke_io_thread (data=0x0) at
./../../../mono/metadata/threadpool.c:343
#6  0x0018e986 in start_wrapper (data=0x7a9d840) at
./../../../mono/metadata/threads.c:657
#7  0x001c3026 in thread_start_routine (args=0x3ea0988) at
./../../../mono/io-layer/wthreads.c:286
#8  0x001ed5e4 in GC_start_routine (arg=0x3e5ed80) at
./../../libgc/pthread_support.c:1390
#9  0x93221155 in _pthread_start ()
#10 0x93221012 in thread_start ()

Thread 8 (process 8852 thread 0x5803):
#0  0x931f746e in __semwait_signal ()
#1  0x932223e6 in _pthread_cond_wait ()
#2  0x93221dcd in pthread_cond_wait$UNIX2003 ()
#3  0x001abbf9 in _wapi_handle_timedwait_signal_handle (handle=0x3ea00b4,
timeout=0x0, alertable=1, poll=0) at ../../../../mono/io-layer/handles.c:1611
#4  0x001abc68 in _wapi_handle_wait_signal_handle (handle=0x14e, alertable=334)
at ../../../../mono/io-layer/handles.c:1554
#5  0x001c085f in WaitForSingleObjectEx (handle=0x3ea00b4, timeout=4294967295,
alertable=1) at ../../../../mono/io-layer/wait.c:205
#6  0x00187297 in async_invoke_thread (data=0xb075b000) at
./../../../mono/metadata/threadpool.c:1487
#7  0x0018e986 in start_wrapper (data=0x7a9d840) at
./../../../mono/metadata/threads.c:657
#8  0x001c3026 in thread_start_routine (args=0x3ea090c) at
./../../../mono/io-layer/wthreads.c:286
#9  0x001ed5e4 in GC_start_routine (arg=0x3e5ed80) at
./../../libgc/pthread_support.c:1390
#10 0x93221155 in _pthread_start ()
#11 0x93221012 in thread_start ()

Thread 7 (process 8852 thread 0x5303):
#0  0x93256e0e in poll$UNIX2003 ()
#1  0x00185daa in socket_io_poll_main (p=0x2aea80) at
./../../../mono/metadata/threadpool.c:475
#2  0x0018e986 in start_wrapper (data=0x7a9c480) at
./../../../mono/metadata/threads.c:657
#3  0x001c3026 in thread_start_routine (args=0x3ea071c) at
./../../../mono/io-layer/wthreads.c:286
#4  0x001ed5e4 in GC_start_routine (arg=0x3e5ed80) at
./../../libgc/pthread_support.c:1390
#5  0x93221155 in _pthread_start ()
#6  0x93221012 in thread_start ()

Thread 6 (process 8852 thread 0x5003):
#0  0x931f746e in __semwait_signal ()
#1  0x932223e6 in _pthread_cond_wait ()
#2  0x93221dcd in pthread_cond_wait$UNIX2003 ()
#3  0x001abbf9 in _wapi_handle_timedwait_signal_handle (handle=0x3ea00b4,
timeout=0x0, alertable=1, poll=0) at ../../../../mono/io-layer/handles.c:1611
#4  0x001abc68 in _wapi_handle_wait_signal_handle (handle=0x14e, alertable=334)
at ../../../../mono/io-layer/handles.c:1554
#5  0x001c085f in WaitForSingleObjectEx (handle=0x3ea00b4, timeout=4294967295,
alertable=1) at ../../../../mono/io-layer/wait.c:205
#6  0x00187297 in async_invoke_thread (data=0xb0455000) at
./../../../mono/metadata/threadpool.c:1487
#7  0x0018e986 in start_wrapper (data=0x7a724b0) at
./../../../mono/metadata/threads.c:657
#8  0x001c3026 in thread_start_routine (args=0x3ea052c) at
./../../../mono/io-layer/wthreads.c:286
#9  0x001ed5e4 in GC_start_routine (arg=0x3e5ef00) at
./../../libgc/pthread_support.c:1390
#10 0x93221155 in _pthread_start ()
#11 0x93221012 in thread_start ()

Thread 5 (process 8852 thread 0x2703):
#0  0x931f0286 in mach_msg_trap ()
#1  0x931f7a7c in mach_msg ()
#2  0x008aa382 in CFRunLoopRunSpecific ()
#3  0x008a9c48 in CFRunLoopRunInMode ()
#4  0x02d6f803 in RunWebThread ()
#5  0x93221155 in _pthread_start ()
#6  0x93221012 in thread_start ()

Thread 4 (process 8852 thread 0x2603):
#0  0x931f02c2 in semaphore_wait_trap ()
#1  0x000fd9f0 in finalizer_thread (unused=0x0) at
./../../../mono/metadata/gc.c:1014
#2  0x0018e986 in start_wrapper (data=0x3f14d00) at
./../../../mono/metadata/threads.c:657
#3  0x001c3026 in thread_start_routine (args=0x3ea0434) at
./../../../mono/io-layer/wthreads.c:286
#4  0x001ed5e4 in GC_start_routine (arg=0x3e5ef60) at
./../../libgc/pthread_support.c:1390
#5  0x93221155 in _pthread_start ()
#6  0x93221012 in thread_start ()

Thread 3 (process 8852 thread 0x2203):
#0  0x931f746e in __semwait_signal ()
#1  0x931f72ef in nanosleep$UNIX2003 ()
#2  0x001a5310 in collection_thread (unused=0x0) at
./../../../mono/io-layer/collection.c:34
#3  0x93221155 in _pthread_start ()
#4  0x93221012 in thread_start ()

Thread 2 (process 8852 thread 0x1103):
#0  0x931f0286 in mach_msg_trap ()
#1  0x931f7a7c in mach_msg ()
#2  0x000c567a in mach_exception_thread (arg=0x0) at
./../../../mono/mini/mini-darwin.c:131
#3  0x001ed5e4 in GC_start_routine (arg=0x3e5ef60) at
./../../libgc/pthread_support.c:1390
#4  0x93221155 in _pthread_start ()
#5  0x93221012 in thread_start ()

Thread 1 (process 8852 thread 0x20b):
#0  0x93213f95 in read$UNIX2003 ()
#1  0x0009236a in mono_handle_native_sigsegv (signal=11, ctx=0xbfffd560) at
./../../../mono/mini/mini-exceptions.c:1561
#2  0x0000637a in mono_sigsegv_signal_handler (_dummy=10, info=0xbfffd520,
context=0xbfffd560) at ../../../../mono/mini/mini.c:4586
#3  <signal handler called>
#4  0x0000c743 in mono_jit_runtime_invoke (method=0x0, obj=0x3e67c80,
params=0xbfffd6b4, exc=0x0) at ../../../../mono/mini/mini.c:4429
#5  0x0016ebb1 in create_custom_attr (image=0x40e5200, method=<value
temporarily unavailable, due to optimizations>, data=<value temporarily
unavailable, due to optimizations>, len=106) at
./../../../mono/metadata/reflection.c:7944
#6  0x0016ed14 in mono_custom_attrs_construct (cinfo=0x7ad7f20) at
./../../../mono/metadata/reflection.c:8086
#7  0x00170977 in mono_reflection_get_custom_attrs_by_type (obj=0x0,
attr_klass=0x0) at ../../../../mono/metadata/reflection.c:8508
#8  0x0010ec41 in custom_attrs_get_by_type (obj=0x0, attr_type=0x0) at
./../../../mono/metadata/icall.c:7239
#9  0x03e7f6b8 in ?? ()
#10 0x03e7f5ff in ?? ()
#11 0x079272b6 in ?? ()
#12 0x07b76f73 in ?? ()
#13 0x07926c8a in ?? ()
#14 0x079694e3 in ?? ()
#15 0x07968348 in ?? ()
#16 0x079673ef in ?? ()
#17 0x07967295 in ?? ()
#18 0x07b76ca2 in ?? ()
#19 0x07b76c0c in ?? ()
#20 0x07b76967 in ?? ()
#21 0x07b768c3 in ?? ()
#22 0x07b76478 in ?? ()
#23 0x07b7614e in ?? ()
#24 0x07b3c0e7 in ?? ()
#25 0x0796dd50 in ?? ()
#26 0x0796db3e in ?? ()
#27 0x0796dab2 in ?? ()
#28 0x0796d9a0 in ?? ()
#29 0x0796d8f7 in ?? ()
#30 0x03e8be53 in ?? ()
#31 0x03e8bd0f in ?? ()
#32 0x03e810d8 in ?? ()
#33 0x0000c67d in mono_jit_runtime_invoke (method=0x4063184, obj=0x4ce7fc0,
params=0xbfffdec0, exc=0x0) at ../../../../mono/mini/mini.c:4490
#34 0x001f2182 in monotouch_trampoline ()
#35 0x0167f459 in -[UIApplication sendAction:to:from:forEvent:] ()
#36 0x016e2ba2 in -[UIControl sendAction:to:forEvent:] ()
#37 0x016e4dc3 in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
#38 0x016e3d29 in -[UIControl touchesBegan:withEvent:] ()
#39 0x01698d87 in -[UIWindow _sendTouchesForEvent:] ()
#40 0x0168281c in -[UIApplication sendEvent:] ()
#41 0x016890b5 in _UIApplicationHandleEvent ()
#42 0x01096ef1 in PurpleEventCallback ()
#43 0x008aab80 in CFRunLoopRunSpecific ()
#44 0x008a9c48 in CFRunLoopRunInMode ()
#45 0x010957ad in GSEventRunModal ()
#46 0x01095872 in GSEventRun ()
#47 0x0168a003 in UIApplicationMain ()
#48 0x03e85759 in ?? ()
#49 0x03e85692 in ?? ()
#50 0x03e84ef5 in ?? ()
#51 0x03e84ec9 in ?? ()
#52 0x03e84e63 in ?? ()
#53 0x0000c67d in mono_jit_runtime_invoke (method=0x408acd4, obj=0x0,
params=0xbffff11c, exc=0x0) at ../../../../mono/mini/mini.c:4490
#54 0x00159a4b in mono_runtime_exec_main (method=0x408acd4, args=0x4ce0a20,
exc=0x0) at ../../../../mono/metadata/object.c:3493
#55 0x0015c675 in mono_runtime_run_main (method=0x408acd4, argc=0,
argv=0xbffff1c8, exc=0x0) at ../../../../mono/metadata/object.c:3273
#56 0x001f41d9 in main ()

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

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