mono.git
7 years ago[acceptance-tests] Improve the profiler-stress test runner.
Alex Rønne Petersen [Sat, 10 Sep 2016 10:38:01 +0000 (12:38 +0200)]
[acceptance-tests] Improve the profiler-stress test runner.

* Emit an NUnit test report file.
* Set a timeout of 6 hours per test.
* Do a thread dump for timed-out tests.
* Don't print stdout/stderr for passing tests.

7 years ago[ci] Bump the timeout of the profiler stress test suite to 24 hours.
Alex Rønne Petersen [Sat, 10 Sep 2016 10:22:58 +0000 (12:22 +0200)]
[ci] Bump the timeout of the profiler stress test suite to 24 hours.

7 years ago[sgen] Remove bogus mono_profiler_events assert.
Alex Rønne Petersen [Fri, 9 Sep 2016 16:00:36 +0000 (18:00 +0200)]
[sgen] Remove bogus mono_profiler_events assert.

This variable can be changed at any time by any thread. It makes no sense to
assert that it has a particular flag.

7 years ago[utils] Move MONO_DEPRECATED to mono-publib.h and make it imply MONO_API + MONO_RT_EX...
Alex Rønne Petersen [Fri, 9 Sep 2016 10:26:04 +0000 (12:26 +0200)]
[utils] Move MONO_DEPRECATED to mono-publib.h and make it imply MONO_API + MONO_RT_EXTERNAL_ONLY.

Also make it work with MSVC.

7 years ago[profiler] Remove the long-obsolete hsmode option.
Alex Rønne Petersen [Fri, 9 Sep 2016 10:12:27 +0000 (12:12 +0200)]
[profiler] Remove the long-obsolete hsmode option.

Also refactor the heap walk code a bit.

7 years ago[profiler] Document and fix the onlycoverage option.
Alex Rønne Petersen [Fri, 9 Sep 2016 09:46:15 +0000 (11:46 +0200)]
[profiler] Document and fix the onlycoverage option.

7 years ago[profiler] Remove the countersonly option.
Alex Rønne Petersen [Fri, 9 Sep 2016 09:33:31 +0000 (11:33 +0200)]
[profiler] Remove the countersonly option.

It was never documented and is no longer functional.

7 years ago[man] Update mprof-report.1 to indicate the correct default maxframes value.
Alex Rønne Petersen [Fri, 9 Sep 2016 09:21:20 +0000 (11:21 +0200)]
[man] Update mprof-report.1 to indicate the correct default maxframes value.

7 years ago[profiler] Use the signal shutdown logic for the sampling thread for more cases.
Alex Rønne Petersen [Fri, 9 Sep 2016 09:11:21 +0000 (11:11 +0200)]
[profiler] Use the signal shutdown logic for the sampling thread for more cases.

7 years ago[profiler] Remove some indirection in setting up GC events.
Alex Rønne Petersen [Fri, 9 Sep 2016 08:23:41 +0000 (10:23 +0200)]
[profiler] Remove some indirection in setting up GC events.

* mono_gc_enable_events: This did nothing for SGen and we called it
  unconditionally for Boehm. So no point in having it around.
* mono_gc_enable_alloc_events: The performance difference between checking
  a static alloc_events variable versus checking mono_profiler_events is
  marginal at best and doesn't justify the indirection, especially now that
  we support managed allocators while profiling.

7 years ago[profiler] Lift profiler limitation in mono_class_get_allocation_ftn ().
Alex Rønne Petersen [Fri, 9 Sep 2016 08:16:26 +0000 (10:16 +0200)]
[profiler] Lift profiler limitation in mono_class_get_allocation_ftn ().

This has not actually been necessary since allocation reporting was moved into
the GC implementations.

7 years ago[profiler] Don't leak counter data structures on shutdown.
Alex Rønne Petersen [Fri, 9 Sep 2016 05:21:17 +0000 (07:21 +0200)]
[profiler] Don't leak counter data structures on shutdown.

7 years ago[profiler] Simplify counters initialization.
Alex Rønne Petersen [Fri, 9 Sep 2016 05:07:55 +0000 (07:07 +0200)]
[profiler] Simplify counters initialization.

7 years ago[profiler] Don't emit a perf counters sample event if none are registered.
Alex Rønne Petersen [Fri, 9 Sep 2016 05:04:13 +0000 (07:04 +0200)]
[profiler] Don't emit a perf counters sample event if none are registered.

7 years ago[profiler] Fix the code that synthesizes thread end events.
Alex Rønne Petersen [Fri, 9 Sep 2016 05:03:29 +0000 (07:03 +0200)]
[profiler] Fix the code that synthesizes thread end events.

It could previously fail to process a newly allocated buffer.

7 years ago[profiler] Add counters for all event types.
Alex Rønne Petersen [Fri, 9 Sep 2016 05:02:21 +0000 (07:02 +0200)]
[profiler] Add counters for all event types.

7 years ago[metadata] Fix FullAOT build
Alexander Köplinger [Sun, 2 Oct 2016 15:24:22 +0000 (17:24 +0200)]
[metadata] Fix FullAOT build

The function was renamed in https://github.com/mono/mono/commit/a0ad8154f7cdca706802aa196d95686e0f8d3b7b#diff-9a532ce56888ac899468740a872fd7e0L1814, but this stub was missed.

