External threads are detached using TLS destructors and this leads to non-determinism around to cleanup ordering of keys.
This causes the profiler to see the profiler tls key null'd even though it was not detached yet.
Even though it's found during configure when targetting 10.7, it's not "really" available before versions 10.12 and it would crash with "lazy symbol binding failed".
* [sdks] Add support for building llvm unless the USE_PREBUILT_LLVM Make.config var is set.
* [sdks] Use prebuilt llvm binaries on ios CI.
* [sdks] Use the IGNORE_PACKAGE_LLVM variable to enable the building of llvm.
When we tried switching mono-project.com to enforce HTTPS these tests
started failing on systems without working SSL configuration.
Use a different domain which is guaranteed to be available over HTTP instead.
(cherry picked from commit a748bad303)
OS: Ubuntu 18.03
CMake: 3.10
For some reason cmake fails to detect any make program (be it ninja or make)
when cross-compiling for Android in XA. It happens despite the programs being in
$PATH and working correctly. The effect is that CMAKE_MAKE_PROGRAM is set to
"not found" in CMakeCache.txt and configuration fails as follows:
Call Stack (most recent call first):
external/mono/external/boringssl/util/android-cmake/android.toolchain.cmake:1140 (CMAKE_FORCE_CXX_COMPILER)
external/mono/sdks/builds/android-armeabi-v7a-debug/mono/btls/build-shared/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
CMakeLists.txt:3 (project)
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
This commit does not fix the issue, per se, but it works around it by finding
the first ninja/make (as configured) executable in $PATH and setting the
CMAKE_MAKE_PROGRAM to full path of the executable. I haven't spent too much time
investigating *why* cmake fails to find the executable (I merely ran it with
--trace-expand --debug-output which revealed nothing of consequence) but this
workaround should be safe for any version of CMake and any OS we use makefiles
on.
Current build uses `tar` to extract ZIP archives. This works with BSD
tar but not with GNU tar, alas. Tar was used in order to strip the root
directory of Android archive while moving files into place. This commit
replaces `tar` with a call to a shell script (because doing what it does
using Make defines is an exercise in pain) which works both on macOS/BSD
and on Linux.
* [Facades] Add System.Memory facade to mobile profiles
Contains only the types we have right now.
Fixes https://github.com/mono/mono/issues/7610
(cherry picked from commit ddcb792c01)
* Bump API snapshot submodule
* [runtime] Add a --disable-btl-lib configure option to disable the building of the btls lib, but compile the managed code with btls support.
* Disable building btls/ and support/ on the bcl build, they are not needed.
* [sdks] Add provisioning for Android SDK and NDK
This will also be used by XA
* Add missing backslash to mxe.mk
* Only grab bin/autopoint
* [sdks] Use provisioning for MXE
We want to treat MXE the same way we do Android SDK and NDK because it only rarely changes, and it's very long to build it.
A nested class that has protected access must be checked using the same inheritance based rules as members.
The existing code ignores that and does a plain visibility check that is only amendable for public/internal nested types.
* [sdks] Pass LLVM_SRC from XA to use `xamarin-android/external/llvm`
We do not clone to `$(LLVM_SRC)` because this is up to XA.
* [sdks] Pass IGNORE_PACKAGE_MXE from XA
This is to avoid rebuilding MXE while XA already took care of it.
* [sdks] Only checkout specific MXE and LLVM commit when cloning
* Use current nursery size when computing allowance
The allowance is the minimum heap growth that we allow between two majors (which is 4 * nursery_size). We need to use the current nursery size instead of the 4MB default, in order to facilitate low memory uses.
* Account for soft heap limit in allowance calculation
This is relevant in cases where the nursery size and soft heap limit are comparable in size.
Address https://github.com/mono/mono/issues/7093 in kind of an adhoc way.
The correct fix is to make
```
((IEnumerable<U>) (new T[] {...})).GetEnumerator()
```
return an `IEnumerator<U>` (like .NET does) instead of `IEnumerator<T>`
and to stop marking IEnumerator as an array special interface.
This reverts commit 26de079c89.
This resulted in 2017-12 having only a small part of the full v15 format as
seen in master or 2018-02. As such, files produced with 2017-12 were
effectively unreadable by mprof-report and the Xamarin Profiler.
Revert 2017-12 to v14 as backporting all of v15 (including the GC roots revamp)
is a fairly huge undertaking.
We had a few stubs that threw not implemented exceptions in Dispose()
which causes the finalizer thread to abort.
Since those classes throw in the constructor already there's no way
to create a valid object and we can remove the throw in Dispose().
Fixes https://github.com/mono/mono/issues/7338
The original version of this code overwrote the same string over and over
again. Because of the order of operations, when looking for siblings of
Test.dll, we would probe for Test.dll.mdb, then Test.pdb, then Test.pdb.config
(note the last one - should be Test.dll.config).
New version of the code uses fresh strings for each sibling.
Fixes https://github.com/mono/mono/issues/7262
Don't assert when comparing if an "array special interface" is assignable from
an array.
The code assumed that the special interface is some sort of generic instance
like ``IList`1<string>``, but it could be a generic type definition
``IList`1``.
There is a case where we would be obligated to return TRUE:
If someone used reflection to get the generic param of ``IList`1`` and then made an
array:
```
var i = typeof (IList<>);
var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T
var a = iparam.MakeArrayType (); // T[]
Console.WriteLine (i.IsAssignableFrom (a));
```
But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check,
earlier in mono_class_is_assignable_from.
So we can return FALSE here.
Fixes https://github.com/mono/mono/issues/7095
The `label` environment variable is set by Jenkins based on the
chroot/node configuration a given job is using.
This crept into the CI scripts while it should have been a
separate concern and caused all sorts of issues when we bumped
from e.g. debian-8-* to debian-9-* in some jobs.
Instead we should consistently use the CI_TAGS env var which we
control exclusively.
(cherry picked from commit eafd6e916f)
* [sdks] Add armv7s device build.
* [sdks] Disable dtrace on the cross compiler builds.
* [sdks] Avoid building mono-dtrace.h for the cross compilers, its not needed anymore.
* [sdks] Add a configure-mono target.
* [sdks] Put back the call to CheckXcodeDir.
* [sdks] Enable ccache if possible.
* [sdks] Generalize iosDeviceTemplate so it can build the tvos runtime as well. Add tvos device build.
Context: https://github.com/xamarin/xamarin-android/pull/1078
xamarin-android uses `mono-api-html` and `mono-api-info` in order to
perform API comparisons; see e.g. 4e459045.
A recent problem has arisen regarding "inter-API-level diffs": there
are many API changes which we consider to be acceptable, and thus
would like to ignore. Unfortunately, `mono-api-html` doesn't support
ignoring many of these constructs, e.g. base class changes:
<h3>Type Changed: Android.Preferences.CheckBoxPreference</h3>
Modified base type: <span class='removed removed-inline removed-breaking-inline'>Android.Preferences.Preference</span> <span class='added '>Android.Preferences.TwoStatePreference</span>
and property type changes:
<h3>Type Changed: Android.Views.InputEvent</h3>
<p>Modified properties:</p>
<pre>
<div data-is-breaking> public <span class='added added-breaking-inline'>abstract</span> int DeviceId { get; }
</div><div data-is-breaking> public <span class='added added-breaking-inline'>abstract</span> InputSourceType Source { get; }
Overhaul the `mono-api-html` "ignore" infrastructure:
* Introduce ignore "scoping". Previously, the ignore options would
only match the *member* text against any provided regular
expression. Thus, `mono-api-html -r ToString` would ignore *all*
members containing `ToString`. Furthermore, there was no way to
restrict the ignore to a particular type. Expand the regex
semantics so that the declaring type is used as a "prefix" for the
to-be-matched text. For example, if a class `Example` is removed,
`mono-api-html` will now match the following value against any
`-r` regular expressions:
Example: Removed type
* Add a `mono-api-html -v` option, to control output verbosity.
When specified, `mono-api-html` will print out available `-r`/etc.
option values:
$ mono-api-html expected.xml new.xml -v
Possible -a value: Android.Resource: Added fields: public static const int AccessibilityEventTypes;
Possible -r value: Android.Preferences.CheckBoxPreference: Modified base type: 'Android.Preferences.Preference' to 'Android.Preferences.TwoStatePreference'
Possible -r value: Android.Views.InputEvent: Modified properties: public int DeviceId { get; }
Possible -n value: Android.Views.UnavailableException: Added type
...
Additionally, allow `mono-api-html` to take a
`Mono.Options.ResponseFileSource`, which allows `@response-files` to
be used as command-line options.
* [sdks] Add targets for the watch cross compiler. (#7061)
* [offsets-tool] Add an '--output' argument to specify the output file directly instead of generating it from the target triple.
* [sdks] Add targets for the watch cross compiler.
* [sdks] Set XCODE_VERSION to 'Xcode' for now to fix the ios build. (#6568)
* [sdks] Set more ios version variables to empty to fix the build. (#6571)
* Revert "[sdks] Fix for XA integration (#7092)"
This reverts commit 5ef368bb1e.
* Revert "Merge more SDK changes from mono master. (#7090)"
This reverts commit c67ec40879.
* [sdks] Add targets for the watch cross compiler. (#7061)
* [offsets-tool] Add an '--output' argument to specify the output file directly instead of generating it from the target triple.
* [sdks] Add targets for the watch cross compiler.
* [sdks] Set XCODE_VERSION to 'Xcode' for now to fix the ios build. (#6568)
* [sdks] Set more ios version variables to empty to fix the build. (#6571)
This would break on iOS with following stacktrace:
```
Unhandled Exception:
System.ArgumentException: An item with the same key has already been added. Key: MonoTouchFixtures.CoreFoundation.BundleTest.TestStaticResourceUrlsNullType
at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException (System.Object key) [0x00000] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/throwhelper.cs:176
at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x001ad] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:466
at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:232
at NUnit.Framework.Internal.FinallyDelegate.Set (NUnit.Framework.Internal.TestExecutionContext context, System.Int64 startTicks, NUnit.Framework.Internal.TestResult result) [0x00023] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/FinallyDelegate.cs:77
at NUnit.Framework.Internal.WorkItems.WorkItem.DispatchWork (System.Object o) [0x00059] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:204
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:957
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:904
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:893
at NUnit.Framework.Internal.WorkItems.WorkItem.RunTest () [0x00005] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:188
at NUnit.Framework.Internal.WorkItems.WorkItem.Execute (NUnit.Framework.Internal.TestExecutionContext context) [0x00063] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:136
at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.RunChildren () [0x00035] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/CompositeWorkItem.cs:154
at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.PerformWork () [0x000de] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/CompositeWorkItem.cs:93
at NUnit.Framework.Internal.WorkItems.WorkItem.DispatchWork (System.Object o) [0x00071] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:205
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:957
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:904
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:893
at NUnit.Framework.Internal.WorkItems.WorkItem.RunTest () [0x00005] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:188
at NUnit.Framework.Internal.WorkItems.WorkItem.Execute (NUnit.Framework.Internal.TestExecutionContext context) [0x00063] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:136
at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.RunChildren () [0x00035] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/CompositeWorkItem.cs:154
at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.PerformWork () [0x000de] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/CompositeWorkItem.cs:93
at NUnit.Framework.Internal.WorkItems.WorkItem.DispatchWork (System.Object o) [0x00071] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:205
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:957
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:904
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:893
at NUnit.Framework.Internal.WorkItems.WorkItem.RunTest () [0x00005] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:188
at NUnit.Framework.Internal.WorkItems.WorkItem.Execute (NUnit.Framework.Internal.TestExecutionContext context) [0x00063] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:136
at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.RunChildren () [0x00035] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/CompositeWorkItem.cs:154
at NUnit.Framework.Internal.WorkItems.CompositeWorkItem.PerformWork () [0x000de] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/CompositeWorkItem.cs:93
at NUnit.Framework.Internal.WorkItems.WorkItem.DispatchWork (System.Object o) [0x00071] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:205
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:957
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:904
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:893
at NUnit.Framework.Internal.WorkItems.WorkItem.RunTest () [0x00005] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:188
at NUnit.Framework.Internal.WorkItems.WorkItem.Execute (NUnit.Framework.Internal.TestExecutionContext context) [0x00063] in /Users/poupou/git/d15-7/xamarin-macios/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/WorkItems/WorkItem.cs:136
at MonoTouch.NUnit.UI.BaseTouchRunner.Run (NUnit.Framework.Internal.Test test) [0x0004d] in /Users/poupou/git/d15-7/xamarin-macios/external/Touch.Unit/NUnitLite/TouchRunner/TouchRunner.cs:449
at MonoTouch.NUnit.UI.BaseTouchRunner.Run () [0x00030] in /Users/poupou/git/d15-7/xamarin-macios/external/Touch.Unit/NUnitLite/TouchRunner/TouchRunner.cs:171
at MonoTouch.NUnit.UI.BaseTouchRunner.<AutoRun>b__40_0 () [0x00000] in /Users/poupou/git/d15-7/xamarin-macios/external/Touch.Unit/NUnitLite/TouchRunner/TouchRunner.cs:139
at MonoTouch.NUnit.UI.TouchRunner+<>c__DisplayClass19_0.<ExecuteOnMainThread>b__0 () [0x00000] in /Users/poupou/git/d15-7/xamarin-macios/external/Touch.Unit/NUnitLite/TouchRunner/TouchRunner.cs:685
at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/poupou/git/d15-7/xamarin-macios/src/Foundation/NSAction.cs:125
--- End of stack trace from previous location where exception was thrown ---
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/poupou/git/d15-7/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/poupou/git/d15-7/xamarin-macios/src/UIKit/UIApplication.cs:63
at monotouchtest.Application.Main (System.String[] args) [0x00011] in /Users/poupou/git/d15-7/xamarin-macios/tests/monotouch-test/Main.cs:28
```
* nuget-hash-extractor: Add support for handling nuget with multiple
.. assemblies.
This is specifically required for handling .net assemblies in
`Microsoft.NET.Build.Extensions` nuget which don't work on mono. These
assemblies are bundled with msbuild and we want to be able to deny these
at runtime.
* nuget-hash-extractor: Add msbuild extensions nuget to list of nugets to
.. process. Version from:
https://github.com/dotnet/cli/blob/501e11d928c21608999c934f0a7078570b688c6c/build/DependencyVersions.props
```
<MicrosoftNETSdkPackageVersion>2.1.0-preview1-62414-02</MicrosoftNETSdkPackageVersion>
<MicrosoftNETBuildExtensionsPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftNETBuildExtensionsPackageVersion>
```
Also, update the list in the runtime and deniedAssembliesList.txt
installed for use by msbuild.
As a follow up to https://github.com/mono/mono/issues/6848 I checked
all the assemblies and found some more identity mismatches with .NET
(cherry picked from commit c84e6c81a2,
minus the Microsoft.VisualC.dll version fix)
There would be a compilation error in the XA build as follow:
```
obj/Release/bundles/armeabi-v7a/temp.c: In function 'install_aot_modules':
obj/Release/bundles/armeabi-v7a/temp.c:49:25: error: 'MONO_AOT_MODE_NORMAL' undeclared (first use in this function)
mono_jit_set_aot_mode (MONO_AOT_MODE_NORMAL);
^
obj/Release/bundles/armeabi-v7a/temp.c:49:25: note: each undeclared identifier is reported only once for each function it appears in
```
We've been using a certain pattern for the Windows .msi for a long
time but the build output used a different name which we simply
manually renamed before publishing.
Since we want to automate as much as possible we can change the
build to produce the correct name right away.
(cherry picked from commit d9a7a04f05
and b153e9074a)
Otherwise the default bockbuild behavior is to use the tip of
MONO_BRANCH which is not what we want when building on Jenkins.
(cherry picked from commit 4248d073d6)
Mobile does not support all clases found in System.ServiceModel, we skip
those tests of the not supported classes yet run all the others.
(cherry picked from commit 3f372d06ee)
* [class] Add Obsolete message to ICSharpCode.SharpZipLib.dll
Users should use the nuget package instead, we'll remove the assembly in Mono 6.0
Don't install it into the 4.7.1 reference assembly directory anymore.
* Bump api-snapshot
* [runtime] Allow access to protected default interface methods from classes which implement the interface.
* [interp] Add some automatic conversations between virtual and non-virtual calls that .net has. Fixes dim-valuetype.il.
* [bcl] Sort the MethodImpl table in PEAPI.
* [runtime] Enable dim-methodimpl.exe test.
* [runtime] Fix vtable construction tracing.
* [interp] Fix null checks on the receiver when converting virtual calls to non-virtual.
Also ensure that WebConnection calls nstream.EndRead().
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=61002
This bug is a regression in HTTPS web request cancellation behavior
first introduced on the 2017-06 branch by
https://github.com/mono/mono/commit/1b5e0f73316ee7b83c8947bc738015443fabd7af.
It is in fact resolved already for the master branch by the refactoring
in https://github.com/mono/mono/pull/6125. But since that refactoring
is too large to backport and since the master branch won't be integrated
into a release for a while longer, it is worth adding a separate smaller
fix for the older active development branches.
This proposed fix is intentionally conservative in how it modifies
`WebConnection.EndWrite()` and `WebConnection.EndRead()`. It makes sure
to keep precisely the same return values and exceptions as before.
The fix also makes a small change to the `Close()` method to avoid
setting `nstream = null`. This allows any pending `EndWrite()`,
`EndRead()`, or `ReadDone()` callbacks to use the `nstream` field even
after `Close()` has run. This shouldn't cause any new garbage
collection issues because the closed `WebConnection` object is not
expected to live much longer than the `NetworkStream` object referenced
by `nstream`.
Example of the problem for canceling `HttpClient.SendAsync()`
=============================================================
1. `WebConnectionStream.SetHeadersAsync()` calls
`WebConnection.BeginWrite()`, passing in an anonymous callback method
that will later call `WebConnection.EndWrite()` when the asynchronous
write operation completes [1].
2. When the `CancellationToken` for the call to `HttpClient.SendAsync()`
is notified about the cancellation, it calls `HttpWebRequest.Abort()`
[2], which calls `WebConnection.Abort()`, which calls
`WebConnection.Close()`.
3. `WebConnection.Close()` calls `Close()` on both the
`MobileAuthenticatedStream` and the network `Socket` and nulls out
the `WebConnection`'s field references to those objects [3].
`MobileAuthenticatedStream.Close()` in turn calls
`MobileAuthenticatedStream.Dispose()`, which sets the `lastException`
field to an `ObjectDisposedException`. If the asynchronous write
operation from step 1 is still in progress at this point, it will
throw the `ObjectDisposedException`.
4. When `MobileAuthenticatedStream.StartOperation()` throws the
`ObjectDisposedException` (thus completing the running Task), the
anonymous callback method from step 1 gets invoked, and it calls
`WebConnection.EndWrite()`.
5. The problem is that now `WebConnection.EndWrite()` fails to call
`MobileAuthenticatedStream.EndWrite()`. There are 2 parts of the
problem:
(a) `WebConnection.EndWrite()` always returns _before_ calling
`MobileAuthenticatedStream.EndWrite()` [4] because the call to
`Abort()` at step 2 has set the request status to canceled [5].
(b) Even if the cancellation status check weren't there, the attempt
to call `MobileAuthenticatedStream.EndWrite()` still wouldn't work
because `Close()` has set the reference to the stream to `null` at
step 3.
The proposed fix addresses (a) by rearranging `WebConnection.EndWrite()`
and `WebConnection.EndRead()` so that they _always_ call the
corresponding `MobileAuthenticatedStream` methods. It addresses (b) by
removing the line in `Close()` that sets the `nstream` field to `null`.
How did mono/2017-06 commit 1b5e0f7 introduce this problem?
===========================================================
Commit 1b5e0f7 uses Tasks and the `TaskToApm()` helper method
_correctly_, so by itself it's OK. The problem is that the older
`WebConnection` methods already had underlying limitations _before_
commit 1b5e0f7. In the Asynchronous Programming Model, "for each call
to BeginOperationName, the application should also call EndOperationName
to get the results of the operation" [6]. But `WebConnection` did not
strictly follow this rule. For example, `WebConnection.EndWrite()` did
_not_ always call `MobileAuthenticatedStream.EndWrite()`. This
imprecise behavior worked until now because unlike unobserved exceptions
in Tasks, "unobserved" exceptions in AsyncResult objects don't trigger
any behaviors when the objects are finalized. (The exceptions are just
discarded.) But now that `MobileAuthenticatedStream.BeginWrite()` uses
Tasks behind the scenes, `WebConnection` needs to be stricter about
following the rules.
Testing the proposed fix against old bugs from `git blame`
==========================================================
- Commit 613c2a9182https://bugzilla.xamarin.com/show_bug.cgi?id=31507
Results: Verified still fixed. I was able to reproduce the original
behavior by intentionally removing the old fix. I then put the old
fix back, added the new proposed changes, and verified that the test
case still produced the good behavior (only task cancellation
messages).
- Commit 7584df6cf8
Neither of the bugs mentioned in the commit message for 7584df6cf8
appears to be related to the `Data.request` check. Since that check
is the only part of the commit touched by the new proposed changes,
neither of the bugs should be affected. But just to be thorough, I
quickly ran through the test cases associated with those bugs.
https://bugzilla.novell.com/show_bug.cgi?id=515931
Results: OK. I tried the test case from
https://bugzilla.novell.com/show_bug.cgi?id=515097 with
`AllowWriteStreamBuffering` set to `true` or `false`. The write
operation started successfully in both cases, and the call to
`Abort()` was able to cancel the operation as expected.
https://bugzilla.novell.com/show_bug.cgi?id=510642
Results: OK. The test case still produced the expected overflow
exception.
References
==========
[1] https://github.com/mono/mono/blob/b293f453027bc075ce636988b383451e5c346347/mcs/class/System/System.Net/WebConnectionStream.cs#L664-L666
[2] https://github.com/mono/mono/blob/b293f453027bc075ce636988b383451e5c346347/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs#L347
[3] https://github.com/mono/mono/blob/b293f453027bc075ce636988b383451e5c346347/mcs/class/System/System.Net/WebConnection.cs#L1131-L1143
[4] https://github.com/mono/mono/blob/b293f453027bc075ce636988b383451e5c346347/mcs/class/System/System.Net/WebConnection.cs#L1033-L1034
[5] https://github.com/mono/mono/blob/b293f453027bc075ce636988b383451e5c346347/mcs/class/System/System.Net/WebConnection.cs#L1169
[6] https://docs.microsoft.com/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm
Follow up to https://github.com/mono/mono/pull/6431, we should
capture the exception that is passed to the methods.
Copied the SetResult() method that referencesource uses.
(cherry picked from commit ad5703adfd)
I found out that we were packaging e.g. MonoPosixHelper.dll from
the gtksharp msi instead of the one we build in Mono :P
This only happened in the x86 build because we don't package
gtksharp in the x64 build.
(cherry picked from commit ff197eb405)
This can happen when emitting code like:
```
class Foo<T> {
T elt;
public T getter () {
return elt; // ILGenerator.Emit (OpCodes.Ldfld, /*FieldBuilder of Foo::elt*/)
};
}
```
the old incorrect code emitted a fielddef token for Foo::elt, but it should be a
memberref for Foo<!0>::elt.
Likewise, if we have
```
class Foo<T> {
public T f () { /*...*/}
public void g () {
var x = f (); // ILGenerator.Emit (OpCodes.Call, /* MethodBuilder of Foo::f */)
/*... */
}
}
```
Fixes https://github.com/mono/mono/issues/6192
the old incorrect code would emit a fieldref token for Foo::f but it should be
a memberref for Foo<!0>::f
Lack of it causes a build error in XA:
CMake Error at [..]mono/external/boringssl/util/android-cmake/android.toolchain.cmake:800 (message):
Specified Android native API level 'android-12' is not supported by your
The set of minimum API levels in `configure.ac` is incorrect. The current
NDK (r16) requires minimum API level of 14 for the 32-bit targets and level 21
for the 64-bit targets.
/// This class contains constants used for deflation.
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
publicclassDeflaterConstants
{
/// <summary>
Loaded 100 of 581 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.