mono.git
8 years agoMerge pull request #2587 from lambdageek/monoerror-api-cleanup-mistakes
Aleksey Kliger (λgeek) [Thu, 11 Feb 2016 17:29:59 +0000 (12:29 -0500)]
Merge pull request #2587 from lambdageek/monoerror-api-cleanup-mistakes

[runtime] Better error handling in mono_{assembly,module_file}_get_object

8 years agoMerge pull request #2590 from esdrubal/wcf_req
Marcos Henrich [Thu, 11 Feb 2016 17:19:25 +0000 (17:19 +0000)]
Merge pull request #2590 from esdrubal/wcf_req

BCL changes required by dotnet/wcf

8 years agoMerge pull request #2595 from ludovic-henry/tests-sgen
Ludovic Henry [Thu, 11 Feb 2016 16:20:45 +0000 (16:20 +0000)]
Merge pull request #2595 from ludovic-henry/tests-sgen

[tests] Remove manual for loop to run sgen tests and use different make targets

8 years ago[reflection] Better error behavior for API functions
Aleksey Kliger [Wed, 10 Feb 2016 00:35:11 +0000 (19:35 -0500)]
[reflection] Better error behavior for API functions

mono_assembly_get_object and mono_module_file_get_object should return
NULL on failure without raising an exception.

8 years ago[tests] Remove manual for loop to run sgen tests and use different make targets
Ludovic Henry [Wed, 10 Feb 2016 18:06:27 +0000 (18:06 +0000)]
[tests] Remove manual for loop to run sgen tests and use different make targets

8 years agoMerge pull request #2598 from dellis1972/master
Marek Safar [Thu, 11 Feb 2016 10:27:51 +0000 (11:27 +0100)]
Merge pull request #2598 from dellis1972/master

[msbuild] Registered the XmlPeek Build Task in the Microsoft.Common.tasks

8 years ago[msbuild] Registered the XmlPeek Build Task in the Microsoft.Common.tasks
Dean Ellis [Thu, 11 Feb 2016 10:09:57 +0000 (10:09 +0000)]
[msbuild] Registered the XmlPeek Build Task in the Microsoft.Common.tasks

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

The previous commit () was incomplete, while it added the source
file for XmlPeek it did not register them in the appropriate
MSBuild tasks files. As a result the XmlPeek task cannot be used.

8 years ago[aot] Fix the check in mono_aot_get_plt_entry () for thumb code, use 'code-4' instead...
Zoltan Varga [Thu, 11 Feb 2016 06:14:29 +0000 (01:14 -0500)]
[aot] Fix the check in mono_aot_get_plt_entry () for thumb code, use 'code-4' instead of 'code', since the latter points to after a call, so it could point outside the range of llvm code. Fixes #36723.

8 years ago[jit] Add a fastpath to Monitor.Enter () which doesn't have a wrapper, and add a...
Zoltan Varga [Thu, 11 Feb 2016 02:27:23 +0000 (21:27 -0500)]
[jit] Add a fastpath to Monitor.Enter () which doesn't have a wrapper, and add a slowpath which has a wrapper, so async stack traces work for threads blocked on monitors. Fixes #38525.

8 years agoFix a warning.
Zoltan Varga [Thu, 11 Feb 2016 02:26:06 +0000 (21:26 -0500)]
Fix a warning.

8 years ago[jit] Fix the peephole optimization added by 9fc7c1de3a2f7d42c732b20e272d9d6693720012...
Zoltan Varga [Thu, 11 Feb 2016 01:09:07 +0000 (20:09 -0500)]
[jit] Fix the peephole optimization added by 9fc7c1de3a2f7d42c732b20e272d9d6693720012, compare_imm+cond_exc_imm can only be eliminated if the comparison is false.

8 years agoRemove table that was not licensed under MIT
Miguel de Icaza [Wed, 10 Feb 2016 23:15:23 +0000 (18:15 -0500)]
Remove table that was not licensed under MIT

8 years ago[Mono.Security]: MonoTlsProviderFactory.GetProvider(string) now returns null on error.
Martin Baulig [Wed, 10 Feb 2016 23:13:01 +0000 (18:13 -0500)]
[Mono.Security]: MonoTlsProviderFactory.GetProvider(string) now returns null on error.

(cherry picked from commit 7f965e8220a67f3d806fb410e99ad453bddbe3bc)

8 years agoMerge pull request #2591 from gofman/cherry-branch
Alexander Köplinger [Wed, 10 Feb 2016 23:10:55 +0000 (00:10 +0100)]
Merge pull request #2591 from gofman/cherry-branch

[System.Windows.Forms] Recreate FosterWindow when required in XplatUIWin32

