mono.git
7 years agoMerge pull request #3008 from lateralusX/jlorenss/win-x64-shutdown-crash
Rodrigo Kumpera [Wed, 18 May 2016 20:45:22 +0000 (13:45 -0700)]
Merge pull request #3008 from lateralusX/jlorenss/win-x64-shutdown-crash

[runtime] Fix for random, timing dependent, mono runtime crash during shutdown on Windows.

7 years agoMerge pull request #3012 from marek-safar/rs-Net
Marek Safar [Wed, 18 May 2016 19:58:06 +0000 (21:58 +0200)]
Merge pull request #3012 from marek-safar/rs-Net

[System] WebHeaderCollection from referencesource

7 years ago[runtime] Remove an unused variable.
Zoltan Varga [Wed, 18 May 2016 19:40:20 +0000 (15:40 -0400)]
[runtime] Remove an unused variable.

7 years agoMerge pull request #2994 from ludovic-henry/remove-nacl
Ludovic Henry [Wed, 18 May 2016 19:36:45 +0000 (15:36 -0400)]
Merge pull request #2994 from ludovic-henry/remove-nacl

[runtime] Remove support for NaCl

7 years agoRemove more deprecated stuff
Miguel de Icaza [Wed, 18 May 2016 19:30:25 +0000 (15:30 -0400)]
Remove more deprecated stuff

7 years agoRemove dead code, update solution files
Miguel de Icaza [Wed, 18 May 2016 19:26:07 +0000 (15:26 -0400)]
Remove dead code, update solution files

7 years agogenproj: Improve handling of executables and projects with build dependencies
Miguel de Icaza [Wed, 18 May 2016 19:19:16 +0000 (15:19 -0400)]
genproj: Improve handling of executables and projects with build dependencies

7 years agoMerge pull request #2815 from lambdageek/dev/monoerror-mono_compile_method
Aleksey Kliger (λgeek) [Wed, 18 May 2016 19:15:16 +0000 (15:15 -0400)]
Merge pull request #2815 from lambdageek/dev/monoerror-mono_compile_method

[runtime] MonoError-ize mono_compile_method

7 years agoMerge pull request #3014 from lambdageek/dev/coop-enabled
Aleksey Kliger (λgeek) [Wed, 18 May 2016 17:15:03 +0000 (13:15 -0400)]
Merge pull request #3014 from lambdageek/dev/coop-enabled

[coop] Make mono_threads_is_coop_enabled a normal function

7 years agoMerge pull request #3007 from directhex/use-mingw64
Alexander Köplinger [Wed, 18 May 2016 15:40:15 +0000 (17:40 +0200)]
Merge pull request #3007 from directhex/use-mingw64

[jenkins] Use mingw64 to build, not 32

7 years ago[coop] Make mono_threads_is_coop_enabled a normal function
Aleksey Kliger [Wed, 18 May 2016 15:19:23 +0000 (11:19 -0400)]
[coop] Make mono_threads_is_coop_enabled a normal function

It doesn't need to live in the header.

In particular is_coop_enabled variable used to be in every translation
unit instead of just a single flag.

7 years agoMerge pull request #3011 from akoeplinger/ci-fixes
Alexander Köplinger [Wed, 18 May 2016 15:18:38 +0000 (17:18 +0200)]
Merge pull request #3011 from akoeplinger/ci-fixes

[ci] Move setting CFLAGS and MONO_CHECK_MODE into the run-jenkins.sh script

7 years agoMerge pull request #3003 from marek-safar/rs-NetworkInformation
Marek Safar [Wed, 18 May 2016 14:18:28 +0000 (16:18 +0200)]
Merge pull request #3003 from marek-safar/rs-NetworkInformation

[System] Common NetworkInformation code from referencesource

7 years agoGraduate the csproj/solution to completed - you can now build with the toplevel net_4...
Miguel de Icaza [Wed, 18 May 2016 14:14:17 +0000 (10:14 -0400)]
Graduate the csproj/solution to completed - you can now build with the toplevel net_4_x.sln

7 years agoMerge pull request #3009 from akoeplinger/fix-sockettest-catch
Alexander Köplinger [Wed, 18 May 2016 14:06:11 +0000 (16:06 +0200)]
Merge pull request #3009 from akoeplinger/fix-sockettest-catch

[System] Get rid of useless catch-all clauses in SocketTest

7 years ago[System] Common NetworkInformation code from referencesource
Marek Safar [Tue, 17 May 2016 10:00:24 +0000 (12:00 +0200)]
[System] Common NetworkInformation code from referencesource