7 years ago[btls] Fix bashism in create-object-library.sh
Alexander Köplinger [Sun, 2 Oct 2016 15:12:45 +0000 (17:12 +0200)]
[btls] Fix bashism in create-object-library.sh

Found by checkbashisms(1) as "unsafe echo with backslash". Some shells don't expand embedded \n in a string by default,
which broke the build on systems like ArchLinux or Alpine where /bin/sh points to those shells because the generated .lo
file contained just a single line instead of two.

Thanks to @JustArchi for researching this on the Mono Gitter channel, it made fixing the issue a lot easier!

7 years ago[System]: ChainValidationHelper: ignore port number when validating a certificate...
Martin Baulig [Sat, 1 Oct 2016 19:29:32 +0000 (21:29 +0200)]
[System]: ChainValidationHelper: ignore port number when validating a certificate's host name.

(cherry picked from commit 4d28eb4b889d4f317675998f906cd9ca47440566)
(cherry picked from commit 7c88bf755ec19ecd7e6db578de329567ee41b8d0)

7 years ago[BTLS]: Ignore port number when validating certificates.
Martin Baulig [Sat, 1 Oct 2016 19:19:39 +0000 (21:19 +0200)]
[BTLS]: Ignore port number when validating certificates.

(cherry picked from commit baebc1d8c0e5ebe0e98f737390546b834baf2932)

7 years ago[BTLS]: Send server name extension on the client.
Martin Baulig [Sat, 1 Oct 2016 19:19:22 +0000 (21:19 +0200)]
[BTLS]: Send server name extension on the client.

(cherry picked from commit 2602c52de4773fe028b36d13d14555036835aa4e)

7 years agoFix build break from 81fb20737f810def6dde88d87a1b2f23cdb736c3
Alexander Köplinger [Sat, 1 Oct 2016 00:42:24 +0000 (02:42 +0200)]
Fix build break from 81fb20737f810def6dde88d87a1b2f23cdb736c3

The HttpWebResponse stub that is used e.g. on the monotouch_watch profile was missing an overload that this commit was using.

7 years ago[corlib] Fix a warning
Alexander Köplinger [Sat, 1 Oct 2016 00:23:52 +0000 (02:23 +0200)]
[corlib] Fix a warning

7 years agoFix build break from efd53c8e2f1823568309a2920091b724be0feff8
Alexander Köplinger [Sat, 1 Oct 2016 00:23:32 +0000 (02:23 +0200)]
Fix build break from efd53c8e2f1823568309a2920091b724be0feff8

The new/renamed TypeBuilderInstantiation wasn't available with FULL_AOT_RUNTIME,
breaking the monotouch profile build.

7 years ago[System] Fill more WebException details when CONNECT fails. Fixes #19594
Marek Safar [Fri, 30 Sep 2016 22:10:03 +0000 (00:10 +0200)]
[System] Fill more WebException details when CONNECT fails. Fixes #19594

7 years agoBump corlib version for efd53c8e2f1823568309a2920091b724be0feff8.
Zoltan Varga [Fri, 30 Sep 2016 21:27:39 +0000 (17:27 -0400)]
Bump corlib version for efd53c8e2f1823568309a2920091b724be0feff8.

7 years ago[scripts]: Add 'btls-cert-sync' script.
Martin Baulig [Fri, 30 Sep 2016 20:48:01 +0000 (22:48 +0200)]
[scripts]: Add 'btls-cert-sync' script.

(cherry picked from commit 30fabaedd3c8e7f6cc7b512ce731396bb82e98eb)

7 years ago[System]: Fix MonoTlsProviderFactory.TryDynamicLoad() logic.
Martin Baulig [Fri, 30 Sep 2016 20:45:30 +0000 (22:45 +0200)]
[System]: Fix MonoTlsProviderFactory.TryDynamicLoad() logic.

If the MONO_TLS_PROVIDER environment variable is missing, use "default".

(cherry picked from commit 7002264dd26784f8df2a5a4f39db768da892b9d1)

