mono.git
6 years agoMerge pull request #5002 from BrzVlad/feature-sgen-modes
Vlad Brezae [Tue, 13 Jun 2017 11:14:47 +0000 (14:14 +0300)]
Merge pull request #5002 from BrzVlad/feature-sgen-modes

[sgen] SGen modes

6 years agoMerge pull request #5021 from BrzVlad/fix-parallel-fixes
Vlad Brezae [Tue, 13 Jun 2017 11:07:29 +0000 (14:07 +0300)]
Merge pull request #5021 from BrzVlad/fix-parallel-fixes

[sgen] Fix parallel fixes

6 years ago[packaging] Simplify Windows packaging scripts
Alexander Köplinger [Mon, 12 Jun 2017 20:44:55 +0000 (22:44 +0200)]
[packaging] Simplify Windows packaging scripts

We don't need to build in a separate checkout of mono anymore.
Also use .pkg passed in from upstream build.

6 years ago[packaging] Move Windows MSI scripts into repository
Alexander Köplinger [Sat, 10 Jun 2017 00:34:30 +0000 (02:34 +0200)]
[packaging] Move Windows MSI scripts into repository

They lived in https://github.com/mono/release before, moving them
into the main repo allows us to version them more easily.

Note: I intend to do more cleanup on those scripts in the future,
this is just the first step.

6 years ago[man] Add entries for sgen modes and new major/minor types
Vlad Brezae [Thu, 8 Jun 2017 23:22:59 +0000 (02:22 +0300)]
[man] Add entries for sgen modes and new major/minor types

6 years ago[sgen] Add sgen modes
Vlad Brezae [Mon, 1 May 2017 20:56:34 +0000 (23:56 +0300)]
[sgen] Add sgen modes

Group gc params configurations into general gc modes. The default mode (SGEN_MODE_NONE) is what we've been using so far, meaning old default features. The other modes can include experimental features.

6 years ago[build] Bumps mcs bootstrap requirement
Marek Safar [Mon, 12 Jun 2017 16:56:10 +0000 (18:56 +0200)]
[build] Bumps mcs bootstrap requirement

