mono.git
8 years ago[mobile_static] Fixed AES class usage for mobile_static profile
Alexander Kyte [Mon, 18 Jan 2016 19:54:58 +0000 (14:54 -0500)]
[mobile_static] Fixed AES class usage for mobile_static profile

8 years ago[bcl/build] Move the config include before setting platform if it is missing, otherwi...
Alexander Kyte [Fri, 15 Jan 2016 20:15:01 +0000 (15:15 -0500)]
[bcl/build] Move the config include before setting platform if it is missing, otherwise wrong platform file included

8 years ago[mobile_static] Work around a test that breaks with aot loading
Alexander Kyte [Thu, 14 Jan 2016 23:54:12 +0000 (18:54 -0500)]
[mobile_static] Work around a test that breaks with aot loading

8 years ago[mobile_static] Fix test by replicating monotouch behavior
Alexander Kyte [Thu, 14 Jan 2016 22:27:32 +0000 (17:27 -0500)]
[mobile_static] Fix test by replicating monotouch behavior

8 years ago[mobile_static] Disable task test described to fail on Touch.Unit and clearly on...
Alexander Kyte [Thu, 14 Jan 2016 22:19:35 +0000 (17:19 -0500)]
[mobile_static] Disable task test described to fail on Touch.Unit and clearly on mobile_static

8 years ago[bcl] Mark finalizer-dependent test as not working because finalizers are not guarant...
Alexander Kyte [Thu, 14 Jan 2016 22:13:06 +0000 (17:13 -0500)]
[bcl] Mark finalizer-dependent test as not working because finalizers are not guaranteed, too flaky for bcl test suite

8 years ago[bcl] Add current directory to reflection lookup path to fix nunit-lite tests.
Alexander Kyte [Thu, 14 Jan 2016 21:36:43 +0000 (16:36 -0500)]
[bcl] Add current directory to reflection lookup path to fix nunit-lite tests.

8 years ago[mobile_static] Fixed test that needed test .dlls explicitly named
Alexander Kyte [Thu, 14 Jan 2016 21:35:57 +0000 (16:35 -0500)]
[mobile_static] Fixed test that needed test .dlls explicitly named

8 years ago[mobile_static] Added missing mobile_static blacklists
Alexander Kyte [Thu, 14 Jan 2016 21:09:55 +0000 (16:09 -0500)]
[mobile_static] Added missing mobile_static blacklists

8 years ago[bcl] Remove trailing whitespace from corlib_test.dll.sources
Alexander Kyte [Thu, 14 Jan 2016 21:09:28 +0000 (16:09 -0500)]
[bcl] Remove trailing whitespace from corlib_test.dll.sources

8 years ago[mobile_static] Don't run vts tests on mobile_static
Alexander Kyte [Thu, 14 Jan 2016 19:32:11 +0000 (14:32 -0500)]
[mobile_static] Don't run vts tests on mobile_static

8 years ago[mobile_static] Exclude the MobileNotWorking category on mobile_static
Alexander Kyte [Wed, 13 Jan 2016 20:38:03 +0000 (15:38 -0500)]
[mobile_static] Exclude the MobileNotWorking category on mobile_static

8 years ago[bcl/mobile] Fixed TimeZoneTest on non-xammac/non-monotouch mobile profiles
Alexander Kyte [Wed, 13 Jan 2016 20:17:03 +0000 (15:17 -0500)]
[bcl/mobile] Fixed TimeZoneTest on non-xammac/non-monotouch mobile profiles

8 years ago[bcl] Exclude tests for mobile_static excluded on monotouch
Alexander Kyte [Wed, 13 Jan 2016 19:55:52 +0000 (14:55 -0500)]
[bcl] Exclude tests for mobile_static excluded on monotouch

8 years ago[bcl] Add mobile_static sources/excludes based on monotouch excluded tests
Alexander Kyte [Wed, 13 Jan 2016 19:45:11 +0000 (14:45 -0500)]
[bcl] Add mobile_static sources/excludes based on monotouch excluded tests

8 years ago[mobile_static] Remove include of Mono.Posix.dll on mobile static, which isn't build
Alexander Kyte [Wed, 13 Jan 2016 19:40:06 +0000 (14:40 -0500)]
[mobile_static] Remove include of Mono.Posix.dll on mobile static, which isn't build

8 years ago[bcl] Make the bcl build system respect .excludes for test suites
Alexander Kyte [Wed, 13 Jan 2016 19:38:45 +0000 (14:38 -0500)]
[bcl] Make the bcl build system respect .excludes for test suites

8 years ago[bcl] Fix gensources undesired behavior, see full message
Alexander Kyte [Wed, 13 Jan 2016 19:34:14 +0000 (14:34 -0500)]
[bcl] Fix gensources undesired behavior, see full message

