mono.git
7 years ago[mcs] Accept and ignore command line args supported by csc that we don't
Ankit Jain [Mon, 19 Sep 2016 15:09:55 +0000 (11:09 -0400)]
[mcs] Accept and ignore command line args supported by csc that we don't

.. support:

/publicsign+
/publicsign-

7 years ago[bcl] Add more reflection types to monotouch
Marek Safar [Mon, 19 Sep 2016 11:20:41 +0000 (13:20 +0200)]
[bcl] Add more reflection types to monotouch

7 years agoMerge pull request #3576 from ntherning/ignore-FileSecurityTest.EveryoneMayNotBeOwner...
Marek Safar [Mon, 19 Sep 2016 10:48:19 +0000 (12:48 +0200)]
Merge pull request #3576 from ntherning/ignore-FileSecurityTest.EveryoneMayNotBeOwner-when-Administrator

Ignore the FileSecurityTest.EveryoneMayNotBeOwner test when running as Administrator

7 years ago[mkbundle] support satellite assemblies (#3448)
Marek Habersack [Mon, 19 Sep 2016 09:51:24 +0000 (11:51 +0200)]
[mkbundle] support satellite assemblies (#3448)

Satellite assemblies are special in that they all share the same file
name, but they live in separate directories named after the locale the
satellite assemblies pack. mkbundle currently doesn't support "clashing"
assembly filenames and will not be able to store the satellite
assemblies in the bundle for that reason.

This patch adds support for storing satellite assemblies with their
culture path prefix (e.g. en-US/MyAssembly.resources.dll) in the bundle
and also special code in the assembly loader to support such filenames
in the code which loads assemblies from the bundle.

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

7 years agoIgnore the FileSecurityTest.EveryoneMayNotBeOwner test when running as
Niklas Therning [Mon, 19 Sep 2016 09:01:41 +0000 (11:01 +0200)]
Ignore the FileSecurityTest.EveryoneMayNotBeOwner test when running as
Administrator

This test fails when running as Administrator since Administrator CAN set the
owner to Everyone. This patch ignores the test when running as Administrator.
The check has to be done after the File.SetAccessControl() call that is
expected to fail since when we aren't running as Administrator the IsInRole()
check will trigger UAC which we need to prevent when possible.

7 years agoMerge pull request #3573 from ntherning/replace-NUnit-Culture-with-SetCulture
Marek Safar [Fri, 16 Sep 2016 18:01:08 +0000 (20:01 +0200)]
Merge pull request #3573 from ntherning/replace-NUnit-Culture-with-SetCulture

Use NUnit's SetCulture attribute rather than Culture

7 years agoMerge pull request #3562 from BrzVlad/fix-reverse-wbarrier
Vlad Brezae [Fri, 16 Sep 2016 17:43:46 +0000 (20:43 +0300)]
Merge pull request #3562 from BrzVlad/fix-reverse-wbarrier

[jit] Fix missing wbarrier for array generic setter

7 years agoMerge pull request #3565 from vargaz/no-free-imt-thunks
Rodrigo Kumpera [Fri, 16 Sep 2016 17:13:54 +0000 (10:13 -0700)]
Merge pull request #3565 from vargaz/no-free-imt-thunks

[runtime] Avoid freeing IMT thunks, some threads might still be execu…

7 years ago[corlib] Add missing apis
Marek Safar [Fri, 16 Sep 2016 16:05:34 +0000 (18:05 +0200)]
[corlib] Add missing apis

7 years agoMerge pull request #3574 from ntherning/disable-tests-with-com-instantiation-on-mono...
Niklas Therning [Fri, 16 Sep 2016 15:04:13 +0000 (17:04 +0200)]
Merge pull request #3574 from ntherning/disable-tests-with-com-instantiation-on-mono-on-windows

Disable tests which instantiate COM objects on Windows

7 years agoDisable tests which instantiate COM objects on Windows
Niklas Therning [Fri, 16 Sep 2016 14:59:03 +0000 (16:59 +0200)]
Disable tests which instantiate COM objects on Windows

COM is not working on Mono on Windows and adding support for it is not a
priority at the moment.

7 years ago[System.Net.Http] Show invalid values added to HttpHeaderValueCollection. to Fixes...
Marek Safar [Fri, 16 Sep 2016 13:47:50 +0000 (15:47 +0200)]
[System.Net.Http] Show invalid values added to HttpHeaderValueCollection. to Fixes #44413.

7 years ago[mcs] Delay array base type interfaces initialization. Fixes #44402
Marek Safar [Fri, 16 Sep 2016 11:12:34 +0000 (13:12 +0200)]
[mcs] Delay array base type interfaces initialization. Fixes #44402

7 years agoMerge pull request #3564 from henricm/thread-safe-win32eventlog-notifications
Marek Safar [Fri, 16 Sep 2016 12:58:29 +0000 (14:58 +0200)]
Merge pull request #3564 from henricm/thread-safe-win32eventlog-notifications

Making Win32EventLog notification thread safe

7 years agoMerge pull request #3545 from ntherning/throw-AbandonedMutexException-on-unix
Niklas Therning [Fri, 16 Sep 2016 12:57:21 +0000 (14:57 +0200)]
Merge pull request #3545 from ntherning/throw-AbandonedMutexException-on-unix

Correctly handle abandoned mutexes on non-Windows platforms

7 years agoUse NUnit's SetCulture attribute rather than Culture
Niklas Therning [Fri, 16 Sep 2016 12:47:47 +0000 (14:47 +0200)]
Use NUnit's SetCulture attribute rather than Culture

A few tests are currently ignored when running on a system where the default
culture isn't "en" or "en-US". This patch changes Culture attributes to
SetCulture attributes instead to make those tests run on all system and make
NUnit set the culture to the required one during the test run.

Also found and fixed a test failure in one of these methods,
DateTimeTest.ToUniversalTime_TimeZoneOffsetShouldNotOverflow(), which assumed
the minimum year is 0 while it's actually 1. Confirmed that this is the case
on .NET as well.

7 years agoMaking Win32EventLog notification thread safe
Henric Müller [Fri, 16 Sep 2016 12:17:17 +0000 (14:17 +0200)]
Making Win32EventLog notification thread safe

The _notifyResetEvent could be closed and nulled and the
NotifyEventThread would still try to read from the event log.
Also multiple calls to EnableNotification would cause issues.
With this fix, we make sure only one notify event thread is
running and that we thread safe the disabling of notifications.

7 years ago[runtime] Fix build
Ludovic Henry [Fri, 16 Sep 2016 09:48:47 +0000 (11:48 +0200)]
[runtime] Fix build

7 years ago[threads] Check InternalThread.last just after checking corlib version
Ludovic Henry [Fri, 16 Sep 2016 09:46:46 +0000 (11:46 +0200)]
[threads] Check InternalThread.last just after checking corlib version

7 years ago[io-layer] include `w32mutex-utils.h` (#3568)
Bernhard Urban [Fri, 16 Sep 2016 09:24:27 +0000 (02:24 -0700)]
[io-layer] include `w32mutex-utils.h` (#3568)

7 years agoCorrectly handle abandoned mutexes on non-Windows platforms
Niklas Therning [Thu, 15 Sep 2016 11:39:03 +0000 (13:39 +0200)]
Correctly handle abandoned mutexes on non-Windows platforms

When a thread owning a mutex doesn't release it before it exits and a second
thread tries to take it using e.g. Mutex.WaitOne() an AbandonedMutexException
should be thrown. This is what .NET and Mono on Windows does.

This commit builds on the work done in PR #2267, which modifies the Win32
emulation of WaitForSingleObjectEx(), SignalObjectAndWait() and
WaitForMultipleObjectsEx() to return WAIT_ABANDONED_0 when expected, and
updates it to the current HEAD. It also adds a few test methods to
WaitHandleTest that test that WaitHandle.WaitAny() and WaitHandle.WaitAll()
follows the .NET behaviour.

7 years agoCorrectly handle abandoned mutexes on non-Windows platforms
Niklas Therning [Thu, 15 Sep 2016 10:51:09 +0000 (12:51 +0200)]
Correctly handle abandoned mutexes on non-Windows platforms

When a thread owning a mutex doesn't release it before it exits and a second
thread tries to take it using e.g. Mutex.WaitOne() an AbandonedMutexException
should be thrown. This is what .NET and Mono on Windows does.

This commit adds the infrastructure needed in the Win32 emulation layer to
coomunicate that a mutex has been abandoned. It builds on the work done in
PR #2267 and updates it to the current HEAD.

7 years ago[mcs] Report more errors for nameof expressions. Fixes #44168
Marek Safar [Fri, 16 Sep 2016 08:55:41 +0000 (10:55 +0200)]
[mcs] Report more errors for nameof expressions. Fixes #44168

7 years agoMerge pull request #3566 from ntherning/fix-time-zone-issues-on-windows
Marek Safar [Fri, 16 Sep 2016 08:26:38 +0000 (10:26 +0200)]
Merge pull request #3566 from ntherning/fix-time-zone-issues-on-windows

Fixes time zone issues when running on Windows

7 years agoRevert "[loader] Tests for RefereceAssemblyAttribute support"
Zoltan Varga [Thu, 15 Sep 2016 23:44:10 +0000 (19:44 -0400)]
Revert "[loader] Tests for RefereceAssemblyAttribute support"

This reverts commit 31de4df835d27ec750fc81739bdd84a87a2efaa7.

Revert this as the corresponding fix was reverted.

7 years ago[winx64] Mark some inline functions static to hopefully fix the mxe build.
Zoltan Varga [Thu, 15 Sep 2016 18:06:21 +0000 (14:06 -0400)]
[winx64] Mark some inline functions static to hopefully fix the mxe build.

7 years ago[runtime] Add a counter for the number of freed IMT trampolines.
Zoltan Varga [Thu, 15 Sep 2016 16:30:25 +0000 (12:30 -0400)]
[runtime] Add a counter for the number of freed IMT trampolines.

7 years ago[corlib] Use simple BinaryCompatibility as anywhere else
Marek Safar [Thu, 15 Sep 2016 15:22:23 +0000 (17:22 +0200)]
[corlib] Use simple BinaryCompatibility as anywhere else

7 years ago[bcl] Fix few warnings
Marek Safar [Thu, 15 Sep 2016 15:12:38 +0000 (17:12 +0200)]
[bcl] Fix few warnings

7 years ago[man] Update few mcs sections
Marek Safar [Thu, 15 Sep 2016 15:11:53 +0000 (17:11 +0200)]
[man] Update few mcs sections

7 years agoFixes time zone issues when running on Windows
Niklas Therning [Thu, 15 Sep 2016 14:18:05 +0000 (16:18 +0200)]
Fixes time zone issues when running on Windows

TimeZoneInfo.GetDaylightChanges() didn't work as expected when run against the
time zone data available in Windows.

This patch also enables most of the time zone related tests that were
previously ignored when not run on Unix platforms. Time zone ids will now be
mapped from tz db time zone names to Windows time zone names when needed so
that most of the tests can be run on Mono on Windows as well.

7 years ago[build] Add System.Numerics.Vectors to xammac profile
Marek Safar [Thu, 15 Sep 2016 12:16:46 +0000 (14:16 +0200)]
[build] Add System.Numerics.Vectors to xammac profile

7 years ago[mcs] Improve member lookup rules when type parameter has both non-object effective...
Marek Safar [Thu, 15 Sep 2016 11:36:35 +0000 (13:36 +0200)]
[mcs] Improve member lookup rules when type parameter has both non-object effective base class and interface constraint(s)

7 years agoRevert "[runtime] Check for ReferenceAssemblyAttribute when loading for execution."
Zoltan Varga [Thu, 15 Sep 2016 11:36:46 +0000 (07:36 -0400)]
Revert "[runtime] Check for ReferenceAssemblyAttribute when loading for execution."

This reverts commit bc9461168edd5bceab698999685f3cbfdd113107.

Revert this to see if it fixes the wrench build.

7 years ago[runtime] Avoid freeing IMT thunks, some threads might still be executing them. This...
Zoltan Varga [Thu, 15 Sep 2016 11:35:18 +0000 (07:35 -0400)]
[runtime] Avoid freeing IMT thunks, some threads might still be executing them. This creates a memory leak, but its bounded. Fixes #39832.

7 years ago[w32handle] Remove case where mutex and cond are busy (#3561)
Ludovic Henry [Thu, 15 Sep 2016 08:12:07 +0000 (10:12 +0200)]
[w32handle] Remove case where mutex and cond are busy (#3561)

This code path has not been used for a while now, as mono_os_(mutex|cond)_destroy return -1 in case of error, and not EBUSY.

This is also the only code path that would check the return value, so we can simply remove the returned value, and assert on the error.

7 years agoMerge pull request #3559 from mistressofjellyfish/httpcookie
Marek Safar [Thu, 15 Sep 2016 06:55:06 +0000 (08:55 +0200)]
Merge pull request #3559 from mistressofjellyfish/httpcookie

[System.Web] HttpCookie load defaults from Web.config

7 years agoMerge pull request #3558 from rolfbjarne/tests-system-dns-make-failures-not-crash-app
Marek Safar [Thu, 15 Sep 2016 06:52:44 +0000 (08:52 +0200)]
Merge pull request #3558 from rolfbjarne/tests-system-dns-make-failures-not-crash-app

[System] Rewrite Dns tests so that failures don't cause the process to crash.

7 years ago[jit] Fix missing wbarrier for array generic setter
Vlad Brezae [Wed, 14 Sep 2016 22:16:03 +0000 (01:16 +0300)]
[jit] Fix missing wbarrier for array generic setter

The generic setter receives the element by reference which means we will never emit the write barrier since a reference to a reference is not a reference (mini_type_is_reference). Check the actual value instead. Fixes #42903.

7 years ago[w32handle] Fix race condition when creating named mutex/event/semaphore (#3560)
Ludovic Henry [Wed, 14 Sep 2016 21:18:50 +0000 (23:18 +0200)]
[w32handle] Fix race condition when creating named mutex/event/semaphore (#3560)

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

7 years agoMerge pull request #3557 from ntherning/fix-time-zone-dst-in-delta-behaviour
Marek Safar [Wed, 14 Sep 2016 16:39:26 +0000 (18:39 +0200)]
Merge pull request #3557 from ntherning/fix-time-zone-dst-in-delta-behaviour

Replicate .NET's TimeZoneInfo.IsDaylightSavingTime() and GetUtcOffset() behaviour when passed times within the lost period at DST start

7 years ago[System.Web] HttpCookie load defaults from Web.config
Katharina Bogad [Wed, 14 Sep 2016 15:57:55 +0000 (17:57 +0200)]
[System.Web] HttpCookie load defaults from Web.config

HttpCookie now loads default values from the Web.config,
just like the reference source does.

7 years ago[System] Rewrite Dns tests so that failures don't cause the process to crash.
Rolf Bjarne Kvinge [Wed, 14 Sep 2016 15:33:12 +0000 (17:33 +0200)]
[System] Rewrite Dns tests so that failures don't cause the process to crash.

Previously the tests were written so that some failures might occur on the
threadpool in methods that did not catch exceptions. In that case the process
would terminate due to an unhandled exception. So rewrite the tests to catch
exceptions in any code that doesn't run on the main thread, and forward those
exceptions to the main thread.

Also wait for async operations to complete on the main thread, and remove
asserts that are not supposed to be hit.

7 years ago[mcs] Move type constraints checks after base type definition. Fixes #44212
Marek Safar [Wed, 14 Sep 2016 13:40:11 +0000 (15:40 +0200)]
[mcs] Move type constraints checks after base type definition. Fixes #44212

7 years agoMerge pull request #3536 from henricm/fix-machinename-ignorecase
Niklas Therning [Wed, 14 Sep 2016 12:57:03 +0000 (14:57 +0200)]
Merge pull request #3536 from henricm/fix-machinename-ignorecase

Ignoring case for MachineName in EventLogTest

7 years agoReplicate .NET's TimeZoneInfo.IsDaylightSavingTime() and GetUtcOffset()
Niklas Therning [Wed, 14 Sep 2016 10:00:07 +0000 (12:00 +0200)]
Replicate .NET's TimeZoneInfo.IsDaylightSavingTime() and GetUtcOffset()
behaviour when passed times within the lost period at DST start

When passed a time within this period .NET's IsDaylightSavingTime() returns
true while GetUtcOffset() returns the BaseUtcOffset without the DST delta
added. This patch changes the behaviour in Mono to do what .NET does.

7 years agoSet DefaultPersistentConnectionLimit to 10 for Xamarin.Android
Marek Habersack [Wed, 14 Sep 2016 09:18:13 +0000 (11:18 +0200)]
Set DefaultPersistentConnectionLimit to 10 for Xamarin.Android

This is to make it the same as the Xamarin.iOS setting and
fixes https://bugzilla.xamarin.com/show_bug.cgi?id=7467

7 years ago[runtime] Rename IMT thunks to 'trampolines'. NFC. (#3555)
Zoltan Varga [Wed, 14 Sep 2016 00:56:20 +0000 (02:56 +0200)]
[runtime] Rename IMT thunks to 'trampolines'. NFC. (#3555)

7 years ago[io-layer] Extract Mutex, Semaphore and Event (#3553)
Ludovic Henry [Tue, 13 Sep 2016 21:40:58 +0000 (23:40 +0200)]
[io-layer] Extract Mutex, Semaphore and Event (#3553)

* [metadata] Move mutex managed support to seperate file

* [mutex] Extract CreateMutex

* [mutex] Extract ReleaseMutex

* [mutex] Extract OpenMutex

* [mutex] Extract wapi_mutex_abandon

* [mutex] Extract MonoW32HandleOps for mutex and named mutex

* [io-layer] Extract wapi_search_handle_namespace

* [metadata] Move semaphore managed support to seperate file

* [semaphore] Move _WapiHandle_sem and _WapiHandle_namedsem to semaphores.h

* [semaphore] Extract CreateSemaphore

* [semaphore] Extract ReleaseSemaphore

* [semaphore] Extract OpenSemaphore

* [semaphore] Extract MonoW32HandleOps

* [metadata] Move event managed support to seperate file

* [event] Extract CreateEvent

* [event] Remove dead code PulseEvent

* [event] Extract SetEvent

* [event] Extract ResetEvent

* [event] Extract OpenHandle

* [event] Extract MonoW32HandleOps

* [w32handle] Extract namespace locking

* [io-layer] Inline only use of wapi_shm_sem_lock/wapi_shm_sem_unlock

7 years ago[hybrid-aot] Add runtime support (#3556)
Ludovic Henry [Tue, 13 Sep 2016 21:40:01 +0000 (23:40 +0200)]
[hybrid-aot] Add runtime support (#3556)

* [aot-compiler] Add generic class and gsharedvt for hybrid AOT mode

* [aot-compiler] Remove dead code

* [hybrid-aot] Add --hybrid-aot for future use

7 years ago[threads] Import mono_thread_info_set_priority (#3543)
Ludovic Henry [Tue, 13 Sep 2016 16:41:29 +0000 (18:41 +0200)]
[threads] Import mono_thread_info_set_priority (#3543)

* [mono-threads] Remove MonoThreadParm.creation_flags

* [mono-threads] Remove MonoThreadParm.priority and set to MONO_THREAD_PRIORITY_NORMAL by default

* [threads] Wrap use of mono_thread_info_(get|set)_priority

* [threads] Store priority on MonoInternalThread

* [threads] Import mono_thread_info_set_priority

* [mono-threads] Remove MonoThreadParm

7 years ago[System] Don't compress custom http headers in httplistener response. Fixes #34715
Marek Safar [Tue, 13 Sep 2016 14:07:40 +0000 (16:07 +0200)]
[System] Don't compress custom http headers in httplistener response. Fixes #34715

7 years ago[runtime] Pass the initial context to mono_walk_stack_with_ctx () in mono_stack_walk_...
Zoltan Varga [Tue, 13 Sep 2016 12:58:17 +0000 (08:58 -0400)]
[runtime] Pass the initial context to mono_walk_stack_with_ctx () in mono_stack_walk_async_safe (). Hopefully fixes #44164.

7 years agoMerge pull request #3534 from BrzVlad/fix-conc-gcstress-mem
Vlad Brezae [Mon, 12 Sep 2016 20:27:39 +0000 (23:27 +0300)]
Merge pull request #3534 from BrzVlad/fix-conc-gcstress-mem

[sgen] Fix conc gcstress mem

7 years agoMerge pull request #3541 from kumpera/add-tas-to-threading
Rodrigo Kumpera [Mon, 12 Sep 2016 20:05:28 +0000 (16:05 -0400)]
Merge pull request #3541 from kumpera/add-tas-to-threading

[abort] Reduce the race window when doing Monitor:Enter.

7 years agoBump version to 4.9.0
Zoltan Varga [Mon, 12 Sep 2016 18:59:46 +0000 (20:59 +0200)]
Bump version to 4.9.0

7 years agoMerge pull request #3549 from lewurm/arm64-icache-big-little-fix
monojenkins [Mon, 12 Sep 2016 17:30:08 +0000 (18:30 +0100)]
Merge pull request #3549 from lewurm/arm64-icache-big-little-fix

[arm64] fixes around icache flushing

This fixes https://bugzilla.xamarin.com/show_bug.cgi?id=39859

The problem in `emit_thunk` and the workarounds for the Cortex A53 errata are unrelated to the bug above, but they don't hurt either.

The basic problem that we see is that the Exynos 8890 SoC (shipped for example in the world edition of the Samsung Galaxy S7) is a big.LITTLE architecture with two different CPUs, four of each. `__clear_cache` of GCC [1], the built-in that we use to flush the instruction cache, correctly reads the cache line sizes for data- and instruction cache from the CPU and then caches that result. However, the two CPUs on the Exynos 8890 have two different cache line sizes for the instruction cache (128 bytes vs. 64 bytes): If we happen to initialize the cache line sizes with the larger one, we only flush every other cache line if the code runs on the second CPU model.

Neither V8 [2] and LLVM [3] do caching of the cache line sizes, but just read it every time from the register.  We have a slightly different solution, where we cache _and_ read the value every time and try to determine a global minimum across CPUs, in case we get scheduled to a different CPU by the kernel during the flushing loop.

[1] https://android.googlesource.com/toolchain/gcc/+/master/gcc-4.9/libgcc/config/aarch64/sync-cache.c#33
[2] https://github.com/v8/v8/commit/fec99c689b8587b863df4a5c4793c601772ef663
[3] https://github.com/llvm-mirror/compiler-rt/blob/ff75f2a0260b1940436a483413091c5770427c04/lib/builtins/clear_cache.c#L146

7 years agoMerge pull request #3535 from henricm/fix-always-use-preamble-length
Marek Safar [Mon, 12 Sep 2016 14:52:30 +0000 (16:52 +0200)]
Merge pull request #3535 from henricm/fix-always-use-preamble-length

Removing hard coded preamble length

7 years ago[sgen] Free major sections in bulk also on 64bit
Vlad Brezae [Thu, 1 Sep 2016 17:58:08 +0000 (17:58 +0000)]
[sgen] Free major sections in bulk also on 64bit

On coreclr-gcstress this reduces the OS vmem maps by more than half.

7 years ago[sgen] Adjust free-ing of empty blocks
Vlad Brezae [Fri, 2 Sep 2016 16:52:20 +0000 (16:52 +0000)]
[sgen] Adjust free-ing of empty blocks

After sweep, depending on the computed allowance, we are freeing empty blocks so that we still keep around enough blocks to fill that allowance (to avoid repeated vmaps).

On both collectors this had the problem that the allowance also accounts for LOS space, which we shouldn't account for in major section heuristics (which means that in LOS intensive benchmarks we only free major sections after the LOS shrinks).

On the concurrent collector, where we have a negative allowance adjustment depending on the duration of the concurrent mark (in order to mimic serial memory usage), we can have very small allowances at the end of a major collection, even 0. This means that we would reserve no empty blocks for later use.

We solve these issues by reserving empty blocks relative to the amount of current alive blocks, which is also the basis of how we compute the allowance in the first place.

7 years ago[runtime] Replace uses of alloc functions with glib variants
Vlad Brezae [Tue, 30 Aug 2016 00:30:51 +0000 (00:30 +0000)]
[runtime] Replace uses of alloc functions with glib variants

7 years ago[utils] Fix internal allocator header size.
Mark Probst [Thu, 9 Jun 2016 20:15:23 +0000 (13:15 -0700)]
[utils] Fix internal allocator header size.

The header is always just a pointer.

7 years ago[runtime] Counters for allocated virtual memory.
Mark Probst [Thu, 9 Jun 2016 20:40:11 +0000 (13:40 -0700)]
[runtime] Counters for allocated virtual memory.

7 years agoMerge pull request #3552 from DavidKarlas/getScopeChanges
David Karlaš [Mon, 12 Sep 2016 12:58:54 +0000 (14:58 +0200)]
Merge pull request #3552 from DavidKarlas/getScopeChanges

[Debugger] GetLocals was throwing NullReferenceException(li.scopes_start) if ran against older runtime

7 years ago[Debugger] GetLocals was throwing NullReferenceException(li.scopes_start) if ran...
David Karlaš [Mon, 12 Sep 2016 11:01:27 +0000 (13:01 +0200)]
[Debugger] GetLocals was throwing NullReferenceException(li.scopes_start) if ran against older runtime
Added logic to make sure user of API handles version checking when calling GetScope
Made properties in LocalScope class public

7 years ago[threads] Correct the spin waiting in 'sleep_interruptable' (#3544)
Emil Sandstø [Mon, 12 Sep 2016 10:19:00 +0000 (12:19 +0200)]
[threads] Correct the spin waiting in 'sleep_interruptable' (#3544)

After https://github.com/mono/mono/commit/089c47f1c07bf250d76c36e04675569fc6f5b4ba#diff-e7e458b6256eaa730c145f14a666652aR1141
the code started to use nanoseconds instead of milliseconds. The problem was that this caused 'sleep_interruptable' to spin wait the last millisecond before the wait was over, https://bugzilla.xamarin.com/show_bug.cgi?id=44132.

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

7 years agoMerge pull request #3550 from alexrp/revert-tp-monitor
Alex Rønne Petersen [Sun, 11 Sep 2016 14:19:41 +0000 (16:19 +0200)]
Merge pull request #3550 from alexrp/revert-tp-monitor

Revert "[threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538)"

7 years agoRevert "[threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538)"
Alex Rønne Petersen [Sun, 11 Sep 2016 13:44:56 +0000 (15:44 +0200)]
Revert "[threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538)"

This reverts commit 2f88b8eb5a6f0108288a878f515c53b72637a88b.

There is a subtle problem with turning the monitor thread into a simple
MonoThreadInfo: It creates worker threads via mono_thread_create_internal (),
which allocates the thread object from the GC. No thread can allocate from
the GC unless it's actually attached, which the worker thread is not when
created with just mono_threads_create ().

7 years ago[runtime] Remove some dead code.
Zoltan Varga [Fri, 9 Sep 2016 22:50:50 +0000 (00:50 +0200)]
[runtime] Remove some dead code.

7 years ago[arm64] use `dc civac` instead of `dc cvau`
Bernhard Urban [Fri, 9 Sep 2016 22:43:40 +0000 (00:43 +0200)]
[arm64] use `dc civac` instead of `dc cvau`

suggested workaround for some Cortex A53 bugs, inspired by V8:
https://github.com/v8/v8/commit/fec99c689b8587b863df4a5c4793c601772ef663

7 years ago[arm64] manually flush icache
Bernhard Urban [Fri, 9 Sep 2016 22:42:58 +0000 (00:42 +0200)]
[arm64] manually flush icache

should fix https://bugzilla.xamarin.com/show_bug.cgi?id=39859

7 years ago[arm64] flush whole emitted thunk
Bernhard Urban [Fri, 9 Sep 2016 06:00:36 +0000 (08:00 +0200)]
[arm64] flush whole emitted thunk

7 years ago[threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538)
Ludovic Henry [Fri, 9 Sep 2016 21:41:34 +0000 (23:41 +0200)]
[threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538)

7 years agoRemove a debug printf.
Zoltan Varga [Fri, 9 Sep 2016 18:08:06 +0000 (20:08 +0200)]
Remove a debug printf.

7 years agoAdd missing file.
Zoltan Varga [Fri, 9 Sep 2016 17:59:45 +0000 (19:59 +0200)]
Add missing file.

7 years ago[sdb] Add a MethodMirror:GetScopes () method which returns scope information.
Zoltan Varga [Fri, 9 Sep 2016 17:58:59 +0000 (19:58 +0200)]
[sdb] Add a MethodMirror:GetScopes () method which returns scope information.

7 years ago[threads] Add specific field to check size (#3542)
Ludovic Henry [Fri, 9 Sep 2016 14:23:34 +0000 (16:23 +0200)]
[threads] Add specific field to check size (#3542)

7 years ago[threadpool-ms] Replace win32 semaphore by coop semaphore (#3519)
Ludovic Henry [Fri, 9 Sep 2016 10:09:18 +0000 (12:09 +0200)]
[threadpool-ms] Replace win32 semaphore by coop semaphore (#3519)

7 years ago[mono-threads] Fix lifetime of MonoThreadInfo->handle (#3539)
Ludovic Henry [Fri, 9 Sep 2016 09:38:30 +0000 (11:38 +0200)]
[mono-threads] Fix lifetime of MonoThreadInfo->handle (#3539)

This handle should have a total of maximum 3 copies:
 - in MonoThreadInfo->handle
 - in the return value of mono_threads_create_thread
 - in MonoInternalThread->handle (if it's a managed thread)

Before, there would always be 2 references (in MonoThreadInfo->handle and another another for MonoInternalThread->handle), even if it would be referenced at one place only (MonoThreadInfo->handle), which would lead to a handle leak.

We also need to duplicate the returned handle, to avoid having a use-after-free of the handle (in case the thread exits before we access that handle)

7 years ago[llvm] Disable llvm again for methods with large basic blocks in non-llvm-only mode...
Zoltan Varga [Fri, 9 Sep 2016 01:14:12 +0000 (03:14 +0200)]
[llvm] Disable llvm again for methods with large basic blocks in non-llvm-only mode, the workaround doesn't seem to work. Fixes #42395.

7 years agoMerge pull request #3540 from kumpera/abort-on-gerror
monojenkins [Fri, 9 Sep 2016 00:45:04 +0000 (01:45 +0100)]
Merge pull request #3540 from kumpera/abort-on-gerror

[logging] Fix g_error not aborting.

Once we enabled g_log redirection, we stopped aborting as the new handlers didn't behave like eglib.

7 years agoMerge pull request #3528 from BrzVlad/fix-sgen-check-before-collections
Vlad Brezae [Thu, 8 Sep 2016 23:54:48 +0000 (02:54 +0300)]
Merge pull request #3528 from BrzVlad/fix-sgen-check-before-collections

[sgen] Fix sgen debug flags

7 years ago[runtime] Reduce the race window when aborting Monitor:Enter.
Rodrigo Kumpera [Thu, 8 Sep 2016 20:43:07 +0000 (13:43 -0700)]
[runtime] Reduce the race window when aborting Monitor:Enter.

If you abort a thread that is doing a Monitor:Enter, if the syscall abort lands before
the target thread start waiting it will block in a non aletable way.

To address that, we start by waiting in an alertable way and if interrupted we
decide to continue or not based on whether an abort can start.

Additionally, when alertable, we CAS the thread state to catch early Thread:Abort
calls that set the state by did not managed to init it.

This fixes a rare deadlock on tests/monitor-abort.exe.

7 years ago[threads] Add mono_threads_is_ready_to_be_interrupted helper to figure out whether...
Rodrigo Kumpera [Thu, 8 Sep 2016 20:42:56 +0000 (13:42 -0700)]
[threads] Add mono_threads_is_ready_to_be_interrupted helper to figure out whether a thread is ready to be interrupted.

7 years ago[threading] Introduce mono_thread_test_and_set_state to manipulate thread state.
Rodrigo Kumpera [Thu, 1 Sep 2016 23:47:19 +0000 (16:47 -0700)]
[threading] Introduce mono_thread_test_and_set_state to manipulate thread state.

Unconditional state transitions are really bad since they don't allow threads
to coordinate between themselves.

7 years ago[logging] Fix g_error not aborting.
Rodrigo Kumpera [Thu, 8 Sep 2016 22:58:08 +0000 (15:58 -0700)]
[logging] Fix g_error not aborting.

7 years ago[threads] Factor common attach code in mono_thread_attach_internal (#3530)
Ludovic Henry [Thu, 8 Sep 2016 15:17:28 +0000 (17:17 +0200)]
[threads] Factor common attach code in mono_thread_attach_internal (#3530)

* [threads] Allocate StartInfo in create_thread

* [threads] Put start_notify semaphore in StartInfo

* [threads] Factor common attach code in mono_thread_attach_internal

* [threads] Use same registered mechanism as mono-threads

7 years agoMerge pull request #3537 from ntherning/fix-failing-ThreadTest-tests-on-windows
Niklas Therning [Thu, 8 Sep 2016 14:31:59 +0000 (16:31 +0200)]
Merge pull request #3537 from ntherning/fix-failing-ThreadTest-tests-on-windows

Remove Assert.Fail() calls in ThreadTest when running on Windows

7 years agoRemove Assert.Fail() calls in ThreadTest when running on Windows
Niklas Therning [Thu, 8 Sep 2016 13:26:25 +0000 (15:26 +0200)]
Remove Assert.Fail() calls in ThreadTest when running on Windows

The tests that fail like this actually work just fine on Mono on Windows.
Added the NotDotNet category to the CurrentThread_Domains() test since it
fails on .NET.

7 years agoIgnoring case for MachineName in EventLogTest
Henric Müller [Thu, 8 Sep 2016 12:57:44 +0000 (14:57 +0200)]
Ignoring case for MachineName in EventLogTest

7 years agoAvoid race condition between domain unload and threadpool. (#3491)
Jonathan Chambers [Thu, 8 Sep 2016 12:28:59 +0000 (08:28 -0400)]
Avoid race condition between domain unload and threadpool. (#3491)

* Avoid race condition between domain unload and threadpool.

Previous logic only ensured that domain->threadpool_jobs was 0.
There was a race condition as follows:
* worker jobs are queued into ThreadPoolDomain outstanding_request's
* domain unload starts
* domain->threadpool_jobs is 0 so unload proceeds
* queued jobs are processed from the ThreadPoolDomain outstanding_request's
* the domain can be set/entered by worker threads since
  mono_domain_set only fails for domains with state of MONO_APPDOMAIN_UNLOADED,
  while our domain is in the MONO_APPDOMAIN_UNLOADING state
* jobs are now being unexpectedly run in domain that is being shutdown

* Fix a hang when unloading the domain.

This change applies the diff from ludovic-henry to correct the hang.

https://gist.github.com/ludovic-henry/6c8a4bc8951091c0ef36df2e52d5e32e

7 years agoRemoving hard coded preamble length
Henric Müller [Thu, 8 Sep 2016 12:15:32 +0000 (14:15 +0200)]
Removing hard coded preamble length

For some reason preamble length was asumed to be 3 when cp 65001
instead of always looking att the preamble length of the encoding.
This resulted in responses cropped by 3 chars on windows.

7 years agoMerge pull request #3532 from alexrp/profiler-stress-tests
Alexander Köplinger [Thu, 8 Sep 2016 05:23:40 +0000 (07:23 +0200)]
Merge pull request #3532 from alexrp/profiler-stress-tests

[acceptance-tests] Add profiler-stress suite.

7 years ago[acceptance-tests] Add profiler-stress suite.
Alex Rønne Petersen [Wed, 7 Sep 2016 23:57:07 +0000 (01:57 +0200)]
[acceptance-tests] Add profiler-stress suite.

7 years agoMerge pull request #3531 from alexrp/master
Alex Rønne Petersen [Thu, 8 Sep 2016 01:18:40 +0000 (03:18 +0200)]
Merge pull request #3531 from alexrp/master

[profiler} Don't crash if a zero sampling frequency is given.

7 years ago[profiler} Don't crash if a zero sampling frequency is given.
Alex Rønne Petersen [Thu, 8 Sep 2016 00:20:32 +0000 (02:20 +0200)]
[profiler} Don't crash if a zero sampling frequency is given.

7 years agoMoving WSAGetLastError calls closer to socket operation (#3450)
Henric Müller [Wed, 7 Sep 2016 13:30:55 +0000 (15:30 +0200)]
Moving WSAGetLastError calls closer to socket operation (#3450)

* When doing async connect on windows, connect returns `WSAEINPROGRESS`
which needs to be returned to managed code for correct handling. However
on Windows, last error gets reset before `WSAGetLastError` is called.
This fix moves all `WSAGetLastError` calls up closer to the socket
operation to make sure correct error code is returned to the managed code.

* Making sure `TcpNoDelay` is set to false for IPv4 by default and
that `DualMode` is default for IPv6.

* Making sure option value is set to 0 before calling getsockopt
because on Windows, a `BOOL` option value (eg TcpNoDelay) is returned
as a one byte value and the other bytes are left untouched which resulted
in TcpNoDelay always seemed to be true.

* Fixed so `TF_REUSE_SOCKET` is set only if `reuse` parameter is set
when disconnecting a socket.

7 years agoMerge pull request #3511 from henricm/fix-no-socket-reuse
Niklas Therning [Wed, 7 Sep 2016 13:23:54 +0000 (15:23 +0200)]
Merge pull request #3511 from henricm/fix-no-socket-reuse

Not reusing sockets in dual mode tests

7 years ago[threads] Remove CREATE_SUSPENDED (#3529)
Ludovic Henry [Wed, 7 Sep 2016 12:28:46 +0000 (14:28 +0200)]
[threads] Remove CREATE_SUSPENDED (#3529)

* [threads] Remove use of CREATE_SUSPENDED for domain unload thread

* [threads] Remove use of CREATE_SUSPENDED for managed thread

* [threads] Remove CREATE_SUSPENDED

7 years agoMerge pull request #3526 from alexrp/master
Alex Rønne Petersen [Wed, 7 Sep 2016 01:00:48 +0000 (03:00 +0200)]
Merge pull request #3526 from alexrp/master

[sgen] Don't consider managed write barriers to be critical methods.