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.
Bug was caused by wrong values in enum because `string` is parsed only when type is `SpecificTrampoline` but with mismatching values between C and C# enums it didn't parse string when it should causing parsing next event throwing random exceptions because there was still unexpected string data.
* [w32handle] Don't enter GC SAFE around calls to w32handle_wait_{one,multiple}
On non-Win32, the mono_w32handle_wait_{one,multiple} implementation is
coop-aware, so there's no need to enter/exit GC Safe.
On Win32, mono_win32_wait_for_{single_object,multiple_objects}_ex is not coop
aware (and can't be - because it's called from utils/os-event-win32.c which is
not supposed to use coop machinery), so do GC transitions around these calls.
Fixes cooperative GC regression due to f5fc773512
* [w32process] Use coop concurrency primitives
for exit_sem and processes_mutex.
With OS semaphores we could deadlock under coop GC if a GC happens at the same time that
a thread is waiting on the exit_sem - the finalizer thread gets suspended and
the incoming SIGCHLD never posts, so the waiting thread never suspends and the
GC STW never happens.
fixup! [w32process] Use coop semaphore for exit_sem
* [test] assembly_append_ordering.cs: mark methods with NoInlining
if TriggerLoadingSystemCore is inlined into Main, System.Core will be loaded
when Main is JITed, which throws off the assembly loading ordering that the
test cares about: that the SRE assembly is loaded before System.Core.
When we leave a try block and invoke finally blocks, we need to add try holes also for catch handlers, since they can invoke the previously handled finally blocks.
This has the following advantages:
* There is only one implementation instead of two
* The C version no longer needs to be compiled/recompiled.
The disadvantage is the additional build time dependency on python.
The windows build will keep using the C version for now.
* [jit] Extract AOT definitions from mini.h to aot-runtime.h.
* [jit] Remove some dead declarations from mini.h.
* [jit] Extract some non-JIT related functions and MonoJitDomainInfo/MonoJitTlsData into mini-runtime.h
- 1 pixel for right and bottom to compensate cells CellBounds overlapping;
- one more pixel for top, right and bottom to have one pixel gap between text and border. Left border had a good gap already (why?).
No call DrawText for cell if there is no rectangle at all.
The AOT profiler is not meant to be loaded during AOT compilation.
The coverage profiler does not currently support instrumentation of AOT code.
The log profiler does support enter/leave instrumentation of AOT code, but no
other functionality should be enabled in this case. We only want to set the
call instrumentation filter callback and then return control to the runtime.
* [interp] disassembler for mint instructions should return a string instead of printing char by char
otherwise logs are unreadable on products like XI
* [fixup] free `ins`
With the revamped GC root reporting work, some GC root unregister events will
arrive after the thread_stopped event. This will cause the thread to be
re-added to the thread list in the profiler, and never be removed until program
exit. This meant that if such a thread had actually exited and a new thread
would reuse its thread ID, that new thread would fail to add itself to the
thread list, leading to failures like this one:
init_thread: failed to insert thread 0x70000b761000 in log_profiler.profiler_thread_list, found = true
By using the new thread_exited event, we remove the thread from the thread list
after these GC root unregister events have arrived, thereby ensuring that the
thread won't be incorrectly 'resurrected'.
thread_stopping occurs earlier than thread_stopped, before any of the detach
code has run. thread_exited occurs after thread_stopped, once all detach logic
has finished.
* [runtime] Implement a few broken getters on ModuleBuilder
* [runtime] Implement ModuleBuilder.GetCustomAttributes
* [runtime] Test GetMethods, GetCustomAttributes, and GetFields for ModuleBuilder
* [runtime] Specify and test use of typebuilders with Custom Attributes + add more tests
* [w32find] Remove use of w32handle
* [w32handle] Ref handle when looking it up so it doesn't get destroyed while using it
* [w32handle] Ref handle when accessing its MonoW32HandleBase
* [w32handle] Make MonoW32Handle public
* [w32handle] Return MonoW32Handle as part of mono_w32handle_lookup_and_ref
* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_own
* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_isowned
* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_signal
* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_prewait
* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_specialwait
* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_details
* [w32handle] Pass MonoW32Handle from mono_w32handle_foreach
* [w32handle] Pass MonoW32Handle to own_if_{owned,signalled}
* [w32handle] Pass MonoW32Handle to mono_w32handle_issignalled
* [w32handle] Pass MonoW32Handle from mono_w32handle_set_in_use
* [w32handle] Pass MonoW32Handle to mono_w32handle_{lock,trylock,unlock}_handle
* [w32handle] Remove dead mono_w32handle_ref
* [w32handle] Pass MonoW32Handle from mono_w32handle_set_signal_state
* [w32handle] Pass MonoW32Handle to mono_w32handle_test_capabilities
* [w32handle] Remove dead mono_w32handle_get_type
* [w32handle] Pass MonoW32Handle to mono_w32handle_ops_signal
* [w32handle] Pass MonoW32Handle to mono_w32handle_ops_isowned
* [w32handle] Pass MonoW32Handle to mono_w32handle_ops_specialwait
* [w32handle] Pass MonoW32Handle to mono_w32handle_timedwait_signal_handle
* [w32handle] Fix some typos and ref/unref imbalance
* [w32handle] Rename mono_w32handle_{trylock,lock,unlock}_handle to mono_w32handle_{trylock,lock,unlock}
* [w32handle] Rename numhandles to nhandles
* [w32handle] Return MonoW32Handle instead of index when creating the handle
* [w32handle] Remove gpointer handle parameter for mono_w32handle_{ref,unref}_core
* [w32handle] Remove gpointer handle parameter for mono_w32handle_timedwait_signal_handle
* [w32handle] Remove gpointer handle parameter for mono_w32handle_duplicate
* [w32handle] Remove gpointer handle parameter for w32handle_destroy
* [w32handle] Remove gpointer handle parameter for mono_w32handle_unref
* [w32handle] Remove dead function
* [w32handle] Remove gpointer handle parameter for own_if_{owned,signalled}
* [w32handle] Remove gpointer handle parameter for mono_w32handle_{wait_one,wait_multiple,signal_and_wait}
* [w32handle] Remove gpointer handle parameter for mono_w32handle_foreach callback
* [w32handle] Remove gpointer handle parameter for mono_w32handle_ops_{signal,own,isowned,specialwait,prewait,details}
* [w32handle] Make mutex and cond coop friendly
* [w32handle] Check for ref before type in mono_w32handle_lookup_and_ref
* [w32handle] Allocate the private_handles array on the heap, to reduce mono executable and library size
If nodefaults is passed as the first argument, we would print `Could not parse argument: nodefaults` due to how it's parsed differently.
If nodefaults is passed after the first argument we would not print a warning that this was wrong.
This commit fixes both usability issues.
* [sdks] Fix Android pick of mono runtime
* [android] Have Console.{Out,Error} go through the runtime log mechanism to ease their interception
* [sdks] Intercept runtime logs instead of Console to send back for instrumentation
* [sdks] Intercept Android test runner logging
[profiler] Some documentation improvements
* Update and rewrite profiler-related `man` pages.
* Update profiler API documentation for the new API.
* Extend the `exdoc` tool to support some more Doxygen features.
* Document the AOT profiler's file format.
* Clean up the sample profiler module and add a makefile.
* Include context/domain reports in `mprof-report`'s default report set.
* Exit the process when the `help` option is passed to the profilers.
* Remove the IOMap profiler.
* Remove some deprecated options from the log profiler's `help` output.
* Clean up the AOT profiler and bring its user interface in line with the others.
* Allow comments in coverage filter files.
In 22f0977132 it was disabled
but we can actually just run a shorter version in PRs.
Also reenable the precompilation target for the managed CoreCLR tests.
[LogProfiler] Removed GcRoot events logging from start
GcRoots should only be reported/captured during heapshot. We already set callback when heapshot collection starts and unset it when heapshot is finished. Which means after 1st heapshot is taken we don't log them outside heapshot. Hence we shouldn't be logging them from start...
GcRoots should only be reported/captured during heapshot. We already set callback when heapshot collection starts and unset it when heapshot is finished. Which means after 1st heapshot is taken we don't log them outside heapshot. Hence we shouldn't be logging them from start...
The test was added in https://github.com/mono/mono/commit/375471820c02ff0bab025bff75b5da7efc95d3cd.
We were seeing some flakyness in the this test, looking at it I
noticed that we were passing executeOnlyOnce = false to
(Unsafe)RegisterWaitForSingleObject. This means that the delegate
would be executed again whenever the AutoResetEvent `evt` is signaled or
the timeout elapsed. The problem is that evt is never signaled by design
and we set a timeout of 1ms which means we'd execute it in a tight loop.
Setting executeOnlyOnce = true fixes this and I verified it doesn't
change the intent of the test (i.e. the test still fails after the
original commit is reverted).
Bumped the timeout for the CountdownEvent as well to be safe
since it's quite short.
When doing an OP_CALL_HANDLER for a clause (from a leave opcode), all following instructions, up until the actual branch out of the try block, should be part of a hole for that clause. We were failing to account for a single leave instruction invoking multiple finally clauses sequentially, in which case a basic block can be a try hole for multiple clauses.
* [bcl] Build some assemblies with -warnaserror
This ensures that we keep the build warning free.
We'll only opt-in a few assemblies that already have zero warnings.
We also only apply this when using csc as mcs might raise different warnings.
For now just opt-in assemblies in the net_4_x profile.
* Use the same option parsing logic as the other profilers.
* Support the same output file syntax as the other profilers.
* Use output.aotprofile as the default output file name.
* Open the output file on startup rather than shutdown.
* Use runtime logging functions instead of printf/fprintf.
* Don't print anything unless the verbose option is given.
* Fix an endianness issue with writing ints to the output file.
* Move all profiler state into MonoProfiler structure and store it statically.
* Remove outdated comments and includes.
* Separate profiler module documentation into a new mono-profilers(1) page.
* Add documentation for the aot and coverage profilers.
* Rewrite the mprof-report(1) page to only talk about mprof-report itself.
* Rewrite and update the profiler-related sections of mono(1).
* Conform to man page formatting conventions.
* Move doc comments to profiler.c so they're picked up by exdoc.
* Rewrite mono-api-profiler.html for the new profiler API.
* Clarify some aspects of the doc comments.
Some generic instances were not generated because they were only referenced by METHOD_RGCTX patches, and the gsharedvt
fallback didn't work because the method in question Unsafe.Add<T> uses a sizeof opcode on a gsharedvt type which is currently
not supported.
Testcase:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
using System;
using System.Runtime.CompilerServices;
public class Tests
{
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public void Foo55<T> () {
byte[] arr = new byte [10];
ref byte data0 = ref arr [0];
Unsafe.Add (ref data0, 0);
}
interface IFace {
void Foo55 <T> ();
}
class AClass : IFace {
public void Foo55 <T> () {
byte[] arr = new byte [10];
ref byte data0 = ref arr [0];
Unsafe.Add (ref data0, 0);
}
}
public static int Main () {
IFace iface = new AClass ();
iface.Foo55<int> ();
return 0;
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* [ci] Fix testing of msbuild in run-test-mac-sdk.sh
It contained the old version number and failed on bots that didn't
have leftover old build result.
* [ci] Fix msbuild paths in Windows packaging
They changed with 73bd521c07.
mono_class_setup_interface_offsets and mono_class_setup_interface_id should
only be called for interfaces.
mono_class_setup_interface_offsets is incorrect for classes, and
mono_class_setup_interface_id would be a no-op.
* [ci] Add Jenkins pipeline script for building OSX and Windows packages
This replaces the current Jenkins freestyle jobs.
We no longer need the signing inside of the MacSDKRelease profile
since we're now signing on a separate service and having the signing
certificates locally is discouraged anyway.
* [ci] Update embedded gtk-sharp in Windows msi to 2.12.45
This matches what we ship on www.mono-project.com
* [sdks] Match xamarin-android targets flags and parameters
* [sdks] Only compile BCL profiles that are needed
* [sdks] Add release and debug out directories for android
* [sdks] Add Android SDK and NDK paths from xamarin-android
* [sdks] Match xamarin-android x86 SDK version
* [sdks] Use make_standalone_toolchain.py to provision the Android toolchain
* Bump nuget-buildtasks
cherry-pick 304d785bd0
* [msbuild] Install importbefore/after hooks for nuget
cherry-pick 4c935964b2
* [msbuild] Fix build - create the directories before installing .. (#5980)
.. to them.
cherry-pick d711efdd90
* [msbuild] Fix build (#5981)
- Don't copy 14.0/Imports to 15.0 now, as we do that in nuget-buildtasks.
- And don't create symlinks for Microsoft.NuGet.targets as it is not
required anymore.
cherry-pick ef1ea85c0f
* [tools] Fix .apps generated by MacPack not running when Mono 5 is installed on macOS
The current script used by the generated .app only checks for Mono in /usr/local/bin, but not in /Library/Frameworks/Mono.framework/Versions/Current/Commands (the default location for new installations of Mono 5 on macOS)
* [tools] Fix WinForms .apps generated by MacPack not running when Mono 5 is installed on 64-bit macOS
Latest Mono now defaults to running mono64 on a 64-bit OS but there is currently no WinForms support on 64-bit Mono. Pass --arch=32 to mono when wrapping a WinForms app with MacPack.
* Localized * FileDialog. Fixed missing Locale.GetText for the displayed strings.
* Fixed padding and size of buttons in the PopupButtonPanel class. This was done to remove the workaround "Recently\nused" and similar in futher localizations.
* Changed width of PopupButtonPanel to prevent sticking buttons to the separator.
Instead of using find_method which relies on method name and exact signature
matching (and thus can't work for variant interfaces), use the vtable and the
interface offset to find the constrained method.
Terminology:
base method - a method of the base class to be called
base class - some general class or interface that declares a method
constraint class - a more specific class that also implements the method.
constrained method - the version of the base method in the constraint class.
To find the constrained method given the base method:
- if the base class is a class:
the constraint class can't be an interface. it's either the base class or
some subclass of it. If the base method isn't virtual there's nothing to do
the constrained method is the same one.
If the base method is virtual, get its vtable slot and find the corresponding
method in the constraint class's vtable.
- if the base class is an interface:
in this case the constraint class is either another interface or a class.
if the constraint class is an interface, since interfaces can't have
implementations, there's nothing to do.
if the constraint class is a class, then to find the constrained method
get the interface slot offset of the base method and find the base interface offset
of the base interface and look in the constrained class vtable.
(the base interface offset gives the starting vtable slot for the base
interface in the constraint class vtable; the slot offsets go consecutively
for each of the methods of the interface).
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=60545
They are not generated by a ruby script.
The commit includes the generated file and the generation script for now to ease development.
We can later discuss generating it at build time.
In Unix, assume our current directory contains:
`test`, a directory
`test/test2`, another directory
`test/test2/test_file`, a file
`test3`, a symbolic link pointing to `test/test2`
Then the path "test3/../test3" has two interpretations depending on the processor:
* The OS (the `lstat` syscall, `ls`, etc.) will find it invalid (as it evaluates to: enter `test/test2`, go up one level, try to enter `test3` which is another level down
* We (.NET, at least CoreCLR) should find it valid (enter `test3`, go up one level, enter `test3`).
This ensures that for Directory.Exists, we process the path `..`'s on the .NET level before passing it for native processing.
this test case was broken for an unknown time, but surfaced with a
recent change in nunit-lite (2255c54966)
that runs every test in a new `ExecutionContext`. Previously, the
pre-condition for this test was implicility fulfilled by another test.
The test failed already when executed only on its own. With the change
around `ExecutionContext`, each test is "isolated" regarding said
pre-condition.
The fix is to explicitly fulfil the pre-condition in the test.
ModuleBuilder::GetArrayMethod returns a fresh MonoArrayMethod instance each
time it's called, even if you ask for the same method multiple times. On the
other hand, mono_image_get_array_token caches tokens by method signature.
Therefore mono_image_create_token should expect collisions.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=60238
* [runtime] Fix mkbundle compilation on OSX
* [runtime] Add aot arguments to mkbundle
* [runtime] Enable compiling aot with mkbundle
* [runtime] Add new dedup interface to mkbundle
* [runtime] Fix path resolving for mkbundle
* [runtime] Use mkbundle in BCL tests
* [runtime] Skip building System.Security, System.IdentityModel tests on testing_aot_full
* [runtime] Fix in-tree building for mkbundle
* [runtime] Move testing dll into profile
* [runtime] Add target to mkbundle all tests before CI
* [runtime] Build stripper and use with mkbundle
Preliminary linker support ran into dependency-finding bug
with the monolinker.exe binary. Fix postponed until later.
* [runtime] Skip not supported tests with mkbundle
* [runtime] Don't re-aot when running BCL tests
* [runtime] Provide config to mkbundle
* [runtime] Fix mkbundle internationalization test results, build all
* [runtime] Clean up temp mkbundle aot directory
* [runtime] Add mkbundle support for dedup
* [runtime] Fix tracking of dedup module in mkbundle
* [runtime] Document mkbundle AOT options in man pages
* [runtime] Fix CADMessage generic method argument marshalling
* [runtime] Support excluding or choosing to emit only inflated methods
* [runtime] Only write cache if changed, so can be used by Makefiles
* [runtime] Thread state through multiple mono_compile_assembly calls
* [runtime] Emit skipped methods in dedup module
* [runtime] Use AOT attribute to mark dummy dedup module
* [runtime] Expose and use can_dedup for AOT compiler+runtime
* [runtime] Add missing cases to the mangler
* [runtime] Fix direct calls with dedup
* [runtime] Implement runtime support for finding deduped code
* [runtime] Refactor dedup state setup into new function
* [runtime] Add in dedup debugging aid / external visibility
Gives a demo on how to make mangled method names externally visible
* [runtime] Log dedup statistics
This fix is a bit weird but it's due to some restrictions of the managed API.
MissingMemberException & friends require both ClassName and MemberName to be supplied independently, so the signature
can't simply be applied to MemberName. So we pass it on a separate field.
The next thing is that we want C#'esque signatures, where the return type comes before ClassName.MemberName, so we pass
a format string and apply it in managed.
it was fine on CI, but developers can run into build errors if they
don't follow a strict order (due to autotools fighting with
`winconfig.h`).
`basic.exe` passes, but everything involving native transitions crashes.
This introduces the following changes.
By default, enable more events. Exceptions and Counters are on by default.
By default, if alloc or heapshot are enabled, we emit root events as well.
New `nodefaults` argument that disables the above changes to default arg processing.
Added "nocalls" argument for compat only purposes.
Restored "cycles/" prefix to sample frequency argument. It was already a dead argument, but kept for compat.
We restored that as existing clients pass that flag.
* [tests] Appdomain assembly loading regression test for #49308
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=49308
We try to trick the remoting code into causing an assembly from a bad directory
to be loaded too eagerly into an appdomain. If we succeed, we call a method
that doesn't exist. Expected behavior is that the bad assembly is not loaded
and instead we can do an Assembly.LoadFrom of a good assembly.
* [tests] Add appdomain-marshalbyref-assemblyload.exe to KNOWN_FAILING_TESTS
This is a regression test for
https://bugzilla.xamarin.com/show_bug.cgi?id=49308, it should be re-enabled
when the bug is fixed.
.. of 15.x. It doesn't really affect anything and makes it simpler on
wrench to specify directory from which to run the tests!
(cherry picked from commit 3f3b106aca)
# Conflicts:
# packaging/MacSDK/msbuild.py
* [Tests] Make Mono.Data.Sqlite tests more robuts.
There are cases in which the tests are ran in parallel and the files
used for the db are writte/read by several tests at the same time. This
changes ensures that we do have a diff test file per test case to ensure
that we do not have false negatives.
Any translation unit that includes a Mono header should include <config.h>
first to ensure that all of our configuration defines are available.
In particular, config.h defines MONO_INSIDE_RUNTIME which, in mono-publib.h causes
MONO_RT_EXTERNAL_ONLY to be defined to an attribute that causes a compilation
error if you use a function that is internally deprecated for the runtime.
Also change a couple of places that used non-_checked functions.
Handles macro bodies are allowed to operate on raw pointers to managed memory.
The macro arguments must be UNSPUPPRESSed because we want warnings if the
arguments are doing bad things.
Marking a struct definition or a typedef with MONO_RT_MANAGED_ATTR will cause
Centrinel to treat pointers to the struct as residing in managed memory and to
issue warnings when raw pointers to such managed objects occur in the runtime.
(Also Centrinel knows that if the first field of a struct is a `MonoObject`,
then the struct is definiting a subtype of a managed object and so pointers to
_that_ struct also point into managed memory)
This is a candidate fix for:
https://bugzilla.xamarin.com/show_bug.cgi?id=60317
The bug was introduced by 1b5e0f7331.
Preliminary verification
========================
If I make just this _one_ change to a "bad" commit of Mono from after
commit 1b5e0f7, rebuild System.dll in the `xammac` profile, and then
overwrite that file in the MonoBundle directory of a Xamarin.Mac test
app, then I restore the old "good" behavior. (I started with
38da0b3b49 as the "bad" version for my
tests.)
I believe this confirms that the cause of bug 60317 was the usual
deadlocking issue when awaiting Tasks on the UI thread. As discussed on
https://blog.stephencleary.com/2012/07/dont-block-on-async-code.html, if
any Tasks awaited anywhere up the call stack are missing
`ConfigureAwait (false)`, then you can run into trouble on the UI
thread.
Additional little checks
========================
1. Do the other `await` statements in commit
1b5e0f7331 all look OK? Yes, it looks
like this was the only `await` statement that was missing
`ConfigureAwait (false)`:
```
$ git show 1b5e0f7331 | grep await
+ await ProcessOperation (cancellationToken).ConfigureAwait (false);
+ var ret = await InnerRead (cancellationToken).ConfigureAwait (false);
+ await Parent.InnerWrite (RunSynchronously, cancellationToken);
+ var ret = await Parent.InnerRead (RunSynchronously, requestedSize, cancellationToken).ConfigureAwait (false);
+ result = await asyncRequest.StartOperation (CancellationToken.None).ConfigureAwait (false);
+ result = await asyncRequest.StartOperation (cancellationToken).ConfigureAwait (false);
+ var ret = await task.ConfigureAwait (false);
+ await task.ConfigureAwait (false);
```
2. Is it a concern that mcs/class/System did not contain any calls to
`ConfigureAwait ()` until commit 1b5e0f7:
```
$ git grep ConfigureAwait 1b5e0f73316ee7b83c8947bc738015443fabd7af^ -- mcs/class/System || echo 'None'
None
```
I do not think this is a concern. For example,
System.Net.Http.HttpClient has been using `ConfigureAwait (false)` for
several years, so there is a precedent for it.
This occasionally happens:
```
System.NullReferenceException : Object reference not set to an instance of an object
at System.Diagnostics.Win32EventLog.NotifyEventThread (System.Threading.ManualResetEvent resetEvent) [0x00001] in D:\j\workspace\w\mcs\class\System\System.Diagnostics\Win32EventLog.cs:739
at System.Diagnostics.Win32EventLog.<EnableNotification>b__44_0 () [0x00000] in D:\j\workspace\w\mcs\class\System\System.Diagnostics\Win32EventLog.cs:729
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in D:\j\workspace\w\mcs\class\referencesource\mscorlib\system\threading\thread.cs:68
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in D:\j\workspace\w\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 D:\j\workspace\w\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 D:\j\workspace\w\mcs\class\referencesource\mscorlib\system\threading\executioncontext.cs:893
at System.Threading.ThreadHelper.ThreadStart () [0x00008] in D:\j\workspace\w\mcs\class\referencesource\mscorlib\system\threading\thread.cs:105
```
We'll get it because there's a race as the lamdba capturing
_notifyResetEvent in EnableNotification() is outside of the
_eventLock so _notifyResetEvent can be null by the time it is called.
We need to check for that case in NotifyEventThread().
* [interp] clear stack on resuming into the main loop
fixes `System.Collections.Generic.DictionaryTest.IDictionary_Add3`.
The problem is that resuming into an handler requires the evaluation stack to be emptied, which didn't happen with the new unified exception handling.
The frame layout looks like this in memory:
| sp | vt_sp | locals | ... |
|----|-------|--------|-----|
If we don't empty `sp` properly, we will eventually overflow into the `vt_sp` area (which is the evaluation stack for value types). So things get funny if `sp == vt_sp` and you do stuff like this:
```c
sp->data.p = vt_sp;
```
Kind of amazing that it almost passed the whole test suite with that bug.
* [interp] clear eval stack for value types as well when entering a handler
* [interp] disable more tests in corlib suite
* [Facades] Use same assembly company/product/copyright attributes as other BCL assemblies
We can't use Consts.cs since it'd bloat up the facades too much.
Also remove ".dll" suffix from AssemblyTitle/Description to match
what the Facades in the .NET Framework Reference Assemblies pack
are using.
* Bump API snapshot submodule
* [interp] enable it by default in configure
can be disabled via --enable-minimal=interpreter, like other components in the
runtime.
* [interp] use DISABLE_INTERPRETER in Makefile.am.in so it is closer to what we had before
* [interp] improve handling of interpreter flag and also check if we are on a cross-compile runtime
* [configure] add interpreter to the list of --enable-minimal
* [ci] remove --enable-interpreter from script
* [windows] disable interpreter for now
* [driver] add output about availabilty of interpreter in --version
* [man] add entry to mono.1 about --interpreter
* [driver] update --interpreter handling
Race only observed on Windows and current solution adds dependency between detach
and finalizer thread. Disable on none Windows platforms until we have an alternative
solution to the race condition. Keep on Windows until we have alternative solution
since race is manifesting itself on Jenkins builds.
This removes the duplicate code from the interpreter and makes it possible to support exception debugging.
Also fix the the basic block construction code so CEE_THROW begins a new bblock.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59909
WebChannelFactory doesn't add the WebHttpBehavior on mobile:
https://github.com/mono/mono/blob/4272b68b769951c221ec39d3e844f8f715e1df62/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebChannelFactory.cs#L87-L90
This makes the WebInvokeAttributeTest.RejectTwoParametersWhenNotWrapped
test fail on mobile since it doesn't reach the normal validation
method where it'd fail with InvalidOperationException, e.g. here''s
the stack on net_4_x profile:
```
System.InvalidOperationException : Operation 'Join' has multiple message body parts. Add parameters to the UriTemplate or change the BodyStyle to 'Wrapped' or 'WrappedRequest' on the WebInvoke/WebGet attribute.
at System.ServiceModel.Description.WebHttpBehavior.ValidateOperation (System.ServiceModel.Description.OperationDescription operation) [0x000f9] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel.Web/System.ServiceModel.Description/WebHttpBehavior.cs:249
at System.ServiceModel.Description.WebHttpBehavior.Validate (System.ServiceModel.Description.ServiceEndpoint endpoint) [0x00028] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel.Web/System.ServiceModel.Description/WebHttpBehavior.cs:268
at System.ServiceModel.Description.ServiceEndpoint.Validate () [0x0007f] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel/System.ServiceModel.Description/ServiceEndpoint.cs:129
at System.ServiceModel.ChannelFactory`1[TChannel].CreateChannel (System.ServiceModel.EndpointAddress address, System.Uri via) [0x0002b] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs:148
at System.ServiceModel.ChannelFactory`1[TChannel].CreateChannel (System.ServiceModel.EndpointAddress address) [0x00000] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs:115
at System.ServiceModel.ChannelFactory`1[TChannel].CreateChannel () [0x00006] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs:110
```
We can fix this by adding the WebHttpBehavior in the test manually.
NB: I'm actually not sure why this isn't done by default on MOBILE?
According to MSDN it should.
rpm-find-provides is a mess, this makes it a bit less of a mess by adding not only stuff from the GAC, but also Facades and 4.5 directories. Doesn't help with version mismatches for facades though.
This fixes bug #60435, where the DataGridViewRow.CreateCellsInstance method is never invoked. Now value of the Cells property is initialized by calling the CreateCellsInstance method.
Removed unused localization resource files.
Added default resources for English locale. Updated makefile and System.Windows.Forms-net_4_x.csproj.
Class Locale now uses ResourceManager.
The zip tests were not using temp files which created bug #60480 when
trying to read the embeded resources. This also fixes the situation in
which tests are run in parallel for the Mac since we could have tests
that step on each other files.
Both on jit and interp, the full corlib message sink path does not work on some testcases. Apparently we rely on the xdomain wrappers for correctness there.
The object creation of some types (like ContextBoundObject) can return a transparent proxy. When calling the constructor on the returned object we might need to go through the remoting wrappers.
* [interp] Add infrastructure code needed for unified exception handling between the interpreter and the JIT.
* Pass the clause to mono_interp_set_resume_state ().
* Add a mono_interp_run_filter () function to run filter clauses.
* Add a 'ji' field to ExceptionTraceIp which is used to avoid an ip->ji lookup in ves_icall_get_trace ().
* Rename mono_handle_exception_internal_first_pass () to handle_exception_first_pass () and make it return the
StackFrameInfo for the frame which caught the exception.
This allows the removal of the duplicate and hard to understand interpreter EH code
and makes it easier to add debugger support to the intepreter.
* [sdb] Pass the already computed StackFrameInfo to mono_debugger_agent_handle_exception () so it doesn't have to be recomputed in ss_create (). This approach works both for the JIT and the interpreter.
* [interp] Generate seq points for async methods too.
* [interp] Rename ves_exec_method_with_context () to interp_exec_method_full (), add a interp_exec_method () helper with less arguments.
* [interp] Set ctx->sp for interpreter frames to the address of the InterpFrame structure, code in debugger-agent.c uses it to order frames.
* [sdb] Fix the support for filter clauses in the interpreter by running them in a new interpreter frame.
* [sdb] Add DEBUGGER_INVOKE frames for the interpreter.
* [interp] Add a mono_interp_frame_get_parent () function, use that instead of the 'new_sp' argument to mono_interp_frame_iter_next ().
* [sdb] Run the test code for the ClassLocalReflection () test only for that test since it doesn't work with the interpreter.
* [interp] Fix the build.
* [jit] Move the code handling the MonoLMFExt structures from exceptions-<ARCH>.c to mini-exceptions.c, its the same on all platforms.
* [jit] Remove mono_arch_init_lmf_ext (), it does the same on every platform.
Use getrandom() instead of /dev/urandom on Linux
getrandom() was introduced in version 3.17 of the Linux kernel and glibc has implemented it since version 2.25.
After a user requested minor collection we need to check if the new size of the heap exceeds the allowance, in which case we need to also do a major collection.
Fixes bug (#60168) where, if user triggers minors repeatedly, we never get to collect the major space (which is normally checked after the nursery is full, which never happens in this case)
d9922895d4 removed Mono.Unix.Native/SocketTest.cs
from the exclude list on the monodroid profile.
It turns out that some tests don't work there however,
they fail with an ArgumentOutOfRangeException on some socket options.
The latest NDK doesn't support platform 9 anymore, the minimum it accepted was 14 thus I changed both arm and x86 to it.
This is harmless as 14 covers all but gingerbread which XA plans on stopping to support.
Added a android-toolchain target that configure all android toolchains.
On my system, XS installs android sdk/ndk on different places.
This patch probe the default places and fallback to the places I got.
It does verify if the paths are bad and fail building ASAP.
Finally, in includes sdks/Make.config that will include defines to trim what things you actually want to build.
When matching a class in match_class() debug helper, avoid maching the class
if the matched-against descriptor's class name is only
a prefix of the class name, but the class name is actually
longer (e.g. don't match Foo2 against Foo).
Add a unit test for callspec parsing and evaluation.
call specifications are being used with the --trace command line
argument and with the log profiler 'callspec' parameter. This test
suite verifies that call specifications are correctly parsed and matched
against methods at runtime.
AM_CONDITIONAL(HOST_DARWIN, test x$host_darwin = xyes)
AM_CONDITIONAL(HOST_SIGPOSIX, test x$use_sigposix = xyes)
AM_CONDITIONAL(HOST_ANDROID, test x$platform_android = xyes)
AM_CONDITIONAL(HOST_TIZEN, test x$platform_tizen = xyes)
AM_CONDITIONAL(HOST_IOS, test x$platform_ios = xyes)
if test -z "$HOST_DARWIN_TRUE"; then :
@@ -846,6 +853,7 @@ fi
AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
AM_CONDITIONAL(SHARED_MONO, test x$with_shared_mono != xno)
AC_ARG_ENABLE(mcs-build, [ --disable-mcs-build disable the build of the mcs directory], try_mcs_build=$enableval, enable_mcs_build=yes)
AC_ARG_ENABLE(support-build, [ --disable-support-build disable the build of the support directory], try_support_build=$enableval, enable_support_build=yes)
AC_ARG_WITH(xen_opt, [ --with-xen_opt=yes,no Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes])
if test "x$with_xen_opt" = "xyes" -a "x$mono_cv_clang" = "xno"; then
@@ -921,6 +929,7 @@ AC_ARG_WITH(testing_aot_full, [ --with-testing_aot_full=yes,no If you w
AC_ARG_WITH(winaot, [ --with-winaot=yes,no If you want to build the Windows friendly AOT assemblies (defaults to no)], [], [with_winaot=default])
AC_ARG_WITH(orbis, [ --with-orbis=yes,no If you want to build the Orbis assemblies (defaults to no)], [], [with_orbis=default])
AC_ARG_WITH(unreal, [ --with-unreal=yes,no If you want to build the Unreal assemblies (defaults to no)], [], [with_unreal=default])
AC_ARG_WITH(wasm, [ --with-wasm=yes,no If you want to build the WebAssembly (defaults to no)], [], [with_wasm=default])
AC_ARG_WITH(runtime_preset, [ --with-runtime_preset=net_4_x,all,aot,hybridaot,fullaot,bitcode,unreal Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
Loaded 100 of 1752 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.