Mono 4.8.0 Release Notes

Release date: 22 Feb 2017

Release History

  • 4.8.1.0 - Security fix for macOS (11 Apr 2017)
  • 4.8.0.524 - Service Release 1 (05 Apr 2017)
  • 4.8.0.520 - Service Release 0 (14 Mar 2017)
  • 4.8.0.495 - Initial stable release (22 Feb 2017)

Highlights

In Depth

API additions for .NET Standard 2.0

We added APIs to comply with .NET Standard 2.0, which is still a work in progress at the time of this writing. Note that in some cases an implementation is still missing and will throw at runtime.

Please check the .NET Standard repository on GitHub for more details about .NET Standard.

TLS 1.2 Support

Mono now ships with TLS 1.2, powered by Google’s BoringSSL project. (*)

To use it, you must set the environment variable MONO_TLS_PROVIDER to the value “btls”, like this:

export MONO_TLS_PROVIDER=btls

This affects Mono when it is built from source code and is also the stack used on Xamarin.Android.

Xamarin.iOS, Xamarin.Mac and the Mono installed by the official Mac MDK installer use Apple’s TLS stack instead which uses Apple’s system certificate store to resolve the root certificates, so everything works out of the box.

On BoringSSL systems like Linux, you can populate the Mono certificate store from the system certificate store using the cert-sync tool.

On Mac if you compiled and installed Mono from source (i.e. you don’t have access to the Apple TLS implementation), you can use cert-sync to populate the Mono certificate stores with CA certificates from the curl maintainers which are based on Mozilla’s trusted CA list:

curl -L -o /tmp/cacert.pem https://curl.haxx.se/ca/cacert.pem
cert-sync --user /tmp/cacert.pem

(*) Note: our CentOS 6 packages still ship only the legacy TLS provider since the GCC on CentOS 6 is too old to compile BoringSSL.

Cross-compilation with MKBundle

The MKBundle tool has been updated to easily support cross-compilation, instead of using a native compiler to compile a bundled executable, Mono has been altered to support payloads embedded in the executable.

To do this, use the new --simple command line option. The new invocation looks like this:

mkbundle -o hello --simple hello.exe

You can configure the resulting bundle with some command line options that you wish to pass to the runtime, for example, the following would disable inlining:

mkbundle -o hello --options -O=-inline --simple hello.exe

The cross-compilation feature requires the Mono team to update the packages on the server and might not be working during the alpha period, but will be available at ship time. You can get a list of the available targets from the server, and retrieve one of the targets like this:

$ mkbundle --list-targets
Cross-compilation targets available:
4.8.0-linux-libc2.13-amd64
4.8.0-linux-libc2.13-armel
4.8.0-linux-libc2.13-armhf
4.8.0-linux-libc2.13-i386
4.8.0-macos-10.7-amd64
4.8.0-macos-10.7-i386
4.8.2-linux-libc2.13-amd64
4.8.2-linux-libc2.13-armel
4.8.2-linux-libc2.13-armhf
4.8.2-linux-libc2.13-i386
4.8.2-macos-10.7-amd64
4.8.2-macos-10.7-i386

$ mkbundle --fetch-target 4.8.2-macos-10.7-i386

Then you can cross-compile like this:

mkbundle --cross 4.8.2-macos-10.7-i386 hello.exe -o hello-macos

We have also extended the tool to allow you to configure the environment variables that you wish your bundled executable uses at runtime (for example to set some Mono internal configuration options with --env), distribute native libraries with --library, specify additional character encodings with --i18n and specify a machine.config file with --config.

For an overview of all the new features, check the mkbundle(1) manual page.

Runtime

Runtime Logging

The new MONO_LOG_DEST environment variable can set to instruct the runtime where to write the tracing messages to. If this variable is not set, the default continues to be stdout, if the value is set to the special syslog value, the tracing will be sent to the syslog, on Windows it will be sent to the mono.log file.

The MONO_LOG_HEADER environment variable, if set, will include the id, timestampe and process id on the trace logs.

Concurrent SGen

