Bug 5200 - Linker causes crash by removing System.Reflection.Pointer
Summary: Linker causes crash by removing System.Reflection.Pointer
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 5.2
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2012-05-21 06:51 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2012-05-22 09:09 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Rolf Bjarne Kvinge [MSFT] 2012-05-21 06:51:12 UTC
Test case: 

https://github.com/sgmunn/MonoKit

Run in simulator, click on Event Sourced Domain Test.

Result:

* Assertion at ../../../../../mono/mono/metadata/object.c:3166, condition `tmp_klass' not met

Stacktrace:

  at (wrapper managed-to-native) System.Reflection.MonoField.GetValueInternal (System.Reflection.MonoField,object) <IL 0x0002e, 0xffffffff>
  at System.Reflection.MonoField.GetValue (object) [0x0006a] in /mono/ios/mono/mcs/class/corlib/System.Reflection/MonoField.cs:124
  at System.Runtime.Serialization.SerializationMap.SerializeNonReference (object,System.Runtime.Serialization.XmlFormatterSerializer) [0x00056] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:242
  at System.Runtime.Serialization.SerializationMap.Serialize (object,System.Runtime.Serialization.XmlFormatterSerializer) [0x0006a] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:228
  at System.Runtime.Serialization.XmlFormatterSerializer.Serialize (System.Type,object) [0x002af] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs:152
  at System.Runtime.Serialization.SerializationMap.SerializeNonReference (object,System.Runtime.Serialization.XmlFormatterSerializer) [0x0008a] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:247
  at System.Runtime.Serialization.SerializationMap.Serialize (object,System.Runtime.Serialization.XmlFormatterSerializer) [0x0006a] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:228
  at System.Runtime.Serialization.XmlFormatterSerializer.Serialize (System.Type,object) [0x002af] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs:152
  at System.Runtime.Serialization.SerializationMap.SerializeNonReference (object,System.Runtime.Serialization.XmlFormatterSerializer) [0x0008a] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:247
  at System.Runtime.Serialization.SerializationMap.Serialize (object,System.Runtime.Serialization.XmlFormatterSerializer) [0x0006a] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:228
  at System.Runtime.Serialization.XmlFormatterSerializer.Serialize (System.Type,object) [0x002af] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs:152
  at System.Runtime.Serialization.SerializationMap.SerializeNonReference (object,System.Runtime.Serialization.XmlFormatterSerializer) [0x0008a] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:247
  at System.Runtime.Serialization.SerializationMap.Serialize (object,System.Runtime.Serialization.XmlFormatterSerializer) [0x0006a] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:228
  at System.Runtime.Serialization.XmlFormatterSerializer.Serialize (System.Type,object) [0x002af] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs:152
  at System.Runtime.Serialization.XmlFormatterSerializer.Serialize (System.Xml.XmlDictionaryWriter,object,System.Type,System.Runtime.Serialization.KnownTypeCollection,bool,int,string,bool,System.Runtime.Serialization.DataContractResolver,System.Runtime.Serialization.DataContractResolver) [0x00000] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs:60
  at System.Runtime.Serialization.DataContractSerializer.WriteObjectContent (System.Xml.XmlDictionaryWriter,object) [0x00013] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs:420
  at System.Runtime.Serialization.XmlObjectSerializer.WriteObject (System.Xml.XmlDictionaryWriter,object) [0x00008] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs:107
  at System.Runtime.Serialization.DataContractSerializer.WriteObject (System.Xml.XmlWriter,object) [0x00007] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs:384
  at System.Runtime.Serialization.XmlObjectSerializer.WriteObject (System.IO.Stream,object) [0x00007] in /mono/ios/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs:90
  at MonoKitSample.SampleSerializer`1.SerializeToString (object) [0x00006] in /Users/rolf/test/assistly/11565/MonoKit/MonoKitSample/SampleDomain.cs:119
  at MonoKit.Domain.Data.AggregateRepository`1.Save (T) [0x000de] in /Users/rolf/test/assistly/11565/MonoKit/MonoKit/Domain/Data/AggregateRepository_T.cs:81
  at MonoKit.Domain.UnitOfWork`1.Commit () [0x0001e] in /Users/rolf/test/assistly/11565/MonoKit/MonoKit/Domain/UnitOfWork_T.cs:90
  at MonoKit.Data.SQLite.SQLiteUnitOfWorkScope.Commit () [0x00019] in /Users/rolf/test/assistly/11565/MonoKit/MonoKit.iOS/Data/SQLite/SQLiteUnitOfWorkScope.cs:35
  at MonoKit.Domain.DomainCommandExecutor`1.Execute (MonoKit.Domain.ICommand) [0x0002f] in /Users/rolf/test/assistly/11565/MonoKit/MonoKit/Domain/DomainCommandExecutor_T.cs:28
  at MonoKitSample.Samples.DoDomainTest1 (MonoKit.UI.Elements.Element) [0x00036] in /Users/rolf/test/assistly/11565/MonoKit/MonoKitSample/Samples.cs:191
  at MonoKit.UI.Elements.Element.Execute () [0x0000b] in /Users/rolf/test/assistly/11565/MonoKit/MonoKit.iOS/UI/Elements/Element.cs:91
  at MonoKit.UI.TableViewSection`1.RowSelected (MonoTouch.Foundation.NSIndexPath) [0x00041] in /Users/rolf/test/assistly/11565/MonoKit/MonoKit.iOS/UI/TableViewSection_T.cs:145
  at MonoKit.UI.TableViewSource.RowSelected (MonoTouch.UIKit.UITableView,MonoTouch.Foundation.NSIndexPath) [0x00012] in /Users/rolf/test/assistly/11565/MonoKit/MonoKit.iOS/UI/TableViewSource.cs:150
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <IL 0x0005a, 0xffffffff>
  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
  at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /mono/ios/monotouch/src/UIKit/UIApplication.cs:38
  at iPhoneTest.Application.Main (string[]) [0x00000] in /Users/rolf/test/assistly/11565/MonoKit/iPhoneTest/Main.cs:17
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

