mono.git
6 years ago[System.Net.Http] Updates range check from 3741d16503a973a99c724bdab9a255a5f07a3637
Marek Safar [Tue, 3 Oct 2017 14:32:15 +0000 (16:32 +0200)]
[System.Net.Http] Updates range check from 3741d16503a973a99c724bdab9a255a5f07a3637

6 years agoMerge pull request #5636 from BrzVlad/fix-xmm-scan
Vlad Brezae [Tue, 3 Oct 2017 15:51:20 +0000 (18:51 +0300)]
Merge pull request #5636 from BrzVlad/fix-xmm-scan

[sgen] Scan simd registers on linux amd64 + apple arm64

6 years ago[mcs] Implements C# 7.2 readonly structs
Marek Safar [Tue, 3 Oct 2017 13:27:11 +0000 (15:27 +0200)]
[mcs] Implements C# 7.2 readonly structs

6 years ago[w32file] Push win32 specific error to win32 specific implementation (#5665)
Ludovic Henry [Tue, 3 Oct 2017 14:38:09 +0000 (10:38 -0400)]
[w32file] Push win32 specific error to win32 specific implementation (#5665)

ERROR_SHARING_VIOLATION can only happen on win32, so pushing the code to deal with this error to w32file-win32.c file.

6 years ago[mcs] Adds minor langversion support
Marek Safar [Tue, 3 Oct 2017 10:21:57 +0000 (12:21 +0200)]
[mcs] Adds minor langversion support

6 years agoMerge pull request #5656 from lateralusX/lateralusX/dynamic-static-windows-build
Johan Lorensson [Tue, 3 Oct 2017 12:20:14 +0000 (14:20 +0200)]
Merge pull request #5656 from lateralusX/lateralusX/dynamic-static-windows-build

[Windows] Mono build project restructure dropping .def file enabling full static and dynamic mono builds.

6 years ago[interp] fix using conv.u with string
Bernhard Urban [Tue, 3 Oct 2017 08:37:05 +0000 (10:37 +0200)]
[interp] fix using conv.u with string

6 years ago[jit] Fix using conv.u with string.
Rodrigo Kumpera [Mon, 2 Oct 2017 23:31:40 +0000 (16:31 -0700)]
[jit] Fix using conv.u with string.

6 years ago[mcs] Allow properties and indexers of by-ref values to be set without setter
Marek Safar [Tue, 3 Oct 2017 00:27:20 +0000 (02:27 +0200)]
[mcs] Allow properties and indexers of by-ref values to be set without setter

6 years ago[runtime] Store implmap_idx as a guint32 to avoid overflows if the implmap table...
Zoltan Varga [Mon, 2 Oct 2017 21:31:00 +0000 (23:31 +0200)]
[runtime] Store implmap_idx as a guint32 to avoid overflows if the implmap table has more than 64k rows. Fixes #59881.

6 years agoMerged changes in master libmonoruntime into PR.
lateralusX [Tue, 3 Oct 2017 07:26:11 +0000 (09:26 +0200)]
Merged changes in master libmonoruntime into PR.

6 years agoUpdated with review feedback.
lateralusX [Fri, 29 Sep 2017 12:19:44 +0000 (14:19 +0200)]
Updated with review feedback.

6 years agoUpdate msvc README file.
lateralusX [Thu, 28 Sep 2017 13:43:21 +0000 (15:43 +0200)]
Update msvc README file.

6 years agoAdd missing dependency for libmini.
lateralusX [Thu, 28 Sep 2017 13:43:10 +0000 (15:43 +0200)]
Add missing dependency for libmini.

6 years agoAlign libgc vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 13:15:35 +0000 (15:15 +0200)]
Align libgc vcxproj with makefile.

6 years agoAlign libgcmonosgen vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 12:51:49 +0000 (14:51 +0200)]
Align libgcmonosgen vcxproj with makefile.

6 years agoAlign eglib vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 11:59:30 +0000 (13:59 +0200)]
Align eglib vcxproj with makefile.

6 years agoAlign libmonoruntime vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 11:41:49 +0000 (13:41 +0200)]
Align libmonoruntime vcxproj with makefile.

6 years agoAlign libmonoutils vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 10:39:36 +0000 (12:39 +0200)]
Align libmonoutils vcxproj with makefile.

6 years agoFix libmini targets and filters.
lateralusX [Thu, 28 Sep 2017 09:23:27 +0000 (11:23 +0200)]
Fix libmini targets and filters.

6 years agoAdded labels to eglib and libmonoutils.
lateralusX [Wed, 27 Sep 2017 15:45:11 +0000 (17:45 +0200)]
Added labels to eglib and libmonoutils.

