mono.git
7 years ago[msvc] Update csproj files
monojenkins [Wed, 26 Oct 2016 05:22:19 +0000 (05:22 +0000)]
[msvc] Update csproj files

7 years ago[mobile-static] Increase trampoline limits even more.
Zoltan Varga [Tue, 25 Oct 2016 22:51:17 +0000 (18:51 -0400)]
[mobile-static] Increase trampoline limits even more.

7 years ago[mobile-static] Increase the number of imt trampolines to 2000 to prevent running...
Zoltan Varga [Tue, 25 Oct 2016 22:12:58 +0000 (18:12 -0400)]
[mobile-static] Increase the number of imt trampolines to 2000 to prevent running out of them in the System.Core tests.

7 years ago[runtime] For delegate invoke wrappers, store the generic invoke method in the wrappe...
Zoltan Varga [Tue, 25 Oct 2016 22:05:32 +0000 (18:05 -0400)]
[runtime] For delegate invoke wrappers, store the generic invoke method in the wrapper info and inflate it when inflating the wrapper. Fixes ipy failure. (#3821)

7 years agoMerge pull request #3823 from mono/fix-btls-managed
Alexander Köplinger [Tue, 25 Oct 2016 20:29:23 +0000 (22:29 +0200)]
Merge pull request #3823 from mono/fix-btls-managed

[System] Don't build managed BTLS code on monotouch

7 years ago[bcl] Only build Mono.Btls.Interface and btls tool when BTLS is enabled
Alexander Köplinger [Tue, 25 Oct 2016 17:49:17 +0000 (19:49 +0200)]
[bcl] Only build Mono.Btls.Interface and btls tool when BTLS is enabled

7 years ago[System] Don't build managed BTLS code on monotouch
Alexander Köplinger [Tue, 25 Oct 2016 16:44:33 +0000 (18:44 +0200)]
[System] Don't build managed BTLS code on monotouch

After 2fb07d6c6d5b3915ef4665391febbb7b8be09fb5 BTLS can be used as a shared lib,
but this caused an issue in some monotouch tools which grepped the P/Invokes for `__Internal`
since these icalls wouldn't resolve on monotouch since BTLS is disabled there.

Instead, we now completely leave out building the managed parts of BTLS when
BTLS is not enabled.

7 years agoFix compilation errors in mono/utils/os-event-win32.c with Mingw/GCC (#3818)
Niklas Therning [Tue, 25 Oct 2016 14:49:50 +0000 (16:49 +0200)]
Fix compilation errors in mono/utils/os-event-win32.c with Mingw/GCC (#3818)

This was introduced in 92be5357d12ecf0cc4c51fbcb76fc0514b375d1c. The patch
also adds the os-event-win32.c file to the libmonoutils Visual Studio project.

7 years ago[BTLS]: Fix a ref-counting leak in X509ChainImplBtls. Fixes #45687. (#3811)
Martin Baulig [Tue, 25 Oct 2016 13:42:08 +0000 (15:42 +0200)]
[BTLS]: Fix a ref-counting leak in X509ChainImplBtls.  Fixes #45687. (#3811)

* [BTLS]: Fix a ref-counting leak in X509ChainImplBtls.  Fixes #45687.

* Set 'untrusted = null' in Dispose().

(cherry picked from commit c9a67ffc5addabe74015f7d8f33977f4ab416075)

7 years ago[System] Clean up some warnings
Marek Safar [Tue, 25 Oct 2016 12:28:35 +0000 (14:28 +0200)]
[System] Clean up some warnings

7 years ago[runtime] Ignore bit 14 in typedef export table during verification. It seems to...
Marek Safar [Tue, 25 Oct 2016 10:50:12 +0000 (12:50 +0200)]
[runtime] Ignore bit 14 in typedef export table during verification. It seems to be used by some WinRT predefined types

7 years agoMerge pull request #3817 from monojenkins/update-csprojs
Alexander Köplinger [Tue, 25 Oct 2016 09:58:06 +0000 (11:58 +0200)]
Merge pull request #3817 from monojenkins/update-csprojs

[msvc] Update csproj files

7 years agoMonoLinker: Fix a Typo in the README (#3816)
Swaroop Sridhar [Tue, 25 Oct 2016 05:33:25 +0000 (22:33 -0700)]
MonoLinker: Fix a Typo in the README (#3816)

7 years ago[msvc] Update csproj files
monojenkins [Tue, 25 Oct 2016 04:51:24 +0000 (04:51 +0000)]
[msvc] Update csproj files

7 years agoMerge pull request #3812 from rolfbjarne/watchos-no-cfnetwork
Marek Safar [Mon, 24 Oct 2016 21:27:39 +0000 (23:27 +0200)]
Merge pull request #3812 from rolfbjarne/watchos-no-cfnetwork

[System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.

7 years agoMerge pull request #3815 from microMolvi/patch-1
Alexander Köplinger [Mon, 24 Oct 2016 21:20:48 +0000 (23:20 +0200)]
Merge pull request #3815 from microMolvi/patch-1

caspol.1: fix minor grammatical errors

7 years ago[x86] Clear the fp stack when exceptions are thrown. Fixes #45841. (#3814)
Zoltan Varga [Mon, 24 Oct 2016 20:42:52 +0000 (16:42 -0400)]
[x86] Clear the fp stack when exceptions are thrown. Fixes #45841. (#3814)

7 years agocaspol.1: fix minor grammatical errors
Abdur Rehman [Mon, 24 Oct 2016 19:15:03 +0000 (00:15 +0500)]
caspol.1: fix minor grammatical errors

7 years ago[runtime] Fix an assert message.
Zoltan Varga [Mon, 24 Oct 2016 18:58:07 +0000 (14:58 -0400)]
[runtime] Fix an assert message.

7 years ago[System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.
Rolf Bjarne Kvinge [Mon, 24 Oct 2016 17:50:16 +0000 (19:50 +0200)]
[System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.

The MacProxy class uses CFNetwork, but since CFNetwork is not a public
framework on watchOS, we can't use it.

So remove MacProxy completely (it only contains internal classes), and throw
PlatformNotSupportedException in any API that used it (the managed networking
stack is not supported on watchOS anyway, so this should be safe).

https://bugzilla.xamarin.com/show_bug.cgi?id=45847

7 years ago[runtime] Add MonoOSEvent
Ludovic Henry [Tue, 27 Sep 2016 19:08:27 +0000 (21:08 +0200)]
[runtime] Add MonoOSEvent

7 years agoMake mkbundle use SDKs instead of a single runtime for cross compilation
Miguel de Icaza [Mon, 24 Oct 2016 16:47:31 +0000 (11:47 -0500)]
Make mkbundle use SDKs instead of a single runtime for cross compilation

Make mkbundle use SDKs instead of a single runtime for cross compilation

7 years agoMerge pull request #3801 from akoeplinger/netstandard20-updates
Alexander Köplinger [Mon, 24 Oct 2016 14:36:49 +0000 (16:36 +0200)]
Merge pull request #3801 from akoeplinger/netstandard20-updates

[bcl] Move a few types from the Facades into the framework for netstandard20 compatibility

7 years agoMerge pull request #3810 from lateralusX/jlorenss/add_missing_assert_include
Johan Lorensson [Mon, 24 Oct 2016 14:09:59 +0000 (16:09 +0200)]
Merge pull request #3810 from lateralusX/jlorenss/add_missing_assert_include

Explicit include of assert.h.

7 years agoExplicit include of assert.h.
lateralusX [Mon, 24 Oct 2016 13:39:55 +0000 (15:39 +0200)]
Explicit include of assert.h.

7 years ago[configure.ac] Only disable -Wno-zero-length-array on clang
Alexander Köplinger [Mon, 24 Oct 2016 13:17:54 +0000 (15:17 +0200)]
[configure.ac] Only disable -Wno-zero-length-array on clang

The $GCC variable in autoconf will be yes for clang as well [1].

[1] https://lists.gnu.org/archive/html/autoconf/2014-09/msg00023.html

7 years agoMerge pull request #3442 from lateralusX/jlorenss/win-atexit-commands
Johan Lorensson [Mon, 24 Oct 2016 09:53:15 +0000 (11:53 +0200)]
Merge pull request #3442 from lateralusX/jlorenss/win-atexit-commands

Add support on Windows to install atexit handler(s) early in bootprocess.

7 years agoMerge pull request #3808 from monojenkins/update-csprojs
Alexander Köplinger [Sat, 22 Oct 2016 12:23:00 +0000 (14:23 +0200)]
Merge pull request #3808 from monojenkins/update-csprojs

[msvc] Update csproj files

7 years ago[mono] Add some strong types for a few variables, document some methods (#3777)
Miguel de Icaza [Sat, 22 Oct 2016 04:36:34 +0000 (23:36 -0500)]
[mono] Add some strong types for a few variables, document some methods (#3777)

7 years ago[msvc] Update csproj files
monojenkins [Sat, 22 Oct 2016 04:28:22 +0000 (04:28 +0000)]
[msvc] Update csproj files

7 years ago[btls] Convert BTLS icalls to pinvokes by invoking them using [DllImp… (#3799)
Zoltan Varga [Fri, 21 Oct 2016 21:29:13 +0000 (17:29 -0400)]
[btls] Convert BTLS icalls to pinvokes by invoking them using [DllImp… (#3799)

* [btls] Convert BTLS icalls to pinvokes by invoking them using [DllImport("__Internal")], which will make it easier to redirect them to a separate dylib in the future.

* [btls] Add a --enable-dynamic-btls configure flag to enable compiling btls into a separate shared library instead of embedding it into the runtime.

7 years agoThere's a G_BREAKPOINT in mini-exceptions.c which could be hit during user execution...
Andi McClure [Fri, 21 Oct 2016 21:28:59 +0000 (17:28 -0400)]
There's a G_BREAKPOINT in mini-exceptions.c which could be hit during user execution. This will not be caught by our normal crash reporter, so we should use g_error here instead. (#3791)

7 years ago[runtime] Fix the native-to-managed marshalling of null blittable arrays. Fixes ...
Zoltan Varga [Fri, 21 Oct 2016 20:48:07 +0000 (16:48 -0400)]
[runtime] Fix the native-to-managed marshalling of null blittable arrays. Fixes #45788.

7 years ago[bcl] Move a few types from the Facades into the framework for netstandard20 compatib...
Alexander Köplinger [Fri, 21 Oct 2016 13:38:20 +0000 (15:38 +0200)]
[bcl] Move a few types from the Facades into the framework for netstandard20 compatibility

See https://github.com/dotnet/standard/pull/76.

Also moved IncrementalHash from System.Core.dll to mscorlib.dll as per discussion with Wes.

7 years ago[tests] Disable reference-loader.exe test for now
Alexander Köplinger [Fri, 21 Oct 2016 11:24:27 +0000 (13:24 +0200)]
[tests] Disable reference-loader.exe test for now

The code it's supposed to test was temporarily disabled in 1bf9409629c144dc5400a800e8ab20ed516d5ced

7 years agoChanges in class libraries to enable Windows Runtime event support using Mono's mscor...
TautvydasZilys [Fri, 21 Oct 2016 11:04:49 +0000 (14:04 +0300)]
Changes in class libraries to enable Windows Runtime event support using Mono's mscorlib (#3778)

* Use Windows Runtime event related classes from Reference Source and implement couple missing methods needed for Windows Runtime event suppor

* Add native stubs for newly added icalls.

* Attempt to fix build on non-windows

* Attempt to fix mscorlib build when COM is disabled.

* Revert "Attempt to fix mscorlib build when COM is disabled."

This reverts commit 5befc13b5ee7283fc4f19bd706389496c139790f.

* System.Type::IsWindowsRuntimeObjectProperty is under "FEATURE_COMINTEROP || MONO_COM", so its callers should be under it too.

* Fix build failure due to a semantic merge conflict with b313769878e1d96c2b50fb1c96be229282d74a30

7 years agoFix crash in SafePipeHandle.ReleaseHandle() on Windows (#3797)
Niklas Therning [Fri, 21 Oct 2016 01:52:38 +0000 (03:52 +0200)]
Fix crash in SafePipeHandle.ReleaseHandle() on Windows (#3797)

The ReleaseHandle() methods tries to deallocate the handle as if it was a
pointer to heap memory. But on Windows it's a HANDLE. The call to
Marshal.FreeHGlobal() causes a crash on Windows. It doesn't crash on other
platforms probably due to the emulated handles which are indeed heap allocated
memory objects. But the underlying file descriptor is never closed so there
should be a file descriptor leak on other platforms.

This patch fixes the issue by calling MonoIO.Close() on the handle rather than
Marshal.FreeHGlobal()

7 years ago[loader] Disable mono_assembly_has_reference_assembly_attribute
Aleksey Kliger [Thu, 20 Oct 2016 17:51:55 +0000 (13:51 -0400)]
[loader] Disable mono_assembly_has_reference_assembly_attribute

It relies on mono_custom_attrs_from_assembly_checked which is not
sufficiently robust to missing assemblies when trying to look for custom
attributes.

7 years ago[System]: Distinguish between empty hostnames and no hostnames for certificate valida...
Martin Baulig [Thu, 20 Oct 2016 00:44:32 +0000 (02:44 +0200)]
[System]: Distinguish between empty hostnames and no hostnames for certificate validation.

SecPolicyCreateSSL() distinguishes between an empty string (validation will fail
if the certificate contains host name constraints) and a null pointer (no host name
checking will be performed) for the hostname.

We incorrectly used `string.IsNullOrEmpty (host)` in a few places.

7 years ago[System]: ChainValidationHelper: always set 'status11' on error.
Martin Baulig [Thu, 20 Oct 2016 00:35:11 +0000 (02:35 +0200)]
[System]: ChainValidationHelper: always set 'status11' on error.

7 years ago[boringssl]: Merge latest chromium-stable branch from Google.
Martin Baulig [Thu, 20 Oct 2016 16:48:04 +0000 (18:48 +0200)]
[boringssl]: Merge latest chromium-stable branch from Google.

7 years agoMerge pull request #3786 from lambdageek/dev-42584-take2
Aleksey Kliger (λgeek) [Thu, 20 Oct 2016 15:33:15 +0000 (11:33 -0400)]
Merge pull request #3786 from lambdageek/dev-42584-take2

Check for ReferenceAssemblyAttribute when loading for execution

7 years agoUtf8 (#3776)
Miguel de Icaza [Thu, 20 Oct 2016 13:19:09 +0000 (08:19 -0500)]
Utf8 (#3776)

* UTF8 Marshaling APIs  (#3736)

Adds support for the new UTF8 marshaling functionality in .NET, there
is support for the new MarshalAs(UnmanagedType.LPUTF8St) as well as a
handful of convenience methods in Marshal.cs

In Mono, this is mostly a pass-through as we have historically only
done UTF8, so this merely adds the constant processing to the runtime.

This fixes a few bugs that the new test suite exhibited: when we
marshaled UTF8 strings, we assumed Chars() == Bytes() and we would end
up chopping when marshaling out, and marshaling in.

There is also an additional behavioral bug that was fixed in
Marshal.cs, unlike the rest of the runtime that treated Ansi as Utf8,
StringToCoTaskMemAnsi behaved as ascii. This brings the API in line
with the rest of the runtime.

The equivalent CoreCLR changes were:

dotnet/coreclr#4793
dotnet/coreclr#6561

This has also surfaced two limitations in Mono's marshaling code,
which is why two sets of tests are disabled: StringBuilder return
types are not handled specially (char * needs to be turned into a new
StringBuilder when present) and StringBuilders with an Out attribute
should update the StringBuilder in place, not make a new copy of it.

7 years agoAdd support on Windows to install atexit handler(s) early in application’s startup.
lateralusX [Thu, 20 Oct 2016 10:48:09 +0000 (12:48 +0200)]
Add support on Windows to install atexit handler(s) early in application’s startup.
This is done by adding a new argument to install specific named custom handlers,
--handlers=. There is also an argument to describe the supported handlers on current
platform, --help-handlers.

The supported handlers can be different depending on implementing platform and currently
only Windows uses this feature to install an atexit handler waiting for a keypress
before exiting process. This is however a generic concept that could be used to run handler
code early in the boot process on any platform for other purposes. Adding the argument first
in command line makes it possible to do the installation very early in the boot process, this
is used by the waitkeypress atexit handler in order to be used in cases where the arguments
itself are unsupported or incorrect formatted causing an exit of the process.

When running under Visual Studio debugger the console window will not be kept
open when the debugee process terminates. Normally this is not a problem, but there are scenarios,
especially when having errors in configuration, when you would like the console to be kept open so
you can read the output in order to detect the error.

Normally there is an option to start the console application from within Visual Studio but
not attaching the debugger (CTRL+F5) and by default Visual Studio will then inject a pause
in the execution of the process holding up the console, but for some reasons, having more
complex solutions like mono, this feature stops working, so it is not possible to keep the console
open in that scenario for more complex solutions.

This makes it a little problematic to hold the process when working within the debugger in order
to look for console output and errors. Since mono can exit the process using exit command and not
only by returning from main, the developer needs to set breakpoints on both end of main and in c-runtime
exit methods. Even if that is a possible workaround this option won't work when running the process outside
the debugger (CTRL+F5).

This commit adds a handler argument that can be used on Windows (potential on other platforms as well), atexit-waitkeypress.
The waitkeypress will hold the console and process open until a key is pressed and is very
useful when running and debugging mono from within Visual Studio. Example of output when running mono’s mono-mini-regression-test
with an assembly not found together with –handlers=atexit-waitkeypress command line argument:

failed to load assembly: gshared-nofound.exe
Overall results: tests: 0, 100% pass, opt combinations: 25
Press any key to continue . . .

Currently this is only implemented for Windows, but could be enabled for other platforms,
if similar need exist elsewhere.

Since this is a standard mono command line option it is possible to inject it using the MONO_ENV_OPTIONS environment variable as well.

7 years ago[runtime] Fix the calculation of the instance size of ptr/var types. (#3790)
Zoltan Varga [Wed, 19 Oct 2016 23:29:55 +0000 (19:29 -0400)]
[runtime] Fix the calculation of the instance size of ptr/var types. (#3790)

7 years agoMerge pull request #3787 from AsamK/fix_listview
Alexander Köplinger [Wed, 19 Oct 2016 13:30:39 +0000 (15:30 +0200)]
Merge pull request #3787 from AsamK/fix_listview

[MWF] Fix two issues in ListView

7 years ago[hybrid-aot] Fix GSharedVT support (#3783)
Ludovic Henry [Wed, 19 Oct 2016 13:14:59 +0000 (09:14 -0400)]
[hybrid-aot] Fix GSharedVT support (#3783)

* [aot-compiler] Cleanup GSharedVT check

* [aot-compiler] Enable partial sharing for hybrid AOT

* [aot] Enable GSharedVT for Android

* [aot] Ensure GSharedVT is supported at runtime as well as compile time

* [aot] Factor aot mode setting

7 years agoMerge pull request #3789 from monojenkins/update-csprojs
Alexander Köplinger [Wed, 19 Oct 2016 11:05:55 +0000 (13:05 +0200)]
Merge pull request #3789 from monojenkins/update-csprojs

[msvc] Update csproj files

7 years ago[msvc] Update csproj files
monojenkins [Wed, 19 Oct 2016 10:17:15 +0000 (10:17 +0000)]
[msvc] Update csproj files

7 years agoAdd unit tests for ListView bugs
Sebastian [Tue, 18 Oct 2016 22:05:23 +0000 (00:05 +0200)]
Add unit tests for ListView bugs

7 years ago[tools] Fix casing of sqlsharp
Alexander Köplinger [Tue, 18 Oct 2016 18:53:28 +0000 (20:53 +0200)]
[tools] Fix casing of sqlsharp

The directory is lowercase on disk.

7 years ago[runtime] Check for ReferenceAssemblyAttribute when loading for execution.
Aleksey Kliger [Tue, 18 Oct 2016 18:45:42 +0000 (14:45 -0400)]
[runtime] Check for ReferenceAssemblyAttribute when loading for execution.

An assembly with a System.Runtime.CompilerServices.ReferenceAssemblyAttribute
may be loaded in a reflection-only context, but not for execution.

When loading assembly refs, or when loading assemblies by name (as
opposed to file path), a reference assembly will be skipped over and
other assemblies from the GAC and the load path will be tried.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42584

7 years ago[loader] Tests for RefereceAssemblyAttribute support
Aleksey Kliger [Wed, 12 Oct 2016 19:21:09 +0000 (15:21 -0400)]
[loader] Tests for RefereceAssemblyAttribute support

This reverts commit 8612b548ee110336fe84d74b099359c8a2864459.

Which itself reverted commit 31de4df835d27ec750fc81739bdd84a87a2efaa7.

7 years ago[runtime] Let mono_custom_attrs_has_attr ignore malformed attributes
Aleksey Kliger [Wed, 12 Oct 2016 18:43:07 +0000 (14:43 -0400)]
[runtime] Let mono_custom_attrs_has_attr ignore malformed attributes

7 years ago[runtime] Don't build temporary array in mono_custom_attrs_get_attr_checked
Aleksey Kliger [Wed, 12 Oct 2016 16:02:08 +0000 (12:02 -0400)]
[runtime] Don't build temporary array in mono_custom_attrs_get_attr_checked

Just return the first matching attribute as soon as it's found, don't
build a temporary array and then index into it.

7 years ago[runtime] Mark mono_custom_attrs_get_attr external only
Aleksey Kliger [Wed, 12 Oct 2016 16:01:28 +0000 (12:01 -0400)]
[runtime] Mark mono_custom_attrs_get_attr external only

Runtime should use mono_custom_attrs_get_attr_checked.

7 years ago[runtime] Add assembly name to message in FileNotFoundException
Aleksey Kliger [Wed, 12 Oct 2016 15:49:05 +0000 (11:49 -0400)]
[runtime] Add assembly name to message in FileNotFoundException

when using mono_error_set_assembly_load_simple ()

7 years agoFix ArgumentOutOfRangeException exception when removing a not focused item
Sebastian [Tue, 18 Oct 2016 18:19:45 +0000 (20:19 +0200)]
Fix ArgumentOutOfRangeException exception when removing a not focused item

The code in RemoveAt doesn't update the focused item index, if the focused
item is the last item in the list and another item is removed.
The next time an item is removed, the focused item index is equal to Count
and an ArgumentOutOfRangeException is thrown.

7 years agoFix IndexOutOfBounds exception, when removing and adding an item to another list
Sebastian [Tue, 18 Oct 2016 18:14:50 +0000 (20:14 +0200)]
Fix IndexOutOfBounds exception, when removing and adding an item to another list

Removing a selected item from one ListView and adding the same item to
another ListView, an IndexOutOfBounds exception was thrown, if the second
ListView has fewer elements than the first one. That's because the
DisplayIndex still contained the index from the first ListView.

7 years agoBump boringssl submodule
Alexander Köplinger [Tue, 18 Oct 2016 17:32:52 +0000 (19:32 +0200)]
Bump boringssl submodule

7 years agoFixes System build
Marek Safar [Tue, 18 Oct 2016 15:20:30 +0000 (17:20 +0200)]
Fixes System build

7 years ago[System] Implements Socket::ConnectAsync. Fixes #44406
Marek Safar [Tue, 18 Oct 2016 15:12:54 +0000 (17:12 +0200)]
[System] Implements Socket::ConnectAsync. Fixes #44406

7 years ago[mcs] Add new test
Marek Safar [Tue, 18 Oct 2016 13:11:08 +0000 (15:11 +0200)]
[mcs] Add new test

7 years ago[ci] Add option to not run tests via CI_TAGS
Alexander Köplinger [Tue, 18 Oct 2016 14:00:49 +0000 (16:00 +0200)]
[ci] Add option to not run tests via CI_TAGS

7 years agoMerge pull request #3780 from akoeplinger/mcs-error-constant-invariant
Marek Safar [Tue, 18 Oct 2016 12:58:46 +0000 (14:58 +0200)]
Merge pull request #3780 from akoeplinger/mcs-error-constant-invariant

[mcs] Use InvariantCulture for GetValueAsLiteral() in constant.cs

7 years agoBump cecil to get recent fixes
Marek Safar [Tue, 18 Oct 2016 12:09:43 +0000 (14:09 +0200)]
Bump cecil to get recent fixes

7 years agoMerge pull request #3781 from grendello/networkinfo
Marek Safar [Mon, 17 Oct 2016 21:30:34 +0000 (23:30 +0200)]
Merge pull request #3781 from grendello/networkinfo

With Android 7.0 (Nougat) it is no longer possible to read some

7 years ago[runtime] Fix a regression introduced by 1be62d5e2a325d45159485629a9ef6158aac0984...
Zoltan Varga [Mon, 17 Oct 2016 21:19:44 +0000 (17:19 -0400)]
[runtime] Fix a regression introduced by 1be62d5e2a325d45159485629a9ef6158aac0984 (field loading rewrite). Static field offsets were overwritten with 0 if the mono_class_setup_fields () function was called in parallel.

7 years agoWith Android 7.0 (Nougat) it is no longer possible to read some
Marek Habersack [Mon, 17 Oct 2016 17:40:21 +0000 (19:40 +0200)]
With Android 7.0 (Nougat) it is no longer possible to read some

information about network interfaces from the /sys filesystem. Google
placed restrictions on two files used by the Mono BCL to read
information about the interface:

      /sys/class/net/[DEVICE]/flags
      /sys/class/net/[DEVICE]/operstate

The information we used to read from `flags` let us determine whether
the interface supports multicast and the `operstate` file provided us
with detailed information on the current device state.

Additionally, it is now impossible to read the hardware MAC address used
by any interface. This bit of information is also unavailable when using
the Java APIs and therefore applications running on devices with API
24 (and possibly newer) will not be able to access this information.

More details about the issue are available from the upstream Android
bug:

      https://code.google.com/p/android/issues/detail?id=205565

In order to obtain the required information, we now need to use the Java
APIs on devices with API 24+ and this commit implements the backend to
retrieve this information. It is done in C in order to avoid overhead of
creating mirror .NET objects when calling Java, thus saving time and
memory during an operation which may be performed by some applications
quite frequently.

This patch implements code that calls into the Xamarin.Android
runtime when runnin under API24 or newer to obtain the information.

Part of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=44296

7 years ago[mcs] Use InvariantCulture for GetValueAsLiteral() in constant.cs
Alexander Köplinger [Tue, 10 Nov 2015 14:01:43 +0000 (15:01 +0100)]
[mcs] Use InvariantCulture for GetValueAsLiteral() in constant.cs

Without it mcs would've printed the following error for code like `const int val = 1.42f`
on a system where the decimal separator is not the dot, e.g. German:

```
test.cs(3,18): error CS0031: Constant value `1,42' cannot be converted to a `int'
```

7 years agoMerge pull request #3779 from akoeplinger/fix-aot-only-reference
Alexander Köplinger [Mon, 17 Oct 2016 15:56:03 +0000 (17:56 +0200)]
Merge pull request #3779 from akoeplinger/fix-aot-only-reference

[mini] Fix mention of --aot-only option, it no longer exists

7 years agoImplement some missing methods in RSACryptoServiceProvider
Lluis Sanchez [Fri, 14 Oct 2016 13:27:31 +0000 (15:27 +0200)]
Implement some missing methods in RSACryptoServiceProvider

(cherry picked from commit d4e09f5c35c9c5944e2c1e60e017d3ecddc52616)

7 years agoImplemented System.Security.Cryptography.X509Certificates.RSACertificateExtensions
Lluis Sanchez [Fri, 14 Oct 2016 07:27:08 +0000 (09:27 +0200)]
Implemented System.Security.Cryptography.X509Certificates.RSACertificateExtensions

(cherry picked from commit 04a376b2ab038fc8ebc786185695893456d541c9)

7 years ago[mini] Fix mention of --aot-only option, it no longer exists
Alexander Köplinger [Mon, 17 Oct 2016 15:15:27 +0000 (17:15 +0200)]
[mini] Fix mention of --aot-only option, it no longer exists

It was replaced with --full-aot in ba99fd833400666f574c571cc1981e846d09a610,
but there were still two places left that talked about the old option which leads to confusion.

Also updated the link to Xamarin docs to the current URL.

7 years ago[build] Regenerate .csproj files
Alexander Köplinger [Mon, 17 Oct 2016 14:34:15 +0000 (16:34 +0200)]
[build] Regenerate .csproj files

Note: DISABLE_CAS_USE was removed in ed989a8e9e5c170b6d19edc60bb80e8a4e6d5cc0

7 years ago[System] More Socket methods from referencesource
Marek Safar [Mon, 17 Oct 2016 13:04:01 +0000 (15:04 +0200)]
[System] More Socket methods from referencesource

7 years ago[WP] [runtime] Rewrite field loading and layout (#3722)
Zoltan Varga [Sun, 16 Oct 2016 04:35:16 +0000 (00:35 -0400)]
[WP] [runtime] Rewrite field loading and layout (#3722)

* [runtime] Improve the locking in mono_class_setup_basic_field_info ().

Compute all the required information outside the lock and install it inside the lock. Remove mono_class_setup_basic_field_info_locking () function which is no longer needed.

* [runtime] Move the special case of no fields from mono_class_setup_fields () to mono_class_layout_fields ().

* [runtime] Move the computation of klass->blittable and klass->element_class/cast_class for enums to mono_class_layout_fields () so it can be used for dynamic types as well.

* [runtime] Make typebuilder_setup_fields () initilize the same data as mono_class_setup_fields ().

* [runtime] Move more common code into mono_class_layout_fields () from mono_class_setup_fields () and typebuilder_setup_fields ().

* [runtime] Avoid infinite recursion in mono_class_setup_fields () by storing the classes under initialization in a TLS list instead of using the racy klass->setup_fields_called flag.

* [runtime] Reduce the amount of locking in mono_class_setup_fields () to the call to mono_class_layout_fields (). Remove mono_class_setup_fields_locking ().

* [runtime] Remove a special case for no fields from mono_class_layout_fields (), the normal code can handle it.

* [runtime] Reorganize mono_class_layout_fields () so it makes all modifications to the MonoClass instance in one place.

* [runtime] Reduce the amounrt of locking in mono_class_layout_fields ().

* [runtime] Remove some compiler context code.

7 years ago[corlib] Don't emit symbol information in ModuleBuilderTest.GetType()
Alexander Köplinger [Sat, 15 Oct 2016 01:13:59 +0000 (03:13 +0200)]
[corlib] Don't emit symbol information in ModuleBuilderTest.GetType()

It doesn't work on Android and the test doesn't need it.

7 years ago[System] Fix expected default value in test for ServicePointManager.ConnectionLimit...
Alexander Köplinger [Fri, 14 Oct 2016 23:09:10 +0000 (01:09 +0200)]
[System] Fix expected default value in test for ServicePointManager.ConnectionLimit on XA

The default was aligned with XI on https://github.com/mono/mono/commit/d06354174070d01394f5e75ffcfc9c1110a1e7db

7 years agoMerge pull request #3775 from alexrp/main-thread-name
Alex Rønne Petersen [Fri, 14 Oct 2016 21:16:15 +0000 (23:16 +0200)]
Merge pull request #3775 from alexrp/main-thread-name

[runtime] Don't change the native name of the main thread.

7 years agoRevert "UTF8, with build fixed"
Miguel de Icaza [Fri, 14 Oct 2016 18:39:22 +0000 (14:39 -0400)]
Revert "UTF8, with build fixed"

This reverts commit 50d119be5d5ba52e0c935ea53907cf2b061a3cd8.

7 years agoRevert "Revert "UTF8 Marshaling APIs (#3736)""
Miguel de Icaza [Fri, 14 Oct 2016 18:36:17 +0000 (14:36 -0400)]
Revert "Revert "UTF8 Marshaling APIs  (#3736)""

This reverts commit 2a01bde545a47e287977637a4a08f8f965ca45dc.t push
:

7 years agoUTF8, with build fixed
Miguel de Icaza [Fri, 14 Oct 2016 18:35:46 +0000 (14:35 -0400)]
UTF8, with build fixed

7 years agoRevert "UTF8 Marshaling APIs (#3736)"
Miguel de Icaza [Fri, 14 Oct 2016 18:26:40 +0000 (14:26 -0400)]
Revert "UTF8 Marshaling APIs  (#3736)"

This reverts commit 4056e80006ee934ec024215cf998baf66aa8d6ae.

7 years agoUTF8 Marshaling APIs (#3736)
Miguel de Icaza [Fri, 14 Oct 2016 18:23:23 +0000 (14:23 -0400)]
UTF8 Marshaling APIs  (#3736)

Adds support for the new UTF8 marshaling functionality in .NET, there is support for the new MarshalAs(UnmanagedType.LPUTF8St) as well as a handful of convenience methods in Marshal.cs

In Mono, this is mostly a pass-through as we have historically only done
UTF8, so this merely adds the constant processing to the runtime.

This fixes a few bugs that the new test suite exhibited: when we marshaled UTF8 strings, we assumed Chars() == Bytes() and we would end up chopping when marshaling out, and marshaling in.

There is also an additional behavioral bug that was fixed in Marshal.cs, unlike the rest of the runtime that treated Ansi as Utf8, StringToCoTaskMemAnsi behaved as ascii. This brings the API in line with the rest of the runtime.

The equivalent CoreCLR changes were:

dotnet/coreclr#4793
dotnet/coreclr#6561

This has also surfaced two limitations in Mono's marshaling code, which is why two sets of tests are disabled: StringBuilder return types are not handled specially (char * needs to be turned into a new StringBuilder when present) and StringBuilders with an Out attribute should update the StringBuilder in place, not make a new copy of it.

7 years ago[runtime] Don't change the native name of the main thread.
Alex Rønne Petersen [Fri, 14 Oct 2016 16:18:57 +0000 (18:18 +0200)]
[runtime] Don't change the native name of the main thread.

This makes it hard to differentiate multiple Mono processes in `top`.

We still report the name of the main thread as "Main" to the profiler.

7 years ago[System.ServiceModel] Hide only relevant exceptions in TcpChannelListener.cs
Marek Safar [Fri, 14 Oct 2016 14:23:44 +0000 (16:23 +0200)]
[System.ServiceModel] Hide only relevant exceptions in TcpChannelListener.cs

7 years ago[System] Use mono specific payload type for EndAccept of TCPListener
Marek Safar [Fri, 14 Oct 2016 14:21:23 +0000 (16:21 +0200)]
[System] Use mono specific payload type for EndAccept of TCPListener

7 years agoMerge pull request #3763 from akoeplinger/move-type
Alexander Köplinger [Fri, 14 Oct 2016 14:17:39 +0000 (16:17 +0200)]
Merge pull request #3763 from akoeplinger/move-type

[System.ServiceModel] Move a few types into System.IdentityModel

7 years agoMerge pull request #3771 from henricm/enable-system-tests-on-windows
Niklas Therning [Fri, 14 Oct 2016 12:29:31 +0000 (14:29 +0200)]
Merge pull request #3771 from henricm/enable-system-tests-on-windows

Enable System tests for PR builds on Windows

7 years agoEnable System tests for PR builds on Windows
Henric Müller [Fri, 14 Oct 2016 08:09:25 +0000 (10:09 +0200)]
Enable System tests for PR builds on Windows

7 years ago[System.Xml] Update supported time formats for mobile version of XML deserializer...
Marek Safar [Thu, 13 Oct 2016 21:58:18 +0000 (23:58 +0200)]
[System.Xml] Update supported time formats for mobile version of XML deserializer. Fixes #42843

7 years ago[System.Xml] Enable more tests
Marek Safar [Thu, 13 Oct 2016 21:53:32 +0000 (23:53 +0200)]
[System.Xml] Enable more tests

7 years agoMerge pull request #3756 from henricm/named-pipe-alertable-on-windows
Henric Müller [Fri, 14 Oct 2016 06:48:39 +0000 (08:48 +0200)]
Merge pull request #3756 from henricm/named-pipe-alertable-on-windows

Making named pipe connects alertable on Windows

7 years agoMerge pull request #3766 from BrzVlad/feature-default-conc
Vlad Brezae [Thu, 13 Oct 2016 22:35:49 +0000 (01:35 +0300)]
Merge pull request #3766 from BrzVlad/feature-default-conc

[sgen] Switch to default concurrent on desktop

7 years agoMerge pull request #3761 from kumpera/fix-maccore-linking-regression
Rodrigo Kumpera [Thu, 13 Oct 2016 18:24:48 +0000 (14:24 -0400)]
Merge pull request #3761 from kumpera/fix-maccore-linking-regression

[icalls] Change get_bundled_machine_config to ICALL_EXPORT so maccore can link it.

7 years agoMerge pull request #3716 from vargaz/unbox-stobj-null
Rodrigo Kumpera [Thu, 13 Oct 2016 18:00:58 +0000 (14:00 -0400)]
Merge pull request #3716 from vargaz/unbox-stobj-null

[jit] Add a small optimization for unbox.any+stobj called with a null…

7 years ago[System] SocketAsyncEventArgs::Dispose does not free any managed resources. Fixes...
Marek Safar [Thu, 13 Oct 2016 14:43:38 +0000 (16:43 +0200)]
[System] SocketAsyncEventArgs::Dispose does not free any managed resources. Fixes #44757

7 years agoMerge pull request #3591 from directhex/mono_libdir_fallback
Bernhard Urban [Thu, 13 Oct 2016 14:39:38 +0000 (16:39 +0200)]
Merge pull request #3591 from directhex/mono_libdir_fallback

Handle relocatable libMonoPosixHelper.so when --libdir= isn't lib/

7 years ago[System]: Move MonoBtlsProvider.IsSupported() -> MonoTlsProviderFactory.IsBtlsSupport...
Martin Baulig [Thu, 13 Oct 2016 14:26:40 +0000 (16:26 +0200)]
[System]: Move MonoBtlsProvider.IsSupported() -> MonoTlsProviderFactory.IsBtlsSupported() (#3760)

* [System]: Move MonoBtlsProvider.IsSupported() -> MonoTlsProviderFactory.IsBtlsSupported().

Move the intern-call which is used to determine whether we're using BTLS out of MonoBtlsProvider
to allow the managed linker to eliminate the Mono.Btls.* classes when it's not supported.

* Fix Android build.

(cherry picked from commit 90699022b6fed7fd273ba3379a2e3696bbd8956f)