7 years ago[jenkins] Use VS2015, not 2013
Jo Shields [Wed, 18 May 2016 13:56:44 +0000 (14:56 +0100)]
[jenkins] Use VS2015, not 2013

7 years agoRemove [assembly:TargetFramework] as no other assembly uses it, and causes our msbuil...
Miguel de Icaza [Wed, 18 May 2016 13:45:18 +0000 (09:45 -0400)]
Remove [assembly:TargetFramework] as no other assembly uses it, and causes our msbuild to fail

7 years ago[WIP] Important change: more comprehensive Makefile to support csproj-local on System...
Miguel de Icaza [Wed, 18 May 2016 13:28:42 +0000 (09:28 -0400)]
[WIP] Important change: more comprehensive Makefile to support csproj-local on System.Design (#3006)

* Important change: more comprehensive Makefile to support csproj-local on System.Design

* Change the dependency

* update

7 years ago[System] WebHeaderCollection from referencesource
Marek Safar [Wed, 18 May 2016 12:44:07 +0000 (14:44 +0200)]
[System] WebHeaderCollection from referencesource

7 years ago[System] Throw PlatformNotSupportedException if NetworkInformation.NetworkChange...
Rolf Bjarne Kvinge [Wed, 18 May 2016 12:21:23 +0000 (14:21 +0200)]
[System] Throw PlatformNotSupportedException if NetworkInformation.NetworkChange is used on watchOS. (#3010)

NetworkInformation.NetworkChange requires the SystemConfiguration framework,
which isn't available on watchOS.

7 years ago[ci] Move setting CFLAGS and MONO_CHECK_MODE into the run-jenkins.sh script
Alexander Köplinger [Wed, 18 May 2016 12:16:12 +0000 (14:16 +0200)]
[ci] Move setting CFLAGS and MONO_CHECK_MODE into the run-jenkins.sh script

So we can further reduce the state we keep on Jenkins itself.

7 years ago[System] Get rid of useless catch-all clauses in SocketTest
Alexander Köplinger [Wed, 18 May 2016 11:38:48 +0000 (13:38 +0200)]
[System] Get rid of useless catch-all clauses in SocketTest

When one of the tests doesn't fail with the expected exception, we'd get just a useless message
like "TtlChangeoverflow #3" instead of the much more useful exception info + stacktrace that
NUnit catches when an unhandled exception is thrown.

7 years agoFix for rare mono runtime crash during shutdown sequence on Windows.
lateralusX [Wed, 18 May 2016 10:20:55 +0000 (12:20 +0200)]
Fix for rare mono runtime crash during shutdown sequence on Windows.

During mono shutdown on windows there is, on rare occasions, an exception
in CloseHandle indicating the closure of an invalid handle. This exception
is normally a strong indication of a much more severe underlying problem,
a doubled close on a handle, that could lead to random data corruptions
and very hard to track bugs in random areas of the code. If the system reused
the handle for a different object that silently gets incorrectly closed by above
call, the above bug could manifest itself into some completely different issues,
so getting a consistent repro with the above exception with CloseHandle was a good
point to start tracking down the bug.

The exception throwed in CloseHandle boils down to the fact that threads
in thread pool's that have their finalizer run on shutdown can end up in
a scenario where the thread handle has already been closed elsewhere.

When the threads are finalized in mono_gc_finialize_threadpool_threads,
the handle on the internal thread object, stored in MonoInternalThread,
will be closed by the thread objects finializer in ves_icall_System_Threading_InternalThread_Thread_free_internal.
Under some rare occasions, one of the handles are not valid and will cause
the exception in CloseHandle or even worse, pointing to a complete different
kind of object, potentially closed by the threads finalizer, causing an instable
process with random behavior related to WIN32 objects (files, mutexes, threads, events etc).

The reason why it rarely manifests itself is due to a race between the finializer thread and the
main thread during shutdown. Main thread gives finalizer thread 2000 ms to complete its work and
if it’s time outs, the main thread won’t call the code that will run the finalizers,
mono_gc_finalize_threadpool_threads for the thread objects added to an internal list
by the finalizer thread, so if the finalizer takes more than 2000 ms to complete during shutdown
the bug won’t manifest itself. By increasing the wait time in mono_domain_finalize to for example INFINITE,
the repro of this bug will be 100% and not timing dependent anymore.

Turns out that the offending CloseHandle on the thread object happens at an
earlier point in time during shutdown, when mono_thread_manage tries to wait for
threads to complete manage thread it will do remove_and_abort_threads for background
threads still around. The way this works is that it will setup a list of thread handles
that it will wait for using WaitForMultipleObjects and then close the handles.
It turns out that the implementation of remove_and_abort_threads adds the wrong
handle to the list, not the duplicated handle but the original thread handle,
and that will trigger this bug, since the original thread handle will be closed
(and the duplicated handle will leak). The fix is to use the duplicated thread
handle instead of the original, similar to how it was already done in other similar methods, like build_wait_tids.
Sinces this bug seems to been around for quite some time and is a race related to managed threads and mono
shutdown sequence it could give other weird side effects on windows during shutdown
(since it could have closed a random WIN32 object instead of the intended thread).

Looking at Bugzilla, there is one bug that very well could be related to this specific problem, 10108:

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

This bug should most likely be retested with this fix to see if it still reproducible once merged into master.

7 years ago[jenkins] Use mingw64 to build, not 32
Jo Shields [Wed, 18 May 2016 09:48:01 +0000 (10:48 +0100)]
[jenkins] Use mingw64 to build, not 32

7 years ago[genproj] Updates to project generator and csproj files.
Miguel de Icaza [Wed, 18 May 2016 00:40:47 +0000 (20:40 -0400)]
[genproj] Updates to project generator and csproj files.

* Adds support for a handful of new command line arguments that we now use in the build.

* Always attempts to match to a project name, to get the proper project dependency.

* Update to support .exe and .dll in the generation.

* Remove warnings and some dead code

* Update the resulting csproj files based on running:

make update-csproj
make package-inputs
mono genproj.exe

7 years agoMerge pull request #3004 from xmcclure/gc-bridge-various
Rodrigo Kumpera [Tue, 17 May 2016 23:49:12 +0000 (16:49 -0700)]
Merge pull request #3004 from xmcclure/gc-bridge-various

Various GC bridge cleanup from looking at bug #40844

7 years ago[runtime] Remove support for NaCl
Ludovic Henry [Fri, 13 May 2016 21:33:06 +0000 (17:33 -0400)]
[runtime] Remove support for NaCl

7 years agoMerge pull request #2250 from esdrubal/master
Alexis Christoforides [Tue, 17 May 2016 20:36:14 +0000 (16:36 -0400)]
Merge pull request #2250 from esdrubal/master

[System] Check SocketOptionName.ReuseAddress support.

7 years agoAdd some comments in new/old gc bridges
Andi McClure [Tue, 17 May 2016 17:23:02 +0000 (13:23 -0400)]
Add some comments in new/old gc bridges

7 years agoFix error message in sgen-bridge which does not list all options
Andi McClure [Tue, 17 May 2016 16:47:35 +0000 (12:47 -0400)]
Fix error message in sgen-bridge which does not list all options

7 years agoRemove redundant flag set in sgen-tarjan-bridge
Andi McClure [Tue, 17 May 2016 16:47:05 +0000 (12:47 -0400)]
Remove redundant flag set in sgen-tarjan-bridge

bridge_processing_in_progress is set by sgen-tarjan-bridge.c at the
start and end of each bridge, although sgen-bridge sets this flag at
the same time.

7 years agoMore accurate trace reporting duration of android gc bridge
Andi McClure [Tue, 17 May 2016 16:45:49 +0000 (12:45 -0400)]
More accurate trace reporting duration of android gc bridge

There is some code that reports the length of a gc bridge operation in
sgen-stw. This is dead code dating from a period when gc bridges
occurred synchronously as part of a stop the world operation. The new
code globally tracks the end of the last stw and reports time since
then when the bridge thread completes.

7 years agoMerge pull request #2979 from akoeplinger/tests-simplify
Alexander Köplinger [Tue, 17 May 2016 16:09:38 +0000 (18:09 +0200)]
Merge pull request #2979 from akoeplinger/tests-simplify

[tests] Simplify 'test-sgen' target logic in Makefile.am

7 years agoMerge pull request #2988 from radical/xbuild-fix-processwrapper
Marek Habersack [Tue, 17 May 2016 15:54:11 +0000 (17:54 +0200)]
Merge pull request #2988 from radical/xbuild-fix-processwrapper

[xbuild] Fix ProcessWrapper to WaitForExit(..) before accessing ExitCode

7 years agoChange Url for raw runtimes
Miguel de Icaza [Tue, 17 May 2016 02:05:31 +0000 (22:05 -0400)]
Change Url for raw runtimes

7 years agoFix man page
Miguel de Icaza [Tue, 17 May 2016 02:03:33 +0000 (22:03 -0400)]
Fix man page

7 years ago[runtime] MonoError-ize mono_compile_method
Aleksey Kliger [Wed, 30 Mar 2016 21:36:47 +0000 (17:36 -0400)]
[runtime] MonoError-ize mono_compile_method

Mark it external only.  Runtime should use mono_compile_method_checked.

7 years agoMerge pull request #3001 from ludovic-henry/coop-blocking-rename
Aleksey Kliger (λgeek) [Mon, 16 May 2016 22:33:18 +0000 (18:33 -0400)]
Merge pull request #3001 from ludovic-henry/coop-blocking-rename

[coop] Use GC safe/unsafe macros inside the runtime

7 years agoMerge pull request #2987 from spouliot/ipv6only
Alexander Köplinger [Mon, 16 May 2016 21:33:14 +0000 (23:33 +0200)]
Merge pull request #2987 from spouliot/ipv6only

[System][tests] Tweak Dns unit tests so it does not fail on an IPv6 only network

7 years ago[arm] Align the stack to 16 bytes in mono_arch_get_call_filter () so it works on...
Zoltan Varga [Mon, 16 May 2016 21:01:58 +0000 (17:01 -0400)]
[arm] Align the stack to 16 bytes in mono_arch_get_call_filter () so it works on watchos.

7 years ago[coop] Use GC safe/unsafe macros inside the runtime
Ludovic Henry [Mon, 16 May 2016 20:26:52 +0000 (16:26 -0400)]
[coop] Use GC safe/unsafe macros inside the runtime

This allow the removal of MONO_(PREPARE|FINISH)BLOCKING and MONO(PREPARE|FINISH)_RESET_BLOCKING, which were not explicit in their intent, leading to confusion. This also harmonize how the product and the runtime transition between thread states.

7 years agoMerge pull request #2969 from ludovic-henry/coop-no-try-finally
Rodrigo Kumpera [Mon, 16 May 2016 20:05:53 +0000 (13:05 -0700)]
Merge pull request #2969 from ludovic-henry/coop-no-try-finally

[coop] Remove try { ... } finally { ... } blocks from wrappers + Fix state transitions in trampolines

7 years agoMerge pull request #2999 from marek-safar/rs-FileWeb
Marek Safar [Mon, 16 May 2016 19:42:51 +0000 (21:42 +0200)]
Merge pull request #2999 from marek-safar/rs-FileWeb

[System] FileWebResponse/FileWebRequest from referencesource

7 years ago[System] Use common assertion api in IPAdressTest to fix monodroid build
Alexander Köplinger [Mon, 16 May 2016 19:05:58 +0000 (21:05 +0200)]
[System] Use common assertion api in IPAdressTest to fix monodroid build

`Assertion.Fail` isn't supported by NUnitLite in monodroid, use `Assert` instead to fix the build:

```
[12:29:46] /Users/builder/data/lanes/1845/88dbce4e/source/monodroid/tests/bcl-test/BclTests.csproj (default targets) ->
[12:29:46] /Library/Frameworks/Mono.framework/Versions/4.2.1/lib/mono/4.5/Microsoft.CSharp.Targets (CoreCompile target) ->
[12:29:46]
[12:29:46]  src/System/Test/System.Net/IPAddressTest.cs(282,4): error CS0103: The name `Assertion' does not exist in the current context
[12:29:46]
[12:29:46]   14 Warning(s)
[12:29:46]   1 Error(s)
```

7 years ago[System] FileWebResponse/FileWebRequest from referencesource
Marek Safar [Mon, 16 May 2016 09:18:12 +0000 (11:18 +0200)]
[System] FileWebResponse/FileWebRequest from referencesource

7 years ago[coop] Ensure exception handling is done in GC unsafe mode
Ludovic Henry [Wed, 11 May 2016 16:50:49 +0000 (12:50 -0400)]
[coop] Ensure exception handling is done in GC unsafe mode

7 years ago[debug] Print MonoMethod pointer in mono_pmip output
Ludovic Henry [Fri, 6 May 2016 14:54:55 +0000 (10:54 -0400)]
[debug] Print MonoMethod pointer in mono_pmip output

7 years ago[coop] Assert that trampolines are called from GC unsafe code
Ludovic Henry [Thu, 12 May 2016 15:21:35 +0000 (11:21 -0400)]
[coop] Assert that trampolines are called from GC unsafe code

7 years ago[coop] The magic trampoline might be called from BLOCKING state
Ludovic Henry [Fri, 13 May 2016 14:56:47 +0000 (10:56 -0400)]
[coop] The magic trampoline might be called from BLOCKING state

7 years ago[coop] Add default ftnptr eh callback
Ludovic Henry [Wed, 4 May 2016 21:01:27 +0000 (17:01 -0400)]
[coop] Add default ftnptr eh callback

7 years ago[coop] Use unbalanced state switching functions for managed-to-native wrapper
Ludovic Henry [Fri, 6 May 2016 17:38:02 +0000 (13:38 -0400)]
[coop] Use unbalanced state switching functions for managed-to-native wrapper

7 years ago[coop] Add possibly unbalanced state switching functions
Ludovic Henry [Wed, 4 May 2016 18:56:15 +0000 (14:56 -0400)]
[coop] Add possibly unbalanced state switching functions

This will be used by managed-to-native and native-to-managed wrappers, as well as trampolines, to switch between states. This is necessary as their calls might be unbalanced (a prepare blocking, without the corresponding finish blocking).

7 years ago[coop] Throw exception from finally clause in native-to-managed wrapper
Ludovic Henry [Mon, 9 May 2016 15:57:51 +0000 (11:57 -0400)]
[coop] Throw exception from finally clause in native-to-managed wrapper

If we do not throw it from the finally clause, then in case of a Thread.Abort, we will not rethrow the catched exception, but the ThreadAbortException, and this without using the callback, leading to native stack unwinding.

7 years ago[coop] Remove try { ... } finally { ... } from managed-to-native wrapper
Ludovic Henry [Wed, 4 May 2016 18:38:38 +0000 (14:38 -0400)]
[coop] Remove try { ... } finally { ... } from managed-to-native wrapper

7 years ago[coop] Remove support for invoke thunk wrapper
Ludovic Henry [Wed, 4 May 2016 17:58:26 +0000 (13:58 -0400)]
[coop] Remove support for invoke thunk wrapper

The support will be broken when we will introduce MonoHandle, as we can't pass the exception naked object ref around, but need to wrap it in a MonoHandle, while still in RUNNING mode.

7 years agoMerge pull request #2993 from lambdageek/dev/monoerror-mono_string_from_utf16
Aleksey Kliger (λgeek) [Mon, 16 May 2016 14:13:19 +0000 (10:13 -0400)]
Merge pull request #2993 from lambdageek/dev/monoerror-mono_string_from_utf16

[runtime] MonoError-ize mono_string_from_utf16

7 years ago[System] Fixes build
Marek Safar [Mon, 16 May 2016 11:38:17 +0000 (13:38 +0200)]
[System] Fixes build

7 years ago[System] Authorization from referencesource
Marek Safar [Mon, 16 May 2016 10:13:52 +0000 (12:13 +0200)]
[System] Authorization from referencesource

7 years agoMerge pull request #2995 from marek-safar/rs-IPAddress
Marek Safar [Mon, 16 May 2016 09:07:38 +0000 (11:07 +0200)]
Merge pull request #2995 from marek-safar/rs-IPAddress

[System] IPAddress from referencesource

7 years ago[reflection] Avoid force-setting klass->has_finalize for dynamic classes, compute...
Zoltan Varga [Sun, 15 May 2016 09:18:21 +0000 (05:18 -0400)]
[reflection] Avoid force-setting klass->has_finalize for dynamic classes, compute it normally. Fixes #40953. (#2997)

7 years ago[llvmonly] Avoid generating gsharedvt out wrappers for non-generic signatures.
Zoltan Varga [Sat, 14 May 2016 21:44:51 +0000 (17:44 -0400)]
[llvmonly] Avoid generating gsharedvt out wrappers for non-generic signatures.

7 years agomkbundle commands for cross compilation. (#2970)
Miguel de Icaza [Sat, 14 May 2016 04:32:14 +0000 (21:32 -0700)]
mkbundle commands for cross compilation. (#2970)

* Start of packager for mkbundle

* [mkbundle] Add fingerprint and directory at end of package

* [mkbundle] Update embedding file format, add support for --options, support for --runtime, chmod +x

* [driver] Add a way to parse arbitrary command line options

* [mkbundle] Align the assemblies on a page boundary, do not release directory buffer

* Work-around odd compiler error by using memcpy

* Update makefile

* Fix the windows build

* [Windows] Export the new mono_parse_options_from API

* Implement the various cross-compiler target fetching commands

* Clean

7 years ago[System] IPAddress from referencesource
Marek Safar [Fri, 13 May 2016 11:10:47 +0000 (13:10 +0200)]
[System] IPAddress from referencesource

7 years ago[System] Replace few System.Net types with referencesource
Marek Safar [Fri, 13 May 2016 16:09:13 +0000 (18:09 +0200)]
[System] Replace few System.Net types with referencesource

7 years ago[coop] Avoid calling mono_marshal_set_last_error () in the managed-to-native wrapper...
Zoltan Varga [Fri, 13 May 2016 15:35:20 +0000 (11:35 -0400)]
[coop] Avoid calling mono_marshal_set_last_error () in the managed-to-native wrapper inside the blocking block. Also make sure the prepare/finish_blocking jit icalls have no wrappers, so calling them doesn't involve trampolines.

7 years agoMerge pull request #2974 from lambdageek/dev/monoerror-misc_fixes
Aleksey Kliger (λgeek) [Fri, 13 May 2016 15:07:00 +0000 (11:07 -0400)]
Merge pull request #2974 from lambdageek/dev/monoerror-misc_fixes

[runtime] Eliminate some mono_error_raise_exception calls

7 years agoFix a warning.
Zoltan Varga [Fri, 13 May 2016 14:11:01 +0000 (10:11 -0400)]
Fix a warning.

7 years ago[llvmonly] Make sure that linkonce methods need no initialization since they could...
Zoltan Varga [Fri, 13 May 2016 14:09:32 +0000 (10:09 -0400)]
[llvmonly] Make sure that linkonce methods need no initialization since they could be called before the AOT module they belong to is loaded. Still not enabled, since they seem to actually increase executable size.

7 years ago[System] Remove unused files
Marek Safar [Fri, 13 May 2016 12:06:15 +0000 (14:06 +0200)]
[System] Remove unused files

7 years ago[runtime] MonoError-ize mono_string_from_utf16
Aleksey Kliger [Thu, 12 May 2016 21:34:32 +0000 (17:34 -0400)]
[runtime] MonoError-ize mono_string_from_utf16

Marked it external only.  Runtime should use mono_string_from_utf16_checked

Also mark mono_string_from_utf32 as external only.

(It's currently unused in the runtime, but in the future
 mono_string_from_utf32_checked is available)

7 years agoMerge pull request #2984 from amccague/ping-task-fix
Marek Safar [Thu, 12 May 2016 21:24:05 +0000 (23:24 +0200)]
Merge pull request #2984 from amccague/ping-task-fix

Resolved bug (8554) with Task Based Ping API

7 years agoMerge pull request #2990 from akoeplinger/fix-fsharp
Alexander Köplinger [Thu, 12 May 2016 16:01:32 +0000 (18:01 +0200)]
Merge pull request #2990 from akoeplinger/fix-fsharp

[bcl] Add stub Mono.Posix.dll to 4.0 folder so FSharp bootstrapping works

7 years ago[arm] Make sure MONO_CONTEXT_GET_CURRENT () sets sp to an aligned value on watchos.
Zoltan Varga [Thu, 12 May 2016 15:51:02 +0000 (11:51 -0400)]
[arm] Make sure MONO_CONTEXT_GET_CURRENT () sets sp to an aligned value on watchos.

7 years ago[bcl] Add stub Mono.Posix.dll to 4.0 folder so FSharp bootstrapping works
Alexander Köplinger [Thu, 12 May 2016 15:47:03 +0000 (17:47 +0200)]
[bcl] Add stub Mono.Posix.dll to 4.0 folder so FSharp bootstrapping works

It was checking the existence of the file which doesn't work anymore after the -api rename.
This was already fixed upstream in https://github.com/fsharp/fsharp/pull/525 but the bootstrap package doesn't have the fix yet.

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

7 years ago[runtime] MonoError-ize mono_mlist_{alloc,prepend,append}
Aleksey Kliger [Fri, 22 Apr 2016 16:22:51 +0000 (12:22 -0400)]
[runtime] MonoError-ize mono_mlist_{alloc,prepend,append}

Mark the various functions external only.  Runtime should use the
_checked variants.

7 years ago[runtime] Eliminate some uses of mono_error_raise_exception
Aleksey Kliger [Thu, 21 Apr 2016 19:38:08 +0000 (15:38 -0400)]
[runtime] Eliminate some uses of mono_error_raise_exception

7 years ago[cominterop] Get rid of uses of mono_error_raise_exception
Aleksey Kliger [Thu, 21 Apr 2016 19:21:54 +0000 (15:21 -0400)]
[cominterop] Get rid of uses of mono_error_raise_exception

in icalls

7 years ago[cominterop] MonoError-ize mono_string_from_bstr
Aleksey Kliger [Thu, 21 Apr 2016 18:52:57 +0000 (14:52 -0400)]
[cominterop] MonoError-ize mono_string_from_bstr

Runtime should use mono_string_from_bstr_checked. The icall is
mono_string_from_bstr_icall. Marked mono_string_from_bstr external only.

7 years agoFix an bug added by 5b9f9751baedfeba4a0771fb18b50cba3c5ea69b.
Zoltan Varga [Thu, 12 May 2016 14:01:45 +0000 (10:01 -0400)]
Fix an bug added by 5b9f9751baedfeba4a0771fb18b50cba3c5ea69b.

7 years agoMerge pull request #2853 from alexrp/thread-name-improvements
Alex Rønne Petersen [Thu, 12 May 2016 12:14:30 +0000 (14:14 +0200)]
Merge pull request #2853 from alexrp/thread-name-improvements

More thread name improvements

7 years ago[threads] Add a missing mono_hazard_pointer_clear () in thread_cleanup ().
Alex Rønne Petersen [Sat, 9 Apr 2016 11:24:13 +0000 (13:24 +0200)]
[threads] Add a missing mono_hazard_pointer_clear () in thread_cleanup ().

7 years ago[threads] mono_thread_set_name_internal (): Rename 'managed' arg to 'permanent'.
Alex Rønne Petersen [Fri, 8 Apr 2016 01:23:40 +0000 (03:23 +0200)]
[threads] mono_thread_set_name_internal (): Rename 'managed' arg to 'permanent'.

The actual meaning is about whether or not the name is allowed to change after
having been set by the mono_thread_set_name_internal () call; it has nothing to
do with whether the call came from managed per se.

7 years ago[threads] Don't consider MONO_THREAD_FLAG_NAME_SET when setting thread name at thread...
Alex Rønne Petersen [Fri, 8 Apr 2016 01:20:11 +0000 (03:20 +0200)]
[threads] Don't consider MONO_THREAD_FLAG_NAME_SET when setting thread name at thread startup.

If we did consider this, an internal runtime thread that had its name set by a
mono_thread_set_name_internal (..., FALSE /*managed*/, ...) call prior to
starting would not have its native name set nor its name reported to the
profiler.

7 years ago[threads] Don't exempt thread pool threads from the 'name already set' check + exception.
Alex Rønne Petersen [Fri, 8 Apr 2016 01:15:44 +0000 (03:15 +0200)]
[threads] Don't exempt thread pool threads from the 'name already set' check + exception.

MS.NET doesn't, so we shouldn't either.

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

7 years ago[threads] Only mark a thread as having a name set if the given name is non-null.
Alex Rønne Petersen [Fri, 8 Apr 2016 01:13:58 +0000 (03:13 +0200)]
[threads] Only mark a thread as having a name set if the given name is non-null.

This is consistent with MS.NET behavior.

7 years ago[threads] Rename mono_thread_info_set_name () to mono_native_thread_set_name ().
Alex Rønne Petersen [Fri, 8 Apr 2016 01:02:56 +0000 (03:02 +0200)]
[threads] Rename mono_thread_info_set_name () to mono_native_thread_set_name ().

This function has nothing to do with MonoThreadInfo structures, so the name is
somewhat misleading. It only requires a native thread ID.

7 years ago[domain] Remove an unnecessary call to mono_thread_info_set_name ().
Alex Rønne Petersen [Fri, 8 Apr 2016 01:02:17 +0000 (03:02 +0200)]
[domain] Remove an unnecessary call to mono_thread_info_set_name ().

We now do this in the thread main function.

7 years agoBump nunit-lite to get compiler warning fix.
Rolf Bjarne Kvinge [Thu, 12 May 2016 10:39:33 +0000 (12:39 +0200)]
Bump nunit-lite to get compiler warning fix.

commit //github.com/mono/NUnitLite@7065bc89e8661cad447140752c0fce118644e06e
Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
Date:   Thu May 12 12:30:28 2016 +0200

    Fix compiler warning.

7 years ago[arm] Implement a dummy version of MONO_CONTEXT_GET_CURRENT () on watchos, only the...
Zoltan Varga [Thu, 12 May 2016 10:15:23 +0000 (06:15 -0400)]
[arm] Implement a dummy version of MONO_CONTEXT_GET_CURRENT () on watchos, only the sp register is set, this is the only one needed by sgen.

7 years ago[arm] Fix the DISABLE_JIT build.
Zoltan Varga [Thu, 12 May 2016 07:52:13 +0000 (03:52 -0400)]
[arm] Fix the DISABLE_JIT build.

7 years ago[aot] Add some MonoError machinery to aot-runtime.c.
Zoltan Varga [Thu, 12 May 2016 02:31:22 +0000 (22:31 -0400)]
[aot] Add some MonoError machinery to aot-runtime.c.

7 years ago[System][tests] Make sure Dns tests works in a mixed IPv4/IPv6 network too
Sebastien Pouliot [Wed, 11 May 2016 21:50:01 +0000 (17:50 -0400)]
[System][tests] Make sure Dns tests works in a mixed IPv4/IPv6 network too

Previous tweak could disable some tests in a mixed network, e.g.
if an IPv6 address was first but an IPv4 address was available.

7 years ago[xbuild] Fix ProcessWrapper to WaitForExit(..) before accessing ExitCode
Ankit Jain [Wed, 11 May 2016 20:54:46 +0000 (16:54 -0400)]
[xbuild] Fix ProcessWrapper to WaitForExit(..) before accessing ExitCode

Process.Exited event can get invoked before the process has really
exited. So, accessing process.ExitCode before the real exit can throw:

Error executing task Exec: System.InvalidOperationException: Process must exit before requested information can be determined.
  at System.Diagnostics.Process.EnsureState (System.Diagnostics.Process+State state) [0x000b9] in /Users/ankit/dev/mono/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs:1439
  at System.Diagnostics.Process.get_ExitCode () [0x00000] in /Users/ankit/dev/mono/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs:219
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ExitCode ()
  at Microsoft.Build.Utilities.ToolTask.ExecuteTool (System.String pathToTool, System.String responseFileCommands, System.String commandLineCommands) [0x00101] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs:185
  at Microsoft.Build.Tasks.Exec.ExecuteTool (System.String pathToTool, System.String responseFileCommands, System.String commandLineCommands) [0x00026] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs:83
  at Microsoft.Build.Utilities.ToolTask.Execute () [0x0001c] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs:128
  at Microsoft.Build.BuildEngine.TaskEngine.Execute () [0x00000] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs:134
  at Microsoft.Build.BuildEngine.BuildTask.Execute () [0x0008f] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs:101

ProcessWrapper.WaitForOutput depends on the
`endEventExit`(ManualResetEvent) to be set, which is done in the event
handler for Process.Exited . So, effectively, WaitForOutput can return
before the process has really exited and ToolTask ends up throwing an
exception when it accesses the ExitCode.

Fix: Add a WaitForExit in WaitForOutput, to be sure!

7 years agoMerge pull request #2971 from BrzVlad/feature-cross-binprot
Vlad Brezae [Wed, 11 May 2016 19:37:35 +0000 (22:37 +0300)]
Merge pull request #2971 from BrzVlad/feature-cross-binprot

[sgen] Cross platform binary protocol grep

7 years agoMerge pull request #2986 from akoeplinger/fix-mono310-bootstrapping
Alexander Köplinger [Wed, 11 May 2016 19:29:21 +0000 (21:29 +0200)]
Merge pull request #2986 from akoeplinger/fix-mono310-bootstrapping

[System] Rename variable to fix bootstrapping with Mono 3.10 mcs

7 years ago[corlib] Put back instance creation using activation attributes. Fixes #40758
Marek Safar [Wed, 11 May 2016 16:24:52 +0000 (18:24 +0200)]
[corlib] Put back instance creation using activation attributes. Fixes #40758

7 years agoMerge pull request #2982 from ludovic-henry/fix-cross-monocontext
Ludovic Henry [Wed, 11 May 2016 15:09:49 +0000 (11:09 -0400)]
Merge pull request #2982 from ludovic-henry/fix-cross-monocontext

Revert "[MonoContext] Make cross compiler a specific case"

7 years ago[System][tests] Tweak Dns unit tests so it does not fail on an IPv6 only network
Sebastien Pouliot [Wed, 11 May 2016 13:11:17 +0000 (09:11 -0400)]
[System][tests] Tweak Dns unit tests so it does not fail on an IPv6 only network

Some existing tests only works when IPv4 is available, which was fine as
it match how we historically ran those tests.

Apple has a new requirement [1] to test under an "IPv6 only network" and
the change facilitate this.

[1] https://developer.apple.com/news/?id=05042016a

7 years agoMerge pull request #2985 from akoeplinger/fix-bug39305
Alexander Köplinger [Wed, 11 May 2016 12:57:20 +0000 (14:57 +0200)]
Merge pull request #2985 from akoeplinger/fix-bug39305

[corlib] Make CountdownEventTests.Signal_Concurrent more reliable