6 years agoFix libmonoruntime targets and filters.
lateralusX [Wed, 27 Sep 2017 15:28:37 +0000 (17:28 +0200)]
Fix libmonoruntime targets and filters.

6 years agoFix libmonoutils targets and filters.
lateralusX [Wed, 27 Sep 2017 12:11:07 +0000 (14:11 +0200)]
Fix libmonoutils targets and filters.

6 years agoFix eglib targets and filters.
lateralusX [Wed, 27 Sep 2017 12:10:29 +0000 (14:10 +0200)]
Fix eglib targets and filters.

6 years agoDrop use of def files for x86, x64 mono-2.0-sgen|boehm.dll Windows build.
lateralusX [Tue, 26 Sep 2017 15:15:16 +0000 (17:15 +0200)]
Drop use of def files for x86, x64 mono-2.0-sgen|boehm.dll Windows build.

6 years agoRestructure of mono.sln and build properties to better fix static/dynamic library...
lateralusX [Fri, 22 Sep 2017 07:44:04 +0000 (09:44 +0200)]
Restructure of mono.sln and build properties to better fix static/dynamic library support.

6 years agoMerge all static runtime libs into libmono-static.
lateralusX [Mon, 18 Sep 2017 14:00:35 +0000 (16:00 +0200)]
Merge all static runtime libs into libmono-static.

Make libmono-static lib file include all needed runtime libs making it easier to
link and distribute as part of Mono SDK.

Commit also updates linking of vcxprojs in mono.sln to use merged static lib.

6 years agoMerge pull request #5668 from kumpera/wasm-work-p4
Rodrigo Kumpera [Mon, 2 Oct 2017 23:36:39 +0000 (16:36 -0700)]
Merge pull request #5668 from kumpera/wasm-work-p4

More WASM fixes.