So we were previously taking the set symmetric difference of the
.sources and the .excludes files. This is semantically wrong, and the
change makes us take the difference. What we were doing is concatenating
the two files and taking any lines that are only seen once. If a file is
in excludes and not in sources, then we will include it. This is wrong.
This change always duplicates excludes, so anything present in excludes
is seen at least twice. This has the effect of making sure that only
things in .sources but not in .excludes are in the output file.

8 years ago[nunit-lite] Use nunit-lite in the build system if variable set, set for mobile_static
Alexander Kyte [Wed, 13 Jan 2016 17:55:02 +0000 (12:55 -0500)]
[nunit-lite] Use nunit-lite in the build system if variable set, set for mobile_static

8 years ago[nunit-lite] Add NUnitLite fork as submodule and build through makefiles
Alexander Kyte [Wed, 13 Jan 2016 17:10:01 +0000 (12:10 -0500)]
[nunit-lite] Add NUnitLite fork as submodule and build through makefiles
in /mcs/tools/nunit-lite

8 years ago[runtime] Add SA_RESTART to SIG{CONT,INT,PROF,QUIT,USR2,WINCH}.
Alex Rønne Petersen [Fri, 22 Jan 2016 19:57:06 +0000 (20:57 +0100)]
[runtime] Add SA_RESTART to SIG{CONT,INT,PROF,QUIT,USR2,WINCH}.

We need this as these signals can be delivered at any point and can interrupt
system calls that external (non-Mono) code is executing, which such code may
not be written to handle gracefully.

8 years ago[system] Avoid reflection use to create NtlmSession. Fixes #37732
Sebastien Pouliot [Fri, 22 Jan 2016 19:19:46 +0000 (14:19 -0500)]
[system] Avoid reflection use to create NtlmSession. Fixes #37732

commit d2325f1483cd642457a7b2efe402e3c1d414d69d (only since 4.3.2, not
4.3.1) caused the failure when an application is linked.

The use of `GetOrCreateValue` uses reflection to create an `NtlmSession`
instance so the linker won't see it as used anymore (and removes it).

Fixed by avoiding reflection (which will also perform better).

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

8 years ago[runtime] Fix warning
Ludovic Henry [Fri, 22 Jan 2016 18:25:31 +0000 (18:25 +0000)]
[runtime] Fix warning

8 years ago[mcs] String interpolating of dynamic arguments does not behave like normal dynamic...
Marek Safar [Fri, 22 Jan 2016 17:19:49 +0000 (18:19 +0100)]
[mcs] String interpolating of dynamic arguments does not behave like normal dynamic operation but assumes all arguments are object only (not dynamic). Fixes #37886

8 years ago[amd64] Fix setting ainfo->pair_size[1] to 1 instead of 0 if the argument is only...
Zoltan Varga [Fri, 22 Jan 2016 16:27:44 +0000 (11:27 -0500)]
[amd64] Fix setting ainfo->pair_size[1] to 1 instead of 0 if the argument is only passed in one reg.

8 years agoMerge pull request #2494 from nealef/master
Alexander Köplinger [Fri, 22 Jan 2016 15:40:41 +0000 (16:40 +0100)]
Merge pull request #2494 from nealef/master

Adjust last fix to bypass another compiler failing

8 years agoAdjust last fix to bypass another compiler failing
Neale [Fri, 22 Jan 2016 15:36:28 +0000 (10:36 -0500)]
Adjust last fix to bypass another compiler failing

8 years ago[runtime] Use MonoError for mono_thread_attach_full
Ludovic Henry [Fri, 22 Jan 2016 14:39:44 +0000 (14:39 +0000)]
[runtime] Use MonoError for mono_thread_attach_full

8 years ago[runtime] Use MonoError for new_thread_with_internal
Ludovic Henry [Fri, 22 Jan 2016 14:33:04 +0000 (14:33 +0000)]
[runtime] Use MonoError for new_thread_with_internal

8 years agoMerge pull request #2476 from ludovic-henry/fix-process-readbuffer-nullref
Alexander Köplinger [Fri, 22 Jan 2016 14:02:39 +0000 (15:02 +0100)]
Merge pull request #2476 from ludovic-henry/fix-process-readbuffer-nullref

[Process] Fix NullReferenceException in AsyncStreamReader.ReadBuffer after disposing the Process

8 years ago[Process] Fix NullReferenceException in AsyncStreamReader.ReadBuffer after disposing...
Ludovic Henry [Tue, 19 Jan 2016 19:14:43 +0000 (19:14 +0000)]
[Process] Fix NullReferenceException in AsyncStreamReader.ReadBuffer after disposing the Process

