mono.git
8 years agoMerge pull request #2922 from akoeplinger/fix-tvos
monojenkins [Tue, 19 Apr 2016 22:40:34 +0000 (23:40 +0100)]
Merge pull request #2922 from akoeplinger/fix-tvos

[utils] Fix MONO_SIGNAL_USE_UCONTEXT_T not being defined on tvOS simulator

In the maccore tvossimulator tests we were seeing the following assertion with the Mono 4.5 preview:

```
error: * Assertion: should not be reached at /Users/builder/data/lanes/1381/0d6923b4/source/maccore/external/mono/mono/utils/mono-context.c:194

0   dont link                           0x000000010175702d mono_handle_native_sigsegv + 253
1   libsystem_platform.dylib            0x000000010a0cfeaa _sigtramp + 26
2   ???                                 0x0000000001bfc4db 0x0 + 29344987
3   libsystem_c.dylib                   0x0000000109e56cbc abort + 129
4   dont link                           0x00000001018d1503 _ZL12log_callbackPKcS0_S0_iPv + 67
5   dont link                           0x00000001018c26d0 monoeg_assertion_message + 192
6   dont link                           0x00000001018af6de mono_sigctx_to_monoctx + 30
7   dont link                           0x000000010183f473 sgen_suspend_thread + 323
8   dont link                           0x000000010183f58e sgen_thread_handshake + 126
9   dont link                           0x000000010183fb20 sgen_client_stop_world + 1296
10  dont link                           0x0000000101871283 sgen_stop_world + 67
11  dont link                           0x0000000101870d43 sgen_perform_collection + 99
12  dont link                           0x0000000101872576 sgen_gc_collect + 102
13  dont link                           0x00000001018d1886 _ZL7pump_gcPv + 54
14  libsystem_pthread.dylib             0x000000010a0b7c13 _pthread_body + 131
15  libsystem_pthread.dylib             0x000000010a0b7b90 _pthread_body + 0
16  libsystem_pthread.dylib             0x000000010a0b5375 thread_start + 13
```

This was caused by a4e257a07f511062a8feb3e06e1566fd980110ce, the issue is that the check was changed from UCONTEXT_REG_RAX to MONO_SIGNAL_USE_UCONTEXT_T, but that is only available when HAVE_SIGACTION is defined which it is not in this case.

Talked with Zoltan, fixing this by enabling MONO_SIGNAL_USE_UCONTEXT_T on all apple platforms for now.

/cc @vargaz @xmcclure

@monojenkins merge

8 years agoAnother round of profiler fixes/improvements. PR #2882 (Manually Merged)
Rodrigo Kumpera [Tue, 19 Apr 2016 22:13:09 +0000 (15:13 -0700)]
Another round of profiler fixes/improvements. PR #2882 (Manually Merged)

https://github.com/mono/mono/pull/2882

8 years agoMerge pull request #2806 from lambdageek/dev/monoerror-marshal_remote
monojenkins [Tue, 19 Apr 2016 21:50:30 +0000 (22:50 +0100)]
Merge pull request #2806 from lambdageek/dev/monoerror-marshal_remote

[runtime] MonoError-ize marshal and remoting code

Get rid of calls to `mono_raise_exception` in marshaling and remoting code.

8 years ago[profiler] Don't link against libmono.
Rodrigo Kumpera [Wed, 13 Apr 2016 20:31:28 +0000 (22:31 +0200)]
[profiler] Don't link against libmono.

This would result in duplicate runtimes being loaded (as evidenced by
/proc/$pid/maps), which could lead to all sorts of breakage.

8 years ago[profiler] Load the profiler with MONO_DL_EAGER.
Alex Rønne Petersen [Wed, 13 Apr 2016 18:19:12 +0000 (20:19 +0200)]
[profiler] Load the profiler with MONO_DL_EAGER.

We need to make sure all external references have been resolved so that we
don't invoke the dynamic linker in the mono_sample_hit () callback which is
called in async-signal context.

8 years ago[utils/dl] Add a MONO_DL_EAGER enum value for clarity.
Alex Rønne Petersen [Thu, 14 Apr 2016 14:51:13 +0000 (16:51 +0200)]
[utils/dl] Add a MONO_DL_EAGER enum value for clarity.

8 years ago[profiler] Don't use a real-time signal on Android.
Alex Rønne Petersen [Tue, 12 Apr 2016 07:43:27 +0000 (09:43 +0200)]
[profiler] Don't use a real-time signal on Android.

8 years ago[profiler] Use 'start_unload' events instead of 'end_unload' events to avoid crashes.
Alex Rønne Petersen [Mon, 11 Apr 2016 05:49:14 +0000 (07:49 +0200)]
[profiler] Use 'start_unload' events instead of 'end_unload' events to avoid crashes.

'end_unload' events can receive mostly-freed structures.

8 years ago[profiler] Use a signal to interrupt the sampler thread's sleep if needed.
Alex Rønne Petersen [Sat, 9 Apr 2016 11:16:29 +0000 (13:16 +0200)]
[profiler] Use a signal to interrupt the sampler thread's sleep if needed.

There is a slight problem when we're using CLOCK_PROCESS_CPUTIME_ID: If we're
shutting down and there's largely no activity in the process other than waiting
for the sampler thread to shut down, it can take upwards of 20 seconds
(depending on a lot of factors) for us to shut down because the sleep
progresses very slowly as a result of the low CPU activity.

We fix this by repeatedly sending the profiler signal to the sampler thread in
order to interrupt the sleep.