Native stacktrace:

	0   iPhoneTest                          0x0007b01c mono_handle_native_sigsegv + 284
	1   iPhoneTest                          0x000be52d sigabrt_signal_handler + 109
	2   libsystem_c.dylib                   0x90e1359b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   libsystem_c.dylib                   0x90daebdd abort + 167
	5   iPhoneTest                          0x001c6b2d monoeg_g_logv + 157
	6   iPhoneTest                          0x001c6b5b monoeg_assertion_message + 43
	7   iPhoneTest                          0x0015534b mono_field_get_value_object + 1627
	8   iPhoneTest                          0x000fc8b6 ves_icall_MonoField_GetValueInternal + 102
	9   ???                                 0x0ddf8fb6 0x0 + 232755126
	10  ???                                 0x0ddf8db4 0x0 + 232754612
	11  ???                                 0x0ddf4dc7 0x0 + 232738247
	12  ???                                 0x0ddf487b 0x0 + 232736891
	13  ???                                 0x0ddf39d9 0x0 + 232733145
	14  ???                                 0x0ddf4e58 0x0 + 232738392
	15  ???                                 0x0ddf487b 0x0 + 232736891
	16  ???                                 0x0ddf39d9 0x0 + 232733145
	17  ???                                 0x0ddf4e58 0x0 + 232738392
	18  ???                                 0x0ddf487b 0x0 + 232736891
	19  ???                                 0x0ddf39d9 0x0 + 232733145
	20  ???                                 0x0ddf4e58 0x0 + 232738392
	21  ???                                 0x0ddf487b 0x0 + 232736891
	22  ???                                 0x0ddf39d9 0x0 + 232733145
	23  ???                                 0x0ddf2ea8 0x0 + 232730280
	24  ???                                 0x0ddf2d08 0x0 + 232729864
	25  ???                                 0x0ddec527 0x0 + 232703271
	26  ???                                 0x0ddec4ba 0x0 + 232703162
	27  ???                                 0x0dde9202 0x0 + 232690178
	28  ???                                 0x0dde8f10 0x0 + 232689424
	29  ???                                 0x0dde8058 0x0 + 232685656
	30  ???                                 0x0dde713d 0x0 + 232681789
	31  ???                                 0x0dde6ef7 0x0 + 232681207
	32  ???                                 0x0dd99fec 0x0 + 232366060
	33  ???                                 0x0a762e60 0x0 + 175517280
	34  ???                                 0x0a762bcd 0x0 + 175516621
	35  ???                                 0x0a7627ed 0x0 + 175515629
	36  ???                                 0x0a762466 0x0 + 175514726
	37  ???                                 0x0a7625e5 0x0 + 175515109
	38  iPhoneTest                          0x000084f2 mono_jit_runtime_invoke + 722
	39  iPhoneTest                          0x0014cb7e mono_runtime_invoke + 126
	40  iPhoneTest                          0x001e4148 monotouch_trampoline + 3688
	41  UIKit                               0x0095c5c5 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1164
	42  UIKit                               0x0095c7fa -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 201
	43  Foundation                          0x0059385d __NSFireDelayedPerform + 389
	44  CoreFoundation                      0x0159a936 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
	45  CoreFoundation                      0x0159a3d7 __CFRunLoopDoTimer + 551
	46  CoreFoundation                      0x014fd790 __CFRunLoopRun + 1888
	47  CoreFoundation                      0x014fcd84 CFRunLoopRunSpecific + 212
	48  CoreFoundation                      0x014fcc9b CFRunLoopRunInMode + 123
	49  GraphicsServices                    0x023ed7d8 GSEventRunModal + 190
	50  GraphicsServices                    0x023ed88a GSEventRun + 103
	51  UIKit                               0x008cb626 UIApplicationMain + 1163
	52  ???                                 0x0a2e1395 0x0 + 170791829
	53  ???                                 0x0869f6b8 0x0 + 141162168
	54  ???                                 0x0869f2c0 0x0 + 141161152
	55  ???                                 0x0869f416 0x0 + 141161494
	56  iPhoneTest                          0x000084f2 mono_jit_runtime_invoke + 722
	57  iPhoneTest                          0x0014cb7e mono_runtime_invoke + 126
	58  iPhoneTest                          0x00150c34 mono_runtime_exec_main + 420
	59  iPhoneTest                          0x001557d5 mono_runtime_run_main + 725
	60  iPhoneTest                          0x00064c85 mono_jit_exec + 149
	61  iPhoneTest                          0x001d974e main + 2238
	62  iPhoneTest                          0x00001f95 start + 53
	63  ???                                 0x00000004 0x0 + 4

=================================================================
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.
=================================================================
Comment 2 Rolf Bjarne Kvinge [MSFT] 2012-05-21 07:18:37 UTC
Note that the app is trying to serialize a System.Type, which will fail anyway (in particular it will fail with a stack overflow once this crash has been resolved).
Comment 3 Sebastien Pouliot 2012-05-22 09:09:15 UTC
Fixed.
5.2-series: 89db00c962602cfa9061ad1c15eee0f50289e3bd
master: 3fb747b3e08f8a3a95966e2b94c323526d09cb2a

QA: unit test added on both branches