6 years ago[ci] Small improvements for run-jenkins and collect-coverage. (#5669)
vkargov [Mon, 2 Oct 2017 22:16:39 +0000 (15:16 -0700)]
[ci] Small improvements for run-jenkins and collect-coverage. (#5669)

* [ci] Allow setting custom mono flags for test runs via MONO_TEST_FLAGS.

* [ci] Make the handling of CFLAGS a bit more flexible in run-jenkins.sh.

* [ci] Generalize collect-coverage to handle more targets.

6 years agoMerge pull request #5675 from mono/glib-debug-symbols
Alexis Christoforides [Mon, 2 Oct 2017 17:46:14 +0000 (13:46 -0400)]
Merge pull request #5675 from mono/glib-debug-symbols

Add glib to the list of packages with debugging symbols.

6 years agoBump mono-extensions to fix build break (#5677)
Alexander Köplinger [Mon, 2 Oct 2017 17:45:13 +0000 (19:45 +0200)]
Bump mono-extensions to fix build break (#5677)

The driver.c patch from mono-extensions no longer applied after https://github.com/mono/mono/commit/30cddad5fb4c3d290906a6e6c33ecd8b07d8b48c

6 years agoBump NuGet.BuildTasks to get new updates and switch to `dev` branch (#5566)
Ankit Jain [Mon, 2 Oct 2017 16:18:08 +0000 (12:18 -0400)]
Bump NuGet.BuildTasks to get new updates and switch to `dev` branch (#5566)

6 years agoAdd glib to the list of packages with debugging symbols.
Cody Russell [Thu, 28 Sep 2017 20:11:01 +0000 (15:11 -0500)]
Add glib to the list of packages with debugging symbols.

6 years ago[profiler] log profiler: limit method instrumentation to selected methods (#5517)
Uri Simchoni [Mon, 2 Oct 2017 14:29:49 +0000 (17:29 +0300)]
[profiler] log profiler: limit method instrumentation to selected methods (#5517)

* [trace] remove code that has no effect

* [trace] move program assembly out of MonoTraceSpec

The assembly member represents the program assembly. It's
information the trace spec is matched against, not part of
the trace spec per-se (if two trace specs exist for two purposes
we would still have one program assembly)

* [trace] remove side effects from get_string()

On the way towards supporting multiple trace specs,
remove side effects from get_string() function.

* [trace] remove side effects from get_token()

Remove side effects from get_token() to allow handling
multiple trace specs.

* [trace] fix handling of double exclusion and disabled

When encountering "disabled", do not add an entry to
the trace spec

Fix error handling around double "-" - get_spec()
never returns TOKEN_EXCLUDE and the recursion can
be easily avoided.

* [trace] remove side effects from get_spec()

Another step in making the trace options reusable.

* [trace] rename mono_trace_parse_options() to mono_trace_set_options()

This routine actually sets the tracing options, not just parses an
option string, so set_ is more suitable. This frees up the
mono_trace_parse_options() name for pure parsing, when we later
reuse the parsing code.

* [trace] make tracing options API reusable

Add APIs that parse tracing options and evaluate a method
against the parsed options. The tracing functionality now uses
this API, but other components can use this to apply an operation
to a method based on policy (e.g. profiling)

* [trace] rename MonoTraceSpec to MonoCallSpec

In preparation for reusing call specification beyond the
tracer, rename the data structure - it now only specifies
a set of calls, without indication what should be done with
them.

* [trace] rename mono_trace_set_assembly to mono_callspec_set_assembly

As it becoming a reuse candidate, we remove the "trace" component
from the name.

* [trace-metadata] move callspec code into its own module

Introduce callspec.c/h which encapsulate the call specification
functionality.

* [profiler] add "callspec" option to log profiler

The callspec option define which methods get instrumented
at JIT time with entry/exit calls to the profiler. The
syntax is same as the tracer (--trace=) syntax. To
distinguish between profiler options and callspec, wrap the
callspec with double quotes, as in:
--profile=log:callspec="all-mscorlib",calls

Since this typically runs from a shell, the double quotes have to be
escaped or wrapped in single quotes, as in:
mono '--profile=log:callspec="all-mscorlib",calls' prog.exe

* [metadata] add an error return string to callspec parsing

Instead of printing parsing error messages to standard error,
return an error string. That allows the client to do the right thing
with the error.

6 years ago[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
Zoltan Varga [Mon, 2 Oct 2017 14:26:17 +0000 (16:26 +0200)]
[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to FALSE before it was saved, causing invalid code to be generated in some cases when doing nested inlining. Fixes #59608. (#5654)

6 years ago[mcs] Initial by ref returns and variables support
Marek Safar [Tue, 19 Sep 2017 13:47:31 +0000 (15:47 +0200)]
[mcs] Initial by ref returns and variables support

6 years agoFix ninja BTLS build for verbose builds (#5673)
Marek Habersack [Mon, 2 Oct 2017 14:15:45 +0000 (16:15 +0200)]
Fix ninja BTLS build for verbose builds (#5673)

ninja treats `VERBOSE=1` as a target and, failing to find one, aborts
the build with an error. Pass `-v` in this case instead.

6 years agoFix LinearGradientMode parameter validation to match corefx (#5672)
Hugh Bellamy [Mon, 2 Oct 2017 14:15:28 +0000 (15:15 +0100)]
Fix LinearGradientMode parameter validation to match corefx (#5672)

6 years agoAllow passing null to JsonArray.Add()
Steffen Kieß [Tue, 19 Sep 2017 18:41:16 +0000 (20:41 +0200)]
Allow passing null to JsonArray.Add()

null is a valid value in a JSON array, so there is no reason forbid
adding null to the array. JsonArray.Save() already handles null values in
the array.

6 years agoRemove invalid tests for image palettes in GdiPlusTest (#5671)
Hugh Bellamy [Mon, 2 Oct 2017 00:28:25 +0000 (01:28 +0100)]
Remove invalid tests for image palettes in GdiPlusTest (#5671)

C.r. https://github.com/mono/libgdiplus/pull/112

6 years ago[corlib] Make Marshal.BufferToBSTR(Array, int) non-public again (#5670)
Alexander Köplinger [Sat, 30 Sep 2017 19:51:42 +0000 (21:51 +0200)]
[corlib] Make Marshal.BufferToBSTR(Array, int) non-public again (#5670)

* [corlib] Make Marshal.BufferToBSTR(Array, int) non-public again

It was accidentally made public in https://github.com/mono/mono/commit/c5cdfaec1e0973ced3f97ef589cd0bece56067ad.
Unfortunately this was before we had the API diff check on Mono and the manual checks in XI/XA integration didn't catch it either.

* Bump API snapshot submodule

6 years agoMerge pull request #5659 from kumpera/fix_59824
Rodrigo Kumpera [Fri, 29 Sep 2017 23:17:03 +0000 (16:17 -0700)]
Merge pull request #5659 from kumpera/fix_59824

[runtime] Synthesize IList and IReadOnlyList for the element type of enum errays. Fixes #59824

6 years ago[wasm] We can't free memory in wasm as it uses the malloc mmap backend.
Rodrigo Kumpera [Fri, 29 Sep 2017 23:14:22 +0000 (16:14 -0700)]
[wasm] We can't free memory in wasm as it uses the malloc mmap backend.

6 years ago[wasm] Add new missing signature.
Rodrigo Kumpera [Fri, 29 Sep 2017 22:45:00 +0000 (15:45 -0700)]
[wasm] Add new missing signature.

6 years ago[wasm] Disable test that doesn't work with WASM
Rodrigo Kumpera [Fri, 29 Sep 2017 22:44:41 +0000 (15:44 -0700)]
[wasm] Disable test that doesn't work with WASM

6 years ago[System.Net.Http] HttpClient timeout range checks. Fixes #25755
Marek Safar [Fri, 29 Sep 2017 14:08:49 +0000 (16:08 +0200)]
[System.Net.Http] HttpClient timeout range checks. Fixes #25755

6 years agocodeowners update
Marek Safar [Fri, 29 Sep 2017 09:52:48 +0000 (11:52 +0200)]
codeowners update

6 years ago[w32file] Move MonoIO.Find{First,Next,Close} to managed
Ludovic Henry [Wed, 27 Sep 2017 15:28:16 +0000 (11:28 -0400)]
[w32file] Move MonoIO.Find{First,Next,Close} to managed

6 years ago[w32file] Remove dead code
Ludovic Henry [Wed, 27 Sep 2017 15:35:36 +0000 (11:35 -0400)]
[w32file] Remove dead code

6 years ago[sre] register a canonical MonoReflectionMethod for a methodref token
Aleksey Kliger [Wed, 27 Sep 2017 18:01:47 +0000 (14:01 -0400)]
[sre] register a canonical MonoReflectionMethod for a methodref token

In mono_image_create_token we are passed in a managed reflection object and we
need to create a token for it and optionally register it so that we can resolve
that token back to a runtime structure and managed object later.

For a MonoReflectionMethod object that refers to a method from outside the
current dynamic image, we need to generate a memberref token.  It will be the
same token for the same underlying MonoMethod*.  When we go to register the
token with mono_dynamic_image_register_token we need to pass a managed object.
Unfortunately two MonoReflectionMethod objects could refer to the same
MonoMethod* but differ in their ReflectedType, so just registering the
passed-in MonoReflectionMethod means we could assert in
mono_dynamic_image_register_token because previously we may have registered the
same method via a different ReflectedType.

So what we do is we cal mono_method_get_object_handle with NULL for the
reflected type - which corresponds to just using the DeclaringType of the given
MonoMethod*.

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

6 years ago[sre] Expect a new token for MonoArrayMethod and SignatureHelper
Aleksey Kliger [Wed, 27 Sep 2017 22:30:13 +0000 (18:30 -0400)]
[sre] Expect a new token for MonoArrayMethod and SignatureHelper

6 years ago[sre] Remove MonoDynamicImage:handleref_managed field
Aleksey Kliger [Wed, 27 Sep 2017 21:32:19 +0000 (17:32 -0400)]
[sre] Remove MonoDynamicImage:handleref_managed field

It's now unused.

6 years ago[sre] Map fieldref tokens to MonoClassField*
Aleksey Kliger [Wed, 27 Sep 2017 21:23:54 +0000 (17:23 -0400)]
[sre] Map fieldref tokens to MonoClassField*

Previously, we mapped fieldref tokens to MonoReflectionField managed objects,
But the object is just used as a key for caching the token so we may as well
use the native field instead of a managed object.

6 years ago[sre] Wrap mono_image_create_token with HANDLE_FUNCTION_{ENTER,RETURN}
Aleksey Kliger [Wed, 27 Sep 2017 17:56:56 +0000 (13:56 -0400)]
[sre] Wrap mono_image_create_token with HANDLE_FUNCTION_{ENTER,RETURN}

We will allocate a handle for the object that we will register.  For now it's
just an alias of the object passed in, but it could differ.

6 years ago[test] SRE ILGenerator test for methodref and fieldref token caching
Aleksey Kliger [Thu, 28 Sep 2017 20:24:30 +0000 (16:24 -0400)]
[test] SRE ILGenerator test for methodref and fieldref token caching

Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=59364

We need to cause SRE to generate the same methodref/fieldref token from two
different reflection objects.  That happens if you get the same method or field
via a base and a derived class so that the MemberInfo:DeclaredType is different
but the underlying MonoMethod* or MonoClassField* is the same.

6 years ago[System] HttpListenerRequest: ignore bad cookies and keep request alive (#5657)
Alexander Köplinger [Thu, 28 Sep 2017 23:19:09 +0000 (01:19 +0200)]
[System] HttpListenerRequest: ignore bad cookies and keep request alive (#5657)

HttpRequestListener throws on incorrect cookie name. It throws CookieException ("Name contains invalid characters"). There are many cookies out there that unfortunately do not conform to the guidelines and HttpRequestListener will kill the request in such a case. The .Net framework under windows lets the request through however.

Included is a patch HttpListenerRequest as well as a test with a bad cookie name.

I have tested this under linux(master branch) and .net (4.0), they now both have the same behavior.

6 years ago[msbuild] Bump msbuild to fix test failures on wrench (#5660)
Ankit Jain [Thu, 28 Sep 2017 22:55:07 +0000 (18:55 -0400)]
[msbuild] Bump msbuild to fix test failures on wrench (#5660)

6 years agoMerge pull request #5560 from kumpera/wasm-work-p3
Rodrigo Kumpera [Thu, 28 Sep 2017 22:06:02 +0000 (18:06 -0400)]
Merge pull request #5560 from kumpera/wasm-work-p3

More WASM fixes, with this I can get half of the mini test suite to run without crashing.

6 years agoMerge pull request #5567 from kumpera/fix_59334
Rodrigo Kumpera [Thu, 28 Sep 2017 20:50:07 +0000 (16:50 -0400)]
Merge pull request #5567 from kumpera/fix_59334

[runtime] Handle RuntimeWrappedException and dynamic methods. Fixes #59334

6 years ago[runtime] Synthesize IList and IReadOnlyList for the element type of enum errays...
Rodrigo Kumpera [Thu, 28 Sep 2017 20:45:54 +0000 (13:45 -0700)]
[runtime] Synthesize IList and IReadOnlyList for the element type of enum errays. Fixes #59824

Make sure array of enums can be casted to interfaces of their element types.

6 years ago[mini] Fix test compiling when running !MOBILE
Rodrigo Kumpera [Thu, 28 Sep 2017 17:11:19 +0000 (10:11 -0700)]
[mini] Fix test compiling when running !MOBILE

6 years ago[runtime] Fix icall signature and change comment to fixme.
Rodrigo Kumpera [Thu, 28 Sep 2017 17:01:11 +0000 (10:01 -0700)]
[runtime] Fix icall signature and change comment to fixme.

6 years ago[wasm] Implement GC support. Embedder must provide main loop pumping function request...
Rodrigo Kumpera [Thu, 28 Sep 2017 00:30:49 +0000 (17:30 -0700)]
[wasm] Implement GC support. Embedder must provide main loop pumping function request_gc_cycle.

6 years ago[runtime] Fix DISABLE_REFLECTION_EMIT build.
Rodrigo Kumpera [Wed, 27 Sep 2017 22:06:23 +0000 (15:06 -0700)]
[runtime] Fix DISABLE_REFLECTION_EMIT build.

6 years ago[amd64] Save missing register
Vlad Brezae [Tue, 26 Sep 2017 21:15:41 +0000 (00:15 +0300)]
[amd64] Save missing register

6 years ago[arm64] Scan simd registers on apple
Vlad Brezae [Mon, 25 Sep 2017 23:30:33 +0000 (02:30 +0300)]
[arm64] Scan simd registers on apple

Fix for #50190

6 years ago[runtime] Avoid indirection when building MonoContext on darwin
Vlad Brezae [Mon, 25 Sep 2017 20:14:19 +0000 (23:14 +0300)]
[runtime] Avoid indirection when building MonoContext on darwin

6 years ago[arm64] Add the full neon regs to the context
Vlad Brezae [Fri, 22 Sep 2017 22:42:43 +0000 (01:42 +0300)]
[arm64] Add the full neon regs to the context

The full regs are still not handled in the trampolines. Only the lower half is saved.

6 years ago[amd64] Add XMM registers to MonoContext on linux
Vlad Brezae [Thu, 21 Sep 2017 22:36:07 +0000 (01:36 +0300)]
[amd64] Add XMM registers to MonoContext on linux

Fix for #50189

6 years ago[mkbundle] Link against Objective-C runtime and Foundation framework on OSX (#5642)
Alexander Köplinger [Wed, 27 Sep 2017 09:15:12 +0000 (11:15 +0200)]
[mkbundle] Link against Objective-C runtime and Foundation framework on OSX (#5642)

Without it you get errors like the following in old-style mkbundle:

```
Undefined symbols for architecture x86_64:
  "_CFLocaleCopyCurrent", referenced from:
      _ves_icall_System_Globalization_CultureInfo_get_current_locale_name in libmono-2.0.a(libmonoruntimesgen_la-locales.o)
  "_CFLocaleGetIdentifier", referenced from:
      _ves_icall_System_Globalization_CultureInfo_get_current_locale_name in libmono-2.0.a(libmonoruntimesgen_la-locales.o)
  "_CFLocaleGetValue", referenced from:
      _ves_icall_System_Globalization_CultureInfo_get_current_locale_name in libmono-2.0.a(libmonoruntimesgen_la-locales.o)
  "_CFRelease", referenced from:
      _ves_icall_System_Globalization_CultureInfo_get_current_locale_name in libmono-2.0.a(libmonoruntimesgen_la-locales.o)
...
```

We actually documented this in the 3.4 release notes: http://www.mono-project.com/docs/about-mono/releases/3.4.0/#breaking-changes

However this means that you had to use the "-c" mkbundle option
to only generate the .c stub so you could pass those additional libraries.

6 years ago[jit] Add support for unlimited size/number of arguments to the dyn call code (#5612)
Zoltan Varga [Wed, 27 Sep 2017 01:23:56 +0000 (03:23 +0200)]
[jit] Add support for unlimited size/number of arguments to the dyn call code (#5612)

* [jit] Add a mono_arch_dyn_call_get_buf_size () arch specific function which returns the size of the buffer required for a given dyn call. Use this instead of a fixed size buffer, to allow backends to use variable sized buffers later.

* [amd64] Add support for unlimited size/number of arguments to the dyncall code.

* [arm64] Add support for unlimited size/number of arguments to the dyncall code. Part of the fix for #59184.

6 years ago[[runtime] Wait for the thread to really exit in Thread.Join (). Change the check...
Zoltan Varga [Wed, 27 Sep 2017 00:08:31 +0000 (02:08 +0200)]
[[runtime] Wait for the thread to really exit in Thread.Join (). Change the check for started threads in mono_thread_set_name_internal () so it check the thread state and not the tid. Avoid setting the tid to 0 when the thread exits. (#5549)

6 years ago[mini] Add my test suite to the list of magic type assemblies.
Rodrigo Kumpera [Tue, 26 Sep 2017 22:03:18 +0000 (15:03 -0700)]
[mini] Add my test suite to the list of magic type assemblies.

6 years ago[mini] Adjust some test suites to work under mobile.
Rodrigo Kumpera [Tue, 26 Sep 2017 21:57:45 +0000 (14:57 -0700)]
[mini] Adjust some test suites to work under mobile.

6 years ago[Mono.Unix] Fix crasher in StringToHeap (#5639)
Marius Ungureanu [Tue, 26 Sep 2017 20:34:07 +0000 (23:34 +0300)]
[Mono.Unix] Fix crasher in StringToHeap (#5639)

In case StringToHeap (string, Encoding) was called with a null string, it would unconditionally reference the string when trying to query the string's length.

Bug 10074 - Error while updating status of command: MonoDevelop.Ide.Commands.ViewCommands.LayoutList

6 years ago[test] Add gparam Type.IsAssignableFrom and Type.BaseType tests
Aleksey Kliger [Tue, 26 Sep 2017 17:01:43 +0000 (13:01 -0400)]
[test] Add gparam Type.IsAssignableFrom and Type.BaseType tests

Lock down .NET Framework documented behavior

6 years ago[class] Use constraints of gparam T2 in T1.IsAssignableFrom (T2)
Aleksey Kliger [Fri, 22 Sep 2017 14:30:44 +0000 (10:30 -0400)]
[class] Use constraints of gparam T2 in T1.IsAssignableFrom (T2)

Suppose we want to know C.IsAssignableFrom (T1):
```
  class C { }
  class G<T1, T2> where T1 : T2, T2 : C { }
```

Previously, we would get `False`, because we only checked the constraints of T1
if C was an interface or another gparam.  Now Instead we always consider the
constraints in `A.IsAssignableFrom (B)` whenever `B` is a gparam.

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

6 years ago[test] Add regression test for 58809
Aleksey Kliger [Thu, 21 Sep 2017 18:10:49 +0000 (14:10 -0400)]
[test] Add regression test for 58809

Check that generic parameters's constraints properly affect the subclass and
interface relationships even when the constraints relate several of the generic
parameters themselves.

6 years ago[w32process] Fix inverted kernel and user ticks (#5641)
Ludovic Henry [Tue, 26 Sep 2017 17:51:54 +0000 (13:51 -0400)]
[w32process] Fix inverted kernel and user ticks (#5641)

6 years agoFix shutdown race between mono_thread_manage and mono_thread_detach_internal. (#5599)
Johan Lorensson [Tue, 26 Sep 2017 17:25:23 +0000 (19:25 +0200)]
Fix shutdown race between mono_thread_manage and mono_thread_detach_internal. (#5599)

* Add support for mono_threads_add_joinable_thread and friends on Windows.

Current Windows implementation doesn't have support for the joinable thread
implementation in threads.c. Joinable threads are used by the runtime during
shutdown to coordinate with exit of platform threads.

Since threads detaching and exiting during shutdown could still use or provide
important resources, like GC memory, lacking support for this feature could
potentially expose the implementation to various shutdown race conditions.

Commit also change requested permission on a thread handle when opening it for
synchronization purposes. No need to request all thread access when handle is only
used for synchronization, like in WaitForXXX API calls.

* Fix race between mono_thread_detach_internal and mono_thread_manage.

There is a race during shutdown when main tread is running mono_thread_manage and
attached threads are running mono_thread_detach_internal. The problem is related to
the removal from the registered threads list since mono_thread_manage will pick
threads to wait upon from that list. If a thread removes itself from the list
using mono_thread_detach_internal it will then race against runtime shutdown
and the removal of used resources still in used by mono_thread_detach_intenral,
like MonoInternalThread.

This race could trigger the assert seen in bugzilla:

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

or other undefined behavior depending on where the detached thread resume execution
after main thread has shutdown the runtime, but not yet terminated the process.

The fix makes sure threads that are detaching during shutdown ends up on the joinable
threads list. Threads on that list will be waited upon by the main thread during shutdown,
mono_thread_cleanup. This will make sure the detached thread finishes the remaining of
mono_thread_detach_internal and potential other code still using GC memory during shutdown.
Threads already on the threads list will already be waited upon by mono_thread_manage during
shutdown (if not removed by mono_thread_detach_internal triggering this race), so this change
won't add additional threads to be waited up by the runtime. It just makes the shutdown more
reliable using already available concepts (like the joinable threads list).

* Fix warning C4141 on Windows MSVC compiler.

* Updated with review feedback.

* Prevent race between finalizer and main thread to join same thread multiple times.

Checking against joinable_threads list in mono_threads_add_joinable_thread is not enough.
There is a small chance that the same runtime thread could get on the list twice since
mono_threads_add_joinable_thread could be called multiple times for the the same tid.
This will work under Windows but is undefined behavior on POSIX's platforms.

This could happen if the finalizer thread calls mono_threads_join_threads when a thread
is detaching and have added itself to the joinable_threads, but before unregister_thread
has been called. Finalizer thread will then take tid from list and wait, this will cause
the second call to mono_threads_add_joinable_thread to not find itself in the joinable_threads
and add tid a second time. NOTE, this race only applies to runtime threads added to the
joinable_threads list.

Fix adds an additional method to add runtime threads to the list. This method will only add to
list if its indeed a runtime thread and doesn’t already have an outstanding pending native join
request. This method is called by code previously checking runtime_thread flag before adding to
joinable_threads list. This will prevent the scenario when the same MonoThreadInfo add its tid to
the joinable_threads list multiple times due to above race condition.

6 years agoMerge pull request #5640 from alexrp/master
Alex Rønne Petersen [Tue, 26 Sep 2017 14:38:51 +0000 (16:38 +0200)]
Merge pull request #5640 from alexrp/master

[profiler] Fix some buffer size calculations.

6 years ago[profiler] Fix some buffer size calculations.
Alex Rønne Petersen [Tue, 26 Sep 2017 11:43:28 +0000 (13:43 +0200)]
[profiler] Fix some buffer size calculations.

6 years ago[Tests] Fail with message in case symlink fails
Ludovic Henry [Mon, 25 Sep 2017 20:38:44 +0000 (16:38 -0400)]
[Tests] Fail with message in case symlink fails

6 years agoMerge pull request #5433 from lateralusX/lateralusX/windows-mono-debugger-soft-hang
Johan Lorensson [Tue, 26 Sep 2017 06:33:40 +0000 (08:33 +0200)]
Merge pull request #5433 from lateralusX/lateralusX/windows-mono-debugger-soft-hang

Fix sporadic hang in Mono.Debugger.Soft test suite on Windows.

6 years ago[w32handle] Only own first handle if doing WaitHandle.WaitAny (#5625)
Ludovic Henry [Tue, 26 Sep 2017 03:05:58 +0000 (23:05 -0400)]
[w32handle] Only own first handle if doing WaitHandle.WaitAny (#5625)

This is the behaviour on .NET, even if it goes against the documentation at https://msdn.microsoft.com/en-us/library/tdykks7z(v=vs.110).aspx#Anchor_2

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

6 years ago[wasm] Disable test due to emcc bug.
Rodrigo Kumpera [Tue, 26 Sep 2017 00:37:52 +0000 (17:37 -0700)]
[wasm] Disable test due to emcc bug.

6 years ago[wasm] Fix test_0_conv_i under interp.
Rodrigo Kumpera [Tue, 26 Sep 2017 00:01:37 +0000 (17:01 -0700)]
[wasm] Fix test_0_conv_i under interp.

6 years ago[mini] Fix bug categories.
Rodrigo Kumpera [Mon, 25 Sep 2017 23:35:05 +0000 (16:35 -0700)]
[mini] Fix bug categories.

6 years ago[wasm] Add ff signature
Rodrigo Kumpera [Mon, 25 Sep 2017 23:33:11 +0000 (16:33 -0700)]
[wasm] Add ff signature

6 years ago[interp] Don't inline empty calls that take vt arguments.
Rodrigo Kumpera [Mon, 25 Sep 2017 23:32:51 +0000 (16:32 -0700)]
[interp] Don't inline empty calls that take vt arguments.

6 years ago[runtime] Handle RuntimeWrappedException and dynamic methods using a SRE as module...
Rodrigo Kumpera [Mon, 25 Sep 2017 22:35:41 +0000 (15:35 -0700)]
[runtime] Handle RuntimeWrappedException and dynamic methods using a SRE as module. Fixes #59334

A DynamicMethod can be placed in a SRE module and it must respect any RuntimeCompatibilityAttribute set on that assembly.

We do that by updating the runtime side list of cattr in the AssemblyBuilder when a RuntimeCompatibilityAttribute is set using SetCustomAttribute.

6 years ago[class] Short circuit collect_implemented_interfaces_aux on gparams
Aleksey Kliger [Wed, 20 Sep 2017 21:34:59 +0000 (17:34 -0400)]
[class] Short circuit collect_implemented_interfaces_aux on gparams

and also setup_interface_offsets.

A gparam is never a real interface so we can just short circuit
if we see a gparam during interface collection.  (A gparam may be instantiated
with an interface --- but ginst interface offsets are processed anew when the
ginst is initialized in mono_class_init, not somehow extracted from the gtd and
the MonoGenericContext).

6 years ago[class] Mark mono_class_from_generic_parameter external only
Aleksey Kliger [Fri, 15 Sep 2017 14:27:44 +0000 (10:27 -0400)]
[class] Mark mono_class_from_generic_parameter external only

Runtime should use mono_class_from_generic_parameter_internal

6 years ago[runtime] Handle RuntimeWrappedException and dynamic methods.
Rodrigo Kumpera [Wed, 13 Sep 2017 23:12:57 +0000 (16:12 -0700)]
[runtime] Handle RuntimeWrappedException and dynamic methods.

Introduce MonoDynamicMethod that holds the assembly of a DM (and TB).
Use it to determine the RuntimeWrappedException policy for exceptions.

This is needed cuz the assembly of a MonoMethod is normally found using method->parent->image->assembly.

But this doesn't work with DynamicMethods that don't define an owner type as they are forced to corlib's policy.

The default policy for DM's is to not wrap those exceptions and in the case a Module is provided, the policy of that module must be respected.

This commit handles all cases but when a Module is a SRE module.

6 years ago[profiler] Add dedicated coverage profiler (#5622)
Ludovic Henry [Mon, 25 Sep 2017 16:27:47 +0000 (12:27 -0400)]
[profiler] Add dedicated coverage profiler (#5622)

This is to remove the need to depend on the log profiler and mprof-report to generate code coverage reports

6 years ago[ppc64] add instructions needed for builtin types
Bernhard Urban [Mon, 25 Sep 2017 11:32:52 +0000 (11:32 +0000)]
[ppc64] add instructions needed for builtin types

6 years ago[ppc] add native type support for float
Bernhard Urban [Wed, 20 Sep 2017 09:55:47 +0000 (11:55 +0200)]
[ppc] add native type support for float

6 years ago[ppc] add native type support for integer
Bernhard Urban [Wed, 20 Sep 2017 09:55:34 +0000 (11:55 +0200)]
[ppc] add native type support for integer

6 years agoAdd test projects (optional) to net_4_x.sln (#5633)
Egor Bogatov [Mon, 25 Sep 2017 14:02:36 +0000 (17:02 +0300)]
Add test projects (optional) to net_4_x.sln (#5633)

* add tests to net_4_x.sln

* remove redundant string.Format

6 years agoUpdated with review feedback.
lateralusX [Tue, 19 Sep 2017 15:17:23 +0000 (17:17 +0200)]
Updated with review feedback.