mono.git
8 years agoMerge pull request #2379 from xmcclure/babysitter-contd
monojenkins [Wed, 23 Dec 2015 19:25:16 +0000 (19:25 +0000)]
Merge pull request #2379 from xmcclure/babysitter-contd

scripts/babysitter stdout logging improvements

Always print stdout log statements, even when all babysitter features
are turned off, even when the test suite does not support the protocol.

8 years agoscripts/babysitter stdout logging improvements
Andi McClure [Wed, 23 Dec 2015 17:49:53 +0000 (12:49 -0500)]
scripts/babysitter stdout logging improvements

Always print stdout log statements, even when all babysitter features
are turned off, even when the test suite does not support the protocol.

8 years ago[mkbundle] Add support for --quiet.
Rolf Bjarne Kvinge [Fri, 13 Nov 2015 09:48:58 +0000 (10:48 +0100)]
[mkbundle] Add support for --quiet.

8 years ago[mkbundle] Fix compiler warnings.
Rolf Bjarne Kvinge [Thu, 10 Dec 2015 09:44:55 +0000 (10:44 +0100)]
[mkbundle] Fix compiler warnings.

8 years ago[llvm] Fix LLVM support after e7166e4f9cee4eb896f1a2ff0290e0b9d8fedacb.
Zoltan Varga [Wed, 23 Dec 2015 06:09:02 +0000 (01:09 -0500)]
[llvm] Fix LLVM support after e7166e4f9cee4eb896f1a2ff0290e0b9d8fedacb.

8 years agoucm2cp: Remove the deprecated '#if NET_2_0' fence
Miguel de Icaza [Wed, 23 Dec 2015 04:28:13 +0000 (23:28 -0500)]
ucm2cp: Remove the deprecated '#if NET_2_0' fence

8 years ago[System.Xml.Linq] Reenable a test that was commented out
Alexander Köplinger [Wed, 23 Dec 2015 01:04:06 +0000 (02:04 +0100)]
[System.Xml.Linq] Reenable a test that was commented out

It works fine now, the underlying mcs bug was fixed long ago.

8 years agoMerge pull request #2366 from xmcclure/scripts-babysitter
Alexander Köplinger [Tue, 22 Dec 2015 23:17:42 +0000 (00:17 +0100)]
Merge pull request #2366 from xmcclure/scripts-babysitter

Adds babysitter script for PR tests

8 years agoSupport process-group killing in babysitter script
Andi McClure [Tue, 22 Dec 2015 22:38:16 +0000 (17:38 -0500)]
Support process-group killing in babysitter script

The babysitter script was failing to act as a GNU timeout replacement
because it was delivering signals to the spawned process only, whereas
GNU timeout would create a process group. This lead to a problem where
timeout kills by the babysitter would leave children of the spawned
process still running. To fix this, the babysitter script now follows
the exact steps that GNU timeout does (or as close as is possible in
Python). An attempt at a Windows process-group implementation is also
included, but I have not tested it.

Also changed the 'retry_support' key to 'babysitter_protocol' in the
JSON logs, because it was pointed out the old key was misleading (it
is true even when retries are deactivated).

8 years agoHave scripts/babysitter use MONO_BABYSITTER_LOG_FILE configuration
Andi McClure [Tue, 22 Dec 2015 20:04:57 +0000 (15:04 -0500)]
Have scripts/babysitter use MONO_BABYSITTER_LOG_FILE configuration

Instead of configuring logs with WORKSPACE dir

8 years agoMore peer review changes on scripts/babysitter
Andi McClure [Tue, 22 Dec 2015 19:47:28 +0000 (14:47 -0500)]
More peer review changes on scripts/babysitter

- Using “iteration” for # of retries instead of ambiguous “passes”
- More clearly document what environment keys are for in-script
- Remove CRASH_RESUME key, make setting always true
- Print explicit human-readable messages for stdout log

8 years agoMerge pull request #2375 from akoeplinger/servicemodel-remove-portfinders
Alexander Köplinger [Tue, 22 Dec 2015 17:42:35 +0000 (18:42 +0100)]
Merge pull request #2375 from akoeplinger/servicemodel-remove-portfinders

[ServiceModel] Remove custom free port finder code

8 years agoMerge pull request #2376 from rolfbjarne/bitcode-without-undefined-references
Rolf Bjarne Kvinge [Tue, 22 Dec 2015 16:38:09 +0000 (17:38 +0100)]
Merge pull request #2376 from rolfbjarne/bitcode-without-undefined-references

Do not allow undefined references if bitcode is enabled.

8 years agoMerge pull request #2034 from alexrp/ctx-cleanup
Rodrigo Kumpera [Tue, 22 Dec 2015 16:05:30 +0000 (11:05 -0500)]
Merge pull request #2034 from alexrp/ctx-cleanup

[runtime] Actually clean up context-static data segments.

8 years agoMerge pull request #1896 from meum/patch-1
Miguel de Icaza [Tue, 22 Dec 2015 15:20:19 +0000 (10:20 -0500)]
Merge pull request #1896 from meum/patch-1

Fix dot stuffing in SmtpClient

