Alex Rønne Petersen [Wed, 20 Sep 2017 12:32:07 +0000 (14:32 +0200)]
[Mono.Profiler.Log] Load entire buffers before processing them.
This should reduce the amount of I/O system calls we do, and should be fine
in terms of memory usage since the profiler tries to keep buffers small (64k),
and latency since the profiler flushes buffers every second.
This changes the API somewhat so that users no longer have to construct a
LogReader; this is now done internally, and the type is no longer public. Also,
the LogProcessor now leaves the given stream open, so it's up to the user to
close it.
Alex Rønne Petersen [Tue, 19 Sep 2017 18:32:26 +0000 (20:32 +0200)]
[Mono.Profiler.Log] Fix excessive byte array allocations.
The problem was that the base Stream.ReadByte () method allocates a temporary
byte array and then calls Read (..., 1) on it. To solve this, we override
ReadByte () in LogStream and use a private buffer to hold the result.
It's a bit of a mystery to me why Stream.ReadByte () does it this way. The
documentation for Stream explicitly says that instance methods aren't thread
safe, so it would be perfectly fine for Stream.ReadByte () to do what we do
here...
Alex Rønne Petersen [Tue, 19 Sep 2017 22:06:16 +0000 (00:06 +0200)]
Merge pull request #5528 from rodrmoya/fix-mono-profiler-lib
[Mono.Profiler.Log] Support MLPD version 13
Rodrigo Moya [Tue, 19 Sep 2017 18:13:33 +0000 (20:13 +0200)]
[Mono.Profiler.Log] Styling fixes
Alexis Christoforides [Tue, 19 Sep 2017 17:15:07 +0000 (13:15 -0400)]
Update bockbuild for XCode 9 build fix
Rodrigo Kumpera [Tue, 12 Sep 2017 17:30:13 +0000 (10:30 -0700)]
[verifier] Allow byref in PropertySig blobs. Fixes #59180
Alexander Köplinger [Mon, 18 Sep 2017 19:14:22 +0000 (21:14 +0200)]
[WindowsBase] Fix exception type in *ValueSerializer.ConvertFromString with null parameter
ArgumentNullException was introduced by https://github.com/mono/mono/pull/5593
but it should be NotSupportedException instead to match with Windows .NET.
Similar change to what was noticed during review of https://github.com/mono/mono/pull/5343#discussion_r132166426.
Alexander Köplinger [Mon, 18 Sep 2017 18:58:44 +0000 (20:58 +0200)]
[WindowsBase] Use InvariantCulture for ConvertTo/ToString tests
They'd fail on locales such as de-DE before which uses ';' as separator.
Johan Lorensson [Tue, 19 Sep 2017 06:40:04 +0000 (08:40 +0200)]
Merge pull request #5573 from lateralusX/lateralusX/windows-invalid-socket-error
Fix sporadic failures in MonoTests.System.Net.HttpRequestStreamTest on x64 Windows.
Marek Safar [Tue, 19 Sep 2017 06:25:45 +0000 (08:25 +0200)]
Merge pull request #5589 from marek-safar/tests
Update tests network helper to be reliable in multi-threaded tests
Bernhard Urban [Fri, 15 Sep 2017 16:19:27 +0000 (09:19 -0700)]
[w32error] Add ENXIO -> ERROR_DEV_NOT_EXIST error translation
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=58738
Marek Safar [Mon, 18 Sep 2017 17:28:07 +0000 (19:28 +0200)]
[System.Runtime.Remoting] Adds System.Core reference for tests
Marek Safar [Fri, 15 Sep 2017 09:10:31 +0000 (11:10 +0200)]
Update tests network helper to be reliable in multi-threaded tests
monojenkins [Mon, 18 Sep 2017 15:39:55 +0000 (17:39 +0200)]
[msvc] Update csproj files (#5602)
Mikhail Filippov [Mon, 18 Sep 2017 14:56:44 +0000 (17:56 +0300)]
Multi-culture implementation ValueSerializers, Parse and ToString for types from WindowsBase. (#5593)
Armin Hasitzka [Mon, 18 Sep 2017 13:31:09 +0000 (15:31 +0200)]
[CI] Update Clang's ThreadSanitizer blacklist (#5558)
* Update clang-thread-sanitizer-blacklist based on races that can occur with commit
20bbf3208687b3f12582a35103bd6a6c9bb8a32e
* Add functions that came up in:
- https://jenkins.mono-project.com/job/test-mono-pull-request-clang-sanitizer/23/
- https://jenkins.mono-project.com/job/test-mono-pull-request-clang-sanitizer/24/
- https://jenkins.mono-project.com/job/test-mono-pull-request-clang-sanitizer/25/
- https://jenkins.mono-project.com/job/test-mono-pull-request-clang-sanitizer/26/
Jason Imison [Mon, 18 Sep 2017 13:30:37 +0000 (15:30 +0200)]
Install Microsoft.FSharp.NetSdk.props and targets (#5581)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=57771
Rolf Bjarne Kvinge [Mon, 18 Sep 2017 12:34:25 +0000 (14:34 +0200)]
[mono-api-html] Add solution.
It makes running mono-api-html from an IDE easier.
Zoltan Varga [Sat, 16 Sep 2017 07:44:05 +0000 (03:44 -0400)]
[llvm] Map byref types to the same type as the this argument so they are called using the same signature if the this argument is passed explicitly. Fixes #59436. (#5572)
Aleksey Kliger (λgeek) [Fri, 15 Sep 2017 22:32:04 +0000 (18:32 -0400)]
[loader] Init MonoClass:sizes.element_size lazily (Fixes #43563) (#5559)
* [loader] If signaling recursive type initialize, don't double free
If we detect that a recursive type initialization is happening, we should leave
without removing the class from the init_pending_tld_id list. Otherwise we get
a double-free when the outer recursive call finally finishes and tries to
remove the same element.
Also re-load the init_list from TLS since a recursive call to mono_class_init could
have modified it between the time the current mono_class_init call started and
when it is finishing.
* [loader] Improve error message when a field's type is a failed class
Add the class failure to the field failure error message.
* [tests] Check that runtime can represent recursive structs
Regression tests for https://bugzilla.xamarin.com/show_bug.cgi?id=43563
* [loader] Init MonoClass:sizes.element_size lazily (Fixes #43563)
Originally mono_bounded_array_class_get () would populate
MonoClass:sizes.element_size as soon as the MonoClass for the array was needed.
This is a problem because we cannot call mono_class_array_element_size () on
the element class on a valuetype until mono_class_layout_fields () finishes
initializing it.
That means that structs which contain an array of themselves would hit the
recursive initialization check in mono_class_setup_fields and the MonoClass for
the element class would be marked as failed to load.
Instead we rely on the MonoClass:size_inited bit to tell us whether the array
class has been initialized and if not, we set the array element size in
mono_class_layout_fields.
This is possible because MonoClass:sizes.element_size is only really needed to
know how to allocate space for an array. When laying out a class that contains
an array we don't need the element size - they array is just a reference type.
Example:
```csharp
struct S {
static S[][] foo;
}
```
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43563
Bernhard Urban [Fri, 15 Sep 2017 06:47:18 +0000 (08:47 +0200)]
[interp] disable assemblyresolve_event6.exe
needs working appdomains in the interpreter.
Ankit Jain [Fri, 15 Sep 2017 14:06:48 +0000 (10:06 -0400)]
[msbuild] Bump to get workaround for bxc #55697 . (#5591)
https://github.com/mono/msbuild/commit/
8b76a1d2b9ffc493349a861962e44540ea14eaac
Eberhard Beilharz [Thu, 14 Sep 2017 15:52:52 +0000 (17:52 +0200)]
[SWF] Allow to compile without X11 installed (Xamarin-59496)
This change fixes a crash we get in resgen when building without
X11 installed. The bug got introduced when fixing Xamarin-395.
Change-Id: If81a4a3ca4db7a1b0156480ad49bd61610ecebf0
lateralusX [Thu, 14 Sep 2017 09:22:25 +0000 (11:22 +0200)]
Update filters for new files added to Visual Studio projects.
monojenkins [Thu, 14 Sep 2017 19:54:19 +0000 (19:54 +0000)]
Bump API snapshot submodule
Martin Baulig [Thu, 14 Sep 2017 17:17:19 +0000 (13:17 -0400)]
[System]: SslStream.Flush() now flushes the underlying stream. Bug #57528. (#5569)
* Mono.Security.Interface.IMonoSslStream: removed Flush().
* Mono.Net.Security.MobileAuthenticatedStream: Flush() now calls `InnerStream.Flush ()'.
* System.Net.Security.SslStream: Flush() now calls `InnerStream.Flush ()'.
* System.Net.Security.SslStream: fix `CanRead`, `CanWrite` and `CanTimeout` logic.
Martin Baulig [Thu, 14 Sep 2017 17:16:13 +0000 (13:16 -0400)]
[Mono.Security]: Add internal 'MonoTlsProviderFactory.InternalVersion' constant. (#5568)
Internal version number (not in any way related to the TLS Version).
Used by the web-tests to check whether the current Mono contains certain
features or bug fixes.
Negative version numbers are reserved for martin work branches.
Rodrigo Moya [Fri, 8 Sep 2017 17:36:20 +0000 (19:36 +0200)]
[Mono.Profiler.Log] Check MLPD version when reading header
Right now, when reading a MLPD of an old version, it just silently fails, so
throw an exception when the version is unsuported.
Rodrigo Moya [Fri, 8 Sep 2017 10:36:58 +0000 (12:36 +0200)]
[Mono.Profiler.Log] Reverse managed backtrace in SampleHitEvent's
This comes in reverse order, compared to other backtraces in the MLPD, so
reverse it before sending it to visitors, so that it comes in the same
format as the rest of backtraces.
lateralusX [Thu, 14 Sep 2017 09:20:27 +0000 (11:20 +0200)]
Invalid handle exception during WSACleanup on shutdown.
Running the MonoTests.System.Net.HttpRequestStreamTest under debugger reveals this
problem. WSACleanup is freeing an invalid handle as part of network shutdown.
This happens since mono_w32socket_close calls incorrect win32 API when closing sockets.
It currently calls CloseHandle, while it should call closesocket. This probably cause
problems in winsock book keeping of active sockets, and when closing the network layer,
winsock will try to close handles that it still open, but since the handles have already been closed
by incorrect call to CloseHandle, it will close an “invalid handle” either causing the exception
or even worse, close a different handle currently in use, causing undefined behavior
during the rest of mono shutdown.
Fix is to switch to correct API when closing sockets on Windows, closesocket instread of CloseHandle.
lateralusX [Thu, 14 Sep 2017 09:06:38 +0000 (11:06 +0200)]
Fix sporadic failures in MonoTests.System.Net.HttpRequestStreamTest on x64 Windows.
MonoTests.System.Net.HttpRequestStreamTest suite has sporadic failures on Windows x64
with following exception:
System.Net.Sockets.SocketException : An operation was attempted on something that is not a socket.
This happens due to a data type and constant size mismatch. w32socket.h defines
INVALID_SOCKET and SOCKET_ERROR for all platforms. On Windows x64, SOCKET is defined
by winsock2.h as 64-bit type as well as INVALID_SOCKET constant, but above code will
define INVALID_SOCKET as a 32-bit constant value. This will in turn cause code to sporadically
fail to detect invalid sockets as returned by win32 API's. This will in turn cause the socket
exception when code continues to use socket as argument to win32 socket API’s.
Current “invalid” x64 codegen for expression:
if (sock == INVALID_SOCKET)
mov eax,0FFFFFFFFh
cmp rsi,rax
and with fixed defines, correct 64-bit cmp instruction:
cmp rsi,0FFFFFFFFFFFFFFFFh
Fix makes sure we get the defines of INVALID_SOCKET and SOCKET_ERROR from winsock2.h
on Windows platforms to be consistent with define of SOCKET type.
Jon Purdy [Thu, 14 Sep 2017 00:09:19 +0000 (17:09 -0700)]
Fix bug 4786 test.
The fix in #5501 had a scoping error causing `make check` to fail.
Rodrigo Moya [Thu, 7 Sep 2017 20:16:13 +0000 (22:16 +0200)]
[Mono.Profiler.Log] Support MLPD version 13
The differences from v14 are small, and given it is the current "stable"
MLPD version, it's worth supporting it. The differences are:
* ImagePointer field not present in v13 Assembly*Event's
* In MonitorEvent, LogMonitorEvent is not in a separate field, but included
as a flag in the extType field.
* SampleHitEvent's have a type field in v13, which was removed in v14, because
only cycles samples are emitted.
* MONO_GC_EVENT_{MARK,RECLAIM}_{START,END} were removed in v14
* SampleUnmanagedBinary's SegmentPointer is not based on ptr_base in v13
* In v13, HeapRootsEvent's Attributes is (wrongly) a byte, in v14 this was
fixed and changed back to a uleb128
Alex Rønne Petersen [Wed, 13 Sep 2017 19:49:08 +0000 (21:49 +0200)]
Merge pull request #5562 from alexrp/master
[profiler] Revert the root_type field back to uleb128.
Rodrigo Kumpera [Wed, 13 Sep 2017 17:07:34 +0000 (13:07 -0400)]
Merge pull request #5550 from Cry-Miron/patch-1
Fix issue where loaded global modules aren't freed
Marek Safar [Wed, 13 Sep 2017 09:11:06 +0000 (11:11 +0200)]
Bump ikdasm
Marek Safar [Tue, 12 Sep 2017 15:47:31 +0000 (17:47 +0200)]
[corlib] Update negative symbol for all cultures. Fixes #57496
Cry-Miron [Wed, 13 Sep 2017 08:44:59 +0000 (10:44 +0200)]
Changed indentation to K&R indentation
Alex Rønne Petersen [Wed, 13 Sep 2017 07:17:45 +0000 (09:17 +0200)]
[Mono.Profiler.Log] Read root type field as uleb128.
Alex Rønne Petersen [Wed, 13 Sep 2017 07:16:40 +0000 (09:16 +0200)]
[profiler] Revert the root_type field back to uleb128.
It's actually a 32-bit value.
Rodrigo Kumpera [Tue, 12 Sep 2017 23:12:58 +0000 (16:12 -0700)]
[wasm] Disable tests that crashes the runtime for now
Rodrigo Kumpera [Tue, 12 Sep 2017 23:11:32 +0000 (16:11 -0700)]
[wasm] Don't try mini_get_delegate_arg if the interpreter is in use.
Rodrigo Kumpera [Tue, 12 Sep 2017 21:13:56 +0000 (17:13 -0400)]
Merge pull request #5544 from kumpera/verify_byref_return
Implement verification of safe byref returns
Ankit Jain [Tue, 12 Sep 2017 20:44:48 +0000 (16:44 -0400)]
[msbuild] Bump msbuild to pick up SDK updates (#5548)
Rodrigo Kumpera [Tue, 12 Sep 2017 20:12:06 +0000 (13:12 -0700)]
[wasm] Add one more wasm_invoke entry.
Rodrigo Kumpera [Tue, 12 Sep 2017 20:04:46 +0000 (13:04 -0700)]
[interp] Add some error handling to the interpreter
Alexander Kyte [Tue, 12 Sep 2017 19:46:18 +0000 (15:46 -0400)]
[runtime] Use no-op for SufficientExecutionStack on Linux (#5543)
We had previously responded to bad performance on android by stubbing out
ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_SufficientExecutionStack
on android. This was necessary because the call to pthread_attr_getstack ()
will read /proc/self/maps. When used inside of a hot function, the performance is terrible.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58911
Rodrigo Kumpera [Tue, 12 Sep 2017 18:52:50 +0000 (11:52 -0700)]
[wasm] Don't use capture_context fast path that requires function tramps.
Rodrigo Kumpera [Fri, 8 Sep 2017 18:58:19 +0000 (11:58 -0700)]
[mini] Add MONO_ prefix to RETURN_ADDRESS macro.
Rodrigo Kumpera [Tue, 12 Sep 2017 17:39:38 +0000 (10:39 -0700)]
[verifier] Add test for structs.
Katelyn Gadd [Tue, 12 Sep 2017 00:26:04 +0000 (17:26 -0700)]
Fix bug 57918:
Async Socket reads that need to perform multiple underlying read operations fail to return a correct total # of bytes read
cherusker [Thu, 7 Sep 2017 09:25:09 +0000 (11:25 +0200)]
Mark operations on `shutting_down` as known and accepted data races
Aleksey Kliger [Fri, 8 Sep 2017 18:24:05 +0000 (14:24 -0400)]
[coop handles] Record backtrace when allocating handles when MONO_HANDLE_TRACK_OWNER is defined
A backtrace that leads to the allocation site is helpful for debugging.
Aleksey Kliger [Fri, 8 Sep 2017 18:21:53 +0000 (14:21 -0400)]
[appdomain] Catch exceptions when invoking AppDomain.DoAssemblyResolve
Otherwise we may leak a coop handle for the requesting assembly, which may
lead to an assertion when we unload the current domain.
Aleksey Kliger [Fri, 8 Sep 2017 19:18:20 +0000 (15:18 -0400)]
[test] Regression test for #58950
If a reflection only assembly resolve event handler throws an exception, catch
the exception in the runtime to ensure that no coop handles leak.
Cry-Miron [Tue, 12 Sep 2017 13:28:34 +0000 (15:28 +0200)]
Fix assert in module cleanup if nothing is cached
Cry-Miron [Tue, 12 Sep 2017 09:45:03 +0000 (11:45 +0200)]
Fix issue where loaded global modules aren't freed
Globally loaded modules would previously call LoadLibrary on Windows, but never FreeLibrary. This would result in said library keeping an internal reference counter of 1 until the application exited its entry-point, resulting in possible shutdown issues.
This commit makes sure that we correctly free modules (and unload them in the platform-specific APIs) whenever Mono itself is shutting down, ensuring the expected result of Mono-loaded libraries being correctly freed.
Rodrigo Kumpera [Mon, 11 Sep 2017 23:33:52 +0000 (16:33 -0700)]
[verifier] Fail to merge stacks with different safe byref'ness.
Rodrigo Kumpera [Mon, 11 Sep 2017 22:53:14 +0000 (15:53 -0700)]
[verifier] Implement verification of byref returns.
The verification algorithm is inspired on internal specs by the Roslyn team but adapted to what it generates today.
Here's how this patch works:
We introduce a new verification type, SAFE_BYREF, that's used for a byref value that is safe to return from the stack.
It's unverifiable to return a byref value that is not marked SAFE_BYREF.
We mark the following values are SAFE_BYREF:
- byref arguments, unless it's the `this` arg of a valuetype instance method
- return values of method calls when all byref arguments have SAFE_BYREF values - the this arg is ignored.
- the address of a static field (LDSFLDA)
- the address of an array element (LDELEMA)
- the address of a field if the receiver is either a SAFE_BYREF value or a reference
Notoriously from the above is the value of local variables. We took a conservative approach of unsafe tainting.
We do this by associating 3 states to a local: unassigned (initial value of zero), assigned and safe (SAFE_BYREF_LOCAL), assigned and unsafe (UNSAFE_BYREF_LOCAL)
When loading a local, we set its value as SAFE_BYREF if the local is in the SAFE_BYREF_LOCAL state.
When storing to a local, we set it to SAFE_BYREF_LOCAL if, only if, it's not marked as UNSAFE_BYREF_LOCAL and the value is SAFE_BYREF.
If we store a non-safe value to a local, we mark it as UNSAFE_BYREF_LOCAL.
If we store a non-safe value to a SAFE_BYREF_LOCAL local, we mark the method as unverifiable.
This algorithm makes sure we don't mix safe and unsafe byref and side with safety in case of control-flow dependent values.
Jonathan Chambers [Mon, 11 Sep 2017 17:27:00 +0000 (13:27 -0400)]
Implement stack overflow handling on Win64. Call _resetstkoflw to restore stack protection before calling handler, and then jump to handler via a cached MonoContext. (#5472)
Armin Hasitzka [Mon, 11 Sep 2017 14:35:03 +0000 (16:35 +0200)]
[TSan] Interlock and unlock MonoJitStats (#5437)
[TSan] Interlock and unlock MonoJitStats
This is the first part of telling TSan what to do with `MonoJitStats`; I dealt with all the `gint32` values and partly touched the `gboolean` value (see `FIXME`). However, `MonoJitStats` also contains `gdouble` which can (1) probably be interlocked and (2) will be updated in a later step, together with the `FIXME`, as soon as an updated version of the atomic interface exists.
I did my best to distinguish between perf. critical parts and parts where `Interlocked* ()` seems to work perfectly fine. As before, if I misjudged anything, I would kindly ask to comment the affected operations, and I will update them accordingly.
More (technical) details can be found in the commit messages.
Alexander Köplinger [Fri, 8 Sep 2017 14:36:06 +0000 (16:36 +0200)]
[System.Xaml] Fix deadlock on exception in XamlBackgroundReader
The ManualResetEvent wouldn't be signaled when an exception happens
in the reader loop so we'd deadlock in Read().
I'm still investigating where the exception comes from but this
should at least help unblocking CI.
https://bugzilla.xamarin.com/show_bug.cgi?id=46683
Niklas Therning [Mon, 11 Sep 2017 09:07:53 +0000 (11:07 +0200)]
Merge pull request #5504 from ntherning/wait-for-native-thread-to-die-in-Thread-Join
Wait for the native thread to die in Thread.Join() on Windows
Bernhard Urban [Mon, 11 Sep 2017 08:59:14 +0000 (10:59 +0200)]
Update CONTRIBUTING.md (#5542)
Jason Imison [Fri, 8 Sep 2017 22:07:07 +0000 (00:07 +0200)]
[F#] Reinstate _DebugFileExt as it's needed for mobile debugging. (#5534)
Also added a mechanism for users to override DebugType
Rodrigo Kumpera [Fri, 8 Sep 2017 18:55:38 +0000 (14:55 -0400)]
Merge pull request #5428 from kumpera/wasm-support-p2
Mono Wasm support
Ludovic Henry [Fri, 8 Sep 2017 18:07:00 +0000 (14:07 -0400)]
[threads] Fix "[threads] Fix leaking threads: SGen Worker and Finalizer (#5284)" (#5532)
* Revert "[threads] Fix leaking threads: SGen Worker and Finalizer (#5284)"
The sgen-specific cleanup cannot be run before the sgen-agnostic cleanup
This reverts commit
7db0fb0c886f5157066e26c2e2ae2d39c338cf6b.
* [threads] Make sure we do not leak the finalizer and sgen threadpool threads
Jason Imison [Fri, 8 Sep 2017 12:38:29 +0000 (14:38 +0200)]
F# portable debugging (#5531)
* Switch F# builds over to portable pdb
* Add portable pdb metadata fix from https://github.com/Microsoft/visualfsharp/pull/3553
Manuel de la Pena [Fri, 8 Sep 2017 11:05:48 +0000 (13:05 +0200)]
[Tests] Fix Mono.Data.Tds tests on iOS (#5501)
* [Tests] Fix Mono.Data.Tds tests on iOS
The modified tests failed on iOS following PR:
https://github.com/xamarin/xamarin-macios/pull/2580 that adds support
for Xharness to run the Mono.Data.Tds on Xamarin.iOS. With the changes
the tests run a expected.
* Close Listener when done.
Armin Hasitzka [Fri, 8 Sep 2017 09:20:28 +0000 (11:20 +0200)]
[TSan] Tackle MonoPerfCounters (#5413)
[TSan] Tackle MonoPerfCounters
With `MonoPerfCounters` taking part in many races, I thought it's finally time to attend to it. If I am not mistaken, most (if not all) load / store operations can be interlocked. If I am wrong, I would kindly ask to quickly comment the respective perf. critial operations and I will change them to `Unlocked* ()`.
Furthermore, a few details:
* updated all fields to signed types as `Interlocked* ()` functions exist for these types already
* upgraded a few values to `64-bit` as other `64-bit` values are assigned to them
* fixed a few `FIXME`s in `predef_writable_update ()` that were connected to `Interlocked* ()` functions
Miguel de Icaza [Thu, 7 Sep 2017 20:40:43 +0000 (16:40 -0400)]
Update man page
Miguel de Icaza [Thu, 7 Sep 2017 19:17:00 +0000 (15:17 -0400)]
Shorter
Miguel de Icaza [Thu, 7 Sep 2017 19:13:39 +0000 (15:13 -0400)]
Toggle the turbo button
Miguel de Icaza [Thu, 7 Sep 2017 21:57:53 +0000 (17:57 -0400)]
Remove lingering bits from removed prj2make tool (#5526)
Marek Safar [Thu, 7 Sep 2017 15:19:25 +0000 (17:19 +0200)]
Bump Roslyn
monojenkins [Thu, 7 Sep 2017 15:42:30 +0000 (17:42 +0200)]
[msvc] Update csproj files (#5524)
Armin Hasitzka [Thu, 7 Sep 2017 12:50:49 +0000 (14:50 +0200)]
Use `Unlocked* ()` to mark racy counters (#5500)
[TSan] Mark racy counters in metadata.c
- using `gint32` instead of `int` should not be an issue
- `img_set_count` is interlocked by `image_sets_lock ()` - `UnlockedIncrement ()` is just used for completeness / documentation
- `++img_set_cache_(hit|miss)` is called quite often and is connected to caching: it seems to me as if interlocking these counters would be a bad idea (at least for cache hits)
Armin Hasitzka [Thu, 7 Sep 2017 10:23:07 +0000 (12:23 +0200)]
[threads] Fix leaking threads: SGen Worker and Finalizer (#5284)
* Fix leaking threads: SGen Worker and Finalizer
- https://bugzilla.xamarin.com/show_bug.cgi?id=58317
- stop SGen workers before the finalizer stops
- clean up SGen workers with the Finalizer
- remove `mono_thread_join (GUINT_TO_POINTER (gc_thread->tid));` as we detach the Finalizer with `mono_threads_join_threads ()` within `mono_gc_cleanup ()`
* [fixup!] Move counting variable into the loop initialiser and add a `(gpointer)` cast
Armin Hasitzka [Thu, 7 Sep 2017 10:19:23 +0000 (12:19 +0200)]
[TSan] Reorganise / clean up counters logic in mini-generic-sharing.c (#5502)
* Reorganise counters:
- use `Interlocked* ()` and `Unlocked* ()` to fix / mark (possible) races
- change the initialisation location and the visbility of some counters
- fix a few typos
* Extend the warning when re-registering counters
* also print counter address if we have a duplicate
Marek Safar [Thu, 7 Sep 2017 09:22:25 +0000 (11:22 +0200)]
Updates for CODEOWNERS
Alexander Köplinger [Thu, 7 Sep 2017 09:24:35 +0000 (11:24 +0200)]
Update reference-assemblies (#5519)
Marek Safar [Wed, 6 Sep 2017 15:09:53 +0000 (17:09 +0200)]
Bump roslyn to 2.3.2
Alex Rønne Petersen [Wed, 6 Sep 2017 23:01:57 +0000 (01:01 +0200)]
Merge pull request #5512 from rodrmoya/fix-mono-profiler-lib
[Mono.Profiler.Log] Initialize LogEvent's properties
Rodrigo Moya [Tue, 5 Sep 2017 19:43:36 +0000 (21:43 +0200)]
[Mono.Profiler.Log] Initialize LogEvent's properties
Make sure all events have all fields initialized. This was missing setting
Buffer and Timestamp properties when creating the different LogEvent* subclasses.
Alexander Köplinger [Wed, 6 Sep 2017 20:24:07 +0000 (22:24 +0200)]
[WinForms/Drawing] Remove some leftover test scripts (#5518)
They're no longer used.
Martin Baulig [Wed, 6 Sep 2017 18:56:11 +0000 (14:56 -0400)]
[Mono.Security]: Remove some unused `Mono.Security.Interface` classes. (#5509)
* [Mono.Security]: Remove some unused `Mono.Security.Interface` classes.
* Mono.Security.Interface: removed `IBufferOffsetSize` and `BufferOffsetSize`
(these were not general-purpose BOS APIs, but depend on the internal
`SecretParameters` class).
* Mono.Security.Interface: removed `SecretParameters`, `SecureBuffer`,
`IMonoTlsEventSink`, `TlsBuffer` and `TlsMultiBuffer`.
* Bump API snapshot submodule
Bernhard Urban [Wed, 6 Sep 2017 12:28:20 +0000 (14:28 +0200)]
[amd64] fix tailcall insn size (#5483)
commit
https://github.com/mono/mono/commit/
9a634c1810aad46d30a674f3a97ab263dcd4272e
introduces a regression for
https://github.com/mono/coreclr/blob/mono/tests/src/JIT/Methodical/Invoke/25params/25param1c.il
```
Testing method of 25 parameters, all of int data type, tail.call
mono-sgen(46435,0x7fff9d34b3c0) malloc: *** error for object 0x101045400: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Process 46435 stopped
* thread #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00007fff945c915f libsystem_malloc.dylib`malloc_error_break
libsystem_malloc.dylib`malloc_error_break:
-> 0x7fff945c915f <+0>: pushq %rbp
0x7fff945c9160 <+1>: movq %rsp, %rbp
0x7fff945c9163 <+4>: nop
0x7fff945c9164 <+5>: nopl (%rax)
(lldb) mbt
* thread #1
* frame #0: 0x00007fff945c915f libsystem_malloc.dylib`malloc_error_break
frame #1: 0x00007fff945c5e81 libsystem_malloc.dylib`szone_error + 406
frame #2: 0x00007fff945c7925 libsystem_malloc.dylib`small_free_list_remove_ptr_no_clear + 766
frame #3: 0x00007fff945c7cb2 libsystem_malloc.dylib`free_small + 881
frame #4: 0x00000001004d2110 mono-sgen`monoeg_g_free(ptr=0x0000000101083c00) at gmem.c:66
frame #5: 0x0000000100007b64 mono-sgen`mono_codegen(cfg=0x000000010108c800) at mini.c:2300
frame #6: 0x000000010000aedf mono-sgen`mini_method_compile(method=0x0000000100910310, opts=
370239999, domain=0x000000010090ebd0, flags=JIT_FLAG_RUN_CCTORS, parts=0, aot_method_index=-1) at mini.c:3829
frame #7: 0x000000010000edd0 mono-sgen`mono_jit_compile_method_inner(method=0x0000000100910310, target_domain=0x000000010090ebd0, opt=
370239999, error=0x00007fff5fbfe048) at mini.c:4156
frame #8: 0x000000010001459e mono-sgen`mono_jit_compile_method_with_opt(method=0x0000000100910310, opt=
370239999, jit_only=0, error=0x00007fff5fbfe048) at mini-runtime.c:2127
frame #9: 0x0000000100013e6d mono-sgen`mono_jit_compile_method(method=0x0000000100910310, error=0x00007fff5fbfe048) at mini-runtime.c:2173
frame #10: 0x0000000100131eea mono-sgen`common_call_trampoline(regs=0x00007fff5fbfe128, code="H\x8bй\x01", m=0x0000000100910310, vt=0x0000000000000000, vtable_slot=0x0000000000000000, error=0x00007fff5fbfe048) at mini-trampolines.c:704
frame #11: 0x00000001001313b7 mono-sgen`mono_magic_trampoline(regs=0x00007fff5fbfe128, code="H\x8bй\x01", arg=0x0000000100910310, tramp="����\b\x10\x03\x91") at mini-trampolines.c:835
```
turns out we smashed our code buffer.
Also, transform this comparison:
```
if (G_UNLIKELY (offset > (cfg->code_size - max_len - EXTRA_CODE_SPACE))) {
if (G_UNLIKELY ((offset + max_len + EXTRA_CODE_SPACE) > cfg->code_size)) {
```
we deal with unsigned values here, and if `max_len` is bigger then
`cfg->code_size`, we won't resize the buffer.
Armin Hasitzka [Wed, 6 Sep 2017 12:16:02 +0000 (14:16 +0200)]
Interlock `inflated_signatures_size`, `memberref_sig_cache_size`, `methods_size` and `signatures_size` (#5489)
[TSan] Interlocking loader.c
`loader.c` contains four statistics counters and all of them are invovled in data races. This PR focuses on dealing with them:
- All of them can be `gint32` as they are registered as `MONO_COUNTER_INT` anyways.
- Since there is already a lot of locking involved in `loader.c` (including an approved usage of `Interlocked* ()` with with `mono_stats`), I think that `Interlocked* ()` can be used here instead of `Unlocked* ()`. If this assumption is wrong, I would kindly ask to correct me by commenting the affected rows and I will change it to `Unlocked* ()`.
Zoltan Varga [Wed, 6 Sep 2017 11:56:37 +0000 (07:56 -0400)]
[bcl] Use RuntimeHelpers.GetHashCode () for getting the hash code of … (#5511)
* [bcl] Use RuntimeHelpers.GetHashCode () for getting the hash code of the delegate target to avoid calling user defined hash code implementations which can throw exceptions. Fixes a regression introduced by
a48bc439850869e565833d7fe6330c289beffe40.
* add test for #59235
https://bugzilla.xamarin.com/show_bug.cgi?id=59235
* [fixup] RuntimeHelpers.GetHashCode handles null
Zoltan Varga [Tue, 5 Sep 2017 00:24:48 +0000 (02:24 +0200)]
[sdb] Don't set tls->context when interrupting a thread, it could race with the thread processing a breakpoint at the same time. Fixes #58612.
Neale Ferguson [Thu, 31 Aug 2017 20:40:06 +0000 (16:40 -0400)]
Add z14 support and extend z13 support
Rodrigo Kumpera [Tue, 5 Sep 2017 21:28:37 +0000 (14:28 -0700)]
[utils] Fix inet_pton fallback.
Niklas Therning [Tue, 5 Sep 2017 09:15:22 +0000 (11:15 +0200)]
Wait for the native thread to die in Thread.Join() on Windows
This is the behavior of .NET. After this patch the code on Mono for Windows
will make sure the underlying native thread of a managed thread has died
before Thread.Join() returns.
This PR builds on PR #5454 but makes it Windows specific. PR #5454 was
reverted since it caused crashes on some Unix platforms.
Vladimir Kargov [Sat, 2 Sep 2017 00:06:46 +0000 (17:06 -0700)]
[ci] Add the coverage collection script.
Marek Safar [Mon, 4 Sep 2017 11:10:47 +0000 (13:10 +0200)]
More codeowners update
cherusker [Sun, 3 Sep 2017 17:54:35 +0000 (19:54 +0200)]
Use `Unlocked* ()` for operations on `joinable_thread_count`
- mark the (harmless) data race of the fastpath
cherusker [Mon, 4 Sep 2017 07:09:10 +0000 (09:09 +0200)]
Fix racy counter and unify the styles
HinTak [Fri, 1 Sep 2017 22:01:51 +0000 (23:01 +0100)]
Clarifying the usage of the --library option
I found that multiple libraries need to be specified in dependency order. That was not obvious from the man page. Make it explicit.
See https://bugzilla.xamarin.com/show_bug.cgi?id=59154
Alexander Köplinger [Fri, 1 Sep 2017 22:10:40 +0000 (00:10 +0200)]
[ci] Retry flaky tests only on PRs (#5492)
So we can still see failures in master and release branches.
Rodrigo Kumpera [Thu, 31 Aug 2017 18:20:31 +0000 (11:20 -0700)]
[wasm][sgen] Introduce DEFAULT_SWEEP_MODE, move DEFAULT_MAJOR to sgen-config.h and make wasm defaults serial.