8 years agoMerge pull request #2594 from akoeplinger/fix-facade-lookup-when-mono-path-overriden
Alexander Köplinger [Wed, 10 Feb 2016 22:50:44 +0000 (23:50 +0100)]
Merge pull request #2594 from akoeplinger/fix-facade-lookup-when-mono-path-overriden

[metadata] Fix Facades lookup in assembly.c when MONO_PATH is set

8 years ago[profiler] Remove perf_event.h from EXTRA_DIST, too.
Alex Rønne Petersen [Wed, 10 Feb 2016 22:08:39 +0000 (23:08 +0100)]
[profiler] Remove perf_event.h from EXTRA_DIST, too.

8 years ago[profiler] Only include perf_event.h when actually needed, and use the system header.
Alex Rønne Petersen [Wed, 10 Feb 2016 21:34:09 +0000 (22:34 +0100)]
[profiler] Only include perf_event.h when actually needed, and use the system header.

8 years ago[profiler] Remove the bundled perf_event.h header.
Alex Rønne Petersen [Wed, 10 Feb 2016 21:22:45 +0000 (22:22 +0100)]
[profiler] Remove the bundled perf_event.h header.

Bundling this in Mono is technically a GPL violation. We need to switch to the
system <linux/perf_event.h> header.

8 years ago[Mono.Security]: Add 'MonoTlsProviderFactory.GetProvider(string)'.
Martin Baulig [Wed, 10 Feb 2016 00:01:09 +0000 (19:01 -0500)]
[Mono.Security]: Add 'MonoTlsProviderFactory.GetProvider(string)'.

Similar to 'SetDefaultProvider(string)', but return the provider instead
of installing it.

(cherry picked from commit 024241f424062a41f35061cd851f0923e25f16c7)

8 years ago[llvmonly] Remove some leftover debugging code.
Zoltan Varga [Wed, 10 Feb 2016 20:29:29 +0000 (15:29 -0500)]
[llvmonly] Remove some leftover debugging code.

8 years ago[swf] Flow SynchronizationContext through ExecutionContext. Fixes #38599
Marek Safar [Wed, 10 Feb 2016 19:24:13 +0000 (20:24 +0100)]
[swf] Flow SynchronizationContext through ExecutionContext. Fixes #38599

8 years ago[metadata] Fix Facades lookup in assembly.c when MONO_PATH is set
Alexander Köplinger [Wed, 10 Feb 2016 18:03:31 +0000 (19:03 +0100)]
[metadata] Fix Facades lookup in assembly.c when MONO_PATH is set

When MONO_PATH is set, the corlib lookup returns early on in mono_assembly_load_corlib (),
without adding the Facades dir to default_path.

This causes any app/library that relies on the facades to fail at runtime.

Fixing this by always doing the Facades lookup when returning the found corlib image.

8 years ago[corlib] Adds property AccessToken to WindowsIdentity
Marcos Henrich [Mon, 21 Dec 2015 18:36:02 +0000 (18:36 +0000)]
[corlib] Adds property AccessToken to WindowsIdentity

System.Security.Principal.WindowsIdentity.AccessToken is required for
dornet/wcf to compile.

8 years agoImpelements IDisposable in X509Store
Marcos Henrich [Mon, 21 Dec 2015 18:31:29 +0000 (18:31 +0000)]
Impelements IDisposable in X509Store

This class implement IDisposable in .NET and dotnet/wcf depends on this
to compile.

8 years ago[System.Windows.Forms] Recreate FosterWindow when required in XplatUIWin32
Paul Gofman [Wed, 10 Feb 2016 14:15:43 +0000 (17:15 +0300)]
[System.Windows.Forms] Recreate FosterWindow when required in XplatUIWin32

Fixes #38614

8 years ago[System.Net.Security] Adds NegotiateStream methods
Marcos Henrich [Mon, 21 Dec 2015 18:26:31 +0000 (18:26 +0000)]
[System.Net.Security] Adds NegotiateStream methods

System.Net.Security was missing some methods that are used by
dotnet/wcf.

8 years ago[corlib] Added missing properties to EventAttribute
Marcos Henrich [Mon, 21 Dec 2015 18:23:22 +0000 (18:23 +0000)]
[corlib] Added missing properties to EventAttribute

8 years ago[corlib] Use correct max/min value for DateTime overflows. Fixes #35876
Marek Safar [Wed, 10 Feb 2016 09:21:38 +0000 (03:21 -0600)]
[corlib] Use correct max/min value for DateTime overflows. Fixes #35876

8 years ago[System] Simple readability changes to SimpleAsyncResult
Marek Safar [Tue, 9 Feb 2016 19:09:33 +0000 (20:09 +0100)]
[System] Simple readability changes to SimpleAsyncResult