6 years ago[msvc] Update csproj files (#4898)
monojenkins [Mon, 12 Jun 2017 20:55:04 +0000 (21:55 +0100)]
[msvc] Update csproj files (#4898)

6 years agoMerge pull request #4967 from kumpera/profiler-arg-cleanup
Rodrigo Kumpera [Mon, 12 Jun 2017 17:07:24 +0000 (10:07 -0700)]
Merge pull request #4967 from kumpera/profiler-arg-cleanup

Rework profiler argument handling.

6 years agoBump corefx
Marek Safar [Mon, 12 Jun 2017 13:58:03 +0000 (15:58 +0200)]
Bump corefx

6 years agoFix OpenMappedWebConfiguration throws: System.IndexOutOfRangeException, when using...
Pablo Ruiz García [Sun, 11 Jun 2017 23:55:26 +0000 (01:55 +0200)]
Fix OpenMappedWebConfiguration throws: System.IndexOutOfRangeException, when using RazorGenerator under mono (#5013)

6 years agoFix System.Numerics xunit tests and add them to CI (#5006)
Alexander Köplinger [Sun, 11 Jun 2017 23:44:50 +0000 (01:44 +0200)]
Fix System.Numerics xunit tests and add them to CI (#5006)

* Fix System.Numerics xunit tests and add them to CI

Xunit.Extensions.NetCore.dll is available as a net46 version now
so we can just use it instead of building it from our buildtools fork.
This also allows us to remove the fork from our submodules.

We were missing running the System.Numerics xunit tests in CI,
this adds them so we catch breaks like these earlier.

* Skip tests on Windows, they seem to fail there

6 years ago[mcs] C#7 type pattern matching
Marek Safar [Sun, 11 Jun 2017 07:51:44 +0000 (09:51 +0200)]
[mcs] C#7 type pattern matching

6 years ago[sdb] Fix passing of nullable parameters in invokes. Fixes #57160. (#5012)
Zoltan Varga [Sat, 10 Jun 2017 03:53:39 +0000 (23:53 -0400)]
[sdb] Fix passing of nullable parameters in invokes. Fixes #57160. (#5012)

6 years ago[sgen] Avoid using parallel minors for small nurseries
Vlad Brezae [Fri, 9 Jun 2017 22:50:20 +0000 (01:50 +0300)]
[sgen] Avoid using parallel minors for small nurseries

It is not effective and it can lead to regressions, due to the added synchronizations and work splitting.

6 years ago[sgen] Disable parallel mode if not enough cores
Vlad Brezae [Fri, 9 Jun 2017 22:43:04 +0000 (01:43 +0300)]
[sgen] Disable parallel mode if not enough cores

6 years ago[sgen] Use logical cpu count for number of workers
Vlad Brezae [Fri, 9 Jun 2017 22:33:09 +0000 (01:33 +0300)]
[sgen] Use logical cpu count for number of workers

It actually leads to better performance. The downside is the creation of more sgen workers. This is currently capped at 8.

6 years agoRemove the mono-profiler- prefix from all source files in the profiler subdir.
Rodrigo Kumpera [Fri, 9 Jun 2017 20:24:20 +0000 (13:24 -0700)]
Remove the mono-profiler- prefix from all source files in the profiler subdir.

Additionally, rename arg-parsing.c to log-args.c so it's clear it's part of the log profiler.

6 years ago[profiler]Use g_warning and remove bad usage() line
Rodrigo Kumpera [Fri, 9 Jun 2017 20:04:22 +0000 (13:04 -0700)]
[profiler]Use g_warning and remove bad usage() line

6 years agoMerge pull request #4998 from kumpera/fix_56684
Rodrigo Kumpera [Fri, 9 Jun 2017 18:44:43 +0000 (14:44 -0400)]
Merge pull request #4998 from kumpera/fix_56684

[corlib] Don't pass RuntimeMethodHandle across domains. Fixes #56684

6 years agoMerge pull request #4997 from lambdageek/bug-57222
Aleksey Kliger (λgeek) [Fri, 9 Jun 2017 17:40:28 +0000 (13:40 -0400)]
Merge pull request #4997 from lambdageek/bug-57222

[sre] FieldBuilder:RuntimeResolve shouldn't lookup by name (Fixes #57222)

6 years agoBump corefx
Marek Safar [Fri, 9 Jun 2017 11:54:24 +0000 (13:54 +0200)]
Bump corefx

6 years ago[marshal] allocate dummy string always in root domain
Bernhard Urban [Wed, 7 Jun 2017 16:28:32 +0000 (18:28 +0200)]
[marshal] allocate dummy string always in root domain

otherwise it can happen that the dummy string is allocated in a
different domain, and when it's onloaded the GC root points to an
invalid object.

6 years agoBunch of minor fixes.
Rodrigo Kumpera [Thu, 8 Jun 2017 22:40:40 +0000 (15:40 -0700)]
Bunch of minor fixes.

6 years agoRemove env var.
Rodrigo Kumpera [Thu, 8 Jun 2017 22:37:43 +0000 (15:37 -0700)]
Remove env var.

6 years agoupdate usage, print warning on output:-FILENAME and add a TODO.
Rodrigo Kumpera [Thu, 8 Jun 2017 22:36:06 +0000 (15:36 -0700)]
update usage, print warning on output:-FILENAME and add a TODO.

6 years agoRemove spurious header. Change from enum to bucket of defines.
Rodrigo Kumpera [Thu, 8 Jun 2017 22:21:45 +0000 (15:21 -0700)]
Remove spurious header. Change from enum to bucket of defines.

6 years ago[test] Test SRE of a class with two methods with the same name.
Aleksey Kliger [Thu, 8 Jun 2017 21:44:54 +0000 (17:44 -0400)]
[test] Test SRE of a class with two methods with the same name.

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

Although methods aren't affected by this bug, I added a regression test for
this case anyway in case the implementation changes.

Currently MethodBuilder.RuntimeResolve() goes through a different codepath - it
calls RuntimeType.GetMethod (MethodInfo) which calls into an icall which looks
for a method with a matching token rather than a matching name.

6 years ago[corlib] Don't pass RuntimeMethodHandle across domains. Fixes #56684
Rodrigo Kumpera [Thu, 8 Jun 2017 21:10:38 +0000 (14:10 -0700)]
[corlib] Don't pass RuntimeMethodHandle across domains. Fixes #56684

We can't pass RuntimeMethodHandle across AppDomains since that can lead to memory corruption.

The way this happens is that when Domain (A) passes a method handle (M) to Domain (B), (B) will get the reflection object for
which will add that MonoMethod to the per-domain reflection hashtable. This won't cause the assembly of (M) to be registered with (B).

When (A) is unloaded, it might be the only domain referencing the assembly of (M), cause it to unload resulting in (B) having a dangling
pointer to (M) on its reflection hashtable.

The fix is to serialize enough lookup data across the wire so we can do type/method lookup using reflection on the target domain.
It might be slower, but this only happens on some remoting slowpaths anyways.

Finally, we can't simply register the assembly of (M) into domain (B) as that list (MonoDomain::domain_assemblies) is used for type loading,
thus breaking the target domain in some scenarios.

6 years ago[sre] FieldBuilder:RuntimeResolve shouldn't lookup by name. (Fixes #57222)
Aleksey Kliger [Thu, 8 Jun 2017 19:56:30 +0000 (15:56 -0400)]
[sre] FieldBuilder:RuntimeResolve shouldn't lookup by name. (Fixes #57222)

RuntimeType:GetField (FieldInfo) looks up the field by name and attributes,
which doesn't work for SRE because it is legal to create multiple fields with
the same name and type and attributes.  So lookup using the
RuntimeFieldHandle (aka MonoClassField*) instead.

6 years ago[test] Test SRE of a class with two fields with same name
Aleksey Kliger [Thu, 8 Jun 2017 20:11:14 +0000 (16:11 -0400)]
[test] Test SRE of a class with two fields with same name

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

6 years agoMerge pull request #4995 from lambdageek/dev-monodis-show-field-tokens
Aleksey Kliger (λgeek) [Thu, 8 Jun 2017 19:54:04 +0000 (15:54 -0400)]
Merge pull request #4995 from lambdageek/dev-monodis-show-field-tokens

[monodis] Document --show-tokens and show field tokens

6 years ago[amd64] Fix a check in mono_emit_stack_alloc (). (#4985)
Zoltan Varga [Thu, 8 Jun 2017 19:47:27 +0000 (15:47 -0400)]
[amd64] Fix a check in mono_emit_stack_alloc (). (#4985)

6 years ago[monodis] Show field tokens in --show-tokens mode
Aleksey Kliger [Thu, 8 Jun 2017 15:38:31 +0000 (11:38 -0400)]
[monodis] Show field tokens in --show-tokens mode

6 years ago[monodis] Print table name (when valid) in --show-tokens mode
Aleksey Kliger [Thu, 8 Jun 2017 15:37:57 +0000 (11:37 -0400)]
[monodis] Print table name (when valid) in --show-tokens mode

6 years ago[monodis] Document --show-tokens
Aleksey Kliger [Thu, 8 Jun 2017 15:36:45 +0000 (11:36 -0400)]
[monodis] Document --show-tokens

6 years agoMerge pull request #4994 from lewurm/interp-aot-mode-fix-windows
Niklas Therning [Thu, 8 Jun 2017 12:48:10 +0000 (14:48 +0200)]
Merge pull request #4994 from lewurm/interp-aot-mode-fix-windows

[win] set HAVE_ONLINE_VES

6 years ago[win] set HAVE_ONLINE_VES
Bernhard Urban [Thu, 8 Jun 2017 09:50:19 +0000 (11:50 +0200)]
[win] set HAVE_ONLINE_VES

6 years ago[interp] disable bug-45841-fpstack-exceptions.exe on CI
Bernhard Urban [Thu, 8 Jun 2017 07:02:14 +0000 (09:02 +0200)]
[interp] disable bug-45841-fpstack-exceptions.exe on CI

6 years ago[interp] provide stub for icall_trampoline for x86 and ppc
Bernhard Urban [Wed, 7 Jun 2017 21:54:55 +0000 (23:54 +0200)]
[interp] provide stub for icall_trampoline for x86 and ppc

keep the linker happy

6 years ago[interp] root domain must be used for AOT'd wrappers used by interpreter
Bernhard Urban [Wed, 7 Jun 2017 16:24:17 +0000 (18:24 +0200)]
[interp] root domain must be used for AOT'd wrappers used by interpreter

6 years ago[interp aot] documentation
Bernhard Urban [Wed, 7 Jun 2017 16:24:17 +0000 (18:24 +0200)]
[interp aot] documentation

6 years ago[marshal] some things are required in the interpreter despite DISABLE_JIT
Bernhard Urban [Wed, 7 Jun 2017 16:24:17 +0000 (18:24 +0200)]
[marshal] some things are required in the interpreter despite DISABLE_JIT

6 years ago[configure] introduce HAVE_ONLINE_VES
Bernhard Urban [Wed, 7 Jun 2017 16:24:16 +0000 (18:24 +0200)]
[configure] introduce HAVE_ONLINE_VES

6 years ago[interp] fix when DISABLE_JIT is set
Bernhard Urban [Wed, 7 Jun 2017 16:24:16 +0000 (18:24 +0200)]
[interp] fix when DISABLE_JIT is set

6 years ago[interp] add InterpMethodArguments struct to offset-tool
Bernhard Urban [Wed, 7 Jun 2017 16:24:15 +0000 (18:24 +0200)]
[interp] add InterpMethodArguments struct to offset-tool

6 years ago[interp] add MONO_AOT_MODE_INTERP
Bernhard Urban [Wed, 7 Jun 2017 16:24:15 +0000 (18:24 +0200)]
[interp] add MONO_AOT_MODE_INTERP

6 years ago[interp] add --aot=interp, so we can run `mono --full-aot --interpreter`
Bernhard Urban [Wed, 7 Jun 2017 16:24:14 +0000 (18:24 +0200)]
[interp] add --aot=interp, so we can run `mono --full-aot --interpreter`

6 years ago[tests] Re-enable bug-45841-fpstack-exceptions.exe (#4927)
vkargov [Wed, 7 Jun 2017 21:02:21 +0000 (14:02 -0700)]
[tests] Re-enable bug-45841-fpstack-exceptions.exe (#4927)

* [tests] Re-enable bug-45841-fpstack-exceptions.exe

* [tests] Pass correct parameters in bug-45841.

6 years ago[mcs] Better detection of null operator inside conditional expression. Fixes #57232
Marek Safar [Wed, 7 Jun 2017 16:00:00 +0000 (18:00 +0200)]
[mcs] Better detection of null operator inside conditional expression. Fixes #57232

6 years agoCosmetic; remove [Category ("Martin")] from the test.
Martin Baulig [Wed, 7 Jun 2017 15:54:25 +0000 (11:54 -0400)]
Cosmetic; remove [Category ("Martin")] from the test.

6 years ago[System]: Fix possible initialization issue in MonoTlsProviderFactory. (#4987)
Martin Baulig [Wed, 7 Jun 2017 15:46:21 +0000 (11:46 -0400)]
[System]: Fix possible initialization issue in MonoTlsProviderFactory. (#4987)

* [Mono.Security]: Add test for MonoTlsProviderFactory.GetProvider ().

* [System]: Fix possible initialization issue in MonoTlsProviderFactory.

6 years ago[System]: Actually disable the keychain code and SecItemImport() on XI. (#4983)
Martin Baulig [Wed, 7 Jun 2017 15:27:05 +0000 (11:27 -0400)]
[System]: Actually disable the keychain code and SecItemImport() on XI. (#4983)

6 years ago[mcs] C#7 out variable declaration
Marek Safar [Wed, 7 Jun 2017 12:13:52 +0000 (14:13 +0200)]
[mcs] C#7 out variable declaration

6 years ago[MacSDK] Bump libgdiplus to latest (#4984)
Alexander Köplinger [Wed, 7 Jun 2017 12:08:27 +0000 (14:08 +0200)]
[MacSDK] Bump libgdiplus to latest (#4984)

We were using a very old commit of libgdiplus. This brings in
the latest changes.

6 years ago[interp] factor out everything that allocates a MonoLMFExt on the stack in order...
Bernhard Urban [Tue, 6 Jun 2017 14:36:34 +0000 (16:36 +0200)]
[interp] factor out everything that allocates a MonoLMFExt on the stack in order to reduce stack pressure in the main interpreter loop

6 years ago[interp] factor out MINT_JIT_CALL instruction from interpreter switch in order to...
Bernhard Urban [Tue, 6 Jun 2017 14:36:34 +0000 (16:36 +0200)]
[interp] factor out MINT_JIT_CALL instruction from interpreter switch in order to reduce stack pressure

6 years ago[sgen] Make sure workers process jobs only if they are running (#4974)
Vlad Brezae [Wed, 7 Jun 2017 09:58:54 +0000 (12:58 +0300)]
[sgen] Make sure workers process jobs only if they are running (#4974)

This simplifies logic and prevents serial context being used by multiple workers at the same time.

6 years agoSystem.Drawing: Start consuming sources from corefx
Frederik Carlier [Tue, 6 Jun 2017 17:25:02 +0000 (19:25 +0200)]
System.Drawing: Start consuming sources from corefx

Closes https://github.com/mono/mono/pull/4980

6 years ago[MacSDK] Update version number in msbuild.py
Alexander Köplinger [Tue, 6 Jun 2017 21:01:00 +0000 (23:01 +0200)]
[MacSDK] Update version number in msbuild.py

6 years ago[mini] set MONO_ARCH_HAVE_INIT_LMF_EXT on architectures that implement mono_arch_init...
Bernhard Urban [Tue, 6 Jun 2017 17:53:16 +0000 (19:53 +0200)]
[mini] set MONO_ARCH_HAVE_INIT_LMF_EXT on architectures that implement mono_arch_init_lmf_ext

it worked before, because we relied on implicit linking

6 years ago[mini] guard mono_arch_init_lmf_ext prototype properly
Bernhard Urban [Tue, 6 Jun 2017 16:47:08 +0000 (18:47 +0200)]
[mini] guard mono_arch_init_lmf_ext prototype properly

6 years ago[arm] don't set MONO_ARCH_SOFT_DEBUG_SUPPORTED on android cross compiling
Bernhard Urban [Tue, 6 Jun 2017 16:45:59 +0000 (18:45 +0200)]
[arm] don't set MONO_ARCH_SOFT_DEBUG_SUPPORTED on android cross compiling

follow up fix for https://github.com/mono/mono/pull/4956

this breaks the cross compiler on windows for android:

```
  [9:07:36]                       /bin/sh ../../libtool  --tag=CC   --mode=compile /Users/builder/android-toolchain/mxe/bin/i686-w64-mingw32.static-gcc -DHAVE_CONFIG_H -I. -I/U  sers/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini -I../..   -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -  DWIN32_THREADS -DFD_SETSIZE=1024 -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno  -cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -Wno-format-zero-length -D__ARM_EABI__ -DARM_FPU_VFP=1 -DNO_UNALIGNED_ACCESS -I/User  s/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono -I/Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/eglib/src -I../../eglib  /src -I/Users/builder/data/lanes/5000/ff452183/source/xamarin-android/build-tools/mono-runtimes/obj/Release//llvm/installed-win32/usr/include -DNDEBUG -D__NO_CTYPE_INLINE -D_  GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DLLVM_API_VERSION=4 -O -I../arch/arm -fvisibility=hidden -DXAMARIN_PRODUCT_VERSION=0 -static   -static-libgcc -std=gnu99 -fno-strict-aliasing -fwrapv -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-  prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -Wno-format-ze  ro-length -mno-tls-direct-seg-refs -Werror-implicit-function-declaration -MT libmini_la-mini-arm-gsharedvt.lo -MD -MP -MF .deps/libmini_la-mini-arm-gsharedvt.Tpo -c -o libmin  i_la-mini-arm-gsharedvt.lo `test -f 'mini-arm-gsharedvt.c' || echo '/Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/'`mini-arm-gsharedv  t.c
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c: In function 'mono_arch_is_single_step_event  ':
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7242:2: error: unknown type name 'siginfo_t'
  [9:07:36]                         siginfo_t *sinfo = info;
  [9:07:36]                         ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7248:11: error: request for member 'si_addr'   in something not a structure or union
  [9:07:36]                         if (sinfo->si_addr >= ss_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)ss_trigger_page + 128)
  [9:07:36]                                  ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7248:57: error: request for member 'si_addr'   in something not a structure or union
  [9:07:36]                         if (sinfo->si_addr >= ss_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)ss_trigger_page + 128)
  [9:07:36]                                                                                ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c: In function 'mono_arch_is_breakpoint_event'  :
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7262:2: error: unknown type name 'siginfo_t'
  [9:07:36]                         siginfo_t *sinfo = info;
  [9:07:36]                         ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7267:11: error: request for member 'si_signo  ' in something not a structure or union
  [9:07:36]                         if (sinfo->si_signo == DBG_SIGNAL) {
  [9:07:36]                                  ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7269:12: error: request for member 'si_addr'   in something not a structure or union
  [9:07:36]                          if (sinfo->si_addr >= bp_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)bp_trigger_page + 128)
  [9:07:36]                                   ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7269:58: error: request for member 'si_addr'   in something not a structure or union
  [9:07:36]                          if (sinfo->si_addr >= bp_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)bp_trigger_page + 128)
```

6 years agoBump API snapshot
Alexander Köplinger [Tue, 6 Jun 2017 16:36:50 +0000 (18:36 +0200)]
Bump API snapshot

6 years ago[System]: Correctly implement close and shutdown in SslStream. (#4969)
Martin Baulig [Tue, 6 Jun 2017 15:46:29 +0000 (11:46 -0400)]
[System]: Correctly implement close and shutdown in SslStream. (#4969)

* [System]: Correctly implement close and shutdown in SslStream.

* Cleanup.

* Cosmetic.

* More ReferenceSources/SR2.cs into common.sources to make it build.

6 years agoUse correct path separator for satellite assemblies in cross builds (#4976)
Marek Habersack [Tue, 6 Jun 2017 14:06:00 +0000 (16:06 +0200)]
Use correct path separator for satellite assemblies in cross builds (#4976)

When creating a bundle on Windows to run on Android, macOS/iOS or Linux we need
to use the target system's path separator when storing satellite assemblies in
the bundle instead of the host system's one. Failing to do so will embed (on
Windows) the satellite assemblies with paths like

   fr_FR\myassembly.resources.dll

while at runtime Mono will try to look up the assembly by

   fr_FR/myassembly.resources.dll

and fail to find it, obviously. The `--style` parameter is now consulted to see
what path separator character should be used.

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

6 years agoBump corefx
Marek Safar [Tue, 6 Jun 2017 11:07:20 +0000 (13:07 +0200)]
Bump corefx

6 years ago[man] Remove mention of MONO_AOT_CACHE from mono.1
Alexander Köplinger [Tue, 6 Jun 2017 13:43:02 +0000 (15:43 +0200)]
[man] Remove mention of MONO_AOT_CACHE from mono.1

The env var was removed a long time ago in b8766a812d64d819948e1b7c6482a6ac80d3b4eb
and was replaced by options to --aot. This came up in Gitter today.

6 years agoimplement Image.SetPropertyItem() method v4 (#1167)
ralovich [Mon, 5 Jun 2017 23:43:41 +0000 (19:43 -0400)]
implement Image.SetPropertyItem() method v4 (#1167)

This is thought to be fixing https://bugzilla.novell.com/show_bug.cgi?id=406307.

v4: state that my changes are licensed under MIT X11 license

6 years ago[w32handle] Fix deadlock on SignalAndWait (#4973)
Ludovic Henry [Mon, 5 Jun 2017 22:07:40 +0000 (18:07 -0400)]
[w32handle] Fix deadlock on SignalAndWait (#4973)

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

6 years agoMerge pull request #4962 from lambdageek/dev-handles-sockets
Aleksey Kliger (λgeek) [Mon, 5 Jun 2017 21:50:30 +0000 (17:50 -0400)]
Merge pull request #4962 from lambdageek/dev-handles-sockets

[w32socket] Use coop handles for many Socket icalls

6 years ago[w32socket] Use coop handles for System.Net.Sockets.Socket.cancel_blocking_socket_ope...
Aleksey Kliger [Fri, 2 Jun 2017 19:16:31 +0000 (15:16 -0400)]
[w32socket] Use coop handles for System.Net.Sockets.Socket.cancel_blocking_socket_operation

6 years ago[coop handles] Add mono_internal_thread_handle_ptr () function
Aleksey Kliger [Fri, 2 Jun 2017 20:11:42 +0000 (16:11 -0400)]
[coop handles] Add mono_internal_thread_handle_ptr () function

MonoInternalThreadHandle is not really needed - all MonoInternalThread
instances are supposed to be pinned.  But for uniformity, the icall marshaller
makes handles anyway.  This function lets us get back to a raw ptr.

6 years ago[runtime] typedef MonoThread MonoThreadObject
Aleksey Kliger [Fri, 2 Jun 2017 19:03:38 +0000 (15:03 -0400)]
[runtime] typedef MonoThread MonoThreadObject

MonoThreadHandle is already taken.  So define MonoThreadObject as an alias for
MonoThread and then make MonoThreadObjectHandle the coop handle type.

6 years ago[w32socket] Use coop handles for icalls in System.Net.Sockets.Socket
Aleksey Kliger [Tue, 30 May 2017 19:58:51 +0000 (15:58 -0400)]
[w32socket] Use coop handles for icalls in System.Net.Sockets.Socket

- Use coop handles for create_object_from_sockaddr

  Eventually want to rewrite its callers to use
  create_object_handle_from_sockaddr directly.

- Use coop handles for

  - LocalEndPoint_internal

  - RemoteEndPoint_internal

- inside create_sockaddr_from_object

  Eventually callers should be updated to use create_sockaddr_form_handle
  directly.

- Use coop handles for

  - ReceiveFrom_internal

  - Bind_internal

  - Connect_internal

  - SendTo_internal

- Remove dead code (create_object_from_sockaddr, create_sockaddr_from_object)

- Use coop handles for

  - Receive_internal WSABUF[]

  - Receive_internal byte[]

  - Send_internal

  - Send_array_internal

  - SetSocketOption_internal

  - GetSocketOption_arr_internal

  - GetSocketOption_obj_internal

  - IOControl_internal

  - SendFile_internal

- Remove more dead code

- Use coop handles for

  - Socket_internal

  - Select_internal

- Trivial coop handles conversion for several icalls in System.Net.Sockets.Socket

  None of these functions use managed objects, so just add a MonoError* argument.

6 years ago[coop handles] Define MonoSafeHandleHandle
Aleksey Kliger [Thu, 1 Jun 2017 17:21:57 +0000 (13:21 -0400)]
[coop handles] Define MonoSafeHandleHandle

Used to access System.Net.Sockets.SafeSocketHandle from native code

6 years ago[coop handles] Macros to access a handle via a MonoClassField
Aleksey Kliger [Wed, 31 May 2017 20:02:53 +0000 (16:02 -0400)]
[coop handles] Macros to access a handle via a MonoClassField

6 years ago[marshal] Wrap byref reference args to icalls in coop handles correctly.
Aleksey Kliger [Wed, 31 May 2017 14:30:09 +0000 (10:30 -0400)]
[marshal] Wrap byref reference args to icalls in coop handles correctly.

Previously we only had "out" reference args working - they get a handle that's
initialized to NULL on entry and then writes back to the out arg on icall
return.

For "ref" reference args, do the same thing but initialize to the initial
argument value.

6 years ago[mcs] Remove unwanted tests
Marek Safar [Mon, 5 Jun 2017 18:53:24 +0000 (20:53 +0200)]
[mcs] Remove unwanted tests

6 years agoBump to 5.5 for master branch
Ludovic Henry [Mon, 5 Jun 2017 15:29:28 +0000 (11:29 -0400)]
Bump to 5.5 for master branch

6 years agoRevert "[marshal] delay dummy string allocation"
Alexander Köplinger [Mon, 5 Jun 2017 14:34:24 +0000 (16:34 +0200)]
Revert "[marshal] delay dummy string allocation"

Reverts 5e23a773b4b41163d4a0834e5f1c79305b903795

It seems to cause a crash during msbuild tests:

```
  xunit -> Microsoft.Build.Engine.UnitTests...
  Stacktrace:

  Native stacktrace:

   0   mono                                0x0017cad4 mono_handle_native_crash + 308
   1   mono                                0x001e2b03 sigabrt_signal_handler + 147
   2   libsystem_platform.dylib            0x920a8deb _sigtramp + 43
   3   ???                                 0xffffffff 0x0 + 4294967295
   4   libsystem_c.dylib                   0x940bb27c abort + 155
   5   mono                                0x0036886d mono_log_write_logfile + 381
   6   mono                                0x003630d2 structured_log_adapter + 50
   7   mono                                0x00380d1b monoeg_assertion_message + 107
   8   mono                                0x0033863d major_scan_object_with_evacuation + 3373
   9   mono                                0x0033b3d0 drain_gray_stack + 6608
   10  mono                                0x0032df57 finish_gray_stack + 151
   11  mono                                0x0032d3c6 major_finish_collection + 118
   12  mono                                0x00329909 major_do_collection + 169
   13  mono                                0x003288bd sgen_perform_collection + 605
   14  mono                                0x0032a90b sgen_gc_collect + 75
   15  mono                                0x002d5c4d unload_thread_main + 861
   16  mono                                0x002abb6b start_wrapper + 795
   17  libsystem_pthread.dylib             0x9ae6d5fb _pthread_body + 144
   18  libsystem_pthread.dylib             0x9ae6d485 _pthread_struct_init + 0
   19  libsystem_pthread.dylib             0x9ae72cf2 thread_start + 34

  Debug info from gdb:

  (lldb) command source -s 0 '/tmp/mono-gdb-commands.2tso9f'
  Executing commands in '/tmp/mono-gdb-commands.2tso9f'.
  (lldb) process attach --pid 2037
  2017-06-02 13:07:23.000 lldb[2093:282f] Metadata.framework [Error]: couldn't get the client port
  Process 2037 stopped
  * thread #1, name = 'tid_507', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
  libsystem_kernel.dylib`__psynch_cvwait:
  ->  0x923cc7ca <+10>: jae    0x923cc7da                ; <+26>
      0x923cc7cc <+12>: calll  0x923cc7d1                ; <+17>
      0x923cc7d1 <+17>: popl   %edx
      0x923cc7d2 <+18>: movl   0xe0b084f(%edx), %edx

  Executable module set to "/Users/builder/data/lanes/2716/mono-mac-sdk/external/bockbuild/stage/bin/mono".
  Architecture set to: i386-apple-macosx.
  (lldb) thread list
  Process 2037 stopped
  * thread #1: tid = 0x530e96a, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'tid_507', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    thread #2: tid = 0x530e96b, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
    thread #3: tid = 0x530e96c, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
    thread #4: tid = 0x530e96d, 0x923c7fb6 libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
    thread #5: tid = 0x530e96e, 0x923cd992 libsystem_kernel.dylib`kevent64 + 10, queue = 'com.apple.libdispatch-manager'
    thread #6: tid = 0x530ea26, 0x923ccace libsystem_kernel.dylib`__select + 10, name = 'tid_5a03'
    thread #7: tid = 0x530edf1, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'tid_4007'
    thread #8: tid = 0x530edf2, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    thread #9: tid = 0x530edf3, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    thread #10: tid = 0x530edf4, 0x923ccff2 libsystem_kernel.dylib`__wait4 + 10, name = 'Domain unloader'
  (lldb) thread backtrace all
  * thread #1, name = 'tid_507', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    * frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71bd9 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
      frame #3: 0x00361ea9 mono`mono_os_event_wait_multiple + 505
      frame #4: 0x00361ca5 mono`mono_os_event_wait_one + 53
      frame #5: 0x00376b49 mono`mono_thread_info_wait_one_handle + 41
      frame #6: 0x002d51b5 mono`mono_domain_try_unload + 485
      frame #7: 0x002d4f6a mono`ves_icall_System_AppDomain_InternalUnload + 90
      frame #8: 0x05bf9ee0
      frame #9: 0x018ce01d mscorlib.dll.dylib`System_AppDomain_Unload_System_AppDomain + 45
      frame #10: 0x05bf9d60
      frame #11: 0x05bf9ccc
      frame #12: 0x05bf9d04
      frame #13: 0x05bf9c90
      frame #14: 0x05bf996d
      frame #15: 0x02e7d171
      frame #16: 0x005c26d4
      frame #17: 0x005b6878
      frame #18: 0x005b6b7a
      frame #19: 0x000c38a8 mono`mono_jit_runtime_invoke + 1592
      frame #20: 0x002e43fe mono`do_runtime_invoke + 94
      frame #21: 0x002e7de3 mono`do_exec_main_checked + 147
      frame #22: 0x002e69a5 mono`mono_runtime_run_main_checked + 69
      frame #23: 0x0013b687 mono`mono_jit_exec + 311
      frame #24: 0x0013e2b2 mono`mono_main + 10114
      frame #25: 0x000b22db mono`main + 2011
      frame #26: 0x000b1af5 mono`start + 53
    thread #2, name = 'SGen worker'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71bd9 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
      frame #3: 0x0035f0e9 mono`thread_func + 249
      frame #4: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #5: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #6: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #3, name = 'SGen worker'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71bd9 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
      frame #3: 0x0035f0e9 mono`thread_func + 249
      frame #4: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #5: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #6: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #4, name = 'Finalizer'
      frame #0: 0x923c7fb6 libsystem_kernel.dylib`semaphore_wait_trap + 10
      frame #1: 0x002dbeb6 mono`finalizer_thread + 278
      frame #2: 0x002abb6b mono`start_wrapper + 795
      frame #3: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #4: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #5: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #5, queue = 'com.apple.libdispatch-manager'
      frame #0: 0x923cd992 libsystem_kernel.dylib`kevent64 + 10
      frame #1: 0x91b5c899 libdispatch.dylib`_dispatch_mgr_invoke + 238
      frame #2: 0x91b5c532 libdispatch.dylib`_dispatch_mgr_thread + 52
    thread #6, name = 'tid_5a03'
      frame #0: 0x923ccace libsystem_kernel.dylib`__select + 10
      frame #1: 0x0036df29 mono`mono_poll + 409
      frame #2: 0x002b482f mono`poll_event_wait + 111
      frame #3: 0x002b345f mono`selector_thread + 1439
      frame #4: 0x002abb6b mono`start_wrapper + 795
      frame #5: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #6: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #7: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #7, name = 'tid_4007'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71c25 libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
      frame #3: 0x003760f3 mono`mono_thread_info_sleep + 979
      frame #4: 0x002b1a86 mono`monitor_thread + 262
      frame #5: 0x002abb6b mono`start_wrapper + 795
      frame #6: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #7: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #8: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #8, name = 'Threadpool worker'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71c25 libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
      frame #3: 0x002b12e0 mono`worker_thread + 1024
      frame #4: 0x002abb6b mono`start_wrapper + 795
      frame #5: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #6: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #7: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #9, name = 'Threadpool worker'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71c25 libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
      frame #3: 0x002b12e0 mono`worker_thread + 1024
      frame #4: 0x002abb6b mono`start_wrapper + 795
      frame #5: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #6: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #7: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #10, name = 'Domain unloader'
      frame #0: 0x923ccff2 libsystem_kernel.dylib`__wait4 + 10
      frame #1: 0x940d9ea5 libsystem_c.dylib`waitpid$UNIX2003 + 48
      frame #2: 0x0017cba7 mono`mono_handle_native_crash + 519
      frame #3: 0x001e2b03 mono`sigabrt_signal_handler + 147
      frame #4: 0x920a8deb libsystem_platform.dylib`_sigtramp + 43
  (lldb) detach
  Process 2037 detached
  (lldb) quit

  =================================================================
  Got a SIGABRT while executing native code. This usually indicates
  a fatal error in the mono runtime or one of the native libraries
  used by your application.
  =================================================================
```

6 years ago[mcs] Throw expression cannot be placed after any colon.
Marek Safar [Mon, 5 Jun 2017 13:27:28 +0000 (15:27 +0200)]
[mcs] Throw expression cannot be placed after any colon.

6 years ago[mcs] C#7 throw expression
Marek Safar [Mon, 5 Jun 2017 10:19:08 +0000 (12:19 +0200)]
[mcs] C#7 throw expression

6 years agoBump bockbuild to bring in 64bit fix
Alexander Köplinger [Sun, 4 Jun 2017 17:27:10 +0000 (19:27 +0200)]
Bump bockbuild to bring in 64bit fix

6 years ago[profiler] Another atempt at fixing linux.
Rodrigo Kumpera [Sun, 4 Jun 2017 17:01:52 +0000 (10:01 -0700)]
[profiler] Another atempt at fixing linux.

6 years agoRevert "[sdb] Add an API to make the contents of the 'State Machine Hoisted Local...
Zoltan Varga [Fri, 2 Jun 2017 17:52:50 +0000 (13:52 -0400)]
Revert "[sdb] Add an API to make the contents of the 'State Machine Hoisted Local Scopes' table in ppdb files available in sdb. (#4961)" (#4970)

This reverts commit 010fce60af693fdb80c814b94825a1ca9b9bac1e.

6 years ago[sdb] Add an API to make the contents of the 'State Machine Hoisted Local Scopes...
Zoltan Varga [Fri, 2 Jun 2017 17:43:56 +0000 (13:43 -0400)]
[sdb] Add an API to make the contents of the 'State Machine Hoisted Local Scopes' table in ppdb files available in sdb. (#4961)

6 years agoUpdate API snapshot
Alexander Köplinger [Fri, 2 Jun 2017 17:12:31 +0000 (19:12 +0200)]
Update API snapshot

6 years ago[profiler] Fix linux.
Rodrigo Kumpera [Fri, 2 Jun 2017 16:24:39 +0000 (09:24 -0700)]
[profiler] Fix linux.

6 years ago[jit] Avoid running class cctors for remoting wrappers in the source domain. Fixes...
Zoltan Varga [Fri, 2 Jun 2017 15:54:54 +0000 (11:54 -0400)]
[jit] Avoid running class cctors for remoting wrappers in the source domain. Fixes #56821. (#4950)

6 years ago[interp] respect remoting proxies when resolving virtual methods
Bernhard Urban [Thu, 1 Jun 2017 19:30:09 +0000 (21:30 +0200)]
[interp] respect remoting proxies when resolving virtual methods

6 years ago[interp] reference domain that owns method in RuntimeMethod and couple other domain...
Bernhard Urban [Thu, 1 Jun 2017 17:01:29 +0000 (19:01 +0200)]
[interp] reference domain that owns method in RuntimeMethod and couple other domain related fixes

6 years ago[marshal] delay dummy string allocation
Bernhard Urban [Fri, 2 Jun 2017 08:24:28 +0000 (10:24 +0200)]
[marshal] delay dummy string allocation

6 years agoUpdate API snapshot
Alexander Köplinger [Fri, 2 Jun 2017 11:34:28 +0000 (13:34 +0200)]
Update API snapshot

6 years ago[Mono.Options] Fix test and add suite to CI (#4963)
Alexander Köplinger [Fri, 2 Jun 2017 11:07:12 +0000 (13:07 +0200)]
[Mono.Options] Fix test and add suite to CI (#4963)

* [Mono.Options] Fix test and add suite to CI

We missed running Mono.Options tests on CI so we didn't catch
this error which was introduced with: https://github.com/mono/mono/pull/4719

```
CSC     [net_4_x-darwin] net_4_x_Mono.Options_test.dll
Test/Mono.Options/CommandSetTest.cs(231,16): error CS7036: There is no argument given that corresponds to the required formal parameter 'error' of 'CommandSet.CommandSet(string, TextWriter, TextWriter, Converter<string, string>)'
```

* [Mono.Options] Stop hardcoding \n to fix tests on Windows

6 years ago[corlib] Updates api
Marek Safar [Thu, 1 Jun 2017 22:14:58 +0000 (00:14 +0200)]
[corlib] Updates api

6 years ago[arm] remove cross compiling guard for MONO_ARCH_SOFT_DEBUG_SUPPORTED
Bernhard Urban [Wed, 31 May 2017 10:26:24 +0000 (12:26 +0200)]
[arm] remove cross compiling guard for MONO_ARCH_SOFT_DEBUG_SUPPORTED

6 years ago[interp] guard remoting functions properly
Bernhard Urban [Thu, 1 Jun 2017 19:31:47 +0000 (21:31 +0200)]
[interp] guard remoting functions properly

6 years ago[runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)
Zoltan Varga [Fri, 2 Jun 2017 07:51:44 +0000 (03:51 -0400)]
[runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)

https://blog.chromium.org/2017/05/goodbye-pnacl-hello-webassembly.html

6 years ago[Posix] Optimize string marshal code by using unsafe code (#4964)
Marius Ungureanu [Fri, 2 Jun 2017 07:03:47 +0000 (00:03 -0700)]
[Posix] Optimize string marshal code by using unsafe code (#4964)