We do not need to do this on platforms where we use a regular sleep based on a
monotonic clock. The sleep will return in a reasonable amount of time in those
cases.

8 years ago[profiler] Add some more counters.
Alex Rønne Petersen [Sat, 9 Apr 2016 02:01:19 +0000 (04:01 +0200)]
[profiler] Add some more counters.

8 years ago[profiler] Limit the number of allocated sample hit structures.
Andi McClure [Sat, 9 Apr 2016 01:16:10 +0000 (03:16 +0200)]
[profiler] Limit the number of allocated sample hit structures.

8 years ago[profiler] Add counters for log buffers and sample hits.
Andi McClure [Sat, 9 Apr 2016 01:14:33 +0000 (03:14 +0200)]
[profiler] Add counters for log buffers and sample hits.

8 years ago[profiler] Rewrite the log profiler's handling of sample hits.
Alex Rønne Petersen [Sat, 9 Apr 2016 01:06:41 +0000 (03:06 +0200)]
[profiler] Rewrite the log profiler's handling of sample hits.

The old code had quite a few problems:

1. It would result in stack corruption under heavy load, somehow. This typically
   resulted in an assertion when starting the unwinding process because the
   unwinding flags would be inconsistent.
2. It sometimes wrote complete garbage into the statistical buffers.
3. As a result of using the helper thread to assemble collected samples into log
   buffers, it did not work on platforms where the helper thread is disabled.
4. Performance was poor under heavy load because waking up the helper thread to
   assemble events would always trigger a counters sample + dump.
5. The code was very complicated and hard to understand/maintain.

(Points (1) and (2) can probably be attributed to point (5).)

In the new sampling world order, we use a lock-free allocator and a lock-free
reuse queue to acquire memory for sample hit events in the sample hit callback.
We then fill it with the info we collect during the async stack walk. Finally,
we ship it off to a separate dumper thread (via another lock-free queue) where
it gets turned into a log buffer and then shipped off to the writer thread.

This new approach appears very stable; I've yet to make it crash in any of the
stress tests I typically run. In a heavy workload, the helper thread's CPU
usage was previously around 25-30%. It is now down to basically 0% while the
dumper thread is only around 15%. CPU usage by threads that are collecting
samples is a bit higher than before, but only until the reuse queue converges
on a size that is big enough to satisfy all sample event requests. At that
point, no more allocations from the lock-free allocator happen, and performance
improves.

8 years ago[utils/lfa] Export the lock-free allocation code for use in the profiler.
Alex Rønne Petersen [Fri, 8 Apr 2016 23:24:06 +0000 (01:24 +0200)]
[utils/lfa] Export the lock-free allocation code for use in the profiler.

8 years ago[profiler] Add counters for numbers of signals sent/received/accepted.
Andi McClure [Fri, 8 Apr 2016 23:22:52 +0000 (01:22 +0200)]
[profiler] Add counters for numbers of signals sent/received/accepted.

8 years ago[counters] Add a profiler category.
Alex Rønne Petersen [Fri, 8 Apr 2016 23:22:32 +0000 (01:22 +0200)]
[counters] Add a profiler category.

8 years ago[profiler] Make the default sample frequency 100 Hz.
Alex Rønne Petersen [Sat, 9 Apr 2016 01:16:44 +0000 (03:16 +0200)]
[profiler] Make the default sample frequency 100 Hz.

Our previous default (1000 Hz) was quite extreme and resulted in very high
overhead from the profiler for moderate workloads.

Also, fix the profiler to actually treat the 'freq' argument as a frequency
when passing it to the runtime. It was being incorrectly treated as a sleep
interval.

8 years ago[domain] Report domain unloads to the profiler when finalizing the domain.
Alex Rønne Petersen [Sat, 9 Apr 2016 01:57:16 +0000 (03:57 +0200)]
[domain] Report domain unloads to the profiler when finalizing the domain.

We would miss the unload event for the root domain because we reported it just
before freeing the domain, by which time the profiler was detached.

8 years ago[profiler] Only initialize the sampler thread once.
Alex Rønne Petersen [Sat, 9 Apr 2016 02:11:14 +0000 (04:11 +0200)]
[profiler] Only initialize the sampler thread once.

8 years ago[System.Configuration] Fail tests on standalone error
Marek Safar [Tue, 19 Apr 2016 21:24:12 +0000 (23:24 +0200)]
[System.Configuration] Fail tests on standalone error

8 years ago[System.Configuration] re-enable standalone tests
Marek Safar [Tue, 19 Apr 2016 21:10:21 +0000 (23:10 +0200)]
[System.Configuration] re-enable standalone tests

8 years ago[utils] Fix MONO_SIGNAL_USE_UCONTEXT_T not being defined on tvOS simulator
Alexander Köplinger [Tue, 19 Apr 2016 19:30:53 +0000 (21:30 +0200)]
[utils] Fix MONO_SIGNAL_USE_UCONTEXT_T not being defined on tvOS simulator

In the maccore tvossimulator tests we were seeing the following assertion with the Mono 4.5 preview:

```
error: * Assertion: should not be reached at /Users/builder/data/lanes/1381/0d6923b4/source/maccore/external/mono/mono/utils/mono-context.c:194

0   dont link                           0x000000010175702d mono_handle_native_sigsegv + 253
1   libsystem_platform.dylib            0x000000010a0cfeaa _sigtramp + 26
2   ???                                 0x0000000001bfc4db 0x0 + 29344987
3   libsystem_c.dylib                   0x0000000109e56cbc abort + 129
4   dont link                           0x00000001018d1503 _ZL12log_callbackPKcS0_S0_iPv + 67
5   dont link                           0x00000001018c26d0 monoeg_assertion_message + 192
6   dont link                           0x00000001018af6de mono_sigctx_to_monoctx + 30
7   dont link                           0x000000010183f473 sgen_suspend_thread + 323
8   dont link                           0x000000010183f58e sgen_thread_handshake + 126
9   dont link                           0x000000010183fb20 sgen_client_stop_world + 1296
10  dont link                           0x0000000101871283 sgen_stop_world + 67
11  dont link                           0x0000000101870d43 sgen_perform_collection + 99
12  dont link                           0x0000000101872576 sgen_gc_collect + 102
13  dont link                           0x00000001018d1886 _ZL7pump_gcPv + 54
14  libsystem_pthread.dylib             0x000000010a0b7c13 _pthread_body + 131
15  libsystem_pthread.dylib             0x000000010a0b7b90 _pthread_body + 0
16  libsystem_pthread.dylib             0x000000010a0b5375 thread_start + 13
```

This was caused by a4e257a07f511062a8feb3e06e1566fd980110ce, the issue is that the check was changed from UCONTEXT_REG_RAX to MONO_SIGNAL_USE_UCONTEXT_T, but that is only available when HAVE_SIGACTION is defined which it is not in this case.

Discussed with Zoltan, fixing this by enabling MONO_SIGNAL_USE_UCONTEXT_T on all apple platforms for now.

8 years ago[runtime] Remove use of mono_raise_exception in mono_object_isinst_mbyref_checked
Aleksey Kliger [Mon, 28 Mar 2016 19:04:42 +0000 (15:04 -0400)]
[runtime] Remove use of mono_raise_exception in mono_object_isinst_mbyref_checked

8 years ago[remoting] Remove calls to mono_raise_exception
Aleksey Kliger [Tue, 29 Mar 2016 16:45:02 +0000 (12:45 -0400)]
[remoting] Remove calls to mono_raise_exception

1. MonoError-ize mono_remoting_wrapper icall.
   This is a bit this method is allowed to use
   mono_error_raise_exception: it is called from a
   MONO_WRAPPER_REMOTING_INVOKE method which is considered a "protected
   wrapper" in which the usual pending exception interruption check is a no-op.
2. Use mono_set_pending_exception in mono_marshal_set_domain_by_id icall

fixup f5dc934

8 years ago[mcs] Don't do empty array interpolation on user code, weird code expects empty array...
Marek Safar [Tue, 19 Apr 2016 17:14:44 +0000 (19:14 +0200)]
[mcs] Don't do empty array interpolation on user code, weird code expects empty array not to be equal

8 years ago[symbolicate] Switch to Cecil backend
Marek Safar [Tue, 19 Apr 2016 13:26:02 +0000 (15:26 +0200)]
[symbolicate] Switch to Cecil backend

8 years ago[monosymbolicate] Small cleanups
Marek Safar [Mon, 18 Apr 2016 19:19:45 +0000 (21:19 +0200)]
[monosymbolicate] Small cleanups

8 years agoSupport custom Xamarin Android HttpClient handler
Marek Habersack [Wed, 13 Apr 2016 07:12:08 +0000 (09:12 +0200)]
Support custom Xamarin Android HttpClient handler

Make it possible to select a default System.Net.HttpClient handler
on Android. Selection of the handler is handled on the Xamarin Android
side.

8 years agoMerge pull request #2863 from alexrp/windows-critsect-debug-info
Alex Rønne Petersen [Tue, 19 Apr 2016 09:48:24 +0000 (11:48 +0200)]
Merge pull request #2863 from alexrp/windows-critsect-debug-info

[utils/mutex] Initialize Win32 critical sections without debug info.

8 years ago[offsets-tool] Fix path to Options.cs
Rolf Bjarne Kvinge [Tue, 19 Apr 2016 08:41:25 +0000 (10:41 +0200)]
[offsets-tool] Fix path to Options.cs

8 years agoMerge pull request #2919 from lewurm/random-mini-stuff
monojenkins [Tue, 19 Apr 2016 07:15:21 +0000 (08:15 +0100)]
Merge pull request #2919 from lewurm/random-mini-stuff

Random mini stuff

@monojenkins merge

8 years ago[io-layer] Fail to modification time if it's beyond the limit allowed by the system...
Rodrigo Kumpera [Tue, 19 Apr 2016 00:03:26 +0000 (17:03 -0700)]
[io-layer] Fail to modification time if it's beyond the limit allowed by the system. Fixes #40368

This is the case for 32bits OSX that uses 32bits time_t for everything.

8 years agoMerge pull request #2821 from lambdageek/dev/monoerror-assembly
Aleksey Kliger (λgeek) [Mon, 18 Apr 2016 22:02:47 +0000 (18:02 -0400)]
Merge pull request #2821 from lambdageek/dev/monoerror-assembly

[assembly loader] Don't raise in mono_assembly_open_full and mono_assembly_load_with_partial_name

8 years agoMerge pull request #2910 from cptjazz/compiler_warnings
monojenkins [Mon, 18 Apr 2016 22:00:48 +0000 (23:00 +0100)]
Merge pull request #2910 from cptjazz/compiler_warnings

Fix undefined behaviour in left-shift.

This PR fixes a left-shift that relied on undefined behaviour.

