mono.git
8 years ago[xbuild] Remove ErrorTest.TestExecute1()
Ankit Jain [Fri, 11 Mar 2016 19:46:51 +0000 (14:46 -0500)]
[xbuild] Remove ErrorTest.TestExecute1()

This was an incorrect test. Tasks can't really be used like this
especially this once since it tries to Log an error, but it hasn't been
assigned a BuildEngine yet!

Other fixes in TaskLoggingHelper expose this issue.

8 years agoMerge pull request #2751 from akoeplinger/fix-msbuild-remapping
monojenkins [Fri, 11 Mar 2016 15:45:21 +0000 (15:45 +0000)]
Merge pull request #2751 from akoeplinger/fix-msbuild-remapping

Fix msbuild remapping

First commit:
```
Revert "Do not remap framework assembly if it's version is higher than the runtime version"

It would cause issues on mobile, cause the runtime version is 2.0.5.0 there and loading
e.g. System.dll v4.0 would no longer be mapped to that version anymore after this change.
```
---
Second commit:
```
[runtime] Stop remapping higher versions of
 Microsoft.Build.Framework/Engine and remap Microsoft.Build.Utilities/Tasks
 (.v3.5)

The previous remapping was added in 725ed3f82400b1466ca17e99b85adcbde54238ca, but it didn't actually
fix the bug in https://bugzilla.xamarin.com/show_bug.cgi?id=32561.

The underlying cause of the bug is that in Mono 4.0 we removed the 2.0/3.5 profiles.
This meant that Microsoft.Build.Utilities.dll and Microsoft.Build.Utilities.v3.5.dll weren't installed
in the GAC anymore, because MSBuild 4.0 uses Microsoft.Build.Utilities.v4.0.dll, so the app failed
to load the 2.0 version of the assembly. The same applies for the .Tasks variants.

We remap earlier versions of the Microsoft.Build.Utilities/Tasks assemblies to the v4.0 version.
I've introduced another item in the AssemblyVersionMap struct which allows remapping to target a different
assembly name, because MSBuild made the questionable decision to put the version number in the assembly name.
While strictly speaking this is not what .NET is doing (it just fails there if .NET 2.0 isn't installed)
on Mono there's no way to install those older profiles anymore, so we remap them to v4.0 to keep apps working.

Newer versions of Microsoft.Build.Framework/Engine (like 12.0, 14.0) however have the same name, so we need to be
more careful here and only do a remapping to the 4.0 version if it's an earlier version (e.g. 2.0 -> 4.0).
This avoids issues with accidentally remapping 14.0 -> 4.0.

I tested the app from the bug report and it now works fine.
```

8 years ago[runtime] Stop remapping higher versions of Microsoft.Build.Framework/Engine and...
Alexander Köplinger [Thu, 10 Mar 2016 21:17:12 +0000 (22:17 +0100)]
[runtime] Stop remapping higher versions of Microsoft.Build.Framework/Engine and remap Microsoft.Build.Utilities/Tasks (.v3.5)

The previous remapping was added in 725ed3f82400b1466ca17e99b85adcbde54238ca, but it didn't actually
fix the bug in https://bugzilla.xamarin.com/show_bug.cgi?id=32561.

The underlying cause of the bug is that in Mono 4.0 we removed the 2.0/3.5 profiles.
This meant that Microsoft.Build.Utilities.dll and Microsoft.Build.Utilities.v3.5.dll weren't installed
in the GAC anymore, because MSBuild 4.0 uses Microsoft.Build.Utilities.v4.0.dll, so the app failed
to load the 2.0 version of the assembly. The same applies for the .Tasks variants.

