mono.git
7 years ago[build] Fix warning (#4177)
Ludovic Henry [Tue, 20 Dec 2016 15:16:01 +0000 (10:16 -0500)]
[build] Fix warning (#4177)

7 years ago[coop] switch to GC unsafe state in SIGINT handler as it may throw an exception
Bernhard Urban [Wed, 14 Dec 2016 11:54:52 +0000 (12:54 +0100)]
[coop] switch to GC unsafe state in SIGINT handler as it may throw an exception

7 years ago[coop] switch to GC unsafe state in SIGFPE handler as it may throw an exception
Bernhard Urban [Wed, 14 Dec 2016 11:53:37 +0000 (12:53 +0100)]
[coop] switch to GC unsafe state in SIGFPE handler as it may throw an exception

7 years agoMerge pull request #3981 from kumpera/fix_symbolification_issues
Rodrigo Kumpera [Tue, 20 Dec 2016 14:05:47 +0000 (12:05 -0200)]
Merge pull request #3981 from kumpera/fix_symbolification_issues

This PR adds runtime crash symbolification. It requires runtime and tooling changes.

7 years ago[System.Xml] Add support for msxsl format functions. Fixes #50242
Marek Safar [Tue, 20 Dec 2016 13:44:02 +0000 (14:44 +0100)]
[System.Xml] Add support for msxsl format functions. Fixes #50242

7 years ago[System.Xml] Enable more tests
Marek Safar [Tue, 20 Dec 2016 12:21:38 +0000 (13:21 +0100)]
[System.Xml] Enable more tests

7 years agoImplement fast tls for s390x (#4161)
Neale Ferguson [Tue, 20 Dec 2016 12:56:21 +0000 (07:56 -0500)]
Implement fast tls for s390x (#4161)

[s390x] Implement fast tls for s390x

7 years ago[sn] Improve signing error message
Marek Safar [Tue, 20 Dec 2016 11:01:59 +0000 (12:01 +0100)]
[sn] Improve signing error message

7 years ago[System.ValueTuple] Don't emit debug symbols
Marek Safar [Tue, 20 Dec 2016 11:00:10 +0000 (12:00 +0100)]
[System.ValueTuple] Don't emit debug symbols

7 years agoMerge pull request #4178 from ntherning/fix-broken-windows-build
Niklas Therning [Tue, 20 Dec 2016 10:23:32 +0000 (11:23 +0100)]
Merge pull request #4178 from ntherning/fix-broken-windows-build

Fix broken Windows build due to missing mini-exceptions-native-unwinder.c

7 years agoFix broken Windows build due to missing mini-exceptions-native-unwinder.c
Niklas Therning [Tue, 20 Dec 2016 10:04:14 +0000 (11:04 +0100)]
Fix broken Windows build due to missing mini-exceptions-native-unwinder.c

Commit 41272d634b5917f67c12fc4f7172d66242abe7d9 removed mono/mini/mini-
exceptions-native-unwinder.c from the source tree but didn't update msvc
/libmono-static.vcxproj accordingly causing the VS build to fail.

7 years ago[Facades] Removes duplicate signing info
Marek Safar [Tue, 20 Dec 2016 09:18:56 +0000 (10:18 +0100)]
[Facades] Removes duplicate signing info

7 years ago[exception] remove dynamic loading of libunwind/libcorkscrew on Android
Bernhard Urban [Mon, 19 Dec 2016 16:48:54 +0000 (17:48 +0100)]
[exception] remove dynamic loading of libunwind/libcorkscrew on Android

we will rely on the output of debuggerd in order to get a native stack
trace.  The arguments to support that:

(a) native stack trace by debuggerd is at least as good as the one we get via
    libunwind (most of the time the trace provided by libunwind is useless?)

(b) we cannot screw up by accident (e.g. we have seen issues with a too small altstack)

(c) we don't need to maintain the libunwind integration into mono (which we
    sort of had to do because of the upcoming dlopen limitation in Android 7.0
    Nougat).

(d) the libmonosgen-2.0.so had about one megabyte more footprint (16mb ->
    17mb). I'm talking about a debug build here though.

See mailing list discussion for more information:
http://lists.dot.net/pipermail/android-devel/2016-December/000026.html

7 years ago[external] remove libunwind headers
Bernhard Urban [Tue, 13 Dec 2016 21:55:35 +0000 (22:55 +0100)]
[external] remove libunwind headers

7 years ago[arm] Fix llvm support for HFA arguments.
Zoltan Varga [Mon, 19 Dec 2016 22:54:34 +0000 (17:54 -0500)]
[arm] Fix llvm support for HFA arguments.

7 years ago[mono-symbolificate] Add test for nested type arguments and ambiguous matches.
Rodrigo Kumpera [Thu, 17 Nov 2016 01:10:08 +0000 (17:10 -0800)]
[mono-symbolificate] Add test for nested type arguments and ambiguous matches.

7 years ago[mono-symbolificate] Add support for runtime generated stacktraces and fix a bug.
Rodrigo Kumpera [Thu, 17 Nov 2016 01:00:49 +0000 (17:00 -0800)]
[mono-symbolificate] Add support for runtime generated stacktraces and fix a bug.

First the bug fix.
If we hit a method with a nested type as argument, we would not include the outer types and fail to match.

Now for the big change.
The runtime now includes mvid and aotid in the stacktraces it generates. This makes them symboficatable but
with the side effect that the runtime adopts a more compact and slightly different format. Differences includes:

- short name for primitives (int, object, string, etc)
- <> for generic instances
- / for type nesting
- generics vars are appended with _REF

7 years ago[bockbuild] Disable boehm on osx64.
Zoltan Varga [Mon, 19 Dec 2016 18:07:31 +0000 (13:07 -0500)]
[bockbuild] Disable boehm on osx64.

7 years ago[mini] Implement callback that gives metadata access to seqpoint information.
Rodrigo Kumpera [Thu, 17 Nov 2016 00:07:52 +0000 (16:07 -0800)]
[mini] Implement callback that gives metadata access to seqpoint information.

7 years ago[runtime] Include seqpoints, mvid and aotid on runtime generated stack traces.
Rodrigo Kumpera [Thu, 17 Nov 2016 00:07:21 +0000 (16:07 -0800)]
[runtime] Include seqpoints, mvid and aotid on runtime generated stack traces.

7 years ago[runtime] Extract mono_runtime_get_aotid from the icall code.
Rodrigo Kumpera [Thu, 17 Nov 2016 00:05:35 +0000 (16:05 -0800)]
[runtime] Extract mono_runtime_get_aotid from the icall code.

7 years ago[runtime] Use commas for array rank instead of a number when stringifying.
Rodrigo Kumpera [Wed, 16 Nov 2016 23:36:29 +0000 (15:36 -0800)]
[runtime] Use commas for array rank instead of a number when stringifying.

7 years ago[Facades] Add missing reference
Marek Safar [Mon, 19 Dec 2016 17:50:15 +0000 (18:50 +0100)]
[Facades] Add missing reference

7 years ago[Facades] Use the Open.snk key for the System.ValueTuple facade (#4173)
Alexander Köplinger [Mon, 19 Dec 2016 17:25:16 +0000 (18:25 +0100)]
[Facades] Use the Open.snk key for the System.ValueTuple facade (#4173)

It is one of the libraries that started using this new key for signing:
https://github.com/dotnet/buildtools/commit/141bce1285f36bac7ddcef1947a9f2105953e6e5

7 years ago[build] Add new profile
Marek Safar [Mon, 19 Dec 2016 15:35:23 +0000 (16:35 +0100)]
[build] Add new profile

7 years ago[exception] print process map when crashing on Linux
Bernhard Urban [Wed, 14 Dec 2016 12:11:14 +0000 (13:11 +0100)]
[exception] print process map when crashing on Linux

7 years ago[unwinding] set DUMPABLE, so debuggerd can ptrace us
Bernhard Urban [Tue, 13 Dec 2016 22:40:58 +0000 (23:40 +0100)]
[unwinding] set DUMPABLE, so debuggerd can ptrace us

7 years ago[System.Core] SLE from CoreFX including interpreter
Marek Safar [Wed, 14 Dec 2016 14:04:32 +0000 (15:04 +0100)]
[System.Core] SLE from CoreFX including interpreter

7 years agoMerge pull request #4155 from BrzVlad/fix-tls-lmf-addr
Vlad Brezae [Mon, 19 Dec 2016 12:05:19 +0000 (14:05 +0200)]
Merge pull request #4155 from BrzVlad/fix-tls-lmf-addr

[runtime] Fix MONO_ARCH_ENABLE_MONO_LMF_VAR

7 years ago[msvc] Update csproj files (#4163)
monojenkins [Mon, 19 Dec 2016 11:20:27 +0000 (12:20 +0100)]
[msvc] Update csproj files (#4163)

7 years ago.NET allows each finalizer thread up to 2 seconds to complete and 40 seconds for...
Neale Ferguson [Sun, 18 Dec 2016 13:08:48 +0000 (08:08 -0500)]
.NET allows each finalizer thread up to 2 seconds to complete and 40 seconds for all threads to complete. However, mono just allows 2 seconds for all finalizers. Some complex applications easily exceed this and this results in thread aborts to be invoked. This fix is simplistic as it simply replaces the 2 seconds with 40 without addressing the 2 seconds per finalizer thread. This problem is more complex but this fix will circumvent the problem until a final option is designed and implemented. (#4162)

7 years agoconfigure.ac: import makedev() and friends from <sys/sysmacros.h> (#4170)
Sergei Trofimovich [Sun, 18 Dec 2016 11:15:14 +0000 (11:15 +0000)]
configure.ac: import makedev() and friends from <sys/sysmacros.h> (#4170)

Current glibc's <sys/types.h> headers are included into
many C standard headers.

The problem here is that makedev()/major()/minor() macros
defined in <sys/sysmacros.h> leak into C standard headers
and poison global namespace.

The plan is to get rid of <sys/sysmacros.h> inclusion
in <sys/types.h>:
    https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html

On such system without implicit <sys/sysmacros.h> mono fails
to build as:

  CC       libmonoruntime_la-w32process-unix-default.lo
w32process-unix-default.c: In function 'mono_w32process_get_modules':
w32process-unix-default.c:225:12: error: implicit declaration of function 'makedev' [-Werror=implicit-function-declaration]
   device = makedev ((int)maj_dev, (int)min_dev);
            ^~~~~~~

autoconf has a AC_HEADER_MAJOR macro to autodetect
header for major() and friends.

This change switches to AC_HEADER_MAJOR.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
7 years ago[test-runner] Try to dump threads on timeout with lldb and gdb
Ludovic Henry [Thu, 15 Dec 2016 19:43:08 +0000 (14:43 -0500)]
[test-runner] Try to dump threads on timeout with lldb and gdb

7 years ago[mini] Inline only use of mono_runtime_syscall_fork
Ludovic Henry [Thu, 15 Dec 2016 19:11:39 +0000 (14:11 -0500)]
[mini] Inline only use of mono_runtime_syscall_fork

7 years ago[mini] Factor duplicates mono_gdb_render_native_backtraces
Ludovic Henry [Thu, 15 Dec 2016 19:09:42 +0000 (14:09 -0500)]
[mini] Factor duplicates mono_gdb_render_native_backtraces

7 years ago[threadpool] Remove assertion on RequestWorkerThread failure (#4167)
Ludovic Henry [Sat, 17 Dec 2016 14:42:18 +0000 (09:42 -0500)]
[threadpool] Remove assertion on RequestWorkerThread failure (#4167)

We observed that this assertion would sometimes be triggered on CI in case of intensive load. This would be possible because we wouldn't necessarily decrease the outstanding_request in a new worker. To decrease resource usage, we also want to limit the amount of new worker we request.

7 years ago[threadpool] Use threadpool->threads instead of threadpool->counters to wait on clean...
Ludovic Henry [Sat, 17 Dec 2016 14:41:36 +0000 (09:41 -0500)]
[threadpool] Use threadpool->threads instead of threadpool->counters to wait on cleanup (#4146)

7 years ago[jit] Enable tests for the Vector<T> intrinsics. (#4157)
Zoltan Varga [Sat, 17 Dec 2016 12:11:21 +0000 (07:11 -0500)]
[jit] Enable tests for the Vector<T> intrinsics. (#4157)

7 years ago[llvm] Fix the mapping of simd types to llvm types when using -O=-simd.
Zoltan Varga [Sat, 17 Dec 2016 12:08:09 +0000 (07:08 -0500)]
[llvm] Fix the mapping of simd types to llvm types when using -O=-simd.

7 years ago[llvm] Add back support for OP_TLS_GET.
Zoltan Varga [Sat, 17 Dec 2016 10:56:41 +0000 (05:56 -0500)]
[llvm] Add back support for OP_TLS_GET.

7 years ago[runtime] Fix Mach ARM assert.
Jon Purdy [Fri, 11 Nov 2016 22:19:54 +0000 (14:19 -0800)]
[runtime] Fix Mach ARM assert.

This changes mono_mach_arch_get_thread_fpstate_size to return a value,
rather than asserting. The actual float state isn't used yet. This also
assumes NEON, which may not be correct.

7 years ago[simd] Fix the exception thrown by Vector<T>.CopyTo () on a failed bounds check.
Zoltan Varga [Fri, 16 Dec 2016 19:58:57 +0000 (14:58 -0500)]
[simd] Fix the exception thrown by Vector<T>.CopyTo () on a failed bounds check.

7 years ago[runtime] Fix MONO_ARCH_ENABLE_MONO_LMF_VAR
Vlad Brezae [Fri, 16 Dec 2016 01:00:18 +0000 (03:00 +0200)]
[runtime] Fix MONO_ARCH_ENABLE_MONO_LMF_VAR

Using MONO_ARCH_ENABLE_MONO_LMF_VAR requires that we have means of getting the address of a tls variable (which is always the case when using __thread, but not necessarily when using pthread). Make sure that using it is properly guarded.

In the future we might want to remove MONO_ARCH_ENABLE_LMF_VAR and always try to use a tls variable for the lmf. Additionally we should benchmark what combinations work best and stick to them on all platforms. (ex when using fast tls we might consider using lmf_get + lmf_set if possible, when using fallbacks we might always want to use the lmf_addr to void multiple calls, always use lmf_ir etc).

7 years ago[aot] Bump AOT file format version due to changes to patch infos etc.
Zoltan Varga [Fri, 16 Dec 2016 18:47:32 +0000 (13:47 -0500)]
[aot] Bump AOT file format version due to changes to patch infos etc.

7 years ago[threads] Ensure thread is still alive when detaching it
Ludovic Henry [Fri, 16 Dec 2016 18:42:36 +0000 (13:42 -0500)]
[threads] Ensure thread is still alive when detaching it

If the compiler optimized it so that we would unregister the thread->thread_pinning_ref GC root before we would destroy the thread fields, we could run into "* Assertion at threads.c:1081, condition 'thread->suspended' not met"

7 years ago[runtime] Remove old unused defines/prototypes
Vlad Brezae [Fri, 16 Dec 2016 17:39:09 +0000 (19:39 +0200)]
[runtime] Remove old unused defines/prototypes

7 years ago[build] Remove PEAPI from library profiles
Marek Safar [Fri, 16 Dec 2016 11:01:53 +0000 (12:01 +0100)]
[build] Remove PEAPI from library profiles

7 years ago[build] Update list of aoted images in mcs mode
Marek Safar [Fri, 16 Dec 2016 11:17:40 +0000 (12:17 +0100)]
[build] Update list of aoted images in mcs mode

7 years ago[System.Numerics.Vectors] Update to the latest CoreFX version
Marek Safar [Fri, 16 Dec 2016 14:43:58 +0000 (15:43 +0100)]
[System.Numerics.Vectors] Update to the latest CoreFX version

7 years ago[System.Numerics.Vectors] Enable Vector on desktop profile
Marek Safar [Fri, 16 Dec 2016 14:26:38 +0000 (15:26 +0100)]
[System.Numerics.Vectors] Enable Vector on desktop profile

7 years agoBump corefx
Marek Safar [Fri, 16 Dec 2016 11:43:57 +0000 (12:43 +0100)]
Bump corefx

7 years ago[corlib] Override virtual DSA.HashData() methods in DSACryptoServiceProvider (#4150)
Alexander Köplinger [Fri, 16 Dec 2016 10:53:25 +0000 (11:53 +0100)]
[corlib] Override virtual DSA.HashData() methods in DSACryptoServiceProvider (#4150)

The methods were added in .NET 4.6 but couldn't be done abstract so instead
they were added virtual which just throws an exception telling you to override
it in the subclass.

We implemented this for RSACryptoServiceProvider in https://github.com/mono/mono/pull/3770
(the methods were already overriden in that case because we moved to referencesource)
but DSACryptoServiceProvider is still using the Mono code so we need to
implement it there too.

7 years agoFix a warning.
Zoltan Varga [Fri, 16 Dec 2016 02:47:46 +0000 (21:47 -0500)]
Fix a warning.

7 years agoRevert "[build] Update list of aoted images in mcs mode"
Alexander Köplinger [Thu, 15 Dec 2016 20:36:41 +0000 (21:36 +0100)]
Revert "[build] Update list of aoted images in mcs mode"

This reverts commit 59b8a5d3bae8f55c7fa31080a0c1b9e88d4419b8.

It breaks the mcs build:

```
20:35:27 MONO_PATH='./../../class/lib/build/' > build_aot.log 2>&1 /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/runtime/mono-wrapper --aot=bind-to-runtime-version,outfile=/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll.so --debug /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll || (cat build_aot.log; exit 1)
20:35:27 Failed to load method 0x6000001 from '/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll' due to Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>.
20:35:27 Run with MONO_LOG_LEVEL=debug for more information.
20:35:27 AOT of image /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll failed.
20:35:27 Mono Ahead of Time compiler - compiling assembly /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll
20:35:27 AOTID 368C895D-F9C7-38E7-C0BA-F9B6964CD1A0
20:35:27
make[7]: *** [/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Reflection.Metadata.dll.so] Error 1
20:35:27 make[7]: *** Waiting for unfinished jobs....
20:35:27 Failed to load method 0x6000001 from '/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll' due to Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>.
20:35:27 Run with MONO_LOG_LEVEL=debug for more information.
20:35:27 AOT of image /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll failed.
20:35:27 Mono Ahead of Time compiler - compiling assembly /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll
20:35:27 AOTID 368C895D-F9C7-38E7-C0BA-F9B6964CD1A0
20:35:27 make[7]: *** [/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll.so] Error 1
20:35:27 Failed to load method 0x600000c from '/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe' due to Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>.
20:35:27 Run with MONO_LOG_LEVEL=debug for more information.
20:35:27 AOT of image /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe failed.
20:35:27 Mono Ahead of Time compiler - compiling assembly /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe
20:35:27 AOTID 44CBE5F8-37FA-0F68-B472-47E2F4209FC5
20:35:27 System.Collections.Immutable.dll
20:35:27 AOTID 368C895D-F9C7-38E7-C0BA-F9B6964CD1A0
20:35:33 make[7]: Leaving directory `/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/mcs/class/aot-compiler'
20:35:33 make[6]: Leaving directory `/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/mcs/class/aot-compiler'
20:35:33 make[6]: *** [do-all] Error 2
```

7 years ago[msvc] Update csproj files (#4151)
monojenkins [Thu, 15 Dec 2016 20:01:12 +0000 (21:01 +0100)]
[msvc] Update csproj files (#4151)

7 years ago[build] Update list of aoted images in mcs mode
Marek Safar [Thu, 15 Dec 2016 18:04:31 +0000 (19:04 +0100)]
[build] Update list of aoted images in mcs mode

7 years ago[System.Core] Add CryptoServiceProviders to mobile
Marek Safar [Thu, 15 Dec 2016 16:01:43 +0000 (17:01 +0100)]
[System.Core] Add CryptoServiceProviders to mobile

7 years ago[Facades] Move IncrementalHash to System.Security.Cryptography.Algorithms facade
Marek Safar [Thu, 15 Dec 2016 14:23:04 +0000 (15:23 +0100)]
[Facades] Move IncrementalHash to System.Security.Cryptography.Algorithms facade

It looks like the type won't be part of .net for anytime soon

7 years ago[corlib] Fixes warning
Marek Safar [Thu, 15 Dec 2016 11:10:02 +0000 (12:10 +0100)]
[corlib] Fixes warning

7 years ago[process] Fix process-unref-race.exe (#4144)
Ludovic Henry [Thu, 15 Dec 2016 13:18:23 +0000 (08:18 -0500)]
[process] Fix process-unref-race.exe (#4144)

* [process] Rename MonoProcess to Process as it's not public anymore

* [process] Replace setting process->pid = 0 by process->signalled = TRUE

* [process] Remove processes_mutex lock when unrefing process->handle

We do not need to synchronize it here because we do not modify `processes`, and the only other place where we access process->handle is before adding it to `processes`.

* [process] Fix race condition

Without this memory barrier `process->next = processes` and `processes = process` could be reordered, and when accessing `processes` in mono_sigchld_signal_handler, we could observe a NULL processes->next. This would make us not find a pid in `processes`, and because of the posix API, we would never mark this process as exited.

This would trigger a hang in `process-unref-race.exe` test.

Thank you to @kumpera for the help figuring this out!

7 years ago[s390x] Fix build
Vlad Brezae [Thu, 15 Dec 2016 13:13:56 +0000 (15:13 +0200)]
[s390x] Fix build

7 years ago[aot] fix linker invocation for llvm mode on linux
Bernhard Urban [Thu, 15 Dec 2016 06:41:45 +0000 (07:41 +0100)]
[aot] fix linker invocation for llvm mode on linux

clang++ should only be used for llvm_only (aka. bitcode) mode.

this is a follow up fix for:
https://github.com/mono/mono/commit/7d238ddd5edeeb42cec5e07b6d6527d16332f921
and
https://github.com/mono/mono/commit/fc5305d2af1b6891b05cb82342bf92d4659546e1

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

7 years ago[tools] Add resx2sr internal tool
Marek Safar [Thu, 15 Dec 2016 10:22:07 +0000 (11:22 +0100)]
[tools] Add resx2sr internal tool

7 years agoMerge pull request #4014 from BrzVlad/feature-tls-refactor
Vlad Brezae [Thu, 15 Dec 2016 10:22:04 +0000 (12:22 +0200)]
Merge pull request #4014 from BrzVlad/feature-tls-refactor

[runtime] thread local storage refactor

7 years ago[arm64] Mark MONO_CONTEXT_GET_CURRENT () as clobbering x16.
Zoltan Varga [Thu, 15 Dec 2016 04:45:29 +0000 (05:45 +0100)]
[arm64] Mark MONO_CONTEXT_GET_CURRENT () as clobbering x16.

7 years agoFix build break due to Cecil API change
Alexander Köplinger [Wed, 14 Dec 2016 20:35:31 +0000 (21:35 +0100)]
Fix build break due to Cecil API change

https://github.com/jbevain/cecil/commit/42db79cc16f1cbe8dbab558904e188352dba2b41

7 years ago[xbuild] Bump buildtools to get support for netstandard 1.6
Ankit Jain [Wed, 14 Dec 2016 19:54:35 +0000 (14:54 -0500)]
[xbuild] Bump buildtools to get support for netstandard 1.6

https://github.com/mono/buildtools/commit/9b6ee8686be55a983d886938165b6206cda50772

7 years ago[system] Remove port number from TLS Server Name Identification (SNI). Fixes #46549...
Sebastien Pouliot [Wed, 14 Dec 2016 19:24:41 +0000 (14:24 -0500)]
[system] Remove port number from TLS Server Name Identification (SNI). Fixes #46549 (#4120)

The port number should not be included along the host name. Otherwise
the server will refuse the connection (and we'll throw). This is a
problem when servers are not using the default (443) SSL/TLS port.

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

The BTLS provider was fixed but the old MonoTLS (managed) provider had
the same issue.

Another PR will be made to fix AppleTLS in xamarin-macios repo [2]

[1] https://github.com/mono/mono/pull/3939
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=45994

7 years agoBump cecil to get portable pdb fix
Alexander Köplinger [Wed, 14 Dec 2016 19:16:08 +0000 (20:16 +0100)]
Bump cecil to get portable pdb fix

7 years ago[arm] Resurrect inlined fast tls
Vlad Brezae [Wed, 23 Nov 2016 01:48:48 +0000 (01:48 +0000)]
[arm] Resurrect inlined fast tls

Only on desktop linux, where we now inline aeabi_read_tp.

7 years ago[arm64] Resurrect inlined fast tls
Vlad Brezae [Tue, 22 Nov 2016 11:07:18 +0000 (03:07 -0800)]
[arm64] Resurrect inlined fast tls

7 years ago[x86] Resurrect inlined fast tls
Vlad Brezae [Mon, 21 Nov 2016 21:52:50 +0000 (13:52 -0800)]
[x86] Resurrect inlined fast tls

7 years ago[runtime] Global debug option for using fallback tls
Vlad Brezae [Fri, 18 Nov 2016 20:34:42 +0000 (22:34 +0200)]
[runtime] Global debug option for using fallback tls

7 years ago[amd64] Resurrect inlined fast tls
Vlad Brezae [Fri, 18 Nov 2016 20:15:01 +0000 (22:15 +0200)]
[amd64] Resurrect inlined fast tls

By default all platforms will call into native getters/setters whenever they need to get access tls value. On certain platforms we can try to be faster than this and avoid the call. We call this fast tls and each platform defines its own way to achieve this. Fast tls should normally be inlined, otherwise there is little point to doing anything else in the first place (on linux, __thread access is 2-3 instructions, on mac pthread_getspecific is 2 instructions, other platforms also having decent implementations).  For this, a platform has to define MONO_ARCH_HAVE_FAST_TLS, and provide alternative getters/setters for a MonoTlsKey. In order to have fast getter/setters, the platform has to declare a way to fetch an internal offset (MONO_THREAD_VAR_OFFSET) which is stored in the tls module, and in the arch specific file probe the system to see if we can use the offset initialized here. If these run-time checks don't succeed we just use the fallbacks.

In case we would wish to provide fast inlined tls for aot code, we would need to be sure that, at run-time, these two platform checks would never fail otherwise the tls getter/setters that we emitted would not work. Normally, there is little incentive to support this since tls access is most common in wrappers and managed allocators, both of which are not aot-ed by default. So far, we never supported inlined fast tls on full-aot systems.

7 years ago[runtime] Refactor and unify tls access
Vlad Brezae [Thu, 10 Nov 2016 22:24:51 +0000 (00:24 +0200)]
[runtime] Refactor and unify tls access

The purpose of this commit is to unify tls access across all platforms. We had tls information spread out throughout the entire code which was guarded with many defines/capabilities which made very hard to follow what was going on. Also this made switching between pthread and __thread very unstable since there were a lot of dependencies between different pieces of the tls infrastructure. Also it was not very clear what happens if one of the tls pieces failed.

Now we are moving all the tls variables to a single module that provides getters/setters and initialization API. Runtime code now knows that we can always access a tls variable (from managed code, we just do a nowrapper icall into the same global geters/setters). Even though we used to these type of calls all around before, it is worth mentioning that runtime should account for a thread to be in this type of unregistered code without m2n wrapper and no register jinfo.

On average this makes common tls intensive methods (m2n wrappers and managed allocator) 20% slower, with potential for more regression if we use tls getters/setters recklessly. As a consequence we will re-enable the most important pieces of fast tls code in the future.

7 years ago[exception] do not wrap SIGILL into a managed exception
Bernhard Urban [Mon, 12 Dec 2016 14:25:59 +0000 (15:25 +0100)]
[exception] do not wrap SIGILL into a managed exception

there is not much point in trying to recover from it and even worse,
wrapping it into a managed exception might hide it if the application is
sloppy with exception handling (cf. Pokémon Exception Handling).

7 years ago[exception] rename mono_handle_native_sigsegv -> mono_handle_native_crash
Bernhard Urban [Mon, 12 Dec 2016 13:32:23 +0000 (14:32 +0100)]
[exception] rename mono_handle_native_sigsegv -> mono_handle_native_crash

7 years ago[exception] pass signal as string already to mono_handle_native_sigsegv
Bernhard Urban [Mon, 12 Dec 2016 14:28:41 +0000 (15:28 +0100)]
[exception] pass signal as string already to mono_handle_native_sigsegv

7 years agoMerge pull request #4139 from lambdageek/bug-49686
Marek Safar [Wed, 14 Dec 2016 10:08:51 +0000 (11:08 +0100)]
Merge pull request #4139 from lambdageek/bug-49686

[sre] Implement DynamicMethod.GetCustomAttributes() and IsDefined() (Fixes #49686)

7 years agoMerge pull request #4110 from BrzVlad/fix-sgen-win32
Vlad Brezae [Wed, 14 Dec 2016 09:56:08 +0000 (11:56 +0200)]
Merge pull request #4110 from BrzVlad/fix-sgen-win32

[sgen] Fix sgen win32

7 years ago[jit] Add a workaround to avoid a crash in mini_above_abort_threshold () when using...
Zoltan Varga [Wed, 14 Dec 2016 06:12:29 +0000 (07:12 +0100)]
[jit] Add a workaround to avoid a crash in mini_above_abort_threshold () when using bitcode.

7 years ago[process] Remove useless FIXME
Ludovic Henry [Wed, 14 Dec 2016 02:44:27 +0000 (21:44 -0500)]
[process] Remove useless FIXME

7 years ago[arm64] Save the fp regs in MONO_CONTEXT_GET_CURRENT (). (#4121)
Zoltan Varga [Tue, 13 Dec 2016 22:38:41 +0000 (17:38 -0500)]
[arm64] Save the fp regs in MONO_CONTEXT_GET_CURRENT (). (#4121)

7 years ago[threadpool] Assert that we do not overflow ThreadPoolCounter starting and working...
Ludovic Henry [Tue, 13 Dec 2016 21:58:15 +0000 (16:58 -0500)]
[threadpool] Assert that we do not overflow ThreadPoolCounter starting and working fields (#4138)

7 years ago[threadpool] Fix `MonoTests.runtime.unload-appdomain-on-shutdown.exe` (#4135)
Ludovic Henry [Tue, 13 Dec 2016 21:53:03 +0000 (16:53 -0500)]
[threadpool] Fix `MonoTests.runtime.unload-appdomain-on-shutdown.exe` (#4135)

* [threadpool] Increase and decrease refcount when removing domain

* [threadpool] Fix unload-appdomain-on-shutdown.exe

If the threadpool is not initialized, there is no need to initialize it, as no worker is going to start in the domain because mono_domain_is_unloading would return TRUE.

7 years ago[sre] Implement DynamicMethod.GetCustomAttributes() and IsDefined ()
Aleksey Kliger [Tue, 13 Dec 2016 17:27:13 +0000 (12:27 -0500)]
[sre] Implement DynamicMethod.GetCustomAttributes() and IsDefined ()

Per .NET documentation, DynamicMethod does not support custom attributes
exception the MethodImplAttribute pseudo-custom attribute.

Also change GetMethodImplementationFlags to include NoInlining as on .NET

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

7 years ago[test] Test for System.Linq.Expressions.MethodCallExpression with a DynamicMethod
Aleksey Kliger [Tue, 13 Dec 2016 21:17:08 +0000 (16:17 -0500)]
[test] Test for System.Linq.Expressions.MethodCallExpression with a DynamicMethod

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

7 years agoRevert "[ci] Move mcs switch for Win32 builds into the run-jenkins.sh script"
Vlad Brezae [Wed, 7 Dec 2016 12:21:49 +0000 (14:21 +0200)]
Revert "[ci] Move mcs switch for Win32 builds into the run-jenkins.sh script"

This reverts commit 2b8d9bdb0850d98ed65f025a4cdcb4ca3f1eaa19.

7 years ago[sgen] Don't suspend thread in wow64 transition
Vlad Brezae [Wed, 7 Dec 2016 00:06:00 +0000 (02:06 +0200)]
[sgen] Don't suspend thread in wow64 transition

The stack pointer provided by GetThreadContext is not reliable.

7 years ago[test] Test for System.Reflection.Emit.DynamicMethod.GetCustomAttributes
Aleksey Kliger [Tue, 13 Dec 2016 20:49:39 +0000 (15:49 -0500)]
[test] Test for System.Reflection.Emit.DynamicMethod.GetCustomAttributes

7 years ago[sgen] binary protocol on windows
Vlad Brezae [Tue, 29 Nov 2016 22:06:55 +0000 (00:06 +0200)]
[sgen] binary protocol on windows

7 years ago[runtime] Fix prototype of functions
Vlad Brezae [Tue, 29 Nov 2016 19:06:13 +0000 (21:06 +0200)]
[runtime] Fix prototype of functions

These functions are cast and invoked as a MonoThreadStart (which requires to receive on arg, return one arg and be WINAPI on windwos), which could lead to cconv problems if the prototype is not matching.

7 years agoFix a warning.
Zoltan Varga [Tue, 13 Dec 2016 16:40:10 +0000 (17:40 +0100)]
Fix a warning.

7 years ago[amd64] Return from the altstack before handling native sigsegvs. This will make...
Zoltan Varga [Tue, 13 Dec 2016 06:48:37 +0000 (07:48 +0100)]
[amd64] Return from the altstack before handling native sigsegvs. This will make backtrace () actually work.

7 years ago[jit] Pass '-nx' to gdb when printing native backtraces so it doesn't read .gdbinit...
Zoltan Varga [Tue, 13 Dec 2016 06:47:31 +0000 (07:47 +0100)]
[jit] Pass '-nx' to gdb when printing native backtraces so it doesn't read .gdbinit, thus making it more deterministic.

7 years agoRemove the debian-snapshot submodule
Alexander Köplinger [Tue, 13 Dec 2016 15:44:48 +0000 (16:44 +0100)]
Remove the debian-snapshot submodule

Jo said it's no longer used. We're using the following repos now:

https://github.com/mono/linux-packaging-mono
https://github.com/mono/linux-packaging-mono-snapshot

7 years ago[msvc] Update csproj files (#4136)
monojenkins [Tue, 13 Dec 2016 12:52:22 +0000 (13:52 +0100)]
[msvc] Update csproj files (#4136)

7 years agoRevert "Fix a warning."
Bernhard Urban [Tue, 13 Dec 2016 12:41:32 +0000 (13:41 +0100)]
Revert "Fix a warning."

This reverts commit b498facf7cebade5762d79f28cd102a5ed120bc5.

7 years agoFix a warning.
Zoltan Varga [Tue, 13 Dec 2016 06:29:41 +0000 (07:29 +0100)]
Fix a warning.

7 years ago[threads] Destroy thread->suspended before removing the GC root to thread (#4133)
Ludovic Henry [Mon, 12 Dec 2016 23:57:07 +0000 (18:57 -0500)]
[threads] Destroy thread->suspended before removing the GC root to thread (#4133)