The following exception would arise if we dispose the Process before making sure the AsyncStreamReader finished its work:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at System.Diagnostics.AsyncStreamReader.ReadBuffer (IAsyncResult ar) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs:158
  at System.IO.Stream+ReadWriteTask.InvokeAsyncCallback (System.Object completedTask) [0x00015] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:670
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x0008d] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:957
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:904
  at System.IO.Stream+ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke (System.Threading.Tasks.Task completingTask) [0x0005e] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:696
  at System.Threading.Tasks.Task.FinishContinuations () [0x0009a] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:3633
  at System.Threading.Tasks.Task.FinishStageThree () [0x00045] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2366
  at System.Threading.Tasks.Task.FinishStageTwo () [0x000f8] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2339
  at System.Threading.Tasks.Task.Finish (Boolean bUserDelegateExecuted) [0x00049] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2239
  at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) [0x00079] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2834
  at System.Threading.Tasks.Task.ExecuteEntry (Boolean bPreventDoubleExecution) [0x0006f] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2760
  at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2707
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:857
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:1212

This would arise in test-runner.cs when one of the test would timeout, leading to the Process being disposed. This would then dispose the AsyncStreamReader, setting its `stream` value to null. The callback to ReadBuffer would then try to access `stream`, but would throw a NullReferenceException. By not disposing the AsyncStreamReader explicitely, we close the stream first, which will trigger a call to ReadBuffer, thus not triggering the NullReferenceException.

8 years agoMerge pull request #2482 from akoeplinger/mono-posix-test-fix
Alexander Köplinger [Fri, 22 Jan 2016 13:38:16 +0000 (14:38 +0100)]
Merge pull request #2482 from akoeplinger/mono-posix-test-fix

[Mono.Posix] Make UnixSignalTest.TestRaiseStorm() more reliable

8 years ago[runtime] Use MonoError for create_thread_object and create_internal_thread
Ludovic Henry [Fri, 22 Jan 2016 12:31:52 +0000 (12:31 +0000)]
[runtime] Use MonoError for create_thread_object and create_internal_thread

8 years ago[runtime] Use MonoError for mono_array_new_specific
Ludovic Henry [Fri, 22 Jan 2016 11:55:34 +0000 (11:55 +0000)]
[runtime] Use MonoError for mono_array_new_specific

8 years ago[runtime] Use MonoError for mono_array_new_full
Ludovic Henry [Thu, 21 Jan 2016 15:54:18 +0000 (15:54 +0000)]
[runtime] Use MonoError for mono_array_new_full

8 years agoMerge pull request #2477 from ludovic-henry/monoerror-mono_object_new_alloc_specific
Ludovic Henry [Fri, 22 Jan 2016 11:13:58 +0000 (11:13 +0000)]
Merge pull request #2477 from ludovic-henry/monoerror-mono_object_new_alloc_specific

[runtime] Use MonoError for mono_object_new_alloc_specific

8 years agoMerge pull request #2488 from nealef/master
Zoltan Varga [Fri, 22 Jan 2016 03:28:16 +0000 (22:28 -0500)]
Merge pull request #2488 from nealef/master



8 years agoTo get around a problem with gcc 4.4.7 on s390x, the SWAP macro is reworked so that...
Neale [Fri, 22 Jan 2016 02:41:44 +0000 (21:41 -0500)]
To get around a problem with gcc 4.4.7 on s390x, the SWAP macro is reworked so that it correctly processes all elements

8 years ago[runtime] Use MonoError for mono_string_new_size
Ludovic Henry [Thu, 21 Jan 2016 16:20:03 +0000 (16:20 +0000)]
[runtime] Use MonoError for mono_string_new_size

8 years ago[runtime] Use MonoError for mono_object_new_alloc_specific
Ludovic Henry [Thu, 21 Jan 2016 14:46:59 +0000 (14:46 +0000)]
[runtime] Use MonoError for mono_object_new_alloc_specific

8 years agoMerge pull request #2485 from ludovic-henry/monoerror-mono_marshal_alloc
Rodrigo Kumpera [Fri, 22 Jan 2016 00:55:39 +0000 (19:55 -0500)]
Merge pull request #2485 from ludovic-henry/monoerror-mono_marshal_alloc

[runtime] Use MonoError for mono_marshal_alloc

8 years agoMerge pull request #2484 from ludovic-henry/monoerror-mono_string_get_pinned
Rodrigo Kumpera [Fri, 22 Jan 2016 00:54:37 +0000 (19:54 -0500)]
Merge pull request #2484 from ludovic-henry/monoerror-mono_string_get_pinned

[runtime] Use MonoError for mono_string_get_pinned

8 years agoMerge pull request #2480 from ludovic-henry/monoerror-mono_object_clone
Rodrigo Kumpera [Fri, 22 Jan 2016 00:41:07 +0000 (19:41 -0500)]
Merge pull request #2480 from ludovic-henry/monoerror-mono_object_clone

