mono.git
7 years ago[profiler] Access in_shutdown atomically.
Alex Rønne Petersen [Wed, 14 Sep 2016 12:31:32 +0000 (14:31 +0200)]
[profiler] Access in_shutdown atomically.

7 years ago[profiler] Drop support for perf events on Linux.
Alex Rønne Petersen [Wed, 14 Sep 2016 16:20:14 +0000 (18:20 +0200)]
[profiler] Drop support for perf events on Linux.

7 years ago[utils/lfa] Add a missing #include to fix the profiler build.
Alex Rønne Petersen [Tue, 13 Sep 2016 15:57:54 +0000 (17:57 +0200)]
[utils/lfa] Add a missing #include to fix the profiler build.

7 years ago[profiler] Disable GC move events when allocation events are disabled.
Alex Rønne Petersen [Tue, 13 Sep 2016 11:09:24 +0000 (13:09 +0200)]
[profiler] Disable GC move events when allocation events are disabled.

They serve no purpose when allocation profiling is enabled, and just make log
files bigger than they have to be.

7 years ago[profiler] Clean up and improve the helper thread code.
Alex Rønne Petersen [Tue, 13 Sep 2016 09:34:22 +0000 (11:34 +0200)]
[profiler] Clean up and improve the helper thread code.

* Don't invoke undefined behavior if an fd is >= FD_SETSIZE.
* Allow multiple command sockets.
* Close the command socket(s) on shutdown.
* Properly run cleanup logic on shutdown.

7 years ago[profiler] Process requests in method_jitted ().
Alex Rønne Petersen [Mon, 12 Sep 2016 17:29:05 +0000 (19:29 +0200)]
[profiler] Process requests in method_jitted ().

7 years ago[profiler] Remove the need to pass a MonoProfiler argument to some functions.
Alex Rønne Petersen [Mon, 12 Sep 2016 13:53:37 +0000 (15:53 +0200)]
[profiler] Remove the need to pass a MonoProfiler argument to some functions.

This is now available on the MonoProfilerThread structure.

7 years ago[profiler] Fix the way the profiler frees hazardous data on shutdown.
Alex Rønne Petersen [Mon, 12 Sep 2016 13:35:24 +0000 (15:35 +0200)]
[profiler] Fix the way the profiler frees hazardous data on shutdown.

7 years ago[profiler] Replace a check with an assert in coverage_filter ().
Alex Rønne Petersen [Mon, 12 Sep 2016 12:48:51 +0000 (14:48 +0200)]
[profiler] Replace a check with an assert in coverage_filter ().

7 years ago[profiler] Add messages to most assertions.
Alex Rønne Petersen [Mon, 12 Sep 2016 12:44:01 +0000 (14:44 +0200)]
[profiler] Add messages to most assertions.

7 years ago[profiler] Remove the ign_res () hack.
Alex Rønne Petersen [Mon, 12 Sep 2016 12:31:16 +0000 (14:31 +0200)]
[profiler] Remove the ign_res () hack.

7 years ago[profiler] Clean up the #include mess in mono-profiler-log.c.
Alex Rønne Petersen [Mon, 12 Sep 2016 12:15:16 +0000 (14:15 +0200)]
[profiler] Clean up the #include mess in mono-profiler-log.c.

Half of these aren't even needed - get rid of those. Sort the rest.

7 years ago[profiler] Remove mono_threads_attach_tools_thread () declaration.
Alex Rønne Petersen [Mon, 12 Sep 2016 11:58:25 +0000 (13:58 +0200)]
[profiler] Remove mono_threads_attach_tools_thread () declaration.

We get this from mono-threads.h now.

7 years ago[profiler] Remove some broken, commented-out code from register_method_local ().
Alex Rønne Petersen [Mon, 12 Sep 2016 11:51:45 +0000 (13:51 +0200)]
[profiler] Remove some broken, commented-out code from register_method_local ().