7 years ago[SRE] Rename MonoGenericClass to TypeBuilderInstantiation to match MS. (#3679)
Zoltan Varga [Fri, 30 Sep 2016 17:45:30 +0000 (13:45 -0400)]
[SRE] Rename MonoGenericClass to TypeBuilderInstantiation to match MS. (#3679)

7 years ago[runtime] Fix a warning.
Zoltan Varga [Fri, 30 Sep 2016 17:35:11 +0000 (13:35 -0400)]
[runtime] Fix a warning.

7 years ago[System]: Make BTLS the default TLS Provider on Desktop.
Martin Baulig [Fri, 30 Sep 2016 15:36:50 +0000 (17:36 +0200)]
[System]: Make BTLS the default TLS Provider on Desktop.

7 years ago[cert-sync]: Make the new store the default and add '--legacy' for the old one.
Martin Baulig [Fri, 30 Sep 2016 15:28:52 +0000 (17:28 +0200)]
[cert-sync]: Make the new store the default and add '--legacy' for the old one.

7 years ago[BTLS]: Remove some debugging methods.
Martin Baulig [Fri, 30 Sep 2016 15:02:01 +0000 (17:02 +0200)]
[BTLS]: Remove some debugging methods.

7 years agoMerge pull request #3681 from rolfbjarne/fix-monotouch-build
Alexander Köplinger [Fri, 30 Sep 2016 15:02:57 +0000 (17:02 +0200)]
Merge pull request #3681 from rolfbjarne/fix-monotouch-build

[System] Fix monotouch* build.

7 years ago[System] Fix monotouch* build.
Rolf Bjarne Kvinge [Fri, 30 Sep 2016 14:23:23 +0000 (16:23 +0200)]
[System] Fix monotouch* build.

7 years ago[System]: Enable AndroidPlatform.CertStoreLookup().
Martin Baulig [Fri, 30 Sep 2016 14:24:38 +0000 (16:24 +0200)]
[System]: Enable AndroidPlatform.CertStoreLookup().

Uses reflection to call into AndroidEnvironment.CertStoreLookup()
(which as been added in https://github.com/xamarin/xamarin-android/pull/246).

7 years agoBump boringssl to fix the build
Alexander Köplinger [Fri, 30 Sep 2016 14:13:02 +0000 (16:13 +0200)]
Bump boringssl to fix the build

7 years ago[btls] Only use cmake policies CMP0026/CMP0042 if cmake supports it
Alexander Köplinger [Fri, 30 Sep 2016 13:56:53 +0000 (15:56 +0200)]
[btls] Only use cmake policies CMP0026/CMP0042 if cmake supports it

Some older cmake versions don't.

7 years ago[System]: AndroidPlatform.CertStoreLookup(): add to the build, but return null.
Martin Baulig [Fri, 30 Sep 2016 13:16:42 +0000 (15:16 +0200)]
[System]: AndroidPlatform.CertStoreLookup(): add to the build, but return null.

This needs to have support added to xamarin-android before we can enable it.

(cherry picked from commit 9e46b5744b93bcc0bc36ab9d957a5510aaeabf1f)

7 years agoMerge pull request #3676 from chamons/SignalHandlerAPI_XM45
Alexander Köplinger [Fri, 30 Sep 2016 12:56:38 +0000 (14:56 +0200)]
Merge pull request #3676 from chamons/SignalHandlerAPI_XM45

Add Mono.Runtime to XM 4.5 profile

7 years ago[BTLS]: Add managed BTLS sources.
Martin Baulig [Fri, 30 Sep 2016 11:47:22 +0000 (13:47 +0200)]
[BTLS]: Add managed BTLS sources.

* external/boringssl: unmanaged code from Google (added earlier).

* mono/btls: unmanaged BTLS lives here (added earlier).

* System/Mono.Btls: managed BTLS lives here.

* Mono.Btls.Interface: The purpose of this assembly is to allow test suites
  such as xamarin/web-tests to test parts of the BTLS APIs without making
  System.dll's internals visible.  It is not a stable and maintained API.

7 years ago[Mono.Security]: Add the new certificate store.
Martin Baulig [Fri, 30 Sep 2016 11:08:26 +0000 (13:08 +0200)]
[Mono.Security]: Add the new certificate store.

BTLS uses a different format and naming scheme for the local certificate store.

Before using BTLS for the first time on desktop, you need to convert the local
certificate store by either using the new `btls-cert-sync` tool (which will convert
your existing certificate store to the new new format) or `cert-sync` with the
`--btls` argument.

The new format and naming scheme is identically to what you'll find in
'/system/etc/security/cacerts/' on an Android device.  It stores the certificates
in PEM format (with a human-readable text section added) using filenames which
are based on the certificate's subject name hash.

Previously, Mono stored the certificates in binary DER format, using a filename
based on either the Subject-Key-Identifier (if available) or the thumbprint.

We cannot access this from BTLS because computing these filenames requires
reading the entire X509 certificate (including the X509v3 extensions), but
their native lookup code only gives us the SubjectName.

This transitioning won't affect Android users as we're using the system
certificate store (including the user certificate store, via a Java callback).

* Mono.Security.X509.X509Store and X509Stores:
  Support both the old and the new format.  Using the new format requires BTLS.

* Mono.Security.X509.X509StoreManager:
  Add `NewCurrentUserPath` and `NewLocalMachinePath` properties for the
  new path names (~/.config/.mono/new-certs).

* Mono.Security.X509.X509StoreManager:
  Add `NewCurrentUser` and `NewLocalMachine` properties.  Requires BTLS.

* tools/security/cert-sync:
  Add new `--btls` argument to use the new store.

7 years ago[System]: Add AndroidPlatform.CertStoreLookup().
Martin Baulig [Fri, 30 Sep 2016 10:58:15 +0000 (12:58 +0200)]
[System]: Add AndroidPlatform.CertStoreLookup().

This is conditional to HAVE_BTLS and needs to have support added
to xamarin-android first.

7 years ago[System]: New X509Helper2 APIs for BTLS.
Martin Baulig [Fri, 30 Sep 2016 10:55:31 +0000 (12:55 +0200)]
[System]: New X509Helper2 APIs for BTLS.

The managed HAVE_BTLS conditionals will be removed once BTLS itself has landed.

7 years ago[System.Core] Cleanup more warnings
Marek Safar [Fri, 30 Sep 2016 10:08:33 +0000 (12:08 +0200)]
[System.Core] Cleanup more warnings

7 years ago[System.Data] Cleanup warnings
Marek Safar [Fri, 30 Sep 2016 09:04:07 +0000 (11:04 +0200)]
[System.Data] Cleanup warnings

7 years ago[System.Data] Implements SqlClient async readers. Fixes #44843
Marek Safar [Fri, 30 Sep 2016 08:52:00 +0000 (10:52 +0200)]
[System.Data] Implements SqlClient async readers. Fixes #44843

7 years ago[BTLS]: Add the native BTLS sources.
Martin Baulig [Fri, 30 Sep 2016 09:46:46 +0000 (11:46 +0200)]
[BTLS]: Add the native BTLS sources.

7 years agoMerge pull request #3663 from lateralusX/jlorenss/win-api-family-support-libgcmonosgen
Johan Lorensson [Fri, 30 Sep 2016 09:40:53 +0000 (11:40 +0200)]
Merge pull request #3663 from lateralusX/jlorenss/win-api-family-support-libgcmonosgen

Build libgcmonosgen under none desktop Windows API family.

7 years agoBuild libgcmonosgen under none desktop Windows API family.
lateralusX [Fri, 30 Sep 2016 06:48:00 +0000 (08:48 +0200)]
Build libgcmonosgen under none desktop Windows API family.

Initial work to build libgcmonosgen under none desktop Windows API families.
Changes are mainly related to header files included by libgcmonosgen sources and shared
by other libraries.

7 years agoSre cleanup9 (#3661)
Zoltan Varga [Fri, 30 Sep 2016 03:53:22 +0000 (23:53 -0400)]
Sre cleanup9 (#3661)

* [SRE] Assign pseudo tokens to SRE objects in the BCL instead of doing it in the runtime.

Real tokens are assigned after the dynamic types they depend on have been created, by creating the corresponding finished reflection object
(i.e. a MonoMethod for a MethodOnTypeBuilderInst etc.) and obtaining its token.
In Save mode, this is done in ModuleBuilder.Save ().
In Run mode, this is done on-demand when the JIT tries to resolve a token into its corresponding metadata object, by the runtime calling
the RuntimeResolve () method on the builder object.

* [SRE] Remove dead code.

* [SRE] Remove the MonoGenericMethod/MonoGenericCMethod classes, they have not needed.

* [SRE] Delay the creation of MonoClass-es for MonoGenericClass/GenericTypeParameterBuilder/SymbolType until its needed.

* [SRE] Small code cleanup.

* [SRE] Remove the TypeBuilder.IsGenericParameter () icall, it should return false.

* [SRE] Unify the calling of the various RuntimeResolve () methods by adding a RuntimeResolve () method to ModuleBuilder, and calling that from native code.

* [SRE] Remove unused TypeBuilder::get_event_info () icall.

* [SRE] Remove more unused/empty icalls.

7 years ago[Mono.Security]: Cleanup the MonoTlsProvider's certificate validation code. (#3674)
Martin Baulig [Thu, 29 Sep 2016 20:47:28 +0000 (22:47 +0200)]
[Mono.Security]: Cleanup the MonoTlsProvider's certificate validation code. (#3674)

* [Mono.Security]: Remove Mono.Security.Interface.IMonoTlsContext.

This interface is not actually used anywhere anymore, so we can also
just get rid of it.

* [System]: Removed unused private TLS classes.

* [Mono.Security]: Cleanup the MonoTlsProvider's certificate validation code.

Each TLS Provider now has its own certificate validator and there is no
automatic fallback anymore.  We only have three different TLS Providers,
"legacy", "appletls" and "btls" - and legacy is the only one which used
the managed validator.  Both AppleTls and BTLS provider their own validator,
which invokes some native API.

All of the following were internal APIs.

* MonoTlsProvider.HasCustomSystemCertificateValidator has been removed.

* MonoTlsProvider.InvokeSystemCertificateValidator() has been renamed
  into ValidateCertificate() and is now abstract.

(cherry picked from commit 63c0803b2b60ccf50cc16ae93cc70443ccf364f2)

7 years ago[mcs] Branch visited labels cache for conditional block. Fixes #44751
Marek Safar [Thu, 29 Sep 2016 20:34:52 +0000 (22:34 +0200)]
[mcs] Branch visited labels cache for conditional block. Fixes #44751

7 years agoAdd Mono.Runtime to XM 4.5 profile
Chris Hamons [Thu, 29 Sep 2016 19:53:32 +0000 (14:53 -0500)]
Add Mono.Runtime to XM 4.5 profile

- Extends https://github.com/mono/mono/pull/3624

7 years ago[mkbundle] Add diagnostics, fix crash, fix registered path to match runtime name...
Miguel de Icaza [Thu, 29 Sep 2016 19:13:41 +0000 (15:13 -0400)]
[mkbundle] Add diagnostics, fix crash, fix registered path to match runtime name on embedded MonoImages (#3669)

7 years agoMerge pull request #3670 from lambdageek/dev/mempool-loader-error-msg
Aleksey Kliger (λgeek) [Thu, 29 Sep 2016 18:10:52 +0000 (14:10 -0400)]
Merge pull request #3670 from lambdageek/dev/mempool-loader-error-msg

[loader] Store MONO_EXCEPTION_TYPE_LOAD error strings in mempools

7 years agoComparing pid instead of handles in GetModules_internal (#3575)
Henric Müller [Thu, 29 Sep 2016 15:19:43 +0000 (17:19 +0200)]
Comparing pid instead of handles in GetModules_internal (#3575)

Process handles can be different for same process id.
Therefore make sure we compare the process ids instead.

7 years agoMerge pull request #3671 from rolfbjarne/pr-fix-system-tests
Niklas Therning [Thu, 29 Sep 2016 11:25:07 +0000 (13:25 +0200)]
Merge pull request #3671 from rolfbjarne/pr-fix-system-tests

[System] Fix tests that regressed in e6536dd.

7 years agoMerge pull request #3664 from lateralusX/jlorenss/extern-test-driver-usage
Johan Lorensson [Thu, 29 Sep 2016 10:08:31 +0000 (12:08 +0200)]
Merge pull request #3664 from lateralusX/jlorenss/extern-test-driver-usage

Enable reuse of eglib native test framework and test driver source.

7 years ago[System] Fix tests that regressed in e6536dd.
Rolf Bjarne Kvinge [Thu, 29 Sep 2016 10:01:49 +0000 (12:01 +0200)]
[System] Fix tests that regressed in e6536dd.

* I got confused between [TestFixtureSetup] and [Setup], so fix tests whose
  [Setup] methods were changed/removed to properly clean up after each test
  (using a [TearDown] method) so that the next time the on-demand creation of
  objects works as expected (i.e. objects created in the [Setup] method should
  be created on-demand once for each method instead of once for each class).

* Also fix SocketAcceptAsyncTest, the change to properly catch exceptions on
  background threads was incorrect.

7 years ago[threads] Assert that every thread is detached when exiting (#3620)
Ludovic Henry [Thu, 29 Sep 2016 06:49:35 +0000 (08:49 +0200)]
[threads] Assert that every thread is detached when exiting (#3620)

7 years ago[scripts] Add script to package the basic runtime to reuse by mkbundle
Miguel de Icaza [Thu, 29 Sep 2016 02:31:30 +0000 (22:31 -0400)]
[scripts] Add script to package the basic runtime to reuse by mkbundle

7 years ago[System]: Rename MonoLegacyTlsProvider into LegacyTlsProvider. (#3666)
Martin Baulig [Wed, 28 Sep 2016 22:53:03 +0000 (00:53 +0200)]
[System]: Rename MonoLegacyTlsProvider into LegacyTlsProvider. (#3666)

LegacyTlsProvider now lives in the 'Mono.Net.Security' namespace
(previously 'Mono.Net.Security.Private') and derives directly from
the public 'Mono.Security.Interface.MonoTlsProvider'.

This allows it to be used by products, for instance replacing
xamarin-macios/src/Security/Tls/OldTlsProvider.cs.

The idea is to have all 'MonoTlsProvider' implementations inside
System.dll and not access any of the private APIs from outside of it.
(cherry picked from commit 9437553e545f57443ccc33fe4129cbb6ac94f832)

7 years ago[configure] Add configure.ac checks for BTLS. (#3668)
Martin Baulig [Wed, 28 Sep 2016 22:53:33 +0000 (00:53 +0200)]
[configure] Add configure.ac checks for BTLS. (#3668)

7 years ago[corlib] Improve test added in 54ea12e4fa41bae72704a260aadc398328b73b16
Marek Safar [Wed, 28 Sep 2016 22:28:57 +0000 (00:28 +0200)]
[corlib] Improve test added in 54ea12e4fa41bae72704a260aadc398328b73b16

7 years ago[runtime] Use mono_error_set_for_class_failure in more places
Aleksey Kliger [Wed, 28 Sep 2016 22:25:33 +0000 (18:25 -0400)]
[runtime] Use mono_error_set_for_class_failure in more places

Also assert if we see anothing other than MONO_EXCEPTION_TYPE_LOAD or
MONO_EXCEPTION_INVALID_PROGRAM in a class failure.

7 years ago[build] Make monolite output path configurable
Marek Safar [Wed, 28 Sep 2016 21:34:36 +0000 (23:34 +0200)]
[build] Make monolite output path configurable

7 years ago[loader] Use mempool memory for MONO_EXCEPTION_TYPE_LOAD messages.
Aleksey Kliger [Wed, 28 Sep 2016 21:25:36 +0000 (17:25 -0400)]
[loader] Use mempool memory for MONO_EXCEPTION_TYPE_LOAD messages.

Prevent memory leaks by storing the error message strings in the same
mempool as the failing class.

7 years ago[image] Check mempool of mono_image_property_insert value
Aleksey Kliger [Wed, 28 Sep 2016 21:24:14 +0000 (17:24 -0400)]
[image] Check mempool of mono_image_property_insert value

When adding an image property, check that the value belongs to the same image.

Ensure that we don't leak the values when the property hashtables are destroyed.

7 years ago[checked] Add CHECKED_METADATA_STORE and CHECKED_METADATA_STORE_LOCAL
Aleksey Kliger [Wed, 28 Sep 2016 21:22:31 +0000 (17:22 -0400)]
[checked] Add CHECKED_METADATA_STORE and CHECKED_METADATA_STORE_LOCAL

When running a checked build with metadata checking enabled, these
macros check that values written to ptr occupy the apropriate mempool.

7 years ago[image] Add mono_image_strdup_printf and mono_image_strdup_vprintf
Aleksey Kliger [Wed, 28 Sep 2016 21:21:53 +0000 (17:21 -0400)]
[image] Add mono_image_strdup_printf and mono_image_strdup_vprintf

7 years ago[mempool] Add mono_mempool_strdup_printf and mono_mempool_strdup_vprintf
Aleksey Kliger [Wed, 28 Sep 2016 21:21:09 +0000 (17:21 -0400)]
[mempool] Add mono_mempool_strdup_printf and mono_mempool_strdup_vprintf

7 years ago[System] Reduce duration of SendGenericExceedBuffer test
Marek Safar [Wed, 28 Sep 2016 16:12:23 +0000 (18:12 +0200)]
[System] Reduce duration of SendGenericExceedBuffer test

7 years ago[System]: Cleanup the internal MobileTlsContext.
Martin Baulig [Tue, 27 Sep 2016 15:51:06 +0000 (17:51 +0200)]
[System]: Cleanup the internal MobileTlsContext.

* Add SelectClientCertificate().
* ValidateCertificate() now returns bool.
* Add ValidateCertificate() overload.

(cherry picked from commit 0d07c695b504068d2b99a3fa9e84e6de4d2b3eed)

7 years ago[Mono.Security]: Cleanup the internal ICertificateValidator2.
Martin Baulig [Tue, 27 Sep 2016 15:33:13 +0000 (17:33 +0200)]
[Mono.Security]: Cleanup the internal ICertificateValidator2.

(cherry picked from commit fcc570920db2d63cee0c9a00c03b8b0dad6e6df5)

7 years agoRemove all MONO_FEATURE_NEW_TLS conditionals.
Martin Baulig [Tue, 27 Sep 2016 13:59:47 +0000 (15:59 +0200)]
Remove all MONO_FEATURE_NEW_TLS conditionals.

(cherry picked from commit c155563d1e6c61de86839088dd5feaefaef40cc6)

7 years agoCleanup; with the removal of 'PrebuiltSystemAlias', we don't need to use XX509* anymore.
Martin Baulig [Tue, 27 Sep 2016 13:19:13 +0000 (15:19 +0200)]
Cleanup; with the removal of 'PrebuiltSystemAlias', we don't need to use XX509* anymore.

(cherry picked from commit 5b412212cd8bf45bee13084116dc8111e86c47a3)

7 years ago[System]: Make Test/System.Net.Sockets compile.
Martin Baulig [Wed, 28 Sep 2016 11:35:10 +0000 (13:35 +0200)]
[System]: Make Test/System.Net.Sockets compile.

(cherry picked from commit c2e7ca6c99d4ae16832b2e00acde7eafd668de14)

7 years agoEnable reuse of eglib native test framework and test driver source.
lateralusX [Wed, 28 Sep 2016 10:01:08 +0000 (12:01 +0200)]
Enable reuse of eglib native test framework and test driver source.

In current eglib test framework there is no mechanism to specify where
the include file describing all tests is located. Current implementation also assumes it is the main
entry point of the process since it defines the main symbol. There are several scenarios
where it could make sense to reuse eglib test framework and its driver in other native unit test projects
unit testing native code. In those scenarios it would be nice to include existing driver.c
from eglib/test (no copy) and use toolchain capabilities to include needed header with test descriptions
and change main symbol name, since main will most likely be defined elsewhere.

This can be achieved by two simple defines that can be set when embedding eglib test framwork in other
native binaries. By default these defines will not be set and current behavior will be preserved.

7 years ago[build] Update bootstrap info text
Marek Safar [Wed, 28 Sep 2016 06:42:48 +0000 (08:42 +0200)]
[build] Update bootstrap info text

7 years agoMerge pull request #3626 from lateralusX/jlorenss/win-api-family-support-eglib
Johan Lorensson [Wed, 28 Sep 2016 06:40:30 +0000 (08:40 +0200)]
Merge pull request #3626 from lateralusX/jlorenss/win-api-family-support-eglib

Build eglib under none desktop Windows API family.

7 years agoMerge pull request #3658 from kumpera/fix-ios-logging
Rodrigo Kumpera [Wed, 28 Sep 2016 00:11:23 +0000 (20:11 -0400)]
Merge pull request #3658 from kumpera/fix-ios-logging

[logging] Fix logging on iOS. We lost asl redirection and it was sending to stdout instead.

7 years ago[threads] Signal the w32handle later in the thread destruction process (#3652)
Ludovic Henry [Tue, 27 Sep 2016 21:44:51 +0000 (23:44 +0200)]
[threads] Signal the w32handle later in the thread destruction process (#3652)

7 years ago[logging] Fix logging on iOS. We lost asl redirection and it was sending to stdout...
Rodrigo Kumpera [Tue, 27 Sep 2016 21:39:24 +0000 (14:39 -0700)]
[logging] Fix logging on iOS. We lost asl redirection and it was sending to stdout instead.

7 years ago[coop handles] Add some memory fences (#3617)
Aleksey Kliger (λgeek) [Tue, 27 Sep 2016 21:02:18 +0000 (17:02 -0400)]
[coop handles] Add some memory fences (#3617)

When running with async suspend (ie, not coop), a user thread might be
suspended while its manipulating the coop handle stack.  In that case,
we want to present a consitent view to mono_handle_stack_scan () by
adding memory fences to code that updates the stack chunks.  In
particular we want to ensure that the chunk size is increased after
the new slot has a valid (null) value.  Also when creating new chunks
make sure their size is initialized before the chunk stack is updated.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43921 (at least the
one stack trace observed in [comment 1](https://bugzilla.xamarin.com/show_bug.cgi?id=43921#c1)).

7 years ago[Mono.Security.Interface] Cleanup and simplify MonoTlsProviderFactory.
Martin Baulig [Tue, 27 Sep 2016 09:53:05 +0000 (11:53 +0200)]
[Mono.Security.Interface] Cleanup and simplify MonoTlsProviderFactory.

The "global" TLS Provider (returned by MonoTlsProviderFactory.GetProvider())
may only be modified at application startup (before any of the TLS / Certificate
code has been used).

* MonoTlsProviderFactory.HasProvider has been removed.

  This property used to initialize the TLS Subsystem without throwing any
  exceptions.  However, properties with side-effects is a bad design principle.

* Add MonoTlsProviderFactory.IsInitialized.

  Does not have any side-effects.

* Add MonoTlsProviderFactory.Initialize() and Initialize(string).

  May only be called at application startup and explicitly initializes the
  TLS Subsystem.

* Rename MonoTlsProviderFactory.GetDefaultProvider() into GetProvider()
  and removed MonoTlsProviderFactory.GetCurrentProvider().

  We do not distinguish between a "default" and a "current" provider anymore;
  there is only one "global" provider.

* Add MonoTlsProviderFactory.IsProviderSupported(string).

  Checks whether a specific TLS Provider is supported, without having side-effects.

* Make the old APIs [Obsolete] until products have been updated.

* Add some documentation to MonoTlsProviderFactory.

(cherry picked from commit 7c3ae83b31a2456d00daf2949706719e3e694d15)

7 years ago[llvm] Enable support for large basic blocks again.
Zoltan Varga [Tue, 27 Sep 2016 19:23:40 +0000 (15:23 -0400)]
[llvm] Enable support for large basic blocks again.

llc has some performance problems with large basic blocks so we have to break them up into smaller ones. Use some hacks to prevent opt/llc from merging them back again.

7 years agoMerge pull request #3656 from marek-safar/bootstrap
Marek Safar [Tue, 27 Sep 2016 19:24:11 +0000 (21:24 +0200)]
Merge pull request #3656 from marek-safar/bootstrap

[build] Bootstrap extension for roslyn

7 years ago[runtime] Fix MonoMethod.get_base_method when abstract methods are not overridden
Aleksey Kliger [Fri, 23 Sep 2016 20:08:52 +0000 (16:08 -0400)]
[runtime] Fix MonoMethod.get_base_method when abstract methods are not overridden

When there is an abstract class in the middle of an inheritance
hierarchy that doesn't override a method, get_base_methods needs to search
the parent class instead aborting early.

Example:

```
abstract class Root {
  public abstract void Foo ();
}
abstract class Abs : Root { }
class Derived : Abs {
  public override void Foo () { }
}
```

If we ask for the base method of Derived.Foo we used to get Derived.Foo
back because Abs did not provide an override.  Instead we should skip
abs and look in Root.

7 years agoFix trace logging on Android
Marek Habersack [Tue, 27 Sep 2016 18:31:19 +0000 (20:31 +0200)]
Fix trace logging on Android

Introduction of the structured trace logger accidentally broke Android
logcat logging. The reason for this is that the default logging handler
defined in eglib (in goutput.c) for Android was never called, instead it
was superseeded by the log file logger defined in mono-logger.c

The net effect was that Mono tried to write the messages to some file on
Android leaving logcat devoid of any trace of life :)

This commit fixes the issue by introducing a set of structured logging
functions for Android.

As a side note - file logging on Android is not that useful. Writing to
a file on external storage medium requires app permissions and writing
to a location on internal storage medium, while allowed, might be
subject to space limitations and should not be used for possibly
voluminous data. It's therefore not very practical on Android.

7 years ago[build] Bootstrap extension for roslyn
Marek Safar [Tue, 27 Sep 2016 07:19:05 +0000 (09:19 +0200)]
[build] Bootstrap extension for roslyn

7 years ago[System*] Throw a PlatformNotSupported exception when using the networking stack...
Rolf Bjarne Kvinge [Tue, 27 Sep 2016 11:13:38 +0000 (13:13 +0200)]
[System*] Throw a PlatformNotSupported exception when using the networking stack on watchOS. (#3606)

* [System] Fix line endings for a few files.

Best reviewed by not showing whitespace changes (should be empty diff in that case).

* [System] Fix potential crash in CookieParserTests.

Socket.EndAccept can throw an exception, which will crash the process if it
happens on a threadpool. So handle any exceptions when calling
Socket.EndAccept, and propagate those exceptions out of any threadpool code.

* [System.Net.Http] Throw a PlatformNotSupported exception when using HttpClientHandler on watchOS.

* [System.Net.Http] Tweak tests after watchOS API change.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Extract the HttpListenerResponseHelper class to a separate file.

Extract the HttpListenerResponseHelper class to a separate file so that it's
easier to replace the HttpListenerResponse implementation by using a different
file.

* [System] Throw a PlatformNotSupported exception when using the networking stack on watchOS.

* [System] Tweak tests after watchOS API changes.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Fix potential crash in SocketAcceptAsyncTest.

Fix potential crash in SocketAcceptAsyncTest by catching any exceptions in
code executed on the threadpool so that we never end up with unhandled
exceptions (which may terminate the process).

* [System] Avoid logic in SetUp attributes in tests.

Any type of exception in [SetUp] attributes causes all tests to fail with that
exception.

This even happens for tests that do not need the logic in the [SetUp]
attribute.

So rewrite tests a bit to not use [SetUp] when we can reasonably avoid it, and
instead instantiate class-level variables on first use. This ensures that any
exceptions that occur when initializing those variables are attributed to the
corresponding test, and not all of them.

* [System] Make exception handler (for test) catch more exceptions to avoid unhandled exceptions causing process termination.

* [System] Remove Obsolete attribute on API that throws PNSE.

7 years ago[corlib] Add API to uninstall/reinstall signal handlers.
Rolf Bjarne Kvinge [Fri, 23 Sep 2016 11:53:36 +0000 (13:53 +0200)]
[corlib] Add API to uninstall/reinstall signal handlers.

This API is provided to be used by libraries providing crash reporting, so
that those libraries can install signal handlers and at the same time not
interfere with Mono's signals.

The intended pattern is this:

    Mono.Runtime.RemoveSignalHandlers ();
    InstallThirdPartySignalHandlers ();
    Mono.Runtime.InstallSignalHandlers ();

This ensures that Mono is always notified first of any signals, and will then
chain to the third-party signal handlers if the signal did not originate in
managed code.

Mono's signals must first be removed, so that if third-party signal handler
does signal chaining, we don't end up in Mono's signal handler again.

Mailing-list thread: http://lists.dot.net/pipermail/macios-devel/2016-September/000016.html [Signal-chaining & crash reporters]
Example usage: https://github.com/rolfbjarne/HockeySDK-Xamarin/commit/862721199f1adec210bfc7b1943f975ffb8048a9

7 years ago[mini] Provide a free function to the saved signal handler hash table.
Rolf Bjarne Kvinge [Tue, 13 Sep 2016 11:18:10 +0000 (13:18 +0200)]
[mini] Provide a free function to the saved signal handler hash table.

This makes the cleanup code simpler, and also makes it easier to
replace saved signal handlers without having to worry about
leaking memory.

7 years agoMerge pull request #3647 from BrzVlad/fix-sgen-internal-alloc
Vlad Brezae [Tue, 27 Sep 2016 10:10:01 +0000 (13:10 +0300)]
Merge pull request #3647 from BrzVlad/fix-sgen-internal-alloc

[sgen] Fix sgen internal alloc

7 years ago[Mono.Security]: Cleanup Mono.Security.Interface.CertificateValidationHelper.
Martin Baulig [Mon, 26 Sep 2016 10:39:29 +0000 (12:39 +0200)]
[Mono.Security]: Cleanup Mono.Security.Interface.CertificateValidationHelper.

* CertificateValidationHelper.GetDefaultValidator(): rename this internal method into
  GetInternalValidator() (keeping the old as [Obsolete] until products have been updated).

* CertificateValidationHelper.GetValidator(): remove the 'provider' argument.

This is part of a set of cleanups and simplifications for the upcoming BTLS integration.

7 years agoBuild eglib under none desktop Windows API family.
lateralusX [Tue, 27 Sep 2016 09:28:57 +0000 (11:28 +0200)]
Build eglib under none desktop Windows API family.

Initial work to build eglib under none desktop Windows API family. Classic
Windows API have been split into families and partitions in order to support
different subsets on different Windows platforms. In order to build against
other Windows targets/platforms Mono needs to follow these families/partitions
in order to successfully build where API’s have been removed/replaced. Since most
Mono platforms uses the Windows API signatures a new defined has been added to all
platforms, HAVE_CLASSIC_WINAPI_SUPPORT, used to decide what implementation to include.
On none Windows platforms this is always defined and on Windows platforms it follows the
winapifamily.h. In order to keep down regressions, the existing API’s are kept for HAVE_CLASSIC_WINAPI_SUPPORT
even if there are more modern replacements available.

7 years ago[w32handle] Ensure we initialize begore the gc attach the current thread (#3644)
Ludovic Henry [Tue, 27 Sep 2016 08:43:59 +0000 (10:43 +0200)]
[w32handle] Ensure we initialize begore the gc attach the current thread (#3644)

7 years agoMerge pull request #3643 from marek-safar/bootstrap
Marek Safar [Tue, 27 Sep 2016 06:20:05 +0000 (08:20 +0200)]
Merge pull request #3643 from marek-safar/bootstrap

[build] Bump mono bootstrap dependency to Mono 4.0+

7 years ago[mini] Add some documentation comments to some IR generating macros
Miguel de Icaza [Tue, 27 Sep 2016 02:16:49 +0000 (22:16 -0400)]
[mini] Add some documentation comments to some IR generating macros