[runtime] Use MonoError for mono_object_clone

8 years agoMerge pull request #2479 from ludovic-henry/monoerror-mono_object_new_mature
Rodrigo Kumpera [Fri, 22 Jan 2016 00:39:45 +0000 (19:39 -0500)]
Merge pull request #2479 from ludovic-henry/monoerror-mono_object_new_mature

[runtime] Use MonoError for mono_object_new_mature

8 years agoMerge pull request #2478 from ludovic-henry/monoerror-mono_object_new_fast
Rodrigo Kumpera [Fri, 22 Jan 2016 00:39:13 +0000 (19:39 -0500)]
Merge pull request #2478 from ludovic-henry/monoerror-mono_object_new_fast

[runtime] Use MonoError for mono_object_new_fast

8 years agoMerge pull request #2462 from ludovic-henry/monoerror-mono_object_new_specific
Rodrigo Kumpera [Fri, 22 Jan 2016 00:33:58 +0000 (19:33 -0500)]
Merge pull request #2462 from ludovic-henry/monoerror-mono_object_new_specific

[runtime] Use MonoError for mono_object_new_specific

8 years agoMerge pull request #2458 from ludovic-henry/monoerror-mono_domain_create_appdomain_in...
Rodrigo Kumpera [Thu, 21 Jan 2016 23:47:35 +0000 (18:47 -0500)]
Merge pull request #2458 from ludovic-henry/monoerror-mono_domain_create_appdomain_internal

[runtime] Use MonoError for mono_domain_create_appdomain_internal

8 years agoMerge pull request #2457 from ludovic-henry/monoerror-mono_make_shadow_copy
Rodrigo Kumpera [Thu, 21 Jan 2016 23:46:22 +0000 (18:46 -0500)]
Merge pull request #2457 from ludovic-henry/monoerror-mono_make_shadow_copy

[runtime] Use MonoError for mono_make_shadow_copy

8 years ago[nunit-lite] Use nunit-lite in the build system if variable set, set for mobile_static
Alexander Kyte [Wed, 13 Jan 2016 17:55:02 +0000 (12:55 -0500)]
[nunit-lite] Use nunit-lite in the build system if variable set, set for mobile_static

8 years ago[nunit-lite] Add NUnitLite fork as submodule and build through makefiles
Alexander Kyte [Wed, 13 Jan 2016 17:10:01 +0000 (12:10 -0500)]
[nunit-lite] Add NUnitLite fork as submodule and build through makefiles
in /mcs/tools/nunit-lite

8 years ago[bcl] Fix a System.Core test failure caused by a method linked away.
Zoltan Varga [Thu, 21 Jan 2016 22:23:53 +0000 (17:23 -0500)]
[bcl] Fix a System.Core test failure caused by a method linked away.

8 years ago[runtime] Fix type mismatch between runtime invoke and aot compiler
Alexander Kyte [Thu, 21 Jan 2016 21:37:26 +0000 (16:37 -0500)]
[runtime] Fix type mismatch between runtime invoke and aot compiler

We were using get_runtime_invoke_type () to reduce the number of
wrappers we were using by sharing the wrappers that have MONO_TYPE_I
with that of MONO_TYPE_PTR. They have the same size, but these are not
valid types to share because they have different levels of indirection,
so runtime wrappers that have been aot'ed for the MONO_TYPE_I will be
used for MONO_TYPE_PTR and will dereference the value in the first word
of the pointer. In the case that this is null, we observed a segfault.

Specifically, the wrapper code in marshal.c looks like so:

```
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_I4:
case MONO_TYPE_U4:
case MONO_TYPE_R4:
case MONO_TYPE_R8:
case MONO_TYPE_I8:
case MONO_TYPE_U8:
mono_mb_emit_byte (mb, CEE_LDIND_I);
mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i]));
break;
case MONO_TYPE_STRING:
case MONO_TYPE_CLASS:
case MONO_TYPE_ARRAY:
case MONO_TYPE_PTR:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i]));
break;
```

showing that the two types are not equivalent.

8 years ago[llvmonly] Fix the addition of gsharedvt out wrappers on calls from gsharedvt to...
Zoltan Varga [Thu, 21 Jan 2016 21:29:53 +0000 (16:29 -0500)]
[llvmonly] Fix the addition of gsharedvt out wrappers on calls from gsharedvt to normal code.

8 years agoMerge pull request #2474 from kumpera/compact_mono_error
Rodrigo Kumpera [Thu, 21 Jan 2016 21:19:31 +0000 (16:19 -0500)]
Merge pull request #2474 from kumpera/compact_mono_error