We now support a concurrent mode for the major collector. As opposed to the serial major collector, which suspends the world, does all the work and resumes it, the concurrent major uses two, significantly smaller pauses. These are the starting pause, which initialises the root set for a worker that runs concurrently with your application, followed by a finishing pause, once the concurrent worker is done, that ends the major collection. In order to use it you need to pass MONO_GC_PARAMS=major=marksweep-conc to the environment of the mono runtime.

This mode has been present for a few years now, but only over the recent releases (4.4 and 4.6) has it seen significant improvements. These improvements consist in improved memory usage with it, further reduction of the finishing pause and stability improvements. As of this release, this mode has been strongly tested on desktop platforms and we encourage its use there. Over the next releases we plan to adopt it as the default SGen mode.

Windows

Mono on Windows has vastly improved in this release as we make it a first class supported platform in Mono. We placed a significant amount of work on making Mono on Windows pass our test suites and add many new capabilities, like full static compilation (full AOT).

Mono’s port to Windows now includes the beginning of full static compilation, which will make it suitable to be embedded in UWP apps and is the foundation for more console support.

Android

The default (tarjan-based) Java-C# bridge has been optimized to elegantly handle unusual object graphs which previously caused exponential slowdown during garbage collection.

Reference Source Adoption

More code that we have adopted from Reference Source:

  • mscorlib
    • system/FormattableString.cs
    • system/gc.cs
    • system/sharedstatics.cs
    • system/diagnostics/eventing/eventsourceexception.cs
    • system/reflection/targetexception.cs
    • system/reflection/targetinvocationexception.cs
    • system/reflection/targetparametercountexception.cs
    • system/runtime/compilerservices/disableprivatereflectionattribute.cs
    • system/runtime/compilerservices/FormattableStringFactory.cs
    • system/runtime/compilerservices/idispatchconstantattribute.cs
    • system/security/safesecurityhandles.cs
    • system/security/cryptography/rsacryptoserviceprovider.cs
    • system/text/encodingprovider.cs
    • system/threading/asynclocal.cs
    • system/threading/eventwaithandle.cs
    • system/threading/waithandleExtensions.cs
  • System
    • System/net/System/Net/_emptywebproxy.cs
    • System/net/System/Net/_PooledStream.cs
    • System/net/System/Net/_ProxyChain.cs
    • System/net/System/Net/_Semaphore.cs
    • System/net/System/Net/_ServiceNameStore.cs
    • System/net/System/Net/_TimerThread.cs
    • System/net/System/Net/_WebProxyDataBuilder.cs
    • System/net/System/Net/CredentialCache.cs
    • System/net/System/Net/connectionpool.cs
    • System/net/System/Net/GlobalProxySelection.cs
    • System/net/System/Net/IWebProxyFinder.cs
    • System/net/System/Net/NetworkCredential.cs
    • System/net/System/Net/webproxy.cs
    • System/net/System/Net/WebRequest.cs
    • System/net/System/Net/Cache/RequestCache.cs
    • System/net/System/Net/Cache/RequestCacheEntry.cs
    • System/net/System/Net/Cache/RequestCacheManager.cs
    • System/net/System/Net/Configuration/DefaultProxySection.cs
    • System/net/System/Net/Sockets/_MultipleConnectAsync.cs
    • System/sys/system/IO/ports/InternalResources.cs
    • System/sys/system/Diagnostics/CodeAnalysis/ExcludeFromCodeCoverageAttribute.cs
    • System/sys/system/threading/semaphore.cs
    • System/security/system/security/Authentication/ExtendedProtection/ServiceNameCollection.cs
    • System/services/monitoring/system/diagnosticts/ProcessModuleCollection.cs
    • System/services/monitoring/system/diagnosticts/ProcessThreadCollection.cs
    • System/net/System/Net/_emptywebproxy.cs
    • System/net/System/Net/_PooledStream.cs
    • System/net/System/Net/_ProxyChain.cs
    • System/net/System/Net/_Semaphore.cs
    • System/net/System/Net/_ServiceNameStore.cs
    • System/net/System/Net/_TimerThread.cs
    • System/net/System/Net/_WebProxyDataBuilder.cs
    • System/net/System/Net/CredentialCache.cs
    • System/net/System/Net/connectionpool.cs
    • System/net/System/Net/GlobalProxySelection.cs
    • System/net/System/Net/HttpListenerRequestUriBuilder.cs
    • System/net/System/Net/IWebProxyFinder.cs
    • System/net/System/Net/NetworkCredential.cs
    • System/net/System/Net/webproxy.cs
    • System/net/System/Net/WebRequest.cs
    • System/net/System/Net/Cache/RequestCache.cs
    • System/net/System/Net/Cache/RequestCacheEntry.cs
    • System/net/System/Net/Cache/RequestCacheManager.cs
    • System/net/System/Net/Configuration/DefaultProxySection.cs
    • System/net/System/Net/Sockets/_MultipleConnectAsync.cs
    • System/sys/system/Diagnostics/CodeAnalysis/ExcludeFromCodeCoverageAttribute.cs
    • System/sys/system/IO/ports/InternalResources.cs
    • System/sys/system/threading/semaphore.cs
    • System/sys/system/windows/markup/ValueSerializerAttribute.cs
    • System/security/system/security/Authentication/ExtendedProtection/ServiceNameCollection.cs
    • System/services/monitoring/system/diagnosticts/ProcessModuleCollection.cs
    • System/services/monitoring/system/diagnosticts/ProcessThreadCollection.cs
  • System.Runtime.Caching:
    • System/Caching/SRef.cs
  • System.Web
    • System.Web/Util/Debug.cs

