mono.git
8 years ago[xbuild] Fix #40094, part 1/2: SolutionParser: Emit `AbsolutePath="..."`
Ankit Jain [Wed, 6 Apr 2016 18:11:17 +0000 (14:11 -0400)]
[xbuild] Fix #40094, part 1/2: SolutionParser: Emit `AbsolutePath="..."`

.. attribute for CurrentSolutionConfigurationContents .

   <CurrentSolutionConfigurationContents>
         <SolutionConfiguration xmlns="">
   <ProjectConfiguration Project="{82323650-6C2A-4FAC-91C6-A715C2FE9CB2}" AbsolutePath="/Users/ankit/test/msbuild/bug40094/App1/App1\App1\App1.csproj">
   Release|AnyCPU
   </ProjectConfiguration>
   ...

Related to fix for bxc #40094

8 years agoMerge pull request #2836 from kumpera/cwt_toggleref
Rodrigo Kumpera [Wed, 6 Apr 2016 15:24:52 +0000 (11:24 -0400)]
Merge pull request #2836 from kumpera/cwt_toggleref

Fixed a toggleref and CWT iteraction bug.

8 years ago[runtime] Fixed invalid comparisons to MonoMarshalConv in marshal.c.
Joao Matos [Wed, 6 Apr 2016 15:08:28 +0000 (16:08 +0100)]
[runtime] Fixed invalid comparisons to MonoMarshalConv in marshal.c.

In some platforms, C enums might be considered unsigned, and in that case we'd get the following warning:

mono/mono/metadata/marshal.c:5108:12: warning: comparison of constant -1 with expression of type 'MonoMarshalConv' is always false
      [-Wtautological-constant-out-of-range-compare]
                if (conv == -1) {
                    ~~~~ ^  ~~

The explicit cast should do the right thing.

8 years agoMerge pull request #2833 from directhex/ci-script-in-repo
Alexander Köplinger [Wed, 6 Apr 2016 13:12:29 +0000 (15:12 +0200)]
Merge pull request #2833 from directhex/ci-script-in-repo

Keep Jenkins job script in Mono repo

8 years agoMerge pull request #2804 from radical/al-cecil
Marek Safar [Wed, 6 Apr 2016 11:50:07 +0000 (13:50 +0200)]
Merge pull request #2804 from radical/al-cecil

AL: Use IKVM.Reflection to get custom attributes from the template assembly,

8 years agoMerge pull request #2840 from directhex/fix_make_dist_commoncrypto
Alexander Köplinger [Wed, 6 Apr 2016 09:24:56 +0000 (11:24 +0200)]
Merge pull request #2840 from directhex/fix_make_dist_commoncrypto

Fix missing CommonCrypto/Makefile.include in "make dist" tarballs

8 years agoFix missing CommonCrypto/Makefile.include in "make dist" tarballs
Jo Shields [Wed, 6 Apr 2016 09:04:50 +0000 (10:04 +0100)]
Fix missing CommonCrypto/Makefile.include in "make dist" tarballs

8 years agoKeep Jenkins job script in Mono repo
Jo Shields [Tue, 5 Apr 2016 15:18:41 +0000 (16:18 +0100)]
Keep Jenkins job script in Mono repo

This means we can change the script in different branches (right now, all pull requests against any branch share the same job script)

8 years ago[Microsoft.Build.Tasks] Fix CodeTaskFactory to resolve user references
Marek Safar [Wed, 6 Apr 2016 06:54:02 +0000 (08:54 +0200)]
[Microsoft.Build.Tasks] Fix CodeTaskFactory to resolve user references

8 years agoMerge pull request #2835 from lewurm/fix-make-dist
monojenkins [Wed, 6 Apr 2016 01:40:27 +0000 (02:40 +0100)]
Merge pull request #2835 from lewurm/fix-make-dist

[sqlmetal] fixup for a73fb31f2 in order to fix `make dist'

8 years ago[sgen] Mark togglerefs before processing ephemerons. Fixes #40108.
Rodrigo Kumpera [Tue, 5 Apr 2016 22:50:10 +0000 (18:50 -0400)]
[sgen] Mark togglerefs before processing ephemerons. Fixes #40108.

Strong Togglerefs must be considered as roots for the purpose of Ephemeron processing.

Otherwise you make it not possible to use a toggleref object as key.

8 years agoAL: Use IKVM.Reflection to get custom attributes from the template assembly,
Ankit Jain [Tue, 29 Mar 2016 21:23:06 +0000 (17:23 -0400)]
AL: Use IKVM.Reflection to get custom attributes from the template assembly,

.. instead of System.Reflection. This allows AL to work even if the
dependent assemblies of the template are not available.

8 years agoMerge pull request #2834 from xmcclure/inflated_method_header_leak_followup
monojenkins [Tue, 5 Apr 2016 22:00:37 +0000 (23:00 +0100)]
Merge pull request #2834 from xmcclure/inflated_method_header_leak_followup

Fix uninitialized MonoError in mono_basic_block_split

Follow-up on PR #2781 which removed a mono_error_init leading to memory unsafety. This was causing crashes when verifying assemblies in the 4.4 branch although it does not seem to have caused any known problems in master for some reason.

8 years ago[sqlmetal] fixup for a73fb31f2 in order to fix `make dist'
Bernhard Urban [Tue, 5 Apr 2016 21:08:31 +0000 (14:08 -0700)]
[sqlmetal] fixup for a73fb31f2 in order to fix `make dist'

8 years agoMerge pull request #2832 from razzfazz/handle_eintr
Alexander Köplinger [Tue, 5 Apr 2016 19:39:14 +0000 (21:39 +0200)]
Merge pull request #2832 from razzfazz/handle_eintr

handle EINTR for kevent calls

8 years agoDocument mono_error_init convention in source
Andi McClure [Tue, 5 Apr 2016 18:51:25 +0000 (14:51 -0400)]
Document mono_error_init convention in source

8 years ago[runtime] restore mono_error_init in mono_basic_block_split
Andi McClure [Tue, 5 Apr 2016 18:32:18 +0000 (14:32 -0400)]
[runtime] restore mono_error_init in mono_basic_block_split

Follow-up on PR #2781 which removed a mono_error_init. Ensure use in
helper functions for consistency. Fixes a potential crasher.

8 years ago[Microsoft.Build.Utilities] Fixes tests resources build
Marek Safar [Tue, 5 Apr 2016 18:08:41 +0000 (20:08 +0200)]
[Microsoft.Build.Utilities] Fixes tests resources build

8 years ago[sqlmetal] Remove wrong tests config
Marek Safar [Tue, 5 Apr 2016 17:52:07 +0000 (19:52 +0200)]
[sqlmetal] Remove wrong tests config

8 years ago[mcs] Remove duplicate references
Marek Safar [Tue, 5 Apr 2016 17:17:57 +0000 (19:17 +0200)]
[mcs] Remove duplicate references

8 years agoBump referencesource
Marek Safar [Tue, 5 Apr 2016 13:56:24 +0000 (15:56 +0200)]
Bump referencesource

8 years agoMerge pull request #2831 from razzfazz/fix_dllimport
Alexander Köplinger [Tue, 5 Apr 2016 13:04:31 +0000 (15:04 +0200)]
Merge pull request #2831 from razzfazz/fix_dllimport

clean up DllImport attributes

8 years ago[System] Always pass -noconfig to codedom c# compiler
Marek Safar [Tue, 5 Apr 2016 11:38:36 +0000 (13:38 +0200)]
[System] Always pass -noconfig to codedom c# compiler

8 years ago[build] Exclude generated .g.cs files from "make dist"
Alexander Köplinger [Tue, 5 Apr 2016 11:19:25 +0000 (13:19 +0200)]
[build] Exclude generated .g.cs files from "make dist"

The recent changes to the mobile profiles introduced generated files in their .sources like CommonCrypto/MD5CryptoServiceProvider.g.cs
However, those are not generated when the mobile profiles aren't enabled at configure time.

This caused a problem during "make dist" since it tries to grab the entries in .sources from *all* profiles, causing errors like:

    cp: cannot stat ‘CommonCrypto/MD5CryptoServiceProvider.g.cs’: No such file or directory
    make[5]: *** [dist-local] Error 1

The easiest fix is to filter out those generated files.

8 years agoclean up DllImport attributes
Daniel Becker [Tue, 5 Apr 2016 07:35:21 +0000 (00:35 -0700)]
clean up DllImport attributes

Any native function that can modify errno should have the
SetLastError attribute set to true. Also, no need to specify
EntryPoint if it's the same as the function name.

8 years ago[runtime] Allow the options in MONO_DEBUG to be passed as a command line option too.
Zoltan Varga [Mon, 4 Apr 2016 23:13:33 +0000 (19:13 -0400)]
[runtime] Allow the options in MONO_DEBUG to be passed as a command line option too.

8 years ago[llvm] Enable pinvoke call using the C calling conv in llvm-only mode.
Zoltan Varga [Mon, 4 Apr 2016 23:02:56 +0000 (19:02 -0400)]
[llvm] Enable pinvoke call using the C calling conv in llvm-only mode.

8 years ago[corlib] Make some ExceptionDispatchInfo tests with BitcodeNotWorking because we...
Zoltan Varga [Mon, 4 Apr 2016 22:20:49 +0000 (18:20 -0400)]
[corlib] Make some ExceptionDispatchInfo tests with BitcodeNotWorking because we don't truncate stack traces of exceptions at the catch site when running with bitcode.

8 years agoMerge pull request #2827 from xmcclure/profile-clean-0.1
Rodrigo Kumpera [Mon, 4 Apr 2016 21:24:52 +0000 (17:24 -0400)]
Merge pull request #2827 from xmcclure/profile-clean-0.1

Continued profiler loading cleanup (PR#2816 follow up)

8 years agoMerge pull request #2545 from ermshiperete/Xamarin-24974
monojenkins [Mon, 4 Apr 2016 20:11:31 +0000 (21:11 +0100)]
Merge pull request #2545 from ermshiperete/Xamarin-24974

[corlib] Fix exception in __ComObject finalizer during shutdown

* keep a reference to a __ComObject's proxy so it doesn't get garbage
  collected
* don't create __ComObjects unnecessarily
* Fix for bug [24974](https://bugzilla.xamarin.com/show_bug.cgi?id=24974)

8 years ago[build] Update nunit-console path for xbuild profiles
Marek Safar [Mon, 4 Apr 2016 15:30:08 +0000 (17:30 +0200)]
[build] Update nunit-console path for xbuild profiles

8 years ago[Microsoft.Build.Engine] Update test files
Marek Safar [Mon, 4 Apr 2016 15:25:22 +0000 (17:25 +0200)]
[Microsoft.Build.Engine] Update test files

8 years ago[mcs] Make more errors build explicit
Marek Safar [Mon, 4 Apr 2016 15:03:47 +0000 (17:03 +0200)]
[mcs] Make more errors build explicit

8 years ago[System.Runtime.Serialization.dll] Update referencesource strings
Marek Safar [Mon, 4 Apr 2016 14:40:22 +0000 (16:40 +0200)]
[System.Runtime.Serialization.dll] Update referencesource strings

8 years ago[tools] Update missing reference
Marek Safar [Mon, 4 Apr 2016 13:37:32 +0000 (15:37 +0200)]
[tools] Update missing reference

8 years agoFix make dist
Alexander Köplinger [Mon, 4 Apr 2016 14:34:20 +0000 (16:34 +0200)]
Fix make dist

8 years ago[test-runner] Ignore exceptions during process kill
Alexander Köplinger [Mon, 4 Apr 2016 13:34:24 +0000 (15:34 +0200)]
[test-runner] Ignore exceptions during process kill

We hit this on Jenkins over the weekend:
https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/3845/parsed_console/log_content.html#WARNING1

```
Unhandled Exception:
System.InvalidOperationException: Cannot process request because the process (51792) has exited.
  at System.Diagnostics.Process.GetProcessHandle (Int32 access, Boolean throwIfExited) <0x10d7ea000 + 0x001b6> in <filename unknown>:0
  at System.Diagnostics.Process.GetProcessHandle (Int32 access) <0x10d7f2fd0 + 0x0001e> in <filename unknown>:0
  at System.Diagnostics.Process.Kill () <0x10d7f2ee0 + 0x00031> in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Kill ()
  at TestRunner+<Main>c__AnonStorey0.<>m__0 () <0x10a9b50b0 + 0x00e30> in <filename unknown>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x10c55bc90 + 0x0009a> in <filename unknown>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x10c55a210 + 0x001c6> in <filename unknown>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x10c55a1e0 + 0x00020> in <filename unknown>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) <0x10c55a130 + 0x00059> in <filename unknown>:0
  at System.Threading.ThreadHelper.ThreadStart () <0x10c55be50 + 0x0002e> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Cannot process request because the process (51792) has exited.
  at System.Diagnostics.Process.GetProcessHandle (Int32 access, Boolean throwIfExited) <0x10d7ea000 + 0x001b6> in <filename unknown>:0
  at System.Diagnostics.Process.GetProcessHandle (Int32 access) <0x10d7f2fd0 + 0x0001e> in <filename unknown>:0
  at System.Diagnostics.Process.Kill () <0x10d7f2ee0 + 0x00031> in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Kill ()
  at TestRunner+<Main>c__AnonStorey0.<>m__0 () <0x10a9b50b0 + 0x00e30> in <filename unknown>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x10c55bc90 + 0x0009a> in <filename unknown>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x10c55a210 + 0x001c6> in <filename unknown>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x10c55a1e0 + 0x00020> in <filename unknown>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) <0x10c55a130 + 0x00059> in <filename unknown>:0
  at System.Threading.ThreadHelper.ThreadStart () <0x10c55be50 + 0x0002e> in <filename unknown>:0