8 years agoMerge pull request #2374 from lambdageek/dev/bug-37035
Aleksey Kliger (λgeek) [Tue, 22 Dec 2015 12:33:03 +0000 (07:33 -0500)]
Merge pull request #2374 from lambdageek/dev/bug-37035

[WCF] ServiceHost should look for inherited ServiceBehaviorAttribute

8 years agoDo not allow undefined references if bitcode is enabled.
Rolf Bjarne Kvinge [Tue, 22 Dec 2015 11:52:37 +0000 (12:52 +0100)]
Do not allow undefined references if bitcode is enabled.

The linker does not allow the '-undefined' flag when bitcode
is enabled, so we can't pass it to the linker at all.

8 years ago[ServiceModel] Remove custom free port finder code
Alexander Köplinger [Tue, 22 Dec 2015 00:59:01 +0000 (01:59 +0100)]
[ServiceModel] Remove custom free port finder code

We have a common one in NetworkHelpers now.

8 years ago[WCF] ServiceHost should look for inherited ServiceBehaviorAttribute
Aleksey Kliger [Mon, 21 Dec 2015 20:51:57 +0000 (15:51 -0500)]
[WCF] ServiceHost should look for inherited ServiceBehaviorAttribute

Fixes #37035

8 years ago[aot] Add hooks which can be used by embedders to load the aot data for aot images...
Zoltan Varga [Mon, 21 Dec 2015 22:06:53 +0000 (17:06 -0500)]
[aot] Add hooks which can be used by embedders to load the aot data for aot images compiled with --aot=data-outfile=...

8 years agoAdd documentation for MONO_ENABLE_COOP
Miguel de Icaza [Mon, 21 Dec 2015 19:16:45 +0000 (14:16 -0500)]
Add documentation for MONO_ENABLE_COOP

8 years agoMerge pull request #2373 from akoeplinger/servicemodel-tcpreplychannel-race
João Matos [Mon, 21 Dec 2015 17:44:41 +0000 (17:44 +0000)]
Merge pull request #2373 from akoeplinger/servicemodel-tcpreplychannel-race

[ServiceModel] Make TcpReplyChannel.OnClose thread-safe

8 years agoMerge pull request #2372 from abock/dcs-iserializable-bxc37171
Marek Safar [Mon, 21 Dec 2015 17:33:47 +0000 (18:33 +0100)]
Merge pull request #2372 from abock/dcs-iserializable-bxc37171