We remap earlier versions of the Microsoft.Build.Utilities/Tasks assemblies to the v4.0 version.
I've introduced another item in the AssemblyVersionMap struct which allows remapping to target a different
assembly name, because MSBuild made the questionable decision to put the version number in the assembly name.
While strictly speaking this is not what .NET is doing (it just fails there if .NET 2.0 isn't installed)
on Mono there's no way to install those older profiles anymore, so we remap them to v4.0 to keep apps working.

Newer versions of Microsoft.Build.Framework/Engine (like 12.0, 14.0) however have the same name, so we need to be
more careful here and only do a remapping to the 4.0 version if it's an earlier version (e.g. 2.0 -> 4.0).
This avoids issues with accidentally remapping 14.0 -> 4.0.

I tested the app from the bug report and it now works fine.

8 years ago[System] Bump CTS timeout in BlockingCollectionTests
Alexander Köplinger [Thu, 10 Mar 2016 23:37:16 +0000 (00:37 +0100)]
[System] Bump CTS timeout in BlockingCollectionTests

Saw a few failures on Jenkins on the slower ARM machines over the last days:

```
) MonoTests.System.Collections.Concurrent.BlockingCollectionTests.AddAnyCancellable : System.OperationCanceledException : The operation was canceled.
at System.Collections.Concurrent.BlockingCollection`1[T].TryAddToAnyCore (System.Collections.Concurrent.BlockingCollection`1[] collections, System.Collections.Concurrent.T item, Int32 millisecondsTimeout, CancellationToken externalCancellationToken) [0x00092] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs:1041
at System.Collections.Concurrent.BlockingCollection`1[T].TryAddToAny (System.Collections.Concurrent.BlockingCollection`1[] collections, System.Collections.Concurrent.T item, Int32 millisecondsTimeout, CancellationToken cancellationToken) [0x00006] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs:971
at System.Collections.Concurrent.BlockingCollection`1[T].AddToAny (System.Collections.Concurrent.BlockingCollection`1[] collections, System.Collections.Concurrent.T item, CancellationToken cancellationToken) <0x4421bf18 + 0x0002b> in <filename unknown>:0
at MonoTests.System.Collections.Concurrent.BlockingCollectionTests.AddAnyCancellable () [0x00031] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs:276
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0003d] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs:103
```

100ms is likely just too short, bumping it.

8 years agoMerge pull request #2749 from BrzVlad/fix-suspend-deadlock
monojenkins [Thu, 10 Mar 2016 23:20:19 +0000 (23:20 +0000)]
Merge pull request #2749 from BrzVlad/fix-suspend-deadlock

[runtime] Fix deadlock while unwinding the stack of suspended thread

A suspended thread, in non-coop case, can be holding runtime locks. When the suspender tries to unwind the stack for this thread, it might require taking of runtime locks (ex. in aot case we might search for the jit info in the aot image and then register it, which requires the domain lock). Mark the suspender thread as running in async context while it unwinds other threads.

8 years agoRevert "Do not remap framework assembly if it's version is higher than the runtime...
Alexander Köplinger [Thu, 10 Mar 2016 21:06:09 +0000 (22:06 +0100)]
Revert "Do not remap framework assembly if it's version is higher than the runtime version"

This reverts commit 100bd760a46811121b4b47ebba941d4fb98486ab.

It would cause issues on mobile, cause the runtime version is 2.0.5.0 there and loading e.g. System.dll v4.0 would
no longer be mapped to that version anymore after this change.

8 years ago[runtime] Fix monodroid build
Alexander Köplinger [Thu, 10 Mar 2016 18:44:02 +0000 (19:44 +0100)]
[runtime] Fix monodroid build

8 years agoMerge pull request #2744 from akoeplinger/convert-fixes
Marek Safar [Thu, 10 Mar 2016 17:43:04 +0000 (18:43 +0100)]
Merge pull request #2744 from akoeplinger/convert-fixes

[corlib] Fix Convert.ToUInt32 not throwing OverflowException with a too large number

8 years ago[mcs] Codegen update for specialized struct initialization with awaited element initi...
Marek Safar [Thu, 10 Mar 2016 16:53:21 +0000 (17:53 +0100)]
[mcs] Codegen update for specialized struct initialization with awaited element initializer. Fixes #39459

8 years ago[tests] Add test for assembly remapping change from 100bd760a46811121b4b47ebba941d4fb...
Alexander Köplinger [Thu, 10 Mar 2016 00:40:21 +0000 (01:40 +0100)]
[tests] Add test for assembly remapping change from 100bd760a46811121b4b47ebba941d4fb98486ab

Testing for the remap message via grep isn't ideal, a better way to verify the assembly
version would be to check asm.GetName().Version, but unfortunately in the test environment
when MONO_PATH is set the assembly loading always fallsback to a simple file name matching
in the directory so we end up with the wrong (v4.0) assembly in that case.

8 years agoMerge pull request #2733 from ludovic-henry/fix-mono_cpu_count
Alexander Köplinger [Thu, 10 Mar 2016 15:02:40 +0000 (16:02 +0100)]
Merge pull request #2733 from ludovic-henry/fix-mono_cpu_count

[utils] Make distinction between configured and online CPU count

8 years ago[jit] Add a separate header file for llvm-jit.cpp.
Zoltan Varga [Thu, 10 Mar 2016 14:44:58 +0000 (15:44 +0100)]
[jit] Add a separate header file for llvm-jit.cpp.

8 years ago[corlib] Fix Convert.ToUInt32 not throwing OverflowException with a too large number
Alexander Köplinger [Wed, 9 Mar 2016 18:16:13 +0000 (19:16 +0100)]
[corlib] Fix Convert.ToUInt32 not throwing OverflowException with a too large number

This was revealed by the CoreCLR tests/src/CoreMangLib/cti/system/convert/converttouint3219.exe test.

When we tried to convert a number larger than UInt32.MaxValue (in this case 4933891728) we would cast
the intermediate result to uint which overflows and makes the end result smaller which means we don't throw.

Storing the intermediate result in a long before checking for the correct range fixes this.

Added a few additional tests that I felt were missing and/or only present for other Convert.* methods.
I found two more cases that don't throw OverflowException but fixing it looked more involved so I punted
and just ignored them with a FIXME for now.

8 years ago[utils] Make distinction between ARM platforms for CPU count
Ludovic Henry [Tue, 8 Mar 2016 19:49:35 +0000 (19:49 +0000)]
[utils] Make distinction between ARM platforms for CPU count

ARM platform tends to try very hard to save power by switching off CPUs. This could lead to inconsistencies in the value returned by mono_cpu_count

Recap from Alexander Köplinger <alex.koeplinger@outlook.com>:

When we merged the change from PR #2722, we started seeing random failures on ARM in the MonoTests.System.Threading.ThreadPoolTests.SetAndGetMaxThreads and MonoTests.System.Threading.ManualResetEventSlimTests.Constructor_Defaults tests. Both of those tests are dealing with Environment.ProcessorCount to verify some implementation details.

It turns out that on the Jetson TK1 board we use on public Jenkins and on ARM kernels in general, the value returned by sched_getaffinity (or _SC_NPROCESSORS_ONLN) doesn't contain CPUs/cores that are powered off for power saving reasons. This is contrary to what happens on x86, where even cores in deep-sleep state are returned [1], [2]. This means that we would get a processor count of 1 at one point in time and a higher value when load increases later on as the system wakes CPUs.

Various runtime pieces like the threadpool and also user code however relies on the value returned by Environment.ProcessorCount e.g. for deciding how many parallel tasks to start, thereby limiting the performance when that code thinks we only have one CPU.

Talking to a few people, this was the reason why we changed to _SC_NPROCESSORS_CONF in https://github.com/mono/mono/pull/1688 and why we added a special case for Android in https://github.com/mono/mono/commit/de3addcde5bf875dcd43d3e2c6536d61871e7675 to get the "real" number of processors in the system.

Because of those issues Android/Dalvik also switched from _ONLN to _SC_NPROCESSORS_CONF for the Java API Runtime.availableProcessors() too [3], citing:
> Traditionally this returned the number currently online,
but many mobile devices are able to take unused cores offline to
save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of
cores that could be made available if there were no power or heat
constraints.

The problem with sticking to _SC_NPROCESSORS_CONF however is that it breaks down in constrained environments like Docker or with an explicit CPU affinity set by the Linux `taskset` command, They'd get a higher CPU count than can be used, start more threads etc. which results in unnecessary context switches and overloaded systems. That's why we need to respect sched_getaffinity.

So while in an ideal world we would be able to rely on sched_getaffinity/_SC_NPROCESSORS_ONLN to return the number of theoretically available CPUs regardless of power saving measures everywhere, we can't do this on ARM.

I think the pragmatic solution is the following:
* use sched_getaffinity (+ fallback to _SC_NPROCESSORS_ONLN in case of error) on x86. This ensures we're inline with what OpenJDK [4] and CoreCLR [5] do
* use _SC_NPROCESSORS_CONF exclusively on ARM (I think we could eventually even get rid of the PLATFORM_ANDROID special case)

Thoughts?

Helpful links:

[1] https://sourceware.org/ml/libc-alpha/2013-07/msg00383.html
[2] https://lists.01.org/pipermail/powertop/2012-September/000433.html
[3] https://android.googlesource.com/platform/libcore/+/750dc634e56c58d1d04f6a138734ac2b772900b5%5E1..750dc634e56c58d1d04f6a138734ac2b772900b5/
[4] https://bugs.openjdk.java.net/browse/JDK-6515172
[5] https://github.com/dotnet/coreclr/blob/7058273693db2555f127ce16e6b0c5b40fb04867/src/pal/src/misc/sysinfo.cpp#L148

8 years ago[build] Define HOST_* architecture
Ludovic Henry [Thu, 10 Mar 2016 10:45:48 +0000 (10:45 +0000)]
[build] Define HOST_* architecture

8 years agoMerge pull request #2732 from radical/asm_remap
monojenkins [Thu, 10 Mar 2016 04:00:18 +0000 (04:00 +0000)]
Merge pull request #2732 from radical/asm_remap

Do not remap framework assembly if it's version is higher than the ru…

…ntime version

Currently, assemblies like Microsoft.Build.Framework and
Microsoft.Build.Engine get remapped to the current runtime version, at
load time. This means that if an assembly references the above
assemblies with a version like `14.1.0.0`, then that would get remapped
to `4.0.0.0`. This is incorrect behavior and breaks msbuild. Instead,
now we do the remapping only if the requested version is lower than the
runtime version.

8 years agoMerge pull request #2741 from akoeplinger/acceptance-tests-split
Alexander Köplinger [Wed, 9 Mar 2016 22:42:27 +0000 (23:42 +0100)]
Merge pull request #2741 from akoeplinger/acceptance-tests-split

A few improvements to acceptance-tests

8 years agoMerge pull request #2743 from qmfrederik/fixes/complete-eventsource-3
Marek Safar [Wed, 9 Mar 2016 22:26:15 +0000 (23:26 +0100)]
Merge pull request #2743 from qmfrederik/fixes/complete-eventsource-3

System.Diagnostics.Tracing: Add EventListener and related classes

8 years ago[xbuild] Remove explicit warning level set when csproj does not have it and leave...
Marek Safar [Wed, 9 Mar 2016 22:17:49 +0000 (23:17 +0100)]
[xbuild] Remove explicit warning level set when csproj does not have it and leave the default to compiler

8 years ago[runtime] Fix deadlock while unwinding the stack of suspended thread
Vlad Brezae [Wed, 9 Mar 2016 21:27:19 +0000 (23:27 +0200)]
[runtime] Fix deadlock while unwinding the stack of suspended thread

A suspended thread, in non-coop case, can be holding runtime locks. When the suspender tries to unwind the stack for this thread, it might require taking of runtime locks (ex. in aot case we might search for the jit info in the aot image and then register it, which requires the domain lock). Mark the suspender thread as running in async context while it unwinds other threads.

8 years agoDo not remap framework assembly if it's version is higher than the runtime version
Ankit Jain [Tue, 23 Feb 2016 21:03:48 +0000 (16:03 -0500)]
Do not remap framework assembly if it's version is higher than the runtime version

Currently, assemblies like Microsoft.Build.Framework and
Microsoft.Build.Engine get remapped to the current runtime version, at
load time. This means that if an assembly references the above
assemblies with a version like `14.1.0.0`, then that would get remapped
to `4.0.0.0`. This is incorrect behavior and breaks msbuild. Instead,
now we do the remapping only if the requested version is lower than the
runtime version.

@akoplinger: This will actually impact xbuild too right now because
we're defaulting to xbuild 14.0 in Mono 4.4 now so we'd see messages
like Mono: The request to load the assembly Microsoft.Build.Framework
v14.0.0.0 was remapped to v4.0.0.0 in the assembly loading log, which
will break in very subtle ways.

8 years agoBump ikdasm
Marek Safar [Wed, 9 Mar 2016 18:27:16 +0000 (19:27 +0100)]
Bump ikdasm

8 years agoSystem.Diagnostics.Tracing: Add EventListener and related classes
Frederik Carlier [Sun, 13 Dec 2015 14:53:30 +0000 (14:53 +0000)]
System.Diagnostics.Tracing: Add EventListener and related classes

8 years agoMerge pull request #2742 from mono/revert-2738-fixes/complete-eventsource-2
Marek Safar [Wed, 9 Mar 2016 17:58:29 +0000 (18:58 +0100)]
Merge pull request #2742 from mono/revert-2738-fixes/complete-eventsource-2

Revert "Add EventListener and EventListenerEventArgs to Mono"

8 years agoRevert "Add EventListener and EventListenerEventArgs to Mono"
Marek Safar [Wed, 9 Mar 2016 17:58:13 +0000 (18:58 +0100)]
Revert "Add EventListener and EventListenerEventArgs to Mono"

8 years ago[acceptance-tests] Better description in readme
Alexander Köplinger [Wed, 9 Mar 2016 17:33:59 +0000 (18:33 +0100)]
[acceptance-tests] Better description in readme

8 years agoMerge pull request #2738 from qmfrederik/fixes/complete-eventsource-2
Marek Safar [Wed, 9 Mar 2016 17:47:33 +0000 (18:47 +0100)]
Merge pull request #2738 from qmfrederik/fixes/complete-eventsource-2

Add EventListener and EventListenerEventArgs to Mono

8 years ago[acceptance-tests] Stop symlinking System.Console.dll facade
Alexander Köplinger [Wed, 9 Mar 2016 17:08:09 +0000 (18:08 +0100)]
[acceptance-tests] Stop symlinking System.Console.dll facade

It should no longer be required after 6e81edfa241bedbb3971ca1e7aece82f31de54c1.

8 years ago[acceptance-tests] Split the test suites out of Makefile.am into own files
Alexander Köplinger [Wed, 9 Mar 2016 17:06:57 +0000 (18:06 +0100)]
[acceptance-tests] Split the test suites out of Makefile.am into own files

8 years ago[mcs] nameof operator can use static member. Fixes #39455
Marek Safar [Wed, 9 Mar 2016 16:56:00 +0000 (17:56 +0100)]
[mcs] nameof operator can use static member. Fixes #39455

8 years ago[llvm] Add beginnings of JIT support for LLVM > 3.9.
Zoltan Varga [Wed, 9 Mar 2016 15:58:59 +0000 (16:58 +0100)]
[llvm] Add beginnings of JIT support for LLVM > 3.9.

8 years ago[acceptance-tests] Move git "submodules" to acceptance-tests/external instead of...
Alexander Köplinger [Wed, 9 Mar 2016 15:54:09 +0000 (16:54 +0100)]
[acceptance-tests] Move git "submodules" to acceptance-tests/external instead of next to Mono repo

A few people told me it's surprising that acceptance-tests checks out repos into <mono repo>/../
and it can cause unwanted changes when a repo with the same name already exists there.

While this structure is used in several internal repos I agree for Mono it's better to keep
everything inside the repo itself.

8 years ago[aot] Fix a buffer overflow in the statistics code.
Zoltan Varga [Wed, 9 Mar 2016 15:22:46 +0000 (16:22 +0100)]
[aot] Fix a buffer overflow in the statistics code.

8 years ago[runtime] Remove some unused code.
Zoltan Varga [Wed, 9 Mar 2016 13:28:36 +0000 (14:28 +0100)]
[runtime] Remove some unused code.

8 years agoRemove #if NET_4_6
Frederik Carlier [Wed, 9 Mar 2016 08:05:38 +0000 (09:05 +0100)]
Remove #if NET_4_6

Remove conditional compilation statement as per PR feedback

8 years agoMerge pull request #2736 from xmcclure/more-trampolines
monojenkins [Wed, 9 Mar 2016 05:20:19 +0000 (05:20 +0000)]
Merge pull request #2736 from xmcclure/more-trampolines

Increase default number of aot-compile trampolines

The current defaults are not enough to successfully run
`make fullaotcheck` in mono/mini

8 years agoMerge pull request #2735 from xmcclure/early-lookup-addr
monojenkins [Wed, 9 Mar 2016 03:55:27 +0000 (03:55 +0000)]
Merge pull request #2735 from xmcclure/early-lookup-addr

Early ICALL_ADDR lookup on pinvoke to fix checked-build assert

The pinvoke implementation in the failure case was creating a managed
exception object while in blocking mode, a rules violation. This patch
puts a redundant lookup early so that any exceptions occur before
blocking mode is entered. (The "real" lookup is unchanged because the
current pattern is optimized well by the JIT.)

8 years agoMerge pull request #2731 from Phyyl/master
monojenkins [Wed, 9 Mar 2016 00:00:42 +0000 (00:00 +0000)]
Merge pull request #2731 from Phyyl/master

Remove throw statement in IPAddress.TryParse

In Microsoft's implementation, no exceptions are thrown in this particular method. See here for details: http://referencesource.microsoft.com/#System/net/System/Net/IPAddress.cs,54a3a3f536d5a22c

8 years agoMerge pull request #2674 from lambdageek/dev/monoerror-mono_field_get_value_object
monojenkins [Tue, 8 Mar 2016 22:20:43 +0000 (22:20 +0000)]
Merge pull request #2674 from lambdageek/dev/monoerror-mono_field_get_value_object

Use MonoError for mono_field_get_value_object

Mark it external only.  Runtime should use mono_field_get_value_object_checked.

8 years agoIncrease default number of aot-compile trampolines
Andi McClure [Tue, 8 Mar 2016 22:14:26 +0000 (17:14 -0500)]
Increase default number of aot-compile trampolines

The current defaults are not enough to successfully run
`make fullaotcheck` in mono/mini

8 years agoMerge pull request #2718 from lambdageek/dev/monoerror-sre
monojenkins [Tue, 8 Mar 2016 21:50:33 +0000 (21:50 +0000)]
Merge pull request #2718 from lambdageek/dev/monoerror-sre

[System.Reflection.Emit] Use MonoError in static functions

8 years agoFix an assert in checked-build GC mode
Andi McClure [Tue, 8 Mar 2016 21:44:49 +0000 (16:44 -0500)]
Fix an assert in checked-build GC mode

The pinvoke implementation in the failure case was creating a managed
exception object while in blocking mode, a rules violation. This patch
puts a redundant lookup early so that any exceptions occur before
blocking mode is entered. (The "real" lookup is unchanged because the
current pattern is optimized well by the JIT.)

8 years ago[runtime] Fix the support for coop in managed-native wrappers by finishing blocking...
Zoltan Varga [Tue, 8 Mar 2016 20:52:46 +0000 (21:52 +0100)]
[runtime] Fix the support for coop in managed-native wrappers by finishing blocking inside the try clause before converting the result, and only unblocking in the finally clause if we didn't unblock in the try clause.

8 years agoAdded null check in IPAddress.Parse
Phyyl [Tue, 8 Mar 2016 19:05:39 +0000 (14:05 -0500)]
Added null check in IPAddress.Parse
This check was previously handled in the IPAddress.TryParse method but, but the latter never throws anymore

8 years agoMerge branch 'master'
Frederik Carlier [Tue, 8 Mar 2016 18:41:40 +0000 (19:41 +0100)]
Merge branch 'master'

8 years ago[SRE] MonoError in mono_image_emit_manifest
Aleksey Kliger [Thu, 3 Mar 2016 21:20:15 +0000 (16:20 -0500)]
[SRE] MonoError in mono_image_emit_manifest

8 years ago[SRE] MonoError in mono_image_fill_export_table
Aleksey Kliger [Thu, 3 Mar 2016 21:09:18 +0000 (16:09 -0500)]
[SRE] MonoError in mono_image_fill_export_table

8 years ago[SRE] MonoError in mono_image_get_array_token
Aleksey Kliger [Thu, 3 Mar 2016 21:04:26 +0000 (16:04 -0500)]
[SRE] MonoError in mono_image_get_array_token

8 years ago[SRE] MonoError in mono_image_get_sighelper_token
Aleksey Kliger [Thu, 3 Mar 2016 20:53:10 +0000 (15:53 -0500)]
[SRE] MonoError in mono_image_get_sighelper_token

8 years ago[SRE] MonoError in mono_image_get_generic_field_token
Aleksey Kliger [Thu, 3 Mar 2016 20:44:30 +0000 (15:44 -0500)]
[SRE] MonoError in mono_image_get_generic_field_token

8 years ago[SRE] MonoError in add_custom_modifiers
Aleksey Kliger [Thu, 3 Mar 2016 20:36:52 +0000 (15:36 -0500)]
[SRE] MonoError in add_custom_modifiers

8 years ago[SRE] MonoError in create_generic_typespec
Aleksey Kliger [Thu, 3 Mar 2016 20:22:25 +0000 (15:22 -0500)]
[SRE] MonoError in create_generic_typespec

8 years ago[SRE] MonoError in mono_image_get_field_on_inst_token
Aleksey Kliger [Thu, 3 Mar 2016 19:50:40 +0000 (14:50 -0500)]
[SRE] MonoError in mono_image_get_field_on_inst_token

8 years ago[SRE] MonoError in encode_constraints
Aleksey Kliger [Thu, 3 Mar 2016 19:45:28 +0000 (14:45 -0500)]
[SRE] MonoError in encode_constraints

8 years ago[SRE] MonoError in mono_image_get_event_info
Aleksey Kliger [Thu, 3 Mar 2016 19:37:14 +0000 (14:37 -0500)]
[SRE] MonoError in mono_image_get_event_info

8 years ago[SRE] MonoError in property_encode_signature
Aleksey Kliger [Thu, 3 Mar 2016 19:35:40 +0000 (14:35 -0500)]
[SRE] MonoError in property_encode_signature

8 years ago[SRE] MonoError in mono_image_get_field_info
Aleksey Kliger [Thu, 3 Mar 2016 19:20:24 +0000 (14:20 -0500)]
[SRE] MonoError in mono_image_get_field_info

8 years ago[SRE] MonoError in encode_marshal_blob
Aleksey Kliger [Thu, 3 Mar 2016 19:03:54 +0000 (14:03 -0500)]
[SRE] MonoError in encode_marshal_blob

8 years ago[SRE] MonoError in field_encode_signature
Aleksey Kliger [Thu, 3 Mar 2016 18:56:07 +0000 (13:56 -0500)]
[SRE] MonoError in field_encode_signature

8 years ago[SRE] MonoError in method_encode_clauses
Aleksey Kliger [Thu, 3 Mar 2016 18:40:38 +0000 (13:40 -0500)]
[SRE] MonoError in method_encode_clauses

8 years ago[SRE] MonoError in encode_locals
Aleksey Kliger [Thu, 3 Mar 2016 17:26:38 +0000 (12:26 -0500)]
[SRE] MonoError in encode_locals

8 years ago[SRE] MonoError in encode_reflection_type and encode_custom_modifiers
Aleksey Kliger [Wed, 2 Mar 2016 23:09:34 +0000 (18:09 -0500)]
[SRE] MonoError in encode_reflection_type and encode_custom_modifiers

8 years agoMerge pull request #2706 from ludovic-henry/fix-unhandledexception
monojenkins [Tue, 8 Mar 2016 16:25:25 +0000 (16:25 +0000)]
Merge pull request #2706 from ludovic-henry/fix-unhandledexception

[runtime] Set exit code on unhandled exception even if a managed handler is present

In case we would add a AppDomain.CurrentDomain.UnhandledException callback, we would not exit the VM in case of unhandled exception.
This goes against the expected behaviour, as we should indeed call these managed callbacks in all cases, but they should not stop the VM from exiting.

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

8 years agoMerge pull request #2634 from ludovic-henry/coop-fix-managed-to-native
monojenkins [Tue, 8 Mar 2016 16:25:20 +0000 (16:25 +0000)]
Merge pull request #2634 from ludovic-henry/coop-fix-managed-to-native

[coop] Fix managed-to-native wrapper

8 years ago[runtime] Use MonoError in mono_field_get_value_object
Aleksey Kliger [Wed, 24 Feb 2016 21:11:52 +0000 (16:11 -0500)]
[runtime] Use MonoError in mono_field_get_value_object

Mark it external only.  Runtime should use mono_field_get_value_object_checked.

8 years agoEmbedded API. Fix method signature match failure for generic types with multiple...
Jonathan Mitchell [Sun, 6 Mar 2016 18:09:55 +0000 (18:09 +0000)]
Embedded API. Fix method signature match failure for generic types with multiple type parameters.

Details are on the list.
http://mono.1490590.n4.nabble.com/Re-Embedded-API-ctor-method-signature-query-mono-td4667551.html

Robert Jordan said:

It looks like a bug in mono_method_desc_new ():

https://github.com/mono/mono/blob/master/mono/metadata/debug-helpers.c#L378

The function is treating

.ctor(System.Func`2<string, string>)

like a method with 2 arguments:

arg0 = System.Func`2<string
arg1 = string>

This is obviously wrong :)

The function is then storing the (wrong) argument count
for optimization purposes, and the comparison of methods
is starting to fail.

8 years agoMerge pull request #2707 from lambdageek/dev/monoerror-mono_image_load_module_dynamic
monojenkins [Tue, 8 Mar 2016 15:10:37 +0000 (15:10 +0000)]
Merge pull request #2707 from lambdageek/dev/monoerror-mono_image_load_module_dynamic

[sre] Propagate MonoError in mono_image_load_module_dynamic

8 years agoUpdated TryParse_IpString_Null for IPAddress tests
Philippe Paré [Tue, 8 Mar 2016 14:20:03 +0000 (09:20 -0500)]
Updated TryParse_IpString_Null for IPAddress tests

Now reflects the new behaviour in IPAddress class, not throwing any exceptions in the TryParse method

8 years agoRemove throw statement in IPAddress.TryParse
Philippe Paré [Tue, 8 Mar 2016 13:18:33 +0000 (08:18 -0500)]
Remove throw statement in IPAddress.TryParse

In Microsoft's implementation, no exceptions are thrown in this particular method. See here for details: http://referencesource.microsoft.com/#System/net/System/Net/IPAddress.cs,54a3a3f536d5a22c

8 years ago[mcs] Fixes codegen for lifted null bitwise operators with constant left side of...
Marek Safar [Tue, 8 Mar 2016 12:39:48 +0000 (13:39 +0100)]
[mcs] Fixes codegen for lifted null bitwise operators with constant left side of null value

8 years ago[tests] Add unhandled exception tests with AppDomain.UnhandledException managed handler
Ludovic Henry [Wed, 2 Mar 2016 14:37:01 +0000 (14:37 +0000)]
[tests] Add unhandled exception tests with AppDomain.UnhandledException managed handler

8 years ago[runtime] Set exit code on unhandled exception even if a managed handler is present
Ludovic Henry [Wed, 2 Mar 2016 13:12:13 +0000 (13:12 +0000)]
[runtime] Set exit code on unhandled exception even if a managed handler is present

In case we would add a AppDomain.CurrentDomain.UnhandledException callback, we would not exit the VM in case of unhandled exception.
This goes against the expected behaviour, as we should indeed call these managed callbacks in all cases, but they should not stop the VM from exiting.

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

8 years agoMerge pull request #2708 from lambdageek/dev/monoerror-assorted-get_type
monojenkins [Tue, 8 Mar 2016 11:25:24 +0000 (11:25 +0000)]
Merge pull request #2708 from lambdageek/dev/monoerror-assorted-get_type

[reflection] MonoError for mono_reflection_{get_type_with_rootimage,type_from_name}

8 years agoMerge pull request #2668 from lambdageek/dev/monoerror-mono_security
monojenkins [Tue, 8 Mar 2016 11:20:58 +0000 (11:20 +0000)]
Merge pull request #2668 from lambdageek/dev/monoerror-mono_security

[runtime] MonoError cleanup in mono-security.c

Some easy MonoError cleanup in mono-security.c: use set_pending_exception, don't raise in helper functions, free memory on errors.

8 years agoMerge pull request #2670 from lambdageek/dev/monoerror-mono_runtime_object_init
monojenkins [Tue, 8 Mar 2016 11:20:52 +0000 (11:20 +0000)]
Merge pull request #2670 from lambdageek/dev/monoerror-mono_runtime_object_init

[runtime] Use MonoError in mono_runtime_object_init

Mark mono_runtime_object_init checked external only.  Runtime should use mono_runtime_object_init_checked.

8 years agoMerge pull request #2687 from lambdageek/dev/monoerror-mono_param_get_objects_internal
monojenkins [Tue, 8 Mar 2016 11:20:46 +0000 (11:20 +0000)]
Merge pull request #2687 from lambdageek/dev/monoerror-mono_param_get_objects_internal

[reflection] Use MonoError in mono_param_get_objects

8 years ago[runtime] Wrap mono_prepare_blocking and mono_finish_blocking in try { ... } finally...
Ludovic Henry [Tue, 16 Feb 2016 21:09:07 +0000 (21:09 +0000)]
[runtime] Wrap mono_prepare_blocking and mono_finish_blocking in try { ... } finally { ... } clause

This is to guarantee that even in the case an exception is thrown between both calls, we switch back and forth correctly from RUNNING to BLOCKING state.

8 years ago[runtime] Fix the emission of CEE_MONO_VTADDR opcodes, they need to be emitted right...
Zoltan Varga [Mon, 7 Mar 2016 20:25:23 +0000 (21:25 +0100)]
[runtime] Fix the emission of CEE_MONO_VTADDR opcodes, they need to be emitted right after native calls.

8 years ago[jit] Add a new ICALL_ADDR_CALL patch type which is only used on calls, since ICALL_A...
Zoltan Varga [Tue, 8 Mar 2016 05:27:43 +0000 (06:27 +0100)]
[jit] Add a new ICALL_ADDR_CALL patch type which is only used on calls, since ICALL_ADDR might be used without a call.

8 years ago[mcs] Null conditional operator is never suppose to work with await according to...
Marek Safar [Mon, 7 Mar 2016 20:00:08 +0000 (21:00 +0100)]
[mcs] Null conditional operator is never suppose to work with await according to current C# standard. Fixes #39266

8 years ago[reflection] Fix mono_reflection_type_get_handle when
Aleksey Kliger [Mon, 7 Mar 2016 18:58:01 +0000 (13:58 -0500)]
[reflection] Fix mono_reflection_type_get_handle when
DISABLE_REFLECTION_EMIT is set

Fixup of 20a111a215c2ad93ab77068d2e81e21c886b9846

8 years ago[mcs] Remove test as it cannot reliably depend on process shutdown
Marek Safar [Mon, 7 Mar 2016 18:50:57 +0000 (19:50 +0100)]
[mcs] Remove test as it cannot reliably depend on process shutdown

8 years agoMerge pull request #2727 from akoeplinger/fix-system-testports
monojenkins [Sat, 5 Mar 2016 16:10:17 +0000 (16:10 +0000)]
Merge pull request #2727 from akoeplinger/fix-system-testports

[System] Fix more hardcoded test ports

A test failed on Jenkins today with "address already in use".
Opportunistically replaced a few more hardcoded test ports to avoid failures in the future.

@monojenkins merge

8 years ago[System/ServiceModel] Fix more hardcoded test ports
Alexander Köplinger [Sat, 5 Mar 2016 13:38:33 +0000 (14:38 +0100)]
[System/ServiceModel] Fix more hardcoded test ports

A test failed on Jenkins today with "address already in use".
Opportunistically replaced a few more hardcoded test ports to avoid failures in the future.

8 years ago[mcs] All returns with values from async block with finally need to be captured....
Marek Safar [Sat, 5 Mar 2016 10:28:36 +0000 (11:28 +0100)]
[mcs] All returns with values from async block with finally need to be captured. Fixes #39153

8 years ago[corlib] Enable the shim __ComObject for other profiles than mobile_static too
Alexander Köplinger [Fri, 4 Mar 2016 23:19:15 +0000 (00:19 +0100)]
[corlib] Enable the shim __ComObject for other profiles than mobile_static too

Otherwise they crash in a similar way during verification tests.

8 years ago[System] Switch DNS tests to a more stable domain/IP
Alexander Köplinger [Fri, 4 Mar 2016 23:09:13 +0000 (00:09 +0100)]
[System] Switch DNS tests to a more stable domain/IP

info.diku.dk stopped resolving today. Use Google's public DNS server instead which should be much more stable.

8 years ago[runtime] Compile arch before utils when INSTALL_MONOTOUCH is enabled
Alexander Köplinger [Fri, 4 Mar 2016 22:03:09 +0000 (23:03 +0100)]
[runtime] Compile arch before utils when INSTALL_MONOTOUCH is enabled

We'd run into an error before:

```
In file included from ../../mono/utils/mono-context.h:234:0,
                 from ../../mono/utils/mono-stack-unwinding.h:10,
                 from ../../mono/utils/mono-threads.h:14,
                 from mono-mmap.c:36:
../../mono/arch/arm/arm-codegen.h:936:41: fatal error: mono/arch/arm/arm_dpimacros.h: No such file or directory
```

This was done for the other cases in 637ee7cbaa03a1f576230eb8601c0c4fa7f93b36, but not when the monotouch
special case was added in cf754cdb634f2bdd5bc959cec66145372c301fba.

8 years agoMerge pull request #2714 from lambdageek/dev/monoerror-mono_reflection_type_get_handle
monojenkins [Fri, 4 Mar 2016 22:00:19 +0000 (22:00 +0000)]
Merge pull request #2714 from lambdageek/dev/monoerror-mono_reflection_type_get_handle

[reflection] MonoError for mono_reflection_type_get_handle

`mono_reflection_type_get_handle` is really a kind of normalization procedure that synthesizes real `MonoType`s from reflection's derived types such as `System.Reflection.Emit.ArrayType, ByRefType`, etc.  So we call it all over the place in System.Reflection.Emit runtime code.

That would all be fine, except that users are allowed to subclass `System.Type`, so we have to call the `UnderlyingSystemType()` method to get a real type.  Which means that an override can throw.  Which in coop mode means we have to thread around a `MonoError`.  So that's why this code is uglier.

But really this code is doing a lot of type inspection and high-level work that we should figure out how to migrate to managed.

8 years ago[bcl] Ensure all .sources files have newline at the end
Alexander Köplinger [Fri, 4 Mar 2016 20:48:09 +0000 (21:48 +0100)]
[bcl] Ensure all .sources files have newline at the end

It causes an issue with gensources.sh when using #include on Linux otherwise.

8 years ago[reflection] MonoError for mono_reflection_type_get_handle
Aleksey Kliger [Wed, 2 Mar 2016 15:19:32 +0000 (10:19 -0500)]
[reflection] MonoError for mono_reflection_type_get_handle

8 years agoMerge pull request #2704 from BrzVlad/fix-monitor-abort
Rodrigo Kumpera [Fri, 4 Mar 2016 19:49:33 +0000 (14:49 -0500)]
Merge pull request #2704 from BrzVlad/fix-monitor-abort

[runtime] Fix monitor abort

8 years agoFix filename casing in mobile_System.Data.dll.sources
Alexander Köplinger [Fri, 4 Mar 2016 19:35:19 +0000 (20:35 +0100)]
Fix filename casing in mobile_System.Data.dll.sources

It broke on Linux.

8 years agoMerge pull request #2722 from ludovic-henry/fix-39279-docker-cpu-count
monojenkins [Fri, 4 Mar 2016 18:00:30 +0000 (18:00 +0000)]
Merge pull request #2722 from ludovic-henry/fix-39279-docker-cpu-count

[utils] Get processor count from scheduler affinity if available

In case the user has set a scheduler CPU affinity, we should use it as the number of available CPU for the runtime. This is particularly important on docket which uses cgroups that set the container a cpu affinity, and by not using that, the runtime report the total number of CPU the machine has, and not the number of CPU the container has.

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

8 years agoMerge pull request #2700 from akoeplinger/monotouch-mobile-static
monojenkins [Fri, 4 Mar 2016 17:20:16 +0000 (17:20 +0000)]
Merge pull request #2700 from akoeplinger/monotouch-mobile-static

Enable building of monotouch/xammac profiles without mono-extensions and expose mobile_static in configure.ac

Relies on https://github.com/xamarin/mono-extensions/pull/17

This enables us to compile the monotouch, xammac and mobile_static profiles on public Jenkins without mono-extensions.

8 years agoMerge pull request #2723 from akoeplinger/fix-decimal-test-culture
monojenkins [Fri, 4 Mar 2016 16:30:31 +0000 (16:30 +0000)]
Merge pull request #2723 from akoeplinger/fix-decimal-test-culture

[corlib] Fix three decimal tests to not rely on current culture for formatting

They'd fail on cultures where "." is not the decimal separator before.

I've also reenabled them on mobile cause the workaround for #27269 is no longer necessary since all bots are now on Mono 4.0+.

@monojenkins merge

8 years agoMerge pull request #2719 from kumpera/aot_cctor_encoding_in_method_info
Rodrigo Kumpera [Fri, 4 Mar 2016 16:18:05 +0000 (11:18 -0500)]
Merge pull request #2719 from kumpera/aot_cctor_encoding_in_method_info

[runtime] Explicitly encode the need of running a cctor on method infos.

8 years agoAdd a shim __ComObject class to the mobile_static build
Alexander Köplinger [Wed, 2 Mar 2016 13:30:05 +0000 (14:30 +0100)]
Add a shim __ComObject class to the mobile_static build

We need this because when the runtime is built without --enable-minimal=com the runtime crashes
when trying to AOT because it tries to find the __ComObject (even though nothing in mobile_static
actually uses COM). With this shim we can AOT the mobile_static assemblies even with a "normal"
runtime.

8 years ago[corlib] Fix three decimal tests to not rely on current culture for formatting
Alexander Köplinger [Fri, 4 Mar 2016 14:53:25 +0000 (15:53 +0100)]
[corlib] Fix three decimal tests to not rely on current culture for formatting

They'd fail on cultures where "." is not the decimal separator before.

I've also reenabled them on mobile cause the workaround for #27269 is no longer necessary since all bots are now on Mono 4.0+.

8 years ago[corlib] Fixes build to using correct build profile dependency
Marek Safar [Fri, 4 Mar 2016 14:37:44 +0000 (15:37 +0100)]
[corlib] Fixes build to using correct build profile dependency