make[1]: *** [test-generic-sharing-managed] Error 1
```

We can't do anything about those errors, so just catch and ignore it.

8 years ago[build] Update mcs path in mini tests
Marek Safar [Mon, 4 Apr 2016 13:23:06 +0000 (15:23 +0200)]
[build] Update mcs path in mini tests

8 years ago[Facades] Update list of full assemblies
Marek Safar [Mon, 4 Apr 2016 12:40:56 +0000 (14:40 +0200)]
[Facades] Update list of full assemblies

8 years ago[mcs] Basic boostrap references are always default ones
Marek Safar [Mon, 4 Apr 2016 12:12:51 +0000 (14:12 +0200)]
[mcs] Basic boostrap references are always default ones

8 years ago[Microsoft.Build.Engine] Simplify bd70a55ec7aaeb40b2b0054e0f162c709085842f
Marek Safar [Mon, 4 Apr 2016 12:02:10 +0000 (14:02 +0200)]
[Microsoft.Build.Engine] Simplify bd70a55ec7aaeb40b2b0054e0f162c709085842f

8 years ago[Microsoft.Build.Engine] clean/copy mdb files as well
Marek Safar [Mon, 4 Apr 2016 12:01:02 +0000 (14:01 +0200)]
[Microsoft.Build.Engine] clean/copy mdb files as well

8 years ago[build] Change the way how mcs references are passed to compiler to always use full...
Marek Safar [Mon, 4 Apr 2016 11:42:47 +0000 (13:42 +0200)]
[build] Change the way how mcs references are passed to compiler to always use full path.

One of csc prerequisites because csc uses -lib as path which is considered after
RuntimeEnvironment.GetRuntimeDirectory which makes -lib useless

8 years ago[System.Runtime.Serialization.Formatters.Soap] Make test output deterministic
Marek Safar [Sun, 3 Apr 2016 18:26:33 +0000 (20:26 +0200)]
[System.Runtime.Serialization.Formatters.Soap] Make test output deterministic

8 years ago[Mono.C5] Make test output deterministic
Marek Safar [Sun, 3 Apr 2016 18:12:41 +0000 (20:12 +0200)]
[Mono.C5] Make test output deterministic

8 years agoMerge pull request #2713 from gregoryyoung/master
Ludovic Henry [Mon, 4 Apr 2016 10:15:08 +0000 (11:15 +0100)]
Merge pull request #2713 from gregoryyoung/master

handles AwaitAsync finishing synchronously

8 years ago[amd64] Add a separate ArgStorage entry for gsharedvt return types instead of using...
Zoltan Varga [Sun, 3 Apr 2016 01:02:50 +0000 (21:02 -0400)]
[amd64] Add a separate ArgStorage entry for gsharedvt return types instead of using a separate flag in CallInfo.

8 years ago[acceptance-tests] Fix test-runner.exe compilation after 136dd0
Alexander Köplinger [Sun, 3 Apr 2016 00:56:29 +0000 (02:56 +0200)]
[acceptance-tests] Fix test-runner.exe compilation after 136dd0

8 years agoMerge pull request #2720 from mono/fix-39325
monojenkins [Sat, 2 Apr 2016 15:50:31 +0000 (16:50 +0100)]
Merge pull request #2720 from mono/fix-39325

[Profiler] Keep a reference to assemblies while coverage is running

In certain circumstances, for example when running under nunit-console, assemblies could be unloaded while the profiler still had a reference to them in order to generate the coverage data. In these cases, the memory referred to by the profiler would be invalid and would crash.

Fix this by incrementing the reference count of the assemblies preventing them from being unloaded while coverage is being collected.

Fixes BXC #39325

8 years ago[runtime] Move the test for shutting down the stat profiler to mini_cleanup ().
Zoltan Varga [Sat, 2 Apr 2016 06:32:04 +0000 (02:32 -0400)]
[runtime] Move the test for shutting down the stat profiler to mini_cleanup ().

8 years ago[arm64] Fix the generation of static rgctx trampolines when using aot on linux.
Zoltan Varga [Sat, 2 Apr 2016 05:38:43 +0000 (01:38 -0400)]
[arm64] Fix the generation of static rgctx trampolines when using aot on linux.

8 years ago[arm64] Implement handler block guard trampolines.
Zoltan Varga [Sat, 2 Apr 2016 05:27:27 +0000 (01:27 -0400)]
[arm64] Implement handler block guard trampolines.

8 years ago[runtime] Fix a crash when shutting down the sampling thread.
Zoltan Varga [Sat, 2 Apr 2016 05:23:35 +0000 (01:23 -0400)]
[runtime] Fix a crash when shutting down the sampling thread.

8 years ago[tests] Increase the timeout in the test runner so running tests with llvm doesn...
Zoltan Varga [Sat, 2 Apr 2016 02:36:15 +0000 (22:36 -0400)]
[tests] Increase the timeout in the test runner so running tests with llvm doesn't time out.

8 years ago[metadata] Remove invalid Win32 entry in object-offsets.h
Alexander Köplinger [Sat, 2 Apr 2016 01:56:01 +0000 (18:56 -0700)]
[metadata] Remove invalid Win32 entry in object-offsets.h

The lmf_addr field in MonoLMF only exists for TARGET_X86.

8 years ago[mini] Remove duplicate stubs from tramp-amd64/x86-gsharedvt.c
Alexander Köplinger [Sat, 2 Apr 2016 01:53:22 +0000 (18:53 -0700)]
[mini] Remove duplicate stubs from tramp-amd64/x86-gsharedvt.c

They already exist in arch-stubs.c and caused conflicts on the MSVC build.

8 years ago[msvc] Add missing files to MSVC project files
Alexander Köplinger [Sat, 2 Apr 2016 01:17:39 +0000 (18:17 -0700)]
[msvc] Add missing files to MSVC project files

8 years ago[mini] Fix build on systems without clock_nanosleep ().
Alex Rønne Petersen [Fri, 1 Apr 2016 20:25:10 +0000 (22:25 +0200)]
[mini] Fix build on systems without clock_nanosleep ().

8 years ago[jit] Handle verification failing with InvalidProgramException. Fixes #40040.
Rodrigo Kumpera [Fri, 1 Apr 2016 20:15:41 +0000 (13:15 -0700)]
[jit] Handle verification failing with  InvalidProgramException. Fixes #40040.

8 years ago[runtime] Make a copy of the types passed to mono_mb_add_local () earlier since they...
Zoltan Varga [Fri, 1 Apr 2016 20:12:23 +0000 (16:12 -0400)]
[runtime] Make a copy of the types passed to mono_mb_add_local () earlier since they could be transient.

8 years ago[arm64] Fix clearing of stack traces when an exception is rethrown. Fix the calculati...
Zoltan Varga [Fri, 1 Apr 2016 20:03:20 +0000 (16:03 -0400)]
[arm64] Fix clearing of stack traces when an exception is rethrown. Fix the calculation of struct sizes in pinvoke calls. Remove some dead code.

8 years agoContinued profiler loading cleanup (PR#2816 follow up)
Andi McClure [Fri, 1 Apr 2016 19:39:38 +0000 (15:39 -0400)]
Continued profiler loading cleanup (PR#2816 follow up)

- Back out MONO_PROFILER_LIB_DIR change
- Profiler loading traces should use log mask “dll” not “asm”
- mono_dl_open_runtime_lib should preempt standard paths when loading
  profiler
- mono_dl_open_runtime_lib should check in profiler library directory
- mono_dl_open_runtime_lib contained a memory leak
- With above changes, ptestrunner.pl can remove some environment
  massaging

8 years agoMerge pull request #2825 from kumpera/loader_error_removal
Rodrigo Kumpera [Fri, 1 Apr 2016 18:19:24 +0000 (11:19 -0700)]
Merge pull request #2825 from kumpera/loader_error_removal

GOOD RIDDANCE LOADER ERROR

8 years agoMerge pull request #2826 from mattleibow/mono.options-update
Alexander Köplinger [Fri, 1 Apr 2016 13:08:50 +0000 (15:08 +0200)]
Merge pull request #2826 from mattleibow/mono.options-update

[Mono.Options] Added support for Enums in the PCL version

8 years ago[System.Web.Extensions] Add test for last fix
Alexander Köplinger [Fri, 1 Apr 2016 12:11:03 +0000 (14:11 +0200)]
[System.Web.Extensions] Add test for last fix

8 years ago[System.Web.Extensions] Use CultureInfo.InvariantCulture for number parsing
Jussi Sainio [Fri, 6 Jun 2014 12:54:21 +0000 (15:54 +0300)]
[System.Web.Extensions] Use CultureInfo.InvariantCulture for number parsing

Fixes #4242, see bug comments. JsonSerializer seems to have been already
fixed in abe9dc62. The JsonDeserializer number conversion is now much
stricter, allowing only integer number style for integers and float number
style for floats.

8 years agoMerge pull request #2805 from alexrp/profiler-sampling-thread2
monojenkins [Fri, 1 Apr 2016 07:00:18 +0000 (08:00 +0100)]
Merge pull request #2805 from alexrp/profiler-sampling-thread2

[profiler] Use a background thread to send out sampling signals.

Previously, when using an interval timer, the initial profiling signal could be
delivered to *any* thread in the process. This is not normally a problem, but
if the signaled thread has not even finished its initialization inside libc, it
can happen that it hasn't even set up thread-local storage yet. We then blow up
spectacularly when trying to back up errno in the SIGPROF signal handler, as
it's a TLS variable. Even the SIGSEGV handler blows up immediately after as it
can't access JIT TLS data.

Since there appears to be no reliable and portable way for a library like Mono
to control which exact thread gets the initial timer signal, instead switch to
using a background thread that uses a high-resolution sleep and attempts to
switch itself to real time scheduling if possible. This way, we have full
control over which threads we send SIGPROF to, letting us avoid any threads
which aren't in a 'good' state for profiling.

This commit also gets rid of the multiplexing that was going on in the SIGPROF
signal handler, since we now send out the signals from a background thread. As
this was the only use of the async job API, that API has been removed. This
indirectly fixes the signal storming issue that sometimes popped up, where for
some reason multiple threads would think that they're the initiating thread,
resulting in way too many signals going out.

A nice side-effect of doing the signaling ourselves is that we can now use
real-time signals on systems that have them (e.g. Linux), resulting in a nearly
100% signal delivery rate in all cases. Previously, we would lose a tremendous
amount of signals when an application was under heavy load.

8 years ago[arm64] Implement interruption checking in the trampoline code.
Zoltan Varga [Fri, 1 Apr 2016 04:27:48 +0000 (00:27 -0400)]
[arm64] Implement interruption checking in the trampoline code.

8 years ago[Mono.Options] Added support for Enums in the PCL version
Matthew Leibowitz [Fri, 1 Apr 2016 03:13:46 +0000 (05:13 +0200)]
[Mono.Options] Added support for Enums in the PCL version
 - Support for String to Enum
 - Support for Number to Enum
 - Support for Flags to Enum
 - Added a UnitTest

8 years ago[profiler] Use a background thread to send out sampling signals.
Alex Rønne Petersen [Sun, 20 Mar 2016 02:08:42 +0000 (03:08 +0100)]
[profiler] Use a background thread to send out sampling signals.

Previously, when using an interval timer, the initial profiling signal could be
delivered to *any* thread in the process. This is not normally a problem, but
if the signaled thread has not even finished its initialization inside libc, it
can happen that it hasn't even set up thread-local storage yet. We then blow up
spectacularly when trying to back up errno in the SIGPROF signal handler, as
it's a TLS variable. Even the SIGSEGV handler blows up immediately after as it
can't access JIT TLS data.

Since there appears to be no reliable and portable way for a library like Mono
to control which exact thread gets the initial timer signal, instead switch to
using a background thread that uses a high-resolution sleep and attempts to
switch itself to real time scheduling if possible. This way, we have full
control over which threads we send SIGPROF to, letting us avoid any threads
which aren't in a 'good' state for profiling.

This commit also gets rid of the multiplexing that was going on in the SIGPROF
signal handler, since we now send out the signals from a background thread. As
this was the only use of the async job API, that API has been removed. This
indirectly fixes the signal storming issue that sometimes popped up, where for
some reason multiple threads would think that they're the initiating thread,
resulting in way too many signals going out.

A nice side-effect of doing the signaling ourselves is that we can now use
real-time signals on systems that have them (e.g. Linux), resulting in a nearly
100% signal delivery rate in all cases. Previously, we would lose a tremendous
amount of signals when an application was under heavy load.

8 years ago[Mono.Security] Remove leftover .sources files
Alexander Köplinger [Fri, 1 Apr 2016 00:34:44 +0000 (02:34 +0200)]
[Mono.Security] Remove leftover .sources files

8 years ago[runtime] Remove mono_loader_clear_error, mono_loader_assert_no_error and set_failure...
Rodrigo Kumpera [Fri, 1 Apr 2016 00:23:26 +0000 (17:23 -0700)]
[runtime] Remove mono_loader_clear_error, mono_loader_assert_no_error and set_failure_from_loader_error. The loader error is no more.

8 years ago[runtime] Remove mono_loader_get_last_error, nothing produces loader errors anymore.
Rodrigo Kumpera [Fri, 1 Apr 2016 00:09:56 +0000 (17:09 -0700)]
[runtime] Remove mono_loader_get_last_error, nothing produces loader errors anymore.

8 years ago[runtime] Remove mono_loader_error_prepare_exception, nothing can produce loader...
Rodrigo Kumpera [Thu, 31 Mar 2016 23:39:00 +0000 (16:39 -0700)]
[runtime] Remove mono_loader_error_prepare_exception, nothing can produce loader errors anymore.

8 years ago[runtime] Remove all functions that set the loader error. It's dead code now.
Rodrigo Kumpera [Thu, 31 Mar 2016 23:10:57 +0000 (16:10 -0700)]
[runtime] Remove all functions that set the loader error. It's dead code now.

8 years ago[mono-error] Remove mono_loader_set_error_from_mono_error, nothing uses it.
Rodrigo Kumpera [Thu, 31 Mar 2016 22:53:33 +0000 (15:53 -0700)]
[mono-error] Remove mono_loader_set_error_from_mono_error, nothing uses it.

8 years ago[mono-error] Since nothing sets the loader error anymore, mono_error_set_from_loader_...
Rodrigo Kumpera [Thu, 31 Mar 2016 22:44:37 +0000 (15:44 -0700)]
[mono-error] Since nothing sets the loader error anymore, mono_error_set_from_loader_error can be removed.

8 years agoFix warnings/remove dead code.
Zoltan Varga [Thu, 31 Mar 2016 22:28:47 +0000 (18:28 -0400)]
Fix warnings/remove dead code.

8 years agoFix a warning.
Zoltan Varga [Thu, 31 Mar 2016 22:21:59 +0000 (18:21 -0400)]
Fix a warning.

8 years ago[runtime] Fix the arm linux build by using the fallback InterlockedCompareExchange64...
Zoltan Varga [Thu, 31 Mar 2016 22:18:48 +0000 (18:18 -0400)]
[runtime] Fix the arm linux build by using the fallback InterlockedCompareExchange64 () implementation for now.

8 years ago[runtime] Fix some warnings/remove dead code.
Zoltan Varga [Thu, 31 Mar 2016 22:12:19 +0000 (18:12 -0400)]
[runtime] Fix some warnings/remove dead code.

8 years ago[corlib] Ensure newline in .sources file
Alexander Köplinger [Thu, 31 Mar 2016 22:08:31 +0000 (00:08 +0200)]
[corlib] Ensure newline in .sources file

It causes build issues on .sources with #include on Linux otherwise.

8 years ago[corlib] Fix monotouch_tv_runtime and monotouch_watch_runtime build
Alexander Köplinger [Thu, 31 Mar 2016 22:02:04 +0000 (00:02 +0200)]
[corlib] Fix monotouch_tv_runtime and monotouch_watch_runtime build

8 years agoUpdate X509CertificateImplApple to reflect latest X509CertificateImpl changes.
Martin Baulig [Thu, 24 Mar 2016 00:53:41 +0000 (20:53 -0400)]
Update X509CertificateImplApple to reflect latest X509CertificateImpl changes.

(cherry picked from commit 2fdfbe3479b0d3d24a5471ed7032eede80e58a2d)

8 years ago[reflection] Fix leak in mono_reflection_get_custom_attrs_{by_type,data_checked}
Aleksey Kliger [Thu, 31 Mar 2016 21:26:19 +0000 (17:26 -0400)]
[reflection] Fix leak in mono_reflection_get_custom_attrs_{by_type,data_checked}

If there's an error, first call mono_custom_attrs_free, then deal with
the error.

8 years ago[security-core-clr] Fixup function signature to match header
Aleksey Kliger [Thu, 31 Mar 2016 21:25:28 +0000 (17:25 -0400)]
[security-core-clr] Fixup function signature to match header

mono_security_core_clr_ensure_reflection_access_method should return a
boolean now.

8 years agoMerge pull request #2816 from xmcclure/profile-clean-0
monojenkins [Thu, 31 Mar 2016 19:05:17 +0000 (20:05 +0100)]
Merge pull request #2816 from xmcclure/profile-clean-0

Various cleanups on profiler

3 commits:

Assist on profiler module loading

- Add a MONO_PROFILER_LIB_DIR from which profiler modules are
  dynamically loading, in case it is not the normal library path
- Add information about profiler loading to mono_trace

Comments and clarity in proflog.c

- Add comments on structures
- Rename 'data' and 'data_end' to 'cursor' and 'buf_end' in LogBuffer/StatsBuffer as the old names were confusing
- Add new assert when processing samples

Improve a safety check when writing data into StatBuffer

- The safety check should occur such that if the new value for
StatBuffer::cursor is beyond the bounds of the StatBuffer, the cursor
is not updated.

8 years agoMerge pull request #2810 from kumpera/fix_hazard_free
monojenkins [Thu, 31 Mar 2016 19:00:19 +0000 (20:00 +0100)]
Merge pull request #2810 from kumpera/fix_hazard_free

Fix hazard free

Replace usage of mono_thread_hazardous_free_or_queue and remove it.

    mono_thread_hazardous_free_or_queue has a fundamentally broken design.

    It allows arbitrary free code to run in the context of its caller.

    The sync/async split on where it's called is not enough to know whether
    we can run free'ing code or not.

    Since in sync context we called free functions that could take locks,
    it happened that those locks conflicted with the ones already taken.

    In particular, mono_jit_info_table_free did take a domain lock and
    quite a few of the sync context calls would hold locks that must
    not be held when taking a domain lock.

    This, is practice, means that we'd need to partition the free calls
    into 3 groups: async context, reentrant context (no runtime locks held)
    and sync context (maybe some locks held).

    There was no case where reentrant context would be usable meaning,
    in practice, that all calls happens in what effectively is async context
    where free functions can't be called.

    The new design is a lot more straightforward:

    - No implicit free queue pumping
    - A pair of free functions with well defined behavior.
     mono_thread_hazardous_try_free - to be used where the caller expects the free function to be called
     mono_thread_hazardous_queue_free - to be used where the caller don't expect the free function to be called [1]
    - Explicit pumping on places that known to be ok
     Thread detach
     Finalizer thread

    [1] This might sound like a weird condition, but a lot of lock-free code
    have compensation logic that trigger free'ing during lookups.

8 years agoFix warnings.
Zoltan Varga [Thu, 31 Mar 2016 18:12:05 +0000 (14:12 -0400)]
Fix warnings.

8 years ago[gsharedvt] Change the --enable-gsharedvt configure option to a no-op, its always...
Zoltan Varga [Thu, 31 Mar 2016 17:42:49 +0000 (13:42 -0400)]
[gsharedvt] Change the --enable-gsharedvt configure option to a no-op, its always enabled by default.

8 years ago[gsharedvt] Integrate mini-generic-sharing-gsharedvt.c into mini-generic-sharing.c.
Zoltan Varga [Thu, 31 Mar 2016 17:37:02 +0000 (13:37 -0400)]
[gsharedvt] Integrate mini-generic-sharing-gsharedvt.c into mini-generic-sharing.c.

8 years ago[runtime] Use mono_object_isinst_checked
Aleksey Kliger [Thu, 31 Mar 2016 17:32:19 +0000 (13:32 -0400)]
[runtime] Use mono_object_isinst_checked

    rather than mono_object_isinst.

8 years ago[arm64] Fix passing of small gsharedvt argument on the stack on ios. Fixes #39528.
Zoltan Varga [Thu, 31 Mar 2016 17:24:48 +0000 (13:24 -0400)]
[arm64] Fix passing of small gsharedvt argument on the stack on ios. Fixes #39528.

8 years agoMerge pull request #2820 from kumpera/license-change-rebased
Zoltan Varga [Thu, 31 Mar 2016 17:18:26 +0000 (13:18 -0400)]
Merge pull request #2820 from kumpera/license-change-rebased

Change license and publish xamarin mono extensions

8 years agoUpdate COPYING.LIB
Rodrigo Kumpera [Thu, 31 Mar 2016 16:18:04 +0000 (09:18 -0700)]
Update COPYING.LIB

8 years ago[utils] Fix the build.
Rodrigo Kumpera [Thu, 31 Mar 2016 16:12:22 +0000 (09:12 -0700)]
[utils] Fix the build.

8 years agoMerge pull request #2394 from Mailaender/patch-1
monojenkins [Thu, 31 Mar 2016 16:05:56 +0000 (17:05 +0100)]
Merge pull request #2394 from Mailaender/patch-1

Fixed runtime dependency on libgdiplus with developer soname

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

8 years agoUpdate trademark
hannakim123 [Wed, 30 Mar 2016 22:15:37 +0000 (15:15 -0700)]
Update trademark

8 years agoMerge pull request #1 from xamarin/hannakim123-patch-1
Miguel de Icaza [Thu, 31 Mar 2016 01:24:09 +0000 (18:24 -0700)]
Merge pull request #1 from xamarin/hannakim123-patch-1

Update for CLA

8 years ago[runtime] Cycle the finalizer thread if there are too many outstanding hazard pointer...
Rodrigo Kumpera [Thu, 31 Mar 2016 00:38:43 +0000 (17:38 -0700)]
[runtime] Cycle the finalizer thread if there are too many outstanding hazard pointers to free.

We add a callback to the HP so the GC can monitor the queue size and act on it.

The queue size was picked to keep the overhead limited even under high load.