8 years ago[jit] Add a peephole optimization to remove the ldaddr+compare_imm 0+cond_exc checks...
Zoltan Varga [Wed, 10 Feb 2016 06:59:22 +0000 (01:59 -0500)]
[jit] Add a peephole optimization to remove the ldaddr+compare_imm 0+cond_exc checks inserted when using explicit null checks.

8 years ago[llvmonly] Disable the 'overriding the module target triple with' clang warning when...
Zoltan Varga [Wed, 10 Feb 2016 06:10:38 +0000 (01:10 -0500)]
[llvmonly] Disable the 'overriding the module target triple with' clang warning when compiling the bitcode files.

8 years ago[llvmonly] Fix a few issues passing and returning vtypes smaller than one machine...
Zoltan Varga [Wed, 10 Feb 2016 05:46:57 +0000 (00:46 -0500)]
[llvmonly] Fix a few issues passing and returning vtypes smaller than one machine word.

8 years ago[llvmonly] Fix the locking in the gsharedvt wrapper creation functions.
Zoltan Varga [Wed, 10 Feb 2016 02:55:37 +0000 (21:55 -0500)]
[llvmonly] Fix the locking in the gsharedvt wrapper creation functions.

8 years agoMerge pull request #2584 from lewurm/fix-mobile-compilation
monojenkins [Wed, 10 Feb 2016 02:20:32 +0000 (02:20 +0000)]
Merge pull request #2584 from lewurm/fix-mobile-compilation

[bcl] fix compilation of test on mobile

although a nunit category is specified, the compilation still failed on mobile.

8 years ago[bcl] fix compilation of test on mobile
Bernhard Urban [Tue, 9 Feb 2016 23:07:19 +0000 (15:07 -0800)]
[bcl] fix compilation of test on mobile