Clang emitted the following warning (prior to this patch):
```
sgen-descriptor.c:189:54: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
   return desc | VECTOR_SUBTYPE_REFS | ((gssize)(-1) << 16);
                                        ~~~~~~~~~~~~ ^
```

8 years ago[debug] print exception name for conditional exception OP
Bernhard Urban [Tue, 12 Apr 2016 18:37:38 +0000 (11:37 -0700)]
[debug] print exception name for conditional exception OP

8 years ago[runtime] MonoError-ize mono_store_remote_field_new
Aleksey Kliger [Tue, 29 Mar 2016 16:38:51 +0000 (12:38 -0400)]
[runtime] MonoError-ize mono_store_remote_field_new

Mark mono_store_remote_field_new external only.
Runtime should use mono_store_remote_field_new_checked.
Change mono_marshal_get_stfld_remote_wrapper to use
mono_store_remote_field_new_icall instead of a native call.

8 years ago[runtime] MonoError-ize mono_store_remote_field
Aleksey Kliger [Tue, 29 Mar 2016 16:15:33 +0000 (12:15 -0400)]
[runtime] MonoError-ize mono_store_remote_field

Marked it external only.
Runtime should use mono_store_remote_field_checked.

8 years ago[runtime] MonoError-ize mono_load_remote_field_new
Aleksey Kliger [Mon, 28 Mar 2016 22:18:34 +0000 (18:18 -0400)]
[runtime] MonoError-ize mono_load_remote_field_new

Add mono_load_remote_field_new_checked.  Mark mono_load_remote_field_new
external only.  Add icall mono_load_remote_field_new_icall and use it in
remoting wrappers.

8 years ago[runtime] Add mono_load_remote_field_checked
Aleksey Kliger [Mon, 28 Mar 2016 21:25:43 +0000 (17:25 -0400)]
[runtime] Add mono_load_remote_field_checked

Update it to use MonoError.

Mark mono_load_remote_field external only.

8 years ago[runtime] MonoError-ize mono_method_return_message_restore
Aleksey Kliger [Mon, 28 Mar 2016 19:10:15 +0000 (15:10 -0400)]
[runtime] MonoError-ize mono_method_return_message_restore

8 years agoMerge pull request #2814 from lambdageek/dev/monoerror-appdomain
monojenkins [Mon, 18 Apr 2016 19:15:22 +0000 (20:15 +0100)]
Merge pull request #2814 from lambdageek/dev/monoerror-appdomain

[appdomain] Cleanup MonoError code

1. Assert in mono_get_corlib_version instead of raising an exn.
2. Don't raise in mono_domain_create_appdomain external API function.
3. Assert in mono_domain_assembly_postload_search instead of raising.
4. Don't raise in mono_domain_fire_assembly_load.
5. Use mono_error_set_pending_exception in
   ves_icall_System_AppDomain_InternalGetProcessGuid
6. Dont' raise in unload_thread_main, populate unload_data instead.

8 years agoBump version in configure.ac
Alexander Köplinger [Mon, 18 Apr 2016 18:22:56 +0000 (20:22 +0200)]
Bump version in configure.ac

8 years ago[marshal] use meaningful constant instead of hard coded value
Bernhard Urban [Thu, 7 Apr 2016 22:08:34 +0000 (15:08 -0700)]
[marshal] use meaningful constant instead of hard coded value

8 years ago[jit] Fix the linking of bblocks in mono_replace_ins () by avoiding iterating over...
Zoltan Varga [Mon, 18 Apr 2016 17:26:55 +0000 (13:26 -0400)]
[jit] Fix the linking of bblocks in mono_replace_ins () by avoiding iterating over an array which is modified in place by mono_unlink_bblock ().

8 years ago[tools] Add aot offsets generation tool.
Rolf Bjarne Kvinge [Mon, 18 Apr 2016 15:12:20 +0000 (17:12 +0200)]
[tools] Add aot offsets generation tool.

List of original contributors:

Marek Habersack <grendel@twistedcode.net>
João Matos <joao@tritao.eu>
Zoltan Varga <vargaz@gmail.com>
Rolf Bjarne Kvinge <rolf@xamarin.com>

8 years agoMerge pull request #2916 from ludovic-henry/fix-40306
Ludovic Henry [Mon, 18 Apr 2016 16:58:42 +0000 (18:58 +0200)]
Merge pull request #2916 from ludovic-henry/fix-40306

[threadpool-io] Fix crash on shutdownin System.Net.Sockets.Socket:Close_internal

8 years agoMerge pull request #2915 from poedgirl/master
monojenkins [Mon, 18 Apr 2016 14:05:26 +0000 (15:05 +0100)]
Merge pull request #2915 from poedgirl/master

Added support for SHA256, 384 and 512 in AuthenticodeDeformatter.

Due to the changes introduced by Microsoft to require signing with stronger algorithms, SHA-256, SHA-384 and SHA-512 support was needed.

This change is released under the MIT license.

8 years ago[threadpool-io] Fix crash on shutdownin System.Net.Sockets.Socket:Close_internal
Ludovic Henry [Mon, 18 Apr 2016 13:40:44 +0000 (15:40 +0200)]
[threadpool-io] Fix crash on shutdownin System.Net.Sockets.Socket:Close_internal

There could be a race between System.Net.Sockets.Socket:Close_internal and the io threadpool cleanup, which would lead to a native crash. That's because the io threadpool cleanup would clean the mutex, condition variables as well as close the sockets.

The easiest way to fix that is by cleaning only what's going to stop the runtime from shutting down, and in this case the background selector thread. The same is done for the threadpool where we just shutdown the monitor thread and the worker threads.

