Bug 10774 - wrong assumption in mono_get_exception_type_initialization
Summary: wrong assumption in mono_get_exception_type_initialization
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-02-28 13:56 UTC by Sebastien Pouliot
Modified: 2013-03-01 16:33 UTC (History)
3 users (show)

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 GitHub or Developer Community 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:

Description Sebastien Pouliot 2013-02-28 13:56:20 UTC
mono_get_exception_type_initialization (in exception.c) iterates to the the "right" actor

	/* TypeInitializationException only has 1 ctor with 2 args */

That comment (and code) was likely right when written but today there's an internal .ctor for serialization that has 2 parameters too. Looks like we're just lucky the first it the one the runtime wants.

		public TypeInitializationException (string fullTypeName, Exception innerException)
			: base (Locale.GetText ("An exception was thrown by the type initializer for ") + fullTypeName, innerException)
			this.type_name = fullTypeName;

		internal TypeInitializationException (SerializationInfo info, StreamingContext context)
			: base (info, context)
			type_name = info.GetString ("TypeName");
Comment 1 Sebastien Pouliot 2013-02-28 14:13:39 UTC
mono_get_exception_reflection_type_load and ReflectionTypeLoadException have the same (wrong) assumption
Comment 2 Zoltan Varga 2013-03-01 16:33:26 UTC
Fixed in master.