Bug 5201 - Serializing a System.Type will cause a stack overflow
Summary: Serializing a System.Type will cause a stack overflow
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
Depends on:
Reported: 2012-05-21 07:21 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2016-11-11 09:30 UTC (History)
2 users (show)

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

test.cs (667 bytes, application/octet-stream)
2012-05-21 07:21 UTC, Rolf Bjarne Kvinge [MSFT]

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 Rolf Bjarne Kvinge [MSFT] 2012-05-21 07:21:14 UTC
Created attachment 1930 [details]

Compile and run the attached sample. 

On Mono it will run for a while then eventually throw a stack overflow.

On MS this happens instantly:


Unhandled Exception: System.Runtime.Serialization.SerializationException: Type 'System.RuntimeType' with data contract name 'RuntimeType:http://schemas.datacontract.org/2004/07/System' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
(stack trace)
Comment 1 Martin Baulig 2016-11-11 09:30:05 UTC
Closing ancient bugs.