mono.git
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[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 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 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.

7 years ago[sgen] Make sure we don't sweep a block if we're not supposed to
Vlad Brezae [Tue, 6 Sep 2016 10:43:05 +0000 (13:43 +0300)]
[sgen] Make sure we don't sweep a block if we're not supposed to

If the sweeping mechanism has been triggered by a major collection, then the iteration will wait for the general sweeping to finish and also for the sweeping of all the blocks. If this isn't the case (we are doing a major collection) we will iterate over the current state of the heap, some objects being bound to die during the collection, and the callback must account for this.

It doesn't make much sense to explicitly attempt to iterate without trying to sweep blocks that can be swept.

7 years agoRename local file into socket_fd (#3524)
Manu [Tue, 6 Sep 2016 22:28:16 +0000 (07:28 +0900)]
Rename local file into socket_fd (#3524)

This is to avoid hiding the static gint `file` and to better understand the code.

7 years agoMerge pull request #3509 from ludovic-henry/iolayer-extract-threading
Ludovic Henry [Tue, 6 Sep 2016 22:18:23 +0000 (00:18 +0200)]
Merge pull request #3509 from ludovic-henry/iolayer-extract-threading

[mono-threads] Keep cleaning up mono-threads after iolayer extraction

7 years ago[sgen] Don't consider managed write barriers to be critical methods.
Alex Rønne Petersen [Tue, 6 Sep 2016 18:51:13 +0000 (20:51 +0200)]
[sgen] Don't consider managed write barriers to be critical methods.

When we emit calls to them, we also emit an OP_DUMMY_USE instruction to keep
the object alive, so it is OK for the GC to interrupt write barriers now.

7 years ago[sgen] Remove unused and potentially wrong case from major object iteration
Vlad Brezae [Tue, 6 Sep 2016 17:01:28 +0000 (20:01 +0300)]
[sgen] Remove unused and potentially wrong case from major object iteration

We never enter this case since we never iterate over the major objects without requiring to sweep, while a sweep is running. Even if we would be in this case, we directly access the mark bits which can be cleared at the same time by another thread sweeping the block, so we could miss live objects.

7 years ago[sgen] Fix mod union consistency check
Vlad Brezae [Tue, 6 Sep 2016 16:57:48 +0000 (19:57 +0300)]
[sgen] Fix mod union consistency check

We don't need a mod union to mark an object with concurrent mark&sweep.

7 years ago[sgen] Don't do remset consistency checks during majors
Vlad Brezae [Tue, 6 Sep 2016 16:30:31 +0000 (19:30 +0300)]
[sgen] Don't do remset consistency checks during majors

It doesn't make sense to check the remset during a major since majors dont use the cardtable and we clear it at the start. So we will obviously have missing remsets. For the debugging concurrent case, we should use the mod union consistency checks instead.

7 years ago[sgen] Don't verify the heap after a major
Vlad Brezae [Tue, 6 Sep 2016 15:20:54 +0000 (18:20 +0300)]
[sgen] Don't verify the heap after a major

We would need to deal with scanning forwarded objects and dead objects which is not worth it. Only verify the heap at the start of a collection, as indicated by the name of the flag.

7 years ago[sgen] Fix missing remsets with verify before collections
Vlad Brezae [Tue, 6 Sep 2016 13:43:54 +0000 (16:43 +0300)]
[sgen] Fix missing remsets with verify before collections

When verifying the heap we need to have the set of pinned objects otherwise we can observe missing remsets if suspended between the store and the write barrier. If we don't have the set of pinned objects, allow missing remsets.

7 years ago[mono-threads] Have error in case we cannot set thread priority
Ludovic Henry [Mon, 5 Sep 2016 13:41:56 +0000 (15:41 +0200)]
[mono-threads] Have error in case we cannot set thread priority

7 years ago[mono-threads] Fix win32 to posix priority conversion
Ludovic Henry [Wed, 10 Aug 2016 14:49:45 +0000 (16:49 +0200)]
[mono-threads] Fix win32 to posix priority conversion

7 years ago[mono-threads] Store handle related data in MonoThreadInfo
Ludovic Henry [Fri, 15 Jul 2016 01:10:37 +0000 (03:10 +0200)]
[mono-threads] Store handle related data in MonoThreadInfo

7 years ago[mono-threads] Assert that we do not try to signal the handle multiple times
Ludovic Henry [Fri, 15 Jul 2016 08:51:14 +0000 (10:51 +0200)]
[mono-threads] Assert that we do not try to signal the handle multiple times

7 years agoMerge pull request #3518 from akoeplinger/fix-fileiopermission
Alexander Köplinger [Tue, 6 Sep 2016 13:17:30 +0000 (15:17 +0200)]
Merge pull request #3518 from akoeplinger/fix-fileiopermission

[corlib] Ensure FileIOPermission ctor is not called on mobile

7 years ago[corlib] Ensure FileIOPermission ctor is not called on mobile
Alexander Köplinger [Sun, 4 Sep 2016 14:42:11 +0000 (16:42 +0200)]
[corlib] Ensure FileIOPermission ctor is not called on mobile

After https://github.com/mono/mono/pull/3452 was merged, the LinkSdkRegressionTest.SecurityDeclaration
test in XI started failing:

```
[FAIL] LinkSdkRegressionTest.SecurityDeclaration :   FileIOPermissionAccess
  Expected: null
  But was:  <System.Security.Permissions.FileIOPermissionAccess>

  at LinkSdk.LinkSdkRegressionTest.SecurityDeclaration () [0x00033] in /Users/builder/data/lanes/1411/2a96404f/source/xamarin-macios/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs:990
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/data/lanes/1411/2a96404f/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
```

Due to the added call in the PR the linker preserved FileIOPermissionAccess enum,
which is apparently something we want to avoid.

Since according to https://github.com/mono/mono/pull/3452#discussion_r76384945 the only point of calling the
FileIOPermission is validating that the path doesn't contain invalid characters (mostly an issue on Windows),
I decided to just copy those checks as it's way cleaner.

7 years agoMerge pull request #3525 from henricm/fix-access-level-get-token
Alexander Köplinger [Tue, 6 Sep 2016 10:24:39 +0000 (12:24 +0200)]
Merge pull request #3525 from henricm/fix-access-level-get-token

Using max level allowed when getting current token

7 years agoUsing max level allowed when getting current token
Henric Müller [Tue, 6 Sep 2016 08:08:50 +0000 (10:08 +0200)]
Using max level allowed when getting current token

Reference source of WindowsIdentity is using `MAXIMUM_ALLOWED`
as desired level by default when getting current token.
Changing to same behaviour to enable duplicate and impersonation
to be made on the token retrieved by GetCurrentToken.

7 years ago[mcs/Makefile] make the 'btest' (bootstrap test) target work again
Miguel de Icaza [Tue, 6 Sep 2016 01:38:47 +0000 (21:38 -0400)]
[mcs/Makefile] make the 'btest' (bootstrap test) target work again

7 years ago[jit] Unify the handling of 'error' and 'exc' in the llvm-only and non llvm-only...
Zoltan Varga [Tue, 6 Sep 2016 00:21:38 +0000 (02:21 +0200)]
[jit] Unify the handling of 'error' and 'exc' in the llvm-only and non llvm-only runtime invoke code. Fixes #41961.

7 years agoBetter handle marshaling of packed types (#3508)
Joshua Peterson [Mon, 5 Sep 2016 21:43:55 +0000 (17:43 -0400)]
Better handle marshaling of packed types (#3508)

* This improves the marshaling for packed classes and class involved in an inheritance hierarchy.
* Similar changes were made in the Unity fork of mono across a number of commits.
* The tests here have been taken from the repo and converted to work as NUnit tests in Mono.

7 years ago[jit] Emit a dummy call after calls to Type.GetType () in llvm-only mode to prevent...
Zoltan Varga [Mon, 5 Sep 2016 21:01:38 +0000 (23:01 +0200)]
[jit] Emit a dummy call after calls to Type.GetType () in llvm-only mode to prevent clang from transforming the call to a tail call which would cause the stack walk done by GetType () to find the wrong frame. Fixes #41956.

7 years agoMerge pull request #3521 from ntherning/fix-failures-in-RegistryKeyTest-on-windows
Alexander Köplinger [Mon, 5 Sep 2016 16:17:22 +0000 (18:17 +0200)]
Merge pull request #3521 from ntherning/fix-failures-in-RegistryKeyTest-on-windows

Fix for failures in RegistryKeyTest on Windows

7 years agoMerge pull request #3520 from ntherning/fix-ModuleTest-too-long-temp-folder-path...
Alexander Köplinger [Mon, 5 Sep 2016 15:39:33 +0000 (17:39 +0200)]
Merge pull request #3520 from ntherning/fix-ModuleTest-too-long-temp-folder-path-on-windows

Prevent ModuleTest failures due to too long temp folder path on Windows

7 years agoFix for failures in RegistryKeyTest on Windows
Niklas Therning [Mon, 5 Sep 2016 13:15:11 +0000 (15:15 +0200)]
Fix for failures in RegistryKeyTest on Windows

Refcatored Win32RegistryApi.SetValue() to accept uint/byte/etc values for
DWord registry values.

Added handling of ERROR_CHILD_MUST_BE_VOLATILE errors to GenerateException().

Centralized MarkedForDeletion error handling to GenerateException().

Fixed tests which create volatile subkeys in RegistryKeyTest which used the
same key names but didn't clean up properly.

7 years agoMerge pull request #3505 from ntherning/fix-resource-lookup-in-ResourceReaderTest...
Alexander Köplinger [Mon, 5 Sep 2016 11:42:57 +0000 (13:42 +0200)]
Merge pull request #3505 from ntherning/fix-resource-lookup-in-ResourceReaderTest-on-mono-on-windows

Lookup of test resource files in ResourceReaderTest fails on Windows

7 years agoPrevent ModuleTest failures due to too long temp folder path on Windows
Niklas Therning [Mon, 5 Sep 2016 11:21:28 +0000 (13:21 +0200)]
Prevent ModuleTest failures due to too long temp folder path on Windows

On Windows the TearDown() cannot delete the temp folder since it contains
loaded assemblies. The next time the test is run it will create a temp folder
inside the previous folder. After a number of runs the temp folder path will
approach the ~260 max path supported on Windows and some of the methods will
start failing.

This patch changes the way the temp folder is created and reduces the depth in
the same way as AssemblyTest was patched to fix a similar issue in
b90617e7b7a9ecd501abc65d171d97163ce4ee3d.

7 years ago[sgen] Remove unused parameter
Vlad Brezae [Mon, 5 Sep 2016 11:12:00 +0000 (14:12 +0300)]
[sgen] Remove unused parameter

We never do nursery collections as part of the concurrent finishing pause

7 years agoLookup of test resource files in ResourceReaderTest fails on Windows
Niklas Therning [Thu, 1 Sep 2016 14:34:49 +0000 (16:34 +0200)]
Lookup of test resource files in ResourceReaderTest fails on Windows

Removed the differing code paths in FixtureSetUp() when running on non-Windows
platforms vs when running Mono on Windows or on .NET. The path previously
taken only on non-Windows platforms has been verified to work as expected on
both Mono on Windows and on .NET.

7 years ago[Dataflow] Bump timeouts in TransformBlockTest.DeferredUsage
Alexander Köplinger [Sun, 4 Sep 2016 18:11:36 +0000 (20:11 +0200)]
[Dataflow] Bump timeouts in TransformBlockTest.DeferredUsage

It failed a couple of times according to the babysitter logs with the following error:

```
MESSAGE:
Expected and actual are both <System.Int32[10]>
  Values differ at index [1]
  Expected: -1
  But was:  0
```

Bump timeouts a little bit to see if this helps.

7 years agoMerge pull request #3514 from ntherning/more-reliable-g_get_home_dir-on-windows
Alexander Köplinger [Sun, 4 Sep 2016 09:12:01 +0000 (11:12 +0200)]
Merge pull request #3514 from ntherning/more-reliable-g_get_home_dir-on-windows

Prefer SHGetKnownFolderPath() in g_get_home_dir() over HOMEDRIVE/HOMEPATH environment variables

7 years agoMerge pull request #3517 from alexrp/master
Alex Rønne Petersen [Sat, 3 Sep 2016 20:14:16 +0000 (22:14 +0200)]
Merge pull request #3517 from alexrp/master

[man] Update mprof-report.1 to cover new profiler options.

7 years agoPrefer SHGetKnownFolderPath() in g_get_home_dir() over HOMEDRIVE/HOMEPATH
Niklas Therning [Fri, 2 Sep 2016 19:52:57 +0000 (21:52 +0200)]
Prefer SHGetKnownFolderPath() in g_get_home_dir() over HOMEDRIVE/HOMEPATH
environment variables

Relying on the HOMEDRIVE/HOMEPATH environment variables is fragile as those
variables don't always have to be set. One such scenario is when running on a
Jenkins slave. When not set g_get_home_dir() in eglib would return NULL which
led to a crash in ves_icall_System_Environment_InternalGetHome().

This patch changes g_get_home_dir() to first try to call
SHGetKnownFolderPath() to get the current user's profile directory (i.e. home
dir). If that fails it falls back to the USERPROFILE environment variable. If
that isn't available the function will fallback to the original behavior and
try with HOMEDRIVE/HOMEPATH.

7 years ago[man] Update mprof-report.1 to cover new profiler options.
Alex Rønne Petersen [Sat, 3 Sep 2016 15:05:52 +0000 (17:05 +0200)]
[man] Update mprof-report.1 to cover new profiler options.

Also reformat some sections a bit.

7 years ago[SRE] Move the resolving of user types to managed code, the runtime was not using...
Zoltan Varga [Sat, 3 Sep 2016 02:08:40 +0000 (04:08 +0200)]
[SRE] Move the resolving of user types to managed code, the runtime was not using write barriers. (#3515)

7 years ago[runtime] Fix a C&P problem introduced by d4052c556399c2ef72c79088c05a8ad6913647a6.
Zoltan Varga [Sat, 3 Sep 2016 00:59:20 +0000 (02:59 +0200)]
[runtime] Fix a C&P problem introduced by d4052c556399c2ef72c79088c05a8ad6913647a6.

7 years ago[SRE] Remove empty TypeBuilder:setup_generic_class () icall.
Zoltan Varga [Sat, 27 Aug 2016 22:27:47 +0000 (00:27 +0200)]
[SRE] Remove empty TypeBuilder:setup_generic_class () icall.

7 years ago[runtime] Remove the stub of ves_icall_TypeBuilder_create_internal_class ().
Zoltan Varga [Sat, 27 Aug 2016 22:24:31 +0000 (00:24 +0200)]
[runtime] Remove the stub of ves_icall_TypeBuilder_create_internal_class ().

7 years ago[corlib] Fix the signature of a few SRE icalls, they already receive a TypeBuilder...
Zoltan Varga [Fri, 2 Sep 2016 19:30:05 +0000 (21:30 +0200)]
[corlib] Fix the signature of a few SRE icalls, they already receive a TypeBuilder as the 'this' argument.

7 years agoMerge pull request #3446 from lambdageek/bug-42584
Aleksey Kliger (λgeek) [Fri, 2 Sep 2016 14:31:42 +0000 (10:31 -0400)]
Merge pull request #3446 from lambdageek/bug-42584

[loader] Check for ReferenceAssemblyAttribute when loading

7 years ago[mcs] Adjust correctly newline counter inside pragma warning
Marek Safar [Fri, 2 Sep 2016 14:21:25 +0000 (16:21 +0200)]
[mcs] Adjust correctly newline counter inside pragma warning

7 years ago[corlib] Add timeout to failing test
Marek Safar [Fri, 2 Sep 2016 13:37:56 +0000 (15:37 +0200)]
[corlib] Add timeout to failing test

7 years agoMerge pull request #3506 from ntherning/make-ZoneTest-succeed-on-mono-on-windows
Marek Safar [Fri, 2 Sep 2016 13:01:32 +0000 (15:01 +0200)]
Merge pull request #3506 from ntherning/make-ZoneTest-succeed-on-mono-on-windows

Make Zone.CreateFromUrl() work with URLs like file://C:\foo\bar

7 years agoMerge pull request #3452 from ntherning/fix-AppDomainSetupTest-on-windows
Marek Safar [Fri, 2 Sep 2016 09:25:15 +0000 (11:25 +0200)]
Merge pull request #3452 from ntherning/fix-AppDomainSetupTest-on-windows

Validate AppDomainSetup.ApplicationBase path more like .NET does

7 years agoNot reusing sockets in dual mode tests
Henric Müller [Fri, 2 Sep 2016 09:06:28 +0000 (11:06 +0200)]
Not reusing sockets in dual mode tests

Creating new sockets between each connect instead of
trying to reuse the client socket. The original tests
was not working in the MS .NET runtime and socket reuse
is not recommended to use unless in very special cases.

7 years ago[System.Core] Allow TryConvert to return null for any reference types (not only objec...
Marek Safar [Fri, 2 Sep 2016 09:01:17 +0000 (11:01 +0200)]
[System.Core] Allow TryConvert to return null for any reference types (not only object). Fixes #41509

7 years ago[runtime] Check for ReferenceAssemblyAttribute when loading for execution.
Aleksey Kliger [Fri, 26 Aug 2016 18:10:25 +0000 (14:10 -0400)]
[runtime] Check for ReferenceAssemblyAttribute when loading for execution.

7 years ago[loader] Tests for RefereceAssemblyAttribute support
Aleksey Kliger [Thu, 25 Aug 2016 21:16:05 +0000 (17:16 -0400)]
[loader] Tests for RefereceAssemblyAttribute support

7 years ago[runtime] Add mono_assembly_get_reference_assembly_attribute
Aleksey Kliger [Tue, 23 Aug 2016 15:51:39 +0000 (11:51 -0400)]
[runtime] Add mono_assembly_get_reference_assembly_attribute

Checks whether the given assembly has the
System.Runtime.CompilerServices.ReferenceAssemblyAttribute applied.

7 years agoMerge pull request #3455 from kumpera/abort_cctor
Rodrigo Kumpera [Thu, 1 Sep 2016 21:49:32 +0000 (17:49 -0400)]
Merge pull request #3455 from kumpera/abort_cctor

[runtime] Don't abort .cctors. Fixes #43320

7 years ago[mono-threads] Factor common platform create thread code (#3484)
Ludovic Henry [Thu, 1 Sep 2016 19:22:51 +0000 (21:22 +0200)]
[mono-threads] Factor common platform create thread code (#3484)

7 years agoBundle other options (#3501)
Miguel de Icaza [Thu, 1 Sep 2016 16:58:48 +0000 (12:58 -0400)]
Bundle other options (#3501)

* [mkbundle] add support for baking environment variables, make endian-independent

* [runtime] Bundle support, implement missing stream processing

7 years agoMerge pull request #3498 from mattleibow/bug-41723
Alexander Köplinger [Thu, 1 Sep 2016 16:17:46 +0000 (18:17 +0200)]
Merge pull request #3498 from mattleibow/bug-41723

[Mono.Data.Sqlite] Added checks for entry point existence

7 years agoMake Zone.CreateFromUrl() work with URLs like file://C:\foo\bar
Niklas Therning [Thu, 1 Sep 2016 14:43:50 +0000 (16:43 +0200)]
Make Zone.CreateFromUrl() work with URLs like file://C:\foo\bar

On Windows the test used URLs like `file://C:\tmp\foo` which the
Mono.Security.Uri class was incapable of parsing. System.Uri from
referencesource parses such URLs just fine. This patch fixes the Uri class to
be able to parse such URLs. It also changes the Zone class to not throw an
exception if the Zone.CreateFromUrl() method is passed an invalid URL. Instead
the zone is set to NoZone. This seems to be how Zone in .NET behaves.

7 years agoMerge pull request #3503 from ntherning/fix-MarshalTest.GetHINSTANCE-on-mono-windows
Niklas Therning [Thu, 1 Sep 2016 14:41:58 +0000 (16:41 +0200)]
Merge pull request #3503 from ntherning/fix-MarshalTest.GetHINSTANCE-on-mono-windows

Ignore the MarshalTest.GetHINSTANCE() test on Mono on Windows

7 years agoMerge pull request #3504 from ntherning/fix-PropertyInfoTest.ConstantValue-fails...
Niklas Therning [Thu, 1 Sep 2016 14:41:17 +0000 (16:41 +0200)]
Merge pull request #3504 from ntherning/fix-PropertyInfoTest.ConstantValue-fails-to-delete-locked-file-on-windows

PropertyInfoTest.ConstantValue() shouldn't fail if temp file cannot be deleted

7 years agoPropertyInfoTest.ConstantValue() shouldn't fail if temp file cannot be deleted
Niklas Therning [Thu, 1 Sep 2016 14:30:40 +0000 (16:30 +0200)]
PropertyInfoTest.ConstantValue() shouldn't fail if temp file cannot be deleted

Happens when running this test on Windows. Just swallow the exception if the
File.Delete() fails.

7 years agoIgnore the MarshalTest.GetHINSTANCE() test on Mono on Windows
Niklas Therning [Thu, 1 Sep 2016 14:25:01 +0000 (16:25 +0200)]
Ignore the MarshalTest.GetHINSTANCE() test on Mono on Windows

Won't work on Mono even when running on Windows.

7 years ago[Mono.Data.Sqlite] Using the Version class to do the version comparison correctly
Matthew Leibowitz [Thu, 1 Sep 2016 14:02:44 +0000 (16:02 +0200)]
[Mono.Data.Sqlite] Using the Version class to do the version comparison correctly

7 years agoTypo fix
Miguel de Icaza [Thu, 1 Sep 2016 13:22:16 +0000 (09:22 -0400)]
Typo fix

7 years agoAdd a man page for cert-sync (#3424)
Jo Shields [Thu, 1 Sep 2016 13:21:15 +0000 (14:21 +0100)]
Add a man page for cert-sync (#3424)

7 years ago[runtime] Add a mono_threads_close_thread_handle () function and use it to close...
Zoltan Varga [Thu, 1 Sep 2016 11:34:00 +0000 (13:34 +0200)]
[runtime] Add a mono_threads_close_thread_handle () function and use it to close thread handles instead of CloseHandle (). (#3497)

7 years agoMerge pull request #3492 from lewurm/fix-insert-insn
Bernhard Urban [Thu, 1 Sep 2016 05:22:17 +0000 (07:22 +0200)]
Merge pull request #3492 from lewurm/fix-insert-insn

[mini] emit sequence point before branching off for tail call [was: respect seq points when adding instruction at end of block]

7 years agoMerge pull request #3499 from kumpera/fix_logging
monojenkins [Thu, 1 Sep 2016 02:40:12 +0000 (03:40 +0100)]
Merge pull request #3499 from kumpera/fix_logging

[logging] Ensure glib logging redirection and remove unwanted new pub api functions.

7 years ago[Mono.Data.Sqlite] Instead of try/catch and dlopen/dlsym, use a cross-platform, corre...
Matthew Leibowitz [Thu, 1 Sep 2016 02:09:00 +0000 (04:09 +0200)]
[Mono.Data.Sqlite] Instead of try/catch and dlopen/dlsym, use a cross-platform, correct way of determining API features: version

7 years ago[threading] Update comments.
Rodrigo Kumpera [Thu, 1 Sep 2016 00:49:48 +0000 (17:49 -0700)]
[threading] Update comments.

7 years ago[runtime] Introduce abort protected blocks. Use it within async invokes and unhandled...
Rodrigo Kumpera [Wed, 31 Aug 2016 00:12:22 +0000 (17:12 -0700)]
[runtime] Introduce abort protected blocks. Use it within async invokes and unhandled exceptions.

There are a few places in the runtime that should not be aborted as it would render it unusable.

cctor execution was the initial trigger for this changeset, but then edge triggering of TAE turned out
to expose this issue on other places.

This patch introduces those regions and apply them to the following places:

ves_icall_System_Runtime_Remoting_Messaging_AsyncResult_Invoke: Not delivering the completed CB
screws up any completion logic the user setup up.

mono_unhandled_exception: Protect delivery of the unhandled exception. Can't fail during it or we'll
effectively double fault and abort.

7 years ago[runtime] Add test for the interactions between thread abort and .cctors.
Rodrigo Kumpera [Thu, 25 Aug 2016 23:51:25 +0000 (16:51 -0700)]
[runtime] Add test for the interactions between thread abort and .cctors.

This covers bug #43320

7 years ago[runtime] Don't start aborting a thread if it's running any .cctor. Fixes #43320.
Rodrigo Kumpera [Thu, 25 Aug 2016 23:39:50 +0000 (16:39 -0700)]
[runtime] Don't start aborting a thread if it's running any .cctor. Fixes #43320.

A thread abort must not start if the thread is running a .cctor.
OTOH, if the cctor self aborts, it should start.

Threads now track how many cctors they are running in the cctor_exec_depth variable.

The abort machinery (in async_abort_critical) checks that flag and bail from
starting the abort.

The cctor code (in mono_runtime_class_init_full) ensures that cctor_exec_depth is bumped
around execution of the cctor itself. Additionally, error handling was cleaned up as it was pretty
inconsistent.

7 years ago[runtime] Add mono_current_thread_has_handle_block_guard callback to the runtime...
Rodrigo Kumpera [Thu, 25 Aug 2016 23:37:36 +0000 (16:37 -0700)]
[runtime] Add mono_current_thread_has_handle_block_guard callback to the runtime EH callbacks.

This callback allows the runtime to query mini on whether there's a block guard in play.
It allows for the runtime to correctly decide when to start an abort.

7 years ago[logging] Ensure that glib logging goes through the new logging mechanics and that...
Rodrigo Kumpera [Thu, 1 Sep 2016 00:37:35 +0000 (17:37 -0700)]
[logging] Ensure that glib logging goes through the new logging mechanics and that the domain prefix is preserved.

Call g_log_set_default_handler in mono_trace_set_log_handler and mono_trace_set_log_handler_internal to ensure that g_ logging is properly routed.

Additionally, change the internal logging callback to take the log message as a single string to simplify things.

7 years ago[Mono.Data.Sqlite] Make the fields read-only
Matthew Leibowitz [Wed, 31 Aug 2016 23:28:06 +0000 (01:28 +0200)]
[Mono.Data.Sqlite] Make the fields read-only

7 years ago[Mono.Data.Sqlite] Added iOS specific checks for entry point existence:
Matthew Leibowitz [Wed, 31 Aug 2016 23:25:04 +0000 (01:25 +0200)]
[Mono.Data.Sqlite] Added iOS specific checks for entry point existence:
 - using dlfcn.dlsym to avoid P/Invoke exceptions

7 years ago[logging] Move internals that were landed in public headers by mistake.
Rodrigo Kumpera [Wed, 31 Aug 2016 23:23:21 +0000 (16:23 -0700)]
[logging] Move internals that were landed in public headers by mistake.

7 years ago[runtime] Fix a warning.
Zoltan Varga [Wed, 31 Aug 2016 23:15:34 +0000 (01:15 +0200)]
[runtime] Fix a warning.

7 years ago[profiler] Fix some off-by-ones in header size calculation.
Alex Rønne Petersen [Wed, 31 Aug 2016 23:03:55 +0000 (01:03 +0200)]
[profiler] Fix some off-by-ones in header size calculation.

7 years agoMerge pull request #3493 from alexrp/master
Alex Rønne Petersen [Wed, 31 Aug 2016 23:03:41 +0000 (01:03 +0200)]
Merge pull request #3493 from alexrp/master

Follow-up PR for #3481

7 years ago[corlib] Disable CS0169 for RuntimeStructs.cs.
Zoltan Varga [Wed, 31 Aug 2016 22:59:30 +0000 (00:59 +0200)]
[corlib] Disable CS0169 for RuntimeStructs.cs.

7 years ago[llvm] Error out when using --aot=llvmonly in a runtime compiled without llvm.
Zoltan Varga [Wed, 31 Aug 2016 22:56:52 +0000 (00:56 +0200)]
[llvm] Error out when using --aot=llvmonly in a runtime compiled without llvm.

7 years ago[arm] Make mono_arch_get_call_target () work on direct branches too, previously it...
Zoltan Varga [Wed, 31 Aug 2016 22:41:12 +0000 (00:41 +0200)]
[arm] Make mono_arch_get_call_target () work on direct branches too, previously it returned NULL, which broke the code in handle_thunk () for tail calls.

7 years ago[profiler] Include arguments, architecture, and OS in format header.
Alex Rønne Petersen [Wed, 31 Aug 2016 19:12:54 +0000 (21:12 +0200)]
[profiler] Include arguments, architecture, and OS in format header.

Bumped the major/minor version to 1.0 for this change.

7 years ago[profiler] Fix dump_header () to do fflush () in all non-gzip code paths.
Alex Rønne Petersen [Wed, 31 Aug 2016 19:12:16 +0000 (21:12 +0200)]
[profiler] Fix dump_header () to do fflush () in all non-gzip code paths.

7 years ago[runtime] Export API functions to get arch/os/wordsize strings.
Alex Rønne Petersen [Wed, 31 Aug 2016 19:09:56 +0000 (21:09 +0200)]
[runtime] Export API functions to get arch/os/wordsize strings.

7 years ago[profiler] Remove duplicate #include.
Alex Rønne Petersen [Wed, 31 Aug 2016 17:39:00 +0000 (19:39 +0200)]
[profiler] Remove duplicate #include.

7 years ago[profiler] Update documentation for time fields.
Alex Rønne Petersen [Wed, 31 Aug 2016 11:06:33 +0000 (13:06 +0200)]
[profiler] Update documentation for time fields.

7 years ago[profiler] Document the TYPE_EXCEPTION format.
Alex Rønne Petersen [Wed, 31 Aug 2016 08:26:34 +0000 (10:26 +0200)]
[profiler] Document the TYPE_EXCEPTION format.