fix for the following problem:
> [13:33:37] src/System/Test/System.Diagnostics/ProcessTest.cs(1048,19): error CS0103: The name `GetCrossPlatformStartInfo' does not exist in the current context

8 years agoMerge pull request #2582 from ludovic-henry/fix-threadpool-starvation
monojenkins [Tue, 9 Feb 2016 23:00:32 +0000 (23:00 +0000)]
Merge pull request #2582 from ludovic-henry/fix-threadpool-starvation

[threadpool] Improve the monitor thread heuristic

Because the ThreadPool heuristic is optimized for short lived work item, it has more difficulty when executing long lived work item. That case can lead to a starvation of the worker threads: they are all doing work, while there is outstanding request, and these requests are not satisfied because we reached the max number of working thread.

To fix that issue, we have the monitor thread, whose sole job is to unstuck this kind of starvation cases. Unfortunately, it only works when all the worker threads are in the ThreadState.WaitSleepJoin state, which excludes the case of calling an IO operation in a Task. That includes the case of FileStream.BeginRead/Write/... which implementation can be simplified as follows: FileStream.BeginRead(...) -> Task.Run(() => FileStream.Read(...)).

The way we implement it in this commit is: every MONITOR_INTERVAL (500ms here), we check if there is any outstanding request, and if so, we assume that we are in the starvation case, and we simply increase the max number of working thread. Also to reduce the number of false positives, we do that only if there has been no completed work item for more than at least MONITOR_INTERVAL (in case of low CPU usage, more otherwise, see monitor_sufficient_delay_since_last_dequeue). This case is typically the case where we have all working thread stuck in long running work items.

Finally we increase the monitor interval from 100ms to 500ms so we guarantee we do not create more than 2 threads per second in the monitor thread. That is the value used by the old threadpool.

8 years ago[Docs] handle code-markdown with dots on the names
Miguel de Icaza [Tue, 9 Feb 2016 22:05:34 +0000 (17:05 -0500)]
[Docs] handle code-markdown with dots on the names

8 years ago[Docs] Continue to improve the Mono runtime documentation
Miguel de Icaza [Tue, 9 Feb 2016 20:52:53 +0000 (15:52 -0500)]
[Docs] Continue to improve the Mono runtime documentation

8 years agoMerge pull request #2570 from lambdageek/monoerror-reflection-bubble-2
Aleksey Kliger (λgeek) [Tue, 9 Feb 2016 20:52:52 +0000 (15:52 -0500)]
Merge pull request #2570 from lambdageek/monoerror-reflection-bubble-2

[reflection] Grab bag of MonoError commits

8 years ago[threadpool] Improve the monitor thread heuristic
Ludovic Henry [Tue, 9 Feb 2016 19:17:14 +0000 (19:17 +0000)]
[threadpool] Improve the monitor thread heuristic

Because the ThreadPool heuristic is optimized for short lived work item, it has more difficulty when executing long lived work item. That case can lead to a starvation of the worker threads: they are all doing work, while there is outstanding request, and these requests are not satisfied because we reached the max number of working thread.

To fix that issue, we have the monitor thread, whose sole job is to unstuck this kind of starvation cases. Unfortunately, it only works when all the worker threads are in the ThreadState.WaitSleepJoin state, which excludes the case of calling an IO operation in a Task. That includes the case of FileStream.BeginRead/Write/... which implementation can be simplified as follows: FileStream.BeginRead(...) -> Task.Run(() => FileStream.Read(...)).

The way we implement it in this commit is: every MONITOR_INTERVAL (500ms here), we check if there is any outstanding request, and if so, we assume that we are in the starvation case, and we simply increase the max number of working thread. Also to reduce the number of false positives, we do that only if there has been no completed work item for more than at least MONITOR_INTERVAL (in case of low CPU usage, more otherwise, see monitor_sufficient_delay_since_last_dequeue). This case is typically the case where we have all working thread stuck in long running work items.

Finally we increase the monitor interval from 100ms to 500ms so we guarantee we do not create more than 2 threads per second in the monitor thread. That is the value used by the old threadpool.

8 years ago[reflection] Fix decl of mono_image_create_token
Aleksey Kliger [Tue, 9 Feb 2016 18:34:39 +0000 (13:34 -0500)]
[reflection] Fix decl of mono_image_create_token

For the DISABLE_REFLECTION_EMIT case

8 years ago[reflection] Mark mono_custom_attrs_construct external only
Aleksey Kliger [Thu, 4 Feb 2016 00:24:01 +0000 (19:24 -0500)]
[reflection] Mark mono_custom_attrs_construct external only

The function mono_custom_attrs_construct_by_type is available for the
runtime (though currently static) and uses MonoError for error handling.

8 years ago[reflection] Use MonoError in mono_reflection_marshal_as_attribute_from_marshal_spec
Aleksey Kliger [Wed, 3 Feb 2016 23:56:59 +0000 (18:56 -0500)]
[reflection] Use MonoError in mono_reflection_marshal_as_attribute_from_marshal_spec

8 years ago[runtime] Use MonoError for mono_event_get_object
Aleksey Kliger [Wed, 3 Feb 2016 23:07:53 +0000 (18:07 -0500)]
[runtime] Use MonoError for mono_event_get_object

Mark mono_event_get_object external only.
Runtime should use mono_event_get_object_checked.

8 years ago[runtime] Use MonoError for mono_property_get_object
Aleksey Kliger [Wed, 3 Feb 2016 22:58:21 +0000 (17:58 -0500)]
[runtime] Use MonoError for mono_property_get_object

Mark mono_property_get_object external only.
Runtime should use mono_property_get_object_checked.

8 years ago[reflection] Push MonoError through some static functions
Aleksey Kliger [Wed, 3 Feb 2016 22:21:24 +0000 (17:21 -0500)]
[reflection] Push MonoError through some static functions

8 years ago[debugger] Don't call buffer_add_objid with NULL
Aleksey Kliger [Tue, 9 Feb 2016 16:39:08 +0000 (11:39 -0500)]
[debugger] Don't call buffer_add_objid with NULL

Fixup 64778857e4652ccac18c6fbf990f3e7cc69fa275

8 years ago[runtime] Cleanup MonoError after mono_runtime_try_invoke
Aleksey Kliger [Tue, 9 Feb 2016 17:10:26 +0000 (12:10 -0500)]
[runtime] Cleanup MonoError after mono_runtime_try_invoke

If both an exception exc is set and the MonoError is not ok, we could
leak the MonoError memory.  Explicitly cleanup.

8 years ago[mini] Use catchExcInMonoError to decide if exc should be embedded in MonoError
Aleksey Kliger [Tue, 9 Feb 2016 16:59:24 +0000 (11:59 -0500)]
[mini] Use catchExcInMonoError to decide if exc should be embedded in MonoError

Do the dyn_runtime_invoke decision the same way as other invokes.

Fixup to 45bd9bb5d50e6cbd806a5e95696656eedad3bb78

8 years ago[runtime] Don't raise MonoError when unloading appdomain
Aleksey Kliger [Tue, 9 Feb 2016 16:45:43 +0000 (11:45 -0500)]
[runtime] Don't raise MonoError when unloading appdomain

There's no managed code calling mono_domain_try_unload, so raising was
wrong.  Thread the error out through exc which gets checked by callers.

Fixup for 45bd9bb5d50e6cbd806a5e95696656eedad3bb78

8 years ago[Docs] document one of our most key APIs: mono_add_internal_call
Miguel de Icaza [Tue, 9 Feb 2016 17:05:24 +0000 (12:05 -0500)]
[Docs] document one of our most key APIs: mono_add_internal_call

8 years ago[Docs] Improved the rendering, added some docs
Miguel de Icaza [Tue, 9 Feb 2016 16:46:46 +0000 (11:46 -0500)]
[Docs] Improved the rendering, added some docs

8 years agoMerge pull request #2579 from ludovic-henry/fix-asyncresult-unhandledexception
monojenkins [Tue, 9 Feb 2016 12:25:36 +0000 (12:25 +0000)]
Merge pull request #2579 from ludovic-henry/fix-asyncresult-unhandledexception

[AsyncResult] Fix unhandled exception behaviour in AsyncCallback

The AsyncCallback is called after the BeginInvoke has completed. In all cases, this AsyncCallback is called on the ThreadPool, meaning that an unhandled exception would lead to a process crash.

The correct behaviour, after verification on .NET, is to not swallow the exception, and to properly crash the process.

@monojenkins merge

8 years ago[AsyncResult] Fix unhandled exception behaviour in AsyncCallback
Ludovic Henry [Tue, 9 Feb 2016 10:31:33 +0000 (10:31 +0000)]
[AsyncResult] Fix unhandled exception behaviour in AsyncCallback

The AsyncCallback is called after the BeginInvoke has completed. In all cases, this AsyncCallback is called on the ThreadPool, meaning that an unhandled exception would lead to a process crash.

The correct behaviour, after verification on .NET, is to not swallow the exception, and to properly crash the process.

8 years ago[corlib] AppContext from reference source
Marek Safar [Tue, 9 Feb 2016 10:34:35 +0000 (11:34 +0100)]
[corlib] AppContext from reference source

8 years ago[Docs] Use an external style sheet, prefix the css classes with mapi to isolate,...
Miguel de Icaza [Tue, 9 Feb 2016 03:00:13 +0000 (22:00 -0500)]
[Docs] Use an external style sheet, prefix the css classes with mapi to isolate, fix various processing problems

8 years agoMerge pull request #2578 from akoeplinger/fix-hardcoded-mono-2.0-path
Alexander Köplinger [Tue, 9 Feb 2016 01:31:21 +0000 (02:31 +0100)]
Merge pull request #2578 from akoeplinger/fix-hardcoded-mono-2.0-path

[metadata] Fix hardcoded mono/2.0 path in assembly.c

8 years ago[llvmonly] Compile the bitcode files using -O2.
Zoltan Varga [Tue, 9 Feb 2016 01:01:58 +0000 (20:01 -0500)]
[llvmonly] Compile the bitcode files using -O2.

8 years agoMerge pull request #2577 from xmcclure/bugzilla-37834
monojenkins [Tue, 9 Feb 2016 00:45:26 +0000 (00:45 +0000)]
Merge pull request #2577 from xmcclure/bugzilla-37834

Recognize OS X file "locked" state (fixes #37834)

Quick fix for https://bugzilla.xamarin.com/show_bug.cgi?id=37834

IOLayer is_file_writable/System.IO.File.GetAttributes on posix systems looks only at the unix file permissions and does not consider special OS flags. This leads to an easily end-user-triggered bug on OS X if a mono app (the bug was observed in Xamarin Studio) uses GetAttribute on a file which has been "Locked" using the checkbox in Finder Get Info. This patch recognizes the "uchg" flag for non-writability which Finder uses.

8 years ago[llvmonly] Add unbox wrappers when invoking vtype instance methods through a delegate.
Zoltan Varga [Tue, 9 Feb 2016 00:21:49 +0000 (19:21 -0500)]
[llvmonly] Add unbox wrappers when invoking vtype instance methods through a delegate.

8 years ago[Documentation] Fix the nesting of docs
Miguel de Icaza [Mon, 8 Feb 2016 22:15:17 +0000 (17:15 -0500)]
[Documentation] Fix the nesting of docs

8 years ago[metadata] Fix hardcoded mono/2.0 path in assembly.c
Alexander Köplinger [Mon, 8 Feb 2016 20:44:32 +0000 (21:44 +0100)]
[metadata] Fix hardcoded mono/2.0 path in assembly.c

The performance team discovered this on their bots using the Jenkins snapshot packages. Mono would fail to start with a message like:

```
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/opt/mono-2016.02.08+15.25.39/lib/mono/4.5/mscorlib.dll' directory.
```

The one odd thing is that they are using Mono installed in a path which is different from the prefix used during compilation.

It turns out that the runtime has a hardcoded check for lib/mono/2.0 in https://github.com/mono/mono/blob/7d5a7ea7ac324bb4ee63094ddcf8e20ae9ba4322/mono/metadata/assembly.c#L633-L637.
Since we recently stopped shipping 2.0 in the packages (we moved to 2.0-api for the reference assemblies) this directory wasn't there,
so the code in fallback() called into mono_config_get_assemblies_dir() which just returns the MONO_ASSEMBLIES preprocessor symbol.

That preprocessor symbol is defined to the value of --prefix during compilation, so Mono couldn't find corlib there as well since it's installed in another path which ultimately results in the above error message.

The fix is to change the hardcoded value to 4.5, which is what we established as the directory with the "latest" assemblies now.
Ideally we should find a way to stop hardcoding those paths in the runtime.

PS: I grepped through the runtime source to make sure we don't hardcode 2.0/3.5/4.0 elsewhere and only found one instance in a test.
I fixed it there as well, though the test looks suspicious since it hardcodes /usr ...

8 years ago[docs] Improve the rendering of our API binding APIs and runtime API documentation
Miguel de Icaza [Mon, 8 Feb 2016 18:56:51 +0000 (13:56 -0500)]
[docs] Improve the rendering of our API binding APIs and runtime API documentation

8 years agoSupport OS X "locked" state (fixes #37834)
Andi McClure [Mon, 8 Feb 2016 20:01:45 +0000 (15:01 -0500)]
Support OS X "locked" state (fixes #37834)

IOLayer is_file_writable/System.IO.File.GetAttributes on posix systems
looks only at the unix file permissions and does not consider special
OS flags. This leads to an easily end-user-triggered bug on OS X if a
mono app (the bug was observed in Xamarin Studio) uses GetAttribute on
a file which has been "Locked" using the checkbox in Finder Get Info.
This patch recognizes the "uchg" flag for non-writability which Finder
uses.

8 years agoMerge pull request #2555 from lambdageek/monoerror-mono_runtime_invoke-2
Aleksey Kliger (λgeek) [Mon, 8 Feb 2016 19:12:47 +0000 (14:12 -0500)]
Merge pull request #2555 from lambdageek/monoerror-mono_runtime_invoke-2

Use MonoError for mono_runtime_invoke

8 years ago[mcs] Use $(PLATFORM_PATH_SEPARATOR) instead of ':' for MONO_PATH to fix Windows...
Alexander Köplinger [Mon, 8 Feb 2016 17:36:47 +0000 (18:36 +0100)]
[mcs] Use $(PLATFORM_PATH_SEPARATOR) instead of ':' for MONO_PATH to fix Windows tests

./ was added to MONO_PATH in b5c2b5892f3ff4c104f701a4175b90989e9c7045, but the Unix path separator ':' doesn't work on Windows.

8 years ago[msvc] Fix Debug build by disabling outdated projects in sln
Alexander Köplinger [Fri, 18 Dec 2015 02:49:43 +0000 (03:49 +0100)]
[msvc] Fix Debug build by disabling outdated projects in sln

8 years agoMerge pull request #2571 from lambdageek/monoerror-mono_assembly_get_object
Aleksey Kliger (λgeek) [Mon, 8 Feb 2016 18:08:28 +0000 (13:08 -0500)]
Merge pull request #2571 from lambdageek/monoerror-mono_assembly_get_object

Use MonoError in mono_assembly_get_object

8 years ago[System.Runtime.Caching] Make TestExpiredGetValues test more reliable
Alexander Köplinger [Sat, 6 Feb 2016 20:25:17 +0000 (21:25 +0100)]
[System.Runtime.Caching] Make TestExpiredGetValues test more reliable

It failed twice on Jenkins over the weekend:

```
Test Case Failures:
1) MonoTests.System.Runtime.Caching.MemoryCacheTest.TestExpiredGetValues :   #EGV4
  Expected: 0
  But was:  9