Changes in the MacOS package

  • Upgraded MSBuild to 15.0
  • Upgraded F# to 4.0.1.20
  • GTK+ and GTK# fixes

Bug Fixes

  • 3323: Assertion when deleting global namespace inside method
  • 3399: [PATCH] pending_exception support is incomplete
  • 3434: Mono Compiler crashes when using a DelegateType as a method call
  • 3706: generics aot jit problem
  • 3735: Attempting to JIT compile method: using Linq’s “Any” fails on the device
  • 3767: Unit test UI table cell extends beyond cell bounds for failed test
  • 3811: DataContractJsonSerializer deserialization fails with subclass of List as known type
  • 3850: ScrollEventArgs in Form_Scroll method has invalid values
  • 3960: DismissModalViewControllerAnimated() crashes on 5.2.9
  • 4006: MonoDevelop fails to start with no warning if Gtk# is not installed on windows
  • 5644: Mono allows to access not accessible method
  • 7467: DefaultNonPersistentConnectionLimit is to low
  • 12571: Usage of XElement with XmlAnyElementAttribute is not supported by XmlSerializer
  • 19594: WebException.Response is null when https request needs proxy authentication
  • 29189: Compiling class referencing corefx facade/contract assemblies raises error “Reference to type System.SByte claims it is defined assembly mscorlib,.. but couldn’t be found”
  • 30686: ZipArchive ctor throws InvalidDataException for WebConnectionStream
  • 30821: Compilation generates CS1701 warning
  • 32374: WebRequest::BeginGetRequestStream incorrectly sets IAsyncResult::CompletedSynchronously to always true
  • 33571: Mono crashes when marshalling fixed arrays
  • 34802: Debugger crash on break-all, step into sequence.
  • 35536: Dns.GetHostEntry no longer supports IPv6
  • 35662: Type System.ServiceModel.Security.Tokens.BinarySecretSecurityToken is missing in assembly System.IdentityModel
  • 39282: [System.IO.Compression] issues with ZipArchiveEntry streams
  • 39859: Xamarin.Android apps on the Samsung Galaxy S7 fails to start with the error System.ExecutionEngineException SIGILL
  • 40603: Mono can’t parse Date in DB wich is in format: “2016-02-04 10:39:11Z”
  • 40916: [System.IO.Compression] ZipArchive can create an ZipArchiveEntry that has a modified time of DateTime.MinValue
  • 41035: DataViewTest2.DataView_ListChangedEventTest occasionally fails with llvm+sgen
  • 41349: System.TimeZoneInfo.IsDaylightSavingTime (DateTimeOffset dateTimeOffset) Not Implemented Exception
  • 41393: [WatchOS 2] Incorrect calling convention for P/Invokes taking structures
  • 41431: [aot] Build fails due to ‘Sgen STW requires a working mono-context’ error
  • 41466: mono_class_is_subclass_of return incorrect value by assuming mono_class_init has been called on parameters
  • 41477: SafeSocketHandle ObjectDisposedException ‘handle’ exception with linked CancellationTokenSource
  • 41492: DateTimeOffset.ToLocalTime() throwing erroneous error
  • 41509: DLR crashes when trying to convert a object to null.
  • 41530: [iOS]TimerTest failing randomly on devices,
  • 41552: HttpResponseMessage does not support multiple Links header entries
  • 41575: A Method That Accepts a FormattableString Object Is Not Called
  • 3323: Assertion when deleting global namespace inside method
  • 3399: [PATCH] pending_exception support is incomplete
  • 3434: Mono Compiler crashes when using a DelegateType as a method call
  • 3706: generics aot jit problem
  • 3735: Attempting to JIT compile method: using Linq’s “Any” fails on the device
  • 3767: Unit test UI table cell extends beyond cell bounds for failed test
  • 3811: DataContractJsonSerializer deserialization fails with subclass of List as known type
  • 3850: ScrollEventArgs in Form_Scroll method has invalid values
  • 3960: DismissModalViewControllerAnimated() crashes on 5.2.9
  • 4006: MonoDevelop fails to start with no warning if Gtk# is not installed on windows
  • 5644: Mono allows to access not accessible method
  • 7467: DefaultNonPersistentConnectionLimit is to low
  • 12571: Usage of XElement with XmlAnyElementAttribute is not supported by XmlSerializer
  • 19594: WebException.Response is null when https request needs proxy authentication
  • 29189: Compiling class referencing corefx facade/contract assemblies raises error “Reference to type ‘System.SByte’ claims it is defined assembly ‘mscorlib,..’ but couldn’t be found”
  • 30686: ZipArchive ctor throws InvalidDataException for WebConnectionStream
  • 30821: Compilation generates CS1701 warning
  • 32374: WebRequest::BeginGetRequestStream incorrectly sets IAsyncResult::CompletedSynchronously to always true
  • 33571: Mono crashes when marshalling fixed arrays
  • 34802: Debugger crash on break-all, step into sequence.
  • 35536: Dns.GetHostEntry no longer supports IPv6
  • 35662: Type System.ServiceModel.Security.Tokens.BinarySecretSecurityToken is missing in assembly System.IdentityModel
  • 39282: [System.IO.Compression] issues with ZipArchiveEntry streams
  • 39859: Xamarin.Android apps on the Samsung Galaxy S7 fails to start with the error System.ExecutionEngineException SIGILL
  • 40603: Mono can’t parse Date in DB wich is in format: “2016-02-04 10:39:11Z”
  • 40916: [System.IO.Compression] ZipArchive can create an ZipArchiveEntry that has a modified time of DateTime.MinValue
  • 41035: DataViewTest2.DataView_ListChangedEventTest occasionally fails with llvm+sgen
  • 41349: System.TimeZoneInfo.IsDaylightSavingTime (DateTimeOffset dateTimeOffset) Not Implemented Exception
  • 41393: [WatchOS 2] Incorrect calling convention for P/Invokes taking structures
  • 41431: [aot] Build fails due to ‘Sgen STW requires a working mono-context’ error
  • 41466: mono_class_is_subclass_of return incorrect value by assuming mono_class_init has been called on parameters
  • 41477: SafeSocketHandle ObjectDisposedException ‘handle’ exception with linked CancellationTokenSource
  • 41492: DateTimeOffset.ToLocalTime() throwing erroneous error
  • 41509: DLR crashes when trying to convert a object to null.
  • 41530: [iOS]TimerTest failing randomly on devices,
  • 41552: HttpResponseMessage does not support multiple Links header entries
  • 41575: A Method That Accepts a FormattableString Object Is Not Called
  • 41602: Compiler fails to recognize Indexer
  • 41616: Mono 4.4.0 crashes when using Socket.ConnectAsync to a unix domain socket if the path doesn’t exist
  • 41667: new DateTime().ToLocalTime() results in an exception
  • 41705: MonoTests.System.Threading.MonitorTest.Enter_Null crashes test runtime with assertion
  • 41775: Zip version needed to extract not correct in System.IO.Compression
  • 41782: [Cycle 7] “System.Net.WebException: Error: NameResolutionFailure” when attempting web requests with certain raw IP addresses
  • 41874: Reflection throws AmbiguousMatchException when calling GetProperty on a class that inherits from a generic base class.
  • 41897: NotSupportedException thrown from IPInterfaceProperties.UnicastAddresses
  • 41937: invoke.exe test asserts on bitcode
  • 41955: Bitcode “missing image did not probe corlib” exception thrown
  • 41979: CodeDom cannot call mcs because of invalid encoding configuration
  • 42057: error CS0121: The call is ambiguous
  • 42169: (managed_alloc) Fatal: Managed allocator missing for (mkbundle) in Mono 4.4.X
  • 42191: sdb deadlocks all the time while XS debugs XS
  • 42198: error CS0529: Inherited interface causes a cycle in the interface hierarchy.
  • 42219: [System.IO.Compression] Cannot create ZipArchive with duplicate entries with same name
  • 42224: Compiler crashed with code: 1, “Await yields with non-empty stack” from AssertEmptyStack ()
  • 42226: WCF client Expecting FaultException raising NotImplemented Exception instead When element is provided.
  • 42271: COOP: gc unsafe mode when printing native backtrace causes crash if GC is triggered
  • 42274: System.IO.Compression.ZipArchive vs System.Xml.XmlReader
  • 42395: Build runs indefinitely and never finishes
  • 42408: WebClient.DownloadString returns 401 Unauthorized when using Basic authentication
  • 42410: String Interpolation available even when langversion < 6
  • 42413: Volatile fields don’t enforce acquire - release semantics like Volatile.Read() and Volatile.Write()
  • 42584: InternalError / Crash when using System.Net.Http and PCL library
  • 42585: Switch fall-through not rejected
  • 42611: wrong compiler error when using IEnumerable.Sum
  • 42625: coop: crash with watchos system tests
  • 42688: Can’t wait for more than 429496 ms (429s)
  • 42702: Unnecessary dependency checks
  • 42750: Deploying an iOS app to iPhone 6S crashes when a breakpoint is set
  • 42843: XmlSerializer does not deserialize UTC Time values on Xamarin.Android but works well on windows.
  • 42864: [Cycle 7] “System.Net.WebException: Error: NameResolutionFailure” on second web request to certain raw IP addresses with HttpClient
  • 42887: Encoding iso-8859-1 throws IndexOutOfRangeException for Unicode surrogate pairs
  • 43022: ZipArchive.Entries is not updated when ZipArchiveEntry is deleted
  • 43032: System.Uri cannot parse url with underscore at start
  • 43099: [watchOS] Cannot enter GC safe region if the thread is not attached
  • 43193: Keep CurrentCulture in async/await
  • 43265: Inconsistency in Compilation of Async Code Compared to MSFT Compilers
  • 43291: Runtime crash at reflection.c:mono_custom_attrs_construct_by_type while calling GetCustomAttributes for a proxy class
  • 43320: Thread aborts in the middle of .cctor and hell break loose
  • 43357: WCSessionReplyHandler crashes WatchKit app
  • 43400: “using static” dependent on compile order
  • 43471: pragma warning disable still shows warnings in “Errors” pad
  • 43512: TimeZoneInfo.ConvertTimeBySystemTimeZoneId ArgumentException
  • 43636: [Cycle 8] “Index was out of range. Must be non-negative and less than the size of the collection” in System.Collections.Generic.List1[T].set_Item() when attempting to compile certain C# code involving tasks, async/await, and try/catch/finally
  • 43695: Nuget resolves .netstandard <= 1.3 when Xamarin.IOS does not support it
  • 43696: Delegate caching can invoke unrelated implementation leading to strange results
  • 43718: mcs crashes when unable to resolve type inside lambda using the ‘as’ operator
  • 43786: peverify is broken again
  • 43921: System.Threading.ThreadHelper.ThreadStart_Context tries to allocate, crashes
  • 44025: FTP download issue with IPv6
  • 44109: NetworkCredential does not convert SecureString
  • 44164: gosharp-regexp benchmark triggers unwinding crash when profiling
  • 44168: Can use non-accessible member with nameof
  • 44381: Debugger crash with domain unloading and VSTU
  • 44402: Array doesn’t implement non-generic IEnumerable
  • 44406: Xamarin.Mac.Socket exception:An address incompatible with the requested protocol was used
  • 44413: HttpHeaders.TryAddWithoutValidation behaves differently from .NET
  • 44440: Attempting to JIT error in function with pointer arithmetic
  • 44549: Ide Shuts down: System.ArgumentException: Item has already been added. Key in dictionary: ‘XamlG’ Key being added: ‘XamlG’
  • 44624: Connecting to SQL Server using IPv4 exception.
  • 44707: RemotingConfiguration.Configure() Throws RemotingException Because it Cannot Load ‘machine.config’
  • 44729: Type.GetType(“blah”,true,false) throws TypeLoadException without message
  • 44751: Incorrect code flow analysis with goto and out parameter causes CS0177
  • 44843: SqlCommand.ExecuteReaderAsync throws NotImplementedException
  • 44937: System.Diagnostics.StartProcess does not detect dotnetcore compiled assemblies as managed
  • 44978: HttpClientHandler.SendAsync should throw HttpRequestException for proxy auth failure
  • 44994: DeflateStream decompression is incomplete if reading byte-by-byte
  • 45129: Uri.IsWellFormedUriString returns incorrect result for relative uris beginning with slash
  • 45137: Seeing new AAPT0000 errors when building certain projects against master
  • 45270: Cannot add System.Reactive to watchOS Extension project
  • 45286: C# string interpolation line does not compile on OSX but does on MSBuild
  • 45774: Wrong scopes in .mdb in case of foreach loop
  • 45788: Marshaling a native NULL pointer to a managed array creates a new zero sized array
  • 46175: If the RSA will be used by multiple threads, it has a variety of exceptions.
  • 46190: Overload resolution fails in a case where methods use a named parameter in different positions
  • 46250: Type.GetType with throwOnError true doesn’t throw for a generic instance type with too few generic arguments
  • 47205: Uri.TryCreate throws exception
  • 42414: Run path_helper in OSX postinstall script to make Mono commands available in same shell session
  • 42365: Mono 4.4.1 OSX package doesn’t clean up old symlinks from /usr/local/bin