7 years ago[profiler] assert () -> g_assert ().
Alex Rønne Petersen [Mon, 12 Sep 2016 11:06:54 +0000 (13:06 +0200)]
[profiler] assert () -> g_assert ().

7 years ago[profiler] Always enable the helper thread.
Alex Rønne Petersen [Mon, 12 Sep 2016 10:49:10 +0000 (12:49 +0200)]
[profiler] Always enable the helper thread.

We need it in all cases now that we use it to periodically flush all buffers.
The only platforms it was disabled on was NaCl, which we haven't bothered to
support in a while anyway.

7 years ago[profiler] Encapsulate some common logic in the ENTER_LOG/EXIT_LOG macros.
Alex Rønne Petersen [Mon, 12 Sep 2016 10:27:39 +0000 (12:27 +0200)]
[profiler] Encapsulate some common logic in the ENTER_LOG/EXIT_LOG macros.

This also has the nice effect of reducing the amount of times we attempt to
take the reader lock. Now we take it and release it once for a single event.

7 years ago[profiler] Add a missing deinit_thread () call to the helper thread.
Alex Rønne Petersen [Mon, 12 Sep 2016 10:27:21 +0000 (12:27 +0200)]
[profiler] Add a missing deinit_thread () call to the helper thread.

7 years ago[profiler] Fix several race conditions in accessing MonoProfilerThread.buffer.
Alex Rønne Petersen [Mon, 12 Sep 2016 08:44:34 +0000 (10:44 +0200)]
[profiler] Fix several race conditions in accessing MonoProfilerThread.buffer.

Only in very few situations is it okay to access this field without first
taking the reader lock or exclusive lock.

Fixes some crashes observed in the profiler stress tests.

7 years ago[profiler] Don't flush empty log buffers.
Alex Rønne Petersen [Mon, 12 Sep 2016 08:44:00 +0000 (10:44 +0200)]
[profiler] Don't flush empty log buffers.

7 years ago[profiler] Add an extra assert.
Alex Rønne Petersen [Mon, 12 Sep 2016 08:43:38 +0000 (10:43 +0200)]
[profiler] Add an extra assert.

7 years ago[sgen] Always report object moves on the GC thread.
Alex Rønne Petersen [Sat, 10 Sep 2016 21:09:48 +0000 (23:09 +0200)]
[sgen] Always report object moves on the GC thread.

This avoids exposing the SGen worker threads through the profiler APIs. Doing
so had two main problems:

* It's easy for a user of the profiler API to accidentally mess with the state
  of the worker thread in all sorts of ways, which could break the GC.
* It's been a long-standing guarantee that any profiler API callback will be
  invoked on a thread that is, at the very least, attached to the runtime via
  the mono-threads infrastructure. This is not the case for SGen workers.

This fixes a deadlock in the log profiler when using major=marksweep-conc.

7 years ago[profiler] Rename decode.c to mprof-report.c.
Alex Rønne Petersen [Sat, 10 Sep 2016 05:22:25 +0000 (07:22 +0200)]
[profiler] Rename decode.c to mprof-report.c.

7 years ago[profiler] Rename proflog.{c,h} to mono-profiler-log.{c,h} for consistency with other...
Alex Rønne Petersen [Sat, 10 Sep 2016 05:15:50 +0000 (07:15 +0200)]
[profiler] Rename proflog.{c,h} to mono-profiler-log.{c,h} for consistency with other profilers.

7 years ago[profiler] Remove utils.c/utils.h, move the code to proflog.c/decode.c, and clean...
Alex Rønne Petersen [Fri, 9 Sep 2016 16:50:56 +0000 (18:50 +0200)]
[profiler] Remove utils.c/utils.h, move the code to proflog.c/decode.c, and clean it up.

* Drop support for fast/null timers.
* Use Mono runtime functions for getting the thread ID and allocating buffers.

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)