at MonoTests.System.Runtime.Caching.MemoryCacheTest.TestExpiredGetValues () [0x0012b] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System.Runtime.Caching/Test/System.Runtime.Caching/MemoryCacheTest.cs:1304
```

We're sleeping just as long as the expiry time of the cache items (1s) which might not be enough.
Bumping the sleep time should fix this.

8 years ago[readme] Clarify --enable-parallel-mark description
Alexander Köplinger [Mon, 8 Feb 2016 15:46:17 +0000 (16:46 +0100)]
[readme] Clarify --enable-parallel-mark description

It's Boehm only and not enabled by default on some platforms (e.g. it's disabled on OSX).

8 years ago[runtime] Switch to mono_runtime_invoke_checked and mono_runtime_try_invoke
Aleksey Kliger [Fri, 5 Feb 2016 21:00:19 +0000 (16:00 -0500)]
[runtime] Switch to mono_runtime_invoke_checked and mono_runtime_try_invoke

Mark mono_runtime_invoke external only.
Runtime should use mono_runtime_invoke_checked and mono_runtime_try_invoke.

8 years ago[runtime] Use MonoError for mono_jit_runtime_invoke and mono_llvmonly_runtime_invoke
Ludovic Henry [Fri, 22 Jan 2016 16:55:32 +0000 (16:55 +0000)]
[runtime] Use MonoError for mono_jit_runtime_invoke and mono_llvmonly_runtime_invoke

8 years ago[reflection] Use MonoError in mono_assembly_get_object
Aleksey Kliger [Fri, 29 Jan 2016 21:47:19 +0000 (16:47 -0500)]
[reflection] Use MonoError in mono_assembly_get_object

Mark mono_assembly_get_object external only.
Runtime should use mono_assembly_get_object_checked.

Also propagated MonoError through a few static functions in reflection:
mono_reflection_get_type_internal () and
mono_reflection_get_type_internal_dynamic ()

8 years agoMerge pull request #2574 from abrasive/gcc5_fix_gc
Rodrigo Kumpera [Mon, 8 Feb 2016 14:30:16 +0000 (06:30 -0800)]
Merge pull request #2574 from abrasive/gcc5_fix_gc

libgc: use __builtin_frame_address in GC_approx_sp

8 years agoMerge pull request #2575 from alexrp/master
Rodrigo Kumpera [Mon, 8 Feb 2016 14:27:34 +0000 (06:27 -0800)]
Merge pull request #2575 from alexrp/master

[profiler] Fix a rare crash when sending SIGPROF to a starting thread.

8 years ago[profiler] Fix a rare crash when sending SIGPROF to a starting thread.
Alex Rønne Petersen [Mon, 8 Feb 2016 10:24:51 +0000 (11:24 +0100)]
[profiler] Fix a rare crash when sending SIGPROF to a starting thread.

When sample profiling is enabled and we send a SIGPROF signal to a thread that
hasn't yet transitioned to a running state (e.g. STATE_RUNNING), the signal can
sometimes be delivered at such an early point that libc has not even finished
initializing TLS for that thread yet. This is problematic because we then go
right on to crash in the SIGPROF signal handler when we try to save errno. We
then further crash in the SIGSEGV handler because we can't access the jit_tls
variable either.

The fix is fairly simple: Only send SIGPROF to threads that have transitioned
to a running state. Technically, TLS is initialized 'much' earlier than when
this state transition happens, but since the worst thing that can happen is
that we miss one sampling event (i.e. ~1sec by default) right at the beginning
of the thread's lifetime, this simple fix is good enough.

This crash seemingly only happened on OS X.

8 years ago[llvmonly] Disable tail calls as they break stack traces.
Zoltan Varga [Mon, 8 Feb 2016 07:28:28 +0000 (02:28 -0500)]
[llvmonly] Disable tail calls as they break stack traces.

8 years ago[llvm] Make the stack walk code return.
Zoltan Varga [Mon, 8 Feb 2016 07:27:33 +0000 (02:27 -0500)]
[llvm] Make the stack walk code return.

8 years agolibgc: use __builtin_frame_address in GC_approx_sp
James Laird-Wah [Sun, 7 Feb 2016 23:19:53 +0000 (10:19 +1100)]
libgc: use __builtin_frame_address in GC_approx_sp

With GCC 5.x, the compiler optimises away the dummy load used to
estimate the stack pointer address in GC_approx_sp; it returns
zero. This leads to segfaults when embedding Mono.

Instead, use __builtin_frame_address, which GCC's libgc uses for
the same purpose.

8 years ago[llvmonly] Compile the bitcode files using -O2 (only in desktop llvmonly mode).
Zoltan Varga [Sun, 7 Feb 2016 02:11:06 +0000 (21:11 -0500)]
[llvmonly] Compile the bitcode files using -O2 (only in desktop llvmonly mode).

8 years ago[llvm] When storing valuetypes received in registers to the stack, store only the...
Zoltan Varga [Sun, 7 Feb 2016 02:10:37 +0000 (21:10 -0500)]
[llvm] When storing valuetypes received in registers to the stack, store only the value parts of the register, the upper bits might container garbage.

8 years agoMerge pull request #2567 from lambdageek/monoerror-mono_module_file_get_object
Aleksey Kliger (λgeek) [Sat, 6 Feb 2016 16:08:39 +0000 (11:08 -0500)]
Merge pull request #2567 from lambdageek/monoerror-mono_module_file_get_object

[reflection] Use MonoError in mono_module_file_get_object

8 years ago[jit] Disable to returning of trampolines from mini_jit_info_table_find () to see...
Zoltan Varga [Sat, 6 Feb 2016 08:09:50 +0000 (03:09 -0500)]
[jit] Disable to returning of trampolines from mini_jit_info_table_find () to see whenever that fixes failures on wrench.

8 years ago[llvmonly] Remove the mono_llvmonly_get_calling_assembly () workaround since stack...
Zoltan Varga [Sat, 6 Feb 2016 06:59:38 +0000 (01:59 -0500)]
[llvmonly] Remove the mono_llvmonly_get_calling_assembly () workaround since stack walks work in llvmonly mode now.

8 years ago[reflection] Use MonoError in mono_module_file_get_object
Aleksey Kliger [Fri, 29 Jan 2016 17:20:30 +0000 (12:20 -0500)]
[reflection] Use MonoError in mono_module_file_get_object

Mark mono_module_file_get_object external only.
Use mono_module_file_get_object_checked in runtime code.

8 years agoFix the build.
Zoltan Varga [Fri, 5 Feb 2016 20:22:11 +0000 (15:22 -0500)]
Fix the build.

8 years agoMerge pull request #2569 from xmcclure/gshared-enable
Andi McClure [Fri, 5 Feb 2016 18:39:58 +0000 (13:39 -0500)]
Merge pull request #2569 from xmcclure/gshared-enable

Miscellaneous minor improvements around amd64 aot

8 years agoFixed compiler to wrap paths with embedded spaces when calling external tools.
João Matos [Fri, 5 Feb 2016 16:52:49 +0000 (16:52 +0000)]
Fixed compiler to wrap paths with embedded spaces when calling external tools.

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

8 years ago[corlib] Disable ThreadLocalTests.DisposeOnThreadExit on MonoTouch, it's randomly...
Rolf Bjarne Kvinge [Fri, 5 Feb 2016 14:15:45 +0000 (15:15 +0100)]
[corlib] Disable ThreadLocalTests.DisposeOnThreadExit on MonoTouch, it's randomly failing.

8 years agoMerge pull request #2572 from akoeplinger/fix-monodoc-language
Alexander Köplinger [Fri, 5 Feb 2016 15:14:05 +0000 (16:14 +0100)]
Merge pull request #2572 from akoeplinger/fix-monodoc-language

[monodoc] Fix literal formatting on systems where decimal separator is not a dot

8 years ago[llvmonly] Various small fixes. Make mono_llvm_throw_exception etc. directly callable...
Zoltan Varga [Fri, 5 Feb 2016 07:07:40 +0000 (02:07 -0500)]
[llvmonly] Various small fixes. Make mono_llvm_throw_exception etc. directly callable in static mode. Add support for directly calling pinvoke methods. Fix an assertion during EH.

8 years ago[Docs] More API docs
Miguel de Icaza [Fri, 5 Feb 2016 04:14:01 +0000 (23:14 -0500)]
[Docs] More API docs

8 years ago[llvmonly] Don't set the invariant.load flag on loads from the GOT, they are initiali...
Zoltan Varga [Fri, 5 Feb 2016 03:40:44 +0000 (22:40 -0500)]
[llvmonly] Don't set the invariant.load flag on loads from the GOT, they are initialized by a call to init_method () so they are not completely invariant.

8 years agoRevert "[jit] Don't allocate memory for unused vreg"
Zoltan Varga [Fri, 5 Feb 2016 00:02:18 +0000 (19:02 -0500)]
Revert "[jit] Don't allocate memory for unused vreg"

This reverts commit 137c0999cc8e1e9171c7703af9b013f2e43731f5.

Revert this as leads to a memory overwrite on x86:

defs [ins->dreg + 1] = NULL;

8 years agoMove some amd64 constants out of source into header
Andi McClure [Thu, 4 Feb 2016 19:11:45 +0000 (14:11 -0500)]
Move some amd64 constants out of source into header

8 years agoClarify trampoline error message in aot-runtime
Andi McClure [Thu, 4 Feb 2016 18:43:03 +0000 (13:43 -0500)]
Clarify trampoline error message in aot-runtime

8 years agoMerge pull request #2566 from lambdageek/monoerror-mono_module_get_object
Aleksey Kliger (λgeek) [Thu, 4 Feb 2016 15:26:54 +0000 (10:26 -0500)]
Merge pull request #2566 from lambdageek/monoerror-mono_module_get_object

[reflection] Use MonoError for mono_module_get_object

8 years agoMerge pull request #2535 from lambdageek/monoerror-reflection-bubble
Aleksey Kliger (λgeek) [Thu, 4 Feb 2016 15:26:25 +0000 (10:26 -0500)]
Merge pull request #2535 from lambdageek/monoerror-reflection-bubble

[reflection] Push MonoError through misc methods

8 years ago[System] Remove explicit sdk target from CSharpCodeCompiler
Marek Safar [Thu, 4 Feb 2016 15:03:11 +0000 (16:03 +0100)]
[System] Remove explicit sdk target from CSharpCodeCompiler

8 years ago[io-layer] Print from which pipe we just read
Ludovic Henry [Thu, 4 Feb 2016 14:30:55 +0000 (14:30 +0000)]
[io-layer] Print from which pipe we just read