[MonoError] Introduce fast (and short) macros for initing and checking MonoError. Optimize its size.

8 years ago[MonoError] Fix the definition of init_error.
Rodrigo Kumpera [Thu, 21 Jan 2016 21:13:21 +0000 (16:13 -0500)]
[MonoError] Fix the definition of init_error.

8 years ago[Mono.Security]: Add 'MonoTlsSettings.EnabledCiphers'.
Martin Baulig [Thu, 21 Jan 2016 20:46:45 +0000 (21:46 +0100)]
[Mono.Security]: Add 'MonoTlsSettings.EnabledCiphers'.

(cherry picked from commit 79c7c38cc608f3fe896c450131f42dfeddf0d3b4)

8 years ago[jit] Fix the reference type detection for Volatile:Read/Write (). Fixes part of...
Zoltan Varga [Thu, 21 Jan 2016 19:30:44 +0000 (14:30 -0500)]
[jit] Fix the reference type detection for Volatile:Read/Write (). Fixes part of #37846.

8 years ago[marshal] Inline mono_gc_out_of_memory to explicitly raise an exception
Ludovic Henry [Thu, 21 Jan 2016 17:41:13 +0000 (17:41 +0000)]
[marshal] Inline mono_gc_out_of_memory to explicitly raise an exception

8 years agoMerge pull request #2387 from BrzVlad/feature-concurrent-scanfunc
Mark Probst [Thu, 21 Jan 2016 17:40:48 +0000 (09:40 -0800)]
Merge pull request #2387 from BrzVlad/feature-concurrent-scanfunc

[sgen] Use separate object ops when not evacuating in the concurrent case

8 years agoMerge pull request #2388 from BrzVlad/feature-los-caching
Mark Probst [Thu, 21 Jan 2016 17:39:37 +0000 (09:39 -0800)]
Merge pull request #2388 from BrzVlad/feature-los-caching

[sgen] Improve caching of los objects

8 years ago[runtime] Use MonoError for mono_marshal_alloc
Ludovic Henry [Thu, 21 Jan 2016 17:37:32 +0000 (17:37 +0000)]
[runtime] Use MonoError for mono_marshal_alloc

8 years ago[runtime] Use MonoError for mono_string_get_pinned
Ludovic Henry [Thu, 21 Jan 2016 16:52:32 +0000 (16:52 +0000)]
[runtime] Use MonoError for mono_string_get_pinned

8 years ago[runtime] Use MonoError for mono_object_clone
Ludovic Henry [Thu, 21 Jan 2016 15:18:31 +0000 (15:18 +0000)]
[runtime] Use MonoError for mono_object_clone

8 years ago[runtime] Use MonoError for mono_object_new_mature
Ludovic Henry [Thu, 21 Jan 2016 15:07:26 +0000 (15:07 +0000)]
[runtime] Use MonoError for mono_object_new_mature

8 years ago[runtime] Use MonoError for mono_object_new_fast
Ludovic Henry [Thu, 21 Jan 2016 15:03:05 +0000 (15:03 +0000)]
[runtime] Use MonoError for mono_object_new_fast

8 years ago[runtime] Use MonoError for mono_object_new_specific
Ludovic Henry [Wed, 20 Jan 2016 14:26:13 +0000 (14:26 +0000)]
[runtime] Use MonoError for mono_object_new_specific

8 years agoMerge pull request #2472 from kumpera/gc_api_fixes
Rodrigo Kumpera [Thu, 21 Jan 2016 16:54:02 +0000 (11:54 -0500)]
Merge pull request #2472 from kumpera/gc_api_fixes

[gc] Change the GC interface to be friendlier to coop and misc cleanups.

8 years ago[Mono.Posix] Make UnixSignalTest.TestRaiseStorm() more reliable
Alexander Köplinger [Thu, 21 Jan 2016 16:11:18 +0000 (17:11 +0100)]
[Mono.Posix] Make UnixSignalTest.TestRaiseStorm() more reliable

The test was reenabled in 3f3df2694529b6fc3b88bf9c83c76d792ff47428 and we were seeing it randomly fail
on Jenkins on OSX like that:

```
[...]
***** MonoTests.Mono.Unix.UnixSignalTest.TestNoEmitAny
***** MonoTests.Mono.Unix.UnixSignalTest.TestRaise
***** MonoTests.Mono.Unix.UnixSignalTest.TestRaiseAny
***** MonoTests.Mono.Unix.UnixSignalTest.TestRaiseStorm
/bin/sh: line 1: 40164 Hangup: 1               PATH="/Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/runtime/_tmpinst/bin:/opt/mono/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" MONO_REGISTRY_PATH="/Users/builder/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" MONO_PATH="./../../class/lib/net_4_x::$MONO_PATH" /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/runtime/mono-wrapper --debug ./../../class/lib/net_4_x/nunit-console.exe Mono.Posix_test_net_4_x.dll -noshadow -labels -exclude=NotOnMac,NotWorking,ValueAdd,CAS,InetAccess -labels -xml=TestResult-net_4_x.xml
make[1]: *** [run-test-lib] Error 1
make[1]: Leaving directory `/Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/Mono.Posix'
make: *** [do-run-test] Error 1
```

The problem is that (especially on OSX it seems) the signals raised by the threads in the test can be
delivered after we closed the UnixSignal, which means the default behavior of terminating the program kicks in.

The simplest fix is to just sleep for some time to make sure the signal is delivered and ignored before closing.

8 years agoMerge pull request #2471 from ludovic-henry/checkedbuild-disable-mempool
monojenkins [Thu, 21 Jan 2016 15:05:16 +0000 (15:05 +0000)]
Merge pull request #2471 from ludovic-henry/checkedbuild-disable-mempool

[checked-build] Add compile flag to disable checked-build tests selectively

8 years ago[checked-build] Add compile flag to disable checked-build tests selectively
Ludovic Henry [Wed, 20 Jan 2016 20:12:33 +0000 (20:12 +0000)]
[checked-build] Add compile flag to disable checked-build tests selectively

8 years agoMerge pull request #2475 from sandyarmstrong/getcultureinfo-37848
Marek Safar [Thu, 21 Jan 2016 08:32:25 +0000 (09:32 +0100)]
Merge pull request #2475 from sandyarmstrong/getcultureinfo-37848

[corlib] Throw correct exception for GetCultureInfo(0)

8 years ago[corlib] Throw correct exception for GetCultureInfo(0)
Sandy Armstrong [Wed, 20 Jan 2016 18:42:05 +0000 (10:42 -0800)]
[corlib] Throw correct exception for GetCultureInfo(0)

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

8 years agoAdd mono-error macros for init and check.
Rodrigo Kumpera [Wed, 20 Jan 2016 23:52:02 +0000 (18:52 -0500)]
Add mono-error macros for init and check.

8 years ago[MonoError] Don't use type_name for the argument name, it will produce weird results...
Rodrigo Kumpera [Thu, 21 Jan 2016 01:32:25 +0000 (20:32 -0500)]
[MonoError] Don't use type_name for the argument name, it will produce weird results with mono_error_get_message.

8 years ago[MonoError] Reduce the size of MonoError to conserve stack space.
Rodrigo Kumpera [Thu, 21 Jan 2016 01:15:06 +0000 (20:15 -0500)]
[MonoError] Reduce the size of MonoError to conserve stack space.

This eliminates the builtin 128 bytes char array in MonoError and forces the error message to be always malloc'd.

It makes the code simpler and sacrifices a bit in terms of what we can handle in the case of a malloc OOM.

Malloc OOM is not a solvable problem for a few reasons.
1) Overcommit and virtual memory makes relying on malloc returning zero not an useful thing.
2) Everything goes south when malloc starts to fail. There's nothing much the runtime can do beyond
give up.

OTOH, saving stack space is pretty nice for its own reasons.

1) Clang now generates stack guards by default for frames larger than 120 bytes on amd64. This
means that MonoError has a much bigger overhead than needed.

2) We conservatively scan the stack and, with this change, those are 128 bytes less for the gc to figure out.

On ABI compatibility. We promise backward but not forward compatibility. Meaning someone compiling against 4.4
can't expect it to works against 4.2, but vice versa is fine.

We can handle old users because the struct is now smaller and has always being opaque, meaning callers just
a bit of waste space and that's it.

8 years ago[boehm] Fix the usage of G_UNLIKELY.
Rodrigo Kumpera [Thu, 21 Jan 2016 00:44:20 +0000 (19:44 -0500)]
[boehm] Fix the usage of G_UNLIKELY.

8 years ago[llvmonly] Make sure the signature of unbox trampolines matches the method they are...
Zoltan Varga [Wed, 20 Jan 2016 22:23:56 +0000 (17:23 -0500)]
[llvmonly] Make sure the signature of unbox trampolines matches the method they are calling.

8 years ago[gc] Simplify mono_object_new_pinned.
Rodrigo Kumpera [Wed, 20 Jan 2016 21:40:02 +0000 (16:40 -0500)]
[gc] Simplify mono_object_new_pinned.

Remove #ifdef around that function and make it register objects for finalization as other alloc functions do.

8 years ago[gc] Introduce mono_object_new_mature in the same fashion as the other alloc functions.
Rodrigo Kumpera [Wed, 20 Jan 2016 21:09:46 +0000 (16:09 -0500)]
[gc] Introduce mono_object_new_mature in the same fashion as the other alloc functions.

This means the following:
mono_object_new_mature handles OOM and finalization.
GC glue code returns NULL on failure and doesn't deal with finalization.

Finally, correctly implement mono_gc_alloc_mature in boehm and null-gc instead of the
semantically different implementation we had before.

8 years ago[gc] Move OOM handling into the runtime from the GC.
Rodrigo Kumpera [Wed, 20 Jan 2016 19:51:52 +0000 (14:51 -0500)]
[gc] Move OOM handling into the runtime from the GC.

The current gc interface requires the GC to call mono_gc_out_of_memory on allocation failure.

It won't work if we move away from implementing it with mono_raise_exception as we need to manually bubble
the OOM all the up to the m2n border.

The good thing is that this simplified the gc interface and actually fixes a corner case bug in sgen where
it did not call mono_gc_out_of_memory on alloc failure.

8 years ago[llvmonly] Fix runtime invoke calls to gsharedvt methods without variable signatures...
Zoltan Varga [Wed, 20 Jan 2016 20:47:30 +0000 (15:47 -0500)]
[llvmonly] Fix runtime invoke calls to gsharedvt methods without variable signatures. Add gsharedvt out wrappers and in wrappers for delegate invoke wrappers.

8 years ago[runtime] Add a new helper function mono_method_get_full_name (), which is similar...
Zoltan Varga [Wed, 20 Jan 2016 20:33:44 +0000 (15:33 -0500)]
[runtime] Add a new helper function mono_method_get_full_name (), which is similar to mono_method_full_name (), but the result includes the return type as well.

8 years agoMerge pull request #2465 from alexanderkyte/remoting_debugger_ifdef_fix
Zoltan Varga [Wed, 20 Jan 2016 16:28:38 +0000 (11:28 -0500)]
Merge pull request #2465 from alexanderkyte/remoting_debugger_ifdef_fix

[runtime] ifdef out remoting function call in debugger

8 years ago[runtime] ifdef out remoting function call in debugger
Alexander Kyte [Wed, 20 Jan 2016 16:13:38 +0000 (11:13 -0500)]
[runtime] ifdef out remoting function call in debugger

8 years ago[runtime] Use MonoError for mono_domain_create_appdomain_internal
Ludovic Henry [Mon, 18 Jan 2016 20:54:07 +0000 (20:54 +0000)]
[runtime] Use MonoError for mono_domain_create_appdomain_internal

8 years ago[runtime] Use MonoError for mono_make_shadow_copy
Ludovic Henry [Mon, 18 Jan 2016 19:38:28 +0000 (19:38 +0000)]
[runtime] Use MonoError for mono_make_shadow_copy

8 years ago[llvmonly] Fix the type of the vret_addr argument.
Zoltan Varga [Wed, 20 Jan 2016 02:40:45 +0000 (21:40 -0500)]
[llvmonly] Fix the type of the vret_addr argument.

8 years ago[System]: Change namespace for some internal classes.
Martin Baulig [Mon, 18 Jan 2016 19:50:27 +0000 (20:50 +0100)]
[System]: Change namespace for some internal classes.

(cherry picked from commit 997513da02db9a4a448231e115da36b31814a6c0)

8 years ago[System]: Remove unpredictable pluggable setup and cleanup APIs.
Martin Baulig [Tue, 19 Jan 2016 17:16:46 +0000 (18:16 +0100)]
[System]: Remove unpredictable pluggable setup and cleanup APIs.

(cherry picked from commit 2d945d75bb1abb3a750e6fa2bc0facb768228dbb)

8 years ago[aot] Enable -O=gsharedvt by default when its supported on the platform.
Zoltan Varga [Tue, 19 Jan 2016 22:56:05 +0000 (17:56 -0500)]
[aot] Enable -O=gsharedvt by default when its supported on the platform.

8 years ago[aot] Small refactoring for gsharedvt method lookup.
Zoltan Varga [Tue, 19 Jan 2016 22:49:49 +0000 (17:49 -0500)]
[aot] Small refactoring for gsharedvt method lookup.

8 years ago[llvmonly] Set the del->rgctx field for delegates created using reflection as well.
Zoltan Varga [Tue, 19 Jan 2016 20:57:32 +0000 (15:57 -0500)]
[llvmonly] Set the del->rgctx field for delegates created using reflection as well.

8 years ago[runtime] Avoid a read-after-free in JI table that frees tomstones. Fixes some of...
Rodrigo Kumpera [Tue, 19 Jan 2016 20:47:35 +0000 (15:47 -0500)]
[runtime] Avoid a read-after-free in JI table that frees tomstones. Fixes some of the crashes in #36851.

Due to how JI table search works, tombstones must be malloc'd as they must have the same address range
of the JI they are replacing.

Since tombstones are heap allocated, they must be freed together with the chunks they belong to.

The current code free tombstones when the chunk refcount goes to zero. The freeing code identify
tombstones by looping through the chunk entries.

The problem is that, under heavy contention, a domain can have multiple tables live at the same time.
It happens there's another thread using the old table while the first creates the new one.

During that period of multiple live tables, we don't free JIs straight away, we queue them to be
freed together with the next table to go through it.

So far so good. Here's the problematic scenario:

1) We expand the JI table, there's contention and the old old is delay freed.
While doing it, chunk X is split. Meaning its refcount will remain 1.

2) JI Y that belongs to chunk X is freed, the tombstone is installed in a chunk of the new table.
That chunk *is not* X.
Since there was contention in (1), Y is put in jit_info_free_queue.

3) We run mono_jit_info_table_free for the old table.

3.a) We free all delayed JIs. Y is freed.
3.b) The old table is freed, chunk X will be freed too, since its refcount dropped to zero.
We walk X looking for tombstones, which includes a pointer to Y, which is freed memory at this point.

I found this issue to be possible with delegates being marshaled to function pointers.
Part (1) just requires a process with high activity, like XS.
Part 2 & 3 requires really bad scheduling in that once sgen restarts the world, the finalizer thread
runs before mono_thread_hazardous_try_free_some (done right after dropping the GC lock).
An alternate to bad scheduling is that the finalizer thread was suspended holding the domain lock and
now after restart, it forces the GC initiator to deschedule when it tries to get that lock.

It goes without saying that this bug is EXTREMELY hard to reproduce. It required me to change the runtime
to force all the above conditions to happen. Let me mention them in case someone needs it:

- In mono_thread_hazardous_free_or_queue, I commented the calls to try_free_delayed_free_item to avoid
freeing the old table too early. I changed the conditional so free_func is never called straight away.

- In mono_thread_hazardous_try_free_some I added a sleep of 100ms, this gave the finalizer thread enough
time to free some JIs.

Finally, the fix itself, the solution is pretty straightforward. Stop scanning chunks and store a singly
linked list of tombstones installed in a given chunk. We build that list by coopting next_jit_code_hash
for this use.

This is safe because chunks are ref counted so we know nothing else could point to those tombstones and
when we copy a chunk into a new one we remove all tombstones.

8 years ago[Mono.Posix] Add support for sending and receiving socket control messages
Steffen Kieß [Tue, 19 Jan 2016 19:43:07 +0000 (20:43 +0100)]
[Mono.Posix] Add support for sending and receiving socket control messages

Add wrappers for struct cmsghdr, the macros for manipulating control
messages (CMSG_*) and recvmsg() and sendmsg().

8 years ago[tests] Output more debug information in case of test-runner.exe crash
Ludovic Henry [Tue, 19 Jan 2016 18:46:27 +0000 (18:46 +0000)]
[tests] Output more debug information in case of test-runner.exe crash

8 years ago[io-layer] Fix tarball broken by 39393f118d6a532ccca30a9103a3dd0febdfbef6
Alexander Köplinger [Tue, 19 Jan 2016 14:25:02 +0000 (15:25 +0100)]
[io-layer] Fix tarball broken by 39393f118d6a532ccca30a9103a3dd0febdfbef6

A new file io-trace.h was added but not listed in any Makefile sources anywhere so it didn't end up in the tarball.

8 years agoMerge pull request #2433 from alexrp/thread-volatile-semantics
Alex Rønne Petersen [Tue, 19 Jan 2016 13:02:51 +0000 (14:02 +0100)]
Merge pull request #2433 from alexrp/thread-volatile-semantics

[runtime] Make VolatileRead/VolatileWrite semantics compatible with MS.NET.

8 years agoMerge pull request #2399 from alexanderkyte/seq_point_nostop
Zoltan Varga [Tue, 19 Jan 2016 09:40:24 +0000 (04:40 -0500)]
Merge pull request #2399 from alexanderkyte/seq_point_nostop

[runtime] Use explicit loop checking to remove depth limitation of sequence point search.

8 years agoMerge pull request #2397 from alexanderkyte/debugger_appdomain
Zoltan Varga [Tue, 19 Jan 2016 09:39:54 +0000 (04:39 -0500)]
Merge pull request #2397 from alexanderkyte/debugger_appdomain

[runtime] Read fields out of TransparentProxies correctly in debugger agent FIXES 36823

8 years agoMerge pull request #2450 from grendello/io-layer-trace
Marek Habersack [Tue, 19 Jan 2016 07:49:42 +0000 (08:49 +0100)]
Merge pull request #2450 from grendello/io-layer-trace

Replace the old DEBUG messages with calls to mono_trace.