8 years agoAdded support for SHA256, 384 and 512 in AuthenticodeDeformatter.
Michelle Allen [Mon, 18 Apr 2016 08:31:10 +0000 (16:31 +0800)]
Added support for SHA256, 384 and 512 in AuthenticodeDeformatter.

Due to the changes introduced by Microsoft to require signing with stronger algorithms, SHA-256, SHA-384 and SHA-512 support was needed.

This change is released under the MIT license.

8 years agoMerge pull request #2897 from kumpera/marshal_fixes
monojenkins [Mon, 18 Apr 2016 05:00:21 +0000 (06:00 +0100)]
Merge pull request #2897 from kumpera/marshal_fixes

[marshal] Ensure marshal code emit the right indirect store when dealing with ref types.

The marshal code was using CEE_STIND_I for a lot of ref stores. This would not
generate a WB and is a heap corruption vector.

8 years agoImplement mono_threads_core_set_name() on NetBSD (#2914)
Kamil Rytarowski [Mon, 18 Apr 2016 01:55:53 +0000 (03:55 +0200)]
Implement mono_threads_core_set_name() on NetBSD (#2914)

Part of man-page showing this interface:

PTHREAD_GETNAME_NP(3)      Library Functions Manual      PTHREAD_GETNAME_NP(3)

NAME
     pthread_getname_np - get and set descriptive name of a thread

LIBRARY
     POSIX Threads Library (libpthread, -lpthread)

SYNOPSIS
     #include <pthread.h>

     int
     pthread_getname_np(pthread_t thread, char *name, size_t len);

     int
     pthread_setname_np(pthread_t thread, const char *name, void *arg);

   -- pthread_setname_np(3)

8 years agoMerge pull request #2913 from krytarowski/netbsd-support-11
Alexander Köplinger [Sun, 17 Apr 2016 22:52:40 +0000 (00:52 +0200)]
Merge pull request #2913 from krytarowski/netbsd-support-11

Remove stale file in the repository

8 years agoRemove stale file in the repository
Kamil Rytarowski [Sun, 17 Apr 2016 22:48:26 +0000 (00:48 +0200)]
Remove stale file in the repository

The .orig files are traditionally files of patch(1) and diff(1) tools.
Remove stale file Makefile.orig as it is generating false positives for
grabbing patches from a directory tree.

8 years agoMerge pull request #2912 from krytarowski/netbsd-support-10
Alexander Köplinger [Sun, 17 Apr 2016 22:12:49 +0000 (00:12 +0200)]
Merge pull request #2912 from krytarowski/netbsd-support-10

Remove unportable shell construct detected on NetBSD

8 years agoMerge pull request #2911 from akoeplinger/handleref
monojenkins [Sun, 17 Apr 2016 21:55:19 +0000 (22:55 +0100)]
Merge pull request #2911 from akoeplinger/handleref

[metadata] Don't require HandleRef in domain.c

In 1da6b7629701e71afed2a28c86e7a9cb0f2c6f07 loading of System.Runtime.InteropServices.HandleRef
was changed from optional to required. This caused errors in the maccore tests:

```
MONO_PATH=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/64/Build /Users/builder/data/lanes/1411/5ca65b46/source/maccore/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt  --aot=mtriple=arm64-ios,data-outfile=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/System.arm64.aotdata,static,asmonly,direct-icalls,full,dwarfdebug,no-direct-calls,outfile=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.s "/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/64/Build/System.dll"
Runtime critical type System.Runtime.InteropServices.HandleRef not found
AOT Compilation exited with code 134, command:
```

@monojenkins merge

8 years agoRemove unportable shell construct detected on NetBSD
Kamil Rytarowski [Sun, 17 Apr 2016 20:45:26 +0000 (22:45 +0200)]
Remove unportable shell construct detected on NetBSD

8 years ago[metadata] Don't require HandleRef in domain.c
Alexander Köplinger [Sun, 17 Apr 2016 18:22:04 +0000 (20:22 +0200)]
[metadata] Don't require HandleRef in domain.c

In 1da6b7629701e71afed2a28c86e7a9cb0f2c6f07 loading of System.Runtime.InteropServices.HandleRef
was changed from optional to required. This caused errors in the maccore tests:

```
MONO_PATH=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/64/Build /Users/builder/data/lanes/1411/5ca65b46/source/maccore/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt  --aot=mtriple=arm64-ios,data-outfile=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/System.arm64.aotdata,static,asmonly,direct-icalls,full,dwarfdebug,no-direct-calls,outfile=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.s "/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/64/Build/System.dll"
Runtime critical type System.Runtime.InteropServices.HandleRef not found
AOT Compilation exited with code 134, command:
```

8 years agoMerge pull request #2908 from krytarowski/netbsd-support-8
Alexander Köplinger [Sun, 17 Apr 2016 18:08:00 +0000 (20:08 +0200)]
Merge pull request #2908 from krytarowski/netbsd-support-8

Add new ./configure target & xtarget: arm*-netbsd*-eabi*

8 years agoMerge pull request #2907 from krytarowski/netbsd-support-7
Alexander Köplinger [Sun, 17 Apr 2016 18:07:38 +0000 (20:07 +0200)]
Merge pull request #2907 from krytarowski/netbsd-support-7

Improve NetBSD target handling in ./configure

8 years agoMerge pull request #2906 from krytarowski/netbsd-support-6
Alexander Köplinger [Sun, 17 Apr 2016 18:06:56 +0000 (20:06 +0200)]
Merge pull request #2906 from krytarowski/netbsd-support-6

Welcome to ARM ucontext registers on NetBSD

8 years ago[tests/verifier] Fix a few issues in the Makefile
Alexander Köplinger [Sun, 17 Apr 2016 17:04:58 +0000 (19:04 +0200)]
[tests/verifier] Fix a few issues in the Makefile

gmcs and ilasm2 are no longer distributed with Mono.

The run-test step had several issues that prevented it from running,
e.g. the comments caused "unexpected end of line" issues on OSX.

8 years agoMerge pull request 2899 from krytarowski/netbsd-support-1
Alexander Köplinger [Sun, 17 Apr 2016 17:24:59 +0000 (19:24 +0200)]
Merge pull request 2899 from krytarowski/netbsd-support-1

Improve shell portability on NetBSD

The "test" command, as well as the "[" command, are not required to know
the "==" operator.

Comparing with empty strings ("") might lead to unspecified results.

Replace unportable shell loops:
    for I in {2..6}; do ..; done
with POSIX ones:
    I=2; while [ $I -le 6 ]; do ..; I=$((I + 1)); done

8 years agoFix undefined behaviour in left-shift.
Alexander Jesner [Sun, 17 Apr 2016 16:31:32 +0000 (18:31 +0200)]
Fix undefined behaviour in left-shift.

8 years agoAdd new ./configure target & xtarget: arm*-netbsd*-eabi*
Kamil Rytarowski [Sun, 17 Apr 2016 14:04:53 +0000 (16:04 +0200)]
Add new ./configure target & xtarget: arm*-netbsd*-eabi*

Example GNU triplets:

evbarm 7.0 NetBSD ignored arm arm-unknown-netbsdelf7.0
evbarm 7.0 NetBSD ignored armeb armeb-unknown-netbsdelf7.0
evbarm 7.0 NetBSD ignored earmv6 armv6-unknown-netbsdelf7.0-eabi
evbarm 7.0 NetBSD ignored earmv6eb armv6eb-unknown-netbsdelf7.0-eabi
evbarm 7.0 NetBSD ignored earmv6hf armv6-unknown-netbsdelf7.0-eabihf
evbarm 7.0 NetBSD ignored earmv6hfeb armv6eb-unknown-netbsdelf7.0-eabihf
evbarm 7.0 NetBSD ignored earmv7 armv7-unknown-netbsdelf7.0-eabi
evbarm 7.0 NetBSD ignored earmv7eb armv7eb-unknown-netbsdelf7.0-eabi
evbarm 7.0 NetBSD ignored earmv7hf armv7-unknown-netbsdelf7.0-eabihf
evbarm 7.0 NetBSD ignored earmv7hfeb armv7eb-unknown-netbsdelf7.0-eabihf

-- http://git.savannah.gnu.org/cgit/config.git/tree/testsuite/config-guess.data

For now support just EABI targets (available since ARMv4).

8 years agoImprove NetBSD target handling in ./configure
Kamil Rytarowski [Sun, 17 Apr 2016 13:47:20 +0000 (15:47 +0200)]
Improve NetBSD target handling in ./configure

Stop hardcoding libc and linbintl versions.
Add support for libsqlite and libsqlite3.

8 years agoWelcome to ARM ucontext registers on NetBSD
Kamil Rytarowski [Sun, 17 Apr 2016 13:39:13 +0000 (15:39 +0200)]
Welcome to ARM ucontext registers on NetBSD

8 years agoImprove shell portability on NetBSD
Kamil Rytarowski [Sat, 16 Apr 2016 20:50:23 +0000 (22:50 +0200)]
Improve shell portability on NetBSD

The "test" command, as well as the "[" command, are not required to know
the "==" operator.

Comparing with empty strings ("") might lead to unspecified results.

Replace unportable shell loops:
    for I in {2..6}; do ..; done
with POSIX ones:
    I=2; while [ $I -le 6 ]; do ..; I=$((I + 1)); done

8 years agoMerge pull request #2900 from krytarowski/netbsd-support-2
Alexander Köplinger [Sun, 17 Apr 2016 11:37:21 +0000 (13:37 +0200)]
Merge pull request #2900 from krytarowski/netbsd-support-2

Fix shell portability in configure.ac for NetBSD

8 years agoMerge pull request #2904 from krytarowski/netbsd-support-5
Alexander Köplinger [Sun, 17 Apr 2016 11:36:33 +0000 (13:36 +0200)]
Merge pull request #2904 from krytarowski/netbsd-support-5

Include <errno.h> for errno on NetBSD

8 years agoMerge pull request #2898 from ludovic-henry/fix-process-hasexited
Alexander Köplinger [Sun, 17 Apr 2016 11:35:31 +0000 (13:35 +0200)]
Merge pull request #2898 from ludovic-henry/fix-process-hasexited

[corlib] Fix WaitHandle.Wait{One,Any,All} when runtime returns WAIT_FAILED

8 years agoMerge pull request #2905 from directhex/force-dpkg-architecture
Alexander Köplinger [Sun, 17 Apr 2016 11:10:15 +0000 (13:10 +0200)]
Merge pull request #2905 from directhex/force-dpkg-architecture

[jenkins] Force build arch = dpkg arch, on Debian systems

8 years ago[jenkins] Force build arch = dpkg arch, on Debian systems
Jo Shields [Sun, 17 Apr 2016 08:28:54 +0000 (09:28 +0100)]
[jenkins] Force build arch = dpkg arch, on Debian systems

Autotools misdetects architecture when using chroots, e.g. tries to do an x86_64 build on an x86_64 system in an i386 chroot

8 years agoMerge pull request #2901 from krytarowski/netbsd-support-3
Alexander Köplinger [Sun, 17 Apr 2016 01:56:38 +0000 (03:56 +0200)]
Merge pull request #2901 from krytarowski/netbsd-support-3

Define access to R8-R11 regs in ucontext on NetBSD/AMD64

8 years ago[System] Replace websocket echo test server with corefx one (#2902)
Alexander Köplinger [Sun, 17 Apr 2016 01:33:24 +0000 (03:33 +0200)]
[System] Replace websocket echo test server with corefx one (#2902)

echo.websocket.org is down since yesterday. Let's use the one that corefx uses for now.

8 years agoInclude <errno.h> for errno on NetBSD
Kamil Rytarowski [Sun, 17 Apr 2016 01:31:52 +0000 (03:31 +0200)]
Include <errno.h> for errno on NetBSD

The <sys/errno.h> header on NetBSD declares only a list of ERROR values.

This fixes the following build issue:

In file included from ../../mono/utils/mono-proclib.h:7:0,
                 from mono-proclib.c:8:
mono-proclib.c: In function 'mono_cpu_usage':
mono-proclib.c:893:54: error: 'errno' undeclared (first use in this function)
   g_error ("getrusage() failed, errno is %d (%s)\n", errno, strerror (errno));
                                                      ^
../../eglib/src/glib.h:600:70: note: in definition of macro 'g_error'
 #define g_error(...)    do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__); for (;;); } while (0)
                                                                      ^
mono-proclib.c:893:54: note: each undeclared identifier is reported only once for each function it appears in
   g_error ("getrusage() failed, errno is %d (%s)\n", errno, strerror (errno));
                                                      ^
../../eglib/src/glib.h:600:70: note: in definition of macro 'g_error'
 #define g_error(...)    do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__); for (;;); } while (0)

8 years agoDefine access to R8-R11 regs in ucontext on NetBSD/AMD64
Kamil Rytarowski [Sat, 16 Apr 2016 23:01:19 +0000 (01:01 +0200)]
Define access to R8-R11 regs in ucontext on NetBSD/AMD64

8 years agoFix shell portability in configure.ac for NetBSD
Kamil Rytarowski [Sat, 16 Apr 2016 21:39:52 +0000 (23:39 +0200)]
Fix shell portability in configure.ac for NetBSD

8 years ago[corlib] Fix WaitHandle.Wait{One,Any,All} when runtime returns WAIT_FAILED
Ludovic Henry [Fri, 15 Apr 2016 15:39:51 +0000 (17:39 +0200)]
[corlib] Fix WaitHandle.Wait{One,Any,All} when runtime returns WAIT_FAILED

In case the runtime would fail to wait on the wait handle(s), we would still return true, as if the WaitHandle was successfully signaled

8 years agoMerge pull request #2890 from mono/alexischr/remove-managed-alloc-string-zeroing
Alexis Christoforides [Sat, 16 Apr 2016 10:24:17 +0000 (06:24 -0400)]
Merge pull request #2890 from mono/alexischr/remove-managed-alloc-string-zeroing

[sgen] Remove unnecessary and wrong IL code on string managed allocators

8 years ago[System] Remove MONO_X509_ALIAS
Marek Safar [Sat, 16 Apr 2016 06:56:38 +0000 (08:56 +0200)]
[System] Remove MONO_X509_ALIAS

8 years ago[System] Remove PrebuiltSystem alias (it's not needed with any modern mcs)
Marek Safar [Sat, 16 Apr 2016 06:35:50 +0000 (08:35 +0200)]
[System] Remove PrebuiltSystem alias (it's not needed with any modern mcs)

8 years agoMerge pull request #2417 from razzfazz/guard_substr
Alexis Christoforides [Sat, 16 Apr 2016 02:57:33 +0000 (22:57 -0400)]
Merge pull request #2417 from razzfazz/guard_substr

handle path stripping correctly for root of watched tree

8 years agoMerge pull request #2889 from mono/alexischr/canary-sizecalc-change-impact
Alexis Christoforides [Sat, 16 Apr 2016 02:35:47 +0000 (22:35 -0400)]
Merge pull request #2889 from mono/alexischr/canary-sizecalc-change-impact

[sgen] "align-up" requested allocation sizes within the managed alloc…

8 years ago[runtime] Fix warnings.
Zoltan Varga [Sat, 16 Apr 2016 00:11:20 +0000 (20:11 -0400)]
[runtime] Fix warnings.

8 years agoMerge pull request #2894 from marek-safar/mono.security
Marek Safar [Fri, 15 Apr 2016 22:41:02 +0000 (00:41 +0200)]
Merge pull request #2894 from marek-safar/mono.security

[build] Fixes Mono.Security dependency

8 years ago[marshal] Ensure marshal code emit the right indirect store when dealing with ref...
Rodrigo Kumpera [Fri, 15 Apr 2016 22:19:37 +0000 (15:19 -0700)]
[marshal] Ensure marshal code emit the right indirect store when dealing with ref types.

The marshal code was using CEE_STIND_I for a lot of ref stores. This would not
generate a WB and is a heap corruption vector.

8 years agoMerge pull request #2893 from kumpera/fix_29585
monojenkins [Fri, 15 Apr 2016 17:05:39 +0000 (18:05 +0100)]
Merge pull request #2893 from kumpera/fix_29585

Fix #29585.

@monojenkins merge.

8 years ago[mono-api-html] Fix path in csproj.
Rolf Bjarne Kvinge [Fri, 15 Apr 2016 15:38:01 +0000 (17:38 +0200)]
[mono-api-html] Fix path in csproj.

8 years ago[mcs] Better error message for conflict of types with the same name
Marek Safar [Fri, 15 Apr 2016 15:28:19 +0000 (17:28 +0200)]
[mcs] Better error message for conflict of types with the same name

8 years ago[build] Fixes Mono.Security dependency
Marek Safar [Fri, 15 Apr 2016 13:41:14 +0000 (15:41 +0200)]
[build] Fixes Mono.Security dependency

8 years agoMerge pull request #2887 from lewurm/fix-jit-pass-name
monojenkins [Fri, 15 Apr 2016 12:41:00 +0000 (13:41 +0100)]
Merge pull request #2887 from lewurm/fix-jit-pass-name

[jit] fix stats name for method_to_ir pass

we settled for underscores

@monojenkins merge.

8 years agoMerge pull request #2885 from ntherning/fix_test_op_il_seq_point_sh_on_cygwin_2_4_1
Alexander Köplinger [Fri, 15 Apr 2016 11:49:53 +0000 (13:49 +0200)]
Merge pull request #2885 from ntherning/fix_test_op_il_seq_point_sh_on_cygwin_2_4_1

Fixes for  'make check-seq-points' on Cygwin

8 years agoMerge pull request #2878 from kumpera/mach_fixes
Rodrigo Kumpera [Fri, 15 Apr 2016 09:11:46 +0000 (02:11 -0700)]
Merge pull request #2878 from kumpera/mach_fixes

Add retry logic to mach function calls.

8 years ago[mcs] No optional parameters tie breaking rules for delegates overload resolution
Marek Safar [Fri, 15 Apr 2016 08:41:05 +0000 (10:41 +0200)]
[mcs] No optional parameters tie breaking rules for delegates overload resolution

8 years agoAdd regression test.
Rodrigo Kumpera [Fri, 15 Apr 2016 00:53:55 +0000 (17:53 -0700)]
Add regression test.

8 years ago[corlib] Fix CspParametersTest.Ctor test
Alexander Köplinger [Fri, 15 Apr 2016 00:53:49 +0000 (02:53 +0200)]
[corlib] Fix CspParametersTest.Ctor test

This essentially reapplies ae2f50e57fb39a005a80303d21a956e89ec36a8b which was inadvertently changed back in 27f07c8095e50cc8be3c5155fcc929a119267db0.

It started failing again after 255ce320b0da31b6e50cef084a4079039ccb39d6 reapplied a fix that was also inadvertently removed (https://github.com/mono/referencesource/commit/8c7937a9e7cc3f61f9ceb6a9d6f19fefdf1672b0).

8 years ago[runtime] Fix mono_class_inflate_generic_method_full_checked handle of partially...
Rodrigo Kumpera [Fri, 15 Apr 2016 00:39:44 +0000 (17:39 -0700)]
[runtime] Fix mono_class_inflate_generic_method_full_checked handle of partially inflated generic methods. Fixes #29585.

The problem here was that the function was not correctly setting is_generic when handling partially inflated methods.

The working scenario was method 'Foo<A>::Bar<B>' inflated with (Something<Else>;)[1] resulting in Foo<Something<Else>>::Bar<B>.

This would work because the is_generic check would verify that the supplied context has no method_inst, thus had to remain a GMD.

The problematic one would be inflating Foo<Something<A>>::Bar<B> with (Else;) resulting too in Foo<Something<Else>>::Bar<B>.

To handle this, we would first extract the root method definition [2] and then inflate the original method context with the supplied
context. So we end up with Foo<A>::Bar<B> and inflate (Something<A>;B) with (Else;) resulting in (Something<Else>;B) *1*.

Finally, we would inflate Foo<A>::Bar<B>  with that new context, resulting in Foo<Something<Else>>::Bar<B>.

The resulting method is the same in both scenarios, but context used for inflation is different in that in the second case
it includes the GMD method instantiation (The B in *1*).

This would trip up the computation of whether we ended up with a GMD or not.

The right check, though, is not whether the inflation context has a method instantiation or not, but whether the resulting method
has the same method context as the root GMD[2].

This affected #29585 since disabling some optimizations triggered things to be inflated in different ways.

[1] (Something<Else>;) means a context with a class instantiation and no method instantiation
[2] The GMD defined on the GTD.

8 years ago[jit] fix stats name for method_to_ir pass
Bernhard Urban [Thu, 14 Apr 2016 21:14:45 +0000 (14:14 -0700)]
[jit] fix stats name for method_to_ir pass

we settled for underscores

8 years ago[sgen] Remove unnecessary and wrong IL code on string managed allocators
Alexis Christoforides [Thu, 24 Mar 2016 14:06:34 +0000 (10:06 -0400)]
[sgen] Remove unnecessary and wrong IL code on string managed allocators
This appears to have been copied from Boehm, but here we are not responsible for zeroing.
Also, 's->chars [len]' is not the same as 'align_up (s + size) - 2', so this was corrupting canaries.

8 years ago[sgen] "align-up" requested allocation sizes within the managed allocator, instead...
Alexis Christoforides [Thu, 24 Mar 2016 13:56:50 +0000 (09:56 -0400)]
[sgen] "align-up" requested allocation sizes within the managed allocator, instead of sometimes before.
All code paths will still align-up the size to be allocated, but now it's easier to gather the real size of an object.