XmlObjectSerialier: fix ISerializable (bxc#37171)

8 years agoXmlObjectSerialier: fix ISerializable (bxc#37171)
Aaron Bockover [Sun, 20 Dec 2015 16:03:38 +0000 (11:03 -0500)]
XmlObjectSerialier: fix ISerializable (bxc#37171)

The shim/bridge between Mono and the RS implementation of
XmlObjectSerializer, DataContractSerializer, etc. did not properly
invoke the constructor required by ISerializable, as it completely
omitted passing the populated SerializationInfo object.

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

8 years ago[ServiceModel] Make TcpReplyChannel.OnClose thread-safe
Alexander Köplinger [Mon, 21 Dec 2015 13:33:14 +0000 (14:33 +0100)]
[ServiceModel] Make TcpReplyChannel.OnClose thread-safe

We were seeing the following unhandled exception on Jenkins:

````\rUnhandled exceptions:
1) MonoTests.System.ServiceModel.OperationContextTest.Current : System.NullReferenceException: Object reference not set to an instance of an object
  at System.ServiceModel.Channels.NetTcp.TcpReplyChannel.OnClose (TimeSpan timeout) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Channels.NetTcp/TcpReplyChannel.cs:141
  at System.ServiceModel.Channels.CommunicationObject.Close (TimeSpan timeout) [0x0001c] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CommunicationObject.cs:140
  at System.ServiceModel.Channels.CommunicationObject.Close () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CommunicationObject.cs:131
  at System.ServiceModel.Dispatcher.ListenerLoopManager.TryReceiveRequestDone (IAsyncResult result) [0x00027] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs:583
```

This happens because multiple threads can call OnClose() and so `client` can be null.

Fixed this by taking code from HttpReplyChannel.OnClose which handled this already and also fixed the race condition there (the checks need to happen under a lock).

8 years agoMerge pull request #2370 from DavidKarlas/replaceQuote
Marek Safar [Mon, 21 Dec 2015 09:00:20 +0000 (10:00 +0100)]
Merge pull request #2370 from DavidKarlas/replaceQuote

[XBuild] Fixed method invocation with string argument containing ",` or '

8 years agoAdd preliminary support for storing the AOT metadata outside the AOT image. This...
Zoltan Varga [Mon, 21 Dec 2015 03:08:26 +0000 (22:08 -0500)]
Add preliminary support for storing the AOT metadata outside the AOT image. This can save about 10-20% from the executable size when statically linking AOT images. Needs callbacks to allow embedding apps to load the aot data.

8 years agoMerge pull request #2371 from akoeplinger/symbolicate-quoted
monojenkins [Sun, 20 Dec 2015 16:55:59 +0000 (16:55 +0000)]
Merge pull request #2371 from akoeplinger/symbolicate-quoted

[symbolicate] Make sure MONO_PATH is quoted

Without it we saw a " ./../../class/lib/net_4_x: Is a directory" error in the cygwin build.

@monojenkins merge

8 years ago[symbolicate] Make sure MONO_PATH is quoted
Alexander Köplinger [Sun, 20 Dec 2015 15:20:31 +0000 (16:20 +0100)]
[symbolicate] Make sure MONO_PATH is quoted

Without it we saw a " ./../../class/lib/net_4_x: Is a directory" error in the cygwin build.

8 years ago[XBuild] Fixed method invocation with string argument containing ",` or '
David Karlaš [Sun, 20 Dec 2015 09:41:01 +0000 (10:41 +0100)]
[XBuild] Fixed method invocation with string argument containing ",` or '
Before this commit string value starting or ending with this char was malformed because Trim removed also part of string value
Also fixed recent regression from 42c0a94445 which failed to split arguments if doubleQuote was inside singleQuoute

8 years ago[llvmonly] Avoid emitting runtime invoke wrappers for the signatures which the gshare...
Zoltan Varga [Sat, 19 Dec 2015 23:43:09 +0000 (18:43 -0500)]
[llvmonly] Avoid emitting runtime invoke wrappers for the signatures which the gsharedvt based invoke wrappers can handle.

8 years ago[llvmonly] Share more gsharedvt wrappers.
Zoltan Varga [Sat, 19 Dec 2015 23:29:41 +0000 (18:29 -0500)]
[llvmonly] Share more gsharedvt wrappers.

8 years ago[llvmonly] Avoid generating gsharedvt in wrappers for method signatures, they are...
Zoltan Varga [Sat, 19 Dec 2015 23:06:20 +0000 (18:06 -0500)]
[llvmonly] Avoid generating gsharedvt in wrappers for method signatures, they are not needed.

8 years ago[csproj] Refreshed order.xml and csproj files
Alexander Köplinger [Sat, 19 Dec 2015 16:26:30 +0000 (17:26 +0100)]
[csproj] Refreshed order.xml and csproj files

8 years agoUpdate the System.Diagnostics.Tracing namespace to better match the .NET API
Frederik Carlier [Sat, 12 Dec 2015 23:44:59 +0000 (00:44 +0100)]
Update the System.Diagnostics.Tracing namespace to better match the .NET API

8 years agoMerge pull request #2364 from lambdageek/dev/checked-critical
Aleksey Kliger (λgeek) [Sat, 19 Dec 2015 16:57:01 +0000 (11:57 -0500)]
Merge pull request #2364 from lambdageek/dev/checked-critical

[coop] checked build GC critical regions

8 years agoMerge pull request #2367 from BillSeurer/master
João Matos [Sat, 19 Dec 2015 16:16:49 +0000 (16:16 +0000)]
Merge pull request #2367 from BillSeurer/master

[powerpc] New macros and utility functions for v2 elf ABI function calls

8 years agoMerge pull request #2369 from akoeplinger/msvc-win64-crash
João Matos [Sat, 19 Dec 2015 16:15:23 +0000 (16:15 +0000)]
Merge pull request #2369 from akoeplinger/msvc-win64-crash

[sgen] Disable freeing of OS memory on 64bit Windows build too

8 years agoMerge pull request #2368 from DavidKarlas/portablePdbTargetsSupport
Alexander Köplinger [Sat, 19 Dec 2015 14:31:28 +0000 (15:31 +0100)]
Merge pull request #2368 from DavidKarlas/portablePdbTargetsSupport

[XBuild] Add support for copying/cleaning portable .pdb files generated by Roslyn compiler

8 years ago[sgen] Disable freeing of OS memory on 64bit Windows build too
Alexander Köplinger [Sat, 19 Dec 2015 14:17:02 +0000 (15:17 +0100)]
[sgen] Disable freeing of OS memory on 64bit Windows build too

This was applied for the x86 build in 398c7fc21f849798e18770d4ec85d7acb8b66333.
Moved the check so that it applies to the x64 MSVC build as well.

We were hitting the same assert in mono_vfree() on Jenkins and this fixes it.

8 years ago[XBuild] Add support for copying/cleaning portable .pdb files generated by Roslyn...
David Karlaš [Sat, 19 Dec 2015 11:29:50 +0000 (12:29 +0100)]
[XBuild] Add support for copying/cleaning portable .pdb files generated by Roslyn compiler

8 years ago[llvmonly] Avoid adding some gsharedvt wrappers which are already added.
Zoltan Varga [Sat, 19 Dec 2015 06:39:03 +0000 (01:39 -0500)]
[llvmonly] Avoid adding some gsharedvt wrappers which are already added.

8 years ago[jit] Only emit the gsharedvt runtime invoke wrappers in llvm-only mode.
Zoltan Varga [Sat, 19 Dec 2015 06:19:30 +0000 (01:19 -0500)]
[jit] Only emit the gsharedvt runtime invoke wrappers in llvm-only mode.

8 years ago[runtime] Factor out a part of mono_jit_runtime_invoke () into a separate function.
Zoltan Varga [Sat, 19 Dec 2015 06:14:52 +0000 (01:14 -0500)]
[runtime] Factor out a part of mono_jit_runtime_invoke () into a separate function.

8 years ago[runtime] Disable the check-seq-points tests on arm, it cannot be made to reliably...
Zoltan Varga [Sat, 19 Dec 2015 03:38:36 +0000 (03:38 +0000)]
[runtime] Disable the check-seq-points tests on arm, it cannot be made to reliably work without major changes since arm cannot encode all 32 bit immediates inside instructions, which means that opcodes which call is_rotated_imm8 () would need special handling whe the 'single-imm-size' option is used.

8 years ago[jit] Enable gsharedvt in llvmonly mode by default if ENABLE_GSHAREDVT is defined.
Zoltan Varga [Fri, 18 Dec 2015 22:05:54 +0000 (17:05 -0500)]
[jit] Enable gsharedvt in llvmonly mode by default if ENABLE_GSHAREDVT is defined.

8 years ago[coop] Checked build GC critical regions.
Aleksey Kliger [Thu, 17 Dec 2015 20:03:22 +0000 (15:03 -0500)]
[coop] Checked build GC critical regions.

For local handles in coop suspend configuartions we need the idea of a
"critical region": a situation when transitioning from GC
Unsafe (running) to GC Safe (blocking) mode constitutes a bug. In
checked builds, we'd like to assert when that happens.

This PR adds MONO_PREPARE_GC_CRITICAL_REGION,
MONO_FINISH_GC_CRITICAL_REGION and MONO_REQ_GC_NOT_CRITICAL.

In regular build, these are nops. In checked build, they use a new
thread-local flag to prevent transitions from running to blocking.

8 years ago[mcs] Propagate null operator flag during standalone to extension methods promotion...
Marek Safar [Fri, 18 Dec 2015 20:12:34 +0000 (21:12 +0100)]
[mcs] Propagate null operator flag during standalone to extension methods promotion. Fixes #37080

8 years agoPeer feedback changes for babysitter script PR
Andi McClure [Fri, 18 Dec 2015 20:04:19 +0000 (15:04 -0500)]
Peer feedback changes for babysitter script PR

8 years agoMerge pull request #2314 from lambdageek/dev/local-handles
Aleksey Kliger (λgeek) [Fri, 18 Dec 2015 19:55:12 +0000 (14:55 -0500)]
Merge pull request #2314 from lambdageek/dev/local-handles

Just the low-level bits of the handles API

8 years ago[powerpc] New macros and utility functions for v2 Elf ABI function calls.
Bill Seurer [Fri, 18 Dec 2015 19:23:40 +0000 (13:23 -0600)]
[powerpc] New macros and utility functions for v2 Elf ABI function calls.

8 years agoAdds babysitter script for PR tests
Andi McClure [Fri, 18 Dec 2015 18:15:18 +0000 (13:15 -0500)]
Adds babysitter script for PR tests

I see two problems with our current automated PR tests:
- Many false negatives— PR tests often fail due to recurring failures
  unrelated to the PR
- Information about what failed is awkward to retrieve, scattered in
  multiple places

This commit adds a Python script, `scripts/babysitter`. Currently our
Jenkins test suites are each run wrapped with the `timeout` command.
The babysitter acts as a drop-in replacement for GNU timeout but adds
the following features:
- Logs machine readable output about each test suite (as
  line-delimited json)
- If the test suite uses NUnit, can detect if a test case failed or
  crashed (terminated mono in mid-test), and retry unsuccessful tests
  (up to a limit).

The reasoning here is that tests which fail inconsistently are
currently most likely due to one of our outstanding recurring failures
rather than the change made in the PR. Therefore, if a failing test
succeeds on retry, the PR itself is probably valid (although the
failure should be logged and looked at).

In addition to the script itself, changes to NUnit were required in
order to support the retry feature and allow fine-grained logging for
NUnit suites.

Major TODOs:
- Add retry support for our non-NUnit-based test suites
- Save the XML files NUnit produces (since reruns stomp XMLs from
  previous runs)
- Add some kind of sensible feature for dealing with timeouts

8 years ago[icall/GetMachineName] Use sysconf if available to capture the whole host name, fall...
Miguel de Icaza [Fri, 18 Dec 2015 18:10:37 +0000 (13:10 -0500)]
[icall/GetMachineName] Use sysconf if available to capture the whole host name, fall back to a fixed size buffer otherwise

8 years ago[coop] Cleanup
Ludovic Henry [Wed, 2 Dec 2015 00:03:28 +0000 (19:03 -0500)]
[coop] Cleanup

8 years ago[coop] Introduce new runtime handle API
Ludovic Henry [Fri, 13 Nov 2015 16:01:41 +0000 (16:01 +0000)]
[coop] Introduce new runtime handle API

8 years ago[runtime] Remove some debug printfs.
Zoltan Varga [Fri, 18 Dec 2015 06:38:23 +0000 (01:38 -0500)]
[runtime] Remove some debug printfs.

8 years agoAdd an alternative implementation for runtime invokes in llvmonly mode
Zoltan Varga [Fri, 18 Dec 2015 05:41:54 +0000 (00:41 -0500)]
Add an alternative implementation for runtime invokes in llvmonly mode
which uses gsharedvt out wrappers. We invoke the wrappers, and the
wrappers invoke the methods themselves. The advantage of this approach is
that the set of possible signatures for gsharedvt out wrappers is small,
so the set of runtime invoke wrappers needed to invoke them is also small,
thus only a small number of them need to be generated.
Not yet enabled.

8 years ago[runtime] Add a mono_marshal_get_runtime_invoke_for_sig () helper function to create...
Zoltan Varga [Fri, 18 Dec 2015 05:36:12 +0000 (00:36 -0500)]
[runtime] Add a mono_marshal_get_runtime_invoke_for_sig () helper function to create a runtime invoke wrapper for a signature.

8 years ago[mkbundle] Fix --nomain option for Windows
Alexis Christoforides [Fri, 18 Dec 2015 02:38:10 +0000 (21:38 -0500)]
[mkbundle] Fix --nomain option for Windows

8 years ago[mkbundle] Allow override of embedded assemblies.
Alexis Christoforides [Fri, 18 Dec 2015 00:27:26 +0000 (19:27 -0500)]
[mkbundle] Allow override of embedded assemblies.
If they exist, name-matched assemblies in the current directory will be embedded instead of the properly resolved ones.

8 years agoMerge pull request #2365 from akoeplinger/fix-llvm-method
Zoltan Varga [Fri, 18 Dec 2015 02:10:07 +0000 (21:10 -0500)]
Merge pull request #2365 from akoeplinger/fix-llvm-method

[mini] Ensure mono_llvm_create_vars() is only present in ENABLE_LLVM

8 years ago[mini] Ensure mono_llvm_create_vars() is only present in ENABLE_LLVM
Alexander Köplinger [Fri, 18 Dec 2015 01:56:15 +0000 (02:56 +0100)]
[mini] Ensure mono_llvm_create_vars() is only present in ENABLE_LLVM

It caused a build error on msvc debug builds because the symbol wasn't there.

8 years agoMerge pull request #2350 from akoeplinger/signcode-sha1
Alexander Köplinger [Thu, 17 Dec 2015 22:38:09 +0000 (23:38 +0100)]
Merge pull request #2350 from akoeplinger/signcode-sha1

[signcode] Change default hashing algorithm from MD5 to SHA1

8 years ago[mkbundle] Fix typo
Alexis Christoforides [Thu, 17 Dec 2015 22:02:55 +0000 (17:02 -0500)]
[mkbundle] Fix typo

8 years ago[mkbundle] Correct some linking options for Windows
Alexis Christoforides [Thu, 17 Dec 2015 18:43:57 +0000 (13:43 -0500)]
[mkbundle] Correct some linking options for Windows

8 years ago[mkbundle] Allow overriding linked Mono library path
Alexis Christoforides [Wed, 9 Dec 2015 23:05:32 +0000 (18:05 -0500)]
[mkbundle] Allow overriding linked Mono library path

8 years agoMerge pull request #2342 from lewurm/mkbundlefix
Alexis Christoforides [Thu, 17 Dec 2015 18:44:56 +0000 (13:44 -0500)]
Merge pull request #2342 from lewurm/mkbundlefix

[mkbundle] restore old behavior of -c flag

8 years ago[test][System.Runtime.Serialization] Ensure test compile on XI (avoid more than one...
Sebastien Pouliot [Thu, 17 Dec 2015 14:02:49 +0000 (09:02 -0500)]
[test][System.Runtime.Serialization] Ensure test compile on XI (avoid more than one Main method)

8 years agoFix "make dist" WITHOUT accidentally un-bumping referencesources
Jo Shields [Thu, 17 Dec 2015 10:29:57 +0000 (10:29 +0000)]
Fix "make dist" WITHOUT accidentally un-bumping referencesources

8 years agoRevert "Fix typo in dde9ee9e (Fixes `make dist`)"
Jo Shields [Thu, 17 Dec 2015 10:29:17 +0000 (10:29 +0000)]
Revert "Fix typo in dde9ee9e (Fixes `make dist`)"

This reverts commit 85cbe23b99807da23284740896a3966539c8000f.

8 years agoFix typo in dde9ee9e (Fixes `make dist`)
Jo Shields [Thu, 17 Dec 2015 09:45:37 +0000 (09:45 +0000)]
Fix typo in dde9ee9e (Fixes `make dist`)

8 years ago[jit] Fix the support for gshared types in mini_emit_initobj (), previously we were...
Zoltan Varga [Thu, 17 Dec 2015 06:20:13 +0000 (01:20 -0500)]
[jit] Fix the support for gshared types in mini_emit_initobj (), previously we were treating them as reference types, leading to stack overwrites. Fixes #37079.

8 years ago[jit] Make it possible to enable gsharedvt in llvmonly mode even if MONO_ARCH_GSHARED...
Zoltan Varga [Wed, 16 Dec 2015 21:07:34 +0000 (16:07 -0500)]
[jit] Make it possible to enable gsharedvt in llvmonly mode even if MONO_ARCH_GSHAREDVT_SUPPORTED is not enabled.

8 years ago[jit] Remove a superfluous assert.
Zoltan Varga [Wed, 16 Dec 2015 20:38:05 +0000 (15:38 -0500)]
[jit] Remove a superfluous assert.

8 years ago[jit] Reorganize mono_jit_runtime_invoke () a bit so info->ret_box_class is set even...
Zoltan Varga [Wed, 16 Dec 2015 20:17:41 +0000 (15:17 -0500)]
[jit] Reorganize mono_jit_runtime_invoke () a bit so info->ret_box_class is set even if dyncall is not supported.

8 years agoAdd support for translating between normal and gsharedvt calling conventions in llvmo...
Zoltan Varga [Wed, 16 Dec 2015 20:08:04 +0000 (15:08 -0500)]
Add support for translating between normal and gsharedvt calling conventions in llvmonly mode.

This is implemented by generating two wrappers for each concrete signature found in the assembly:
* an 'in' wrapper translates from the normal to the gsharedvt signature
* an 'out' wrapper translates from the gsharedvt to the normal signature

The wrappers take an extra argument, which points to a function descriptor, which is an <addr, arg> pair. They
make a call to ADDR which ARG as an extra argument. ADDR/ARG is either a gsharedvt method with an rgctx
argument, or another gsharedvt wrapper with a function descriptor argument.

All calls made out of gsharedvt methods with a variable signature use the gsharedvt calling convention. If the
callee is also gsharedvt, no wrapper is needed. If the callee is not gsharedvt, the call goes thought
a gsharedvt out wrapper.
Calls made from normal methods to gsharedvt methods go though a gsharedvt in wrapper.

    * mini-generic-sharing.c (mini_get_gsharedvt_in_sig_wrapper): New function to generate gsharedvt in
    wrappers as IL code.
    (mini_get_gsharedvt_out_sig_wrapper): Ditto for out wrappers.

    * method-to-ir.c (emit_llvmonly_calli): New helper function to make a call to a function descriptor.
    (mono_method_to_ir): Make some indirect calls to MONO_RGCTX_INFO entries using function descriptors.

    * aot-compiler.c (compile_method): Generate gsharedvt wrappers for the signatures used by the method.

    * aot-runtime.c (decode_method_ref_with_target): Decode gsharedvt wrappers.

    * jit-icalls.c (resolve_vcall): Rewrite this so it can handle gsharedvt as well.
    (resolve_iface_call): Ditto.
    (mono_init_delegate): Ditto.
    (mono_init_delegate_virtual): Ditto.

    * mini-trampolines.c (mini_create_llvmonly_ftndesc): New helper function to create a function descriptor.
    (mini_add_method_wrappers_llvmonly): New helper function to add gsharedvt in/out wrappers, similar
    to mini_add_method_trampolines ().

    * mini-generic-sharing.c (mini_get_gsharedvt_wrapper): Return the newly added wrappers in llvmonly mode.
    (class_type_info): Insert gsharedvt wrappers if needed. Some MONO_RGCTX_INFO types will now resolve to
    function descriptors instead of function addresses.
    (instantiate_info): Ditto.

8 years ago2015-12-16 Zoltan Varga <vargaz@gmail.com>
Zoltan Varga [Wed, 16 Dec 2015 19:10:13 +0000 (14:10 -0500)]
2015-12-16  Zoltan Varga  <vargaz@gmail.com>

Add mono_signature_full_name () helper function.

* debug-helpers.c (mono_signature_full_name): New helper function to stringify a signature, including
its return types as well.

8 years ago2015-12-16 Zoltan Varga <vargaz@gmail.com>
Zoltan Varga [Wed, 16 Dec 2015 19:05:39 +0000 (14:05 -0500)]
2015-12-16  Zoltan Varga  <vargaz@gmail.com>

Add beginnings for support for gsharedvt in llvmonly mode. Gsharedvt methods use a calling convention
where everything is passed and returned by ref, even normal types. I.e.

public int foo<T> (T t, int i);

becomes:

void foo (int *vret, T* t_addr, int *i_addr);

Not enabled yet.

* mini-llvm.c: Implement support for gsharedvt.

* ssa.c (mono_ssa_remove_gsharedvt): Same as mono_ssa_remove (), but only remove the
OP_VPHI nodes referencing gsharedvt variables, since they cannot be handled by the
llvm backend.

* mini-llvm.c (mono_llvm_create_vars): New backend function, similar to mono_arch_create_vars ().

* decompose.c (mono_decompose_vtype_opts): Decompose more opcodes in llvm mode so
opcodes using gsharedvt variables don't reach the llvm backend. Some, like OP_LDADDR and
vcalls, still do.

* method-to-ir.c (mono_allocate_gsharedvt_vars): New function to allocate gsharedvt locals,
extracted from mono_spill_global_vars () so it can be used in llvm mode too.

8 years ago[mono-api-info] Add `mono-api-info -L`, `mono-api-info -r`
Jonathan Pryor [Wed, 16 Dec 2015 15:59:06 +0000 (10:59 -0500)]
[mono-api-info] Add `mono-api-info -L`, `mono-api-info -r`

**The Scenario**: `mono-api-info` and `mono-api-html`, together, are a
useful way to track API changes over time, specifically to check for
accidental API breakage:

# Have a "known good" assembly version;
# keep reference/assembly.xml in version control
$ mono-api-info assembly.dll > reference/assembly.xml

# ...then on every new build, check for breakage:
$ mono-api-info assembly.dll > new-assembly.xml
$ mono-api-html reference/assembly.xml new-assembly.xml > assembly-diff.html
$ if grep '<p>Removed' assembly-diff.html > /dev/null ; then \
echo "ABI BREAK IN assembly.dll" ; \
cat assembly-diff.html ; \
fi

This is a very nice workflow, and has been used in Xamarin.Android to
track accidental API breakage for some time.

**The problem** with the above workflow are *implicit* references:
`mono-api-info` will happily look for dependencies in the same
directory as `assembly`, but it will *also* look for assembly
references in various system-specific directories, which is fine...

...until it *isn't* fine, e.g. if you have your own version of
mscorlib.dll that you need to use, *not* the system one, as your own
version may have API differences from the system mscorlib.dll which
are "percolated" into `mono-api-info` output. For example, on
"desktop" profiles, System.Attribute implements
System.Runtime.InteropServices._Attribute, and thus *all* custom
attribute types will have _Attribute listed as an implemented
interface. The Xamarin.iOS and Xamarin.Android mscorlib.dll,
meanwhile, does *not* have System.Attribute implementing _Attribute.
Consequently, changing the mscorlib.dll which is used while processing
an assembly will change `mono-api-info` output, resulting in "API
breakage" which doens't actually exist, because the wrong mscorlib.dll
was used to generate the original API description in the first place.

We need a way to control which mscorlib.dll/etc. are used. This can be
done by allowing specification of the assembly search directories, so
that we can "override" the default system-specific directory location.

**The solution**: Add a `mono-api-info -L PATH` option which adds PATH
to the list of directories that `mono-api-info` will search when
resolving assembly references. This allows "overriding" the system
directory location, as PATH will be searched for mscorlib.dll before
the system directory location.

Additionally, add a `mono-api-info -r ASSEMBLY` option, which will
pre-process ASSEMBLY (and all dependencies) and add the directory
which contains ASSEMBLY to the assembly search paths.

These two options are conceptually similar to `mcs -L` and `mcs -r`.

Finally, while adding support for these options, add support for
`mono-api-info --help`, so that we don't need to use only the man page
to get option information.

8 years agoMerge pull request #2324 from akoeplinger/caching-locking
Alexander Köplinger [Wed, 16 Dec 2015 17:05:45 +0000 (18:05 +0100)]
Merge pull request #2324 from akoeplinger/caching-locking

[System.Runtime.Caching] Add missing locking when accessing cache entries

8 years agoMerge pull request #2356 from ludovic-henry/fix-thread-suspend-deadlock
Rodrigo Kumpera [Wed, 16 Dec 2015 15:57:17 +0000 (10:57 -0500)]
Merge pull request #2356 from ludovic-henry/fix-thread-suspend-deadlock

[threads] Fix potential deadlock on suspend

8 years ago[threads] Fix potential deadlock on suspend
Ludovic Henry [Wed, 16 Dec 2015 14:00:15 +0000 (14:00 +0000)]
[threads] Fix potential deadlock on suspend

Because mono_thread_info_safe_suspend_and_run is locking the suspend lock, we cannot enter the blocking state in any of its callee, as that could lead to a deadlock.

8 years agoMerge pull request #2353 from ludovic-henry/fix-servicemodel-15153
monojenkins [Wed, 16 Dec 2015 13:55:04 +0000 (13:55 +0000)]
Merge pull request #2353 from ludovic-henry/fix-servicemodel-15153

Add test and merge #1879

@monojenkins merge

8 years agoMerge pull request #2351 from ludovic-henry/fix-socket-36941
monojenkins [Wed, 16 Dec 2015 11:35:02 +0000 (11:35 +0000)]
Merge pull request #2351 from ludovic-henry/fix-socket-36941

[socket] Add test for SocketOptionName.MulticastTimeToLive

8 years agoMerge pull request #2345 from akoeplinger/xbuild14
Marek Safar [Wed, 16 Dec 2015 11:13:07 +0000 (12:13 +0100)]
Merge pull request #2345 from akoeplinger/xbuild14

Bump xbuild script to 14.0 and a few other fixes

8 years agoAdd test for bug #15153
Mark Mikofski [Tue, 16 Jun 2015 18:44:02 +0000 (11:44 -0700)]
Add test for bug #15153

8 years ago[socket] Add test for SocketOptionName.MulticastTimeToLive
Ludovic Henry [Tue, 15 Dec 2015 21:25:43 +0000 (21:25 +0000)]
[socket] Add test for SocketOptionName.MulticastTimeToLive

8 years agoMerge pull request #2354 from xmcclure/ugh-no-gdi
Andi McClure [Wed, 16 Dec 2015 03:38:31 +0000 (22:38 -0500)]
Merge pull request #2354 from xmcclure/ugh-no-gdi

Fix Microsoft.Build.Tasks make check on OS X

8 years agoFix Microsoft.Build.Tasks make check on OS X
Andi McClure [Tue, 15 Dec 2015 22:23:31 +0000 (17:23 -0500)]
Fix Microsoft.Build.Tasks make check on OS X

The mcs/class/Microsoft.Build.Tasks make check contains a test whose
goal is to verify that Microsoft.Build.Evaluation.Project can run a
MSBuild code fragment which has an assembly reference. The assembly
referenced in the test is System.Drawing. However on many systems
System.Drawing does not work without special setup. The test should
reference a different assembly (I picked System.Runtime.Serialization)
because ensuring System.Drawing is working isn't relevant to the test.

8 years agoMerge pull request #2346 from xmcclure/proxy-load-fail
Andi McClure [Tue, 15 Dec 2015 21:39:09 +0000 (16:39 -0500)]
Merge pull request #2346 from xmcclure/proxy-load-fail

Let GetTransparentProxy fail clean on load error (bug 36848)

8 years ago[signcode] Change default hashing algorithm from MD5 to SHA1
Alexander Köplinger [Tue, 15 Dec 2015 19:57:57 +0000 (20:57 +0100)]
[signcode] Change default hashing algorithm from MD5 to SHA1

MD5 is considered insecure and switching the default to SHA1 should be better for everyone.

See the discussion on the mailing list: http://lists.ximian.com/pipermail/mono-devel-list/2015-December/043424.html

8 years ago[scripts] Bump xbuild script to 14.0
Alexander Köplinger [Tue, 15 Dec 2015 18:44:43 +0000 (19:44 +0100)]
[scripts] Bump xbuild script to 14.0

This means we'll use xbuild 14.0 by default, which allows users to build projects with ToolsVersion=14.0

8 years ago[xbuild] Add new TargetFrameworkVersion entries in Microsoft.Common.targets
Alexander Köplinger [Tue, 15 Dec 2015 18:43:01 +0000 (19:43 +0100)]
[xbuild] Add new TargetFrameworkVersion entries in Microsoft.Common.targets

Add the new 4.5.2, 4.6 and 4.6.1 versions to Microsoft.Common.targets so xbuild doesn't print "warning : TargetFrameworkVersion 'v4.6.1' not supported by this toolset".

Additionally I found a bug in the target where "and" was used instead of "or" which means the condition was never true, fixed as well.

8 years agoLet GetTransparentProxy fail clean on load error (bug 36848)
Andi McClure [Tue, 15 Dec 2015 18:47:56 +0000 (13:47 -0500)]
Let GetTransparentProxy fail clean on load error (bug 36848)

icall for Remoting.RealProxy.GetTransparentProxy can sometimes attempt
to load an invalid class which is not previously loaded. Currently,
this leads to an assert failure in mono_class_proxy_vtable which does
not expect to be getting an invalid proxy class as input. Fix is for
the icall to load the class early and raise on failure.

A test is included.

8 years agoMerge pull request #2338 from BogdanovKirill/httpwritefix3
monojenkins [Tue, 15 Dec 2015 17:43:22 +0000 (17:43 +0000)]
Merge pull request #2338 from BogdanovKirill/httpwritefix3

[HttpConnection] Bug fix: HttpListener's "IgnoreWriteExceptions" property value is ignored when "Expect: 100-Continue" header set in request

That problem was discussed previously here: https://github.com/mono/mono/pull/2300
I want to offer alternative solution now.

8 years agoMerge pull request #2344 from ludovic-henry/fix-servicemodel-flakiness
monojenkins [Tue, 15 Dec 2015 16:00:03 +0000 (16:00 +0000)]
Merge pull request #2344 from ludovic-henry/fix-servicemodel-flakiness

[tests] Fix more System.ServiceModel flakiness

@monojenkins: automerge

8 years ago[tests] Fix more System.ServiceModel flakiness
Ludovic Henry [Tue, 15 Dec 2015 14:27:22 +0000 (14:27 +0000)]
[tests] Fix more System.ServiceModel flakiness

8 years agoMerge pull request #2343 from ludovic-henry/threads-cleanup
monojenkins [Tue, 15 Dec 2015 13:29:58 +0000 (13:29 +0000)]
Merge pull request #2343 from ludovic-henry/threads-cleanup

[automerge][threads] Various cleanups

None

8 years ago[threads] Add mono_thread_info_usleep function
Ludovic Henry [Tue, 15 Dec 2015 11:59:27 +0000 (11:59 +0000)]
[threads] Add mono_thread_info_usleep function

8 years ago[threads] Bring mono_thread_info_safe_suspend_and_run code together
Ludovic Henry [Tue, 15 Dec 2015 11:58:21 +0000 (11:58 +0000)]
[threads] Bring mono_thread_info_safe_suspend_and_run code together