Contributors

Alan McGovern, Aleksey Kliger, Alex Earl, Alex Rønne Petersen, Alexander Kyte, Alexander Köplinger, Alexis Christoforides, Andi McClure, Andres G. Aragoneses, Angelo Compagnucci, Ankit Jain, Bennjamin Blast, Bernhard Urban, Chris Hamons, Dmitriy Loktionov, Craig McQueen, David Karlaš, David Mitchell, Dolphin Hawkins, Emil Sandstø, Henric Müller, Jb Evain, Jiří Volejník, Jo Shields, João Matos, Joel Martinez, Johan Lorensson, Jon Purdy, Jonathan Chambers, Jonathan Pryor, Josh Peterson, Kamil Rytarowski, Katharina Bogad, Kelly Washington, Konstantin Safonov, Lluis Sanchez, Ludovic Henry, Manu, Marcos Henrich, Marek Habersack, Marek Safar, Marius Ungureanu, Mark Probst, Martin Baulig, Matthew Brophy, Matthew Leibowitz, Miguel de Icaza, Mikayla Hutchinson, Mike Voorhees, Neale Ferguson, Niklas Therning, Pozdeev, Rodrigo Kumpera, Rolf Bjarne Kvinge, Sebastien Pouliot, Shay Rojansky, Vincent Povirk, Vlad Brezae, Zoltan Varga