Compare commits

..
2523 Commits
Author SHA1 Message Date
Alexander Köplinger 5077205a44 [pdb2mdb] Dispose Cecil AssemblyDefinition on pdb2mdb (#4899)
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=56275

Recent Cecil 0.10 changed to not reading the assembly in memory but
instead reads directly from the underlying stream [0]. This however
means that the file handle is not freed until the AssemblyDefinition
is disposed.

Xamarin.Android is using the pdb2mdb source as part of
Xamarin.Android.Build.Tasks.dll and hit an issue where the file
would be locked inside of VS.

[0] http://cecil.pe/post/149243207656/mono-cecil-010-beta-1
2017-05-18 15:41:08 -04:00
Jo Shields 0d6f6f8f40 Bump version, following 5.0.0.x release 2017-05-18 17:02:34 +01:00
Zoltan Varga d6c24517f4 [runtime] Make RuntimeHelpers:SufficientExecutionStack () a no-op on android for now. Fixes #56240. (#4889) 2017-05-17 12:34:11 -04:00
Rodrigo Kumpera 0f5c24054c Merge pull request #4885 from kumpera/backport_56177
[runtime] Fix pedump. Fixes bug #56177.
2017-05-16 23:48:14 -04:00
Zoltan Varga 3511ffcb2d [runtime] Fix pedump. 2017-05-16 16:20:15 -07:00
Alexander Köplinger 188c235ca4 [xbuild] Add web targets for 15.0 (#4868) (#4876)
(cherry picked from commit 8077ff5da7)
2017-05-16 19:46:57 +02:00
Aleksey Kliger 25ac18a9b7 [sre] Don't leak coop handles in mono_dynimage_encode_typedef_or_ref_full
This function calls mono_class_get_ref_info which allocates a coop handle.
However it is called from an icall that wasn't converted to use coop handles
yet, so nothing was saving/restoring the handle stack mark, and consequently
the handles leak.
2017-05-15 15:03:07 -04:00
Jonathan Chambers d95d7d30fe Use handle macros to avoid leaking result of mono_type_get_object_handle 2017-05-15 15:03:07 -04:00
Marek Safar 82d42e61b1 [runtime] Remove System.ValueTuple from denied assemblies. It's not needed
anymore because we have reference assemblies and it didn't work for mobile tools (e.g. linker)
2017-05-13 16:22:31 +02:00
Marek Safar 4c98dc2006 Revert "[runtime] Remove System.ValueTuple from denied assemblies. It's not needed"
This reverts commit 4dc09dc922.
2017-05-13 10:35:52 +02:00
Marek Safar 4dc09dc922 [runtime] Remove System.ValueTuple from denied assemblies. It's not needed
anymore because we have reference assemblies and it didn't work for mobile tools (e.g. linker)
2017-05-13 10:32:23 +02:00
Martin Baulig d27287c77b [System]: Cherry-pick GZipStream.BeginRead() fix from corefx. Bug #56260. (#4844)
https://github.com/dotnet/corefx/commit/a6c7e23421701870c1eb855eae95e4605e5b04b3.
2017-05-12 15:39:55 -04:00
Zoltan Varga 1298269b88 [arm] Disable the usage of lmf_ir_mono_lmf. Fixes #55087. (#4819) 2017-05-10 10:58:13 -04:00
Martin Baulig 2ce82742e8 Revert "[System]: Fix bug #52508 in HttpListener when doing multiple Https request."
This reverts commit 81da99eb76.
2017-05-08 15:05:33 -04:00
Martin Baulig 81da99eb76 [System]: Fix bug #52508 in HttpListener when doing multiple Https request.
Move the call to SslStream.AuthenticateAsServer() into the constructor because
we don't want to call it again when Init() is called from Close().

(cherry picked from commit 5e08742b5c)
(cherry picked from commit abfb9a00a7)
2017-05-08 15:01:45 -04:00
Martin Baulig 9667aa6485 [System]: Fix default TLS provider. (#4797) 2017-05-05 13:40:11 +02:00
Ankit Jain 1e856f02ff Empty commit to trigger a build on wrench 2017-05-03 19:58:19 -04:00
Vlad Brezae 6ab979c9df [sgen] Fix accidental triggering of degraded mode
We trigger degraded mode when we are unable to properly build the nursery fragments due to excessive nursery pinning. This is done by initializing degraded_mode at the end of a minor. alloc_degraded is used to do allocation to major heap either as part of mature allocation or as part of degraded mode (when we bump the degraded_mode so we can detect when the next minor should be triggered).

When failing to allocate from the nursery after doing a minor (because the other threads might have already consumed the nursery) we need to do a mature allocation (as a fallback) instead of a degraded mode allocation so we don't uselessly enable the mode.
2017-05-03 22:48:54 +03:00
Ankit Jain 02b6c24e5d Empty commit to trigger a build on wrench 2017-05-03 01:59:45 -04:00
Ankit Jain 87ad2c3690 Empty commit to trigger a build on wrench 2017-05-03 00:27:57 -04:00
Ankit Jain 3cde98344e Empty commit to trigger a build on wrench 2017-05-02 21:05:53 -04:00
Aleksey Kliger (λgeek) 1d0445bfc7 Merge pull request #4769 from lambdageek/bug-55681-2017-02
[sre-save] Handle ConstructorBuilder custom attribute constructors
2017-04-28 17:45:37 -04:00
Ankit Jain 1d389ea02c Empty commit to trigger a build on wrench 2017-04-28 11:56:06 -04:00
Aleksey Kliger ad60bf18b7 [sre-save] Handle ConstructorBuilder custom attribute constructors.
The code expected that a custom attribute was specified as a MonoCMethod and
was calling mono_image_create_token().  However that function expects to be
called from the managed S.R.E.ModuleBuilder:GetToken (MemberInfo) which handles
all the builders in managed code.  Consequently mono_image_create_token () was
asserting.

So now we encode the token for a ConstructorBuilder in place.
2017-04-28 11:46:47 -04:00
Aleksey Kliger c20c0b3b81 [sre] Make mono_image_get_methodref_token non-static in sre-internals.h 2017-04-28 11:46:46 -04:00
Aleksey Kliger d33f7f6de9 [test] Regression tests for ConstructorBuilder custom attributes
Regression tests for https://bugzilla.xamarin.com/show_bug.cgi?id=55681
2017-04-28 11:46:45 -04:00
nosami c8c005f137 Bump msbuild for F#. Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55626 2017-04-28 09:28:36 +01:00
Ankit Jain 1aa58e9a46 Empty commit to trigger a build on wrench 2017-04-27 15:01:51 -04:00
Rodrigo Kumpera 5673411799 Merge pull request #4742 from kumpera/2017-02-backport-4682
2017 02 backport 4682
2017-04-26 00:00:11 -04:00
Zoltan Varga 1434f9c879 [jit] Remove some debug spew. 2017-04-25 05:11:19 -04:00
Rodrigo Kumpera 3598a4ab55 [bcl] Check the compact switch for whether cancelation token throws when disposed. 2017-04-24 14:14:20 -07:00
Rodrigo Kumpera 72cdd51acb [corlib] Change SwitchThrowExceptionIfDisposedCancellationTokenSource to false as this is the default 4.6.0 behavior. 2017-04-24 13:26:46 -07:00
Rodrigo Kumpera ea3996571a [bcl] Make our AppContextDefaultValues more compatible with RS and make them non toggle-able on mobile.
We change AppContextSwitches to hardcode values on mobile and use the full stack on desktop.

We still have all strings in AppContextDefaultValues as this reduces the ifdef mess in AppContextSwitches.
It's only used on desktop, where an extra kb is not the end of the world.
2017-04-24 13:26:19 -07:00
Vlad Brezae bdf17346a6 [metadata] Lock around special static fields hash access
If a type is loaded in another thread, the fields hash can get resized, leading to failure.
2017-04-24 23:25:25 +03:00
Rodrigo Kumpera 37f8c76e38 [corlib] Use AppContextSwitches implementation from RS. Fixes #54448
This change makes AppContextSwitches usable which allow backwards incompatible settings to be actually toggled.
2017-04-24 12:41:59 -07:00
Zoltan Varga cda97d6fc1 [cil-stripper] Mark stripped methods as noinline to prevent the JIT from trying to inline them. Fixes #55041. (#4732) 2017-04-24 13:42:55 -04:00
Alexander Köplinger 198ff835e9 [Facades] Use Open.snk for netstandard.dll
We were using the wrong key since dotnet/standard switched to using the new Open key.

(cherry picked from commit 27fd8e5ad8)
2017-04-24 16:28:10 +02:00
Ankit Jain ba317ed4e6 Empty commit to trigger Wrench build 2017-04-22 18:24:41 -04:00
Alexis Christoforides 450d4d7a9e Trigger package CI build 2017-04-21 18:09:33 -04:00
nosami 5da5fa26fb Bump bockbuild for F# jit tracking patch 2017-04-21 18:14:44 +01:00
Alexis Christoforides bee954cff2 Trigger package CI build 2017-04-21 11:10:27 -04:00
Alexander Köplinger 762430b83e [Facades] Allow passing $(EXTRA_LIB_MCS_FLAGS) to netstandard build 2017-04-21 17:01:34 +02:00
Zoltan Varga d717e1b1ea [runtime] Shadow copy the .pdb files as well. Fixes #55095. (#4715) 2017-04-20 09:49:16 -04:00
Ankit Jain 5a3893de5c Empty commit to trigger Wrench build 2017-04-20 08:52:51 -04:00
Alexis Christoforides 6dc5ddd3d9 Trigger package CI build 2017-04-19 12:28:50 -04:00
Marek Safar 6f6232707c Bump cecil 2017-04-19 12:01:31 +02:00
Mikayla Hutchinson 64a055b079 [Sockets] Fix RemoteEndpoint with async+DualMode (#4702) 2017-04-19 11:49:24 +02:00
Ankit Jain 34a69b5e81 Update NuGet.BuildTasks to dev15.1 from usptream (#4706)
* Update nuget-buildtasks from upstream's `dev15.1` branch

dev15.1 branch + fixup import paths

This was prompted by needing to support nuget restore for projects with
`PackageReference`.

* [nuget] Bump reference to NuGet.BuildTasks to pick up a build fix

* Bump nuget-buildtasks
2017-04-18 21:27:50 +02:00
Zoltan Varga b8c96604c5 [jit] Disable handler block trampolines+aot support on ios, it does an async stack walk, and the eh info for llvm compiled methods cannot be loaded in async context currently. Works around #54658. (#4713) 2017-04-18 14:04:30 -04:00
Alexander Kyte 440fff5aee Merge pull request #4681 from alexanderkyte/circular_type_memo
[runtime] Handle circular references in SRE types
2017-04-18 11:24:09 -04:00
Alexander Köplinger 502a6a5e1b Empty commit to trigger Wrench build 2017-04-18 14:26:24 +02:00
Mikayla Hutchinson 02f0d6ee9d Add System.Net.Http 4.3.1 to blacklist 2017-04-18 10:53:49 +02:00
Zoltan Varga 4242008df5 [arm] Fix a gsharedvt assertion which happens with gsharedvt methods with a lot of arguments. Fixes #54976. 2017-04-17 14:49:29 -04:00
Ankit Jain 12f8ebafed Empty commit to force a wrench build 2017-04-14 23:46:43 -04:00
Ludovic Henry e6a3b54b37 [WebConnection] Fix race condition between Close and BeginWrite (#4694) 2017-04-14 15:17:20 -04:00
Martin Baulig b6255d35cd [appletls]: Disable the new keychain code on XI. (#4695) 2017-04-14 14:50:36 -04:00
Alexander Kyte ff7a2e46e7 [runtime] Handle circular references in SRE types
We previously recursed through the entire directed cyclic graph
of the type passed to SRE. When given a (legal) circular type reference,
we encountered stack overflows. This was particularly easy to trigger
with fsharpi and with FAKE.

By creating everything about the type before searching for the parent,
and by defering all type hierarchy establishment until the type must be
surfaced to manage code, we tease out the data dependencies caught up in
the cycle.

Note the bounded lifetime of the unmanaged object hidden in the SRE
module, which acts as a global reference for all types reachable from
the TypeBuilder passed to the runtime through the icall.
2017-04-14 11:28:59 -04:00
David Karlaš b83bdfd396 Merge pull request #4688 from mono/bug55148
Bug 55148 - Debugger checks type which is possibly never used
2017-04-14 09:51:52 +02:00
Alexander Kyte c686827dba [runtime] Test circular references in SRE 2017-04-13 21:00:31 -04:00
Martin Baulig b9b2d23f1a [appletls]: Use SecIdentityCreate() to avoid using the Mac keychain. (#4671) (#4677)
* [appletls]: Use SecIdentityCreate() to avoid using the Mac keychain. (#4671)

Reading Certificates from the Mac Keychain
==========================================

Reading the private key from the keychain is a new feature introduced with
AppleTls on XamMac and iOS. On Desktop Mono, this new feature has several
known issues and it also did not received any testing yet. We go back to the old
way of doing things, which is to explicitly provide an X509Certificate2 with a
private key.

Keychain Dialog Popups
======================

When using Xamarin.Mac or Xamarin.iOS, we try to search the keychain
for the certificate and private key.

On Xamarin.iOS, this is easy because each app has its own keychain.

On Xamarin.Mac, the .app package needs to be trusted via code-sign
to get permission to access the user's keychain. [FIXME: I still have to
research how to actually do that.] Without this, you will get a popup
message each time, asking you whether you want to allow the app to access
the keychain, but you can make these go away by selecting "Trust always".

On Desktop Mono, this is problematic because selecting "Trust always"
give the 'mono' binary (and thus everything you'll ever run with Mono)
permission to retrieve the private key from the keychain.

This code would also trigger constant keychain popup messages,
which could only be suppressed by granting full trust. It also makes it
impossible to run Mono in headless mode.

SecIdentityCreate
=================

To avoid these problems, we are currently using an undocumented API
called SecIdentityRef() to avoid using the Mac keychain whenever a
X509Certificate2 with a private key is used.

On iOS and XamMac, you can still provide the X509Certificate without
a private key - in this case, a keychain search will be performed (and you
may get a popup message on XamMac).
2017-04-13 18:24:43 -04:00
David Karlaš d845201db4 Bug 55148 - Debugger checks type which is possibly never used 2017-04-13 20:34:01 +02:00
Zoltan Varga 10fe0e89c0 [ppdb] Fix a crash if mono_ppdb_get_seq_points () is only passed a 'source_file' argument. 2017-04-12 16:35:05 -04:00
nosami 83ca242114 Bump F# to 4.1.8 2017-04-11 12:27:35 +01:00
nosami 5309190d7d Bump F# to 4.1.8 2017-04-11 09:40:17 +01:00
nosami 98e0d8c486 Bump F# to 4.1.8 2017-04-11 07:10:42 +01:00
nosami a9d142eeb2 Bump F# to 4.1.8 2017-04-11 05:17:59 +01:00
nosami 6149b5d569 Bump F# to 4.1.8 2017-04-10 23:42:56 +01:00
Alexis Christoforides 851b6c7654 Bump for package change 2017-04-07 10:52:36 -04:00
Alexander Köplinger 6462e3fc8e Make sure .sources files end with newline
It confuses the build on Linux otherwise.

(cherry picked from commit 47ca0c0ae8)
2017-04-07 14:55:23 +02:00
Alexander Köplinger 2eced64a82 Bring in the new reference assemblies (#4619) (#4647)
This bumps the reference assemblies submodule so we can install
the new assemblies which are built from source.
(cherry picked from commit feff7ee306)
2017-04-06 01:55:39 +02:00
Vlad Brezae e6c0a86e70 [sgen] Lock around worker start, not only finishing
If we don't take the finished_lock when starting workers, the workers that we started could have already finished the work and switch to non-parallel context before we are even able to signal all of them.
2017-04-05 19:24:14 +03:00
Marek Safar ad88c52d8e Bump cecil 2017-04-05 15:59:52 +02:00
Alexander Köplinger 7e2f9aa7e8 [tests] Fix the mcs-compileall target in runtime/ (#4637)
It is used as the "verify" step on Jenkins/Wrench and I noticed
it didn't run recently.

Looks like it was broken a while ago by 695e8f53ae.
Moving the verifiable_files variable at the top is wrong since
the $$profile variable is only defined inside the for loop and
so we'd get an empty list.

When that was fixed it still didn't work as piping to `echo`
doesn't work. Replaced it with a Makefile solution instead.
(cherry picked from commit 3bfff911dd)
2017-04-05 03:36:37 +02:00
Martin Baulig dda961cf9a [appletls]: Make CFObject.dlsym() private and fix CFBoolean. (#4640) (#4641)
This fixes a native crash when attempting to use appletls.
(cherry picked from commit 989aefce37)
2017-04-04 15:47:22 -04:00
Marek Safar 55a698e07d Bump cecil 2017-04-04 11:54:40 +02:00
Marek Safar 67489264b7 [System.Core] Linker friendly test update 2017-04-04 11:03:45 +02:00
Marek Safar f23dca66a7 Bump cecil 2017-04-04 09:10:22 +02:00
Alexis Christoforides 590080c39e Bump for packaging change 2017-04-03 18:48:21 -04:00
Ankit Jain 452f94286b Empty commit to force a wrench build 2017-04-03 17:12:09 -04:00
Zoltan Varga f342dae059 [jit] Fix a regression caused by 399f6e2425. Avoid a crash if MONO_VERBOS_METHOD is used. 2017-04-03 15:01:50 -04:00
Alexander Köplinger 8fafb67859 Make monolite profile directory versioned (#4631)
If you're building with monolite currently the build system
checks for the existence of mcs/class/lib/monolite and just
uses it in that case.

It becomes a problem when bumping corlib version since if you
pull the update and try to build it'll use the old monolite
and you'll hit the "corlib version not in sync" error.

By making the monolite directory include the version this can
be avoided and everything works out of the box.

Also removed the confusing "You need Mono version 4.8 or better"
message since we actually require a newer version in
basic-profile-check.cs now and keeping them in sync is error prone.
(cherry picked from commit 500765a5d3)
2017-04-01 18:55:53 +02:00
Mikayla Hutchinson 71cc0a16c9 [System.Web] Implement HostingEnvironment.QueueBackgroundWorkItem
From reference source.

This is required for the Azure Functions Host to run unmodified.
2017-03-31 12:11:39 +02:00
Alexander Köplinger 78c2486dcb Fix Windows build
(cherry picked from commit 6f1d247060)
2017-03-31 04:18:10 +02:00
Andi McClure f47f6a1dab Merge pull request #4629 from alexanderkyte/2017-02-env
[runtime] Switch getenv to use heap memory
2017-03-30 22:12:53 -04:00
Alexander Kyte 052d1c2867 [runtime] Switch getenv to use heap memory
Getenv doesn't use heap memory, it uses static memory.
Mono's usage is consistent with a view of getenv memory contents
that are durable and can be stored and manipulated.

In a multithreaded context, getenv calls can race and corrupt
string buffers as they are read. In a single threaded context,
subsequent calls to getenv will lead to overwriting the memory
that pointers to previous calls point to.

In order to bring memory safety back, we duplicate memory and
manage it at each call-site.

Note: this changes the API semantics of g_getenv. This is necessary
because the locking around the getenv buffer is safest when confined to
the function in eglib.
2017-03-30 18:11:48 -04:00
Marek Safar bdc6fd7f03 Bump cecil 2017-03-30 17:42:46 +02:00
Marek Safar 90faddac77 Bump cecil 2017-03-30 17:29:15 +02:00
nosami 809fa3a3a8 Bump F# to 4.1.5 2017-03-30 11:08:07 +01:00
nosami 7ce4e861df Bump F# to 4.1.5 2017-03-30 10:53:29 +01:00
Zoltan Varga 4e11ba5c8b [jit] Disable SIMD support for System.Numerics, its has too many problems. 2017-03-29 19:52:15 -04:00
nosami 9dafa35db6 Bump F# to 4.1.5 2017-03-29 21:16:04 +01:00
Alexis Christoforides 51f9a82ecd Bump for F# upgrade in package 2017-03-29 12:22:50 -04:00
Marek Safar 5a3b524b60 Bump cecil 2017-03-29 10:28:17 +02:00
Zoltan Varga d4df2e7aa9 [bcl] Avoid waiting for events inside a finalizer in Process.WaitForExit () because it can hang if the thread which sets the event is aborted during shutdown. Fixes #53843. (#4609) 2017-03-28 20:38:51 -04:00
Andi McClure 4d40922fde Remove 'experimental' label from full/hybrid AOT in manpage 2017-03-28 14:14:47 -04:00
Andi McClure 082289cc15 Correctly document --aot options in man page
- Ensure all AOT options are both documented and listed in
  alphabetical order in both the manpage and --help line
- Ensure all exceptoins are commented in the aot-compiler.c source
  with "intentionally udnocumented"
2017-03-28 14:14:43 -04:00
Rolf Bjarne Kvinge ef4352cde5 [corlib] Add back X509 support for watchOS.
Otherwise we'd be regressing existing (and working) behavior.
2017-03-28 11:16:55 +02:00
Chris Hamons 9ed0907eea Disable a few x509 tests that fail on older macOS
- Handles https://bugzilla.xamarin.com/show_bug.cgi?id=53958
- https://bugzilla.xamarin.com/show_bug.cgi?id=53689 is filed to turn them
  back on later with a better version check
- SecCertificateCreateWithData handles invalid arguments differently based on
  macOS version
2017-03-28 00:01:55 +02:00
Ludovic Henry 339c5249a7 [process] Disable tests that do not work on mobile (#4598) 2017-03-27 15:21:15 -04:00
Andi McClure df9df437ae Merge pull request #4592 from lambdageek/bug-53890-2017-02
2017-02 [remoting] Pass correct object to invoke of IRemotingTypeInfo.CanCastTo
2017-03-27 15:14:54 -04:00
Ludovic Henry d15985c4af [threadpool] Fix #53481 (2nd attempt) (#4597)
This will leak on shutdown, and it is to prevent https://bugzilla.xamarin.com/show_bug.cgi?id=53481
2017-03-27 13:37:42 -04:00
Ludovic Henry 98a9c23d70 [threadpool] Fix #53481 (#4593) 2017-03-25 23:52:59 -04:00
Aleksey Kliger 4b82d60bbc [remoting] Pass correct object to invoke of IRemotingTypeInfo.CanCastTo
Pass the payload of the coop handle as the 'this' object, not the handle
itself.

Add asserts in ves_icall_Remoting_RealProxy_InternalGetProxyType that
remote_class and the proxy_class are non-NULL.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53890
2017-03-24 18:53:04 -04:00
Ludovic Henry c3452996bd [threadpool-io] Ensure selector thread is running before waiting on it (#4582)
This could result in a unecessary wait on shutdown where the selector thread would have exited, and the finalizer thread would try to dispose a Socket, which would try to remove the socket from the IOSelector. This removal operation would wait on the selector thread to acknowledge the removal, but because the selector thread would have alreday exited, we would wait on an event that would never happen.
2017-03-24 15:57:40 -04:00
Andi McClure 65d1d7cdae Improve "Could not resolve type with token" exception message 2017-03-24 14:43:17 -04:00
Andi McClure d424096c05 Empty commit to kick builders 2017-03-24 12:28:23 -04:00
Vlad Brezae 6d11ff42da [runtime] Don't reset abort exception in invoke wrapper
It leads to missing self aborts on full-aot.
2017-03-24 16:26:15 +02:00
Vlad Brezae 1c7614193f [runtime] Improve debugging of thread interruptions 2017-03-24 16:25:52 +02:00
Vlad Brezae be6441b30d [runtime] Defer async requests during abort protected blocks
We avoid unnecessary checks for each interruption checkpoint.
2017-03-24 16:25:38 +02:00
Vlad Brezae 66f8f1aa53 [runtime] Fix detecting abort at end of abort protected block
If we have a pending abort then we know we will have the thread_state set and the thread_interruption_requested bumped. We used to consume this request and set the MonoError with the exception. The problems with this is that not all callsites handle the passed MonoError and handling it means converting it back to a pending exception anyway. We just leave the interruption request untouched now.

If the cctor self aborts it means that we consumed the abort exception so we do need to call mono_thread_resume_interruption to reactivate it. We need to make sure that we still don't throw a TypeInitializationException if we had a self abort.
2017-03-24 16:25:26 +02:00
Vlad Brezae a5c496fd46 [runtime] Fix missing abort during abort protected regions
When aborting a thread we set the thread's interruption request and we also increment the global interruption request. If we were trying to abort a thread when it is in an abort protected region, it will just set an interruption deferred and not do anything else (in async_abort_critical). When the thread exited the abort protected region, it was missing the abort request since we didn't increment the global interruption request.

Refactor thread_interruption_requested modifications, making sure we always bump it when requesting an interruption and decrease it when we clear an interruption.
2017-03-24 16:25:12 +02:00
Vlad Brezae b92bdff265 [runtime] Rework abort deferring
The problem with previous implementation was that we were not able to account for two pending exceptions at the same time, since when we execute an interruption request we clear all the state and there is no clear way to account for two exceptions at the same time. This means that, if we have a pending abort in a cctor, all exception handling inside the cctor will be broken (for the provided test case we were only throwing the cctor internal exception outside of it).

In order to fix this, we split into two types of interruptions SYNC and ASYNC (in order to separate mainly between abort and pending exceptions). Sync interruptions are interruptions requested by the thread itself (pending exceptions and self aborts) and they are processed as soon as possible. Async interruptions are requested by other threads (abort, interrupt, suspend) and we defer them as we were doing before (we have a deferred interruption if we have an async exception and abort block count is non zero).
2017-03-24 16:24:56 +02:00
Vlad Brezae d27cc030bb [runtime] Fix interruption deferring
We were accidentally clearing the interruption deferred flag when exiting from nested abort protected regions.
2017-03-24 16:24:42 +02:00
Zoltan Varga 5f5f25f58a [bcl] Add a finalizer to MemoryMappedFile. 2017-03-24 09:37:40 -04:00
Martin Baulig 0d0be3e704 [AppleTls]: Use correct definition of SecTrustResult. (#4586)
* [AppleTls]: Use correct definition of `SecTrustResult`.

We need all the values in this enum because `SecTrustResult.Unspecified`
means success - which currently has an integer value of 4, not 0.

* Oops, make it build.

* Don't make it public.

* Revert whitespace change.

(cherry picked from commit 4638c98ba0)
2017-03-23 17:04:31 -04:00
Andi McClure 414feeffc7 Bump version to 5.0.0 2017-03-23 16:23:59 -04:00
Aleksey Kliger 06060e290d [reflection] Set correct reflected type in MonoMethod.get_base_method
It can be the case that we have two different System.MonoMethod objects that both
point to the same native MonoMethod* but have two different reflected types.
(For example if we call derivedType.GetMethod("f") where f is virtual and
derivedType corresponds to a class that did not override a base definition.  In
that case, the MonoMethod* corresponds to the parent type's f method, but the
reflected type is derivedType)

In this case, GetBaseDefinition will return the same MonoMethod* but the
reflected type of the result should be the base type, not the derived type.
2017-03-23 10:32:05 -04:00
Aleksey Kliger 37a593df33 [tests] Additional tests of System.Reflection.MethodInfo.GetBaseDefinition 2017-03-23 10:32:05 -04:00
Aaron Bockover c34e267b4c csharp: support command line arguments for scripts
This adds a command line argument preprocessor that splits command line
arguments into two groups, delimited by the "standard" `--` "stop
processing" argument, or by the `-s` argument which can be used with
Unix shebang syntax (where the path of the file being executed will
be appended to the command line specified on the shebang line).

- anything before `--` or `-s` will be passed to mcs/csharp as usual
- anything after `--` or `-s` will _not_ be processed by mcs/csharp,
  and will be made available in an `Args` builtin, like `csi`

This _finally_ (after almost 10 years) allows `csharp` to be used for
proper script authoring!

Document the new arguments in the man page. Also remove references to
'gsharp' from the man page.
2017-03-23 10:18:47 +01:00
Chris Hamons 582b140f7d AppleTls Support (#4470)
(cherry picked from commit 4d1e45d76a)
2017-03-23 00:10:39 +01:00
Marek Safar 16c75ce329 [xbuild] Copy csc/mcs GC settings to xbuild script 2017-03-22 23:14:39 +01:00
Zoltan Varga 72eabfe658 [ppdb] Avoid asserting on ppdb images without a guid heap. 2017-03-22 12:12:06 +01:00
Marek Safar c8e14aa2ea Bump cecil 2017-03-22 10:12:38 +01:00
Zoltan Varga ffcc54965d [runtime] Fix another typo in get_errno_from_g_file_error (). 2017-03-22 04:21:59 -04:00
Zoltan Varga 2d56aa09df [runtime] Fix a typo causing an assert in get_errno_from_g_file_error (). Fixes #53684. 2017-03-22 04:21:53 -04:00
Marek Safar ac26b00ca4 Fixes build 2017-03-21 01:30:46 +01:00
Marek Safar f77c835faf [System] Fix Process tests on watch 2017-03-20 23:58:18 +01:00
Marek Safar e319507866 [System.Core] Update mobile test 2017-03-20 23:09:47 +01:00
Rodrigo Kumpera cd5d8a9d1b Merge pull request #4553 from kumpera/backport-block-rebind-of-banned-assemblies
Backport of the rebind bans
2017-03-20 16:27:58 -04:00
Zoltan Varga 5eae4df2ee [arm64] Fix the DISABLE_JIT build. 2017-03-20 07:47:00 -04:00
Alexander Köplinger 9ecfd9f23a [WinForms] Fix test build 2017-03-18 03:17:31 +01:00
Zoltan Varga 37de1b5b0d [arm] Fix the DISABLE_JIT build. 2017-03-17 19:05:59 -04:00
Rodrigo Kumpera 68392d0c90 [runtime] Remove debug spew. 2017-03-17 13:31:47 -07:00
Rodrigo Kumpera 715991f427 [runtime] Remove debug leftover and have mono_assembly_is_problematic_version actually work. 2017-03-17 13:31:43 -07:00
Ankit Jain 503f379a22 Handle windows paths in ResXFileRef, for conversion to string case
- convert the path a little earlier to handle the case for conversion to
  string
- Fixes earlier commit a3195b79f6
- And enable the corresponding test
2017-03-17 15:22:32 -04:00
Ankit Jain a36202bfea Handle a file ref, with backslashes, in a .resx, on a non-windows system
File ref of the form:

```xml
  <data name="foo" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..\Resources\foo.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </data>
```
2017-03-17 15:22:23 -04:00
Rodrigo Kumpera bbf84b172e [tools] Dep check the downloads to avoid the mistake fixed by the previous commit. 2017-03-17 11:46:48 -07:00
Rodrigo Kumpera 62a0e75dd8 [runtime] Update the banned version list to include SRDP and SVT. 2017-03-17 11:46:47 -07:00
Rodrigo Kumpera 80e1e3a964 [tools] Update nuget-hash-extractor to spew the new ban table. 2017-03-17 11:46:43 -07:00
Rodrigo Kumpera 303981e264 [runtime] Reject rebinds that target one of the banned assemblies.
The matching is done by name and version. We don't check pubkey or MVID.
2017-03-17 11:45:59 -07:00
Marek Safar 05ff99fc73 [System] Add back empty MonoTouch namespace 2017-03-17 14:09:44 +01:00
Zoltan Varga 24e82a5385 [x86] Disable the usage of mono_lmf on android as a workaround. 2017-03-16 19:06:52 -04:00
Zoltan Varga cd2579f7ce [x86] Remove some incorrect code from method prologs which clobbers the return value. 2017-03-16 18:57:17 -04:00
Alexander Köplinger 760ac86dd9 Move target for creating monolite package to Mono
(cherry picked from commit 622840da56)
2017-03-16 21:49:18 +01:00
Alexander Köplinger 2b14612b1c Include Mono version in corlib version
This makes it possible to version the runtime<->corlib interface
for each version branch independently and fixes the problem
of monolite getting overwritten by changes in different branches
when corlib version is still the same.

We're moving definition of the corlib version into configure.ac
so we can more easily bake the Mono version into it.

(cherry picked from commit c0dd559ee4)
2017-03-16 21:49:12 +01:00
Alexander Köplinger 94ced23f9a Revert "Include Mono version in corlib version"
This reverts commit b600314281.

A better version is coming in the next commit.
2017-03-16 21:46:47 +01:00
Vlad Brezae 66905636c1 [sgen] Fix xmm scanning on mac x86 (#4521)
The MonoContext (which sgen scans) did not have its fpregs populated, even though we were fetching the fpstate.
2017-03-16 01:07:09 +02:00
Jon Purdy 2fb26892dc Fix XMM scanning on Mac x86.
MONO_CONTEXT_GET_CURRENT needed to be updated.
2017-03-16 01:07:04 +02:00
Zoltan Varga 4b62516d17 [simd] Fix some problems exposed by the corefx test suite. (#4531) 2017-03-15 05:13:16 -04:00
Zoltan Varga d78c35091b [jit] Add parameter type checks to the SIMD intrinsics to make sure we are handling the proper methods. Fixes #53278. (#4520) 2017-03-15 05:13:10 -04:00
Zoltan Varga 836896684c [arm64] Fix the saving/restoring of fp regs in exception filters, we were saving/restoring them from the incorrect position in MonoContext.fregs. (#4499) 2017-03-15 05:12:52 -04:00
Alexander Köplinger 9528721b39 [tools] Don't install mdb2ppdb by default (#4526)
(cherry picked from commit 294148d27d)
2017-03-14 19:41:37 +01:00
Andi McClure eff6063589 Move RunningOnUnix symbol outside #if MONO_FEATURE_PROCESS_START in test
Fixes build on Android
2017-03-14 11:17:31 -04:00
Alexander Köplinger b600314281 Include Mono version in corlib version
This makes it possible to version the runtime<->corlib interface
for each version branch independently and fixes the problem
of monolite getting overwritten by changes in different branches
when corlib version is still the same.
2017-03-14 02:19:17 +01:00
Marek Safar a5808f9c71 [corlib] FileStream::Name needs to include fully qualified normalized name. Fixes #53231 2017-03-12 10:00:22 +01:00
Marek Safar 785c82b5d1 [corlib][Mono.Posix] Remove NunitHelpers.cs reference 2017-03-10 14:52:07 -05:00
Rodrigo Kumpera dcc3c6090b Merge pull request #4498 from kumpera/backport-android-fix
[runtime] Make sure we use lower numbered signals on Android.
2017-03-09 14:13:01 -08:00
Rodrigo Kumpera 08f150b1d9 [runtime] Make sure we use lower numbered signals on Android.
Android on 32bits arm shipped broken headers that made sigset_t be 32 bits instead of 64.

This means that it's not possible to use signals whose value are >= 32. The default implementation
uses RT signals when available (and they are on Android). But RT signals don't work as expected
as their value is >= 32.

This fix hardcodes some safe signals on Android and add asserts about their values to avoid regressions.

See 5005c6f3fb for more details.
2017-03-09 13:19:23 -08:00
Zoltan Varga a417e02c2d [arm] Implement aot support for handler block trampolines. 2017-03-09 15:37:32 -05:00
Zoltan Varga 1a1d71d808 [arm64] Implement aot support for handler block trampolines. 2017-03-09 15:37:28 -05:00
Marek Habersack 152e22549b [mkbundle] Encode directory separator character on Windows (#4493)
When storing satellite assemblies, mkbundle prefixes their names with a
directory name derived from the language/locale of the assembly. It uses the
platform's default directory separator character which on Windows defaults to
'\' and that causes problems when building such a bundle on Windows since \ is
an escape sequence prefix inside strings and not escaping it with another \
leads to gcc errors when building the genrated source.

This commit fixes the problem by quoting the directory separator character
properly on Windows.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52845
2017-03-09 10:32:43 -05:00
Ludovic Henry ae2e60c61c [process] Allocate a handle even for non-child processes (#4393) 2017-03-08 21:07:19 -05:00
Ludovic Henry 9f78eca1af [threads] Fix async call in coop (#4423)
We would observe crashes like the following:

```
 * Assertion at mono-threads.c:1009, condition `mono_thread_info_run_state (info) == STATE_ASYNC_SUSPENDED' not met

 Debug info from gdb:

 [New LWP 26793]
 [New LWP 26792]
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 0x00002b0ff3481ee9 in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0
   Id   Target Id         Frame
   3    Thread 0x2b0ff3e6c700 (LWP 26792) "SGen worker" 0x00002b0ff347e414 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
   2    Thread 0x2b0ff633e700 (LWP 26793) "Finalizer" 0x00002b0ff347e414 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
 * 1    Thread 0x2b0ff2b67c40 (LWP 26780) "mono" 0x00002b0ff3481ee9 in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0

 Thread 3 (Thread 0x2b0ff3e6c700 (LWP 26792)):
 #0  0x00002b0ff347e414 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
 #1  0x0000000000661bdf in mono_os_cond_wait (mutex=0x9dee40 <lock>, cond=0x9dee00 <work_cond>) at ../../mono/utils/mono-os-mutex.h:146
 #2  thread_func (thread_data=0x2b0ff2bcb008) at sgen-thread-pool.c:129
 #3  0x00002b0ff347a182 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
 #4  0x00002b0ff39a130d in clone () from /lib/x86_64-linux-gnu/libc.so.6

 Thread 2 (Thread 0x2b0ff633e700 (LWP 26793)):
 #0  0x00002b0ff347e414 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
 #1  0x00000000005caff3 in mono_os_cond_wait (mutex=<optimized out>, cond=<optimized out>) at ../../mono/utils/mono-os-mutex.h:146
 #2  mono_coop_cond_wait (mutex=<optimized out>, cond=<optimized out>) at ../../mono/utils/mono-coop-mutex.h:87
 #3  mono_threadpool_io_remove_socket (fd=134239440) at threadpool-io.c:628
 #4  0x00000000005ae4f4 in ves_icall_System_Net_Sockets_Socket_Close_internal (sock=42, werror=<optimized out>) at w32socket.c:708
 #5  0x0000000041e8101f in ?? ()
 #6  0x00002b1014abe070 in ?? ()
 #7  0x0000000001615860 in ?? ()
 #8  0x0000000001615860 in ?? ()
 #9  0x0000000000000000 in ?? ()

 Thread 1 (Thread 0x2b0ff2b67c40 (LWP 26780)):
 #0  0x00002b0ff3481ee9 in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0
 #1  0x00000000004ac5e6 in mono_handle_native_crash (signal=<optimized out>, ctx=<optimized out>, info=<optimized out>) at mini-exceptions.c:2557
 #2  <signal handler called>
 #3  0x00002b0ff38dcf79 in raise () from /lib/x86_64-linux-gnu/libc.so.6
 #4  0x00002b0ff38e0388 in abort () from /lib/x86_64-linux-gnu/libc.so.6
 #5  0x000000000066b459 in mono_log_write_logfile (log_domain=<optimized out>, level=<optimized out>, hdr=<optimized out>, message=<optimized out>) at mono-log-common.c:137
 #6  0x00000000006805e0 in monoeg_g_logv (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=<optimized out>, args=args@entry=0x7ffc7324ea78) at goutput.c:115
 #7  0x0000000000680736 in monoeg_assertion_message (format=<optimized out>) at goutput.c:135
 #8  0x00000000006759b8 in mono_thread_info_setup_async_call (info=info@entry=0x2b0ff80008c0, target_func=target_func@entry=0x5bac20 <suspend_for_shutdown_async_call>, user_data=user_data@entry=0x0) at mono-threads.c:1009
 #9  0x00000000005bad50 in suspend_for_shutdown_critical (info=info@entry=0x2b0ff80008c0, unused=unused@entry=0x0) at threads.c:5019
 #10 0x00000000006763ae in mono_thread_info_safe_suspend_and_run (id=47347555100416, interrupt_kernel=interrupt_kernel@entry=0, callback=callback@entry=0x5bad40 <suspend_for_shutdown_critical>, user_data=user_data@entry=0x0) at mono-threads.c:979
 #11 0x00000000005c2e71 in mono_thread_internal_suspend_for_shutdown (thread=<optimized out>) at threads.c:5028
 #12 0x00000000005e9100 in mono_gc_cleanup () at gc.c:1015
 #13 0x00000000005e108e in mono_runtime_cleanup (domain=domain@entry=0x1615860) at appdomain.c:423
 #14 0x00000000004228cb in mini_cleanup (domain=0x1615860) at mini-runtime.c:4111
 #15 0x000000000047b99f in mono_main (argc=10, argv=<optimized out>) at driver.c:2167
 #16 0x00000000004200db in mono_main_with_options (argv=0x7ffc7324ef68, argc=10) at main.c:45
 #17 main (argc=10, argv=0x7ffc7324ef68) at main.c:338

 =================================================================
 Got a SIGABRT while executing native code. This usually indicates
 a fatal error in the mono runtime or one of the native libraries
 used by your application.
 =================================================================
```
2017-03-08 21:07:19 -05:00
Ludovic Henry 8cbef676c3 [threads] Ensure we have balanced appdomain push/pop when attaching the thread on shutdown (#4416) 2017-03-08 21:07:19 -05:00
Ludovic Henry 724c7df79c [threadpool] Do not swallow exception in RegisterWaitForSingleObject callback (#4408) 2017-03-08 21:07:19 -05:00
Ludovic Henry 15e53eba9b [socket] Fix bad parameter passed to select (#4390)
If fd is equals to FD_SETSIZE, then we pass (FD_SETSIZE + 1) as first parameter to select, making it return EINVAL.
2017-03-08 21:07:19 -05:00
Ludovic Henry 7323343a64 [socket] Fix race on SocketAsyncResult (#4389)
It might be possible that the callback modifies the current SocketAsyncResult via the Init method. We observe it with AcceptAsync with a ReceiveAsync in the callback.
2017-03-08 21:07:19 -05:00
Ludovic Henry c69dae3bcb [finalizer] Suspend finalizer thread on after shutdown timeout (#4363)
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=52429
2017-03-08 21:07:19 -05:00
Ludovic Henry 661495317c [threads] Make OSEvent alertable to fix bug #51653 (#4347) 2017-03-08 21:07:19 -05:00
Ludovic Henry 2415374524 [threads] Allow resetting the name of a threadpool thread (#4350)
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=47221
2017-03-08 21:07:19 -05:00
Zoltan Varga fa1030da6f [offsets-tool] Remove dependencies on android directory layout by adding a --targetdir=dir argument argument which points to the mono build directory corresponding to the target abi. Only allow one --abi= argument on android. (#4487) 2017-03-08 12:05:20 -05:00
Rodrigo Kumpera a17a84caee [loader] When loading the parent of a GTD fails. We must disable gclass recording for it.
mono_class_create_from_typedef: When loading a GTD, we track what ginsts' of it were loaded in the meanwhile
so we can fix some information that will be wrong (such as if it's a VT or not).

Were not stopping the recording when a GTD type failed to load its parent. This would result in *A LOT* of ginsts
being captured and would cause issues during domain unload.
2017-03-07 15:01:10 -08:00
Zoltan Varga 44560f1e67 [arm64] Fix the passing of small arguments on the stack in the gsharedvt trampoline, the calculation of their stack offset was incorrect in two places. Fixes #52866. 2017-03-07 01:54:09 -05:00
Zoltan Varga c52c4bd713 [jit] Remove an #ifdef ENABLE_LLVM from mini-os.h, the cross-compile genmdesc.pl can't handle it. 2017-03-06 15:56:21 -05:00
Zoltan Varga c8ca5929c7 [linker] Update the mscorlib descriptor with missing generic interfaces. 2017-03-06 15:56:21 -05:00
Zoltan Varga d60a36ee80 [ssa] Fix an assertion if the buffer used to keep renaming history gets full. 2017-03-06 15:56:21 -05:00
Zoltan Varga cee57b3c78 [runtime] Fix the reflected type of Delegate.Method if the method is an inherited virtual method. Fixes #39444. (#4353) 2017-03-06 15:56:21 -05:00
Zoltan Varga fe75a6ee2f [lldb] Avoid a crash with the mono_tramp_info_register () call in load_aot_module (). 2017-03-06 15:56:21 -05:00
Zoltan Varga 65956a952d [arm] Use TARGET_IOS instead of __APPLE__ so we don't use the ios abi when cross compiling from osx to android. 2017-03-06 15:56:21 -05:00
Andi McClure b6b7ce3eff Bump mono to 4.9.3 to force builders to pick up csc fixes 2017-03-06 13:06:31 -05:00
Alexander Köplinger e6409c5953 [cert-sync] Don't import into BTLS store if BTLS is not available (#4475)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53015
(cherry picked from commit fb4d198131)
2017-03-06 12:07:20 +01:00
Zoltan Varga 2cc99a1681 [jit] Fix an assert in mono_unwind_ops_encode_full () caused by an off-by-one error. Fixes #53066. 2017-03-06 02:33:17 -05:00
Zoltan Varga d8b4f5d2ab [runtime] Add fastpaths to the stelem wrappers for the case when the array element type and the value type are the same. (#4427) 2017-03-06 02:33:09 -05:00
Zoltan Varga 0c315e92b0 [runtime] Speed up mono_icall_start()/mono_icall_end() a bit by using inline versions of the MonoError functions. (#4424) 2017-03-06 02:33:09 -05:00
Zoltan Varga 5d7e4c9cf6 [runtime] Use mono_debug_method_lookup_location () instead of mono_debug_symfile_lookup_location (), the latter doesn't support portable pdb files. Use mono_debug_free_source_location () for freeing. Fixes #52899. (#4457)
(cherry picked from commit 4d7109cceb)
2017-03-05 00:15:26 +01:00
Vincent Povirk 23fb3fe800 [metadata] Fix a possible crash when looking up a p/invoke function. (#4471)
It's possible for two threads to modify the same MonoMethodPInvoke.addr
in mono_lookup_pinvoke_call, with one thread setting it to NULL inside the
loop, and the other thread having completed the loop and expecting it to
be non-NULL.

Use an intermediate variable to prevent addr becoming non-NULL.
2017-03-04 16:55:01 -05:00
Rodrigo Kumpera 679777b17b Merge pull request #4464 from kumpera/backport-4454-2017-02
Backport of #4454 to 2017-02
2017-03-02 21:10:14 -05:00
Zoltan Varga f0c0314e4d [runtime] Fix an infinite loop in the runtime class init code. (#4455)
The following can happen:
* Thread T1 starts initialization of C1
* Thread T2 starts initialization of C2
* T2 starts initialization of C1, it gets blocked on T1.
* T1 finishes initializing C1.
* T1 starts initialization of C3.
* T1 starts initialization of C2. It sees that T2 is
  still blocked on T1, but its not actually blocked, since
  C1 is finished. Still, we record that T1 is blocked.
* T3 starts initialization of C2, it gets into an infinite
  loop in the while loop, since the blocked_thread_hash
  now indicates that T1 and T2 are blocked on each other.

The solution is to not mark a thread as blocked, if its waiting
for a thread which is waiting on a finished lock. Fixes hangs
when running csc.
2017-03-02 17:02:28 -05:00
Rodrigo Kumpera 10ee1bafc9 [loader] Revert allowing SIOC 4.3. This is fine for now as we support LoadFrom as a work-around. 2017-03-02 11:48:07 -08:00
Rodrigo Kumpera bceca5b359 [loader] Pass LoadFrom down to image loading so we can make decisions based on that. 2017-03-02 11:47:29 -08:00
Rodrigo Kumpera 4560d3c57f Pass LoadFrom info down to assembly loading. 2017-03-02 11:47:29 -08:00
Rodrigo Kumpera 1c41089315 [runtime] SIOC 4.3.0 has a managed impl that works under mono. Don't ignore it. 2017-03-02 11:47:28 -08:00
Rodrigo Kumpera cb922c0fa6 Merge pull request #4442 from kumpera/fix-assembly-remapping-2017-02
Backport of #4440
2017-02-28 12:23:08 -08:00
Rodrigo Kumpera fe9c5ebe97 [runtime] Fix assembly remapping by using a hashtable. Fixes #52846 and #52743
In multiple occasions we had bugs due to framework_assemblies not being correctly sorted.

Instead of just fixing the ordering again, I'm moving it a hashtable so future generations won't have to fix this for System.SpaceTravel.dll.
2017-02-27 17:09:29 -08:00
Andi McClure 51403d818e Fix monodis
monodis was not calling the mono_tls_init_runtime_keys function, which
was causing it to crash the first time it attempted to access the
current domain (ie almost immediately).
2017-02-27 15:54:05 -05:00
Rodrigo Kumpera 459d47bb9b [jit] Fix LMF codegen on android arm64.
Android doesn't have fast tls either, so we must use the jit_tls variant.
2017-02-27 12:47:55 -08:00
Vlad Brezae 63dde6cce0 [threads] Don't ignore abort requests in abort protected blocks
Either interrupt or set the interrupt_deferred flag, so the thread can handle the request later in the future. Otherwise we are left with a thread that has an AbortRequested set on its state that it is never processed and future abort requests are ignored due to the presence of this flag.
2017-02-27 22:07:04 +02:00
Vlad Brezae 640d5a03e4 [sgen] Throw OOM also from the managed allocator
Allocation functions from object.c correctly throw OOM when sgen allocation returns NULL. When allocating with the managed allocator we invoke sgen directly (as a fallback) and we didn't handle the NULL return case.

Fixes #52437
2017-02-24 22:19:18 +02:00
Vlad Brezae 19b866517a [sgen] Rename confusing variable 2017-02-24 22:19:16 +02:00
Marek Safar 8953abc7d3 Fixes windows po/ build
(cherry picked from commit 8e7cae914b)
2017-02-24 16:35:45 +01:00
Marek Safar b78f4f6e5f [Mono.Data.Sqlite] Change default datetime convert format to excluded datetime kind. Fixes #46929 2017-02-24 16:19:49 +01:00
Alexander Köplinger 9bd54596bb Force LF line endings for .sources and Makefiles too
This should fix the Windows build.

(cherry picked from commit a7bed9a7fc)
2017-02-24 11:20:34 +01:00
Alexander Köplinger 74d31d88ef Fix Windows build due to line ending changes in sed
The recent sed update in cygwin [1] changed the way sed handles
carriage returns. This meant that every .in file we processed
still contained CR, which doesn't work for .sh files.

Force LF line endings for those files (and also other shell scripts).

[1] https://cygwin.com/ml/cygwin-announce/2017-02/msg00036.html

(cherry picked from commit 8d0e921d8b)
2017-02-24 11:20:26 +01:00
Zoltan Varga d66823b37b [runtime] Avoid holding the init lock while calling the cctor in mono_runtime_class_init (), its not needed any more. (#4361) 2017-02-23 17:57:03 -05:00
Zoltan Varga f01f6476b5 [arm] Fix the passing of structs with 8 byte alignment with llvm on armeabi, they need to be passed as an int64 array to let llvm know that it might need to insert a dummy argument so they are passed in a even register pair. Fixes #52548. 2017-02-22 15:09:23 -05:00
Zoltan Varga bcf75c0b8c [runtime] Use TARGET_WIN32 instead of HOST_WIN32 when setting calling conventions, so cross compilers running on windows do the right thing. (#4412) 2017-02-22 12:49:27 -05:00
Zoltan Varga 84b7173fcb [runtime] Fix mono_bitset_count () so it works on win64 as well. (#4413) 2017-02-22 12:48:11 -05:00
Marek Safar 2b673c3022 [System] Test fix for watch 2017-02-22 10:39:27 +01:00
Andi McClure ff9ce3b7ff Bump version number to 4.9.2 because of msbuild/xbuild compatibility changes. 2017-02-21 14:07:19 -05:00
Marek Safar 97056ba86a Bump cecil 2017-02-21 17:41:09 +01:00
Zoltan Varga ceaa04d0b8 [jit] Fix support for gsharedvt constrained calls which return enums. Fixes #52600. 2017-02-18 16:37:59 -05:00
Ankit Jain 87a92c89c2 [xbuild] Show the deprecation notice with logo, and so hide it with
`/nologo`. It is not controlled by logging levels now.
But we also show the deprecation notice if we couldn't parse
the arguments, which would be more likely to be noticed by a user.
2017-02-17 13:22:47 -05:00
Andi McClure de1a4a0229 Back out 6fbe05fe9, we will decide on version number format changes later 2017-02-17 11:58:00 -05:00
Ankit Jain 2f1bfa9788 [xbuild] Don't show the deprecation notice for minimal or quiet logging
.. levels. This is useful for scripts that might depend on minimal/quiet
levels, to parse output of a specific target execution, eg.
Xamarin.Android .
2017-02-16 17:08:06 -05:00
Ludovic Henry 6caddcd9d1 [socket] Add EPROTOTYPE error case (#4391)
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=52549
2017-02-16 14:07:49 +01:00
Rodrigo Kumpera 8a3e2b11e1 Merge pull request #4376 from kumpera/test-hardneing
Disable some flaky tests and harden another one.
2017-02-16 11:06:26 +01:00
Alexander Köplinger e2fa30543b [System] Fix failing ClientWebSocket test
The wrong part of the ifdef was deleted in a4df7d4923,
we need to InvalidOperationException instead of PNSE.

(cherry picked from commit ed685e8b76)
2017-02-16 03:57:33 +01:00
Marek Safar 8a113e88b3 [System] Fixes failing tests on mobile 2017-02-16 00:04:52 +01:00
Marek Safar d8e522c16c Revert "[Facades] Update netstandard facade to latest"
This reverts commit 171ba52158.
2017-02-15 17:45:50 +01:00
Alexander Köplinger e476b1ac33 [man] Remove outdated version numbers (#4382)
We haven't been consistent in keeping those version numbers
up to date as we bump Mono's version so it's less confusing
to not show them in the manual pages.

`mono --version` is and has been the source of truth.
(cherry picked from commit b117a53b8f)
2017-02-15 17:01:54 +01:00
Marek Safar 6fbe05fe9a Update version number 2017-02-15 13:19:47 +01:00
Marek Safar 440cd5475c [Mono.CodeContracts] Read debug symbols only when they are going to be used 2017-02-15 13:05:21 +01:00
Marek Safar dc34ec682c Cecil update 2017-02-15 13:04:49 +01:00
Alexander Köplinger 9deeb95816 [System.ServiceModel.Internals] Use the mobile sources for testing_aot_full and orbis profile (#4378)
(cherry picked from commit 17c5a00c59)
2017-02-14 22:14:10 +01:00
Alexander Köplinger 171ba52158 [Facades] Update netstandard facade to latest
Includes latest changes from dotnet/standard repo.

(cherry picked from commit 4e54ac3d4b)
2017-02-14 03:43:30 +01:00
Marek Safar 4393b68452 [System.Net.Http] Allow re-sending StreamContent. Fixes #52448 2017-02-13 22:39:10 +01:00
Zoltan Varga 76da2e9ed8 [jit] Disable llvm for overly complex methods, to avoid compilation slowdowns. Fixes #52475. 2017-02-13 14:46:37 -05:00
Marek Safar 5006bcc901 [System] Fixes failing tests on watch 2017-02-13 12:50:48 +01:00
Martin Baulig 50c26943d4 [btls]: Partial merge of #4318 and #4337. (#4345)
* [btls]: Partial merge of #4318 and #4337.

Partially merged commits 4ecb683 and 4c6c6f0 from master without adding
'MonoTlsSettings.CertificateSearchPath'.

* Add MonoBtlsProvider.SetupCertificateStore(MonoBtlsX509Store,MonoTlsSettings,bool)
  overload, which adds 'settings.TrustAnchors' if applicable.

* MonoBtlsContext: call it instead of having our own custom implementation.

* [btls]: Fix MonoBtlsX509Store.cs.AddTrustedRoots(). (#4340)

This internal method is only called from Mono.Btls.Interface.BtlsStore
and used by the web-tests.

Call MonoBtlsProvider.SetupCertificateStore(store) to make its
behavior consistent with the internal implementation.
(cherry picked from commit 8b18c84289)

* [btls]: Partial merge of #4318, #4337 and #4340.

Partially merged commits 4ecb683, 4c6c6f0 and 8b18c84 from master
(without adding 'MonoTlsSettings.CertificateSearchPath').

* Add MonoBtlsProvider.SetupCertificateStore(MonoBtlsX509Store,MonoTlsSettings,bool)
  overload, which adds 'settings.TrustAnchors' if applicable.

* MonoBtlsContext: call it instead of having our own custom implementation.

* Fix MonoBtlsX509Store.cs.AddTrustedRoots(). (#4340)

  This internal method is only called from Mono.Btls.Interface.BtlsStore
  and used by the web-tests. Call MonoBtlsProvider.SetupCertificateStore(store)
  to make its behavior consistent with the internal implementation.
2017-02-13 11:25:02 +01:00
Marek Safar 5596255efe Bump roslyn to rc4 2017-02-13 09:24:18 +01:00
Alexander Köplinger a41069ad76 [tools] Install pdb files for security tools (#4364)
We don't use the global executable.make install logic for the tools
in security so we missed updating this to copy .pdb's as well.
(cherry picked from commit b17ddc5c15)
2017-02-10 20:56:38 +01:00
Alexander Köplinger f70bda0c06 [Mono.Security] Check NewLocalMachinePath too for deciding if store is machine store (#4357)
The code in X509Store only checked the legacy X509StoreManager.LocalMachinePath
when deciding whether CspProviderFlags.UseMachineKeyStore should be
set when dealing with private keys.

However, with BTLS we now also have X509StoreManager.NewLocalMachinePath.

This caused an issue/regression in the recent 4.8 builds that
started importing into the BTLS cert store when using cert-sync:
https://github.com/mono/mono/commit/968c60a0f32c7a4c92568c3feda7503f99b98c94

Because cert-sync is ran at package installation time as root
on Linux we would erroneously not pass UseMachineKeyStore (because
the paths between legacy and BTLS store are different), which in turn
causes KeyPairPersistence to look into the user directory, e.g.
~/.config/.mono/keypairs. Since on a clean machine that directory
hierarchy doesn't exist, it goes on and creates it -> we now have
the ~/.config directory owned by root which means a normal user
application can't write to it anymore (like NuGet) and crashes.

The fix is to check for the BTLS store path as well so KeyPairPersistence
uses the machine path and ~/.config is not created on package installation.

See e.g. https://github.com/travis-ci/travis-ci/issues/7271
(cherry picked from commit 12b44a0e94)
2017-02-09 18:31:30 +01:00
Alexander Köplinger 3ed19e6630 [ci] Temporarily use http url to download server until cert is fixed
(cherry picked from commit 9281d4a7e6)
2017-02-09 18:29:33 +01:00
Ludovic Henry f404e04d6d [process] Fix Process.GetProcessesByName (#4351)
To get a process by name, we need to access the other process ProcessName, but it can fails on non-win32 platforms. This failure wouldn't be caught in the referencesource implementation trigerring this bug.

The exception we would observe would be:
 Unhandled Exception:
 System.InvalidOperationException: Process has exited, so the requested information is not available.
   at System.Diagnostics.Process.get_ProcessName () [0x0002d] in /Users/alexander/dev/mono/mcs/class/System/System.Diagnostics/Process.cs:336
   at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ProcessName ()
   at Program.Main (System.String[] args) [0x0003b] in <9c838a66cdc44c81b38c974edcc9c029>:0
 [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Process has exited, so the requested information is not available.
   at System.Diagnostics.Process.get_ProcessName () [0x0002d] in /Users/alexander/dev/mono/mcs/class/System/System.Diagnostics/Process.cs:336
   at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ProcessName ()
   at Program.Main (System.String[] args) [0x0003b] in <9c838a66cdc44c81b38c974edcc9c029>:0

Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=52345
2017-02-09 11:45:10 +01:00
Marek Safar 6019eeb483 [xbuild] Add deprecation warning 2017-02-07 23:29:40 +01:00
Martin Baulig e37d7a2ce9 [btls]: MonoBtlsError.GetError(out string, out int) returns 0, not null. (#4338)
(cherry picked from commit d3aa5f9504)
2017-02-07 22:28:16 +01:00
Zoltan Varga 2440b14865 [runtime] Add a workaround for #50529 by locking around pthread_create()/pthread_join () calls so they can't happen at the same time. (#4332) 2017-02-07 16:14:32 -05:00
Ludovic Henry 4f4cb919cf [threadpool] Fix hang on threadpool cleanup (#4331)
Waiting for the threadpool threads to exit on shutdown triggers a hand. The simplest solution is to not wait for them, and let the general runtime shutdown mechanism wait for them (see `mono_thread_manage`).
2017-02-07 15:13:12 -05:00
Marek Safar 42a5eeb95a Bump cecil 2017-02-07 17:53:26 +01:00
Marek Safar b65e5ee577 [corlib] Update TimeZoneTest ios simulator check 2017-02-07 10:23:02 +01:00
Vlad Brezae 672282c892 [sgen] Don't assert when suspending detaching thread (#4292)
This means that the thread will be part of the stw (not skipped), so if the stack pointer is not between the expected ranges we dont scan the thread. In other parts of the runtime, suspending here is handled by the suspend_can_continue flag.
2017-02-06 21:25:22 +02:00
Alexander Köplinger 52a81ab58d [tests] Fix duplicate variable setting in assemblyresolve
Probably bad merge conflict resolution in 5d054b1852
2017-02-06 12:32:48 +01:00
Alexander Kyte 5d054b1852 [runtime] Get mono/tests running on bitcode/arm (#4233) 2017-02-06 01:12:54 -05:00
Alexander Köplinger d9360c5b6c [acceptance-tests] Baseline failing coreclr tests for now (#4325)
We can look into them when we have time, but for now let's
just ensure no new failures sneak in.
2017-02-04 16:50:01 +01:00
Alexander Köplinger d7be7eb748 [xbuild] Add .NET 4.6.2 entries and frameworklist.xml (#4326) 2017-02-04 16:48:56 +01:00
Jon Purdy 7f1b9c9e86 [runtime] Require C# namespace to be quoted.
In GENERATE_GET_CLASS_WITH_CACHE and GENERATE_TRY_GET_CLASS_WITH_CACHE,
we were just quoting the namespace immediately.
2017-02-03 13:33:47 -08:00
Jon Purdy 7de7a8d09a [runtime] Avoid 'strncpy'.
Its null-padding behavior can be surprising.
2017-02-03 13:33:47 -08:00
Jon Purdy f138f07d16 [runtime] Use double-underscored attributes.
E.g., 'aligned' => '__aligned__'. We use the following attributes:

 * aligned
 * always_inline
 * cold
 * deprecated
 * error
 * format
 * naked
 * noinline
 * packed
 * printf
 * tls_model
 * unavailable
 * used
 * visibility
 * warn_unused_result
2017-02-03 13:33:47 -08:00
Jon Purdy cf55649fc0 [runtime] Remove redundant #includes. 2017-02-03 13:33:47 -08:00
Jon Purdy e103b436e7 [runtime] Avoid invalid characters.
There were some unquoted backticks and form-feed characters.
2017-02-03 13:33:47 -08:00
vkargov 87c9f31526 [runtime] Use ins->prev in mono_analyze_liveness. (#4296)
* [runtime] Add the missing MONO_BB_FOR_EACH_INS_REVERSE macro.

* [runtime] Use ins->prev instead of building reverse ins array in mono_analyze_liveness.
2017-02-03 15:52:56 -05:00
Zoltan Varga aacea00096 [runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an additional table which contains the token sizes for the metadata tables referenced by the ppdb tables. (#4321) 2017-02-03 07:43:14 -05:00
Ankit Jain 5e27431a9a [xbuild] Disable pre-2.0 csc hack to use /debug:portable (#4322)
This hack should not be required now, as roslyn emits the correct debug
files with /debug:full and /debug:pdbonly, on non-windows platform.

This manifested as https://bugzilla.xamarin.com/show_bug.cgi?id=50710 ,
where the Xamarin.Mac targets override `$(CscToolExe)` to use `mcs`, but
xbuild's `ManagedCompiler` *always* converts `DebugType={full,pdbonly}`
to `/debug:portable`, which would cause mcs to complain.
2017-02-03 13:19:05 +01:00
Zoltan Varga 227eadaee6 [runtime] Factor out some code from mono_metadata_compute_size () to make it easier to add ppdb support later. NFC. (#4320) 2017-02-02 14:30:06 -05:00
Vlad Brezae 87f6f25a21 Merge pull request #4306 from BrzVlad/fix-roslyn-ppc
[ppc] Save all the registers in the context
2017-02-02 21:11:33 +02:00
Vlad Brezae dc527ab341 Revert "Default powerpc to build with mcs (#4313)"
This reverts commit 6a2a23dceb.
2017-02-02 21:09:20 +02:00
Vlad Brezae 7a8be4d2d0 [ppc] Save all the registers in the context
When suspending a thread, we were only saving the callee save registers in the context. Therefore SGen was failing to pin some objects. In order to store the registers in order, a code refactoring was necessary.
2017-02-02 21:09:18 +02:00
Martin Baulig bb569d1653 [btls]: Make the 'MonoBtlsX509LookupMonoCollection' logic consistent with the native implementation. (#4319) 2017-02-02 18:48:20 +01:00
Martin Baulig 01288a7550 [BTLS]: Improve error handling. (#4317)
* Add new native mono_btls_error_peek_error_line() and
  mono_btls_error_get_error_line().

* Add `MonoBtlsError.PeekError(out string, out int)` and
  `MonoBtlsError.GetError(out string, out int)` overloads.

* MonoBtlsContext.GetException(): use it here.
2017-02-02 18:43:02 +01:00
Martin Baulig e4b4e981d6 Merge pull request #4316 from mono/work-51562
[btls]: Allow importing a null `byte[]`.  Fixes #51562.
2017-02-02 12:06:23 +01:00
Niklas Therning 63df1eab87 Merge pull request #4312 from ntherning/winaot-tests-on-jenkins
Adds CI scripts to run the test suites under the winaot profile
2017-02-02 02:11:36 -05:00
Zoltan Varga 3b543687c6 Revert "[runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an additional table which contains the token sizes for the metadata tables referenced by the ppdb tables. (#4304)"
This reverts commit c35cdfa2de.

Revert this as it causes test failures.
2017-02-01 15:36:40 -05:00
Jonathan Chambers 1de3239d7b Send assembly and type load events in the domain that contains them rather than the root domain in the attach/defer case. (#4314) 2017-02-01 14:58:23 -05:00
Martin Baulig 8ef0666048 [btls]: Allow importing a null byte[]. Fixes #51562. 2017-02-01 19:36:33 +01:00
Zoltan Varga c35cdfa2de [runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an additional table which contains the token sizes for the metadata tables referenced by the ppdb tables. (#4304) 2017-02-01 13:05:22 -05:00
Zoltan Varga 644a586355 [x86] Fix a race in the single stepping seq point assembly, we were doing a null check using cmp_membase, following by a call_membase, but the value could change between the two instructions, leading to a nullref. Fixes #50117. (#4308) 2017-02-01 12:56:34 -05:00
Zoltan Varga 3ae33568bd [sdb] Add a Domain property to AssemblyMirror. (#4309) 2017-02-01 12:45:38 -05:00
Zoltan Varga 66df37380c [runtime] Update comments in mono-debug-debugger.h. 2017-02-01 12:42:56 -05:00
monojenkins e68ef38c18 [msvc] Update csproj files (#4315) 2017-02-01 17:40:17 +01:00
Alexander Köplinger 6a2a23dceb Default powerpc to build with mcs (#4313)
It crashes during build with roslyn on Jenkins.
2017-02-01 16:47:01 +01:00
Egor Bogatov c92b9b30df [System.Data] referencesource -> corefx (#4299)
* [System.Data] SQLTypes from corefx

* [System.Data] DataStorage + subclasses from corefx

* [System.Data] remove dead referencesource.sources references

* [System.Data] Generate SR.cs from corefx using resx2sr tool

* [System.Data] move common references to corefx.common.sources

* [System.Data] remove /ReferenceSources/SR.cs

* [System.Data] remove duplicates in corefx.common.sources (accidentally were added)

* [System.Data] simple types & enums from corefx

* [System.Data] referencesource -> corefx

* [System.Data] Referencesource -> corefx

* [System.Data] re-order (sort) files in corefx.common.sources, DbCommandBuilder from corefx

* [System.Data] Referencesource -> corefx

* [System.Data] DataRow, DataSet, Filters, etc from corefx. XmlDataDocument is internal in corefx but used to be public in mono.

* [System.Data] rollback referencesource changes

* [System.Data] Wrap /referencesource/DataSet.cs with #ifdef COREFX in order to include missing DataSetSchemaImporterExtension and ignore DataSet
2017-02-01 15:49:21 +01:00
Alexander Köplinger 492ef28c44 [System] Disable SocketTest.ConnectedProperty on testing_aot_full for now
It failed since we introduced this profile and it was disabled
on Mac a few years ago. A bug is filed to investigate why it only
fails on FullAOT on Linux but works on non-FullAOT builds.

Disable the test for now to get closer to a green build.

https://bugzilla.xamarin.com/show_bug.cgi?id=52157
2017-02-01 15:20:11 +01:00
Alexander Köplinger f5aec6d5e2 [ci] Bump timeout for compile-runtime-tests
The new Azure Windows builders sometimes run into this timeout.
2017-02-01 14:27:01 +01:00
Niklas Therning 6ce1db7596 Adds CI scripts to run the test suites under the winaot profile 2017-02-01 14:00:36 +01:00
Niklas Therning 578c224c25 Merge pull request #4301 from ntherning/fix-Mono.Posix-API-breakage
Fixes the Mono.Posix API breakage introduced in #3985
2017-02-01 07:58:54 -05:00
Zoltan Varga 1e8a8bffb4 [runtime] Fix parse_optimizations () so the optimization names don't … (#4300)
* [runtime] Fix parse_optimizations () so the optimization names don't need to be in a particular order.

* [jit] Avoid unused bits in optflags.
2017-02-01 07:42:14 -05:00
Zoltan Varga faa7954849 [ppdb] Fix support for embedded ppdb data. 2017-02-01 05:37:32 -05:00
Niklas Therning a55ddfca06 Fixes the Mono.Posix API breakage introduced in #3985
Also reverts the changes done to support/map.c. This is a generated file which
shouldn't be changed directly. An alternate fix for the problem in map.c on
Windows was to make sure L_SET et al are defined in mph.h which was already
done for Solaris.
2017-02-01 09:19:35 +01:00
Marek Safar 18c9df1789 Merge pull request #4310 from marek-safar/roslyn-rc3
Bump roslyn to rc3
2017-02-01 09:10:29 +01:00
Marek Safar 1af7e953e8 Merge pull request #4302 from marek-safar/corefx-bump
Bump corefx
2017-02-01 08:31:03 +01:00
Marek Safar 5e63a3ebfb Bump roslyn to rc3 2017-01-31 23:52:58 +01:00
Marek Safar 42b505ce2f Bump corefx 2017-01-31 23:34:24 +01:00
Alexander Köplinger 7a1a02ab7c [tests] Fix assemblyresolve_event4.exe and reference-loader.exe FullAOT test fails
Fix assemblyresolve/Makefile.am so it correctly AOTs the
dependency of assemblyresolve_event4.exe (CLASS was empty before).

Disable reference-loader.exe since we can't AOT the
TestingReferenceAssembly.dll assembly which is a dependency
of the test so it would fail. Discussed with Aleksey, this is OK
because even if we could AOT the assembly we wouldn't use it since
the assembly loader looks at the managed assembly first, finds the
attribute and bails out before looking at the AOT image.
2017-01-31 22:08:35 +01:00
Alexander Köplinger 16b933f883 [System] Fix AsyncOperationManager test that fails on the testing_full_aot profile
It seems the first assert only applies to XI/XM, so use those
in the condition instead of the profiles where it doesn't apply.
2017-01-31 20:23:00 +01:00
Alexander Köplinger e76fa87fe0 Don't try to AOT test assemblies in runtime_preset=all (#4303)
This got broken in ee048db72f
when the winaot profile was added to FULL_AOT_TESTS since we
enable that profile for building with runtime_preset=all which
means that FULL_AOT_TESTS would be defined and the runtime tests
would try to AOT the test assemblies.

Instead, we now only try to AOT if we're actually testing
a profile that needs it. Also introduced a new HYBRID_AOT_TESTS
variable and replaced the existing INSTALL_TESTING_AOT_HYBRID
since that profile would run into the same issue if we included
it in runtime_preset=all (using the INSTALL_ variables to decide
about tests is misleading!)
2017-01-31 19:18:58 +01:00
Marek Safar e3a6168dc2 [mono] Update ignored assemblies list to include System.ValueTuple 2017-01-30 17:47:29 +01:00
Marek Safar 74ca13ad75 [mono] Update ignored assemblies list to include System.Reflection.DispatchProxy 2017-01-30 17:47:29 +01:00
Alexander Köplinger 2bdb9ac999 [System.ServiceProcess] Fix test failure on Windows Server 2016
Use different service as the former has different dependencies
on the server edition.
2017-01-30 17:17:07 +01:00
Alexander Köplinger 845817b13a [System.Web] Fix two more EOL test failures on Windows 2017-01-30 17:17:06 +01:00
Rodrigo Kumpera 964ac3c81e Merge pull request #4297 from kumpera/fix-profiler-osx-linking
[profiler] On OSX, don't link against libmonosgen.
2017-01-30 10:54:55 -05:00
Marek Safar fd5bcaa48b [build] Use multiple inputs in profiled aot 2017-01-28 04:49:28 -05:00
Jon Purdy 980fc8d8cd [docs] Add a basic doxyfile
Bare minimum Doxygen configuration with dependency graphs.
2017-01-28 03:39:07 +01:00
Alexander Köplinger d61e7aca9a [bcl] Update tests that failed when .cs file contained CRLF
Most of them used multiline C# string literals which
means they contained the line ending character of the file.
Updated to make the tests resilient to having CRLF instead of LF.

Some of the mcs tests used a checksum to compare files,
ensured those are checked out using LF.
2017-01-28 02:25:55 +01:00
Rodrigo Kumpera 33a4d7cdd2 Fix non-osx build. 2017-01-27 14:51:31 -05:00
Rodrigo Kumpera d22678f8ba [profiler] Don't link to libmonosgen on OSX. Fixes in tree execution.
Loading profiling modules from the build tree fails on OSX because libmonosgen usually is not present in the install prefix.

This change is slightly overly complicated as I explicitly don't want to change iOS&friends.
2017-01-27 13:29:15 -05:00
Marek Safar 9bee02a3ff [scripts] Set custom csc nursery-size 2017-01-27 13:29:13 -05:00
Marek Safar 73ce529dcd [build] Install correct csc aot images 2017-01-27 13:29:13 -05:00
Bernhard Urban cb521c3c69 [interpreter] make space in args array to sneak in this in mint_newobj 2017-01-27 18:45:15 +01:00
Bernhard Urban 824201fcb8 [interpreter] change calling convention for this argument
the interpreter handles the `this` argument in the frame explicitly.
This doesn't align well with mini which treats `this` as normal
parameter on the stack.  That's just asking for troubles, e.g. for
native wrappers we convert signatures from virtual to static.
2017-01-27 18:45:15 +01:00
Bernhard Urban 934fa3892a [interpreter] fix CEE_LDOBJ for valuetypes 2017-01-27 18:45:15 +01:00
Bernhard Urban 6313ca4b41 [interpreter] first version of CEE{LD,ST}ELEM 2017-01-27 18:45:14 +01:00
Bernhard Urban a9ee8086e5 [interpreter] fixed bug in mint_vtresult, we need the new vt address on the stack 2017-01-27 18:45:14 +01:00
Bernhard Urban da995a21dc [interpreter] reserve storage on valuetype stack in mint_unbox 2017-01-27 18:45:14 +01:00
Bernhard Urban bcd85da0e2 [interpreter] fix some type -> klass accesses
mono_class_from_mono_type respects generic instantiations
2017-01-27 18:45:14 +01:00
Bernhard Urban 1ac870838e [interpreter] call managed boxing for nullable 2017-01-27 18:45:14 +01:00
Bernhard Urban 0dce72bd54 [interpreter] make box instruction respect generics 2017-01-27 18:45:14 +01:00
Bernhard Urban 593827bdd3 [interpreter] improve tracing 2017-01-27 18:45:14 +01:00
Bernhard Urban ca9279d3bb [interpreter] implement unbox_any. call managed unbox implementation for Nullable struct 2017-01-27 18:45:14 +01:00
Bernhard Urban 4c8d570eb1 [interpreter] add temporary regression tests for generics
until we can execute generics.cs
2017-01-27 18:45:14 +01:00
Bernhard Urban defa64af03 [interpreter] integrate compile_method and runtime_invoke into mini 2017-01-27 18:45:14 +01:00
Marek Safar 8e6f129087 [runtime] Add more system assemblies remapping 2017-01-27 12:20:51 -05:00
Alexander Köplinger 7ef66cccd9 A few more LF .gitattributes fixes 2017-01-27 15:58:54 +01:00
Alexander Köplinger 8aba97e42a Always use LF line endings for config.rpath/configure.host as well 2017-01-27 15:19:02 +01:00
Alexander Köplinger a16103f4b4 Add .sh extension to update_submodules so it gets correct line ending
It'd not be recognized as a shell file so it'd get CRLF line
endings on Windows which doesn't work. Also added a shebang.

Also remove get-cygwin-deps.sh, it is long outdated.
Correct instructions are on the Mono website.
2017-01-27 15:19:01 +01:00
Alexander Köplinger b112f67c45 Make sure .sh files always have LF line ending
This removes the need to set core.autocrlf=input when compiling
Mono on Windows via cygwin.
2017-01-27 14:14:23 +01:00
David Karlaš fb5bc8d4c5 [Debugger] Added support for stepping over await and out of async met…
…hods

method-to-ir.c: Added sequence points on IL offsets yieldOffsets and resumeOffsets since we need stepping to stop yieldOffset and ability to set breakpoint on resumeOffset
seq-points.c: This change is needed since we need to know if we are at last non-empty SeqPoint in method, but without this change is_last_non_empty method in debugger-agent.c would loop forever since blocks point between each other in cycles
doest-app.cs and dtest.cs: unit test
debugger-agent.c: I will explain how stepping over `await` and stepping out of `async` method works in commit message, code itself should be self explaining with comments

Step-In and Step-Out case: inside `async` method we do everything same except two things:
1. At end of method we switch to step-out logic
This is important because normal stepping-in/over would step out into “thread pool” calling code. Which is not what we want, we want to continue stepping where .Wait, .Result or `await` is waiting for our Task to finish. `is_last_non_empty` is needed because last non-empty SeqPoint is placed before SetResult(see line 33 in decompiled method below) so we can do StepOut logic before SetResult method is called.  I will explain how step-out works below.
2. When stepping is finished we check if we stepped on yieldOffset(this happens when user is about to step over `await` call) and Task has IsCompleted false(didn’t finish immediately)(line 11 in decompiled method). If we stopped on yieldOffset we put breakpoint on resumeOffset SeqPoint(line 19 in decompiled method) and resume execution so when our AsyncStateMachine is called back after Task(the one that our `await` call triggered) is finished we hit breakpoint and user is just after `await` call. It’s important that we set `async_id` before resuming at yieldOffset so we can check when breakpoint is hit if this is our Task or some other that is executing at same time, since we can’t check threads since threads can change before and after `await` call.

Step-Out case: When user requests step-out or user requests step-in/over and we are at end of method, we set breakpoint in special .Net framework method called “NotifyDebuggerOfWaitCompletion” and call “SetNotificationForWaitCompletion” method so after Task is finished(when we call .SetResult, line 33 in decompiled method).

Method that called our `async` method and got our Task(on which we called “SetNotificationForWaitCompletion”) returned. When it calls .Wait(), .Result, or `await` on our task it will call “NotifyDebuggerOfWaitCompletion”(framework does this). At that point our breakpoint(inside “NotifyDebuggerOfWaitCompletion”) is hit and we do step-out until we get to where user called .Wait(), .Result, and `await`.(Of course if ProjectCodeOnly is enabled, otherwise it’s in 1 method above “NotifyDebuggerOfWaitCompletion”).

I added also ppdb dump and monodis if anyone wants more data:

C# code:
public static async Task<int> ss_await_1 () {
    var a = 1;
    await Task.Delay (20);
    return a + 2;
}
C# decompiled:
  1: void IAsyncStateMachine.MoveNext ()
  2: {
  3:     int num = this.<>1__state;
  4:     int result;
  5:     try {
  6:         TaskAwaiter taskAwaiter;
  7:         if (num != 0) {
  8:           this.<a>5__1 = 1;
  9:           taskAwaiter = Task.Delay (20).GetAwaiter ();
10:           if (!taskAwaiter.get_IsCompleted ()) {
11:                this.<>1__state = 0;
12:                this.<>u__1 = taskAwaiter;
13:               Tests.<ss_await_1>d__90 <ss_await_1>d__ = this;
14:               this.<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter, Tests.<ss_await_1>d__90> (ref taskAwaiter, ref <ss_await_1>d__);
15:                return;
16:            }
17:        }
18:        else {
19:            taskAwaiter = this.<>u__1;
20:            this.<>u__1 = default(TaskAwaiter);
21:            this.<>1__state = -1;
22:        }
23:        taskAwaiter.GetResult ();
24:        taskAwaiter = default(TaskAwaiter);
25:        result = this.<a>5__1 + 2;
26:    }
27:    catch (Exception exception) {
28:        this.<>1__state = -2;
29:        this.<>t__builder.SetException (exception);
30:        return;
31:    }
32:    this.<>1__state = -2;
33:    this.<>t__builder.SetResult (result);
34:}

ppdb dump for this method:
<method containingType="Tests+&lt;ss_await_1&gt;d__90" name="MoveNext">
    <sequencePoints>
    <entry offset="0x0" hidden="true" document="1" />
    <entry offset="0x7" hidden="true" document="1" />
    <entry offset="0xe" startLine="744" startColumn="46" endLine="744" endColumn="47" document="1" />
    <entry offset="0xf" startLine="745" startColumn="3" endLine="745" endColumn="13" document="1" />
    <entry offset="0x16" startLine="746" startColumn="3" endLine="746" endColumn="25" document="1" />
    <entry offset="0x23" hidden="true" document="1" />
    <entry offset="0x7c" startLine="747" startColumn="3" endLine="747" endColumn="16" document="1" />
    <entry offset="0x87" hidden="true" document="1" />
    <entry offset="0xa1" startLine="748" startColumn="2" endLine="748" endColumn="3" document="1" />
    <entry offset="0xa9" hidden="true" document="1" />
    </sequencePoints>
    <scope startOffset="0x0" endOffset="0xb7" />
    <asyncInfo>
    <kickoffMethod declaringType="Tests" methodName="ss_await_1" />
    <await yield="0x35" resume="0x50" declaringType="Tests+&lt;ss_await_1&gt;d__90" methodName="MoveNext" />
    </asyncInfo>
</method>

monodis:
.method private final virtual hidebysig newslot
        instance default void MoveNext ()  cil managed
{
    // Method begins at RVA 0x41f0
.override Could not decode method override class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext due to (null)
// Code size 183 (0xb7)
.maxstack 3
.locals init (
    int32 V_0,
    int32 V_1,
    valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiterV_2,
    class Tests/'<ss_await_1>d__90' V_3,
    class [mscorlib]System.Exception V_4)
IL_0000:  ldarg.0
IL_0001:  ldfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
IL_0006:  stloc.0
.try { // 0
    IL_0007:  ldloc.0
    IL_0008:  brfalse.s IL_000c

    IL_000a:  br.s IL_000e

    IL_000c:  br.s IL_0050

    IL_000e:  nop
    IL_000f:  ldarg.0
    IL_0010:  ldc.i4.1
    IL_0011:  stfld int32 Tests/'<ss_await_1>d__90'::'<a>5__1'
    IL_0016:  ldc.i4.s 0x14
    IL_0018:  call class [mscorlib]System.Threading.Tasks.Task class [mscorlib]System.Threading.Tasks.Task::Delay(int32)
    IL_001d:  callvirt instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter class [mscorlib]System.Threading.Tasks.Task::GetAwaiter()
    IL_0022:  stloc.2
    IL_0023:  ldloca.s 2
    IL_0025:  call instance bool valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::get_IsCompleted()
    IL_002a:  brtrue.s IL_006c

    IL_002c:  ldarg.0
    IL_002d:  ldc.i4.0
    IL_002e:  dup
    IL_002f:  stloc.0
    IL_0030:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
    IL_0035:  ldarg.0
    IL_0036:  ldloc.2
    IL_0037:  stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter Tests/'<ss_await_1>d__90'::'<>u__1'
    IL_003c:  ldarg.0
    IL_003d:  stloc.3
    IL_003e:  ldarg.0
    IL_003f:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32> Tests/'<ss_await_1>d__90'::'<>t__builder'
    IL_0044:  ldloca.s 2
    IL_0046:  ldloca.s 3
    IL_0048:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32>::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter, class Tests/'<ss_await_1>d__90'> ([out] !!0&, [out] !!1&)
    IL_004d:  nop
    IL_004e:  leave.s IL_00b6

    IL_0050:  ldarg.0
    IL_0051:  ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter Tests/'<ss_await_1>d__90'::'<>u__1'
    IL_0056:  stloc.2
    IL_0057:  ldarg.0
    IL_0058:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter Tests/'<ss_await_1>d__90'::'<>u__1'
    IL_005d:  initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
    IL_0063:  ldarg.0
    IL_0064:  ldc.i4.m1
    IL_0065:  dup
    IL_0066:  stloc.0
    IL_0067:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
    IL_006c:  ldloca.s 2
    IL_006e:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
    IL_0073:  nop
    IL_0074:  ldloca.s 2
    IL_0076:  initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
    IL_007c:  ldarg.0
    IL_007d:  ldfld int32 Tests/'<ss_await_1>d__90'::'<a>5__1'
    IL_0082:  ldc.i4.2
    IL_0083:  add
    IL_0084:  stloc.1
    IL_0085:  leave.s IL_00a1

} // end .try 0
catch class [mscorlib]System.Exception { // 0
    IL_0087:  stloc.s 4
    IL_0089:  ldarg.0
    IL_008a:  ldc.i4.s 0xfffffffe
    IL_008c:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
    IL_0091:  ldarg.0
    IL_0092:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32> Tests/'<ss_await_1>d__90'::'<>t__builder'
    IL_0097:  ldloc.s 4
    IL_0099:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32>::SetException(class [mscorlib]System.Exception)
    IL_009e:  nop
    IL_009f:  leave.s IL_00b6

} // end handler 0
IL_00a1:  ldarg.0
IL_00a2:  ldc.i4.s 0xfffffffe
IL_00a4:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
IL_00a9:  ldarg.0
IL_00aa:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32> Tests/'<ss_await_1>d__90'::'<>t__builder'
IL_00af:  ldloc.1
IL_00b0:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32>::SetResult(!0)
IL_00b5:  nop
IL_00b6:  ret
} // end of method <ss_await_1>d__90::MoveNext
2017-01-27 11:17:57 +01:00
David Karlaš da69fcc7f6 [Ppdb] Support for reading CustomDebugInformation and more specifically AsyncMethodDebugInfo 2017-01-27 11:17:57 +01:00
monojenkins 8a8e9532b4 [msvc] Update csproj files (#4295) 2017-01-26 17:40:33 +01:00
Egor Bogatov b37bb1736d [System.Data] SqlTypes and DataStorage from corefx (#4291) 2017-01-26 08:48:23 -05:00
Alexander Köplinger 30b91fc0a9 [ci] Set execute bit on run-test-mcs.sh 2017-01-26 11:59:09 +01:00
Marek Safar 35b66dec34 [ci] run mcs tests on mcs lane 2017-01-25 21:48:51 -05:00
Alexander Köplinger efce0da079 Fix PLATFORM_AOT_SUFFIX check in configure.ac 2017-01-26 01:33:49 +01:00
Alexander Köplinger 1d87187a1b Skip AOTing profile assemblies if AOT_BUILD_FLAGS is not set
Fixes the issue from a4b3ba6177
and 6f4f3643c6.

When building those profiles as part of runtime_preset=all,
the AOT_BUILD_FLAGS variable is not set so AOTing doesn't work
because the command line flag in rules.make is incomplete.

We don't really need/want to AOT for runtime_preset=all,
the point is just to make sure these BCL profiles still build.
2017-01-25 21:17:10 +01:00
Marek Safar 7e6c33c3e7 [tools] Simplify cecil usage in stringreplacer 2017-01-25 14:42:43 -05:00
Alexander Köplinger a4b3ba6177 Disable winaot in the runtime_preset=all as well
It runs into the same issue as orbis (6f4f3643c6).
2017-01-25 20:22:18 +01:00
Aleksey Kliger (λgeek) 9aa19cb3ec [appdomain] Use coop handles for most methods in System.AppDomain (#4286)
* [runtime] Use coop handles for ves_icall_System_AppDomain_GetData

* [runtime] Add mono_string_new_utf16_handle function that returns a MonoStringHandle

* [runtime] Use coop handles for ves_icall_System_AppDomain_InternalGetProcessGuid

* [runtime] Use coop handles for System.AppDomain icalls

  - ves_icall_System_AppDomain_InternalIsFinalizingForUnload
  - ves_icall_System_AppDomain_InternalPushDomainRef
  - ves_icall_System_AppDomain_InternalPushDomainRefByID
    (This one is slightly non-trivial because we switch from MonoException to MonoError)
  - ves_icall_System_AppDomain_InternalPopDomainRef
  - ves_icall_System_AppDomain_InternalSetDomainByID

* [runtime] Use coop handles for ves_icall_System_AppDomain_InternalSetDomain

* [runtime] Use coop handles for ves_icall_System_AppDomain_SetData

* [runtime] Coop handles for some AppDomain icalls

  - ves_icall_System_AppDomain_getCurDomain
  - ves_icall_System_AppDomain_getFriendlyName
  - ves_icall_System_AppDomain_getRootDomain
  - ves_icall_System_AppDomain_getSetup

* [coop handles] Add mono_string_handle_length function

* [marshal] Add mono_marshal_xdomain_copy_value_handle

* [coop handles] Add mono_aray_new_full_handle

* [appdomain] Use handles in mono_array_clone_in_domain

* [runtime] Use coop handles for ves_icall_System_AppDomain_createDomain

* [appdomain] Use coop handles for ves_icall_System_AppDomain_InternalUnload
2017-01-25 13:53:46 -05:00
Marek Safar 90b639f797 Merge pull request #4276 from henricm/winaot
Updates for winaot profile
2017-01-25 13:16:04 -05:00
Henric Müller 5a28b08795 Changing Win32_IP_ADAPTER_INFO to struct to work on AOT builds 2017-01-25 16:34:55 +01:00
Henric Müller 2f6630d46a Fixing AsyncOperationManagerTest test for winaot profile 2017-01-25 16:34:32 +01:00
Henric Müller 65b7f542d6 Fixing tests that asume IPV4 when first adapter is IPV6 2017-01-25 16:34:09 +01:00
Henric Müller fd83021804 Enabling NativeObjectSecurity on windows aot 2017-01-25 16:33:47 +01:00
Henric Müller 2c84763a1a Fixes in NetworkInformation for winaot profile
* Enabling windows specific code for winaot profile
which were disabled with MOBILE define.
* Making sure Win32_FIXED_INFO struct can get marshalled
correctly for AOT builds.
2017-01-25 16:33:24 +01:00
Henric Müller 262a4ae9b4 Enabled win specific time zone code using WIN_PLATFORM 2017-01-25 16:33:00 +01:00
Henric Müller aa40ebb990 Enabled win specific code in registry classes using WIN_PLATFORM 2017-01-25 16:32:34 +01:00
Henric Müller 1cdf024aba Enabling Windows specific code paths with WIN_PLATFORM 2017-01-25 16:32:10 +01:00
Henric Müller b015b474f3 Adding winaot corlib test assembly in LoadWithPartialName 2017-01-25 16:31:47 +01:00
Henric Müller e274e6f7eb Removing mini-exeptions-native-unwinder from project file 2017-01-25 16:31:24 +01:00
Henric Müller 0c61cdc666 Adding .exp to git ignore file. 2017-01-25 16:31:00 +01:00
Henric Müller e1b885c28e Adding Console support for winaot
Introducing a `MONO_FEATURE_CONSOLE` to be used instead of disabling
Windows specific Console related classes using `MOBILE` ifdef. The
`MONO_FEATURE_CONSOLE` will be set for profiles not setting `NO_CONSOLE`
which currently monodriod and monotouch profiles do.
2017-01-25 16:29:12 +01:00
Rodrigo Kumpera b2e515dcc8 Merge pull request #4280 from vargaz/class-init-cond
[runtime] Implement the wait in mono_runtime_class_init_full () using…
2017-01-25 08:53:12 -05:00
Henric Müller ee048db72f Updates for winaot profile 2017-01-25 10:14:01 +01:00
Henric Müller 96374a84a6 Added support for Windows AOT suffix
* Adding support for .dll and .exe AOT suffixes.
* Fix issue with parsing gsharedvt optimazation flag on Windows.
2017-01-25 10:07:48 +01:00
Alexander Köplinger 6f4f3643c6 Temporarily exclude orbis from the runtime_preset=all to fix build break
It breaks on Jenkins with:

```
23:53:28 make aot-all-profile
23:53:28 MONO_PATH="class/lib/orbis/" /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-amd64/runtime/mono-wrapper  ,temp-path=class/lib/orbis/I18N.CJK.dll_bitcode_tmp --verbose class/lib/orbis/I18N.CJK.dll > class/lib/orbis/I18N.CJK.dll.so.aot-log
23:53:28 Cannot open assembly ',temp-path=class/lib/orbis/I18N.CJK.dll_bitcode_tmp': No such file or directory.
```
2017-01-25 03:36:31 +01:00
Alexander Köplinger 603badbd39 [bcl] Fix build for orbis profile 2017-01-24 23:55:38 +01:00
Alexander Köplinger 849f12ba7d [socket] Fix order of parameters for mono_w32file_create
In 56edb3357c the call to ves_icall_System_IO_MonoIO_Open
was changed to mono_w32file_create, but that function uses a different parameter order:

```
mono_w32file_create (name, fileaccess, sharemode, createmode, attrs)
ves_icall_System_IO_MonoIO_Open (filename, mode, access_mode, share, options, error)
```

Fix the order so the parameters we pass are the intended ones.
2017-01-24 22:35:44 +01:00
monojenkins ab87d5de93 [msvc] Update csproj files (#4287) 2017-01-24 18:12:19 +01:00
Vlad Brezae 16ada3424a Merge pull request #3806 from BrzVlad/feature-parallel-gc-final
[sgen] Parallel concurrent major
2017-01-24 13:03:05 +02:00
Marek Safar 77f171e6a3 Bump corert 2017-01-23 21:58:43 -05:00
Marek Safar edaa13248b [build] Add new profile 2017-01-23 15:43:36 -05:00
Ludovic Henry 243cf3bd96 [socket] Ensure werror is initialized to 0 2017-01-23 15:29:07 -05:00
Marek Safar 0546b369ab [build] Add System.Text.Encoding.CodePages dependency used for non-ascii files in build 2017-01-23 12:58:08 -05:00
monojenkins 5afd4aa990 [msvc] Update csproj files (#4284) 2017-01-23 18:19:22 +01:00
Zoltan Varga 6c147e7028 [runtime] Remove duplicate unused SHA1 implementation. 2017-01-23 13:51:01 +01:00
Bernhard Urban b2a7f2eb38 [mono-sha1] make SHA1Transform thread-safe
should fix https://bugzilla.xamarin.com/show_bug.cgi?id=41133

The bug exposed itself as System.MethodAccessExceptionMethod which is
thrown when a method isn't allowed to call another method.  Several
things are checked for this: Among other things, the runtime checks if
the public key in the friend list of the caller assembly matches the
public key in the callee assembly.

The issue here was that two threads computed the SHA1 at the same time,
using the same buffer and therefore computing garbage.
2017-01-23 13:44:04 +01:00
Zoltan Varga 5e50c3d874 [aot] Allow the redirection of aot profile output to an already opened fd using outfile=#<fdnum>. 2017-01-23 05:48:54 -05:00
Zoltan Varga 74e0eb90f3 [runtime] Implement the wait in mono_runtime_class_init_full () using a cond variable instead of a mutex.
Previously it waited for the initialization to be done using a mutex lock/unlock, which needed some additional checks before acquiring the lock. Use a normal cond variable instead. Remove some code duplication from the lock cleanup code.
2017-01-23 00:40:14 -05:00
Zoltan Varga 359fd834fd Enable AOT for all roslyn assemblies. 2017-01-23 00:19:36 -05:00
Alexander Köplinger 5a28370d8a Fix a few cppcheck errors (#4281)
* [zlib] Fix CppCheck error "Shifting a negative value is undefined behaviour"

This matches what upstream now does:
https://github.com/madler/zlib/blob/2edb94a3025d288dc251bc6cbb2c02e60fbd7438/inflate.c#L1529

* [scripts] Fix CppCheck error "Memory leak: nargv"

* [tests] Fix CppCheck error: "Memory leak: reference"

* [aot-compiler] Fix CppCheck error: "Resource leak: infile"

* [metadata] Fix CppCheck error: "Uninitialized variable: ret"
2017-01-23 03:11:40 +01:00
Rodrigo Kumpera 5c62590ba7 Merge pull request #4274 from kumpera/cctor-abort
[runtime] Latest attempt at the cctor abort race. All tests passing locally.
2017-01-22 10:20:38 -05:00
Alexander Köplinger 9716aeb321 Fix tarball build
w32api.h wasn't included in any sources in the Makefile.
Also fix path in vcxproj, the file is in mono/utils not mono/metadata.
2017-01-22 03:13:56 +01:00
Zoltan Varga 67df72ae22 [aot] Init the plt before setting acfg->methods_loaded which is accessed outside the lock. 2017-01-21 06:06:29 -05:00
Ludovic Henry 56edb3357c [io-layer] Extract error (#4279)
* [file] Remove dead field

* [process] Remove wapi_getpid

* [process] Remove CloseHandle

* [io-layer] Remove dead MONO_TRACE

* [io-layer] Extract error

* [io-layer] Extract wapi.h

* [io-layer] Remove the io-layer
2017-01-20 20:15:19 -05:00
Zoltan Varga a69c38055f [runtime] Fix the loaded llvm build. 2017-01-20 19:02:43 -05:00
Marek Safar 203864e977 [corlib] Removes unused method 2017-01-20 23:24:27 +01:00
Alexander Köplinger 0f29c64e73 [btls] Remove last traces of statically linked btls
It was removed in d831fc4ec4.
2017-01-20 20:34:29 +01:00
Alexander Köplinger a104a895ca [btls] Add dependency on btls source files in Makefile so change tracking works 2017-01-20 20:33:37 +01:00
Alexander Köplinger db2f41e964 Really fix the file mode this time...
Sorry, should probably get a coffee :(
2017-01-20 19:49:03 +01:00
Alexander Köplinger cfec2ebeac Fix inadvertent file mode change in previous commit 2017-01-20 19:46:28 +01:00
Alexander Köplinger c98d0ecdf7 [Facades] Refresh netstandard20 typeforwarders 2017-01-20 19:40:55 +01:00
Alexander Köplinger 3ec54319a3 [profiler] Add mono-profiler-aot.h to EXTRA_DIST
This broke the tarball build.
2017-01-20 18:27:05 +01:00
Ludovic Henry f23f72c9de [io-layer] Extract file (#4255)
* [io-layer] Merge io related headers

* [io-layer] Remove global variable _wapi_had_shut_down

* [io-layer] Inline io-portability.c file into io.c

* [io-layer] Inline locking.c file into io.c

* [io-layer] Inline posix.c file into io.c

* [file] Move metadata/file-io* files to metadata/w32file*

* [io-layer] Extract file functions

* [file] Remove overlapped parameter which is always NULL

* [file] Remove SECURITY_ATTRIBUTES parameter which is always NULL

* [file] Remove GET_FILEEX_INFO_LEVELS parameter which is always GetFileExInfoStandard

* [file] Replace ULARGE_INTEGER parameter type with guint64

* [file] Replace WIN32_FILE_ATTRIBUTE_DATA parameter type with MonoIOStat

* [file] Remove mono_w32file_create unused parameter tmplate

* [file] Fix win32 build
2017-01-20 11:32:48 -05:00
Aleksey Kliger (λgeek) b3d9af9023 [reflection] Use coop handles for MonoMethod icalls (#4272)
* [reflection] Use coop handles for MonoMethod.GetGenericArguments

* [reflection] Use handles for ves_icall_MonoMethod_GetGenericMethodDefinition
  and two more trivial functions:
  - ves_icall_MonoMethod_get_IsGenericMethod
  - ves_icall_MonoMethod_get_IsGenericMethodDefinition

* [runtime] Add mono_method_get_base_method function

  - Internal function in class-internals.h, for now.
  - Code factored out from ves_icall_MonoMethod_get_base_method
  - ves_icall_MonoMethod_get_base_method just calls this utility and wraps on
    reflection objects, using handles.

* [reflection] Use coop handles for ves_icall_MonoMethod_MakeGenericMethod_impl

* [reflection] Use coop handles for ves_icall_MonoMethod_GetPInvoke

* [reflection] Use coop handles for ves_icall_MonoMethod_get_core_clr_security_level

* [reflection] Use coop handles for ves_icall_MonoMethod_get_name
2017-01-20 10:35:02 -05:00
Vlad Brezae a4c5367b44 [sgen] Always use a context specialized gray stack 2017-01-20 17:04:47 +02:00
Alexander Köplinger 6f2ce1ddf9 [bcl] Rename FEATURE_MONO_CAS to MONO_FEATURE_CAS
To be consistent with the other MONO_FEATURE_* defines.
2017-01-20 16:00:56 +01:00
Zoltan Varga 441f21bf48 [runtime] Mono.Dynamic.Interpreter is no more, delete it from the list of assemblies compiled by make fullaotcheck. 2017-01-20 05:08:58 -05:00
Zoltan Varga 906ed413f5 [runtime] Fix locking issues while accessing MonoClass bitfields. (#4275) 2017-01-20 03:28:22 -05:00
Alexander Köplinger 59af66cfe9 [System.Transactions] Add stubs and visibility fixes for netstandard20 APIs 2017-01-20 03:07:36 +01:00
Rodrigo Kumpera 70872177bb [runtime] Poll for interruption on cctor execution if mono_threads_end_abort_protected_block returns true. 2017-01-19 18:04:46 -08:00
Rodrigo Kumpera 5c7d98989a [runtime] Add new thread state INTERRUPT_REQUEST_DEFERRED to fix race with abort protected blocks.
The way this works is that when we install a protected block, we change a interrupt requested to interrupt request deferred.
Then, when protected block count drops to zero, we switch back and inform the caller to poll for interrupts.

Additionally, when interrupting, we set it to deferred if there's a protected block in effect and it's not a self interrupt.
2017-01-19 18:02:20 -08:00
Rodrigo Kumpera 39beec794d [threading] Change mono_thread_try_resume_interruption to check for the abort threshold too. 2017-01-19 18:01:43 -08:00
Rodrigo Kumpera 933a18326a [runtime] Workaround in Environment::Exit icall in case current thread has an interruption token installed. Tracked under bug #51653. 2017-01-19 18:00:46 -08:00
Rodrigo Kumpera 45be0e7fb9 [mono/tests] Use multiple return values to make it easy to pinpoint the failure. 2017-01-19 17:59:16 -08:00
Michael DeRoy fd29140735 Fix memory leak when creating sequence points (#4273) 2017-01-19 19:28:47 -05:00
Vlad Brezae 13ff81c713 [sgen] Always use one concurrent worker
We have the infrastructure to use multiple concurrent workers, but, in theory, this could starve the mutator threads. In the future, we should do additional research and consider using multiple concurrent workers.
2017-01-20 00:45:20 +02:00
Vlad Brezae dcd66b592e [sgen] Awaken workers if they are finished while there is work to steal 2017-01-20 00:45:19 +02:00
Vlad Brezae b180e9de9c [sgen] Use non-synchronized gray stack when only one worker is running 2017-01-20 00:45:19 +02:00
Vlad Brezae 4ea34f62a5 [sgen] Spread the initial roots of workers
A parallel phase starts with enqueuing of jobs and of sections to the distribute gray queue. In order to have a good work distribution we split jobs into multiple smaller jobs. We now do the same with the initial gray queue sections, by trying to always have a minimum number of starting sections.
2017-01-20 00:45:18 +02:00
Vlad Brezae 74435adcf9 [sgen] Worker gray queue stealing
When a worker is out of work, it tries to steal a section from the bottom of another workers' private gray queue. This operation takes a lock. Pushes/Pops done by the owner thread on its own private gray queue are done in lock free fashion, using membar/CAS (at section level).
2017-01-20 00:45:18 +02:00
Vlad Brezae 0b7fbf1d6a [sgen] Properly init the size of a new gray queue section
To avoid confusion
2017-01-20 00:45:17 +02:00
Vlad Brezae 050d17df80 [profiler] Fix vtune build 2017-01-20 00:45:17 +02:00
Vlad Brezae 33e80a5291 [sgen] Add worker index to the binary protocol entries 2017-01-20 00:45:16 +02:00
Vlad Brezae 8e72650298 [sgen] Clean exit if we can't read binprot file due to unsupported version 2017-01-20 00:45:16 +02:00
Vlad Brezae 956ebf32ab [sgen] Switch to nopar context when we are left with one worker
Non-parallel context is significantly faster since it doesn't require CAS-ing. Use it when we are left with only one worker so we don't regress performance.
2017-01-20 00:45:15 +02:00
Vlad Brezae 792ec4419a [sgen] Parallel mod union scan jobs 2017-01-20 00:45:14 +02:00
Vlad Brezae 85a5fd5867 [sgen] Avoid allocating mod union cardtables for los objects when scanning
We should consider doing the same when marking the mod union card table, if we have no cards to mark.
2017-01-20 00:45:14 +02:00
Vlad Brezae 4522c35476 [sgen] Remove unused function 2017-01-20 00:45:13 +02:00
Vlad Brezae 24ae43d6a9 [sgen] Use parallel workers when finishing concurrent collections 2017-01-20 00:45:13 +02:00
Vlad Brezae c282c5b4ee [sgen] Make getting object size safe with parallel collector 2017-01-20 00:45:12 +02:00
Vlad Brezae 5ce1564be2 [sgen] Support cementing from multiple workers 2017-01-20 00:45:12 +02:00
Vlad Brezae 9915f47f62 [sgen] Disable concurrent queue redirection
We used to support the case where workers are running and when the main gc thread populates the redirected gray queue, these queue sections are moved to the workers distribute gray queue from where they are distributed to all the workers. In order to simplify the process, the main gc thread should never do any relevant gc work concurrently with the workers. This means that we no longer need to handle the above case.
2017-01-20 00:45:11 +02:00
Vlad Brezae 6dd609be32 [sgen] Add parallel copying infrastructure
Parallel copying should happen only when the world is stopped and the gc thread is not running. Each thread allocates from its own block freelist, which he obtains by pop-ing the global block free list.

When a worker has to copy an object, it first allocates a new object in a major block and initialises its contents. Afterwards it tries to forward the vtable, using a CAS operation. If the vtable already contains a forwarded object, we just return the forwarded address, and the object that we allocated will be left to die (we expect this case to be extremely unlikely, otherwise we could re-enque the free object in its block's freelist).

After the copying is done, the caller has the duty to update references and mark the new object (which we have to do it also with a CAS).

FIXME : This means that an object can reside on a gray queue without being marked, so another thread can enque again this same object. We should refactor this copying/mark/enqueing mechansim to avoid these issues.
2017-01-20 00:45:11 +02:00
Vlad Brezae e382aa00b5 [sgen] Add free lists for each workers
These will be used for object allocation by the workers
2017-01-20 00:45:10 +02:00
Vlad Brezae 7dc021c96d [sgen] Parallel precleaning of los objects
In the future we should consider splitting large objects.
2017-01-20 00:45:10 +02:00
Vlad Brezae 175bf89a99 [sgen] Remove unused parameter 2017-01-20 00:45:09 +02:00
Vlad Brezae c8b5a33e5c [sgen] Parallel major blocks precleaning
We allow spliting a major_scan_cardtable into multiple smaller jobs. For precleaning, we enqueue num_workers precleaning jobs, each one precleaning one in every num_workers blocks from the list.
2017-01-20 00:45:09 +02:00
Vlad Brezae 0a29510f23 [sgen] Split precleaning into multiple jobs 2017-01-20 00:45:08 +02:00
Vlad Brezae 5f2d0db2ba [sgen] Enqueue preclean through a worker finish callback
It moves enqueuing back to the main gc giving more flexibility.
2017-01-20 00:45:08 +02:00
Vlad Brezae d9141894cc [sgen] Enable multiple workers 2017-01-20 00:45:07 +02:00
Vlad Brezae 8e128c0f2c [sgen] CAS on LOS marking
We make sure we don't double enqueue a large object.
2017-01-20 00:45:07 +02:00
Vlad Brezae 9b4efca29b [sgen] Add CAS object marking for concurrent workers
When marking an object we need to make sure we are not unmarking other objects (since marking is stored as bits). This also allows us to make sure that we never enqueue the same object multiple times on separate gray queues.
2017-01-20 00:45:06 +02:00
Vlad Brezae bcb359628e [sgen] Add separate scan/copy context for concurrent parallel configuration 2017-01-20 00:45:06 +02:00
Vlad Brezae b0f00d71a9 [sgen] Use array with fixed-size element for mark words
There is no benefit in using pointer size element and we need to special case between architectures.
2017-01-20 00:45:05 +02:00
Vlad Brezae f87454a5fe [sgen] Support multiple workers 2017-01-20 00:45:03 +02:00
Rodrigo Kumpera 843d3c0633 [runtime] Collapse interruption_requested and abort_protected_block_count into a single var.
This change doesn't change behavior.
2017-01-19 13:34:51 -08:00
Aleksey Kliger 6e91d455db [sre] Use coop handles in parts of sre.c
* Convert ves_icall_RuntimeType_MakeGenericType to use handles.
* The above necessitates converting mono_reflection_bind_generic_parameters and
  mono_reflection_type_get_handle (renamed to
  mono_reflection_type_handle_mono_type) to use handles.
* From there we have to touch a lot of builder internals:
  - ves_icall_DynamicMethod_create_dynamic_method
  - ves_icall_ModuleBuilder_RegisterToken
  - ves_icall_ModuleBuilder_basic_init
  - ves_icall_ModuleBuilder_getMethodToken
  - ves_icall_ModuleBuilder_getToken
  - ves_icall_ModuleBuilder_getUSIndex
  - ves_icall_TypeBuilder_create_runtime_class
* As well as runtime functions
  - mono_image_insert_string
  - mono_image_create_token
  - mono_class_{get,has,set}_ref_info
  - mono_reflection_is_usertype
  - mono_dynimage_encode_reflection_sighelper
  - mono_dynamic_image_register_token
2017-01-19 15:07:26 -05:00
Miguel de Icaza a5aa762c16 Add mdb2ppdb man page, remove prj2make man page 2017-01-19 13:48:14 -05:00
Rodrigo Kumpera 7179d6ebdb Merge pull request #4269 from kumpera/nuget-fixing-round2
[runtime] A pair of small fixes for the ignore assembly work.
2017-01-19 10:26:54 -08:00
Vlad Brezae 43629d1ae0 [sgen] Add multiple thread support for sgen thread pool 2017-01-19 20:05:12 +02:00
Vlad Brezae 64dce80403 [sgen] Add parallel configuration to the sgen testing suite 2017-01-19 20:05:12 +02:00
Vlad Brezae 78b236bbab [sgen] Add option for a new parallel concurrent collector 2017-01-19 20:05:11 +02:00
Vlad Brezae b7333558ec [sgen] Remove unused prototypes 2017-01-19 20:05:11 +02:00
Vlad Brezae c313d43751 [sgen] Use thread safe addition to block list
This will enable us to to parallel block allocation, which is useful when doing parallel copying. We no longer compact the array (using the default array list allocator instead) so we need to account for unallocated slots (slots with null value) in the array at any time (see FOREACH_BLOCK).
2017-01-19 20:05:08 +02:00
Ludovic Henry 82f231ff91 [threads] Fix crash on unknown policy (#4264)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=51545
2017-01-19 09:31:01 -05:00
Ludovic Henry 3c3e566002 [threadpool] Fix race on runtime shutdown (#4263)
We cannot free the threadpool, because there is a race on shutdown where a managed thread may request a new threadpool thread, but we already destroyed the threadpool. So to avoid a use-after-free, we simply do not free the threadpool, as we won't be able to access the threadpool anyway because the ref count will be 0

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=51219
2017-01-19 09:30:07 -05:00
Ludovic Henry e343ad0cfd [io-layer] Extract socket (#4241)
* [socket] Extract win32 and unix specific code from w32socket.c

* [socket] Extract WSAGetLastError and WSASetLastError

* [socket] Extract closesocket

* [socket] Extract iocltsocket

* [socket] Extract socket-wrappers.h functions

* [socket] Extract w32handle operations

* [socket] Extract WSAIoctl

* [socket] Do not use mono_w32socket_ioctl for disconnect

* [socket] Extract errno_to_WSA

* [socket] Remove redundant mono_w32handle_get_type/mono_w32handle_lookup

* [socket] Inline _wapi_* functions

* [socket] Make disconnect not rely on mono_w32socket_ioctl

* [socket] Remove unused parameters to mono_w32socket_transmit_file

* [socket] Refactor calls to mono_w32socket_convert_error

* [socket] Remove dead code
2017-01-19 09:25:55 -05:00
Rodrigo Kumpera 6220d11404 [mini] Add new JIT flag JIT_FLAG_DISCARD_RESULTS to reduce the noise when profiling the jit with --compile-all. (#4266)
JI registration dominates profiling as it has some perf issues itself.
2017-01-19 06:34:50 -05:00
Rodrigo Kumpera bc0c2d37e0 [runtime] A pair of small fixes for the ignore assembly work.
image.c (do_mono_image_load): Ignore refonly images when checking for ignorable assemblies.

icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Load the image in ref only mode.
2017-01-18 17:54:32 -08:00
Alexander Köplinger 7fca4572d9 [btls] Disable RC4 cipher suites by default
They should not be used anymore according to https://tools.ietf.org/html/rfc7465
and browser like Chrome, Firefox and Edge/IE [1] already removed them.

We should to do the same. To have everything in one place I also moved
the disabling of SSLv2/v3 to the mono_btls_ssl_ctx_new function as well
instead of disabling it on each single connection.

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

[1] https://blogs.windows.com/msedgedev/2016/08/09/rc4-now-deprecated/
2017-01-18 21:54:47 +01:00
Alexis Christoforides ec53a1c257 [bockbuild] Fix a packaging regression 2017-01-18 15:21:58 -05:00
Rodrigo Kumpera 346125c061 Merge pull request #4262 from kumpera/fix-windows
Fix the windows build.
2017-01-18 13:18:41 -05:00
Rodrigo Kumpera 290ebcc653 Fix the windows build. 2017-01-18 07:50:51 -08:00
Alexander Köplinger ec0d74690d [pdb2mdb] Detect portable PDB and fail gracefully instead of crashing (#4261)
Before when trying to convert an assembly that had a portable PDB
instead of a native PDB alongside it we'd just crash in the
Microsoft.Cci pdb reader.

We now check whether the symbol file is a portable PDB and exit
gracefully with an error message and exit code 2 from the app.

Users which access the Converter class (like e.g. Xamarin Android [1])
directly can now catch the PortablePdbNotSupportedException to
do custom logic.

[1] https://github.com/xamarin/xamarin-android/blob/15f7547fa673e02256a75910c60c5e13eb158d2b/src/Xamarin.Android.Build.Tasks/Tasks/ConvertDebuggingFiles.cs#L28
2017-01-18 16:48:07 +01:00
Aleksey Kliger e4b93cd0bd [reflection] Fix ves_icall_RuntimeTypeHandle_GetGenericTypeDefinition_impl
There was a typo in ea176c5bb8 that inadvertantly
replaced `generic_class` by `klass`.
2017-01-18 10:30:43 -05:00
Aleksey Kliger e7d19721c6 [coop handles] Fix mono_gchandle_get_target_handle
Apparently it did not get exercised previously.
2017-01-18 10:30:43 -05:00
Aleksey Kliger d31b27997a [test] RuntimeType.GetGenericTypeDefiniton should return the TypeBuilder
even after CreateType has already been called.
2017-01-18 10:30:43 -05:00
Bernhard Urban d9825c6ac8 [mini-posix] close file stream before exec'ing into GDB/LLDB
otherwise it isn't ensured that the content is written to the file.
2017-01-18 15:47:48 +01:00
Bernhard Urban 0cddd56945 [mini-posix] fix indent 2017-01-18 15:47:48 +01:00
Bernhard Urban be9594fe94 [exception] add another testcase where an exception is rethrown explicitly (and therefore another behavior is expected) 2017-01-18 15:47:11 +01:00
Bernhard Urban 4288c5dc31 [exception] retain stack trace when an exception is rethrown 2017-01-18 15:47:11 +01:00
Rodrigo Kumpera f367b437ba Merge pull request #4234 from kumpera/katia-flavia
[runtime] Deny loading bad images.
2017-01-18 01:21:30 -05:00
Alexis Christoforides 1b3e850d20 [bockbuild] Fix packaging regression 2017-01-17 18:21:58 -05:00
Rodrigo Kumpera 26b60ef9c6 [tools] Add nuget-hash-extractor tool to help produce the runtime ignored assemblies table.
This tool takes a folder full of nupkg file and print macro invocations to add to image.c:ignored_assemblies.

Usage:

make download
make run

The download.sh script downloads all nugets we want to ignore. So update it before running if you have more you want to add.
2017-01-17 14:35:57 -08:00
Rodrigo Kumpera 9ec8ec5389 [runtime] Deny loading images that belong to a set of well known bad images.
Matching is done by assembly name and GUID. This should be enough to narrow
down the effect.

This approach is not very efficient as it waits for quite some of the loading
process to be on its way before detection. It works in the case that only a few
rare images are matched.
2017-01-17 14:35:50 -08:00
Alexis Christoforides a72a0b458d [MacSDK] Fix typo in ironlangs manifest 2017-01-17 16:33:26 -05:00
monojenkins 28ec46d6e2 [msvc] Update csproj files (#4254) 2017-01-17 19:17:57 +01:00
Bernhard Urban 03c4efe204 [interpreter] fix castclass and isinst instruction
`mono_object_isinst_mbyref_checked` was removed recently. however, this
code unnecessary checks cases that are covered by
`mono_object_isinst_checked` anyway.
2017-01-17 17:26:32 +01:00
Marek Safar 1c77897951 Clean up few warnings 2017-01-17 13:47:42 +01:00
Alexander Köplinger 997a652923 [tests] Use correct MONO_PATH directory for tools like MCS/ILASM
We need to use the mcs/class/lib/build directory so Roslyn
works (it runs into AOT bugs in net_4_x).

This was fixed in a few other places already, fix more.
2017-01-17 13:05:03 +01:00
Zoltan Varga bf5e2fa8b2 [lldb] Embed the actual entry in the jit descriptor structure to avoid a roundtrip. Add a timer for the amount of time spent in __mono_jit_debug_register_code (). Avoid emitting info for specific trampolines for now. 2017-01-17 04:13:38 -05:00
Zoltan Varga eb66d4cfc2 [tools] Add mdb2ppdb tool for converting a .mdb file to a portable pdb .pdb file. (#4251) 2017-01-17 00:22:28 +01:00
Alexander Kyte 70ce36925b [runtime] Enable unwind_backtrace on ARM/linux (#4230) 2017-01-15 20:18:19 -05:00
Zoltan Varga 3e9e81c1a8 [jit] Optimize constrained calls to Enum.GetHasCode () to avoid boxing. Fixes #51330. (#4250) 2017-01-15 19:52:46 -05:00
Zoltan Varga ebb1e7eb22 [runtime] Remove glib usage from public headers. (#4242) 2017-01-15 19:32:48 -05:00
Zoltan Varga 38983b6b1b [jit] Fix a regression introduced by the addition of an assert in bf467001b1. 2017-01-15 12:54:30 -05:00
monojenkins b18a62e599 [msvc] Update csproj files (#4249) 2017-01-14 18:21:08 +01:00
Marek Safar a9a282e77d Merge pull request #4246 from Unity-Technologies/mcs-generic-constraint-enumerator
[mcs] Ignore constraints on enumerator generic methods. Fixes #51506
2017-01-13 20:01:03 +01:00
Josh Peterson 1f64de8154 [mcs] Ignore constraints on enumerator generic methods. Fixes #51506
This is similar to the change at 30f6c9933a
2017-01-13 09:44:03 -05:00
Alexander Köplinger 968c60a0f3 [btls] Remove btls-cert-sync and integrate it into cert-sync
cert-sync already knew how to import into the BTLS cert store,
update it to always import into both stores so we don't need
the btls-cert-sync tool anymore.
2017-01-13 14:43:04 +01:00
Alexander Köplinger 3aa59f2e6b [Mono.Security] Consider _newFormat when building certificate collection in X509Store
It only looked at the legacy format where certificates had the *.cer
extension, the new BTLS store uses *.0 extension.
2017-01-13 14:43:03 +01:00
Ludovic Henry c5d43075c3 [hybrid] Enable gsharedvt trampoline on amd64 2017-01-13 09:42:59 -02:00
Ludovic Henry 924ef78270 [hybrid] Ensure gsharedvt isn't disabled once it's been enabled
We would observe gsharedvt being disabled on desktop, even after passing --hybrid-aot. This would happen because we would call `mono_set_optimizations` without the `gsharedvt` optimisation enabled, thus calling `mono_set_generic_sharing_vt_supported(FALSE)` disabling again gsharedvt.
2017-01-13 09:42:59 -02:00
Ludovic Henry 6312022a95 [hybrid] Enable logging for methods not found with gsharedvt enabled 2017-01-13 09:42:59 -02:00
Marek Safar 71897f6d15 [Facades] Implementation types from CoreFX 2017-01-13 09:15:01 +01:00
Rodrigo Kumpera bf467001b1 Merge pull request #4198 from vkargov/vk-prevbb
[jit] Fix the prev_bb quick lookup in mono_merge_basic_blocks().
2017-01-12 15:13:49 -08:00
Rodrigo Kumpera b128a290be Merge pull request #4212 from BrzVlad/fix-ephemeron-leak
[corlib] Avoid unbounded resizes of ephemeron arrays
2017-01-12 15:11:30 -08:00
Aleksey Kliger 11eb6b0475 [runtime] Use mono_{object,class}_is_transparent_proxy () where possible
instead of comparing the klass to mono_defaults.transparent_proxy_class directlyi.
2017-01-12 16:46:42 -05:00
Aleksey Kliger dd40906bb8 [runtime] Fix compile error in mono_domain_from_appdomain when DISABLE_REMOTING is defined
mono_defaults.transparent_proxy_class is #ifdef'd out when remoting is disabled.
2017-01-12 16:46:42 -05:00
Zoltan Varga ba9514f620 [runtime] Add an --enable-minimal=mdb option for disabling support for .mdb symbol files. 2017-01-12 16:32:54 -05:00
Aleksey Kliger 8dec9848f6 [mini] Initialize profiler in mini_init
Initializing the profiler later fixes a segfault with cooperative GC due to
thread info callbacks not being initialized.
2017-01-12 15:31:20 -05:00
Alexander Köplinger 44c78cbed9 [ci] Fix interpreter config and simplify CI_TAGS checking in run-jenkins.sh
The elif for the interpreter was done after the elif
that catches (almost) all cases so it was ignored.

Simplify and condense the CI_TAGS checking so it's
easier to understand and more readable.
2017-01-12 21:07:31 +01:00
Bernhard Urban 14976c12aa [configure] avoid avoid 'no symbols' warnings on darwin (2nd attempt) 2017-01-12 20:16:37 +01:00
Aleksey Kliger (λgeek) 1003c4b19f [reflection] Coop handles for more icalls in System.RuntimeTypeHandle (#4220)
* [reflection] Use handles for ves_icall_RuntimeType_get_DeclaringMethod

* [reflection] Use handles for System.RuntimeType.GetInterfaces

* [reflection] Use handles for System.RuntimeType.GetInterfaceMapData

* [reflection] Use handles for System.RuntimeType.GetGenericArgumentsInternal

* [reflection] Use handles for System.RuntimeType.MakePointerType

* [reflection] Use handles for ves_icall_RuntimeType_get_DeclaringType

* [reflection] Use handles for more System.RuntimeType icalls

  - CreateInstanceInternal
  - GetConstructors_native
  - GetCorrespondingInflatedConstructor
  - GetCorrespondingInflatedMethod
  - GetEvents_native
  - GetFields_native
  - GetGenericParameterPosition
  - GetMethodsByName_native
  - GetNestedTypes_native
  - GetPacking
  - GetTypeCodeImplInternal
  - IsTypeExportedToWindowsRuntime
  - IsWindowsRuntimeObjectType
  - get_core_clr_security_level
  - make_array_type
  - make_byref_type
2017-01-12 14:05:59 -05:00
Bernhard Urban af132734b6 [unwind] respect link register on ppc and use right dwarf register for PC depending on ELF spec version
fixes a regression introduced by 3baad19c6c
2017-01-12 19:26:23 +01:00
Zoltan Varga 1121caa963 [runtime] Support TransparentProxy-es in mono_domain_from_appdomain (). 2017-01-12 13:19:27 -05:00
Rodrigo Kumpera bc2340ff3c Merge pull request #3563 from lewurm/interpreter
reviving interpreter
2017-01-12 09:46:05 -08:00
Marek Safar 0fd12d3ff5 Fixes build 2017-01-12 18:19:56 +01:00
Marek Safar 3713ba550c [Mono.Security] Add IVT to Xamarin dlls 2017-01-12 16:41:47 +01:00
Marek Safar fe8cf937d1 Merge pull request #4235 from grendello/android_dns_servers
[BCL,Android] Get DNS server addresses from Android
2017-01-12 12:56:41 +01:00
Marek Habersack bb9981e61c [BCL,Android] Get DNS server addresses from Android
This change implements retrieving a list of DNS server addresses from Android
instead of attempting to parse `/etc/resolv.conf` which doesn't exist on
Android.
The list is retrieved by calling native function in Xamarin.Android that gets
the data from the system.

Part 2 of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=48016
2017-01-12 12:45:36 +01:00
Marek Safar 65aaee5d8d Bump cecil 2017-01-12 10:40:59 +01:00
Zoltan Varga 32690b3021 [aot] Add 'profile-only' argument to only aot methods found in the profile file. 2017-01-12 03:32:06 -05:00
Zoltan Varga f0156ef4cd [aot] Add a 'verbose' argument to the aot compiler, use it to print out more information on profile loading errors. 2017-01-11 22:04:26 -05:00
Zoltan Varga 901322a88b [aot] Add support for loading multiple profile files. 2017-01-11 21:23:16 -05:00
Zoltan Varga a43a4290b8 [lldb] Avoid a crash in mono_lldb_remove_method () if lldb is not enabled. 2017-01-11 17:56:18 -05:00
Jon Purdy e6c312f927 [ilasm] Support 'nooptimization' attribute. 2017-01-11 13:57:15 -08:00
Zoltan Varga 487cab2ad1 [msvc] Add lldb.c to the vs project. 2017-01-11 16:50:12 -05:00
Zoltan Varga a3c230a730 [lldb] Use mono_unwind_get_cie_program () instead of mono_arch_get_cie_program () which might not be available on all platforms. 2017-01-11 16:17:45 -05:00
Martin Baulig 41b471428a [BTLS]: Fix callback method signatures. 2017-01-11 21:14:09 +01:00
Martin Baulig 0bb7e2e421 [BTLS]: Remove unused local variables. 2017-01-11 21:14:08 +01:00
Alexander Köplinger e135936e2f [btls] Fix function declaration and add it to btls-key.h header 2017-01-11 20:40:35 +01:00
Marek Safar 30f6c9933a [mcs] Don't do constraints on fabricated generic methods. Fixes #47672 2017-01-11 20:18:13 +01:00
Marek Safar cd9f3030cd [System.Windows.Forms] Clean up misused __MonoCS__ 2017-01-11 20:18:13 +01:00
monojenkins fc057335ef [msvc] Update csproj files (#4226) 2017-01-11 19:35:12 +01:00
Alexander Köplinger 5b014f9c48 Merge pull request #4224 from akoeplinger/fix-46602
[btls] Create a native BTLS key handle for X509CertificateImplBtls.PrivateKey
2017-01-11 19:32:38 +01:00
Zoltan Varga 6e72e0ec95 Lldb support code for mono (#4225)
* Initial version of lldb support code.

* [lldb] Keep all the debug entries in a linked list so lldb can read it after attaching to the process.

* [lldb] Add an --enable-minimal=lldb option to disable the code. Add locking.

* [lldb] Add support for dynamic methods by adding a new protocol entry for unloading code regions.

* [lldb] Add beginnings of a test suite using the lldb python bindings.

* [lldb] Emit line number info for methods, not used yet.

* [lldb] Add dummy fields to structures to make sure 64 bit fields are 64 bit aligned.

* [lldb] Finish emission of line number info.

* [lldb] Use mono_method_full_name () for computing method names.

* [lldb] Emit info for specific trampolines as well.

* [lldb] Add tests for line number info.

* [lldb] Fix unwind info encoding on x86.

* [lldb] Skip seq points with no native offset.

* [lldb] Add tests for breakpoints.
2017-01-11 12:12:32 -05:00
Aleksey Kliger (λgeek) bf862b4206 [remoting] Coop handles for proxy objects (#4208)
* [remoting] Use coop handles in several functions

  - icall System.Runtime.Remoting.Proxies.RealProxy.InternalGetTransparentProxy
  - mono_remote_class
  - mono_remote_class_vtable
  - mono_upgrade_remote_class
  - mono_object_handle_get_virtual_method
  - mono_object_handle_isinst
  - mono_object_handle_isinst_mbyref

* [reflection] Use handles in System.RuntimeTypeHandle.IsInstanceOfType

* [runtime] Rewrite mono_object_castclass_mbyref
  in terms of mono_object_handle_isinst_mbyref.

  This is an external API function that isn't used inside the runtime.

* [runtime] Remove mono_object_isinst_mbyref_checked

  It was a runtime internal funciton.

  All of its former callers have been converted to use mono_object_handle_isinst_mbyref.
2017-01-11 10:38:49 -05:00
Marek Safar 9197bd0e1c Merge pull request #4219 from marek-safar/corert-bump
Update ValueTuple implementation
2017-01-11 14:32:31 +01:00
Vlad Brezae c7978a2788 [corlib] Avoid unnecessary ephemeron array resizes 2017-01-11 13:22:25 +02:00
Vlad Brezae a3b053bacf [corlib] Avoid unbounded resizes of ephemeron arrays
We compute the size of the array based on how many live ephemerons it stores, and not based on the previous size of the array which doesn't indicate anything.

Fixes leak from #47388.
2017-01-11 13:21:59 +02:00
Marek Safar ddb72c43c8 [corlib] Update ValueTuple implementation 2017-01-11 11:01:24 +01:00
Marek Safar 3d9aca5e59 Bump corert 2017-01-11 11:01:23 +01:00
Zoltan Varga bf1862930b [jit] Extends an array in mono_spill_global_vars () instead of asserting. Fixes #50789. (#4201) 2017-01-11 04:31:21 -05:00
Marek Safar 6a5fd42faf Merge pull request #4222 from alexanderkyte/fix_mismatch_com_disabled
[runtime] Fix corlib out of date error with disabled COM
2017-01-11 09:44:17 +01:00
Chris Hamons bb0564ff3c Mono BCL test fixes so XM can run them (#4210) 2017-01-10 16:59:08 -06:00
Alexander Köplinger a9d75b4b66 [btls] Create a native BTLS key handle for X509CertificateImplBtls.PrivateKey
When setting X509CertificateImplBtls.PrivateKey we'd previously just
update the fallback instance. This causes problems if other code
internal to System.dll like MonoBtlsContext.SetPrivateCertificate()
tries to fetch the NativePrivateKey since it'd be null at that point.

This scenario happens e.g. with HttpListener, it supports a special
directory in ~/.config/.mono/httplistener which contains <port>.cer
and <port>.pvk files (public and private key) that will be used
as the server certificate. In that code we're reading the private
key from the file and assigning it to X509CertificateImplBtls.PrivateKey
without ever having a native BTLS handle.

The fix is to create such a native BTLS handle from the managed
private key when needed.

Note that we can't simply always do this e.g. in the PrivateKey
setter because the setter will be used with instances that
don't actually contain a private key. We can't throw in those
cases so instead we do it only when NativePrivateKey is accessed.

To make the code clearer and easier to read, `privateKey` was
renamed to `nativePrivateKey` in X509CertificateImplBtls.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46602
2017-01-10 22:33:49 +01:00
Alexander Köplinger af85a09321 [btls] Call Reset() in X509CertificateImplBtls.Import()
Otherwise we'd not clear the fields like subjectName, issuerName, etc.
and the properties they're backing would continue to return old values.
2017-01-10 22:20:16 +01:00
Alexander Köplinger 2cadd74de8 [btls] Free handle returned by EVP_PKEY_get1_RSA
From the header docs:

> The |get1| functions return a fresh reference to the underlying
> object or NULL if |pkey| is not of the correct type.
2017-01-10 22:20:15 +01:00
Alexander Köplinger 27b7a9f2c6 [System] Use non-obsolete API in SslStream 2017-01-10 21:45:02 +01:00
monojenkins 6c97220ddc [msvc] Update csproj files (#4221) 2017-01-10 19:33:39 +01:00
Alexander Kyte 4d5088dbe3 [runtime] Fix corlib out of date error with disabled COM 2017-01-10 18:26:18 +00:00
Alexander Köplinger ca5104094c [bcl] Remove System.Activities.Presentation folder from referencesource
We won't import it into Mono anytime soon and the long paths
cause issues when checking out Mono on Windows.
2017-01-10 16:31:29 +01:00
Aleksey Kliger (λgeek) ea176c5bb8 [reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle (#4217)
* [sre] Add typed coop handle declarations

* [reflection] Implement mono_reflection_get_token_handle

  Rewrite mono_reflection_get_token_checked to use it.

* [reflection] Use handles for ves_icall_reflection_get_token

  - Get rid of mono_reflection_get_token_checked
  - Rename mono_reflection_get_token_handle to mono_reflection_get_token_checked

* [reflection] Use handles for ves_icall_GetCurrentMethod

* [reflection] Use handles for ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType_native

* [reflection] Use handles for ves_icall_System_Reflection_Module_ResolveSignature

* [reflection] Use handles for ves_icall_System_Type_internal_from_name

* [reflection] Use handles for ves_icall_System_Type_internal_from_handle

* [runtime] Use coop handles for System.Object.GetType ()

* [reflection] Use handles for ves_icall_MonoField_GetParentType

* [reflection] Use handles for ves_icall_MonoField_ResolveType

* [reflection] Use handles for most icalls in System.RuntimeTypeHandle

  - GetArrayRank
  - GetAttributes
  - GetBaseType
  - GetElementType
  - HasInstantiation
  - IsArray
  - IsByRef
  - IsComObject
  - IsGenericTypeDefinition
  - IsGenericVariable
  - IsPointer
  - IsPrimitive
  - type_is_assignable_from

* [reflection] Use handles for ves_icall_RuntimeTypeHandle_GetGenericTypeDefinition_impl

  and ves_icall_RuntimeTypeHandle_GetGenericParameterInfo
2017-01-10 10:22:14 -05:00
Aleksey Kliger 086b93022e [runtime] Set the pinvoke bit for handles-using icall callsites.
The MonoMethodSignature:pinvoke bit causes the IR translation to clear the
upper bits of return values that are smaller than a register. (See
mono_emit_widen_call_res)

Without this change, any icall returning a boolean (8 bits on .NET) might have
non-zero upper bits which will cause branches to misbehave.
2017-01-10 10:05:05 -05:00
Marek Safar d97516d1d1 [build] Add WIN_PLATFORM define 2017-01-10 11:14:22 +01:00
Zoltan Varga 7512b5422b Revert "[configure] avoid 'no symbols' warnings on darwin"
This reverts commit c1f39f3cb4.

Reverted this to get CI back.
2017-01-09 18:15:41 -05:00
Zoltan Varga 2ba6bcbc48 [aot] Rewrite the AOT profiler. (#4176)
* [aot] Rewrite the AOT profiler.

The AOT profiler is used to collect the methods/instances used at runtime.
Usage:
* mono --profile=aot:output=out.aotprof <app>
* mono --aot=profile=out.aotprof <assembly>

The first command will run <app>, collecting the list of methods it uses into the out.aotprof file.
The second command passes the profile file to the AOT compiler to have it generate additional generic instances.

* [docs] Add a section for AOT profiling to the mono(1) man page.

* [build] Collect AOT profile info from building mscorlib in the build profile, and use it when aot-ing the csc assemblies.

* [runtime] Add missing mono-profiler-aot.h file.

* [runtime] Tidy up usage of MONO_PROFILER_API.

* [aot] Improve error handling in the aot profiler.

* [aot] Improve error handling, add more diagnostics.
2017-01-09 17:37:57 -05:00
Bernhard Urban ec10c6e3fb [amd64/tramp] hide interpreter specific trampoline behind ifdef 2017-01-09 23:34:04 +01:00
Bernhard Urban 21b0819db1 [interpreter] fix warnings in trampoline and remove dead code 2017-01-09 23:34:01 +01:00
Bernhard Urban 918958bbdb [interpreter] get rid of ugly copy/paste hack and include mini.h instead 2017-01-09 23:33:58 +01:00
Bernhard Urban 9fef9cfb66 [interpreter] fix compiler warnings 2017-01-09 23:33:56 +01:00
Bernhard Urban a7c2b841b9 [interpreter] remove basic-simd.exe from richeck target
due to the switch to roslyn we get different code for certain scenarios;
roslyn relies more on a working implementation of generics...
2017-01-09 23:33:53 +01:00
Bernhard Urban a4fcc5a694 [interpreter] guard some debug messages with DEBUG_INTERP 2017-01-09 23:33:51 +01:00
Bernhard Urban a7aba9c582 [interpreter] initialize tls subsystem 2017-01-09 23:33:48 +01:00
Bernhard Urban 796e882c19 [interpreter] remove CALLINT opcode, go through wrapper instead.
the managed wrapper already does everything properly, don't replicate
the logic. For example, since recently some icalls marked with `HANDLE`
require a MonoError object.
2017-01-09 23:33:45 +01:00
Bernhard Urban a81fa4ca1e [interpreter] support conversion of internal pointer type in conv.u 2017-01-09 23:33:43 +01:00
Bernhard Urban f1e08ad12f [interpreter] master rebase fixups 2017-01-09 23:33:40 +01:00
Bernhard Urban 3a29de4999 [interpreter] remove FIXME 2017-01-09 23:33:38 +01:00
Bernhard Urban 609b2c3257 [interpreter] implement CEE_MONO_LDPTR_INT_REQ_FLAG 2017-01-09 23:33:35 +01:00
Bernhard Urban 36e075d3f2 [interpreter] factor out CALL transformation
... so that it can be reused for CEE_MONO_CALLI_EXTRA_ARG
2017-01-09 23:33:32 +01:00
Bernhard Urban 16c727740e [interpreter] add MINT_ICALL_V_P opcode 2017-01-09 23:33:30 +01:00
Bernhard Urban beb96e3cf4 [interpreter] allow up to three arguments in interpreter->native trampoline 2017-01-09 23:33:27 +01:00
Bernhard Urban e8cfc817b7 [interpreter] fix multicast delegates 2017-01-09 23:33:24 +01:00
Bernhard Urban 79f61fbc17 [interpreter] properly clean up the error in get_virtual_method 2017-01-09 23:33:22 +01:00
Bernhard Urban 10430d10ce [interpreter] fix interface method lookup 2017-01-09 23:33:19 +01:00
Bernhard Urban a399d26270 [interpreter] fix ves_array_set 2017-01-09 23:33:16 +01:00
Bernhard Urban 2e9f51d2d7 [interpreter] support return vals in interpreter->native trampoline 2017-01-09 23:33:14 +01:00
Bernhard Urban dd8dfa78c9 [interpreter] do proper unboxing according to its type 2017-01-09 23:33:11 +01:00
Bernhard Urban 500afe3edc [interpreter] add filter to regression harness 2017-01-09 23:33:09 +01:00
Bernhard Urban cfebb416c8 [interpreter] remove wrong error trap 2017-01-09 23:33:06 +01:00
Bernhard Urban b06df4403c [interpreter] fix vtable lookup 2017-01-09 23:33:03 +01:00
Bernhard Urban f241afa9ce [interpreter] implement UNBOX_ANY with UNBOX (ignoring generics) 2017-01-09 23:33:01 +01:00
Bernhard Urban 29de444b4f [interpreter] register missing callback 2017-01-09 23:32:58 +01:00
Bernhard Urban 342285a5bb [interpreter] improve --regression flag wrt exceptions 2017-01-09 23:32:55 +01:00
Bernhard Urban ecc0f09a9e [interpreter] first version of trampoline for interpreter->native transition
this trampoline is supposed to handle an arbritrary amount of arguments.
The trade-off is that this is a bit slower, however, it only requires
one instantiation as opposed to an instantiation for every method
signature.
2017-01-09 23:32:53 +01:00
Bernhard Urban 7db2325992 [interpreter] more asserts and debug info 2017-01-09 23:32:50 +01:00
Bernhard Urban be27ecc37d [ci] add interpreter 2017-01-09 23:32:48 +01:00
Bernhard Urban d29b812ca7 [interpreter] run more regression tests 2017-01-09 23:32:45 +01:00
Bernhard Urban 2bc49b4f03 [mini] update .gitignore 2017-01-09 23:32:42 +01:00
Bernhard Urban 355b85fa59 [interpreter] add configure flag and --regression flag 2017-01-09 23:32:40 +01:00
Bernhard Urban aeb374d274 [interpreter] make stacktraces partially work 2017-01-09 23:32:37 +01:00
Bernhard Urban 4cfd69c91e [interpreter] throw overflow exception for div instruction 2017-01-09 23:32:34 +01:00
Bernhard Urban 6f98c98c8e [interpreter] add --regression feature for basic execution engine tests 2017-01-09 23:32:32 +01:00
Bernhard Urban 88385892af [interpreter] print instruction as string 2017-01-09 23:32:29 +01:00
Bernhard Urban d7c2e71e32 [interpreter] output thread addr as hex 2017-01-09 23:32:26 +01:00
Bernhard Urban 280222dcd4 [interpreter] fix build 2017-01-09 23:32:24 +01:00
Bernhard Urban c9fe53836a [interpreter] revive mono interpreter 2017-01-09 23:32:21 +01:00
Alexander Köplinger 0007e99a87 [btls] Capture inner exception in MobileAuthenticatedStream
Previously we'd just throw the catched exception again
which overwrites its stacktrace, making it less useful
since all you can see is e.g. a NullReferenceException
(re)thrown at MobileAuthenticatedStream:218.

We now capture the original exception information so
the stacktrace is more complete.
2017-01-09 19:48:37 +01:00
Alexander Köplinger ecf1f25fcd [btls] Use MONODROID ifdef instead of ANDROID
We use the former everywhere else in the codebase.
2017-01-09 18:59:10 +01:00
Alexander Köplinger 6d2420f49a [btls] Fix wrong path returned from MonoBtlsProvider.GetSystemStoreLocation()
The path ".mono/certs/NewTrust" doesn't actually exist,
it's called ".mono/new-certs/Trust". Look it up from
MonoBtlsX509StoreManager instead.

This API isn't used anywhere in the BTLS code, that's
probably why it wasn't noticed.
2017-01-09 18:55:51 +01:00
Alexander Köplinger 8c95b57796 [Mono.Security] Add message to obsolete APIs with replacements
It's very confusing to get an "obsolete" warning
without knowing what to replace the API with.
2017-01-09 17:29:15 +01:00
Marek Safar c3b962c865 [System] Fixes ios unresolved symbols 2017-01-09 16:53:46 +01:00
Johan Lorensson 440a7c06af Merge pull request #4195 from lateralusX/jlorenss/win-build-dependency
Fix build_init vcxproj to correctly detect changes in config.h.
2017-01-09 14:20:38 +01:00
Jonathan Chambers bccf7177f7 Add code manager callbacks so JIT can track memory chunk ranges and register stack walk handlers on Win64 (#4213) 2017-01-07 04:00:37 -05:00
Marek Safar 129f185e58 Bump nunit-lite 2017-01-06 17:40:53 +01:00
Marek Safar 3088ba686e [tools] Add C# strings encoding to resx2sr 2017-01-06 17:40:26 +01:00
Marek Safar 695282c94b [build] Update mini tests tools to use correct path 2017-01-06 10:28:04 +01:00
Marek Safar 6245fc7b4e [corlib] Clean up some warnings 2017-01-06 09:12:42 +01:00
Zoltan Varga ee0c587fff [aot] Avoid a crash in the aot compiler if a delegate doesn't have a BeginInvoke ()/EndInvoke () method. Fixes #51206. 2017-01-05 19:46:53 -05:00
Zoltan Varga 2d7588f339 [jit] Fix the check for calling mono_get_vtable_var (), check for 'cfg->method' instead of 'method', the latter is the inlined method. (#4209) 2017-01-05 19:24:05 -05:00
Zoltan Varga b428249c7a [aot] Aot System.Numerics.dll as well for the make fullaotcheck/llvmonlycheck targets. 2017-01-05 16:39:58 -05:00
Aleksey Kliger 286ddebd9c Revert "[reflection] Additional coop handles changes (#4197)"
This reverts commit 59ed24831a.
2017-01-05 12:08:53 -05:00
monojenkins c11459faf3 [msvc] Update csproj files (#4207) 2017-01-05 17:36:22 +01:00
Aleksey Kliger (λgeek) 59ed24831a [reflection] Additional coop handles changes (#4197)
* [sre] Add typed coop handle declarations

* [reflection] Implement mono_reflection_get_token_handle

  Rewrite mono_reflection_get_token_checked to use it.

* [reflection] Use handles for ves_icall_reflection_get_token

  - Get rid of mono_reflection_get_token_checked
  - Rename mono_reflection_get_token_handle to mono_reflection_get_token_checked

* [reflection] Use handles for ves_icall_GetCurrentMethod

* [reflection] Use handles for ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType_native

* [reflection] Use handles for ves_icall_System_Reflection_Module_ResolveSignature

* [reflection] Use handles for ves_icall_System_Type_internal_from_name

* [reflection] Use handles for ves_icall_System_Type_internal_from_handle

* [runtime] Use coop handles for System.Object.GetType ()

* [reflection] Use handles for ves_icall_MonoField_GetParentType

* [reflection] Use handles for ves_icall_MonoField_ResolveType

* [reflection] Use handles for most icalls in System.RuntimeTypeHandle

  - GetArrayRank
  - GetAttributes
  - GetBaseType
  - GetElementType
  - HasInstantiation
  - IsArray
  - IsByRef
  - IsComObject
  - IsGenericTypeDefinition
  - IsGenericVariable
  - IsPointer
  - IsPrimitive
  - type_is_assignable_from

* [reflection] Use handles for ves_icall_RuntimeTypeHandle_GetGenericTypeDefinition_impl

  and ves_icall_RuntimeTypeHandle_GetGenericParameterInfo
2017-01-05 11:29:09 -05:00
Marek Safar b572846271 [System] Cleanup some warnings 2017-01-05 15:01:08 +01:00
Marek Safar 22d1d4ad1c Merge pull request #4205 from marek-safar/compression
[System] Use GZipStream from corefx
2017-01-05 09:37:55 +01:00
Alexander Köplinger ffff742d89 [bcl] Look in all .sources files when gathering files to dist
Previously we would only look into files ending in libraryname.sources.
This breaks down in cases where we used e.g. "#include common.sources"
because those files don't match the pattern and would be left out.

To fix this we could either start resolving includes in the .sources,
but the simpler fix is to just dist files from all normal .sources files.
2017-01-05 03:58:36 +01:00
Bernhard Urban c1f39f3cb4 [configure] avoid 'no symbols' warnings on darwin
This helps to get rid of the messages like these:

```
/Applications/Xcode8.1-beta1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libmonosgen-2.0.a(libmonoruntimesgen_la-coree.o) has no symbols
/Applications/Xcode8.1-beta1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libmonosgen-2.0.a(libmonoruntimesgen_la-file-mmap-windows.o) has no symbols
/Applications/Xcode8.1-beta1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libmonosgen-2.0.a(libmonoruntimesgen_la-lock-tracer.o) has no symbols
/Applications/Xcode8.1-beta1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libmonosgen-2.0.a(libmonoruntimesgen_la-mono-endian.o) has no symbols
[...]
```

That is what is in `libtool`:

```
# Commands used to build an old-style archive.
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
```

`ar` is calling `ranlib`, and then `libtool` calls `ranlib` again. We
cannot control how `ar` calls `ranlib` (that is, we can't tell it to
pass `-no_warning_for_no_symbols`), but we can control to not call it
at all.  Let's to that then.

As a reference, source code of `ar`:
https://opensource.apple.com/source/cctools/cctools-895/ar/ar.c.auto.html
2017-01-05 01:46:37 +01:00
monojenkins 0ef271dcc2 [msvc] Update csproj files (#4204) 2017-01-04 23:50:10 +01:00
Alexander Köplinger 5c4f9d7528 [mcs] Accept and ignore /debug:portable option
We'll just generate a normal .mdb instead.

Decided not to update the help text since
technically we don't support generating a ppdb.
2017-01-04 23:46:03 +01:00
Marek Safar cb2dfe18fd [System] Use GZipStream from corefx 2017-01-04 23:37:19 +01:00
Marek Safar 5f5e06f59c Merge pull request #4202 from marek-safar/compression
[System.IO.Compression] Replaced by corefx implementation
2017-01-04 23:32:36 +01:00
Alexander Kyte 9b02604cc6 [llvmonly] Use right IMT slow path for lazy array interfaces (#4199) 2017-01-04 17:00:34 -05:00
Alexander Köplinger 10dd36e3a8 [System.Core] Fix infinite loop in csproj-local target
This was introduced in 9d5de96b0f since
we would now call the csproj-local target without `intermediate`
being set which results in an infinite loop.

Overriding the target doesn't seem to be necessary anymore, so remove it.
2017-01-04 22:32:53 +01:00
Alexander Köplinger 488b550ac0 [btls] Pass CC and CXX to the BTLS CMake and disable BTLS on older GCC (#4200)
CMake doesn't pick up the compiler from the PATH by default,
it only looks in default locations so without this we might
end up using a different compiler for BTLS than for the main
Mono build which we don't want.

BTLS also requires a fairly new GCC which includes C++11
features, added a quick check for stdalign.h which BTLS
requires and disable it if the header isn't found.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46712
2017-01-04 19:49:41 +01:00
Marek Safar 5dd56dbe70 [build] Fixes monotouch_tv_runtime build 2017-01-04 17:34:34 +01:00
Marek Safar 87eabe71f4 [build] Fixes monotouch_runtime build 2017-01-04 17:19:49 +01:00
Marek Safar 3f9b2dfd5f [System.IO.Compression] Replaced by corefx implementation 2017-01-04 15:37:40 +01:00
Marek Safar b7f6f7976e Revert "Bump corlib version"
This reverts commit acf7d85971.
2017-01-04 13:46:29 +01:00
Marek Safar 7c09a59ee3 [System] Compression enums from corefx 2017-01-04 13:01:09 +01:00
Marek Safar e12d557e4e [build] Fixes tarball build on systems with old mono 2017-01-04 12:37:12 +01:00
David Karlaš 41bb2b5316 Merge pull request #4196 from DavidKarlas/stepAndCatchException
[Debugger] Fixed step-in and step-out in case of exception + unit tests
2017-01-04 07:49:11 +01:00
Vladimir Kargov d726f624da [jit] Remove the meaningless lokup loop in mono_merge_basic_blocks(), add assertions. 2017-01-03 16:18:08 -08:00
Alexander Köplinger ce68b90aa7 [System] Include common.sources in the tarball 2017-01-04 01:12:58 +01:00
Alexander Köplinger acf7d85971 Bump corlib version
Somehow mcs.exe disappeared from monolite even though it was added
in 68d56e8027 and worked for a while.

See if bumping corlib version (i.e. generating a new monolite) fixes it.
2017-01-04 01:04:32 +01:00
Alexander Köplinger 23dbe0e1d6 [xbuild] Fix test that got broken by 248fded92a 2017-01-03 22:38:09 +01:00
Vlad Brezae 379436fcf5 Merge pull request #4152 from BrzVlad/misc-gc-altstack
[sgen] Reenable gc-altstack test
2017-01-03 21:12:46 +02:00
Marek Safar e1421384bd [System] Warnings cleanup 2017-01-03 17:05:26 +01:00
Marek Safar 09774416fd [System] Keep single MonoPInvokeCallbackAttribute implementation 2017-01-03 16:01:24 +01:00
Marek Safar 208dd1e956 [System] Unify Mono.Security dependency to be same for all profiles 2017-01-03 15:13:57 +01:00
Marek Safar 248fded92a [xbuild] More tweaks for portable debug mode 2017-01-03 11:02:09 +01:00
Marek Safar 19dd86f809 [mcs] Disable more array interpolation on user code. Fixes #51166 2017-01-02 19:12:13 +01:00
Marek Safar 676c45bd3e Merge pull request #4194 from DavidKarlas/bug44974
Bug 44974 - [pdb] stepping over is not working
2017-01-02 19:03:45 +01:00
Marek Safar 9ea10965af Roslyn 2.0 (rc2) upgrade 2017-01-02 18:51:40 +01:00
David Karlaš 9a231cd18e [Debugger] Fixed step-in and step-out in case of exception + unit tests
Before this change step-in and step-out didn’t place breakpoints on catch handlers which caused code to continue execution instead of stopping since it missed all breakpoints…
2016-12-28 21:03:53 +01:00
lateralusX 23b8b5d387 Fix build_init vcxproj to correctly detect changes in config.h.
build_init project doesn't detect changes done in config.h. This is needed in order
for build_init to replace config.h with winconfig.h and backup cygconfig.h. This is
normally an issue if you do a reconfigure and build using make and then msbuild. The msbuild
will then fail, since config.h is still the cygwin version. Solution is to do a rebuild all
that will trigger build_init. This fix will make sure that build_init gets invoked if there has been a change to config.h.

There was also a very old issue with the first copy of config.h -> cygconfig.h. This is only done
if there is no cygconfig.h in the directory. This means that the cygconfig.h will not be update until
deleted and a new build_init has been invoked. This fix will make sure cygconfig.h is always updated
if config.h is the cygwin generated version (not already replaced with winconfig.h).
2016-12-28 16:50:54 +01:00
David Karlaš 7308137e43 Merge pull request #4193 from DavidKarlas/stepinSpeedup
[Debugger] Fixed bug where we loop randomly long(+1) and optimised stepping in(over) non-user code
2016-12-28 15:33:53 +01:00
David Karlaš ad14ebb899 [Debugger] Fixed bug where we loop randomly long(+1 part) and optimised stepping in(over) non-user code 2016-12-28 15:22:11 +01:00
David Karlaš 7996debb67 Bug 44974 - [pdb] stepping over is not working
mcs.exe didn’t emit some NOPs after method calls needed when doing StepOut, now that Roslyn emits this we correctly step out to line that called hence, some unit tests needed correcting
2016-12-28 15:11:02 +01:00
Zoltan Varga f997a6e0de [simd] Enable simd support when 32 bit floats are enabled. 2016-12-27 22:09:52 -05:00
Zoltan Varga 533f6c5675 [llvm] Fix compilation/working with recent llvm versions. This should work with 4d6d2b05a267f9f4e46fdbb302f380add938b0cd from the mono/llvm repo. 2016-12-27 20:08:55 -05:00
Zoltan Varga 8b40ce3f32 Fix a warning. 2016-12-27 18:02:48 -05:00
Aleksey Kliger (λgeek) 972f3c8ced [reflection] Use handles for several more icalls (#4098)
* [runtime] Remove MonoReflectionGenericMethod typedef.

  - It's not used in the runtime,
  - Unlike other defs in object-internals.h it doesn't seem to have a
    corresponding managed object.

* [reflection] Add mono_field_get_object_handle.

  Reimplement mono_field_get_object and mono_field_get_object_checked in
  terms of it.

* [reflection] Add mono_property_get_object_handle

  Reimplement mono_property_get_object and
  mono_property_get_object_checked in terms of it.

* [reflection] Use handles for FieldInfo,MonoPropertyInfo,ParameterInfo.GetTypeModifiers

* [reflection] Use handles for MonoMethodInfo.get_parameter_info

  - Change mono_param_get_objects_internal to use handles

* [reflection] Cleanup in method_object_construct

* [reflection] Use handles for System.Refleciton.EventInfo.internal_from_handle_type

  - Replace mono_event_get_object_checked by mono_event_get_object_handle
    which uses handles.

* [reflection] Use handles for System.Reflection.MethodBase.GetMethodBodyInternal

  - Replace mono_method_body_get_object_checked by
    mono_method_body_get_object_handle

* [reflection] Remove CHECK_OR_CONSTRUCT, it's dead code.

  All former callers now use CHECK_OR_CONSTRUCT_HANDLE

* [reflection] Use handles for FieldInfo.get_marshal_info and MonoMethodInfo.get_retval_marshal

  - Change mono_reflection_marshal_as_attribute_from_marshal_spec to
    return a handle; fix callers

* [metadata] Add mono_metadata_get_canonical_generic_inst utility function

* [reflection] Use handles for System.Reflection.Module.ResolveMemberToken and 3 more icalls

  - ResolveFieldToken
  - ResolveMethodToken
  - ResolveTypeToken
2016-12-27 15:37:18 -05:00
Aleksey Kliger 1fc6bdd1b0 [threadpool] Restore handle stack mark after a worker PerformWaitCallback
If a task calls native code that uses handles before completing, we should
dispose of any handles that it may have used before we park the worker.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=49423
2016-12-27 10:48:29 -05:00
Aleksey Kliger 82bbb8dbd8 [sgen] Assert that skipped threads have empty an HandleStack
If we skip scanning a thread with a non-empty handle stack, we may move an
object but fail to update the reference in the handle.
2016-12-27 10:48:29 -05:00
Aleksey Kliger fd7e072c8d [coop handles] Add mono_handle_stack_is_empty 2016-12-27 10:48:29 -05:00
Aleksey Kliger ed456c195f [coop handles] Add MONO_HANDLE_TRACK_OWNER mode.
If MONO_HANDLE_TRACK_OWNER is defined, each coop handle records the source location
where it was first allocated.
2016-12-27 10:48:29 -05:00
Alexander Köplinger d30ee1904c [System] Fix basic/build profile build
It was broken by 37875ca6f3.
2016-12-22 23:41:18 +01:00
Zoltan Varga faa5d1a9f7 [runtime] Add a few missing object offsets for arm. 2016-12-22 17:32:27 -05:00
Neale Ferguson 213568cf8e [jit] Fix a test which fails on big endian. 2016-12-22 17:11:07 -05:00
Marek Safar 37875ca6f3 [System] Remove duplicated sources info 2016-12-22 19:16:32 +01:00
Marek Safar 4d498e2be3 [System] remove unused file 2016-12-22 19:16:32 +01:00
Alexander Köplinger 045dbc0991 configure.ac: set CSC variable to mcs.exe when using mcs as the compiler
Otherwise it'd still be using Roslyn e.g. in mono/mini as $(CSC)
would continue to point to the Roslyn csc.exe which is wrong.
2016-12-22 18:49:46 +01:00
Aleksey Kliger (λgeek) 87b786ed92 Pump hazard pointer queue in unregister_thread while thread is still alive. (#4183)
Some of the destructors (for example mono_jit_info_table_free) may try to take
a lock, which requires that the current thread should be attached.
2016-12-22 11:41:04 -05:00
faulpeltz 10e1dc5314 Fix MonoBtlsX509StoreManager machine store paths (#4027)
The machineXYZPath fields are initialized with machinePath instead of
userPath which caused the machine stores not to work at all
2016-12-22 14:08:50 +01:00
Zoltan Varga ebf1f1cfd2 Fix a regression introduced by 98d7ad045e. 2016-12-22 07:07:12 -05:00
Marek Safar 815c007826 [build] More mcs hacking 2016-12-22 11:40:47 +01:00
Marek Safar e063415208 [build] install csc aot images from aot folder 2016-12-22 11:37:21 +01:00
Marek Safar 27ab4a8175 [System.Xml] Disable more failing tests on old xslt implementation 2016-12-22 10:38:02 +01:00
Marek Safar 2659724dd3 [System.Xml] Disable failing tests on old xslt implementation 2016-12-22 10:31:22 +01:00
Zoltan Varga 1a75e32112 [build] Pass --aot-path to the runtime when building the tests in tests/. 2016-12-21 20:41:15 -05:00
Zoltan Varga 4fe7a65f4f [build] Generate all aot images for csc into the profile directory instead of next to the corresponding assembly so the external/roslyn-binaries submodule doesn't get dirty. Pass the --aot-path argument to the runtime so it picks up the aot images. 2016-12-21 20:39:01 -05:00
Zoltan Varga 56498ccc8f Fix warnings. 2016-12-21 19:48:43 -05:00
Zoltan Varga 8199f32d3e [runtime] Remove some dead code. 2016-12-21 19:37:57 -05:00
Zoltan Varga 98d7ad045e [aot] Cleanup the AOT loading code a bit. Add a --aot-path= command line option to specify additional directories to search for AOT images. (#4191) 2016-12-21 19:30:27 -05:00
Alexander Köplinger 8027e0bb39 [bcl] Clean up old run-test.bat and *.csproj files
They .bat files haven't been used for a long time and don't work anymore.
The csproj files for the facades have a different name now.
2016-12-22 01:09:38 +01:00
Bernhard Urban 801cc68583 [exceptions] unregister SIGILL handler before calling abort () 2016-12-21 17:25:04 +01:00
Bernhard Urban a27bc024f1 [exceptions] only do SIGSEGV related actions for SIGSEGVs in mono_handle_native_crash 2016-12-21 17:25:04 +01:00
Michael DeRoy 3ceb9543ce Do not free marshaled string conversion buffer on win32 (#4140) 2016-12-21 11:21:47 -05:00
Alexander Köplinger b0ba5b9594 Include Open.snk in tarball 2016-12-21 16:51:47 +01:00
Marek Safar a3f17f8007 Merge pull request #4187 from rolfbjarne/dynamic-method-ios
[test] DynamicMethod isn't available on iOS.
2016-12-21 16:44:54 +01:00
Marek Safar 453e9feace [System.IO.Compression.ZipFile] Switch to corefx implementation 2016-12-21 16:43:42 +01:00
Henric Müller 71275496e8 Renamed profile to winaot (#4190) 2016-12-21 16:41:01 +01:00
Rolf Bjarne Kvinge 36cbe76167 [test] Use FULL_AOT_RUNTIME instead of MONOTOUCH. 2016-12-21 16:32:29 +01:00
Marek Safar e68d46f855 Merge pull request #4188 from Unity-Technologies/missing-internals-visible-to
Add missing InternalsVisibleTo attributes on mscorlib.
2016-12-21 15:58:21 +01:00
Marek Safar 48eeda4314 [build] Update runtime test tools to use correct path 2016-12-21 14:51:46 +01:00
Marek Safar 24d6656cb8 [ilasm] Don't break arguments compatiblity 2016-12-21 14:17:17 +01:00
Marek Safar d82b6dbac5 [ilasm] Clenup warnings 2016-12-21 14:13:30 +01:00
Vlad Brezae 088ea9db6e Merge pull request #4185 from BrzVlad/fix-arm64-finally-abort
[arm64] Fix finally abort
2016-12-21 15:12:44 +02:00
Tautvydas Žilys a970158e0d Add missing InternalsVisibleTo attributes on mscorlib. 2016-12-21 13:45:32 +02:00
Alexander Köplinger c5054e44a6 Merge pull request #4159 from akoeplinger/aot-only-rename
[bcl] Rename aot_only profile to testing_aot_full, aot_hybrid to testing_aot_hybrid
2016-12-21 12:37:35 +01:00
Rolf Bjarne Kvinge 5948e157e8 [test] DynamicMethod isn't available on iOS. 2016-12-21 11:44:10 +01:00
Alexander Kyte b8625e671a [runtime] Always expire a non-resolved hostname's cache
This addresses a regression here:

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

The commits
97e51abfcf and
d35b5d2188

changed control flow such that if the host can't be resolved
and host is set to null, then the later check will return null
for the duration that HasTimedOut is false.
2016-12-21 11:06:03 +01:00
Marek Safar edea0795cf Merge pull request #4184 from madewokherd/roslynaot
Fix roslyn install with AOT disabled.
2016-12-21 10:40:42 +01:00
Marek Safar b674f24074 [System.Core] LINQ from corefx 2016-12-21 10:07:54 +01:00
Vlad Brezae 6bc46fb15e [arm64] Fix finally abort
A try finally set looks like :

try:
   ...
   call finally
E: exit try_block

finally:
   ...
   call E

If we get aborted in the finally block, instead of calling to E, we call to a handler block trampoline which will throw the exception using a context that has the ip at E (since we need to execute the finally block first). We need to make sure that E is not logically part of the try block, otherwise we will end up calling the finally block again when unwinding the stack.
2016-12-21 03:40:16 +02:00
Zoltan Varga efea69ee03 [amd64] Disable boehm on osx64. 2016-12-20 19:44:06 -05:00
Vincent Povirk ba6c212d32 Fix roslyn install with AOT disabled. 2016-12-20 16:45:42 -06:00
João Matos 66d4425f04 Merge pull request #4118 from petertiedemann/fix-bug-48516
Fix bug 48516
2016-12-20 20:38:03 +00:00
Alexander Köplinger 5f885d53e7 [System.Xml] Fix casing of System.dll reference in Xslt compiler
Some XML tests enabled as part of 93e845de16 failed
on Linux because of the lowercased system.dll reference in referencesource:

```
1) CompileNoLineInfoSource (MonoTests.System.Xml.Xsl.MsxslScriptTests.CompileNoLineInfoSource)
   System.Xml.Xsl.XsltException : Script compile errors:
error CS0006: Metadata file `system.dll' could not be found

  at System.Xml.Xsl.XsltOld.Compiler.CompileAssembly (System.Xml.Xsl.XsltOld.ScriptingLanguage lang, System.Collections.Hashtable typeDecls, System.String nsName, System.Security.Policy.Evidence evidence) [0x00229] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs:823
  at System.Xml.Xsl.XsltOld.Compiler.CompileScript (System.Security.Policy.Evidence evidence) [0x00016] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs:749
  at System.Xml.Xsl.XsltOld.Compiler.Compile (System.Xml.Xsl.XsltOld.NavigatorInput input, System.Xml.XmlResolver xmlResolver, System.Security.Policy.Evidence evidence) [0x0009d] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs:200
  at System.Xml.Xsl.XslTransform.Compile (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver, System.Security.Policy.Evidence evidence) [0x00022] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs:264
  at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver) [0x0000e] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs:82
  at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.IXPathNavigable stylesheet, System.Xml.XmlResolver resolver) [0x0000e] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs:69
  at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.IXPathNavigable stylesheet) [0x00000] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs:63
  at MonoTests.System.Xml.Xsl.MsxslScriptTests.CompileNoLineInfoSource () [0x00018] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/System.XML/Test/System.Xml.Xsl/MsxslScriptTests.cs:210
  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) [0x00032] in mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
```
2016-12-20 20:41:21 +01:00
Zoltan Varga cf11343eb9 [jit] Allow simple TLS accesses in gsharedvt methods. Properly propagate errors in fill_runtime_generic_context (). Fixes #49056. 2016-12-20 14:19:20 -05:00
Zoltan Varga f3580381e1 [aot] AOT System.Numerics.Vectors when running make fullaotcheck. 2016-12-20 14:19:20 -05:00
Jo Shields 031d79c2c4 [mkbundle] Don't use Path.GetDirectoryName on directory (#4130)
`directory` is already a directory. It's in the name.

`Path.GetDirectoryName ("/path/to/a/thing")` returns `"/path/to/a"`, whether
`thing` is a directory or not. If there's a trailing `/` then it returns
the directory, not the parent - but we don't have a trailing `/`.

This fixes an issue where the path needs to be created by hand before an
SDK can be downloaded.
2016-12-20 20:02:09 +01:00
Alexander Köplinger 35a677b61d Add test profiles as a list on configure.ac summary
Should be easier to extend if we add more such profiles.

Also add the new Xbox profile which was missed.
2016-12-20 19:58:20 +01:00
Alexander Köplinger 342d23b74d [bcl] Rename aot_hybrid profile to testing_aot_hybrid 2016-12-20 19:29:54 +01:00
Alexander Köplinger 4098343789 [bcl] Rename aot_only profile to testing_aot_full 2016-12-20 19:29:54 +01:00
Zoltan Varga ec228cf9a4 [runtime] Add an assert to mono_class_setup_vtable_general () to catch cases when the max_vtsize calculation is incorrect. 2016-12-20 11:49:20 -05:00
Ludovic Henry c0fe371ab1 [build] Fix warning (#4177) 2016-12-20 10:16:01 -05:00
Bernhard Urban b463080174 [coop] switch to GC unsafe state in SIGINT handler as it may throw an exception 2016-12-20 15:40:33 +01:00
Bernhard Urban ee04d9fc68 [coop] switch to GC unsafe state in SIGFPE handler as it may throw an exception 2016-12-20 15:40:33 +01:00
Rodrigo Kumpera 5148ac7e88 Merge pull request #3981 from kumpera/fix_symbolification_issues
This PR adds runtime crash symbolification. It requires runtime and tooling changes.
2016-12-20 12:05:47 -02:00
Marek Safar f3d036a124 [System.Xml] Add support for msxsl format functions. Fixes #50242 2016-12-20 14:46:17 +01:00
Marek Safar 93e845de16 [System.Xml] Enable more tests 2016-12-20 14:46:17 +01:00
Neale Ferguson 37d6cde0ee Implement fast tls for s390x (#4161)
[s390x] Implement fast tls for s390x
2016-12-20 14:56:21 +02:00
Marek Safar 4273e1ef5b [sn] Improve signing error message 2016-12-20 12:02:34 +01:00
Marek Safar 87b020af95 [System.ValueTuple] Don't emit debug symbols 2016-12-20 12:02:34 +01:00
Niklas Therning 92f6ee7bdf Merge pull request #4178 from ntherning/fix-broken-windows-build
Fix broken Windows build due to missing mini-exceptions-native-unwinder.c
2016-12-20 11:23:32 +01:00
Niklas Therning c28deafe6c Fix broken Windows build due to missing mini-exceptions-native-unwinder.c
Commit 41272d634b removed mono/mini/mini-
exceptions-native-unwinder.c from the source tree but didn't update msvc
/libmono-static.vcxproj accordingly causing the VS build to fail.
2016-12-20 11:04:14 +01:00
Marek Safar d2b161ab7b [Facades] Removes duplicate signing info 2016-12-20 10:20:07 +01:00
Bernhard Urban 41272d634b [exception] remove dynamic loading of libunwind/libcorkscrew on Android
we will rely on the output of debuggerd in order to get a native stack
trace.  The arguments to support that:

(a) native stack trace by debuggerd is at least as good as the one we get via
    libunwind (most of the time the trace provided by libunwind is useless?)

(b) we cannot screw up by accident (e.g. we have seen issues with a too small altstack)

(c) we don't need to maintain the libunwind integration into mono (which we
    sort of had to do because of the upcoming dlopen limitation in Android 7.0
    Nougat).

(d) the libmonosgen-2.0.so had about one megabyte more footprint (16mb ->
    17mb). I'm talking about a debug build here though.

See mailing list discussion for more information:
http://lists.dot.net/pipermail/android-devel/2016-December/000026.html
2016-12-20 00:19:20 +01:00
Bernhard Urban 4f1280d588 [external] remove libunwind headers 2016-12-20 00:19:20 +01:00
Zoltan Varga d8743c7a96 [arm] Fix llvm support for HFA arguments. 2016-12-19 17:54:34 -05:00
Rodrigo Kumpera 2360aab8d3 [mono-symbolificate] Add test for nested type arguments and ambiguous matches. 2016-12-19 17:39:20 -02:00
Rodrigo Kumpera ea5c562dad [mono-symbolificate] Add support for runtime generated stacktraces and fix a bug.
First the bug fix.
If we hit a method with a nested type as argument, we would not include the outer types and fail to match.

Now for the big change.
The runtime now includes mvid and aotid in the stacktraces it generates. This makes them symboficatable but
with the side effect that the runtime adopts a more compact and slightly different format. Differences includes:

- short name for primitives (int, object, string, etc)
- <> for generic instances
- / for type nesting
- generics vars are appended with _REF
2016-12-19 17:39:13 -02:00
Zoltan Varga b65d3d76f2 [bockbuild] Disable boehm on osx64. 2016-12-19 13:07:31 -05:00
Rodrigo Kumpera 66fae66334 [mini] Implement callback that gives metadata access to seqpoint information. 2016-12-19 15:57:17 -02:00
Rodrigo Kumpera 0071edc907 [runtime] Include seqpoints, mvid and aotid on runtime generated stack traces. 2016-12-19 15:56:30 -02:00
Rodrigo Kumpera f3fed72782 [runtime] Extract mono_runtime_get_aotid from the icall code. 2016-12-19 15:56:30 -02:00
Rodrigo Kumpera faf9dda1ef [runtime] Use commas for array rank instead of a number when stringifying. 2016-12-19 15:56:30 -02:00
Marek Safar 3bbff5b405 [Facades] Add missing reference 2016-12-19 18:50:58 +01:00
Alexander Köplinger 1f38ad4d93 [Facades] Use the Open.snk key for the System.ValueTuple facade (#4173)
It is one of the libraries that started using this new key for signing:
https://github.com/dotnet/buildtools/commit/141bce1285f36bac7ddcef1947a9f2105953e6e5
2016-12-19 18:25:16 +01:00
Marek Safar 3daf6b7ca1 [build] Add new profile 2016-12-19 16:36:39 +01:00
Bernhard Urban 5247fa62ed [exception] print process map when crashing on Linux 2016-12-19 16:27:33 +01:00
Bernhard Urban c54da4dbf9 [unwinding] set DUMPABLE, so debuggerd can ptrace us 2016-12-19 16:26:19 +01:00
Marek Safar 9d5de96b0f [System.Core] SLE from CoreFX including interpreter 2016-12-19 14:19:30 +01:00
Vlad Brezae 79219ca718 Merge pull request #4155 from BrzVlad/fix-tls-lmf-addr
[runtime] Fix MONO_ARCH_ENABLE_MONO_LMF_VAR
2016-12-19 14:05:19 +02:00
monojenkins e1bc49df99 [msvc] Update csproj files (#4163) 2016-12-19 12:20:27 +01:00
Neale Ferguson 933bda30fd .NET allows each finalizer thread up to 2 seconds to complete and 40 seconds for all threads to complete. However, mono just allows 2 seconds for all finalizers. Some complex applications easily exceed this and this results in thread aborts to be invoked. This fix is simplistic as it simply replaces the 2 seconds with 40 without addressing the 2 seconds per finalizer thread. This problem is more complex but this fix will circumvent the problem until a final option is designed and implemented. (#4162) 2016-12-18 08:08:48 -05:00
Sergei Trofimovich f7ea181e35 configure.ac: import makedev() and friends from <sys/sysmacros.h> (#4170)
Current glibc's <sys/types.h> headers are included into
many C standard headers.

The problem here is that makedev()/major()/minor() macros
defined in <sys/sysmacros.h> leak into C standard headers
and poison global namespace.

The plan is to get rid of <sys/sysmacros.h> inclusion
in <sys/types.h>:
    https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html

On such system without implicit <sys/sysmacros.h> mono fails
to build as:

  CC       libmonoruntime_la-w32process-unix-default.lo
w32process-unix-default.c: In function 'mono_w32process_get_modules':
w32process-unix-default.c:225:12: error: implicit declaration of function 'makedev' [-Werror=implicit-function-declaration]
   device = makedev ((int)maj_dev, (int)min_dev);
            ^~~~~~~

autoconf has a AC_HEADER_MAJOR macro to autodetect
header for major() and friends.

This change switches to AC_HEADER_MAJOR.

Signed-off-by: Sergei Trofimovich <[email protected]>
2016-12-18 06:15:14 -05:00
Ludovic Henry 4d40970f99 [test-runner] Try to dump threads on timeout with lldb and gdb 2016-12-17 09:42:51 -05:00
Ludovic Henry f87d44b29a [mini] Inline only use of mono_runtime_syscall_fork 2016-12-17 09:42:51 -05:00
Ludovic Henry 0d20c88c47 [mini] Factor duplicates mono_gdb_render_native_backtraces 2016-12-17 09:42:51 -05:00
Ludovic Henry d4e61db1fe [threadpool] Remove assertion on RequestWorkerThread failure (#4167)
We observed that this assertion would sometimes be triggered on CI in case of intensive load. This would be possible because we wouldn't necessarily decrease the outstanding_request in a new worker. To decrease resource usage, we also want to limit the amount of new worker we request.
2016-12-17 09:42:18 -05:00
Ludovic Henry 8cbeea4767 [threadpool] Use threadpool->threads instead of threadpool->counters to wait on cleanup (#4146) 2016-12-17 09:41:36 -05:00
Zoltan Varga 99e9881bff [jit] Enable tests for the Vector<T> intrinsics. (#4157) 2016-12-17 07:11:21 -05:00
Zoltan Varga 79eb62822b [llvm] Fix the mapping of simd types to llvm types when using -O=-simd. 2016-12-17 07:08:09 -05:00
Zoltan Varga affa47bb1c [llvm] Add back support for OP_TLS_GET. 2016-12-17 05:56:41 -05:00
Jon Purdy a6d15bad4f [runtime] Fix Mach ARM assert.
This changes mono_mach_arch_get_thread_fpstate_size to return a value,
rather than asserting. The actual float state isn't used yet. This also
assumes NEON, which may not be correct.
2016-12-16 14:36:56 -08:00
Zoltan Varga f249d39a1d [simd] Fix the exception thrown by Vector<T>.CopyTo () on a failed bounds check. 2016-12-16 14:58:57 -05:00
Vlad Brezae da1e7bb009 [runtime] Fix MONO_ARCH_ENABLE_MONO_LMF_VAR
Using MONO_ARCH_ENABLE_MONO_LMF_VAR requires that we have means of getting the address of a tls variable (which is always the case when using __thread, but not necessarily when using pthread). Make sure that using it is properly guarded.

In the future we might want to remove MONO_ARCH_ENABLE_LMF_VAR and always try to use a tls variable for the lmf. Additionally we should benchmark what combinations work best and stick to them on all platforms. (ex when using fast tls we might consider using lmf_get + lmf_set if possible, when using fallbacks we might always want to use the lmf_addr to void multiple calls, always use lmf_ir etc).
2016-12-16 21:28:47 +02:00
Zoltan Varga 38da415de8 [aot] Bump AOT file format version due to changes to patch infos etc. 2016-12-16 13:47:38 -05:00
Ludovic Henry f4fdfcc714 [threads] Ensure thread is still alive when detaching it
If the compiler optimized it so that we would unregister the thread->thread_pinning_ref GC root before we would destroy the thread fields, we could run into "* Assertion at threads.c:1081, condition 'thread->suspended' not met"
2016-12-16 13:42:38 -05:00
Vlad Brezae b8072d9de0 [runtime] Remove old unused defines/prototypes 2016-12-16 19:39:09 +02:00
Marek Safar fb2a1556fb [build] Remove PEAPI from library profiles 2016-12-16 18:34:47 +01:00
Marek Safar fdafd289aa [build] Update list of aoted images in mcs mode 2016-12-16 16:11:39 +01:00
Marek Safar c221a74532 [System.Numerics.Vectors] Update to the latest CoreFX version 2016-12-16 15:43:58 +01:00
Marek Safar e048a72770 [System.Numerics.Vectors] Enable Vector on desktop profile 2016-12-16 15:26:38 +01:00
Marek Safar f4add65dea Bump corefx 2016-12-16 12:43:57 +01:00
Alexander Köplinger 38b073b9de [corlib] Override virtual DSA.HashData() methods in DSACryptoServiceProvider (#4150)
The methods were added in .NET 4.6 but couldn't be done abstract so instead
they were added virtual which just throws an exception telling you to override
it in the subclass.

We implemented this for RSACryptoServiceProvider in https://github.com/mono/mono/pull/3770
(the methods were already overriden in that case because we moved to referencesource)
but DSACryptoServiceProvider is still using the Mono code so we need to
implement it there too.
2016-12-16 11:53:25 +01:00
Zoltan Varga c1086268ba Fix a warning. 2016-12-15 21:47:55 -05:00
Vlad Brezae 46717b4a55 [sgen] Reenable gc-altstack test 2016-12-16 01:05:51 +02:00
Alexander Köplinger ed1006cd71 Revert "[build] Update list of aoted images in mcs mode"
This reverts commit 59b8a5d3ba.

It breaks the mcs build:

```
20:35:27 MONO_PATH='./../../class/lib/build/' > build_aot.log 2>&1 /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/runtime/mono-wrapper --aot=bind-to-runtime-version,outfile=/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll.so --debug /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll || (cat build_aot.log; exit 1)
20:35:27 Failed to load method 0x6000001 from '/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll' due to Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>.
20:35:27 Run with MONO_LOG_LEVEL=debug for more information.
20:35:27 AOT of image /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll failed.
20:35:27 Mono Ahead of Time compiler - compiling assembly /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll
20:35:27 AOTID 368C895D-F9C7-38E7-C0BA-F9B6964CD1A0
20:35:27
make[7]: *** [/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Reflection.Metadata.dll.so] Error 1
20:35:27 make[7]: *** Waiting for unfinished jobs....
20:35:27 Failed to load method 0x6000001 from '/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll' due to Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>.
20:35:27 Run with MONO_LOG_LEVEL=debug for more information.
20:35:27 AOT of image /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll failed.
20:35:27 Mono Ahead of Time compiler - compiling assembly /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll
20:35:27 AOTID 368C895D-F9C7-38E7-C0BA-F9B6964CD1A0
20:35:27 make[7]: *** [/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll.so] Error 1
20:35:27 Failed to load method 0x600000c from '/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe' due to Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>.
20:35:27 Run with MONO_LOG_LEVEL=debug for more information.
20:35:27 AOT of image /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe failed.
20:35:27 Mono Ahead of Time compiler - compiling assembly /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe
20:35:27 AOTID 44CBE5F8-37FA-0F68-B472-47E2F4209FC5
20:35:27 System.Collections.Immutable.dll
20:35:27 AOTID 368C895D-F9C7-38E7-C0BA-F9B6964CD1A0
20:35:33 make[7]: Leaving directory `/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/mcs/class/aot-compiler'
20:35:33 make[6]: Leaving directory `/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/mcs/class/aot-compiler'
20:35:33 make[6]: *** [do-all] Error 2
```
2016-12-15 21:36:41 +01:00
monojenkins bcba54064d [msvc] Update csproj files (#4151) 2016-12-15 21:01:12 +01:00
Marek Safar 59b8a5d3ba [build] Update list of aoted images in mcs mode 2016-12-15 19:04:31 +01:00
Marek Safar af10ff717e [System.Core] Add CryptoServiceProviders to mobile 2016-12-15 17:01:43 +01:00
Marek Safar f1408c59c5 [Facades] Move IncrementalHash to System.Security.Cryptography.Algorithms facade
It looks like the type won't be part of .net for anytime soon
2016-12-15 15:23:56 +01:00
Marek Safar dbb4dbcce7 [corlib] Fixes warning 2016-12-15 15:23:56 +01:00
Ludovic Henry 3a185940f9 [process] Fix process-unref-race.exe (#4144)
* [process] Rename MonoProcess to Process as it's not public anymore

* [process] Replace setting process->pid = 0 by process->signalled = TRUE

* [process] Remove processes_mutex lock when unrefing process->handle

We do not need to synchronize it here because we do not modify `processes`, and the only other place where we access process->handle is before adding it to `processes`.

* [process] Fix race condition

Without this memory barrier `process->next = processes` and `processes = process` could be reordered, and when accessing `processes` in mono_sigchld_signal_handler, we could observe a NULL processes->next. This would make us not find a pid in `processes`, and because of the posix API, we would never mark this process as exited.

This would trigger a hang in `process-unref-race.exe` test.

Thank you to @kumpera for the help figuring this out!
2016-12-15 08:18:23 -05:00
Vlad Brezae 8995297d8a [s390x] Fix build 2016-12-15 15:13:56 +02:00
Bernhard Urban dbaca79c47 [aot] fix linker invocation for llvm mode on linux
clang++ should only be used for llvm_only (aka. bitcode) mode.

this is a follow up fix for:
https://github.com/mono/mono/commit/7d238ddd5edeeb42cec5e07b6d6527d16332f921
and
https://github.com/mono/mono/commit/fc5305d2af1b6891b05cb82342bf92d4659546e1

fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46375
2016-12-15 13:49:48 +01:00
Marek Safar d1d54df3ac [tools] Add resx2sr internal tool 2016-12-15 11:23:06 +01:00
Vlad Brezae a650d4d72c Merge pull request #4014 from BrzVlad/feature-tls-refactor
[runtime] thread local storage refactor
2016-12-15 12:22:04 +02:00
Zoltan Varga fa7aecc9e6 [arm64] Mark MONO_CONTEXT_GET_CURRENT () as clobbering x16. 2016-12-15 09:47:34 +01:00
Alexander Köplinger f13551d2d4 Fix build break due to Cecil API change
https://github.com/jbevain/cecil/commit/42db79cc16f1cbe8dbab558904e188352dba2b41
2016-12-14 21:35:31 +01:00
Ankit Jain c952badd43 [xbuild] Bump buildtools to get support for netstandard 1.6
https://github.com/mono/buildtools/commit/9b6ee8686be55a983d886938165b6206cda50772
2016-12-14 14:57:33 -05:00
Sebastien Pouliot faf2a56710 [system] Remove port number from TLS Server Name Identification (SNI). Fixes #46549 (#4120)
The port number should not be included along the host name. Otherwise
the server will refuse the connection (and we'll throw). This is a
problem when servers are not using the default (443) SSL/TLS port.

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

The BTLS provider was fixed but the old MonoTLS (managed) provider had
the same issue.

Another PR will be made to fix AppleTLS in xamarin-macios repo [2]

[1] https://github.com/mono/mono/pull/3939
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=45994
2016-12-14 20:24:41 +01:00
Alexander Köplinger 9b6a2feb20 Bump cecil to get portable pdb fix 2016-12-14 20:16:08 +01:00
Vlad Brezae dc77e02244 [arm] Resurrect inlined fast tls
Only on desktop linux, where we now inline aeabi_read_tp.
2016-12-14 17:52:51 +02:00
Vlad Brezae d30f89875e [arm64] Resurrect inlined fast tls 2016-12-14 17:52:51 +02:00
Vlad Brezae e21c1281c1 [x86] Resurrect inlined fast tls 2016-12-14 17:52:50 +02:00
Vlad Brezae 3552325d9e [runtime] Global debug option for using fallback tls 2016-12-14 17:52:50 +02:00
Vlad Brezae e7e6e6c697 [amd64] Resurrect inlined fast tls
By default all platforms will call into native getters/setters whenever they need to get access tls value. On certain platforms we can try to be faster than this and avoid the call. We call this fast tls and each platform defines its own way to achieve this. Fast tls should normally be inlined, otherwise there is little point to doing anything else in the first place (on linux, __thread access is 2-3 instructions, on mac pthread_getspecific is 2 instructions, other platforms also having decent implementations).  For this, a platform has to define MONO_ARCH_HAVE_FAST_TLS, and provide alternative getters/setters for a MonoTlsKey. In order to have fast getter/setters, the platform has to declare a way to fetch an internal offset (MONO_THREAD_VAR_OFFSET) which is stored in the tls module, and in the arch specific file probe the system to see if we can use the offset initialized here. If these run-time checks don't succeed we just use the fallbacks.

In case we would wish to provide fast inlined tls for aot code, we would need to be sure that, at run-time, these two platform checks would never fail otherwise the tls getter/setters that we emitted would not work. Normally, there is little incentive to support this since tls access is most common in wrappers and managed allocators, both of which are not aot-ed by default. So far, we never supported inlined fast tls on full-aot systems.
2016-12-14 17:52:50 +02:00
Vlad Brezae 7f76306f79 [runtime] Refactor and unify tls access
The purpose of this commit is to unify tls access across all platforms. We had tls information spread out throughout the entire code which was guarded with many defines/capabilities which made very hard to follow what was going on. Also this made switching between pthread and __thread very unstable since there were a lot of dependencies between different pieces of the tls infrastructure. Also it was not very clear what happens if one of the tls pieces failed.

Now we are moving all the tls variables to a single module that provides getters/setters and initialization API. Runtime code now knows that we can always access a tls variable (from managed code, we just do a nowrapper icall into the same global geters/setters). Even though we used to these type of calls all around before, it is worth mentioning that runtime should account for a thread to be in this type of unregistered code without m2n wrapper and no register jinfo.

On average this makes common tls intensive methods (m2n wrappers and managed allocator) 20% slower, with potential for more regression if we use tls getters/setters recklessly. As a consequence we will re-enable the most important pieces of fast tls code in the future.
2016-12-14 17:52:49 +02:00
Bernhard Urban 0b8670e8fb [exception] do not wrap SIGILL into a managed exception
there is not much point in trying to recover from it and even worse,
wrapping it into a managed exception might hide it if the application is
sloppy with exception handling (cf. Pokémon Exception Handling).
2016-12-14 12:43:51 +01:00
Bernhard Urban 1940d5f89b [exception] rename mono_handle_native_sigsegv -> mono_handle_native_crash 2016-12-14 12:43:51 +01:00
Bernhard Urban 1bc7eca560 [exception] pass signal as string already to mono_handle_native_sigsegv 2016-12-14 12:43:51 +01:00
Marek Safar 85b44400c8 Merge pull request #4139 from lambdageek/bug-49686
[sre] Implement DynamicMethod.GetCustomAttributes() and IsDefined() (Fixes #49686)
2016-12-14 11:08:51 +01:00
Vlad Brezae 6a7b2575ba Merge pull request #4110 from BrzVlad/fix-sgen-win32
[sgen] Fix sgen win32
2016-12-14 11:56:08 +02:00
Zoltan Varga ce5bfb1f78 [jit] Add a workaround to avoid a crash in mini_above_abort_threshold () when using bitcode. 2016-12-14 07:13:43 +01:00
Ludovic Henry 5294685b97 [process] Remove useless FIXME 2016-12-13 21:44:46 -05:00
Zoltan Varga f1866eea8e [arm64] Save the fp regs in MONO_CONTEXT_GET_CURRENT (). (#4121) 2016-12-13 17:38:41 -05:00
Ludovic Henry 33ee8becf2 [threadpool] Assert that we do not overflow ThreadPoolCounter starting and working fields (#4138) 2016-12-13 16:58:15 -05:00
Ludovic Henry 8882af17e6 [threadpool] Fix MonoTests.runtime.unload-appdomain-on-shutdown.exe (#4135)
* [threadpool] Increase and decrease refcount when removing domain

* [threadpool] Fix unload-appdomain-on-shutdown.exe

If the threadpool is not initialized, there is no need to initialize it, as no worker is going to start in the domain because mono_domain_is_unloading would return TRUE.
2016-12-13 16:53:03 -05:00
Aleksey Kliger 789fb679be [sre] Implement DynamicMethod.GetCustomAttributes() and IsDefined ()
Per .NET documentation, DynamicMethod does not support custom attributes
exception the MethodImplAttribute pseudo-custom attribute.

Also change GetMethodImplementationFlags to include NoInlining as on .NET

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=49686
2016-12-13 16:34:18 -05:00
Aleksey Kliger 57527cb400 [test] Test for System.Linq.Expressions.MethodCallExpression with a DynamicMethod
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=49686
2016-12-13 16:34:16 -05:00
Vlad Brezae 009f37b26d Revert "[ci] Move mcs switch for Win32 builds into the run-jenkins.sh script"
This reverts commit 2b8d9bdb08.
2016-12-13 22:55:38 +02:00
Vlad Brezae 390fe34cb4 [sgen] Don't suspend thread in wow64 transition
The stack pointer provided by GetThreadContext is not reliable.
2016-12-13 22:55:36 +02:00
Aleksey Kliger 28ed64f543 [test] Test for System.Reflection.Emit.DynamicMethod.GetCustomAttributes 2016-12-13 15:50:13 -05:00
Vlad Brezae 8bdd416663 [sgen] binary protocol on windows 2016-12-13 20:44:05 +02:00
Vlad Brezae 821aabda89 [runtime] Fix prototype of functions
These functions are cast and invoked as a MonoThreadStart (which requires to receive on arg, return one arg and be WINAPI on windwos), which could lead to cconv problems if the prototype is not matching.
2016-12-13 20:44:04 +02:00
Zoltan Varga 339b8a166c Fix a warning. 2016-12-13 17:40:10 +01:00
Zoltan Varga 4bb24e91fd [amd64] Return from the altstack before handling native sigsegvs. This will make backtrace () actually work. 2016-12-13 17:09:54 +01:00
Zoltan Varga 4e34055e62 [jit] Pass '-nx' to gdb when printing native backtraces so it doesn't read .gdbinit, thus making it more deterministic. 2016-12-13 17:09:53 +01:00
Alexander Köplinger 4c826a3c85 Remove the debian-snapshot submodule
Jo said it's no longer used. We're using the following repos now:

https://github.com/mono/linux-packaging-mono
https://github.com/mono/linux-packaging-mono-snapshot
2016-12-13 16:44:48 +01:00
monojenkins 79283363f0 [msvc] Update csproj files (#4136) 2016-12-13 13:52:22 +01:00
Bernhard Urban 9e3bfaf6a5 Revert "Fix a warning."
This reverts commit b498facf7c.
2016-12-13 13:41:32 +01:00
Zoltan Varga b498facf7c Fix a warning. 2016-12-13 07:29:41 +01:00
Ludovic Henry 02f9d26635 [threads] Destroy thread->suspended before removing the GC root to thread (#4133) 2016-12-12 18:57:07 -05:00
Alexander Köplinger e31a8ef27c [build] Print CSC when compiling with roslyn
Reduces confusion about why the log contains lines starting with MCS
even when using roslyn.
2016-12-12 20:46:30 +01:00
Marek Safar a397af33c7 [xbuild] publicsign and delaysign cannot be used at same time 2016-12-12 19:57:25 +01:00
Marek Safar 21e9c71f7b [xbuild] Add a workaround for not yet implemented full /keyfile signing using csc 2016-12-12 18:28:42 +01:00
Bernhard Urban 3baad19c6c [unwind] reduce frame size of mono_unwind_frame ()
on arm32 it goes down from 5120 bytes to 676 bytes in terms of frame
size.
2016-12-12 18:14:58 +01:00
Marek Safar 26c17a5b0f [Microsoft.CSharp] Tweaks 76f97e3073 to not call new API from Microsoft.CSharp. Fixes #47353
This is a workaround for runtime assembly loading bug always preferring local assembly
2016-12-12 17:24:06 +01:00
Marek Safar 0eb84ed455 [xbuild] Convert pbdonly to portable debug mode 2016-12-12 16:02:48 +01:00
Marek Safar cfccb41b25 [System] Always use mcs as CodeDOM backend compiler 2016-12-12 15:48:36 +01:00
Marek Safar 56f1d45100 [build] Add System.ValueTuple to bootstrap facades 2016-12-12 13:42:16 +01:00
Alexander Köplinger d2a93aa672 Don't remove the roslyn binaries in "make dist" for now
Should help fix the package builds on Jenkins.
2016-12-12 12:51:16 +01:00
Shay Rojansky 5612117861 Add unimplemented Transaction.PromoteAndEnlistDurable (#4129)
Which was added to .NET 4.5.2.
2016-12-12 11:05:23 +01:00
Zoltan Varga 8570fb5f6e [simd] Add intrinsics support for Vector<T>.CopyTo (). 2016-12-11 01:14:44 -05:00
monojenkins 487fddd146 [msvc] Update csproj files (#4128) 2016-12-10 17:36:36 +01:00
Alexander Köplinger 3c6fc4fe73 [Facades] Add System.ValueTuple facade (#4125) 2016-12-10 03:59:47 +01:00
Zoltan Varga 2bdea63484 [arm64] Handle fp regs in mono_sigctx_to_monoctx () on linux, recent gcc versions generate code which store object references in them, so sgen now requires this. (#4127) 2016-12-09 19:12:21 -05:00
Ludovic Henry 5e845a3bc9 [threadpool] Split domain and worker management (#4117)
* [threadpool] Remove `-ms` suffix

* [threadpool] Split domain and worker management

This will allow us to use native threadpool more easily: we will simply have to implement a threadpool worker with the specific API.

On windows, we will use the Win32 Threadpool, and on OSX we will explore using GCD (Grand Central Dispatch).
2016-12-09 15:40:28 -05:00
Ludovic Henry fcf7d1f425 [threads] Inline thread_cleanup into mono_thread_detach_internal (#4119) 2016-12-09 11:09:59 -05:00
Alexander Köplinger 549504bdde Expose mono_build_root to mcs build system
In an out-of-tree build the Makefile which contains get-monolite-latest
doesn't exist in the source directory (which $(topdir)/.. would point to)
but in the build directory.

In order to invoke get-monolite-latest we need to actually call the Makefile
in the correct directory which requires exposing the build directory to the
mcs build system.
2016-12-09 16:44:21 +01:00
Bernhard Urban 72ee51eb8a [configure] fix out-of-tree-build with roslyn 2016-12-09 16:44:21 +01:00
Alexander Köplinger dc8231a9d1 [runtime] Add write barriers for FindFirstFile/FindNextFile icalls (#4114)
We were seeing crashes like [1] or [2] after https://github.com/mono/mono/pull/4042 was merged.
While debugging the issue I found out that when instead of using `out data.cFileName` for passing
the string through the the icall I use a temporary field and assign the result to `data` later on
the crash went away. It also worked if I made the `WIN32_FIND_DATA` class a struct instead.

I talked to @ludovic-henry and he was able to figure out what was going on (many thanks!):

> It seems to be a missing wbarrier
> and that would also explains why it would work with a struct, but not with a class
> so it would work with a struct, because `out data.filename` would be a `MonoString**` to the thread stack,
> and that would work because we would always scan the thread stack
> and it wouldn’t work with a class, because `out data.filename` would be a `MonoString**` to the heap
>
> and because we have a generational GC, if `data` is in the “old” heap (and because we are missing this write barrier),
> we would never scan `data`, thus freeing the `data.filename` string object, and as soon as you are trying to access it,
> well you access garbage
>
> with the write barrier, we will make sure to scan the `data` object, and not loose the reference to `data.filename`

[1] https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/5422/parsed_console/log_content.html#WARNING1
[2] https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/5419/parsed_console/log_content.html#WARNING1
[3] https://github.com/mono/mono/blob/dd88ff52e2f130ee188661a34794aa7c7b564fa8/mcs/class/referencesource/mscorlib/system/io/filesystemenumerable.cs#L280
2016-12-09 14:01:06 +01:00
Marek Safar cf3f3aa8d1 [System] Add new test 2016-12-08 17:16:38 -08:00
Alexis Christoforides 47365cd54b [MacSDK] Include 'opt' as a PATH-available binary 2016-12-08 15:15:39 -05:00
Zoltan Varga 49c26ad3d9 [runtime] Use MonoBoolean instead of gboolean in monitor icalls. Add new internal variants for the ones which are exported. (#4109) 2016-12-08 01:30:48 -05:00
Ubuntu a3543c4ac2 Fix bug 48516 2016-12-08 05:37:41 +01:00
Ludovic Henry 6f4d780594 [jenkins] Rename runtime presets to match CI tags 2016-12-07 20:30:04 -05:00
Alexander Köplinger ea519ada8c [ci] Simplify run-jenkins.sh script variables (#4111)
Get rid of WORKSPACE which is set by Jenkins, this allows one to
more easily run the run-jenkins.sh script locally e.g. on cygwin.

The only thing that needs to be passed in is CI_TAGS and label.
2016-12-07 23:54:28 +01:00
Alexander Köplinger f78a4a2a2b [ci] Run aot-test on more platforms (#4108)
* [ci] Run aot-test on more platforms

Now that https://github.com/mono/mono/pull/4096 is merged, we should be able to run it on Linux too.

* [ci] Don't run aot-test on Windows

It's broken there.
2016-12-07 23:53:51 +01:00
Ludovic Henry 01eadce098 [jenkins] Add bitcode CI tag and rename bitcode_aot_only runtime preset to bitcode 2016-12-07 16:35:54 -05:00
Ludovic Henry cb0e0662a8 [jenkins] Add aot_llvm and aot CI tag as well as aot runtime preset 2016-12-07 16:25:10 -05:00
Ludovic Henry 7aa1cac456 [jenkins] Add fullaot_llvm CI tag and rename aot_only to fullaot 2016-12-07 15:53:22 -05:00
Ludovic Henry d78854f3bf [jenkins] Fix order of CI tags 2016-12-07 15:27:22 -05:00
Ludovic Henry 3fe69ba81f [jenkins] Add hybridaot_llvm CI tag and rename aot_preferred to hybrid 2016-12-07 15:15:20 -05:00
monojenkins 01915cb174 [msvc] Update csproj files (#4115) 2016-12-07 19:28:51 +01:00
Marek Safar dd88ff52e2 [build] Add System.Security.Cryptography.Primitives to bootstrap facades 2016-12-07 07:34:47 -08:00
Marek Safar b1f867e4e5 Merge pull request #4102 from marek-safar/bootstrap
[build] Fixes win32 bootstrap in mcs mode
2016-12-07 06:20:26 -08:00
Alexander Köplinger 2b8d9bdb08 [ci] Move mcs switch for Win32 builds into the run-jenkins.sh script
So we can more easily switch it over to roslyn again in a PR.
2016-12-07 13:17:08 +01:00
Ludovic Henry 742b4841c2 [threads] Fix conflicting signal with boehm (#4096)
Boehm would use SIGPWR on linux 32/64bits for its suspend signal, but that would conflict with utils/threads suspend signal.

The fix consists in looking for an available realtime signal in utils/threads, and fallback to the default SIGXFSZ, SIGPWR and SIGXCPU
2016-12-06 20:46:43 -05:00
Rolf Bjarne Kvinge 196a882e02 [llvm] Fix intrinsic Selector.GetHandle support. (#4103)
An OBJC_IMAGE_INFO section must be emitted when we emit the native equivalent
of @selector for Selector.GetHandle, otherwise the Objective-C runtime will
not process the selectors in this image at runtime (and we may end up with
duplicate selectors in memory).

The AOT compiler already does this here: https://github.com/mono/mono/blob/2eda626316fd8f70cd98947af2f89b7ca9b0ebe5/mono/mini/aot-compiler.c#L9657-L9661
2016-12-06 18:50:31 -05:00
Alexis Christoforides 3b3b69dae1 [Mac SDK] Use MSBuild to build IronPython/IronRuby.
Xbuild currently fails with 'CSC: error CS0041: Unexpected error writing debug information -- 'Windows PDB writer is not available -- could not find Microsoft.DiaSymReader.Native.x86.dll'

Xbuild should be passing "/debug:Portable" to csc in order to work. There is a possibly broken attempt to this in 2d08353991.
2016-12-06 16:53:32 -05:00
Roger Vuistiner cd8e84c1f1 [System]: fix certificate validation on Wine/OSX
- the `is_macosx` static field should be false on Wine/OSX, as it is on Windows.
2016-12-06 22:44:09 +01:00
Alexander Köplinger 5b4b1b0737 Revert "[runtime] Use MonoBoolean as the return value of monitor icalls."
This reverts commit 06088609b0.

It was breaking the build on i386 Linux:

```
Unhandled Exception:
 System.ExecutionEngineException: System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code.
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitExpression (Microsoft.CodeAnalysis.CSharp.BoundExpression expression, System.Boolean used) [0x00070] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatement (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x000ad] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatementAndCountInstructions (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x0000c] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitSequencePointStatement (Microsoft.CodeAnalysis.CSharp.BoundSequencePoint node) [0x0002d] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatement (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x00087] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitBlock (Microsoft.CodeAnalysis.CSharp.BoundBlock block) [0x0009d] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatement (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x0007a] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatementList (Microsoft.CodeAnalysis.CSharp.BoundStatementList list) [0x00023] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatement (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x000b4] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
...
```
2016-12-06 21:30:00 +01:00
Alexander Köplinger 705e1e80f2 [corlib] Put back Directory.GetDirectoryRoot() which was accidentally removed
The mistake happened in https://github.com/mono/mono/pull/4042.
Added a test for the method so we don't do it again.
2016-12-06 20:20:40 +01:00
Niklas Therning 9fa84f129f Fix Microsoft.Build.Engine fail when built with mcs
Fixes the Makefile to not fail if the compiler hasn't generated a pdb file for
the TestTasks dll.
2016-12-06 07:27:49 -08:00
Marek Safar 2d49411dee Revert "Merge pull request #4093 from ntherning/enable-building-bcl-with-mono-4.6-mcs"
This reverts commit d661684b9a, reversing
changes made to 556a4f4565.
2016-12-06 07:21:56 -08:00
Marek Safar 8b440e4f36 [build] Fixes win32 bootstrap in mcs mode
Uses installed mono instead on .NET to run same boostrap check as we
do on other platforms
2016-12-06 07:21:56 -08:00
Ludovic Henry c0c7503ae7 [io-layer] Remove io-layer.h include from as many headers as possible (#4088) 2016-12-06 09:50:26 -05:00
Ludovic Henry de21ecd34f [w32handle] Fix race in foreach and unref (#4089)
It could happen that we unref a handle that we are currently looping over. This could be the case if we are calling Process.GetProcessById (which loops over all handles) and mono_w32handle_unref on a MonoW32HandleProcess handle.
2016-12-06 09:49:32 -05:00
Zoltan Varga 06088609b0 [runtime] Use MonoBoolean as the return value of monitor icalls. 2016-12-06 00:47:32 -05:00
Alexander Köplinger d661684b9a Merge pull request #4093 from ntherning/enable-building-bcl-with-mono-4.6-mcs
Enable building the BCL with mcs from pre-4.8 mono installation
2016-12-06 01:39:19 +01:00
Ludovic Henry 556a4f4565 [threads] Do not switch to GC safe twice, it's already done inside mono_join_uninterrupted 2016-12-05 13:51:02 -05:00
Aleksey Kliger (λgeek) 15aca909f3 [runtime] Use coop handles for the remaining System.Reflection.Assembly icalls (#4082)
* [reflection] Use handles for System.Reflection.Assembly.GetFilesInternal

* [reflection] Use handles for System.Reflection.Assembly.InternalGetType

* [reflection] Use handles for System.Reflection.Assembly.GetManifestResourceNames

* [reflection] Use handles for System.Reflection.Assembly.LoadPermissions

* [reflection] Add mono_method_get_object_handle

  Reimplement mono_method_get_object_checked in terms of the handles one.

* [reflection] Use handles for System.Reflection.Assembly.get_EntryPoint

* [reflection] Use handles for four more icalls in System.Refleciton.Assembly

  That's the lot of them.

    * get_ReflecitonOnly
    * get_code_base
    * get_fullname

* get_global_assembly_cache

* [security] Use handles for System.Security.Policy.Evidence.IsAuthenticodePresent

* [runtime] Use handles for System.Web.Util.Icalls.GetUnmanagedResourcesPtr

* [runtime] Use MONO_HANDLE_GETVAL instead of MONO_HANDLE_RAW in a few places

* [runtime] Use handles for System.AppDomain.ExecuteAssembly
2016-12-05 10:24:10 -05:00
Niklas Therning 54565eaaf9 Enable building the BCL with mcs from pre-4.8 mono installation
This skips passing -runtimemetadataversion when building the BCL with
--with-csc=mcs.
2016-12-05 15:41:50 +01:00
Niklas Therning 786dea24fe Merge pull request #4092 from ntherning/fix-w32process-win32.c-build-failure
Fix build failure in w32process-win32.c
2016-12-05 14:22:22 +01:00
Niklas Therning 68d8a0f087 Fix build failure in w32process-win32.c
Commit 07630fe8c5 broke the build on Windows.
2016-12-05 11:50:07 +01:00
Johan Lorensson 120fb8de40 Merge pull request #3997 from lateralusX/jlorenss/win-api-family-support-safearray
Add possibility to exclude COM SafeArray implementation on some none desktop Windows API families.
2016-12-05 11:45:19 +01:00
vkargov 1e890d8428 A few pretty print fixes for the GDB plugin. (#4001) 2016-12-03 19:41:54 -05:00
Ludovic Henry 8fc79cf5e3 [runtime] Fix build 2016-12-03 18:42:04 -05:00
Ludovic Henry 07630fe8c5 [Process] Remove unused cmd and shell_path variables 2016-12-03 18:13:12 -05:00
Ludovic Henry 31f90b9db6 [Process] Concatenate envirnoment key and value in managed 2016-12-03 18:13:12 -05:00
Ludovic Henry 28d3e31a97 [Process] Rename proc_info to procInfo 2016-12-03 18:13:12 -05:00
Ludovic Henry 43ce530d56 [w32process] Rename MonoW32HandleProcess id to pid and proc_name to pname 2016-12-03 18:13:12 -05:00
Joshua Peterson 971f5ff4ed Don't allow Join to return due to an APC (#3970)
* Don't allow Join to return due to an APC

On Windows, Thread.Join does an alertable wait. If the thread calling
Join gets an APC during the call, Join will incorrectly return. Instead,
the code should handle the APC and continue waiting.

* Do an uninterrupted wait during thread join.

Mimic the behavior of mono_wait_uninterrupted, but for a single thread
that we want to join.

* Make some style changes suggested in the PR.
2016-12-03 17:10:25 -05:00
su21 53fa02470c Socket.AddSockets throw exception with meaningful name (#4086)
fix #48875
2016-12-03 16:34:33 -05:00
monojenkins 238d6fe627 [msvc] Update csproj files (#4087) 2016-12-03 22:21:43 +01:00
Ludovic Henry 55ff3852f5 [io-layer] Remove versioninfo.{c,h} (#4083) 2016-12-03 08:59:47 -05:00
Zoltan Varga 1845e73db4 [runtime] Add locking to mono_gc_compute_gc_descriptor (). (#4084) 2016-12-02 22:44:01 -05:00
Alexander Köplinger f9eae79e15 Fix Makefile issue on Windows
"Makefile:25: *** multiple target patterns.  Stop.", according to web searches
this is because of colons in the file path. install-local always runs so we
don't really need the source files as dependency -> removing.
2016-12-03 03:38:14 +01:00
Miguel de Icaza 22830cfb64 [marshal] Only copy the minimum of size/length, not the full size, fixes #46288 (#4031) 2016-12-02 21:24:25 -05:00
Miguel de Icaza a2bfd33580 [runtime] Provide fallback for Linux systems that lack CPU_COUNT in sched.h, fixes #45683 (#4032) 2016-12-02 21:22:38 -05:00
Alexander Köplinger 9da938a9e2 [build] Another "make dist" fix 2016-12-03 01:38:08 +01:00
Alexander Köplinger 3ddd016856 [ci] Add aot-test step like on Wrench (#4064)
* [ci] Add aot-test step like on Wrench

* [tests] Fix mktemp argument to work on Linux

* [ci] Only run aot-test step on OSX

It seems to crash on linux with the boehm configuration.
2016-12-03 01:18:33 +01:00
Zoltan Varga 0f75df93b3 [runtime] Set klass->inited under the loader lock. 2016-12-02 18:10:29 -05:00
Zoltan Varga c17bc54918 [runtime] Enable thread6.exe test, it should work now. (#4075) 2016-12-02 17:22:16 -05:00
Ludovic Henry 2cc94a2eef [io-layer] Remove FormatMessage (#4055) 2016-12-02 16:52:02 -05:00
Ludovic Henry 0a65f41687 [io-layer] Remove security.{c,h} (#4079) 2016-12-02 15:06:09 -05:00
Alexander Köplinger 713b7fe4ae Fix "make dist" for roslyn assemblies 2016-12-02 20:12:19 +01:00
Marek Safar 19261d8d53 [build] Fixes make dist 2016-12-02 19:58:42 +01:00
Aleksey Kliger (λgeek) d9e73b75b0 Fix clang warning about no argument function prototype. (#4080) 2016-12-02 13:50:24 -05:00
Zoltan Varga b0ad42e210 [runtime] Call mono_class_init () before accessing klass->has_cctor in mono_class_get_cctor (). 2016-12-02 13:33:52 -05:00
Marek Safar ff7a2a5114 [System.Runtime.InteropServices.RuntimeInformation] Updated to reference copied files directly 2016-12-02 18:39:22 +01:00
Johan Lorensson 29de090ea6 Fix windows build error in type-checking.c. (#4078)
Looks like commit f3bbd799f0 that added type-checking.c
to the windows builds broke it since it includes mini.h and ir-emit.h using
<> syntax instead of "". All other include of these files uses "" syntax. Fix
makes sure the includes in type-checking.c uses "" syntax.
2016-12-02 18:23:04 +01:00
monojenkins d29f0045fc [msvc] Update csproj files (#4081) 2016-12-02 18:16:26 +01:00
Marek Safar c36e0aa886 [build] Enable full mcs boostrap for mcs compiler mode 2016-12-02 18:08:41 +01:00
Marek Safar 82953443e1 [build] Fixes wrong dependency moved in 07c20be565 2016-12-02 18:07:22 +01:00
Marek Safar fb7b09c655 [corlib] Cleanup more negative sign cultures with unicode prefixes 2016-12-02 18:07:22 +01:00
Aleksey Kliger (λgeek) 8850a990f8 [runtime] Use mono_assembly_get_object_handle instead of mono_assembly_get_object_checked everywhere in the runtime. (#4061)
* [runtime] Move domain icall declarations to appdomain-icalls.h

* [coop] Use handles for System.AppDomain.GetAssemblies icall

* [coop handles] Add HANDLE_FUNCTION_RETURN_REF macro

* [runtime] Handles for AppDomain.LoadAssemblyRaw and Assembly.LoadFrom

* [reflection] Coop handles for RuntimeTypeHandle.GetAssembly

* [runtime] Change mono_try_assembly_resolve to return MonoAssembly

  instead of managed MonoReflectionAssembly.  Update call sites.

  Also implement it in terms of mono_try_assembly_resolve_handle (which
  also returns MonoAssembly*, not a managed object)

* [runtime] Use handles for System.AppDomain.LoadAssembly

* [reflection] Use mono_assembly_get_object_handle instead of mono_assembly_get_object_checked

  Convert all its callers to use handles and get rid of mono_assembly_get_object_checked
2016-12-02 11:39:39 -05:00
Marek Safar 07c20be565 [build] Add System.Security.Cryptography.Algorithms to monolite 2016-12-02 17:29:11 +01:00
Ludovic Henry 4253746d0f [io-layer] Remove status.h, types.h, timefuncs.h and macros.h (#4069)
* [io-layer] Remove status.h

* [io-layer] Remove types.h

* [io-layer] Remove timefuncs.h

* [io-layer] Remove macros.h
2016-12-02 10:33:22 -05:00
Marek Safar 2a57c92fa0 [Facades] Add System.Security.Cryptography.Algorithms to net_4_x profile 2016-12-02 16:14:11 +01:00
Marek Safar 9cbea50ca5 [mcs] Don't crash on missing forwarded mscorlib 2016-12-02 16:14:11 +01:00
Marek Safar 673f1ba3e1 Merge pull request #4063 from ntherning/fix-culture-info-problem-in-RepeatInfoTest
Ensure the System.Web.UI.WebControls.RepeatInfo_Autogen test runs under en-US
2016-12-02 12:06:53 +01:00
Marek Safar 68d56e8027 [build] Put back mcs to monolite to support boostrap with mcs only 2016-12-02 10:25:30 +01:00
Zoltan Varga e3e699f321 Revert "[build] Put back mcs to monolite to support boostrap with mcs only"
This reverts commit 430e9d64f7.

Revert this as it seems to break the build:
https://wrench.internalx.com/Wrench/ViewLane.aspx?lane_id=2457&host_id=148&revision_id=834314
2016-12-01 21:09:47 -05:00
Zoltan Varga 8d17b4f46c [runtime] Avoid rethrowing ThreadAbortException's from cctors down the stack from where the TAE was first caught. Fixes thread6.cs. (#4073) 2016-12-01 19:07:45 -05:00
Zoltan Varga 8e0443727f [runtime] Change the vtable->initialized bitfield into a byte so its easier to load it from JITted code, the previous version was not using offsets infrastructure so it might not work when cross compiling. (#4068) 2016-12-01 19:04:18 -05:00
Zoltan Varga eca5dbd482 [runtime] Implement support for fixed char arrays. Fixes #48429. (#4072) 2016-12-01 19:02:33 -05:00
Marek Safar 430e9d64f7 [build] Put back mcs to monolite to support boostrap with mcs only 2016-12-01 23:54:14 +01:00
Andi McClure 9910c4b364 Merge pull request #4053 from xmcclure/babysitter_cygwin
Fix babysitter script to work on Windows (Cygwin) builders
2016-12-01 17:01:55 -05:00
monojenkins 36d4145426 [msvc] Update csproj files (#4074) 2016-12-01 22:04:12 +01:00
Zoltan Varga f3bbd799f0 [msvc] Update project files. 2016-12-01 15:53:20 -05:00
Zoltan Varga 7fa00780ad [jit] Fix the DISABLE_REMOTING build. 2016-12-01 15:45:57 -05:00
Zoltan Varga 2d203b2a77 [sdb] Execute the 'assembly_load' test earlier to avoid races when the finalizer thread would load another assembly. 2016-12-01 15:26:30 -05:00
Zoltan Varga c1acb2cee8 [x86] Increase some instruction lengths. 2016-12-01 15:18:33 -05:00
Alexander Köplinger 21f6ffa411 [genproj] Recognize /deterministic and /runtimemetadataversion 2016-12-01 20:59:19 +01:00
Mike Voorhees b6d1320f3e Add embedding API to expose empty string instance (#4067)
* Reuse a single empty string instance

* Undo string empty change to mono_string_new_size_checked and add new embedding api for string empty instead

* Add & use mono_string_empty_checked to fix build error on Linux

* Revert "Add & use mono_string_empty_checked to fix build error on Linux"

This reverts commit 47cafae6573115333fa04776c21e5ddc49fe4b40.

* Remove MONO_RT_EXTERNAL_ONLY to fix build error on linux
2016-12-01 14:53:44 -05:00
Rodrigo Kumpera ce166860ea Merge pull request #4048 from kumpera/iface_casting_cleanup
[mini] Reorg casting code + optimize casting of magic array interfaces.
2016-12-01 11:16:10 -08:00
Andi McClure d7e2c40455 Modify Jenkins scripts to enable babysitter script on Cygwin 2016-12-01 14:08:25 -05:00
Andi McClure 4d4769ed84 Fix babysitter script to work on Windows (Cygwin) builders
The babysitter script used for CI results was previously able to run
either on Windows or standard UNIX. However, the builders run Cygwin,
which turns out to need special support. To make Cygwin work two
changes were made:

1. Paths which are exported to Mono get filtered through `cygpath`.
Paths received back from Mono are filtered in reverse. The script now
tracks two sets of path strings.

2. Under certain circumstances in Cygwin, pgkill() attempts to close a
process group and finds it does not exist. My assumption is that this
is because it has already been closed. I dealt with this by simply
catching the failure and printing a warning.
2016-12-01 14:07:48 -05:00
Ludovic Henry 4e4834f9cd [w32handle] Rename statuscode parameter to abandoned
This parameter is only used to check if a mutex has been abandonned.
2016-12-01 13:34:23 -05:00
Alexander Köplinger aff3d4198b [corlib] Use Directory.GetFiles/GetDirectories implementation from referencesource (#4042)
We already had implementations of the Windows APIs like FindFirstFile/FindNextFile
in native code but we wrapped it with some convenience functions for our implementation.

The referencesource code works directly against those APIs so I added new icall functions
that are just used for passing data to/from native code.

Note that we have the same problem in the DirectoryInfo.GetFiles() implementation.
Right now that one still uses the old Mono implementation, switching it over to
the referencesource implementation will be done in a separate commit.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42715
2016-12-01 17:48:26 +01:00
Alexander Köplinger 69c3bfa45f Merge pull request #4065 from akoeplinger/add-mcs-lane
[ci] Add job configuration for testing Mono with mcs as compiler
2016-12-01 16:53:37 +01:00
Ludovic Henry 7636cb7716 [io-layer] Remove DuplicateHandle 2016-12-01 10:52:05 -05:00
Alexander Köplinger 690452b1bd Fix typo in readme.md
Also format the options without braces like in the other examples.
2016-12-01 16:41:27 +01:00
Aleksey Kliger (λgeek) a713a14521 Merge pull request #4045 from lambdageek/bug-47867
[sre] Ensure generic_context is created before instantiating a TypeBuilder
2016-12-01 10:33:25 -05:00
Niklas Therning 0a53e22631 Ensure the System.Web.UI.WebControls.RepeatInfo_Autogen test runs under en-US 2016-12-01 15:59:45 +01:00
Niklas Therning 0e1a4d8a68 Merge pull request #4051 from Unity-Technologies/registry-bug-fixes
Fix a bug in registry API implementation where had wrong assumptions about possible registry size.
2016-12-01 15:40:40 +01:00
Tautvydas Žilys c2ba35e793 Fix code convention on changed code. 2016-12-01 16:02:12 +02:00
Alexander Köplinger 50de3b0ee4 [ci] Add job configuration for testing Mono with mcs as compiler
To ensure it doesn't break now that we're using Roslyn by default.
2016-12-01 14:49:52 +01:00
lateralusX 94ecf49a0b Enabled possibility to exclude SafeArray implementation on Windows.
SafeArray implementation is not available under all Windows API families. This commit
extracts SafeArray methods making it possible to exclude them under Windows API families
not supporting SafeArrays.
2016-12-01 12:34:58 +01:00
Alexander Köplinger 3bc2b496c5 [acceptance-tests] Use portable pdb for csc 2016-12-01 12:15:21 +01:00
Niklas Therning 256e3ee192 Merge pull request #4033 from ntherning/no-stdcall-for-icalls-on-windows-32-bit
Use __cdecl rather than __stdcall for icalls on Windows 32-bit
2016-12-01 10:42:25 +01:00
Zoltan Varga 0dd9d39a8d [jit] Enable inlining inside gshared methods. (#4059) 2016-12-01 02:10:07 -05:00
Zoltan Varga 52914289b5 Revert "Only allocate 1 empty string instance per AppDomain " (#4062) 2016-11-30 22:28:41 -05:00
Marek Safar 18507ed5c3 [build] Don't use runtime flags on basic boostrap (they are too new) 2016-11-30 23:06:00 +01:00
Mike Voorhees fd36291a48 Only allocate 1 empty string instance per AppDomain (#4047)
* Reuse a single empty string instance

* Undo string empty change to mono_string_new_size_checked and add new embedding api for string empty instead
2016-11-30 16:40:19 -05:00
Alexander Köplinger 5b386e6b28 [ci] Bump timeout in ms-test-suite
Compiling the test exe's is taking longer now with roslyn.
2016-11-30 22:10:44 +01:00
Miguel de Icaza e06e21e754 [configure] Detect endianess and use mcs for big-endian systems.
Renames the flag to be more explicit on the intended purpose.  Also,
document the new configuration flag.

The default will probe the right compiler to use.
2016-11-30 14:53:55 -05:00
Alexis Christoforides d9b58eec84 Bump bockbuild 2016-11-30 14:23:17 -05:00
monojenkins 4b4f9e3078 [msvc] Update csproj files 2016-11-30 19:57:14 +01:00
Aleksey Kliger (λgeek) 94bafb7c55 [tests] Use CSC to compile gc-descriptors test (#4052) 2016-11-30 13:54:21 -05:00
Alexander Köplinger b9e6227efb Merge pull request #4050 from akoeplinger/profile-speedup
[ci] Only build the additional profiles on one arch instead of everywhere
2016-11-30 19:47:47 +01:00
Ludovic Henry 6e4e09dfba [io-layer] Remove wait.h 2016-11-30 13:09:59 -05:00
Ludovic Henry 0b944ffb57 [io-layer] Remove INFINITE 2016-11-30 13:09:59 -05:00
Ludovic Henry 7e79a9cdb0 [io-layer] Extract WaitForSingleObjectEx, WaitForMultipleObjectsEx and SignalObjectAndWait 2016-11-30 13:09:59 -05:00
Aleksey Kliger (λgeek) 32fb6a33cb [reflection] Use mono_module_get_object_handle everywhere (#4010)
* [reflection] Refactor managed object caching

Split up all the mono_XXX_get_object_checked functions into a generic
cache check and a specific construction function that's called if
there's a cache miss.

* [reflection] Add mono_assembly_get_object_handle

* [reflection] Add mono_module_get_object_handle

* [reflection] Use mono_module_get_object_handle everywhere

instead of mono_module_get_object_checked.

Also implement mono_module_file_get_object_handle instead of mono_module_file_get_object_checked
2016-11-30 12:20:30 -05:00
Alexis Christoforides 1fe0f8fb3a Bump bockbuild 2016-11-30 11:47:09 -05:00
Alexander Köplinger e67c011d07 Bump corert submodule 2016-11-30 17:21:00 +01:00
Marek Safar 5b20721b57 [build] Add --with-mcs-compiler config option 2016-11-30 16:53:00 +01:00
Marek Safar 07566447eb [mcs] Fixes runtimemetadataversion option check 2016-11-30 16:53:00 +01:00
Tautvydas Žilys 6dd4137bc0 Fix a bug in registry API implementation where had wrong assumptions about possible registry size. 2016-11-30 16:40:21 +02:00
Marek Safar efbe11145a [build] Prepare roslyn 2.0 bootstrap dependencies 2016-11-30 15:31:41 +01:00
Marek Safar 6dbe62deeb [build] Set monolite path also for Facades 2016-11-30 15:31:41 +01:00
Alexander Köplinger dbd2a1a9cd Merge pull request #3748 from akoeplinger/fix-rng-monotouch
[corlib] Simplify RNGCryptoServiceProvider file name on MT and enable tests
2016-11-30 14:56:51 +01:00
Marek Safar 2d08353991 [xbuild] Add workaround for pre-2.0 csc and convert full to portable debug mode 2016-11-30 14:35:54 +01:00
Alexander Köplinger 962f2a673d [ci] Only build the additional profiles on one arch instead of everywhere
The additional profiles like monotouch, monodroid etc. are normal
managed code anyway and are the same no matter where they're built
so we can save a lot of CI time by not building them e.g. on slower
ARM bots.
2016-11-30 14:31:12 +01:00
Marek Safar 7f4ffa0d8a [build] Use custom nursery size and clean up csc runtime arguments 2016-11-30 09:36:18 +01:00
Alexander Köplinger 1037af0e60 [referencesource] Fix a regression from 47a6f56439
ResourceSets needs to be initialized on Mono.
2016-11-30 02:20:55 +01:00
Rodrigo Kumpera f29547d8b9 [mini] Use the array fast path with array magic interfaces. Do the expensive check in the slow path. 2016-11-29 16:34:33 -08:00
Rodrigo Kumpera 7795f85437 [mini] Cleanup type casting a bit. Unify cast with with cache setup code. 2016-11-29 14:02:42 -08:00
Zoltan Varga bfb14cf4c2 [jit] Add counters for number of JITted method discarded as duplicates and the time spent JITting them. Remove opt set from -v output, it just adds noise. 2016-11-29 16:46:33 -05:00
Marek Safar 8bd65e9d1b Merge pull request #4041 from CyberShadow/pull-20161129-100901
ilasm: Add stub parsing for .data cil attribute
2016-11-29 21:07:54 +01:00
Marek Safar 549b996ac3 Add CoreRT submodule 2016-11-29 19:20:11 +01:00
Marek Safar 47a6f56439 [bcl] Clean up some warnings 2016-11-29 19:16:02 +01:00
Aleksey Kliger 979f07c142 [sre] Do we ever try to instantiate a generic instance? Assert that we don't. 2016-11-29 11:40:20 -05:00
Aleksey Kliger 72d3e86e9e [sre] Throw a TLE if a generic inst is used before the gtd is created.
This can happen if TypeBuilders are used to construct something like
  class S<T> {
    ...
  }
  class R {
    public S<int> SI;
  }

And then CreateType() is called for R and GetField("SI") is called on
  the result before CreateType() is called on the builder for S.
2016-11-29 11:40:19 -05:00
Aleksey Kliger ab9b8967cc [sre] Make sure a generic definition TypeBuilder has its generic_container setup before we try to instantiate it.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=47867
2016-11-29 11:40:18 -05:00
Aleksey Kliger a6716e6d6e [test] Generic typebuilder field in another typebuilder should work.
Even if the generic typebuilder hasn't had CreateType() called on it
yet.

Regression tests for https://bugzilla.xamarin.com/show_bug.cgi?id=47867
2016-11-29 11:40:16 -05:00
Marek Safar 6b0763dd4a Revert "[build] Enable aot for Microsoft.CodeAnalysis.dll/Microsoft.CodeAnalysis.CSharp.dll, as the aot compiler generates smaller images now."
This reverts commit e186dcff2c.
2016-11-29 16:53:21 +01:00
Ludovic Henry e1508c23bd [configure.ac] Rename hybrid runtime preset to aot_preferred 2016-11-29 10:39:38 -05:00
Niklas Therning 7a950a0450 Merge pull request #4040 from ntherning/disable-symbolicate-tests-on-windows
Disable symbolicate tests on Windows
2016-11-29 15:40:27 +01:00
Marek Safar 5a8058f7e4 [System] Report test failure using Assert 2016-11-29 12:01:19 +01:00
Marek Safar 27537cb676 [System] Update ClientWebSocket test to use Setup 2016-11-29 11:44:37 +01:00
Vladimir Panteleev c0b9100de8 ilasm: Add stub parsing for .data cil attribute
The "cil" attribute seems to indicate that the data should be placed
in the .text section, along with the code.

Like the tls attribute, the cil attribute is only implemented insofar
as to recognize it as a valid keyword that can occur in a .data
declaration.
2016-11-29 10:28:21 +00:00
Niklas Therning 4e20db77de Disable symbolicate tests on Windows
We will ignore the failing test-with-aot-msym test for now.
2016-11-29 10:56:08 +01:00
Zoltan Varga a90de75524 [bcl] Fix a regression introduced by 91c68de23f. If a thread was added to (#4038)
blocking_threads twice, then removed once, the corresponding entry in threads_stacktraces was removed,
causing an exception in ReleaseHandle () later.
2016-11-29 03:06:55 -05:00
Zoltan Varga 57fc0b7439 [runtime] Add error handling to mono_get_dbnull_object () it can fail due to a TAE. (#4039) 2016-11-29 03:01:35 -05:00
Johan Lorensson 5d2f0cfa01 Merge pull request #4023 from lateralusX/jlorenss/test-driver-reporter
Adding support to get test results back from TestDriver.
2016-11-29 08:47:12 +01:00
Zoltan Varga e186dcff2c [build] Enable aot for Microsoft.CodeAnalysis.dll/Microsoft.CodeAnalysis.CSharp.dll, as the aot compiler generates smaller images now. 2016-11-29 00:29:18 -05:00
Zoltan Varga a40dc9384b [aot] Only emit instances when using full aot. 2016-11-29 00:22:42 -05:00
Zoltan Varga 548a4dfa19 [runtime] Fix e659982b7b, two callbacks were mixed up. 2016-11-28 21:13:39 -05:00
Alexander Kyte e659982b7b Prevent ThreadAbort from prematurely ending function calls in catch block (#1837)
* [runtime] Fix naming scheme for check if stack grows upward

It was very counter-intutitive to have a file-local preprocessor variable
with a name that sounds like it should have the same truthiness as a given global
preprocessor variable but was defined as the negation of the global variable.

* [runtime] Prevent ThreadAbort from terminating function calls in catch body

ThreadAbortExceptions are special in that if the thread has not
had it's abortion reset, when it reaches the end of a catch block it
must throw.

Consider the situation where a thread has been aborted and the
ThreadAbortException has been caught. If this catch block calls
a method that has a try/catch combination, the current implementation
will throw the ThreadAbortException at the end of the catch in that
function.

Usually you only care that Thread abortions are prompt, but this bug
could result in dramatic program behavior changes when this is combined
with lazy class initialization.

```
Example:
Console.WriteLine inside a thread abort with an uninitialized Console.
```

This fix records the stack pointer when a catch clause is entered, and
only rethrows the abortion if we're exiting a catch clause above or at the
level of the catch clause previously entered.
2016-11-28 21:01:09 -05:00
Zoltan Varga 4f738f8b32 [aot] Bump aot file version after c690636c01. 2016-11-28 20:58:45 -05:00
Zoltan Varga c690636c01 [jit] Call mono_jit_thread_attach () through a GOT slot instead of directly, so the call doesn't go through the trampoline code which wouldn't work if the thread was not attached. (#4037) 2016-11-28 20:57:52 -05:00
Zoltan Varga 950c27dc59 [llvm] Fix a regression introduced by d231b5134d. 2016-11-28 20:14:18 -05:00
Rodrigo Kumpera 9d0c9d6022 add type-checking.c to the build. 2016-11-28 16:05:20 -08:00
Rodrigo Kumpera 00d28f5b50 [runtime] CEE_MONO_CISINST is dead. Removed the type-cast half. 2016-11-28 16:01:25 -08:00
Rodrigo Kumpera e3353ad112 [mini] Remove the need for isinst wrapper for MBRO. 2016-11-28 16:01:25 -08:00
Rodrigo Kumpera 191a5e3731 [mini] Remove the need of the ininst wrapper for interfaces. 2016-11-28 16:01:25 -08:00
Rodrigo Kumpera cd3aad7aae [mini] Remove CEE_MONO_CCASTCLASS. Could not remove from opcodes.def at it weirdly breaks mono/mini/arrays.cs. 2016-11-28 16:01:25 -08:00
Rodrigo Kumpera e8688d4b01 [mini] CEE_MONO_CCASTCLASS is dead. Removed the type-cast half. 2016-11-28 16:01:24 -08:00
Rodrigo Kumpera 569cfcb08e [mini] Avoid the cast wrapper for MBRO. 2016-11-28 16:01:24 -08:00
Rodrigo Kumpera 59df58a1ec Remove dead code. 2016-11-28 16:01:24 -08:00
Rodrigo Kumpera a2a6922840 [mini] Avoid the cast wrapper for ifaces 2016-11-28 16:01:24 -08:00
Rodrigo Kumpera a2d8de9766 [mini] Simplify casting of variant generic interfaces. 2016-11-28 16:01:23 -08:00
Rodrigo Kumpera 1a645892a0 [mini] Extract type checking code into type-checking.c 2016-11-28 15:58:50 -08:00
Rodrigo Kumpera 7adf501b14 Merge pull request #4009 from kumpera/lazy-array-ifaces
[runtime] Implement lazy interface implementation for arrays.
2016-11-28 18:54:03 -05:00
Rodrigo Kumpera c3ba9e9877 [runtime] Remove the eager array interfaces code. Good ridance. 2016-11-28 15:10:30 -08:00
Rodrigo Kumpera f760dcf6e9 [runtime] Clean mono_init_internal hacks. Moved to mono_class_setup_mono_type / mono_class_create_from_typedef. 2016-11-28 15:10:30 -08:00
Rodrigo Kumpera c149ee5b4e [runtime] Fix bad packing in MonoClass. 2016-11-28 15:10:30 -08:00
Rodrigo Kumpera 1b9659a1d2 [runtime] Implement lazy interface implementation for arrays.
We have the following set of problems:

Arrays implement interfaces that are invariant but behave like covariant.
Those are IList`1, ICollection`1, IEnumerable`1

Arrays of primitive types are type equivalent based on their underlying type.
This means int[], uint[] and IntEnum[] are all interchangeable. And so is casting among their interfaces.
Meaning this is valid: `(IList<IntEnum>)(object)new int[1]`.

Finally, the way we implement IEnumerator`1 for arrays forces it to behave just like the other 3 interfaces.

Implementation:

Introduce MonoClass::is_array_special_interface, set for all the above interfaces. This allow fast checking of the interfaces in question.

mono_class_is_assignable_from now includes the array casting rules.

Change mono_class_interface_offset_with_variance to take arrays into account when looking for a candidate iface.

The JIT implements casting of those interfaces using the cast with cache wrapper.

Finally, to handle the weird primitive rules, set the cast_class of sbyte, ushort, uint and ulong to their same-size buddies.
This makes it easier for the casting code to resolve this problem.

Problems:

Casting performance is terrible, anywhere from 60% to 1000% slower on a micro-benchmark.
	Can be improved by extending our casting wrapper to handle those interfaces (probably would have to give up inlining as they would be huge)

The code in domain.c is icky, but not sure where to put it otherwise.

IEnumerator could be solved in Array.cs by not forcing it to be magic as well. Meaning the folowing

```
object array = new int[1];
var a = array as IList<int>;
var b = array as IList<uint>;

a.GetEnumerator().GetType () != b.GetEnumerator().GetType ();
```

The last line is false today but it's harmless to change it to avoid the casting penalty for such central type.
2016-11-28 15:10:15 -08:00
Marek Safar 5e75d4dcab [build] Install also from mcs/packages 2016-11-28 23:30:14 +01:00
Zoltan Varga 5b57dcd52b Revert "[CI] Disable winforms tests on all platforms."
This reverts commit 598183023b.
2016-11-28 14:04:46 -05:00
Zoltan Varga 598183023b [CI] Disable winforms tests on all platforms. 2016-11-28 13:56:37 -05:00
Zoltan Varga e8186bf4b7 Convert MonoClassExt to class properties (#4022)
* [runtime] Store the class failure data as a property.

* [runtime] Store the list of nested classes as a class property.

* [runtime] Move the property relation information from MonoClassExt into a class property.

* [runtime] Move the event relation information from MonoClassExt into a class property.

* [runtime] Move the field_def_values field from MonoClassExt into a class property.

* [runtime] Move the declsec_flags field from MonoClassExt into a class property.

* [runtime] Remove unused MonoClassExt infrastructure.

* [runtime] Add some API docs.
2016-11-28 13:42:16 -05:00
Andi McClure 28046216b2 Merge pull request #4015 from xmcclure/new-threads-collect-fix
Possibly fix hang in sgen-new-threads-collect.exe
2016-11-28 10:37:55 -05:00
Niklas Therning 61c239fb7f Use __cdecl rather than __stdcall for icalls on Windows 32-bit
Mono assumes the same calling convention for icalls as the default P/Invoke
calling convention which is __stdcall on Windows. But none of the icalls are
marked with the required __stdcall attribute on Windows so there will be a
mismatch between the caller and callee.

This is the reason why the System.Web.HttpUtilityTest.JavaScriptStringEncode()
test crashes on Windows 32-bit. It generates a call to an icall
(char.ToString() inlines to new string(char,int)) which is assumed to be
__stdcall while it's actually __cdecl. The caller will decrement ESP as if the
callee was __stdcall resulting in ESP decreasing on each iteration. After a
couple of thousand iterations in the loop in that test the stack guard page is
hit and a stack overflow occurs.
2016-11-28 15:25:01 +01:00
Marek Safar e90eb26993 Merge pull request #2774 from marek-safar/roslyn
Roslyn compiler switch
2016-11-28 14:38:54 +01:00
Vlad Brezae d231b5134d Merge pull request #3973 from mono/small-perf
[Perf] Replace some exhaustive O(n^3) or O(n^2) iterations with O(n)
2016-11-28 14:38:16 +02:00
Marek Safar 0938dfa8e8 Switch to cecil branch with better pdb handling 2016-11-28 08:56:04 +01:00
Marek Safar 4a55ffac62 [build] Bump required bootraping mono version and download it automatically 2016-11-28 08:56:04 +01:00
Marek Safar 3891a89076 [build] Roslyn switch 2016-11-28 08:56:04 +01:00
Miguel de Icaza 700a511bac [marshal] Fix API documentation comment on mono_string_to_byvalwstr 2016-11-27 21:37:54 -05:00
Zoltan Varga c24496dfc8 [runtime] Fix mono_image_load_module_checked () so it actually stores the loaded netmodule in image->modules, not the parent image itself. Fixes #47762. (#4029) 2016-11-27 21:36:48 -05:00
Zoltan Varga b06da6f5e4 [aot] Avoid a crash on class loading failures. Fixes #47152. 2016-11-26 22:45:26 -05:00
Zoltan Varga 560ac752c4 [runtime] Fix a warning. 2016-11-26 17:02:40 -05:00
Zoltan Varga 845b196340 [jit] Fix some SIMD problems on x86. 2016-11-26 16:33:31 -05:00
Alexander Köplinger 51ccfec665 Merge pull request #4028 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-26 19:16:09 +01:00
monojenkins 43cfc13be8 [msvc] Update csproj files 2016-11-26 16:45:55 +00:00
Alexander Köplinger 1562fc6fe5 [Facades] Don't build System.Drawing.Primitives.dll by default for monotouch_watch profile
It needs special logic like the other monotouch profiles in the products
since we don't have a System.Drawing assembly/types for these profiles in Mono
and don't embed the types in the facade anymore after 1074fe91bd.
2016-11-25 20:49:45 +01:00
Marek Safar d717933f7f Merge pull request #4026 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-25 18:24:35 +01:00
Marek Safar 1074fe91bd [Facades] Remove watch special System.Drawing.Primitives, all types are now available in watchos.dll 2016-11-25 18:01:26 +01:00
monojenkins 5e40f8980c [msvc] Update csproj files 2016-11-25 16:51:25 +00:00
Alexander Köplinger a3248942df Merge pull request #4024 from akoeplinger/mkbundle-messages
[mkbundle] Print error message when assemblies couldn't be loaded
2016-11-25 17:07:13 +01:00
lateralusX 0e0c1edaf6 Adding support for get test results in TestDriver.
Added support to pass in an instance of a TestDriverReporter class. If this
an instance of this class is passed in it will get the number of executed, skipped
and failed tests. This could be very useful for external runners that would like
to present the result of TestDriver executed tests.
2016-11-25 13:17:38 +01:00
Alexander Köplinger cea5f28d2c [mkbundle] Print error message when assemblies couldn't be loaded
There were two places in mkbundle where it'd simply exit without printing anything,
leading to confusion such as in https://bugzilla.xamarin.com/show_bug.cgi?id=46479.
2016-11-25 12:40:49 +01:00
Alexander Köplinger fcf4e1b7bf Merge pull request #4020 from akoeplinger/mobile_static-rename
Rename the mobile_static profile to aot_only
2016-11-25 12:03:35 +01:00
Alexander Köplinger 450f5dec0f [corlib] Simplify RNGCryptoServiceProvider file name on MT and enable tests
Also unify xammac and monotouch .sources files.
We're now using the CommonCrypto-based RNGCryptoServiceProvider on xammac too.
2016-11-25 03:53:16 +01:00
Alexander Köplinger 7669c811ff [corlib] Move ComAwareEventInfo stub into System.Core
It was mistakenly added to corlib, it is in System.Core.dll on .NET
2016-11-25 03:38:45 +01:00
Zoltan Varga 73e7f7e156 [jit] Fix more simd+aot issues. Avoid treating the Vector<T> GTD or Vector<T_REF> or Vector<T_GSHAREDVT> as simd types. (#4021) 2016-11-24 17:23:59 -05:00
Bernhard Urban 1fabbf5c9d Merge pull request #4019 from vargaz/get-gclass-locking
[runtime] Reduce the size of the critical section in mono_generic_cla…
2016-11-24 21:57:00 +01:00
Bernhard Urban ca05bb3da7 Merge pull request #4017 from vargaz/get-array-class-locking
[runtime] Decrease the size of the critical section in mono_bounded_a…
2016-11-24 21:54:36 +01:00
Bernhard Urban 2246dd6843 Merge pull request #4018 from vargaz/get-fnptr-locking
[runtime] Reduce the size of the critical section in mono_fnptr_class…
2016-11-24 21:54:01 +01:00
Zoltan Varga e5a8996da2 [runtime] Reduce the size of the critical section in mono_fnptr_class_get (). 2016-11-24 13:09:50 -05:00
Alexander Köplinger 9f5b8c4cf2 Rename the mobile_static profile to aot_only
We decided it's a better name since we're using the profile to
test FullAOT scenarios on desktop (as opposed to the mobile profiles).

While doing the rename I saw that a lot of the #ifdefs were using
MOBILE_STATIC even though the code should actually be included/excluded
in all FullAOT scenarios, e.g. System.Reflection.Emit. I replaced those
cases with FULL_AOT_RUNTIME instead.

For cases where code is specific to this profile, I added a new
AOT_ONLY_DESKTOP define.
2016-11-24 17:40:54 +01:00
Marek Safar 4819f0aad2 [Facades] Add netstandard 2016-11-24 17:14:54 +01:00
Marius Ungureanu a2d76503b1 [Perf] Free process in-place in loop on modules iterations. 2016-11-24 17:17:12 +02:00
Marek Safar 39a04ffccc Bump cecil 2016-11-24 12:14:07 +01:00
Marek Safar 1d6abe9eca [mcs] Count arity correctly for deeply nested types 2016-11-24 11:58:46 +01:00
Zoltan Varga e8ad984ea3 [runtime] Move more callbacks to the RuntimeCallbacks structure. (#4016) 2016-11-23 19:23:10 -05:00
Zoltan Varga 029fe6cfec [runtime] Decrease the size of the critical section in mono_bounded_array_class_get (). 2016-11-23 19:20:00 -05:00
Zoltan Varga 49c62bd1e0 [runtime] Reduce the size of the critical section in mono_generic_class_get_class (). 2016-11-23 17:29:39 -05:00
Andi McClure 24b11d224b Use DateTime.UtcNow not DateTime.Now in test 2016-11-23 16:22:11 -05:00
Zoltan Varga 8c9bc63492 [runtime] Disable the Wformat-zero-length warning. 2016-11-23 15:52:37 -05:00
Andi McClure 27ff5ac5df Possibly fix hang in sgen-new-threads-collect.exe
This test is occasionally taking over 15 minutes to complete. This
could be a hang in the runtime, but the test has a scheduling fairness
issue which could also have the same result (if the GC thread wakes up
much more often than the join thread). Patch slows down the GC rate to
give the join thread a chance to work, and extends the test to a fixed
30 second runtime.
2016-11-23 15:33:27 -05:00
Zoltan Varga 49ba5c7abb [simd] Fix a few AOT problems. 2016-11-23 14:48:29 -05:00
Zoltan Varga d3ad150860 [bcl] Implement Thread.CurrentThread using an icall which calls mono_… (#4011)
* [bcl] Implement Thread.CurrentThread using an icall which calls mono_thread_current () to avoid creating duplicate Thread objects.

* [bcl] Remove unused Thread:CurrentInternalThread_internal () icall.

* [bcl] Optimize Thread:CurrentThread a bit.
2016-11-23 14:43:47 -05:00
Niklas Therning 63caa1998e Merge pull request #4013 from ntherning/fix-assert-in-poll_event_wait-on-WSAENOTSOCK-on-windows-2
Fix assert in poll_event_wait() on WSAENOTSOCK on Windows #2
2016-11-23 18:58:29 +01:00
Marek Safar 9858a95dd1 [System] Don't send response on empty stream write. Fixes #47549 2016-11-23 17:40:49 +01:00
Martin Baulig c8f2e68962 Merge pull request #3962 from mkorkalo/fix_MonoBtlsContext_memory_leak
fix a massive memory leak in MonoBtlsContext
2016-11-23 16:50:09 +01:00
Aleksey Kliger (λgeek) 1020eb345f Merge pull request #3992 from lambdageek/dev-handles-srassembly
[coop] Use handles in System.Reflection.Assembly.{GetReferencedAssemblies,InternalGetAssemblyName}
2016-11-23 09:47:37 -05:00
Niklas Therning abc6614608 Fix assert in poll_event_wait() on WSAENOTSOCK on Windows #2
PR #3998 fixes an error handling issue in poll_event_wait(). This new change
fixes a minor code style problem in that PR, the condition in a ternary wasn't
enclosed in parentheses.
2016-11-23 14:57:45 +01:00
Zoltan Varga ccf49c73f4 [runtime] Filter out duplicate interfaces in mono_class_get_implemented_interfaces (). (#4007) 2016-11-23 08:20:56 -05:00
Zoltan Varga 63db2242eb [runtime] Allocate the temporary vtable array using g_malloc in mono_class_setup_vtable (), alloca can overflow for large vtable sizes. Hopefully fixes #45140. (#4006) 2016-11-22 22:24:38 -05:00
Ludovic Henry 9fb7859dd1 [threadpool] Replace stop by abort for worker thread 2016-11-22 19:05:27 -05:00
Kenneth Skovhede 1e6c680fa2 [Socket] Fix DuplicateAndClose (#3995)
* Fixed issue 47425

This fix simply ensures that the `m_Handle` value is not processed by the GC after a call to `DuplicateAndClose` as that causes the duplicated socket to close.

A potential issue is that this will leak sockets if the sockets are never re-created.

* Implemented ref-counting as suggested by @ludovic-henry
2016-11-22 19:04:57 -05:00
Alexis Christoforides c2e2d0dbfd Bockbuild 2016-11-22 19:01:02 -05:00
Aleksey Kliger 975f6740ea Bump corlib version. 2016-11-22 18:38:50 -05:00
Aleksey Kliger 385d38e60f [reflection] Implement GetReferencedAssemblies in managed
Call out to native to get an array of Mono.MonoAssemblyName* and use
AssemblyName.FillName to create the managed structs.
2016-11-22 18:38:49 -05:00
Alexis Christoforides 7579ea7c42 Bump bockbuild properly 2016-11-22 18:28:52 -05:00
Alexis Christoforides 275f5da19d Bump bockbuild 2016-11-22 17:39:31 -05:00
Zoltan Varga b277bf84af [runtime] Avoid passing a newline to mono_trace (), it adds one automatically. 2016-11-22 15:42:17 -05:00
Zoltan Varga c943fafb41 [jit] Make an assert more informative. Fixes #47152. 2016-11-22 15:12:47 -05:00
Aleksey Kliger 0e7f2016d3 [reflection] Change Assembly.InternalGetAssemblyName to return native MonoAssemblyName
Use managed AssemblyName.FillName to make a
System.Reflection.AssemblyName from a Mono.MonoAssemblyName

Delete native fill_reflection_assembly_name implementation. It's dead code.
2016-11-22 14:40:53 -05:00
Aleksey Kliger c796254173 [metadata] mono_assembly_fill_assembly_name_full
When copyBlobs is true, duplicates the
name, culture and public_key fields of MonoAssemblyName.

If copyBlobs is false, point those fields into the MonoImage.

Change mono_assembly_fill_assembly_name to call the full version with
copyBlobs == FALSE.
2016-11-22 14:40:53 -05:00
Aleksey Kliger 3a7a0a6a2c [coop] Use handles for S.R.Assembly.{GetReferencedAssemblies,InternalGetAssemblyName} 2016-11-22 14:40:53 -05:00
Aleksey Kliger 2d88875c2b [runtime] Add mono_string_handle_to_utf8 2016-11-22 14:40:52 -05:00
Aleksey Kliger f5a91508fe [runtime] mark mono_get_exception_{file_not_found2,bad_image_format2} external only.
Runtime should use
- mono_error_set_assembly_load  for mono_get_exception_file_not_found2
- mono_error_set_bad_image_name for mono_get_exception_bad_image_format2
2016-11-22 14:40:52 -05:00
Alexis Christoforides fee5ece805 Merge branch 'alexischr/nursery-canaries-managed-alloc' 2016-11-22 14:12:53 -05:00
Niklas Therning 22faa8733f Merge pull request #4003 from ntherning/ignore-disconnected-interfaces-in-HttpListenerRequestTest.HttpRequestIsLocal
Ignore disconnected interfaces in HttpListenerRequestTest.HttpRequestIsLocal
2016-11-22 20:03:22 +01:00
Alexander Köplinger 6adffa4edd Merge pull request #4005 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-22 19:26:39 +01:00
Marek Safar 44b95d3d02 [System.Runtime.Remoting] Disable test accidentally re-enabled by nunitlite switch 2016-11-22 18:13:14 +01:00
Zoltan Varga 230e3be56d [runtime] Disable some tests when running with llvm since they take too much time. Reduce the run time of the namedmutex-destroy-race test. 2016-11-22 11:59:59 -05:00
monojenkins d7b958e39d [msvc] Update csproj files 2016-11-22 16:39:46 +00:00
Zoltan Varga edc1e82682 [runtime] Mark the ThreadPool.PerformWaitCallback () method as save_lmf, so ThreadAbortExceptions thrown inside tp worker threads are always caught, otherwise if the TAE arrives while the threads is in native code while executing the callback, the EH will code will abort the thread so the worker thread cleanup code is not executed, causing problems later. (#4002) 2016-11-22 11:24:51 -05:00
Marek Safar 2d189dc93c [mcs] Null coalescing over typed null constants. 2016-11-22 17:02:38 +01:00
Ludovic Henry d8693e0c73 [profiles] Fix MOBILE assemblies and tests compilation + Rename MOBILE to AOT_HYBRID
This only fixes the compilation of the assemblies and the tests. This doesn't fix the failing tests or the crashes.
2016-11-22 10:32:15 -05:00
Ludovic Henry f1decc325f [ci] Add script to run MOBILE profile tests 2016-11-22 10:32:15 -05:00
Ludovic Henry 66d926f926 [utils] Add MonoRefCount to factor ref-counting mechanisms 2016-11-22 10:23:57 -05:00
Marek Safar d0b9c5ebbb [corlib] Update list of known lcids and update CLRD data. Fixes #46456 2016-11-22 14:35:59 +01:00
Niklas Therning 39c699b54a Ignore disconnected interfaces in HttpListenerRequestTest.HttpRequestIsLocal
This test creates an HttpListener for every IP address of all network
interfaces. On Windows disconnected network interfaces have unroutable IP
addresses (169.254.XXX.XXX) and this test fails when it tries to listen to
such an IP address. This patch adds a check to the test to ignore network
interfaces which don't have OperationalStatus == Up.
2016-11-22 14:27:59 +01:00
Niklas Therning 3592a79dc8 Merge pull request #3998 from ntherning/fix-assert-in-poll_event_wait-on-WSAENOTSOCK-on-windows
Fix assert in poll_event_wait() on WSAENOTSOCK on Windows
2016-11-22 11:36:04 +01:00
Zoltan Varga 1ca0e9ae50 [runtime] Add a test for appdomain unload + blocking tp thread. (#4000) 2016-11-21 20:51:05 -05:00
Alexis Christoforides 264e6c4b7c [MacSDK] Fix typo 2016-11-21 17:40:58 -05:00
Zoltan Varga 8979f2786c [runtime] Add back locking around mono_class_layout_fields () to work around https://bugzilla.xamarin.com/show_bug.cgi?id=47156. 2016-11-21 17:28:34 -05:00
Zoltan Varga e83953d02c Threadpool appdomain unload cleanup (#3996)
* [runtime] Move the threadpool related data from MonoDomain to ThreadPoolDomain.

* [runtime] Simplify the waiting for tp threads in the domain unload code. Use a condvar to wait for the active+outstanding number of jobs to reach 0.
2016-11-21 16:59:02 -05:00
Ludovic Henry ead96e0c2c [tests] Rework how we do disabled tests 2016-11-21 09:45:42 -05:00
Aleksey Kliger (λgeek) a4240142a9 Merge pull request #3988 from lambdageek/dev-handles-srmodule
[coop] Use handles in System.Reflection.Module and System.Reflection.Assembly
2016-11-21 09:43:07 -05:00
Niklas Therning 266345b394 Fix assert in poll_event_wait() on WSAENOTSOCK on Windows
On Windows poll_event_wait() in threadpool-ms-io-poll.c checks
WSAGetLastError() when mono_poll() fails. However, mono_poll() sets errno
after converting the WSAXXX error code (e.g. WSAEFAULT->EFAULT). Occasionally
(maybe 1 in 100) the System test suite fails due to mono_poll() returning an
error and poll_event_wait() not handling the error code correctly on Windows.

This patch changes poll_event_wait() to use the same code path which checks
errno on all platforms including Windows. It also fixes a few other places
which used to check WSAGetLastError() rather than errno after a call to
mono_poll(). Also, the Socket.Poll_internal() and Socket.Select_internal()
icalls had to be patched to convert back the errno value to a corresponding
WSAXXX error code by adding WSABASEERR on Windows.
2016-11-21 15:00:41 +01:00
Marek Safar a7de9367ac Revert "[runtime] Default mobile_static AOT type to FullAOT" 2016-11-21 14:40:48 +01:00
Marek Safar cfeadc51e8 Merge pull request #3406 from alexanderkyte/mobile_static_default
[runtime] Default mobile_static AOT type to FullAOT
2016-11-21 09:54:08 +01:00
Zoltan Varga 61e482b928 [runtime] Add even more logging code for the class.c assertion. 2016-11-20 18:01:46 -05:00
Zoltan Varga fc082de6fd Fix the build. 2016-11-20 11:01:47 -05:00
Zoltan Varga 98aa3fd560 Implement SIMD support for the Vector2/3/4 classes in System.Numerics. (#3765)
* [simd] Rename SimdIntrinsc->SimdIntrinsic.

* [ji] Add beginnings of support for the SIMD types in the System.Numerics assembly.

Add intrinsics for the methods marked [JitIntrinsic] in the System.Numerics.Vector2 class. Generalize some code in simd-intrinsic.c
so it works both with System.Numerics and Mono.Simd types.

* [jit] Add support for System.Numerics.Vector4.

* [jit] Add support for System.Numerics.Vector3.

* [jit] Add tests for the JIT intrinsics in System.Numerics.Vectors.

* [jit] Implement System.Numerics.Vector.IsHardwareAccelerated intrinsics.

* [jit] Fix the implementation of System.Numerics.Vector.IsHardwareAccelerated, it should return true.

* [jit] Implement some support for the SIMD intrinsics in System.Numerics.Vector<T>.

* [jit] Disable the usage of the Vector SIMD intrinsics when using r4fp until support for it is implemented.

* [jit] Fix llvm support for the Vector<T> intrinsics.

* [jit] Disable the Vector<T> tests since they don't compile yet.

* [jit] Add an optimization for the typeof(T)==typeof(<concrete type>) construct common in some generics code.

* [simd] Only return true from IsHardwareAccelerated () if simd_supported_versions is non-zero.

* [simd] Add support for add/sub/mul/div operations on Vector<T>.
2016-11-20 10:57:07 -05:00
Marek Safar 82dccb8444 [System] WebClient async request on file streams. Fixes #46538 2016-11-20 11:35:51 +01:00
Zoltan Varga 0ff2675b06 [runtime] Add more debug code to help debug a class.c assert. 2016-11-19 15:23:33 -05:00
Marek Safar 7f765ed410 [corlib] Don't crash when calling Evidence on AssemblyBuilder. Fixes #46739 2016-11-18 23:44:21 +01:00
Jon Purdy 658866d22a [sgen] Fix sgen_qsort.
sgen_qsort sometimes had pathological behavior due to a poor choice of
pivot. This implementation uses the median-of-three strategy, and limits
stack depth by avoiding recursive calls when possible.
2016-11-18 13:52:27 -08:00
Ludovic Henry 25842ac4c6 Revert "[process] Allocate a handle even for non-child processes"
This reverts commit d6928839015effec6358d7bc9c7b1b547645140a.
2016-11-18 16:41:22 -05:00
Zoltan Varga 195b8f074c Revert "[runtime] Change the thread wait code to use cond variables instead o… (#3946)"
This reverts commit 4a1161e2d6.

Revert this, keep the event based code for now.
2016-11-18 15:42:02 -05:00
Zoltan Varga 17c0f93969 Revert "[runtime] Fix the waiting for background threads which got broken by 4a1161e2d6. (#3983)"
This reverts commit dbc63ae672.

Revert this, keep the event based code for now.
2016-11-18 15:42:02 -05:00
Marek Safar 4f2a9766b1 [System] Add range check for empty URI prefix when it also contains unicode character. Fixes #47205 2016-11-18 17:59:32 +01:00
Aleksey Kliger 5f44eb408f [reflection] Use handles for System.Reflection.Assembly.GetTypes
Also change mono_get_exception_reflection_type_load_checked() to use handles.
2016-11-18 10:21:26 -05:00
Aleksey Kliger d66a1722ba [reflection] Use coop handles for 6 icalls in System.Reflection.Module
- Close
- GetGlobalType
- GetHINSTANCE
- GetMDStreamVersion
- GetPEKind
- InternalGetTypes
2016-11-18 10:08:36 -05:00
Aleksey Kliger 9062c51fa5 [coop] mono_type_get_object_handle 2016-11-18 10:08:36 -05:00
Aleksey Kliger 5ea22edbc4 [coop] Add more handle utility functions
- MONO_HANDLE_ARRAY_GETREF
- HANDLE_FUNCTION_RETURN_OBJ
- mono_array_handle_memcpy_refs
2016-11-18 10:08:36 -05:00
Aleksey Kliger e2c41067c8 [coop] Add mono_error_set_exception_handle 2016-11-18 10:08:36 -05:00
Aleksey Kliger (λgeek) 095e791273 Merge pull request #3932 from lambdageek/dev-handles-outargs
[coop handles] Support out args; convert some icalls.
2016-11-18 09:53:59 -05:00
Niklas Therning 9add1a7971 Merge pull request #3985 from ntherning/fix-Mono.Posix-on-windows
Fix Mono.Posix tests on Windows
2016-11-18 14:30:22 +01:00
Henric Müller e264edcf35 Merge pull request #3948 from henricm/fix-pinvoke-utf8-windows
Fix crash on Windows in PInvoke UTF8 tests
2016-11-18 07:11:17 +01:00
Ludovic Henry de1865dad5 [configure.ac] Factor common code for runtime preset 2016-11-17 16:52:53 -05:00
Ludovic Henry ba33a498f1 [configure] Add hybrid runtime preset
It is very close to the Full AOT profile (mobile static), but as the JIT is available, we still allow features like System.Reflection.Emit.
2016-11-17 16:52:53 -05:00
Niklas Therning bddf0f6fc6 Merge pull request #3987 from ntherning/fix-support-stdio-compile-error-on-android
Fixes compile error in support/stdio.c on XA
2016-11-17 22:20:58 +01:00
Niklas Therning 77cec01d04 Fixes compile error in support/stdio.c on XA 2016-11-17 22:14:24 +01:00
Zoltan Varga 586ad14ed1 Fixed arrays pinvoke (#3972)
* [amd64] Use a GArray to collect field information in add_valuetype ().

* [amd64] Fix the marshalling of fixed buffers by treating them as an array of elements.
2016-11-17 14:38:27 -05:00
Zoltan Varga 218e0a8081 [sdb] Error out when trying to obtain objects from unloaded domains, we have to check domain->state as well since the object references become invalid before we received the domain unloaded profiler event. Fixes #44381. 2016-11-17 14:07:11 -05:00
Vlad Brezae 22577feecf Merge pull request #3968 from BrzVlad/fix-monitor-exception
[runtime] Fix monitor exception throwing
2016-11-17 20:40:14 +02:00
Ankit Jain c265b8f9b2 Merge pull request #3979 from radical/fix-xbuild-tgt
[xbuild] Handle a repeat build of a target, when building through ..
2016-11-17 13:22:49 -05:00
Zoltan Varga 0fabf83895 [runtime] Add some printfs to help debug the g_assert (klass->instance_size == instance_size); assert failure. 2016-11-17 13:06:52 -05:00
Marek Safar 2184c18487 [mcs] Fixes user operator extraction from shared list. Fixes #46806 2016-11-17 18:47:46 +01:00
Aleksey Kliger 05c7353dde [coop] Fix mono_stack_mark_pop
We need to restore the old size into the old top chunk, not the current
top chunk.
2016-11-17 11:13:52 -05:00
Aleksey Kliger 4928a3f573 [runtime] Use handles for System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray 2016-11-17 11:13:51 -05:00
Aleksey Kliger efa3dd7f34 [runtime] Use coop handles for System.Enum.GetEnumValuesAndNames 2016-11-17 11:13:49 -05:00
Aleksey Kliger a97f263bca [coop] Marshal out args for icalls using handles. 2016-11-17 11:13:48 -05:00
Aleksey Kliger b30ce960db [coop] Use coop handles for Mono.Runtime.GetNativeStackTrace
Implement mono_exception_get_native_backtrace in terms of mono_exception_handle_get_native_backtrace.
2016-11-17 11:13:47 -05:00
Aleksey Kliger 8a7b68f703 [coop] Functions to convert coop handles to gchandles and back 2016-11-17 10:59:09 -05:00
Alexander Köplinger b17e4c71ec Merge pull request #3965 from akoeplinger/ppc-disable-tests
[ppc64] Disable a few runtime/bcl tests that currently fail
2016-11-17 16:58:00 +01:00
Zoltan Varga dbc63ae672 [runtime] Fix the waiting for background threads which got broken by 4a1161e2d6. (#3983) 2016-11-17 09:49:21 -05:00
João Matos e273739f3d Merge pull request #3953 from rolfbjarne/offsets-tool-autoreclone
[offsets-tool] Make sure to re-clone when the hash for the cpp binaries changes.
2016-11-17 13:29:27 +00:00
Niklas Therning 3df6f5c3f3 Fix Mono.Posix tests on Windows
Cleaned up Mono_Posix_FromSeekFlags() in support/map.c. It didn't properly
handle the case when L_INCR, L_SET, L_XTND aren't available, like on Windows.

Added Mono_Posix_Stdlib_GetLastError() to support/errno.c and changed
Stdlib.GetlastError() use it. Without this Stdlib.GetlastError() wouldn't take
errno in the C runtime used by libMonoPosixHelper.dll into account.

On Windows the Syscall class failed to initialize due to missing functions,
e.g. Mono_Posix_Syscall_get_at_fdcwd(), in libMonoPosixHelper.dll. Those
readonly static fields which were initialized at class initialization have now
been converted to static readonly properties so that the Syscall class can be
initialized despite those functions not being defined.

Cleaned up temp file handling in StdioFileStreamTest to avoid failures due to
sharing violations on Windows.

Fixed a bug in the StdioFileStreamTest.Write() test method when reading back
the batch of bytes written in the second part of the test.

Enabled the Mono.Posix test suite to run on PR builds. This test suite should
from now on be green.
2016-11-17 14:10:49 +01:00
Alexander Köplinger 1bea992099 [ppc64] Disable a few runtime/bcl tests that currently fail
Until someone can investigate those we want to have a clean CI.
2016-11-17 12:59:13 +01:00
Niklas Therning b34a3d6b78 Merge pull request #3966 from ntherning/prevent-multiple-c-runtimes-on-windows
Prevent Mono.Posix from using multiple C runtimes on Windows
2016-11-17 12:49:47 +01:00
Zoltan Varga eb1ae9f8eb [jit] Make mono_print_method_from_ip () work when invoked from threads which are not attached to the runtime. 2016-11-17 00:09:12 -05:00
Alexander Köplinger f0bd6288c3 [corlib] Remove public ctor from IncrementalHash
It doesn't have a public constructor in netstandard/corefx.
2016-11-17 01:55:54 +01:00
Ankit Jain 9572e2a3e3 [xbuild] Handle a repeat build of a target, when building through ..
.. `Project.Build(..)`. For example, in:

```
	<MSBuild Projects="bar.proj" Targets="foo;foo" />
```

The second invocation of `foo`, in the *same* `Project.Build(..)` call,
would get skipped, but BuildTarget assumed that no previous `outputs`
entry existed in the `targetOutputs` dictionary.

System.Exception: MSBuild operation failed ---> System.ArgumentException: Item has already been added. Key in dictionary: 'foo'  Key being added: 'foo'
  at System.Collections.Hashtable.Insert (System.Object key, System.Object nvalue, System.Boolean add) [0x00200] in <94fd79a3b7144c54b4cb162b50fc7761>:0
  at System.Collections.Hashtable.Add (System.Object key, System.Object value) [0x00000] in <94fd79a3b7144c54b4cb162b50fc7761>:0
  at Microsoft.Build.BuildEngine.Project.BuildTarget (System.String target_name, System.Collections.IDictionary targetOutputs) [0x0007e] in <b1524340ac7e4c06b22fac1b2db62c08>:0
  at Microsoft.Build.BuildEngine.Project.BuildInternal (System.String[] targetNames, System.Collections.IDictionary targetOutputs, Microsoft.Build.BuildEngine.BuildSettings buildFlags) [0x00134] in <b1524340ac7e4c06b22fac1b2db62c08>:0
  at Microsoft.Build.BuildEngine.Project.Build (System.String[] targetNames, System.Collections.IDictionary targetOutputs, Microsoft.Build.BuildEngine.BuildSettings buildFlags) [0x0004b] in <b1524340ac7e4c06b22fac1b2db62c08>:0

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=44549
2016-11-16 17:59:12 -05:00
Aleksey Kliger a4dd10aab7 [coop] Use coop handles for Mono.Runtime.GetDisplayName 2016-11-16 16:51:23 -05:00
Aleksey Kliger c6508ecaff [coop] Enter/exit macros for handle-allocating functions
Just setup/clear handle frames
2016-11-16 16:51:22 -05:00
Aleksey Kliger bf6af7c667 [coop] Handle accessor macros
- MONO_HANDLE_IS_NULL
- MONO_HANDLE_GET
- MONO_HANDLE_ARRAY_GETVAL
- mono_array_handle_length ()
2016-11-16 16:51:21 -05:00
Jo Shields fe6e1fdb81 [btls] Download & extract BTLS certs, on Linux builds.
Actually use the correct pathname.  Martin.
2016-11-16 22:01:43 +01:00
Martin Baulig 4adc1028a5 Merge pull request #3956 from directhex/install-btls-certs-in-jenkins
[btls] Download & extract BTLS certs, on Linux builds.
2016-11-16 21:53:20 +01:00
Martin Baulig 75ba28a0bb Merge pull request #3967 from atsushieno/fix-linux-btls
Fix btls build for Linux.
2016-11-16 21:51:27 +01:00
Martin Baulig f6a57ee08a Merge pull request #3950 from mono/work-btls-sni-2
[BTLS]: Add MonoBtlsSsl.GetServerName() and set MonoTlsConnectionInfo.PeerDomainName
(cherry picked from commit e6aa904d9d)
2016-11-16 21:50:36 +01:00
Marius Ungureanu 0e5af42daf [Perf] Replace some exhaustive O(n^3) or O(n^2) iterations with O(n)
Usage of g_slist_count and g_slist_nth are actually O(n) operations by themselves. Nesting them can prove to be CPU intensive.
2016-11-16 20:35:56 +02:00
Rodrigo Kumpera 94b8270e9b Merge pull request #3678 from mono/seq-read
[IO] Implement FileOptions.SequentialScan for Mac/BSD
2016-11-16 10:15:41 -08:00
Ludovic Henry 693bffded3 [mcs/build] Use make functions instead of calling a shell 2016-11-16 11:35:37 -05:00
Ludovic Henry 7ac84e8431 [mcs/build] Factor Q_AOT for future use 2016-11-16 11:35:37 -05:00
Alexander Köplinger d3a72be7e8 [acceptance-tests] Add dependency on nunitlite.dll
nunitlite.dll is not built anymore with a normal Mono build
so we need to depend on it explicitly.
2016-11-16 15:43:38 +01:00
Marek Safar f4ecb2dd06 [acceptance-tests] Specify nunitlite path 2016-11-16 15:22:44 +01:00
Bernhard Urban b26ed1d5d1 Merge pull request #3971 from directhex/longer-longer-longer-longer-longer-lasting-tailcalls
Increase tailcall instruction length on ppc64
2016-11-16 12:38:04 +01:00
Niklas Therning ed892ccf27 Prevent Mono.Posix from using multiple C runtimes on Windows
Since libMonoPosixHelper.dll is linked against ucrtbase.dll the C runtime
wrapper functions in it will call into ucrtbase.dll. Some pinvokes in
Mono.Unix.Native.Stdlib, however, bind directly to C runtime functions in
msvcrt. This is problematic if a resource (heap memory, file pointer, etc) is
allocated using one C runtime and then operated upon using funcitons form the
other C runtime. E.g., Stdlib.malloc() calls into a wrapper in
libMonoPosixHelper so it will use the ucrtbase heap while Stdlib.free() calls
directly into msvcrt's free() which will abort the process since it's called
with a pointer in an unknown heap.

This commit adds libMonoPosixHelper wrappers for all memory and file related
functions in Stdlib to ensure that all such functions use the same C runtime.

Some of the Mono.Posix tests still fail but at least the test suite doesn't
crash after this change. The test failures will be addressed in a future PR.
2016-11-16 09:14:25 +01:00
Jo Shields b5c345c907 Increase tailcall instruction length on ppc64
wrong maximal instruction length of instruction tailcall (expected 120, got 124)
* Assertion: should not be reached at mini-ppc.c:4694
2016-11-16 01:23:33 +00:00
Zoltan Varga 3f6c5c1c93 [runtime] Disable some failing tests until they are fixed. 2016-11-15 16:21:14 -05:00
Zoltan Varga 4a1161e2d6 [runtime] Change the thread wait code to use cond variables instead o… (#3946)
* [runtime] Change the thread wait code to use cond variables instead of events.

Instead of waiting for the thread handles to be signalled, wait for a cond variable signalled which is signalled by the code which calls pthread_join ().

* [runtime] Synchronize access to njoined_threads. Only use the background_change_event on windows.

* Fix a warning.
2016-11-15 15:56:45 -05:00
Alexis Christoforides 7d2a2141e0 Bump bockbuild for helpful CI cleaning fix 2016-11-15 14:03:01 -05:00
Zoltan Varga af553b57ed [jit] Optimize out the early pinvoke address loading done by emit_native_wrapper () when coop+direct pinvokes is enabled, since its not needed, and it generates MONO_PATCH_INFO_ICALL_ADDR relocations which cause pinvoke lookups at runtime on platforms where its not supported like watchos. Fixes #45369. (#3960) 2016-11-15 12:51:54 -05:00
Vlad Brezae ab5d9db4d1 [runtime] Fix monitor exception throwing
mono_monitor_ensure_owned used to throw exception directly and not return. After switching the runtime to use pending exceptions, monitor code would continue running assuming we owned to monitor.

Fixes 46994
2016-11-15 18:05:46 +02:00
Atsushi Eno fe7a97f45b Fix btls build for Linux.
As @baulig suggested us elsewhere.
2016-11-16 01:01:01 +09:00
Marek Safar 4f4c3422cc Remove global ipv6 disabled setting. Fixes #35536 2016-11-15 11:48:34 +01:00
Niklas Therning f3002a1f72 Merge pull request #3963 from ntherning/fix-missing-property-bag-c-file-in-vs-project
Fix missing property-bag.c file in VS project
2016-11-15 11:39:58 +01:00
Niklas Therning 7258af2a53 Merge pull request #3964 from ntherning/fix-vs-linking-error-missing-mono_dl_open
Fix VS error due to missing mono_dl_open()/mono_loader_register_module()
2016-11-15 11:39:22 +01:00
Niklas Therning 95873a47f9 Fix VS error due to missing mono_dl_open()/mono_loader_register_module()
PR #3955 removes mono_dl_open() and mono_loader_register_module() from
msvc/mono.def and msvc/monosgen.def which causes VS linking error. This change
readds the symbols to the def files as a temporary solution to get the VS
builds to build successfully again.
2016-11-15 11:33:02 +01:00
Niklas Therning 256750a9bf Fix missing property-bag.c file in VS project
PR #3936 adds the mono/metadata/property-bag.c file but doesn't add it to
msvc/libmonoruntime.vcxproj, resulting in linking errors when building the VS
solution.
2016-11-15 11:25:56 +01:00
Bernhard Urban 957d4804ab Merge pull request #3961 from akoeplinger/ppc-parallelism
[ci] Reduce make parallelism on ppc64
2016-11-15 08:31:10 +01:00
Mikko Korkalo 7eaf7889a8 fix a massive memory leak in MonoBtlsContext 2016-11-15 08:56:39 +02:00
Alexander Köplinger a493640751 Merge pull request #3952 from akoeplinger/add-tests
[ci] Add missing tests from Wrench
2016-11-15 03:19:21 +01:00
Alexander Köplinger f53186653c [ci] Reduce make parallelism on ppc64
-j4 seems to fail the build.
2016-11-15 03:17:25 +01:00
Rodrigo Kumpera 9d5ff689fc Merge pull request #3936 from kumpera/monoclass_reorg2
More MonoClass reorg, replace 3 fields with a property bag
2016-11-14 17:18:26 -08:00
Alexander Köplinger e7d00de0de [ci] Add missing tests from Wrench
While looking at the Wrench config I noticed there are a few
tests we don't run on Jenkins. This change adds those tests.
2016-11-15 01:53:13 +01:00
Alexander Köplinger 6ef504859c Merge pull request #3958 from akoeplinger/disable-tests
[runtime] Disable certain tests on PRs
2016-11-15 01:50:08 +01:00
Alexander Köplinger 5a5a1ba757 [runtime] Disable certain tests on PRs
This allows us to get back to green builds for PRs
while still keeping track of failing tests in master.
2016-11-15 01:47:04 +01:00
Rodrigo Kumpera ca50502af8 [runtime] Cache marshal info in locals whenever possible. 2016-11-14 14:25:36 -08:00
Rodrigo Kumpera 1abcf8518d Merge pull request #3945 from kumpera/fix-cross-domain-abort
[corlib] Fix cross-domain exception serialization under thread abortion.
2016-11-14 13:59:05 -08:00
Rodrigo Kumpera 80e7d453dc [bcl] Add comment on why the empty try block. 2016-11-14 13:58:40 -08:00
Alexander Köplinger f8763d5245 Merge pull request #3951 from akoeplinger/add-csproj-warning
[msvc] Add warning about autogenerated csproj to genproj
2016-11-14 20:26:47 +01:00
Jo Shields 12bca28936 [btls] Download & extract BTLS certs, on Linux builds. 2016-11-14 19:25:57 +00:00
Rodrigo Kumpera 9f791271c4 Merge pull request #3955 from kumpera/fix-embedding-api
[runtime] Don't add mono-dl.h to loader.h. Move the internal function to an internal header.
2016-11-14 14:03:25 -05:00
Rodrigo Kumpera 2df8d8091e [runtime] Don't add mono-dl.h to loader.h. Move the internal function to an internal header. 2016-11-14 08:04:24 -08:00
Rolf Bjarne Kvinge 30acb7cab9 [offsets-tool] Make sure to re-clone when the hash for the cpp binaries changes. 2016-11-14 16:59:34 +01:00
Ludovic Henry 9852c512ee [w32handle] Make mono_w32handle_ops_* functions private 2016-11-14 10:23:32 -05:00
Ludovic Henry 7af3479338 [w32handle] Compile them in on windows 2016-11-14 10:23:32 -05:00
Ludovic Henry d49734aa5a [w32handle] Remove unused header includes 2016-11-14 10:23:32 -05:00
Ludovic Henry 42f937c33d [os-event] Replace global cond by local cond for each waiting thread (#3941) 2016-11-14 10:08:09 -05:00
Alexander Köplinger 25e52ae81c [msvc] Update .csproj files 2016-11-14 15:34:27 +01:00
Alexander Köplinger b7382f5d6c [msvc] Add warning about autogenerated csproj to genproj
Hopefully reduces the confusion about the csproj files.
2016-11-14 15:33:56 +01:00
Martin Baulig dd99ba6366 [BTLS]: Use host name without port for the Server Name Indication (SNI). Bug #46549.
(cherry picked from commit 20e0914e03)
2016-11-14 15:08:26 +01:00
Henric Müller b8878d4ef0 Enabling pinvoke-utf8.exe test on Windows 2016-11-14 15:00:15 +01:00
Henric Müller 1b327ab61b Fix crash on Windows in PInvoke UTF8 tests
* Making sure `marshal_alloc`and `marshal_free` is used in libtest.c so
memory is allocated/freed with `CoTaskMemAlloc`/`CoTaskMemFree`.
* Now returning correct type for `MONO_NATIVE_UTF8STR` in `mono_type_to_unmanaged`.
2016-11-14 14:32:39 +01:00
Alexander Köplinger fe0b8311e7 Merge pull request #3940 from akoeplinger/deprecate-nunit
[bcl] Deprecate old NUnit 2.4 framework shipped with Mono
2016-11-14 13:43:34 +01:00
Alexander Köplinger f58eb9e642 Merge pull request #3937 from akoeplinger/mph
[msvc] Add Mono_Unix_VersionString to monoposixhelper.def
2016-11-14 00:00:05 +01:00
Marek Habersack d3522160eb Revert "Install utils/{mono-dl.h,mono-compiler.h}"
This reverts commit 397430c7f9.
2016-11-13 22:40:08 +01:00
Alexander Köplinger 7157eaa0fc [msvc] Add Mono_Unix_VersionString to monoposixhelper.def
Fixes the EntryPointNotFoundException when running the Mono.Posix tests on Windows.
This check was introduced in 249ee0686b but the .def file wasn't updated.

With this the tests still crash so switching them off on PRs again for now.
2016-11-13 18:41:22 +01:00
Alexander Köplinger 2d0cf43f3a [bcl] Deprecate old NUnit 2.4 framework shipped with Mono
Print a message when running nunit-console about the deprecation.
Additionally, throw a compilation error if compiling against the
TestFixtureAttribute from old NUnit.

Needed changes in ms-test-suite as well since it was still using NUnit.
2016-11-13 14:00:55 +01:00
Marek Habersack 397430c7f9 Install utils/{mono-dl.h,mono-compiler.h}
These two headers are required by loader.h which is installed in
$prefix/include/mono-2.0/mono/metadata and their lack breaks compilation
of any software that includes loader.h
2016-11-13 00:48:44 +01:00
Niklas Therning e5bf6d7612 Merge pull request #3938 from ntherning/UnicastIPAddressInformation.IPv4Mask-from-refsource
Change UnicastIPAddressInformation.IPv4Mask to work as in refsource on Windows
2016-11-12 08:41:55 +01:00
Rodrigo Kumpera 5a20ab0576 [corlib] Fix cross-domain exception serialization under thread abortion.
RemotingServices::SerializeExceptionData started to fail as TAE was being raised
from within the serialization code and this triggered the completely wrong abort protection code.

This happened because a recent change that made .cctors raise TAE at their end and the stack trace
code would hit System.Reflection.Module's cctor to fetch its GUID for the purpose of symbolification.

The fix is to use the correct protection against aborts, which is to run code from finally blocks.

This fixes multiple failures in the runtime test suite.
2016-11-11 14:48:31 -08:00
Zoltan Varga 6aa99cd1de [runtime] Add back the locking to setup_interface_offsets () to work around crashes in roslyn. 2016-11-11 15:41:36 -05:00
Ludovic Henry d1568db972 [os-event] Replace global cond by local cond for each waiting thread 2016-11-11 13:57:27 -05:00
Alexander Köplinger 86552ed978 Merge pull request #3942 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-11 19:55:36 +01:00
Alexander Köplinger 58504d90fb Fix git submodule url 2016-11-11 19:55:11 +01:00
monojenkins e0026352ea [msvc] Update csproj files 2016-11-11 18:46:04 +00:00
Marek Safar 6145a2d083 Remove extracted linker sources and reuse them via submodule 2016-11-11 18:53:31 +01:00
Ludovic Henry c0a5c44713 [w32handle] Stop returning 0 in every cases for locking/unlocking (#3926)
* [w32handle] Stop returning 0 in every cases for locking/unlocking

* [w32handle] Ensure we lock the signal handle in SignalAndWait
2016-11-11 10:13:38 -05:00
Marek Safar 8d8d7dc061 [mcs] Update better conversion tie breaking rules to cover candidate with longer default parameters. Fixes #45950 2016-11-11 15:55:13 +01:00
Niklas Therning 1e4715d757 Change UnicastIPAddressInformation.IPv4Mask to work as in refsource on Windows
Mono returns null for disconnected interfaces with 169.254.X.X address while
refsources returns 255.255.0.0. This patch copies the relevant pieces from the
refsources to make Mono behave the same.
2016-11-11 15:14:49 +01:00
Joao Matos a1ac272ffe [offsets-tool] Fixed the Makefile to clone into the base directory instead. 2016-11-11 12:59:14 +00:00
Johan Lorensson ced1dce6fb Merge pull request #3809 from lateralusX/jlorenss/win-api-family-support-cleanup
Build mono runtime under none desktop Windows API family, adjustments and cleanup.
2016-11-11 11:43:49 +01:00
Niklas Therning b21be86802 Merge pull request #3930 from ntherning/fix-System.ServiceProcess
Fixes bugs in System.ServiceProcess on Windows
2016-11-11 09:59:05 +01:00
Niklas Therning 49e6222d72 Fixes bugs in System.ServiceProcess on Windows
There was a crash on Windows x64 in Win32ServiceController when enumerating
devices and services. Also fixed the ServiceControllerTest to succeed on .NET
as well Mono on Windows. Had to replace the services used by the test since
most of them have been removed from recent Windows versions.

This PR also enables the System.ServiceProcess tests in Windows PR builds.
2016-11-11 09:37:02 +01:00
Miguel de Icaza 60971c6963 [eglib/mono] Aleksey caught a discrepancy between the semantics of Unix and Windows, our eglib version should always strdup (#3899) 2016-11-10 23:14:03 -05:00
Ankit Jain 387316fed6 [xbuild] Don't reevaluate project when setting metadata in a dynamic ..
.. item.

If we have a project, that sets some properties or items at runtime,
like in a target:

```
        <Target Name="Build">
                <PropertyGroup>
                        <Bar>Bar01</Bar>
                </PropertyGroup>
```

.. such a property can be accessed as `$(Bar)` subsequently.

Then at later point, a target tries to update metadata on an item group
with existing items, like:

```
	<ItemGroup>
		<FooItem Include="xyz" />
	</ItemGroup>

	<Target Name="Foo">
                <ItemGroup>
                        <FooItem>
                                <SomeMetadata>MetadataValue</SomeMetadata>
                        </FooItem>
                </ItemGroup>
```

.. then it is seen that the value for the earlier created `$(Bar)` disappears!
So, if we try to print the value of `$(Bar)` right after that item
group, it would appear as `''`!

The issue is that the metadata update in target `Foo` caused the project
to get re-evaluated, which meant that items/properites created after the
project load were lost! We should not be reevaluating the project when
setting metadata on the basis of dynamic items, like in the target
`Foo`.

These dynamic item groups in a target are represented as
`BuildItemTask`, and these create BuildItems which have their
`IsDynamic` property set. And this is used to avoid re-evaluating the
project in `BuildItem.SetMetadata`.

But when updating metadata (`BuildItem.UpdateMetadata`), we need to
update metadata on the *existing* items, which might not have been
created from such dynamic item groups! So, their `IsDynamic==false`.
Hence, trying to `SetMetadata` on such items would cause the project to
be reevaluated, and thus properties/items like `$(Bar)` would be lost!

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

In this particular case, `Bar` was the `DesignTimeBuild` property, which
was losing it's value when `ProjectReference`'s `AdditionalProperties`
metadata was set in:

```
 <Target Name="BclBuildAddProjectReferenceProperties"
    <ItemGroup>
      <ProjectReference>
         <AdditionalProperties>$(_BclBuildProjectReferenceProperties);%(ProjectReference.AdditionalProperties)</AdditionalProperties>
     </ProjectReference>
    </ItemGroup>
```
2016-11-10 18:20:36 -05:00
Rodrigo Kumpera bc59551adb [runtime] Move MonoClass::ref_info_handle into a property bag. 2016-11-10 14:58:33 -08:00
Rodrigo Kumpera 21d6f20fa9 [runtime] Move MonoClass::marshal_info and MonoClass::ext to use a property bag. 2016-11-10 14:58:05 -08:00
Rodrigo Kumpera 9eb033def8 [runtime] Wrap MonoClass::ext with accessors. 2016-11-10 14:58:04 -08:00
Rodrigo Kumpera 13380df8c7 [runtime] Wrap MonoClass::marshal_info with accessors. 2016-11-10 14:56:34 -08:00
Rodrigo Kumpera 579ff881cf [runtime] Add a simple linearizable property bag implementation. 2016-11-10 14:55:42 -08:00
Bernhard Urban e29e5fd104 [arm64] always assume a cache line size of 4
otherwise we still have the theoretical chance of a race.
2016-11-10 23:34:08 +01:00
Niklas Therning fa83c0c71a Merge pull request #3931 from ntherning/enable-System.Core-tests-on-windows-pr-builds
Enable System.Core tests on Windows PR builds
2016-11-10 21:28:23 +01:00
João Matos d9fdda567d Merge pull request #3927 from tritao/updated_offsets_tool
Updated offsets tool to latest CppSharp.
2016-11-10 18:55:51 +00:00
Marek Safar 00a8ed722d [System.Xml] Add XElement array handling to serialization interpreter. Fixes #12571 2016-11-10 18:43:14 +01:00
Marek Safar ba51c60b57 [system.xml] Enable more tests 2016-11-10 18:43:14 +01:00
Joao Matos 292f5ee377 [offsets-tool] Updated build scripts to handle multiple platforms. 2016-11-10 17:27:00 +00:00
Joao Matos d09eb49b80 [offsets-tool] Fixed whitespace inconsistency. 2016-11-10 17:27:00 +00:00
Joao Matos 7c2c4847fb Updated offsets tool to latest CppSharp. 2016-11-10 17:26:59 +00:00
Niklas Therning 8493ec8617 Enable System.Core tests on Windows PR builds
System.Core is expected to be green now on Windows.
2016-11-10 16:15:21 +01:00
Bernhard Urban e8c3544447 [ppc] clobber r0 in MONO_CONTEXT_GET_CURRENT
r0 can't be the base for a memory acces.
2016-11-10 13:00:36 +01:00
Bernhard Urban 584138b309 [ppc] some 32bit CPUs trap on std, use stw instead 2016-11-10 13:00:36 +01:00
Bernhard Urban eca9ee8003 [ppc] enable MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX on every PowerPC configuration on Linux 2016-11-10 13:00:36 +01:00
Bernhard Urban c330b2cb1d [ppc] use proper calling convention when coming from a signal handler
ELF v2 ABI (aka. ppc64le) defines two entry points per function.
The global entry point (offset 0) sets up the TOC (r2) itself, while the
local entry point (offset 8) is a fast entry point if the TOC is
already set up properly.

When the global entry point is used, the address of the global entry
point is required in r12 according to the ABI.
2016-11-10 13:00:36 +01:00
Bernhard Urban 5d96019cc2 [ppc] disable MONO_ARCH_HAVE_TLS_GET
`--with-tls=__thread` is broken on PowerPC.
`--with-tls=pthread` didn't work on PowerPC, but disabling
MONO_ARCH_HAVE_TLS_GET fixes it.

Instead of guarding the define with `HAVE_KW_THREAD`, let's just
disable it.  We want to get rid of `--with-tls=__thread` anyway.
2016-11-10 13:00:36 +01:00
Johan Lorensson 1c505b45de Merge pull request #3854 from lateralusX/jlorenss/win-clang-toolchain
Switch to Microsoft VS2015 MSVC toolchain for Windows x64 AOT compiler.
2016-11-10 09:37:55 +01:00
Zoltan Varga e7e0b463c7 Method field count (#3907)
* [runtime] Add accessors for method.count and field.count.

* [runtime] Move method/field count to MonoClassDef.
2016-11-09 22:54:29 -05:00
Zoltan Varga 080b4a9b3d [sdb] Avoid asserting when trying to single step on a thread with no managed frames. Fixes #34802. 2016-11-09 21:53:48 -05:00
Zoltan Varga ced8026cb8 [runtime] Fix another race in mono_class_setup_supertypes (). 2016-11-09 18:13:38 -05:00
Ludovic Henry 38a348c991 [threads] Always use the suspended MonoOSEvent for self-suspend (#3915)
* [stw] Refactor to treat error/success cases first

* [threads] Always use the `suspended` MonoOSEvent for self-suspend

The previous self-suspend mechanism was inherently racy:
 - T1 self suspend:
  - T1 calls mono_thread_info_begin_self_suspend, but doesn't call mono_thread_info_end_self_suspend yet
 - T2 suspends T1 <-- the suspend_count is > 0, trigerring the assertion at mono-threads.c:184
2016-11-09 15:59:36 -05:00
Ludovic Henry 723e5a1b07 [threads] Destroy suspend MonoOSEvent when detaching (#3923)
* [threads] Destroy suspend MonoOSEvent when detaching

It could happen that we destroy the managed InternalThread object, before we actually detach the thread (in mono/tests/threadpool-exceptions1.exe for example).

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

* [threads] Close thread handle once done with it
2016-11-09 15:59:24 -05:00
Zoltan Varga 6860a2180a [runtime] Simplify the wait_for_tids () code. (#3920) 2016-11-09 14:51:11 -05:00
Ludovic Henry 3f1bb30d94 [os-event] Make them manual only (#3921)
We only use them as manual reset event in the runtime, and that greatly simplifies the code as well as the way they should be used.
2016-11-09 14:44:29 -05:00
Zoltan Varga f988418693 [sdb] Avoid asserting when trying to single step on a thread with no managed frames. Fixes #34802. 2016-11-09 14:42:21 -05:00
Ludovic Henry a3e6245821 [io-layer] Remove dead code 2016-11-09 14:27:32 -05:00
Alexander Köplinger 10f86fb5fe [System] Fix a few type members on WatchOS
The .platformnotsupported.cs versions of some classes were
inconsistent with their "real" counterparts.
2016-11-09 20:20:27 +01:00
Ludovic Henry d2ad946be6 [process] Allocate a handle even for non-child processes (#3905)
* [w32handle] Inline only use of mono_w32handle_search

* [w32handle] Make special_wait return MonoW32HandleWaitRet

This is to avoid a unnecessary translation from WAIT_* to MonoW32HandleWaitRet

* [process] Use some more referencesource

* [process] Rename mono_processes to processes

* [process] Allocate a handle even for non-child processes

* [process] Create the handle only once the process has started
2016-11-09 08:00:11 -05:00
Ludovic Henry f96f13505a [os-event] Make unix version alertable (#3909)
This fixes `appdomain_unload.exe` test timeout. The following would happen:
 - T1 unload the current domain
  - T1 launch T2 to unload domain
  - T1 waits on T2 to finish
 - T2 tries to abort T1 <-- because the wait on T2 is not alertable, T1 is not going to be aborted
2016-11-09 07:50:12 -05:00
Zoltan Varga a284179696 [runtime] Add locking to mono_class_setup_supertypes () since the 16 bit idepth field cannot be set atomically. Fix a race if mono_field_resolve_type () was called without locking. (#3919) 2016-11-09 02:00:09 -05:00
Zoltan Varga 796d3ea7e8 [x86] Fix max code size of throw trampoline. 2016-11-08 18:55:57 -05:00
Alexander Köplinger d7651411e8 Bump nunitlite for display fixes 2016-11-08 21:25:08 +01:00
Alexis Christoforides e09ef88135 Bump bockbuild 2016-11-08 15:19:41 -05:00
Alexander Köplinger 6d75b73e58 [io-layer] Include sys/types.h header file in wapi.h
Fixes "error: unknown type name 'pid_t'" on Alpine/musl libc.
2016-11-08 20:05:06 +01:00
Alexander Köplinger 941bf17f1b [btls] Include stdint.h header file in btls-time64.c
Fixes "error: unknown type name 'int64_t'" on Alpine/musl libc.
2016-11-08 20:05:06 +01:00
Niklas Therning dab281b88d Merge pull request #3914 from ntherning/mono_context_get_current-on-windows-does-not-save-rsp-properly
mono_context_get_current() on Windows stores registers at incorrect indexes
2016-11-08 18:52:55 +01:00
Alexis Christoforides be95f699da Merge pull request #3773 from mono/bockbuild-integration
Integration of Bockbuild's Mac SDK profile
2016-11-08 11:10:26 -05:00
Alexis Christoforides 8d548bb0f0 Bump bockbuild 2016-11-08 11:10:05 -05:00
Alexis Christoforides 5670128912 Move some more files back to bockbuild repo 2016-11-08 11:09:38 -05:00
Niklas Therning b69a8ab666 mono_context_get_current() on Windows stores registers at incorrect indexes
The indexes must correspond to the values in the AMD64_Reg_No enum in
amd64-codegen.h.
2016-11-08 15:21:36 +01:00
Alexander Köplinger 8784e2e1cb Merge pull request #3913 from omwok/master
column name and ordinal fix.
2016-11-08 13:57:16 +01:00
lateralusX 8ec9b12e53 Switch to Microsoft VS2015 MSVC toolchain for Windows x64 AOT compiler.
In order to reduce dependencies on external toolchains when doing full AOT on Windows
targeting x64 Windows platforms we would like to use what's available in
VS 2015 MSVC toolchain. Mono's full AOT compiler need an assembler and a linker from
available toolchain in order to do different full AOT scenarios, emitting assembler, compile
objects or link complete shared library.

Since the current emitter emits GNU assembler it is beneficial to reuse that assembler
syntax without the need to adopt to a different syntax. In VS2015 Update 1 a new toolchain
option has been released utilizing the Clang parser combined with MSVC code gen. This will
produce object files fully compatible with MSVC linker. It turns out that VS2015 Clang version
also supports GNU assembler and since Mono just uses simple constructs in the assembler
(all code is already compiled and emitted as byte streams in assembler) it is possible to use Clang
for VS to compile our emitted assembler files.

This PR switches to Clang for Microsoft VS2015 and MSVC linker when doing full AOT targeting Windows x64
platforms hosted on a Windows platform. It requires an installation of at least Microsoft VS2015 Update 1
with Clang component selected. NOTE all other scenarios is currently left as is.

This PR also makes adjustments to AOT compiler in order for above scenario to work, supporting asm only output, static output
and regular shared libraries using MSVC linker.
2016-11-08 13:09:00 +01:00
Alexander Köplinger 857b39a58d Merge pull request #3911 from akoeplinger/marshal-cleanuprcw
[corlib] Add Marshal.CleanupUnusedObjectsInCurrentContext() stub
2016-11-08 12:46:44 +01:00
lateralusX b1fe69673c Additional none desktop API families triggered by changes.
* Changes to process.c triggered errors on none desktop API builds.
* Implementation of memory mapped files caused build errors on none desktop API builds.
* Adjustments to disable JIT caused build errors on none JIT builds.
2016-11-08 09:09:03 +01:00
lateralusX 23a69556de Build mono runtime under none desktop Windows API family, adjustments and cleanup.
Continuation work on previous none desktop Windows API family PR's adjusting all
changes to similar patterns used over previous PR's. This PR also move the logic
to silence a MS VS linker warning on empty source files into a macro. It also includes
the use of the macro in a couple of more source files causing linker warnings when build
on none desktop API families excluding JIT support.

Since other Windows API family work is still in progress it also disables build capabilities
for none desktop API families.
2016-11-08 09:04:49 +01:00
Marek Safar b75ef2bf85 Merge pull request #3912 from akoeplinger/marshal-ptrtostrbstr
[corlib] Expose Marshal.PtrToStringBSTR on mobile
2016-11-08 08:55:14 +01:00
Marek Safar 971b7a4e48 Merge pull request #3902 from henricm/fix-rename-lpstr-utf8
Rename fix for lpstr to utf8str on Windows
2016-11-08 08:50:50 +01:00
Alexander Köplinger df1475d95e [corlib] Expose Marshal.PtrToStringBSTR on mobile
The SecureStringHelper from referencesource I added in https://github.com/mono/mono/pull/3887
relies on this to convert from SecureString to plaintext.

It failed on mobile because we always throw a NotImplementedException there,
but we actually have an implementation on the runtime side (even in the DISABLE_COM case).
2016-11-08 01:31:30 +01:00
Alexander Köplinger 05b68a1d35 [corlib] Add Marshal.CleanupUnusedObjectsInCurrentContext() stub
https://github.com/dotnet/standard/issues/94
2016-11-08 00:04:47 +01:00
Zoltan Varga c8ae9af395 [runtime] Fix the ios build. 2016-11-07 17:38:15 -05:00
Zoltan Varga c65847a4ee [jit] Really fix the DISABLE_JIT build. 2016-11-07 15:48:05 -05:00
Aleksey Kliger (λgeek) 64871b1ac0 Merge pull request #3896 from lambdageek/bug-46250
[runtime] Ensure generic type definition arity matches generic context arity
2016-11-07 15:18:08 -05:00
Ludovic Henry d68a5479a7 [threadpool] Fix hang on domain unloading (#3904)
Because we wouldn't return the correct ThreadPoolDomain for the requested domain, we would simply wait on the last inserted MonoDomain. This would lead to a hang when unloading the domain, as we wouldn't wait on the correct domain.
2016-11-07 15:11:22 -05:00
Alexander Köplinger 8e8dcd24e4 Fix tarball build 2016-11-07 20:36:24 +01:00
Martin Baulig 4aa4345ba9 [BTLS]: Use int64_t instead of long in the native API. (#3857)
* [BTLS]: Use `int64_t` instead of `long` in the native API.

* Copy time64.c from Android's source code to get a 64-bit timegm64().

* Rename into btls_timegm64() and remove everything we don't need.

(cherry picked from commit 2365067bda)
2016-11-07 18:25:17 +01:00
Alexander Köplinger 213bce206b Merge pull request #3894 from akoeplinger/fix-actor
[System.ServiceModel] Recognize 'faultactor' in SOAP fault message
2016-11-07 18:24:14 +01:00
Zoltan Varga 54e882c080 [jit] Fix the DISABLE_JIT build. 2016-11-07 11:37:59 -05:00
Rodrigo Kumpera 4c960e1dd5 Merge pull request #2408 from tastywheattasteslikechicken/MoreInterfaceSupport
Enhance maximum number of supported interfaces from 2^16.
2016-11-07 08:04:29 -08:00
Niklas Therning 9f9d6ca94a Merge pull request #3903 from ntherning/fix-NRE-in-Win32-IpcChannel.StopListening-when-no-server-started
Fix NRE in Win32 IpcChannel.StopListening() when no server started
2016-11-07 15:04:54 +01:00
Niklas Therning 0176864293 Merge pull request #3901 from ntherning/Process_GetModules_internal-crash-on-windows
Fix crash in Process.GetModules_internal() on Windows after refactorings
2016-11-07 15:01:39 +01:00
Niklas Therning da894a3527 Fix NRE in Win32 IpcChannel.StopListening() when no server started
This makes the System.Runtime.Remoting test suite fail in various places on
Windows due to the TestFixtureTearDown method in BaseCalls throwing an NRE.
2016-11-07 15:00:05 +01:00
Henric Müller a030ec8904 Rename fix for lpstr to utf8str on Windows
PR https://github.com/mono/mono/pull/3776 renamed `mono_string_to_lpstr`
to `mono_string_to_utf8str` without updating the Windows version.
This fix renames `mono_string_to_lpstr` to `mono_string_to_utf8str` to
make sure the string is allocated using `CoTaskMemAlloc` on Windows
since it will be freed using `CoTaskMemFree`.
2016-11-07 14:46:21 +01:00
Niklas Therning 93040e9d7d Fix crash in Process.GetModules_internal() on Windows after refactorings
EnumProcessModules() is called incorrectly. Also fixes a missing curly braces
pair.
2016-11-07 12:01:43 +01:00
Alexander Köplinger b6588622bc Merge pull request #3900 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-07 02:29:55 +01:00
Zoltan Varga ffc3aaa95c [runtime] Move field.first and method.first to MonoClassDef. Add accessor functions for them. (#3898) 2016-11-06 12:34:45 -05:00
monojenkins 3ac86282de [msvc] Update csproj files 2016-11-06 04:20:14 +00:00
Zoltan Varga 9a4eec2f1f [arm64] Set a flag in MonoContext if the fp regs are saved, and only restore them if they are. These registers are not saved when the context is created from a ucontext. (#3890) 2016-11-04 22:19:25 -04:00
Aleksey Kliger (λgeek) bf95567e69 [mkbundle] Don't free bundled dylibrary directory (#3897)
mkdtemp modifies the template in-place, don't free it.
2016-11-04 21:02:23 -04:00
Rodrigo Kumpera 7bd7446abc Merge pull request #3796 from ntherning/windows-backend-for-MemoryMappedFile
MemoryMappedFile support on Windows
2016-11-04 14:59:47 -07:00
Marek Safar 711f82801d [mcs] Consider method candidates with misplaced named arguments not applicable. Fixes #46190 2016-11-04 18:35:36 +01:00
Marek Safar b43d5089e9 [mcs] Remove debug check 2016-11-04 18:35:36 +01:00
Alexis Christoforides 0c9a8acdf8 Properly configure the bockbuild submodule 2016-11-04 13:34:04 -04:00
Zoltan Varga 9e167696e7 [runtime] Add a few mono mono_class_is_... accessors. (#3891) 2016-11-04 12:34:13 -04:00
Alexis Christoforides 7066e490b9 Fix setting the min. macOS version in the Xamarin profile 2016-11-04 11:31:25 -04:00
Alexis Christoforides 147e97cb6d Rename 'bockbuild' to 'packaging' so that it can be home to other packaging code 2016-11-04 11:31:25 -04:00
Alexis Christoforides befd4fa677 Move the maintained common-use packages back to the bockbuild repo 2016-11-04 11:31:25 -04:00
Alexander Köplinger 69b3397c8e [System.ServiceModel] Recognize 'faultactor' in SOAP fault message
It's an optional element according to [1] and we were simply
throwing a NotImplementedException when encountering it.

Fixed by reading the element value instead. I noticed that we
had a 'details' variable that was never assigned, so the check
for `details == null` was always true and can be removed.
This makes inlining the body of the CreateFault() call easier
since we no longer need to choose different overloads and makes
the code consistent with the CreateFault12 method.
Also added a better exception in case of an unrecognized element.

The CreateFault12 method (handles SOAP 1.2) does not need a similar
fix since actor is not an element in that version [2].

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

[1] https://www.w3.org/TR/soap11/#_Toc478383507
[2] https://www.w3.org/TR/soap12/#soapfault
2016-11-04 16:18:46 +01:00
Aleksey Kliger f59468ec1b [runtime] Ensure generic type definition arity matches generic context arity
Don't instantiate generic type definitions (like Dictionary`2) with too few or too many
type arguments.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46250
2016-11-04 11:16:01 -04:00
Aleksey Kliger 13492e1111 [tests] Test System.Type.GetType() on generics with wrong arity. 2016-11-04 11:16:01 -04:00
Marek Safar 933d252afc [mcs] More work on debug scopes declared out of order. Fixes #45774 2016-11-04 16:05:07 +01:00
Ludovic Henry 627eaebf94 [os-event] Fix set operation
This is a logic bug where we would only wake up one of the threads that are waiting for the manual MonoOSEvent to be set. This would be a problem only if more than one thread is waiting.
2016-11-04 10:46:19 -04:00
Ludovic Henry 52977849ff [threads] Use MonoOSEvent for Thread.Suspend/Resume (#3881)
* [threads] Refactor how we create Thread and InternalThread in native

* [threads] Add coop support for async call

* [threads] Use MonoOSEvent for Thread.Suspend/Resume

By using a MonoOSEvent we avoid relying on the utils/threads suspend mechanism to suspend a metadata/threads. This reduce coupling between both mechanism, and that would allow us to remove a bunch of code from utils/threads when switching to coop.

This only works with coop suspend, as we need the ability to return from an async call, and that's not possible with preemptive suspend.
2016-11-04 09:41:52 -04:00
Ludovic Henry 4303e10c00 [tests] Remove # to enable tests
Make would consider the files following the first # to be comments, leading to not passing it to the test-runner.
2016-11-04 09:23:40 -04:00
Alexander Köplinger f330fa65cb Merge pull request #3893 from henricm/fix-class-accessor-vsproj
Adding class-accessors.c to VS project
2016-11-04 14:04:43 +01:00
Alexander Köplinger c3b6638688 Merge pull request #3887 from akoeplinger/networkcredential-securestring
[System] Replace NetworkCredential with referencesource
2016-11-04 13:53:06 +01:00
Henric Müller 849c1c80b6 Adding class-accessors.c to VS project 2016-11-04 13:50:41 +01:00
Marek Safar 36e481bdef Merge pull request #3892 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-04 09:04:21 +01:00
monojenkins fd1db0807f [msvc] Update csproj files 2016-11-04 04:31:11 +00:00
Legowo Budianto a741882359 column name and ordinal fix...tested on 10.1 2016-11-04 09:31:56 +07:00
Zoltan Varga 68ff30d53f [jit] Cleanup the usage of DISABLE_JIT a bit so it encompasses the whole mini-codegen.c file, add DISABLE_JIT to mini-llvm.c. (#3888) 2016-11-03 21:43:15 -04:00
Zoltan Varga 4f1b55e520 [runtime] Revert parts of 016709fe52 which seems to cause races until they can be fixed. (#3889) 2016-11-03 21:30:28 -04:00
Alexander Köplinger 3d10e1c039 [System] Replace NetworkCredential with referencesource
Fixes an issue where the Mono implementation wasn't converting
between the SecureString and the plaintext version of the password.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44109
2016-11-04 00:29:41 +01:00
Alexis Christoforides 8acbd0ddff Added 'mac-sdk-package' Make target 2016-11-03 19:16:44 -04:00
Zoltan Varga 45201f2596 Fix a warning. 2016-11-03 17:50:40 -04:00
Zoltan Varga 0a8a1e5b23 [arm64] Save+restore fp regs from the context in the call filter trampoline, the JITted code doesn't use them, but if the called code throws an exception, the throw context for the inner throw needs to contain the same values as the original throw context. (#3877) 2016-11-03 17:13:35 -04:00
Alexander Köplinger fe1f6c80be Merge pull request #3871 from akoeplinger/mono.posix-windows
[Mono.Posix] Disable Unix-specific tests on Windows
2016-11-03 20:48:54 +01:00
Marek Safar 5b4da36b41 [corcompare] Update custom XI project file to embed cecil sources 2016-11-03 16:12:58 +01:00
Marek Safar ffb18d2326 [mono-api-html] Remove unused cecil reference 2016-11-03 16:12:58 +01:00
Miguel de Icaza bb101a67b4 [mkbundle] Fix the argument order to put the entry point on argv[1] (#3879) 2016-11-03 10:58:36 -04:00
Rodrigo Kumpera 0709929293 Merge pull request #3734 from kumpera/monoclass_reorg
First pass at MonoClass reorg
2016-11-03 06:24:59 -07:00
Rodrigo Kumpera a0be4a06f4 Remove spurious slash. 2016-11-03 06:24:43 -07:00
Zoltan Varga 9458e258f9 [runtime] Fix the exception message to include the proper type name and calling assembly when Type.GetType () fails. Fix some warnings. (#3876) 2016-11-02 21:27:26 -04:00
Alexander Köplinger fe8c019484 Fix tarball
This file is now autogenerated.
2016-11-02 23:43:16 +01:00
Zoltan Varga 98677ae5af Fix some warnings. 2016-11-02 17:14:14 -04:00
Rodrigo Kumpera da3474947e Merge pull request #3867 from kumpera/issues
Fix some issues found by cppcheck.
2016-11-02 14:02:29 -07:00
Zoltan Varga 72799c7657 Fix some warnings. 2016-11-02 15:13:48 -04:00
Alexander Köplinger 948864764d [utils] More Mach ARM build fixes 2016-11-02 19:41:56 +01:00
Alexander Köplinger a21348b96a [utils] Fix mono_mach_arch_thread_states_to_mcontext function declaration
81b0032420 missed updating it in mach-support-unknown.c
2016-11-02 18:53:51 +01:00
Ludovic Henry abe50c6da3 [process] Fix OSX build 2016-11-02 13:31:15 -04:00
Alexis Christoforides 1e66b38d95 Updated symlink in MacSDKRelease profile 2016-11-02 13:21:18 -04:00
Ludovic Henry 7e1fe62cd9 [io-layer] Extract Process runtime support (#3859)
* [process] Separate code for unix and win32

* [process] Extract OpenProcess

* [process] Extract GetCurrentProcess

* [process] Extract GetModuleFileNameEx

* [process] Extract GetModuleBaseName

* [process] Extract EnumProcessModules

* [process] Extract GetModuleInformation

* [process] Extract CloseProcess

* [process] Extract ShellExecuteEx

* [process] Extract CreateProcessWithLogonW

* [process] Extract GetProcessId

* [process] Extract GetExitCodeProcess

* [process] Extract GetProcessWorkingSetSize and SetProcessWorkingSetSize

* [process] Extract GetPriorityClass and SetPriorityClass

* [process] Extract TerminateProcess

* [process] Extract GetProcessTimes

* [process] Extract CreateProcess

* [process] Extract wapi_process_set_cli_launcher

* [process] Extract wapi_process_get_path

* [process] Remove unused #define in processes.h

* [process] Extract _wapi_process_duplicate

* [process] Extract MonoW32HandleOps

* [process] Move the process related icalls to w32process

* [Process] Move platform specific code to dedicated files

* [process] Cleanup function names

* [io-layer] Remove dead code

* [process] Factor common unix and win32 code

* [process] Fix windows compilation
2016-11-02 12:46:47 -04:00
Marek Safar d4ec51a881 [mcs] Remove unknown warnings reporting to match latest csc 2016-11-02 16:54:24 +01:00
Vlad Brezae 5ee7b3fef5 [sgen] Fix sgen with nursery sizes bigger than 4G 2016-11-02 17:21:30 +02:00
Aleksey Kliger (λgeek) 3bda9496ae Merge pull request #3863 from lambdageek/dev-42584-take4
[custom-attrs] Add a low level iterator for custom attributes on assemblies

And use it to check for the reference assembly attribute.

Using the low level APIs means we don't trigger load of referenced
assemblies and we don't need to take locks, so it is safe to call this
during assembly loading.

Follow up work for https://bugzilla.xamarin.com/show_bug.cgi?id=42584
2016-11-02 11:17:55 -04:00
Alexander Köplinger 56e413a81e Merge pull request #3870 from evincarofautumn/fix-xmm-scanning-mac-arm
[runtime] Fix Mach ARM build.
2016-11-02 15:55:55 +01:00
Alexander Köplinger 3e63523421 [Mono.Posix] Disable Unix-specific tests on Windows
They don't make sense there.

Added nunit group to win32.make for excluding, similar to darwin.make
2016-11-02 15:29:24 +01:00
Alexander Köplinger 355923cba6 Merge pull request #3874 from henricm/isolated-file-stream-testscleanup
Making sure opened streams are closed in IsolatedStorageFileStreamTests
2016-11-02 15:18:46 +01:00
Alexander Köplinger 5e37e386cc [bcl] Add back "dot-per-test" progress indicator to nunitlite
The verbose mode can be enabled with TEST_HARNESS_VERBOSE=1 like before.
We now also print the full test name including namespace in verbose mode again.
2016-11-02 15:14:24 +01:00
Henric Müller 166054d230 Making sure opened streams are closed in IsolatedStorageFileStreamTests 2016-11-02 15:13:23 +01:00
Marek Safar d245400442 [build] MonoTouch specific build flags injection 2016-11-02 13:34:28 +01:00
Marek Safar f240b04af6 Merge pull request #3869 from radical/mcs-ignore-arg
[mcs] Accept and ignore command line args supported by csc that we don't
2016-11-02 09:04:44 +01:00
Zoltan Varga ed8f1918b7 [arm] Fix MONO_CONTEXT_GET_CURRENT (), the inline assembly block was using pre-increment addressing instead of post increment. (#3866) 2016-11-02 03:22:57 -04:00
Zoltan Varga 164864252c [runtime] Fix the build. 2016-11-02 00:23:36 -04:00
Zoltan Varga bc66f5a21c [jit] Simplify the code generation for the mkrefany opcode, the same code can handle the aot and non-aot case. The non-aot case was emitting OP_STOREP_MEMBASE_IMM opcodes with 64 bit immediates, and some platforms like arm64 couldn't handle that. 2016-11-01 22:15:46 -04:00
Zoltan Varga 0eda1938a4 [arm] Call the tls get trampoline through a GOT slot instead of directly, since a direct call could go through the trampoline code which would fail if the thread is not attached to the runtime. Fixes #45371. (#3850) 2016-11-01 22:05:54 -04:00
Rodrigo Kumpera 5b11f8ed1b Fix rebase issues. 2016-11-01 17:48:44 -07:00
Jon Purdy 81b0032420 [runtime] Fix Mach ARM build. 2016-11-01 17:45:06 -07:00
Zoltan Varga 6cee4c38ab Revert "[bcl] Compile nunit-lite-console using -d:MONO so it doesn't print the list of ignored tests. (#3865)"
This reverts commit cff2aab0d2.

Revert this as its not needed.
2016-11-01 20:15:05 -04:00
Rodrigo Kumpera d0b87d802e [runtime] Introduce mono_class_is_interface. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera ced456394e [runtime] Introduce mono_class_is_abstract. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera b065c28572 Fix copyright notices. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera b5f7cd65fd [runtime] Add counters for how many times ext, ref_info_handle and marshal_info are set. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera 7ab70ce86d [runtime] Move MonoClass::next_class_cache to MonoClassDef. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera e0aa84b16c [runtime] Add counters for the number of class kinds that are loaded. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera 96c46ddad4 [runtime] Move MonoClass::generic_container to MonoClassGtd. 2016-11-01 17:13:49 -07:00
Rodrigo Kumpera b6fede3eee [runtime] Move MonoClass::flags to MonoClassDef.
This flag is constant on most types. Now it's on the only place that actually has it as variable.
2016-11-01 17:12:52 -07:00
Rodrigo Kumpera de3b35df91 [runtime] Move MonoClass::generic_class to MonoClassGenericInst.
To make this possible, two accessor functions were added/augmented:

mono_class_get_generic_class: Gets the generic_class and aborts if the MonoClass is of the wrong kind.
mono_class_try_get_generic_class: Gets the generic_class or return NULL if the MonoClass is of the wrong kind.

The bulk of this change is converting all checks for generic_class into calls to mono_class_is_ginst.
2016-11-01 17:11:54 -07:00
Alexis Christoforides 288472465f More refactoring fixes on final bundling commands. 2016-11-01 20:07:45 -04:00
Alexander Köplinger afdb0eef30 Merge pull request #3855 from akoeplinger/shacng-monodroid
[corlib] Map SHA*Cng algorithms to SHA*Managed on monodroid
2016-11-02 00:52:37 +01:00
Sylvan Clebsch 0760eeaff0 Remove exception when using SO_REUSEADDR on Linux (#3856)
SO_REUSEADDR and SO_REUSEPORT are fundamentally different. This
exception seems to have been put in place to address the lack of
the latter on older Linux kernels for TCP. However, the change in
fact raises an exception when SO_REUSEADDR is used, which causes
failures in server applications, which may use SO_REUSEADDR to
avoid WAIT state timeouts.

Description of SO_REUSEADDR and SO_REUSEPORT differences:

http://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t

Some problems caused by raising this exception:

https://github.com/zeromq/netmq/issues/623
https://github.com/zeromq/netmq/issues/592
https://github.com/fsprojects/IfSharp/issues/90
2016-11-01 18:41:46 -04:00
Ankit Jain bf2e774278 [mcs] Accept and ignore command line args supported by csc that we don't
.. support:

	/deterministic+
	/deterministic-
2016-11-01 18:15:05 -04:00
Aleksey Kliger 30faaa5bf2 [custom attr] Iterate over methoddef custom attrs
Make mono_assembly_metadata_foreach_custom_attr iterate over
MethodDef custom attributes in addition to MemberRef.
2016-11-01 18:02:12 -04:00
Aleksey Kliger d24c77f6bb [loader] treat corlib same as other assemblies when checking ReferenceAssemblyAttribute
Now that we're using a metadata-only ReferenceAssemblyAttribute check,
we can treat corlib the same as any other assembly - if we see
ReferenceAssemblyAttribute when loading a candidate assembly, skip it.
2016-11-01 18:02:10 -04:00
Aleksey Kliger 30d1361838 [custom-attrs] Add low-level metadata iterator for assembly custom attributes
And use it to check for the reference assembly attribute.

Using the low level APIs means we don't trigger load of referenced
assemblies and we don't need to take locks, so it is safe to call this
during assembly loading.
2016-11-01 18:01:31 -04:00
Rodrigo Kumpera 1f9b93545a [runtime] Introduce specialized structs for each MonoClass kind. 2016-11-01 14:17:59 -07:00
Rodrigo Kumpera 62b96ad507 [runtime] Introduce kind test functions to cleanup things a bit.
Instead of doing

```
if (klass->class_kind == MONO_CLASS_GTD)
	...
```

Now you do:

```
if (mono_class_is_gtd (klass))
	...
```
2016-11-01 14:17:59 -07:00
Rodrigo Kumpera 4f8d260c67 [runtime] Introduce MonoClass::class_kind and remove is_generic and is_inflated. 2016-11-01 14:17:59 -07:00
Rodrigo Kumpera 81b391fbbd Merge pull request #3764 from evincarofautumn/fix-xmm-scanning-mac
[wip] [runtime] Fix scanning of SIMD registers on Mac.
2016-11-01 12:03:00 -07:00
Rodrigo Kumpera 4471e98bfa Fix some issues found by cppcheck. 2016-11-01 12:00:41 -07:00
Ludovic Henry bfff011734 [threads] Fix Posix async resume (#3861)
If we fail to send the signal, we should not add a pending operation, as the signal handler is never going to answer this operation (via mono_threads_notify_initiator_of_resume).
2016-11-01 14:45:47 -04:00
Marek Safar 26e90ec185 Merge pull request #3864 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-01 10:20:37 +01:00
Zoltan Varga cff2aab0d2 [bcl] Compile nunit-lite-console using -d:MONO so it doesn't print the list of ignored tests. (#3865) 2016-11-01 03:47:53 -04:00
monojenkins 1f45c80ead [msvc] Update csproj files 2016-11-01 04:24:32 +00:00
Jon Purdy 273f507b11 [runtime] Fix scanning of SIMD registers on Mac.
Include XMM regs in context. Use names instead of hardcoded offsets.
2016-10-31 15:03:10 -07:00
Zoltan Varga c4762e796c [runtime] Perform the reference assembly attribute check using the low level metadata apis outside of a lock. 2016-10-31 17:52:18 -04:00
Alexis Christoforides c6cfe554ab Bump bockbuild 2016-10-31 16:16:23 -04:00
Alexis Christoforides 8243706038 [bockbuild] Remove broken sanity check in 'mono' package.
The test correctly fails, as the staging code fails to replace some instances of the destination prefix with the staging prefix. This is a benign error that was already there (the test was just not working) so we are ignoring for now. We must however fix this before e.g. shipping mono in arbitrary staged locations.
2016-10-31 16:12:50 -04:00
Alexis Christoforides ab652c0deb Ensure '/etc/paths.d' exists (it doesn't on clean macOS Sierra installations) 2016-10-31 15:49:25 -04:00
Alexis Christoforides ff641b0063 [bockbuild] Fix regex matching on a deploy-time sanity check on the Mono package 2016-10-31 13:29:35 -04:00
Zoltan Varga 758b80e35c [sgen] Move the logic to determine whenever an ip is in a critical method to sgen code. Avoid loading aot info because its not async safe. (#3853) 2016-10-31 13:18:28 -04:00
Alexis Christoforides ecab2ef241 Bump bockbuild 2016-10-31 13:11:37 -04:00
Alexander Köplinger e796ded61a [corlib] Map SHA*Cng algorithms to SHA*Managed on monodroid
This is a followup to e9205142b2.
Monodroid is missing the Cng and CryptoServiceProvider variants of the SHA
algorithms as well so we need to map to the Managed variants there too,
like on monotouch.
2016-10-31 17:35:13 +01:00
Aleksey Kliger (λgeek) bb4b0ff4fc Merge pull request #3802 from lambdageek/dev-reference-attr-take3
[loader] Re-enable the reference assembly attribute check
2016-10-31 10:16:05 -04:00
Alexander Köplinger 1bb10ac895 Bump boringssl submodule to the correct commit
It was accidentally reverted in https://github.com/mono/mono/commit/95b0698304cbc54fdfd2eac00692c9c8c3c8875d
2016-10-31 13:41:57 +01:00
Marek Safar 0226d3397c [corlib] SharedStatics from referencesource. Fixes #46175 2016-10-31 12:56:56 +01:00
Alexander Köplinger 67d9f3e720 Merge pull request #3851 from akoeplinger/nunitlite
Switch BCL testing from nunit to nunitlite
2016-10-31 12:54:49 +01:00
Alexander Köplinger 3bc76b068d [System] Disable a test that reads a file on mobile
We don't have a way to pass the file to our mobile test runners at the moment.
2016-10-31 12:41:13 +01:00
Alexander Köplinger 9614307bfb [System] Fix monodroid build when BTLS is disabled 2016-10-31 02:07:03 +01:00
Alexander Köplinger d749672b0b [nunitlite] Port babysitter work from nunit24
See https://github.com/mono/mono/commit/1dc0598badaed161efa92fd261de7e555d1a2b13
2016-10-29 14:09:43 +02:00
Alexander Köplinger 2dda624df4 [System.ServiceModel] Make looper thread in ChannelDispatcher a background thread and join instead of abort
This showed up when switching to nunit-lite since it runs all tests in the same AppDomain,
meaning it won't exit when any foreground threads are still running. This was the case
with the thread created by ChannelDispatcher which was still waiting on a connection.

Also try to Join() the thread for a bit so it exits gracefully before trying to abort,
might resolve issues like in https://github.com/mono/mono/pull/3819
2016-10-29 14:09:42 +02:00
Alexander Köplinger a0a01df763 [System.Web.DynamicData] Fix references to nunit.mocks
nunitlite.dll does not include namespace NUnit.Mocks and it is not necessary.
2016-10-29 14:09:41 +02:00
Alexander Köplinger 95f9f418e8 [System.Web] Remove Explicit attribute from test
With nunitlite the test is executed even though it's marked as ignored when the attribute is there.
This is probably the same bug as https://github.com/nunit/nunit/issues/741 (we're passing -exclude for some categories to nunit).
2016-10-29 14:09:41 +02:00
Alexander Köplinger e7b54ec1db [WinForms] Disable the ApplicationTest.RestartNotSupportedExceptionTest for now
It causes an infinite loop because nunit-lite restarts itself over and over when running the test
as the tests don't run in a separate AppDomain so the host process is restarted.
2016-10-29 14:09:40 +02:00
Alexander Köplinger 62c1f50cde [Microsoft.Build] Ignore ThreadAbortException in BuildNodeManager
It showed up after test runs with nunit-lite because it caused writes to Console.Error.
2016-10-29 14:09:39 +02:00
Alexander Köplinger 1a89bfde05 [System.Xml/System.ServiceModel/Dataflow] Use more specific type in assert
Apparently nunitlite is more strict here so we need to allow subclasses as well
and test for the more specific type.
2016-10-29 14:09:39 +02:00
Alexander Köplinger fbf1acd698 [System.Xml] Fix embedded assembly name in XmlCodeExporterTests
nunitlite doesn't run the test in a separate AppDomain so we get the name of the console host.
2016-10-29 14:09:38 +02:00
Alexander Köplinger 40c3407ab9 [System.Runtime.Remoting] Fix double call to ChannelServices.UnregisterChannel
It is already called in TestFixtureTearDown, and calling it twice results in an exception in UnregisterChannel
the second time because the channel is no longer registered.
2016-10-29 14:09:37 +02:00
Alexander Köplinger 77bcadb7dd [System.Data.OracleClient] Replace config file lookup of ConnectionString with env var
This is easier with the new nunitlite config file handling.
2016-10-29 14:09:36 +02:00
Alexander Köplinger 892cd52636 [System.Data.Linq] Fix "build" subdirectory to work with nunitlite
TODO: we should refactor this, seems crazy to have a frankencopy of the test machinery in this folder.
2016-10-29 14:09:36 +02:00
Alexander Köplinger 2550144e79 [corlib/System/System.Configuration] Fix tests relying on the current directory to be the test folder
nunitlite runs tests shadow-copied in a temp folder, so looking up the resource based on the current dir doesn't work.
2016-10-29 14:09:35 +02:00
Alexander Köplinger f1ae0bcaae [corlib] Disable a test that is incompatible with how nunitlite runs tests 2016-10-29 14:09:34 +02:00
Marcos Henrich 5913682513 [bcl] Replace deprecated usage of Assertion class and Is.InstanceOfType usages.
nunitlite does not contain Assertion class.

nunitlite does not implement Is.InstanceOfType, replaced usages of:
Assert.That (type, Is.InstanceOfType(typeof(T))) with Assert.IsInstanceOfType.
2016-10-29 14:09:34 +02:00
Marcos Henrich 863dc73d19 [bcl] Add NUnitHelper.cs with API not in nunit-lite
NUnitHelper.cs adds CollectionAssert, FileAssert, StringAssert.

Also adds AssertHelper class with methods that are not part of nunitlite
Assert class.
2016-10-29 14:09:33 +02:00
Alexander Köplinger 01c9543e08 [bcl] Add patching of nunit-lite-console.exe.config file
Because nunit-lite runs everything in the same AppDomain, we can't use dll.config files for settings anymore.
Since a few test suites rely on being able to read those settings we need to patch them into the main
nunit-lite-console.exe.config file instead before the test.

Remove all _test.dll.config files and replace with nunit-lite patcher equivalent
2016-10-29 14:09:32 +02:00
Marcos Henrich a0f51a3803 [bcl] Replace nunit24 with nunit-lite
Get rid of TEST_HARNESS_VERBOSE and enable verbose logging by default

nunit-lite doesn't have the "dot when test runs" progress indicator anymore,
so we need to enable "verbose" output by default otherwise we don't get
any progress until the test run is over.

Also remove the TestResult_$(PROFILE).log and nunit-summary.xsl files,
they're not needed anymore.
2016-10-29 14:09:31 +02:00
Alexander Köplinger 02bdc5ab21 Merge pull request #3852 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-29 13:37:10 +02:00
JensEhrhardt-eOPUS e1afc84bb1 UdpClient.Receive parameter refers to remote EP (#3842)
Instead of listening to a local end point, listen to any remote endpoint answering to our request.
2016-10-29 10:38:35 +02:00
monojenkins 4b9251d1cd [msvc] Update csproj files 2016-10-29 04:24:01 +00:00
Ludovic Henry f588b336fc [threads] Replace use of W32Handle by MonoOSEvent for MonoThreadInfo exited event (#3659)
* [mono-threads] Make thread wait platform specific

* [mono-threads] Replace thread w32handle use by event

This allows use to remove the MonoThreadInfo dependency on the w32handle on posix.

* [w32handle] Move them to metadata

w32handle are purely for managed support, and they shouldn't be used in the runtime.

* [mono-threads] Factor open/close thread handle

* [mono-threads] Factor exit thread

* [mono-threads] Factor platform register/unregister thread

* [mono-threads] Use ThreadHandle on all platforms

* [threads] Fix mutex abandonning for main thread

According to the comment, the intent is to abandon the mutex hold by the current thread. This intent was conveyed by the previous code when the threading code was still in the io-layer.
2016-10-28 17:00:54 -04:00
Aleksey Kliger 0465b3764f [tests] Build AOT prereqs for reference-loader test 2016-10-28 16:38:41 -04:00
Zoltan Varga 016709fe52 More metadata cleanup (#3792)
* [runtime] Introduce a new mono_class_init_sizes () function which initializes only the instance fields without initializing fields if possible. Use it in a few places instead of mono_class_init ()/mono_class_setup_fields ().

* [runtime] Simplify mono_class_has_references (), it doesn't have to special case the init_pending case.

* [runtime] Use a TLS list instead of the 'init_pending' flag to detect recursion in mono_class_init ().

* [runtime] Reduce the size of the critical section in mono_class_init () by doing most of the work outside the lock.

* [runtime] Avoid loading cached class info for pointer etc. types.

* [runtime] Reduce the locking inside setup_interface_offsets ().
2016-10-28 15:51:35 -04:00
Zoltan Varga b06664a292 [sre] Remove some dead code. 2016-10-28 15:29:07 -04:00
Alexander Köplinger d9a4d1e672 Merge pull request #3847 from rolfbjarne/btls-remove-unused-pinvokes
[System] Remove unused BTLS P/Invokes.
2016-10-28 16:03:36 +02:00
Alexander Köplinger 4c8069a5e1 [bcl] Disable BTLS on xammac and xammac_net_4_5 profiles 2016-10-28 15:59:00 +02:00
Alexander Köplinger d1555df244 [btls] Fix library install
We need to ensure the directory is created and doesn't have an extraneous '/' char.
2016-10-28 15:52:27 +02:00
Ludovic Henry 3f78cade58 [threads] Fix suspend on watchos
Because certain platform (such as WatchOS) do not support syscall abort, we need to ensure that it is supported before we call the `mono_threads_suspend_abort_syscall` function.
2016-10-28 09:12:26 -04:00
Alexander Köplinger 34edae78f3 configure.ac: fix incorrect description 2016-10-28 15:11:54 +02:00
Ludovic Henry d6e1e41a81 [gc] Remove mono_gc_set_stack_end (#3845)
* [sgen] Add stress test

This hope to suspend a thread while it is in the process of attaching or detaching.

* [sgen] Fix unified suspend

This would cause a crash with unified suspend: if a thread would be suspended at mono-threads.c:1168, the stack_start would be greater than the stack_end, triggering the g_error at sgen-stw.c:351. The stack_end would initially be initialized in `sgen_client_thread_register`, but it would be overriden in start_wrapper at threads.c:893.
2016-10-28 08:49:23 -04:00
Alexander Köplinger f4d2a54f88 Merge pull request #3846 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-28 12:07:12 +02:00
João Matos 4df4cc49b7 Merge pull request #3844 from tritao/deflate_fixes
[System.IO.Compresion] DeflateStream fixes
2016-10-28 11:06:00 +01:00
Rolf Bjarne Kvinge a5366237de [System] Remove unused BTLS P/Invokes.
They point to internal functions that don't exist, causing compilation
problems for Xamarin.Mac apps.

Example test/compile failure: https://gist.github.com/rolfbjarne/43cf2228816bbe8a863f331da3e07c0d
2016-10-28 08:17:25 +02:00
monojenkins f1695b00b0 [msvc] Update csproj files 2016-10-28 04:24:51 +00:00
Alexander Köplinger 841db2c41b [corlib] Disable a few tests that are not supported on MOBILE_STATIC for now
They were added in 895f3f5ae8.
2016-10-28 03:14:48 +02:00
Zoltan Varga 8ba31bf79d [llvm] Add the 'notail' flag to non-tailcalls when using the 3.9 based llvm. 2016-10-27 18:29:05 -04:00
Joao Matos dd0745f426 [System.IO.Compression] Fixed potential bug when keeping track of total read bytes of input stream.
This didn't manifest as a bug, to to be on the safe side, replicate the behavior
introduced in https://github.com/mono/mono/commit/b4d5016b5e42fec226d93fd13260b6cac80eb384
and use the same approach when calculating the total of the read bytes of the input stream.
2016-10-27 22:01:21 +01:00
Joao Matos 0b94fdf1d3 [System.IO.Compression] Fixed DeflateStream input stream EOF condition.
What was happening is that we set the stream EOF flag to true when we
could not read any more input data, and that made us early out before
fully finishing the processing of the compressed data.

Now the only EOF flag is set to true is if zlib's inflate() has actually
finished processing the data.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44994#c2.
2016-10-27 22:01:10 +01:00
Aleksey Kliger a81db01598 [coop handles] Don't scan null object references
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=45223
2016-10-27 16:12:28 -04:00
Joao Matos 31f8da0b50 [System.IO.Compression] Fixed DeflateStream inflate() decompression loop.
This reworks the fix from https://github.com/mono/mono/commit/7c4d41a518aaf0370b882f9430752ebcd5544c10.

That fix introduced a regression when handling some inputs, which lead us to ignore
some left-over data from zlib's inflate output buffer.

Now we only break from the loop if inflate() returns Z_BUF_ERROR.

This makes sure all data is fully processed before returning to managed code.

Fixes one of the bugs in https://bugzilla.xamarin.com/show_bug.cgi?id=44994#c2.
2016-10-27 20:44:38 +01:00
Vlad Brezae 86c24e9427 Merge pull request #3769 from evincarofautumn/fix-verify-before-allocs
[sgen] Fix verify-before-allocs.
2016-10-27 20:49:30 +03:00
Zoltan Varga d831fc4ec4 [btls] Remove the statically linked btls code, the dynamic version should work on all platforms. (#3829) 2016-10-27 13:21:09 -04:00
Martin Baulig b0d5b36639 [bcl]: Fix 'Mono.Btls.Interface' build logic.
(cherry picked from commit 43558a209d)
2016-10-27 17:59:53 +02:00
Alexander Köplinger 8fcd9402c5 Merge pull request #3800 from madewokherd/mingwbuild
Use lower-case names for Windows headers.
2016-10-27 12:37:23 +02:00
Abdur Rehman a0cb3e16e6 [man] Typo fixes for the man pages
disco.1: fix typo, closes #3841

csharp.1: fix typos, closes #3840

crlupdate.1: fix minor typo, closes #3839

certmgr.1: fix typos/grammar, closes #3838

ccrewrite.1: fix minor grammatical errors, closes #3837

ccrewrite.1: fix copyright, closes #3836

Following comment changed the copyright:
https://github.com/mono/mono/commit/5a3fb39ca6a46250aec3afef21c85bef30239fc5

Reflect same change in the comments.
2016-10-27 12:19:30 +02:00
Alexander Köplinger 60b660d218 Merge pull request #3826 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-27 02:24:09 +02:00
Marius Ungureanu b8d2428d2c Update io.c 2016-10-27 03:14:04 +03:00
Alexander Köplinger aefc06ddf6 Merge pull request #3831 from rolfbjarne/watchos-fix-defaultproxy-test
[System] Tweak define to exclude System.Net.WebProxy.CreateDefaultProxy and update corresponding test.
2016-10-27 00:32:17 +02:00
Alexander Köplinger 90e87c31d0 Merge pull request #3832 from microMolvi/patch-2
cccheck.1: fix a typo
2016-10-27 00:30:23 +02:00
Zoltan Varga e3717a6441 [runtime] Fix a test so it works with bitcode, stack traces might contain wrapper frames. 2016-10-26 18:10:54 -04:00
Zoltan Varga 29a5474288 [llvmonly] Add gsharedvt out wrappers for icalls, the icall wrappers have a different signature (this/no this). 2016-10-26 16:38:36 -04:00
Abdur Rehman a0c222056c cccheck.1: fix a typo 2016-10-27 01:00:23 +05:00
Ludovic Henry a0d20ebbf7 [suspend] Remove sgen specific suspend code (#3640)
* [suspend] Remove sgen specific suspend code

* [sgen] Remove unused SgenClientThreadInfo->stopped_domain field

* [sgen] Remove unused SgenClientThreadInfo->stopped_ip field

* [threads] Unsplit code for syscall abort

* [threads] Reuse posix suspend signal handler function for abort

* [mono-threads] Move debug printf to separate file

This is to avoid recompiling half of the runtime for every change to these printf.

* [stw] Slightly improve logging

* [mono-threads] Fix unified thread suspend

`mono_threads_suspend_begin_async_suspend` return FALSE iff it coudn't successfully suspend the thread, not if the thread is not in the correct state. The latter is checked by calling `mono_threads_suspend_check_suspend_result` which will return FALSE if we couldn't initialize the state of the suspended thread.

* [mono-threads] Fix unified thread suspend

If we try to suspend a thread that is still attaching, we might suspend it after it allocated the MonoInternalThread and MonoThread, but before it set the current domain or lmf. This would lead us to not scan the thread stack, which would lead to collect the newly allocate MonoInternalThread/MonoThread, leading to a crash. By letting sgen deal with the thread, even if the domain or the lmf is not set, we avoid this bug.

This makes unified suspend have the same behaviour as the previous sgen specific suspend.

* [mono-threads] Fix compilation
2016-10-26 14:57:17 -04:00
Rolf Bjarne Kvinge 92d4f79eac [System] Tweak define to exclude System.Net.WebProxy.CreateDefaultProxy and update corresponding test. 2016-10-26 20:38:33 +02:00
Bernhard Urban 0976d12d67 [mono-config] fix warning (#3820)
```
mono-config.c:324:14: warning: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                                        g_free (libdir);
                                                ^~~~~~
../../eglib/src/glib.h:125:20: note: passing argument to parameter 'ptr' here
void g_free (void *ptr);
                   ^
1 warning generated.
```
2016-10-26 13:05:06 -04:00
Zoltan Varga fafa1a9662 [llvm] Use the global llvm context instead of creating a new one for each aot module, since the latter seems to cause random memory corruption/crashes. 2016-10-26 12:42:09 -04:00
Zoltan Varga 2b09b5fd6b [btls] Install the btls shared library on make install. (#3825) 2016-10-26 11:54:52 -04:00
Marek Safar a3539b2ecb [mcs] Add pathmap option 2016-10-26 11:53:11 +02:00
Niklas Therning 205a420dae MemoryMappedFile support on Windows
This implements the icalls in file-mmap-windows.c used by MemoryMappedFile.
The implementation has been inspired by the CoreFX MemoryMappedFile
implementation.

This patch also fixes a few incompatibilities between .NET and Mono:

 * The default MemoryMappedFileOptions has been changed from DelayAllocatePages
   to None.
 * mono_pagesize() on Windows now return SYSTEM_INFO.dwPageSize, the same as
   .NET and CoreFX.
 * Added mono_valloc_granule() which returns
   SYSTEM_INFO.dwAllocationGranularity and changed mono-codeman.c to use it
   when trying to allocate adjacent virtual memory.
 * MemoryMappedFileTest has been updated to succeed on .NET.
 * A test has been added to test correct DelayAllocatePages behavior (only
   supported on Mono on Windows, the flag is ignored on other platforms).
 * The posix MemoryMappedFile code has been changed to throw
   UnauthorizedAccessException rather than IOException when trying to create a
   view outside of the bounds of a MemoryMappedFile.
 * Creating a named mapping larger than 4GB on 32-bit systems now throws
   ArgumentOutOfRangeException.
2016-10-26 11:33:50 +02:00
monojenkins c91a014a87 [msvc] Update csproj files 2016-10-26 05:22:19 +00:00
Alexis Christoforides 57442250a9 Bump bockbuild 2016-10-25 19:43:48 -04:00
Zoltan Varga 57b34f6b07 [mobile-static] Increase trampoline limits even more. 2016-10-25 18:51:17 -04:00
Zoltan Varga bbf92a5129 [mobile-static] Increase the number of imt trampolines to 2000 to prevent running out of them in the System.Core tests. 2016-10-25 18:13:07 -04:00
Alexis Christoforides 044d3a68a0 Couple more 'bockbuild split' mixups 2016-10-25 18:12:51 -04:00
Alexis Christoforides 726c95447c 'storage.box.xamarin.com' is now 'xamarin-storage' (internal URL) 2016-10-25 18:12:09 -04:00
Zoltan Varga d8d301140c [runtime] For delegate invoke wrappers, store the generic invoke method in the wrapper info and inflate it when inflating the wrapper. Fixes ipy failure. (#3821) 2016-10-25 18:05:32 -04:00
Alexis Christoforides c42497b8b7 Bumped bockbuild 2016-10-25 17:01:37 -04:00
Alexander Köplinger 6d22e137f5 Merge pull request #3823 from mono/fix-btls-managed
[System] Don't build managed BTLS code on monotouch
2016-10-25 22:29:23 +02:00
Alexander Köplinger 3c26e4e5b9 [bcl] Only build Mono.Btls.Interface and btls tool when BTLS is enabled 2016-10-25 21:26:49 +02:00
Alexander Köplinger db21455da9 [System] Don't build managed BTLS code on monotouch
After 2fb07d6c6d BTLS can be used as a shared lib,
but this caused an issue in some monotouch tools which grepped the P/Invokes for `__Internal`
since these icalls wouldn't resolve on monotouch since BTLS is disabled there.

Instead, we now completely leave out building the managed parts of BTLS when
BTLS is not enabled.
2016-10-25 18:44:33 +02:00
Niklas Therning 416b600657 Fix compilation errors in mono/utils/os-event-win32.c with Mingw/GCC (#3818)
This was introduced in 92be5357d1. The patch
also adds the os-event-win32.c file to the libmonoutils Visual Studio project.
2016-10-25 10:49:50 -04:00
Martin Baulig f5f641ff85 [BTLS]: Fix a ref-counting leak in X509ChainImplBtls. Fixes #45687. (#3811)
* [BTLS]: Fix a ref-counting leak in X509ChainImplBtls.  Fixes #45687.

* Set 'untrusted = null' in Dispose().

(cherry picked from commit c9a67ffc5a)
2016-10-25 15:42:38 +02:00
Marek Safar 95b0698304 [System] Clean up some warnings 2016-10-25 14:28:35 +02:00
Marek Safar 69e4db8a1a [runtime] Ignore bit 14 in typedef export table during verification. It seems to be used by some WinRT predefined types 2016-10-25 12:52:43 +02:00
Alexander Köplinger 493d0aaaa0 Merge pull request #3817 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-25 11:58:06 +02:00
Swaroop Sridhar 3cadcb4d7a MonoLinker: Fix a Typo in the README (#3816) 2016-10-25 01:33:25 -04:00
monojenkins c32705dda3 [msvc] Update csproj files 2016-10-25 04:51:24 +00:00
Marek Safar 118e75023a Merge pull request #3812 from rolfbjarne/watchos-no-cfnetwork
[System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.
2016-10-24 23:27:39 +02:00
Alexander Köplinger c444c68c9c Merge pull request #3815 from microMolvi/patch-1
caspol.1: fix minor grammatical errors
2016-10-24 23:20:48 +02:00
Zoltan Varga 17e29bc3a2 [x86] Clear the fp stack when exceptions are thrown. Fixes #45841. (#3814) 2016-10-24 16:42:52 -04:00
Abdur Rehman 3a63a287b6 caspol.1: fix minor grammatical errors 2016-10-25 00:15:03 +05:00
Zoltan Varga 5937f444dd [runtime] Fix an assert message. 2016-10-24 14:58:14 -04:00
Rolf Bjarne Kvinge 4b8fc544b0 [System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.
The MacProxy class uses CFNetwork, but since CFNetwork is not a public
framework on watchOS, we can't use it.

So remove MacProxy completely (it only contains internal classes), and throw
PlatformNotSupportedException in any API that used it (the managed networking
stack is not supported on watchOS anyway, so this should be safe).

https://bugzilla.xamarin.com/show_bug.cgi?id=45847
2016-10-24 20:06:06 +02:00
Ludovic Henry 92be5357d1 [runtime] Add MonoOSEvent 2016-10-24 13:27:03 -04:00
Miguel de Icaza 1fb083d2d4 Make mkbundle use SDKs instead of a single runtime for cross compilation
Make mkbundle use SDKs instead of a single runtime for cross compilation
2016-10-24 11:47:31 -05:00
Aleksey Kliger abe2e95f4e [tests] Missing custom attr on an assembly should not crash mono. 2016-10-24 12:11:07 -04:00
Alexander Köplinger 932ae6cca2 Merge pull request #3801 from akoeplinger/netstandard20-updates
[bcl] Move a few types from the Facades into the framework for netstandard20 compatibility
2016-10-24 16:36:49 +02:00
Johan Lorensson 1de9d6fd55 Merge pull request #3810 from lateralusX/jlorenss/add_missing_assert_include
Explicit include of assert.h.
2016-10-24 16:09:59 +02:00
lateralusX 15213acb7b Explicit include of assert.h. 2016-10-24 15:39:55 +02:00
Alexander Köplinger 1a4e480cca [configure.ac] Only disable -Wno-zero-length-array on clang
The $GCC variable in autoconf will be yes for clang as well [1].

[1] https://lists.gnu.org/archive/html/autoconf/2014-09/msg00023.html
2016-10-24 15:17:54 +02:00
Johan Lorensson 59ddb222e0 Merge pull request #3442 from lateralusX/jlorenss/win-atexit-commands
Add support on Windows to install atexit handler(s) early in bootprocess.
2016-10-24 11:53:15 +02:00
Alexander Köplinger c5ebdef6d4 Merge pull request #3808 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-22 14:23:00 +02:00
Miguel de Icaza 6d37ffdf53 [mono] Add some strong types for a few variables, document some methods (#3777) 2016-10-22 00:36:34 -04:00
monojenkins b3aa48281e [msvc] Update csproj files 2016-10-22 04:28:22 +00:00
Zoltan Varga 2fb07d6c6d [btls] Convert BTLS icalls to pinvokes by invoking them using [DllImp… (#3799)
* [btls] Convert BTLS icalls to pinvokes by invoking them using [DllImport("__Internal")], which will make it easier to redirect them to a separate dylib in the future.

* [btls] Add a --enable-dynamic-btls configure flag to enable compiling btls into a separate shared library instead of embedding it into the runtime.
2016-10-21 17:29:13 -04:00
Andi McClure 20acd5895c There's a G_BREAKPOINT in mini-exceptions.c which could be hit during user execution. This will not be caught by our normal crash reporter, so we should use g_error here instead. (#3791) 2016-10-21 17:28:59 -04:00
Zoltan Varga 27d0ef18f0 [runtime] Fix the native-to-managed marshalling of null blittable arrays. Fixes #45788. 2016-10-21 16:51:01 -04:00
Alexander Köplinger adcc481705 [bcl] Move a few types from the Facades into the framework for netstandard20 compatibility
See https://github.com/dotnet/standard/pull/76.

Also moved IncrementalHash from System.Core.dll to mscorlib.dll as per discussion with Wes.
2016-10-21 22:19:13 +02:00
Aleksey Kliger 9fea3a346a [tests] Re-enable reference-loader.exe test
This reverts commit c08acd2eb4.
2016-10-21 10:30:55 -04:00
Alexis Christoforides fe0a7e6d8c WIP 2016-10-21 10:30:48 -04:00
Aleksey Kliger e10780c24d [loader] Set image assembly before reference attribute assembly check.
In mono_assembly_load_from_full, the call to
mono_assembly_has_reference_assembly_attribute has to come after
image->assembly is set.  This is because image->assembly->base_dir is
used for probing for referenced assemblies, and the reference assembly
attribute check will probe for assemblies referenced by the custom
attributes on the assembly in image being loaded.
2016-10-21 10:30:35 -04:00
Aleksey Kliger ac720981eb [loader] Write fully-qualified field names in mono_field_resolve_type errors. 2016-10-21 10:30:35 -04:00
Aleksey Kliger 7945233379 [custom_attrs] Don't return NULL if a single custom attr is missing.
Add 'ignore_missing' argument to mono_custom_attrs_from_index_checked:
if it is TRUE, a single custom attribute constructor that can't be
resolved to a MonoMethod won't cause the whole method to return NULL.
if 'ignore_missing' is FALSE, use existing behavior.

Updated all the call sites to pass FALSE, except
mono_custom_attrs_from_assembly_checked which also gets a new
'ignore_missing' arg.

Updated 'mono_assembly_has_reference_assembly_attribute to pass TRUE for
ignore_missing.
2016-10-21 10:30:35 -04:00
Alexis Christoforides 4ec89fe356 Bump bockbuild 2016-10-21 10:12:51 -04:00
Alexis Christoforides e55526556d More fixes for the Release ('Xamarin') profile 2016-10-21 09:46:14 -04:00
Alexis Christoforides b92c2208b9 Fixes for the 'xamarin' profile.
Re-renamed profile (now 'MacSDK') to remove hyphen which was prohibiting Python module importing
2016-10-21 09:46:14 -04:00
Alexander Köplinger c08acd2eb4 [tests] Disable reference-loader.exe test for now
The code it's supposed to test was temporarily disabled in 1bf9409629
2016-10-21 13:24:27 +02:00
TautvydasZilys 6d7e40dd90 Changes in class libraries to enable Windows Runtime event support using Mono's mscorlib (#3778)
* Use Windows Runtime event related classes from Reference Source and implement couple missing methods needed for Windows Runtime event suppor

* Add native stubs for newly added icalls.

* Attempt to fix build on non-windows

* Attempt to fix mscorlib build when COM is disabled.

* Revert "Attempt to fix mscorlib build when COM is disabled."

This reverts commit 5befc13b5ee7283fc4f19bd706389496c139790f.

* System.Type::IsWindowsRuntimeObjectProperty is under "FEATURE_COMINTEROP || MONO_COM", so its callers should be under it too.

* Fix build failure due to a semantic merge conflict with b313769878
2016-10-21 13:04:49 +02:00
Niklas Therning 634ab61415 Fix crash in SafePipeHandle.ReleaseHandle() on Windows (#3797)
The ReleaseHandle() methods tries to deallocate the handle as if it was a
pointer to heap memory. But on Windows it's a HANDLE. The call to
Marshal.FreeHGlobal() causes a crash on Windows. It doesn't crash on other
platforms probably due to the emulated handles which are indeed heap allocated
memory objects. But the underlying file descriptor is never closed so there
should be a file descriptor leak on other platforms.

This patch fixes the issue by calling MonoIO.Close() on the handle rather than
Marshal.FreeHGlobal()
2016-10-20 20:52:38 -05:00
Vincent Povirk 1bee4aa4e5 Use lower-case names for Windows headers.
Mingw on Linux is case-sensitive and requires this.
2016-10-20 16:36:18 -05:00
Aleksey Kliger 1bf9409629 [loader] Disable mono_assembly_has_reference_assembly_attribute
It relies on mono_custom_attrs_from_assembly_checked which is not
sufficiently robust to missing assemblies when trying to look for custom
attributes.
2016-10-20 13:51:55 -04:00
Martin Baulig 00f252d01f [System]: Distinguish between empty hostnames and no hostnames for certificate validation.
SecPolicyCreateSSL() distinguishes between an empty string (validation will fail
if the certificate contains host name constraints) and a null pointer (no host name
checking will be performed) for the hostname.

We incorrectly used `string.IsNullOrEmpty (host)` in a few places.
2016-10-20 18:51:03 +02:00
Martin Baulig 7fdd730928 [System]: ChainValidationHelper: always set 'status11' on error. 2016-10-20 18:49:12 +02:00
Martin Baulig 9a073a2929 [boringssl]: Merge latest chromium-stable branch from Google. 2016-10-20 18:48:04 +02:00
Aleksey Kliger (λgeek) 86e44dfdcb Merge pull request #3786 from lambdageek/dev-42584-take2
Check for ReferenceAssemblyAttribute when loading for execution
2016-10-20 11:33:15 -04:00
Miguel de Icaza b313769878 Utf8 (#3776)
* UTF8 Marshaling APIs  (#3736)

Adds support for the new UTF8 marshaling functionality in .NET, there
is support for the new MarshalAs(UnmanagedType.LPUTF8St) as well as a
handful of convenience methods in Marshal.cs

In Mono, this is mostly a pass-through as we have historically only
done UTF8, so this merely adds the constant processing to the runtime.

This fixes a few bugs that the new test suite exhibited: when we
marshaled UTF8 strings, we assumed Chars() == Bytes() and we would end
up chopping when marshaling out, and marshaling in.

There is also an additional behavioral bug that was fixed in
Marshal.cs, unlike the rest of the runtime that treated Ansi as Utf8,
StringToCoTaskMemAnsi behaved as ascii. This brings the API in line
with the rest of the runtime.

The equivalent CoreCLR changes were:

dotnet/coreclr#4793
dotnet/coreclr#6561

This has also surfaced two limitations in Mono's marshaling code,
which is why two sets of tests are disabled: StringBuilder return
types are not handled specially (char * needs to be turned into a new
StringBuilder when present) and StringBuilders with an Out attribute
should update the StringBuilder in place, not make a new copy of it.
2016-10-20 08:19:09 -05:00
lateralusX bdbea3589f Add support on Windows to install atexit handler(s) early in application’s startup.
This is done by adding a new argument to install specific named custom handlers,
--handlers=. There is also an argument to describe the supported handlers on current
platform, --help-handlers.

The supported handlers can be different depending on implementing platform and currently
only Windows uses this feature to install an atexit handler waiting for a keypress
before exiting process. This is however a generic concept that could be used to run handler
code early in the boot process on any platform for other purposes. Adding the argument first
in command line makes it possible to do the installation very early in the boot process, this
is used by the waitkeypress atexit handler in order to be used in cases where the arguments
itself are unsupported or incorrect formatted causing an exit of the process.

When running under Visual Studio debugger the console window will not be kept
open when the debugee process terminates. Normally this is not a problem, but there are scenarios,
especially when having errors in configuration, when you would like the console to be kept open so
you can read the output in order to detect the error.

Normally there is an option to start the console application from within Visual Studio but
not attaching the debugger (CTRL+F5) and by default Visual Studio will then inject a pause
in the execution of the process holding up the console, but for some reasons, having more
complex solutions like mono, this feature stops working, so it is not possible to keep the console
open in that scenario for more complex solutions.

This makes it a little problematic to hold the process when working within the debugger in order
to look for console output and errors. Since mono can exit the process using exit command and not
only by returning from main, the developer needs to set breakpoints on both end of main and in c-runtime
exit methods. Even if that is a possible workaround this option won't work when running the process outside
the debugger (CTRL+F5).

This commit adds a handler argument that can be used on Windows (potential on other platforms as well), atexit-waitkeypress.
The waitkeypress will hold the console and process open until a key is pressed and is very
useful when running and debugging mono from within Visual Studio. Example of output when running mono’s mono-mini-regression-test
with an assembly not found together with –handlers=atexit-waitkeypress command line argument:

failed to load assembly: gshared-nofound.exe
Overall results: tests: 0, 100% pass, opt combinations: 25
Press any key to continue . . .

Currently this is only implemented for Windows, but could be enabled for other platforms,
if similar need exist elsewhere.

Since this is a standard mono command line option it is possible to inject it using the MONO_ENV_OPTIONS environment variable as well.
2016-10-20 12:49:09 +02:00
Zoltan Varga 7d40fd72f6 [runtime] Fix the calculation of the instance size of ptr/var types. (#3790) 2016-10-19 19:29:55 -04:00
Alexander Köplinger b21eb06676 Merge pull request #3787 from AsamK/fix_listview
[MWF] Fix two issues in ListView
2016-10-19 15:30:39 +02:00
Ludovic Henry 1156be7b08 [hybrid-aot] Fix GSharedVT support (#3783)
* [aot-compiler] Cleanup GSharedVT check

* [aot-compiler] Enable partial sharing for hybrid AOT

* [aot] Enable GSharedVT for Android

* [aot] Ensure GSharedVT is supported at runtime as well as compile time

* [aot] Factor aot mode setting
2016-10-19 09:14:59 -04:00
Alexander Köplinger 66fb48c6a5 Merge pull request #3789 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-19 13:05:55 +02:00
monojenkins 919824ddd4 [msvc] Update csproj files 2016-10-19 10:17:15 +00:00
Alexis Christoforides a9f06407b2 [bockbuild] Moved Gtk+ files back to main bockbuild repo 2016-10-18 19:19:16 -04:00
Sebastian f9e1c5a686 Add unit tests for ListView bugs 2016-10-19 00:05:23 +02:00
Alexander Köplinger 57d111577f [tools] Fix casing of sqlsharp
The directory is lowercase on disk.
2016-10-18 20:54:37 +02:00
Aleksey Kliger f7bcbec775 [runtime] Check for ReferenceAssemblyAttribute when loading for execution.
An assembly with a System.Runtime.CompilerServices.ReferenceAssemblyAttribute
may be loaded in a reflection-only context, but not for execution.

When loading assembly refs, or when loading assemblies by name (as
opposed to file path), a reference assembly will be skipped over and
other assemblies from the GAC and the load path will be tried.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42584
2016-10-18 14:48:25 -04:00
Aleksey Kliger 9d789e0d70 [loader] Tests for RefereceAssemblyAttribute support
This reverts commit 8612b548ee.

Which itself reverted commit 31de4df835.
2016-10-18 14:48:25 -04:00
Aleksey Kliger d7b886c173 [runtime] Let mono_custom_attrs_has_attr ignore malformed attributes 2016-10-18 14:48:25 -04:00
Aleksey Kliger bf09936e17 [runtime] Don't build temporary array in mono_custom_attrs_get_attr_checked
Just return the first matching attribute as soon as it's found, don't
build a temporary array and then index into it.
2016-10-18 14:48:25 -04:00
Aleksey Kliger 4e38dbf66b [runtime] Mark mono_custom_attrs_get_attr external only
Runtime should use mono_custom_attrs_get_attr_checked.
2016-10-18 14:48:25 -04:00
Aleksey Kliger b7943a94e6 [runtime] Add assembly name to message in FileNotFoundException
when using mono_error_set_assembly_load_simple ()
2016-10-18 14:48:25 -04:00
Sebastian 59f78905ff Fix ArgumentOutOfRangeException exception when removing a not focused item
The code in RemoveAt doesn't update the focused item index, if the focused
item is the last item in the list and another item is removed.
The next time an item is removed, the focused item index is equal to Count
and an ArgumentOutOfRangeException is thrown.
2016-10-18 20:19:45 +02:00
Sebastian b7c10f90f4 Fix IndexOutOfBounds exception, when removing and adding an item to another list
Removing a selected item from one ListView and adding the same item to
another ListView, an IndexOutOfBounds exception was thrown, if the second
ListView has fewer elements than the first one. That's because the
DisplayIndex still contained the index from the first ListView.
2016-10-18 20:14:50 +02:00
Alexander Köplinger b73b0f5351 Bump boringssl submodule 2016-10-18 19:32:52 +02:00
Marek Safar 658d82d87a Fixes System build 2016-10-18 17:20:30 +02:00
Marek Safar 7f06a0910e [System] Implements Socket::ConnectAsync. Fixes #44406 2016-10-18 17:14:59 +02:00
Marek Safar 09f75f011c [mcs] Add new test 2016-10-18 17:14:59 +02:00
Alexander Köplinger 7b2dcdae0d [ci] Add option to not run tests via CI_TAGS 2016-10-18 16:00:49 +02:00
Marek Safar 03356aba0a Merge pull request #3780 from akoeplinger/mcs-error-constant-invariant
[mcs] Use InvariantCulture for GetValueAsLiteral() in constant.cs
2016-10-18 14:58:46 +02:00
Marek Safar e863f9c25e Bump cecil to get recent fixes 2016-10-18 14:09:43 +02:00
Marek Safar 804794a9a9 Merge pull request #3781 from grendello/networkinfo
With Android 7.0 (Nougat) it is no longer possible to read some
2016-10-17 23:30:34 +02:00
Zoltan Varga 1998314ee2 [runtime] Fix a regression introduced by 1be62d5e2a (field loading rewrite). Static field offsets were overwritten with 0 if the mono_class_setup_fields () function was called in parallel. 2016-10-17 17:19:44 -04:00
Alexis Christoforides 92f94eed83 Fix 'mono' package typo 2016-10-17 16:41:34 -04:00
Marek Habersack c439b67887 With Android 7.0 (Nougat) it is no longer possible to read some
information about network interfaces from the /sys filesystem. Google
placed restrictions on two files used by the Mono BCL to read
information about the interface:

      /sys/class/net/[DEVICE]/flags
      /sys/class/net/[DEVICE]/operstate

The information we used to read from `flags` let us determine whether
the interface supports multicast and the `operstate` file provided us
with detailed information on the current device state.

Additionally, it is now impossible to read the hardware MAC address used
by any interface. This bit of information is also unavailable when using
the Java APIs and therefore applications running on devices with API
24 (and possibly newer) will not be able to access this information.

More details about the issue are available from the upstream Android
bug:

      https://code.google.com/p/android/issues/detail?id=205565

In order to obtain the required information, we now need to use the Java
APIs on devices with API 24+ and this commit implements the backend to
retrieve this information. It is done in C in order to avoid overhead of
creating mirror .NET objects when calling Java, thus saving time and
memory during an operation which may be performed by some applications
quite frequently.

This patch implements code that calls into the Xamarin.Android
runtime when runnin under API24 or newer to obtain the information.

Part of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=44296
2016-10-17 22:29:49 +02:00
Alexander Köplinger 51245ed862 [mcs] Use InvariantCulture for GetValueAsLiteral() in constant.cs
Without it mcs would've printed the following error for code like `const int val = 1.42f`
on a system where the decimal separator is not the dot, e.g. German:

```
test.cs(3,18): error CS0031: Constant value `1,42' cannot be converted to a `int'
```
2016-10-17 19:15:00 +02:00
Alexander Köplinger 297c25787b Merge pull request #3779 from akoeplinger/fix-aot-only-reference
[mini] Fix mention of --aot-only option, it no longer exists
2016-10-17 17:56:03 +02:00
Lluis Sanchez 0701399a88 Implement some missing methods in RSACryptoServiceProvider
(cherry picked from commit d4e09f5c35)
2016-10-17 17:47:40 +02:00
Lluis Sanchez a92792300b Implemented System.Security.Cryptography.X509Certificates.RSACertificateExtensions
(cherry picked from commit 04a376b2ab)
2016-10-17 17:47:34 +02:00
Alexander Köplinger 524d79758a [mini] Fix mention of --aot-only option, it no longer exists
It was replaced with --full-aot in ba99fd8334,
but there were still two places left that talked about the old option which leads to confusion.

Also updated the link to Xamarin docs to the current URL.
2016-10-17 17:18:43 +02:00
Alexander Köplinger 03ea8b5a62 [build] Regenerate .csproj files
Note: DISABLE_CAS_USE was removed in ed989a8e9e
2016-10-17 16:34:16 +02:00
Marek Safar c143e55c45 [System] More Socket methods from referencesource 2016-10-17 15:04:39 +02:00
Zoltan Varga 1be62d5e2a [WP] [runtime] Rewrite field loading and layout (#3722)
* [runtime] Improve the locking in mono_class_setup_basic_field_info ().

Compute all the required information outside the lock and install it inside the lock. Remove mono_class_setup_basic_field_info_locking () function which is no longer needed.

* [runtime] Move the special case of no fields from mono_class_setup_fields () to mono_class_layout_fields ().

* [runtime] Move the computation of klass->blittable and klass->element_class/cast_class for enums to mono_class_layout_fields () so it can be used for dynamic types as well.

* [runtime] Make typebuilder_setup_fields () initilize the same data as mono_class_setup_fields ().

* [runtime] Move more common code into mono_class_layout_fields () from mono_class_setup_fields () and typebuilder_setup_fields ().

* [runtime] Avoid infinite recursion in mono_class_setup_fields () by storing the classes under initialization in a TLS list instead of using the racy klass->setup_fields_called flag.

* [runtime] Reduce the amount of locking in mono_class_setup_fields () to the call to mono_class_layout_fields (). Remove mono_class_setup_fields_locking ().

* [runtime] Remove a special case for no fields from mono_class_layout_fields (), the normal code can handle it.

* [runtime] Reorganize mono_class_layout_fields () so it makes all modifications to the MonoClass instance in one place.

* [runtime] Reduce the amounrt of locking in mono_class_layout_fields ().

* [runtime] Remove some compiler context code.
2016-10-16 00:35:16 -04:00
Alexis Christoforides bb8b635634 Bump bockbuild 2016-10-15 19:51:20 -04:00
Alexander Köplinger 056d58cf04 [corlib] Don't emit symbol information in ModuleBuilderTest.GetType()
It doesn't work on Android and the test doesn't need it.
2016-10-15 03:13:59 +02:00
Alexis Christoforides 48878c2420 Cleanup 2016-10-14 19:11:53 -04:00
Alexis Christoforides 7d44a1affe Removed autotools from the shipped distribution 2016-10-14 19:11:30 -04:00
Alexis Christoforides 8cddd4eaaa Bump bockbuild 2016-10-14 19:10:39 -04:00
Alexander Köplinger dcf4ddd097 [System] Fix expected default value in test for ServicePointManager.ConnectionLimit on XA
The default was aligned with XI on https://github.com/mono/mono/commit/d06354174070d01394f5e75ffcfc9c1110a1e7db
2016-10-15 01:09:10 +02:00
Alex Rønne Petersen f729626e72 Merge pull request #3775 from alexrp/main-thread-name
[runtime] Don't change the native name of the main thread.
2016-10-14 23:16:15 +02:00
Miguel de Icaza fb2908ef74 Revert "UTF8, with build fixed"
This reverts commit 50d119be5d.
2016-10-14 14:39:22 -04:00
Alexis Christoforides 7a0d4bc105 Added missing gdk-pixbuf patches 2016-10-14 14:37:21 -04:00
Miguel de Icaza 2ab2feb43f Revert "Revert "UTF8 Marshaling APIs (#3736)""
This reverts commit 2a01bde545a47e287977637a4a08f8f965ca45dc.t push
:
2016-10-14 14:36:42 -04:00
Miguel de Icaza 50d119be5d UTF8, with build fixed 2016-10-14 14:35:46 -04:00
Miguel de Icaza 2a01bde545 Revert "UTF8 Marshaling APIs (#3736)"
This reverts commit 4056e80006.
2016-10-14 14:26:40 -04:00
Miguel de Icaza 4056e80006 UTF8 Marshaling APIs (#3736)
Adds support for the new UTF8 marshaling functionality in .NET, there is support for the new MarshalAs(UnmanagedType.LPUTF8St) as well as a handful of convenience methods in Marshal.cs

In Mono, this is mostly a pass-through as we have historically only done
UTF8, so this merely adds the constant processing to the runtime.

This fixes a few bugs that the new test suite exhibited: when we marshaled UTF8 strings, we assumed Chars() == Bytes() and we would end up chopping when marshaling out, and marshaling in.

There is also an additional behavioral bug that was fixed in Marshal.cs, unlike the rest of the runtime that treated Ansi as Utf8, StringToCoTaskMemAnsi behaved as ascii. This brings the API in line with the rest of the runtime.

The equivalent CoreCLR changes were:

dotnet/coreclr#4793
dotnet/coreclr#6561

This has also surfaced two limitations in Mono's marshaling code, which is why two sets of tests are disabled: StringBuilder return types are not handled specially (char * needs to be turned into a new StringBuilder when present) and StringBuilders with an Out attribute should update the StringBuilder in place, not make a new copy of it.
2016-10-14 14:23:23 -04:00
Alex Rønne Petersen 99a678e72e [runtime] Don't change the native name of the main thread.
This makes it hard to differentiate multiple Mono processes in `top`.

We still report the name of the main thread as "Main" to the profiler.
2016-10-14 18:18:57 +02:00
Marek Safar fbc8e9daaf [System.ServiceModel] Hide only relevant exceptions in TcpChannelListener.cs 2016-10-14 16:24:21 +02:00
Marek Safar d70b715a96 [System] Use mono specific payload type for EndAccept of TCPListener 2016-10-14 16:24:21 +02:00
Alexander Köplinger a1af439223 Merge pull request #3763 from akoeplinger/move-type
[System.ServiceModel] Move a few types into System.IdentityModel
2016-10-14 16:17:39 +02:00
Niklas Therning 429eb3bb96 Merge pull request #3771 from henricm/enable-system-tests-on-windows
Enable System tests for PR builds on Windows
2016-10-14 14:29:31 +02:00
Henric Müller 081610e669 Enable System tests for PR builds on Windows 2016-10-14 10:09:25 +02:00
Alexis Christoforides 99a23f1200 Transfer the Mac SDK bockbuild profiles & resources inside the Mono repository.
This includes all distributable packages,patches etc. Toolchain packages remain part of the bockbuild repository.

The profiles were also renamed:
'mono-mac-release' -> 'mac-sdk'
'mono-mac-xamarin' -> 'mac-sdk-xamarin'
2016-10-14 03:48:28 -04:00
Alexis Christoforides 608f7c89b2 Added Bockbuild as a submodule 2016-10-14 03:48:28 -04:00
Marek Safar d19e5c42a5 [System.Xml] Update supported time formats for mobile version of XML deserializer. Fixes #42843 2016-10-14 09:10:17 +02:00
Marek Safar 398675d21a [System.Xml] Enable more tests 2016-10-14 09:10:17 +02:00
Henric Müller 20c72671c1 Merge pull request #3756 from henricm/named-pipe-alertable-on-windows
Making named pipe connects alertable on Windows
2016-10-14 08:48:39 +02:00
Vlad Brezae 0b65fb9d99 Merge pull request #3766 from BrzVlad/feature-default-conc
[sgen] Switch to default concurrent on desktop
2016-10-14 01:35:49 +03:00
Jon Purdy 72362aefea [sgen] Fix verify-before-allocs.
sgen_check_whole_heap_stw() calls sgen_stop_world(), which assumes the
GC lock is held.
2016-10-13 14:06:25 -07:00
Rodrigo Kumpera d0fb7a1240 Merge pull request #3761 from kumpera/fix-maccore-linking-regression
[icalls] Change get_bundled_machine_config to ICALL_EXPORT so maccore can link it.
2016-10-13 14:24:48 -04:00
Rodrigo Kumpera 85c73568b0 Merge pull request #3716 from vargaz/unbox-stobj-null
[jit] Add a small optimization for unbox.any+stobj called with a null…
2016-10-13 14:00:58 -04:00
Marek Safar 4d3402deed [System] SocketAsyncEventArgs::Dispose does not free any managed resources. Fixes #44757 2016-10-13 16:44:39 +02:00
Bernhard Urban a342bb00ca Merge pull request #3591 from directhex/mono_libdir_fallback
Handle relocatable libMonoPosixHelper.so when --libdir= isn't lib/
2016-10-13 16:39:38 +02:00
Martin Baulig 5109914276 [System]: Move MonoBtlsProvider.IsSupported() -> MonoTlsProviderFactory.IsBtlsSupported() (#3760)
* [System]: Move MonoBtlsProvider.IsSupported() -> MonoTlsProviderFactory.IsBtlsSupported().

Move the intern-call which is used to determine whether we're using BTLS out of MonoBtlsProvider
to allow the managed linker to eliminate the Mono.Btls.* classes when it's not supported.

* Fix Android build.

(cherry picked from commit 90699022b6)
2016-10-13 16:27:08 +02:00
Vlad Brezae 2b08b7c451 [tests] Select sgen major explicitly in tests
On configurations where we were only testing serial (using the default collector), we now explicitly test concurrent to put emphasis on it.
2016-10-13 17:06:59 +03:00
Vlad Brezae 74d6305ac7 [sgen] Enable concurrent gc by default on desktop
Linux (except android), MacOS and Windows.
2016-10-13 16:53:02 +03:00
Alexander Köplinger 213499eb63 Merge pull request #3762 from akoeplinger/fix-ftp-ipv6
[System] Add IPv6 support to FtpWebRequest
2016-10-13 13:48:40 +02:00
Johan Lorensson f458d55ec2 Merge pull request #3738 from lateralusX/jlorenss/win-api-family-support-libmonoruntime
Build libmonoruntime under none desktop Windows API family.
2016-10-13 12:47:29 +02:00
lateralusX 058f4dc12b Build libmonoruntime under none desktop Windows API family.
Initial work to build libmonoruntime under none desktop Windows API families.
2016-10-13 09:41:12 +02:00
Rodrigo Kumpera 1c7fa71a4a [icalls] Multiple fixes to get_bundled_machine_config.
Enviroment::get_bundled_machine_config icall should be ves_icall_System_Environment_get_bundled_machine_config.

Mark all icalls doing get_bundled_machine_config as ICALL_EXPORT so maccore can link them in/out.
2016-10-12 15:30:11 -07:00
Alexander Köplinger 34f6aab87e [System.ServiceModel] Move a few types into System.IdentityModel
They were moved there in MS.NET 4.5. Added typeforwards so existing references continue to work.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=35662
2016-10-12 23:20:57 +02:00
Rodrigo Kumpera b40bfda0e2 Merge pull request #3755 from kumpera/async-reader-hardering-2
[System] Another round of hardening around disposal of Process while doing async reads.
2016-10-12 12:46:46 -04:00
Alexander Köplinger d91796e39c [System] Add tests for IPv6-enabled FtpWebRequest 2016-10-12 18:43:47 +02:00
Alexander Köplinger aebed51257 [System] Add IPv6 support to FtpWebRequest
When connecting to an FTP server we weren't handling the RFC2428
extension to the FTP protocol which allows connections over IPv6
for the data channel.

We'd try to connect via IPv4 and the server would return an error
saying that this protocol is not supported.

The fix is to add handling for the protocol extension, namely
to use EPSV (for passive FTP) or EPRT (for active FTP) when opening
the data channel and send/parse the IPv6 addresses.

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

Note: we're now using the IP address of the the control channel we connected to for the
data channel instead of the address that is returned by the server in the FTP response message.
The reason is that for EPSV there's no IP returned by the server, and it should be
more reliable for normal PASV as well since the server might not know the
correct external address. This is also what MS does in referencesource.
2016-10-12 18:43:46 +02:00
Marek Safar b57f33ba97 [mcs] Handle interpolated strings with escaped quotes. Fixes #45286 2016-10-12 17:31:47 +02:00
Alexander Köplinger 26f23dbde3 [System] Make sure FtpWebRequest processing happens in a background thread
We don't want it to block app shutdown.
2016-10-12 16:16:29 +02:00
Marek Safar 224985a156 Bump ikvm for mcs fixes 2016-10-12 15:51:49 +02:00
Henric Müller bcbe894d3d Enable System.Runtime.Remoting tests on Windows 2016-10-12 15:18:08 +02:00
Henric Müller 0aed701c96 Making named pipe connects alertable on Windows
This fix makes sure that an aborted thread will wake up
a blocking named pipe connect.
2016-10-12 15:07:04 +02:00
Marek Safar 77541d8c1f Merge pull request #3754 from marek-safar/rs-sockets
[System] More Socket types from referencesource
2016-10-12 14:53:16 +02:00
Marek Safar 095701df57 [Mono.Data.Sqlite] Regression introduced by 04162ffbbd which changed _datetimeFormats order. Fixes #40603 2016-10-12 12:06:30 +02:00
Marek Safar eb76ec5782 [Mono.Data.Sqlite] Enable more tests 2016-10-12 12:06:30 +02:00
Vlad Brezae c866c3eefb Merge pull request #3749 from BrzVlad/fix-mips-fix
[mips] Fix mips
2016-10-12 11:56:10 +03:00
Niklas Therning 6271985201 Merge pull request #3753 from henricm/enable-windowsbase-tests-on-windows
Enable WinowsBase tests on Windows
2016-10-12 10:40:09 +02:00
Marek Safar 092279ecd6 [System] Warnings cleanup 2016-10-12 10:19:18 +02:00
Marek Safar c79b08d83c [System] More Socket types from referencesource 2016-10-12 10:14:03 +02:00
Marek Safar e95a1d4a00 Merge pull request #3750 from marek-safar/socket
[System] More Socket pieces from referencesource
2016-10-12 10:09:18 +02:00
Vlad Brezae 95fd910972 [mips] Disable div with mul on 32bit mips 2016-10-12 00:19:48 +03:00
Zoltan Varga 6332448df8 [llvm] Avoid generating invalid IL for valuetypes+vphi+volatile variables in gsharedvt methods. Fixes part of #45270. 2016-10-11 16:04:00 -04:00
Alexander Köplinger 2fdbce718b [corlib] Fix UdpClient tests on watchos
They were reenabled in 1fa85ad4af,
but UdpClient throws PlatformNotSupportedException on watchos.
2016-10-11 21:25:50 +02:00
Rodrigo Kumpera a5fc1343a3 Merge pull request #3715 from kumpera/fix-44707
[corlib] Don't load the machine config file if it's missing. Fixes #44707
2016-10-11 14:31:04 -04:00
Rodrigo Kumpera 879d682775 [System] Another round of hardening around disposal of Process while doing async reads.
This round ensures stream and decoder are protected from dispose and that we properly
bail out to the EOS case.
2016-10-11 11:25:51 -07:00
Martin Baulig fe2dedafba [cert-sync]: Change back to using the '--btls' argument.
Without arguments, 'cert-sync' now operates on the old certificate store
again, like it was before.  To test BTLS, you need to explicitly run it
with '--btls'.

(cherry picked from commit 46379bda6d)
2016-10-11 18:14:51 +02:00
Alexander Köplinger f7b73f070a Merge pull request #3745 from akoeplinger/fix-bug44937
[io-layer] Correctly detect a PE32+ assembly as managed when starting process
2016-10-11 17:28:08 +02:00
Marek Safar 2ed3257a23 [System.ServiceModel] Split unreliable tests 2016-10-11 16:56:16 +02:00
Marek Safar bb0a415101 [System] Set more error details on failed https proxy connect. Fixes #45108 2016-10-11 16:45:22 +02:00
Marek Safar 34fd8d0ff7 [mono] Fixes hardcoded stack limit in EnsureSufficientExecutionStack check 2016-10-11 16:34:14 +02:00
Marek Safar de10cef32c [System] More Socket pieces from referencesource 2016-10-11 15:45:53 +02:00
Henric Müller cdf9d5103b Enable WinowsBase tests on Windows 2016-10-11 14:37:14 +02:00
Henric Müller b1e7cf18a9 Merge pull request #3662 from henricm/fix-windowsbase-on-win
WindowsBase zlib, ZipSharp and Package fixes for Windows
2016-10-11 14:02:10 +02:00
Henric Müller fd76523f6a Making sure stream is closed when exception is thrown
Stream will never be closed if we throw exception in Open
which leads to file being locked in Windows and that we
leak file handles.
2016-10-11 13:25:48 +02:00
Henric Müller 6676f790a8 Setting Culture to en-us for ToStringTest 2016-10-11 13:25:29 +02:00
Henric Müller fe5fceab9c Make ZipSharp work on Windows
This patch adds the zlib functions needed by ZipSharp to the VS
MonoPosixHelper.def export file.

This patch also changes the ZipSharp code to use different code paths
depending on the size of the C long type on the underlying platform. On
gcc/clang the C long type follows the bitness of the targeted architecture,
it's 32-bit on 32-bit systems and 64-bit on 64-bit systems. With the VS
compiler however, the C long type is always 32-bit regardless of the target
architecture. zlib and minizip uses C long in a number of different function
signatures and structs.
2016-10-11 13:09:15 +02:00
Alexander Köplinger 0f3d08adfb Merge pull request #3746 from ntherning/fix-SocketResponder-on-windows
Fix SocketResponder on Windows
2016-10-11 12:22:37 +02:00
Marek Safar 528e5d2ef4 Merge pull request #3747 from marek-safar/updclient
UpdClient from referencesource
2016-10-11 11:23:58 +02:00
Vlad Brezae ea0e95eec1 [mips] Add missing define 2016-10-10 23:27:52 +03:00
Vlad Brezae bd25dd17d8 [mips] Don't assert when decomposing longs
There is no point in asserting if we encounter an unhandled long op. These ops may still get removed, if emulated later on, or maybe from other passes. Asserting happens as a last resort when emitting the native code for the method.
2016-10-10 23:20:15 +03:00
Alexander Köplinger dac829dbe9 [corlib] Add missing constructors to RNGCryptoServiceProvider on monotouch
Those were missed in cb46f78eef because there's a separate
implementation for monotouch in an unrelated file.
2016-10-10 20:13:55 +02:00
Martin Baulig 83aa0a6f39 [System]: Fix a typo in X500DistinguishedName.AreEqual().
(cherry picked from commit 1ac809aad7)
2016-10-10 18:30:39 +02:00
Alexander Köplinger 8d1a65128a [btls] Use UTC for the Unix epoch in the managed BTLS code (#3702)
The epoch is specified as being in UTC, but the DateTime(int, int, int) constructor
creates a DateTime with an 'Unspecified' timezone, which could lead to problems later on.
2016-10-10 18:03:39 +02:00
Martin Baulig bc8582c84d [BTLS]: Correctly handle certificates with negative serial numbers. (#3719)
In mono_btls_x509_get_serial_number(), first call i2c_ASN1_INTEGER()
which takes care of padding and computing the 2s complement for negative
numbers, then reverse the buffer.
(cherry picked from commit 1a55680bfa)
2016-10-10 18:03:00 +02:00
Marek Safar e0be7efd61 [System.Core] Remove unused files 2016-10-10 17:39:33 +02:00
Niklas Therning 9e4a4ff90e Fix SocketResponder on Windows
There seems to be a race in some tests in the System test suite that use
SocketResponder on Windows. Some tests fail with an exception that the socket
has been closed before they get a chance to see the response sent by the
SocketResponder. The same happens occasionally when using SocketResponder on
.NET. This patch changes the order of the Socket.Shutdown() calls and adds a
Socket.Receive() before Shutdown() is called to give the sender a chance to
actually send any data before the responder shuts down and closes its side of
the connection.
2016-10-10 17:06:43 +02:00
Marek Safar 1fa85ad4af [System] Enable more tests 2016-10-10 17:04:31 +02:00
Marek Safar 97901a252d [System] UdpClient from referencesource 2016-10-10 16:52:03 +02:00
Marek Safar 54900936b6 [System.Data] Use same socket family for data receiver as it has its client. Fixes #44624 2016-10-10 16:25:17 +02:00
Vlad Brezae 38f607b059 Merge pull request #3740 from Unity-Technologies/gc-options-command-line
GC debug and params command line options
2016-10-10 16:43:54 +03:00
Alexander Köplinger 68bcbb4b77 [io-layer] Correctly detect a PE32+ assembly as managed when starting process
We weren't checking whether a PE file is in PE32 or PE32+ format,
causing us to use the PE32 offsets on the newer format as well.

This means that using Process.Start() on a managed assembly didn't
always work when a PE32+ file was in play. Such a file is created
when targeting x64 e.g. via the -platform:x64 csc.exe/mcs option.

The reason why we probably didn't notice until now is that in an
assembly produced by mcs there happens to be some data at the PE32
CLR header offset even in a PE32+ file, causing the check to "work".

This doesn't apply to csc.exe/roslyn though and so we couldn't
execute those assemblies via Process.Start() even though they're
perfectly managed. Since the .NET Core project.json toolchain
produces x64-targeted assemblies by default more people ran into
the issue trying to run those on Mono: https://github.com/cake-build/cake/issues/1247

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

PE/COFF spec at https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx
2016-10-10 14:00:07 +02:00
Alexander Köplinger 7ca51073c6 Merge pull request #3739 from akoeplinger/add-more-netstandard-api
[bcl] Expose a few more APIs on mobile to match with netstandard
2016-10-10 13:39:06 +02:00
Alexander Köplinger cb46f78eef [bcl] Expose a few more APIs on mobile to match with netstandard
See https://github.com/dotnet/standard/issues/47.
2016-10-10 13:35:33 +02:00
Niklas Therning 082057e3d7 Merge pull request #3653 from ntherning/alertable-socket-wait
Make blocking socket calls on Windows interruptible
2016-10-10 13:30:31 +02:00
Niklas Therning 50d7cf0daf Merge pull request #3744 from ntherning/enable-system-security-tests-in-pr-builds-on-windows
Enable System.Security tests in PR builds on Windows
2016-10-10 13:20:35 +02:00
Niklas Therning 46a3201f93 Enable System.Security tests in PR builds on Windows 2016-10-10 10:27:41 +02:00
Alex Rønne Petersen 044afdad5c Merge pull request #3742 from alexrp/profiler-c9-fixes
[profiler] Start the helper thread before the writer thread.
2016-10-08 13:23:10 +02:00
Alex Rønne Petersen 2ab8d8b692 [profiler] Start the helper thread before the writer thread.
This fixes a regression introduced in 0db428169a
which caused the profiler to not report the correct command port in the file
header on startup.
2016-10-08 11:55:31 +02:00
Zoltan Varga 9a3f1672d2 [SRE] Set the wastypebuilder flag on completed generic param builder … (#3712)
* [SRE] Set the wastypebuilder flag on completed generic param builder classes to remove a workaround from mono_type_get_object_checked ().

* [SRE] Remove unused verify_safe_for_managed_space () function.
2016-10-07 20:43:04 -04:00
Zoltan Varga c47a2991f9 [llvm] Make sure the initlocals_bb is not treated as part of a try block if one starts at IL offset 0, since it could mess up the control flow if it contains calls. (#3718) 2016-10-07 20:42:32 -04:00
Alexander Köplinger a201b2ac42 Merge pull request #3741 from akoeplinger/fix-aot-DoAssemblyResolve
[aot] Fix AppDomain.DoAssemblyResolve runtime invoke wrapper
2016-10-08 00:17:22 +02:00
Alexander Köplinger efd8c822c2 [aot] Fix AppDomain.DoAssemblyResolve runtime invoke wrapper
In https://github.com/mono/mono/pull/1528 the DoAssemblyResolve method was changed
from two parameters to three, but the code in aot-compiler.c was not updated to match.
2016-10-07 22:06:22 +02:00
Jonathan Chambers d602c64c2c Document --gc-debug and --gc-params command line options 2016-10-07 13:54:00 -04:00
Jonathan Chambers 3f234cb6ad Add --gc-params and --gc-debug command line options 2016-10-07 13:31:58 -04:00
Aleksey Kliger (λgeek) e1b0a37135 Merge pull request #3731 from lambdageek/dev-handles-gbmc
[runtime] System.Configuration.InternalConfigurationHost:get_bundled_machine_config  needs HANDLES
2016-10-07 13:13:44 -04:00
Niklas Therning 906bad4382 Merge pull request #3729 from ntherning/fix-failures-in-msbuild-tests-on-windows
Fix failures in MSBuild tests on Windows
2016-10-07 19:08:01 +02:00
Zoltan Varga 7de083be0b [runtime] Fix the blittable flag and the instance size for pointer types. Fixes #45131. (#3735) 2016-10-07 11:37:19 -04:00
Alexander Köplinger 8f181779a7 Merge pull request #3737 from akoeplinger/fix-babysitter
[ci] Set the env var in a new subshell to fix babysitter processing
2016-10-07 15:30:19 +02:00
Niklas Therning 149c4509f1 Fix failures in MSBuild tests on Windows 2016-10-07 15:29:04 +02:00
Marek Safar d3c8ea0191 Merge pull request #3727 from henricm/fix-system-web-on-windows
Fixes for System.Web to work on windows
2016-10-07 15:03:34 +02:00
Henric Müller 08367f0476 Enabling System.Web tests on Windows 2016-10-07 14:45:11 +02:00
Niklas Therning 53af53ae59 Make blocking socket calls on Windows interruptible
This second commit adds functions to socket-io.c which uses
WSAEventSelect()/WSAWaitForMultipleEvents() or overlapped I/O to make
potentielly blocking socket calls interruptible (alertable).
2016-10-07 14:30:28 +02:00
Henric Müller 33263bd790 Calling directly into Win API to get current process exe
On Windows the MonoToolsLocator tries to determine which mono.exe
to use by looking at the current process. Due to problems with
AppDomains and shadow copying (which happens in System.Web) we
could not use this approach. Instead we now call GetModuleFileName
directly using p-invoke to get the exe file of the running process.
This is only used when running on Windows.
2016-10-07 14:23:23 +02:00
Marek Safar 65162fe034 [System] Use default parsing rules for Uri.IsWellFormedUriString. Fixes #45129 2016-10-07 13:56:29 +02:00
Niklas Therning b612056c4e Make blocking socket calls on Windows interruptible
This first commit changes the signatures of the icalls for blocking socket
calls in Socket to propagate whether the socket call should block or not. This
is required since it's not possible on Windows through any native API to
determine whether a socket is in blocking or non-blocking mode.

This commit also adds the necessary RegisterForBlockingSyscall() guards to the
Socket.SendFile_internal() method which takes a WSABUF array. Without this
calls to this method won't be signaled when the Socket is closed.

This commit also fixes the error handling in the Socket.SendFile() method to
not rely on WSAGetLastError(). It's likely to have been overwritten between
when the error is generated and the WSAGetLastError() call from managed code.
2016-10-07 11:45:04 +02:00
Alexander Köplinger d622c39b89 [ci] Set the env var in a new subshell to fix babysitter processing
Setting the MONO_TLS_PROVIDER env var in the testing script makes it opaque to the
babysitter and other processing scripts. By setting it in a new subshell we can
ensure that the scripts see the whole invocation.
2016-10-07 11:08:15 +02:00
Rodrigo Kumpera ff4bc7c445 Merge pull request #3730 from kumpera/async-reader-dispose-hardening
[System] Add some hardening when disposing a AsyncStreamReader as it will have things happening concurrently.
2016-10-06 18:53:15 -04:00
Rodrigo Kumpera bd61765189 [corlib] RemotingConfiguration now try to use the bundled machine.config first. 2016-10-06 15:04:48 -07:00
Aleksey Kliger (λgeek) a4c8184708 Merge pull request #3660 from lambdageek/bug-42271
[coop] Switch to GC SAFE for backtrace() and backtrace_symbols()
2016-10-06 17:53:33 -04:00
Aleksey Kliger 636ba50ff7 [runtime] give get_bundled_machine_config ves_icall_Class_Method-style names 2016-10-06 16:58:46 -04:00
Aleksey Kliger 4315e43278 [runtime] System.Configuration.InternalConfigurationHost:get_bundled_machine_config
needs HANDLES

The method (which also goes by
System.Configuration.DefaultConfig:get_bundled_machine_config) was
converted to use coop handles earlier, but we missed this declaration.
2016-10-06 16:35:55 -04:00
Rodrigo Kumpera ddfb6bab08 [System] Add some hardening when disposing a AsyncStreamReader as it will have things happening concurrently. 2016-10-06 13:19:59 -07:00
Zoltan Varga cb17a4f8fd [SRE] Fixup the tokens in subtypes too. (#3721) 2016-10-06 16:12:23 -04:00
Niklas Therning 67f9c76caa Merge pull request #3725 from ntherning/fix-symbolicate-tests-stack-trace-diff-on-windows
Fix symbolicate tests stack trace diff on Windows
2016-10-06 20:04:32 +02:00
Aleksey Kliger c033a02e8a [mempool] Fix indentation in mono_backtrace () 2016-10-06 13:54:40 -04:00
Aleksey Kliger b1e13dd3c9 [coop] Switch to GC SAFE for backtrace() and backtrace_symbols()
Fixes [#42271](https://bugzilla.xamarin.com/show_bug.cgi?id=42271)
2016-10-06 13:54:39 -04:00
Marek Safar 0a515cf13b [corlib] Add ValueTuple 2016-10-06 17:52:23 +02:00
Niklas Therning c467c938dd Fix symbolicate tests stack trace diff on Windows
The symbolicate tests compare stack traces generated by the mono-symbolicate
tool against expected stack traces. The expected stack trace files have been
preprocessed to remove absolute paths and the Makefile does the same with the
output from the tool. However, the preprocessing doesn't take different
directory separator characters into account. This patch adds a 'tr' command to
the Makefile which converts \ -> / before the absolute paths are filtered out
from the actual output from the tool to make the comparison succeed on Windows
as well.
2016-10-06 14:22:49 +02:00
Henric Müller 629da62c52 Ignoring CR in WebControls tests 2016-10-06 11:20:28 +02:00
Johan Lorensson 390697c8b2 Merge pull request #3707 from lateralusX/jlorenss/win-api-family-support-libmonoutils
Build libmonoutils under none desktop Windows API family.
2016-10-06 09:07:41 +02:00
Niklas Therning 5022f7de41 Merge pull request #3720 from ntherning/fix-monodoc-tests-on-windows
Fix monodoc tests on Windows
2016-10-06 08:40:30 +02:00
Zoltan Varga 6ead72475f Fix a typo. 2016-10-05 17:59:29 -04:00
Rodrigo Kumpera 57d37f690e Merge pull request #3714 from kumpera/fix_process_stream_dispose
[System] Fix Process::Dispose resource leak due to RS import.
2016-10-05 14:54:41 -07:00
Rodrigo Kumpera 67d44f8ebf [System] Dispose all streams in Process::Close if they were not exposed to the user. Fixes a RS import regression.
RS takes the stance that redirected streams should not be closed by the Process class because they might
be referenced from the outside.

That would be ok if it was true. If you use Process::BeginOutputReadLine, the output stream becomes inaccessible
with no way to dispose them by any mean but GC.Collect. You get an exception when accessing Process::StandardOutput
once async reading starts.

This change addresses the case where the streams are not accessible. This is tracked by the *StreamReadMode variables
that are set on stream getters or Begin*ReadLine.
2016-10-05 14:51:01 -07:00
Zoltan Varga 69045343ca [jit] Use MONO_INS_IS_PCONST_NULL () macro in more places. 2016-10-05 12:22:33 -04:00
Marek Safar 73e95c3863 [System.Net.Http] Wrap certain exceptions into HttpRequestException. Fixes #44978 2016-10-05 17:56:56 +02:00
Aleksey Kliger (λgeek) 6dd95a6fdf Merge pull request #3684 from lambdageek/dev-monoerror-poolbox
[runtime] Use boxed MonoError for class failure.
2016-10-05 11:09:49 -04:00
Niklas Therning 8fcad5b4bd Fix monodoc tests on Windows
These tests are sensitive to differences in line endings between Windows and
other platforms. This patch changes the diff commands used on Windows to
ignore changes in whitespaces at end of lines.
2016-10-05 16:40:43 +02:00
Johan Lorensson e09aab25bd Merge pull request #3692 from lateralusX/jlorenss/win-api-family-support-libmono
Build libmono under none desktop Windows API family.
2016-10-05 16:10:10 +02:00
Marek Safar 7ddb079a47 [mcs] Don't report version mismatch error for FX assemblies 2016-10-05 15:02:44 +02:00
Alexander Köplinger 7d8ef14d5b Merge pull request #3709 from rolfbjarne/linker-mark-nested-types
[linker] We need to mark nested types even if the declaring type isn't marked.
2016-10-05 13:51:00 +02:00
Alexander Köplinger a394a0e9b6 [ci] Test System.dll with both the legacy and btls TLS provider 2016-10-05 13:19:06 +02:00
Martin Baulig dd03bb0abe [BTLS]: Certificate cleanups and fixes. (#3706)
* [BTLS]: Allow fallback to MX.X509Certificate in X509CertificateImplBtls.

* [BTLS]: Fix X509Certificate2.MonoCertificate.

* X509Certificate2Impl.FallbackImpl: make abstract.

* X509Helper2.GetMonoCertificate(): new internal helper method.

* X509Certificate2.MonoCertificate: use X509Helper2.GetMonoCertificate().
  This is only used by X509ChainImplMono; we should investigate whether we
  could implement the missing APIs in BTLS.

* [BTLS]: Fully implement X509CertificateImplBtls.Import() and use correct semantics.

.NET's X509Certificate2.Import() uses several implicit fallbacks which we previously
did not handle in BTLS.

* you may provide a (unused) password when importing an unencrypted PKCS#8.

* when using null as password, it will attempt to use string.Empty if importing
  without password fails.

* [BTLS]: Implement X509CertificateImplBtls.PrivateKey.

* [BTLS]: Implement X509CertificateImplBtls.Export().

* [BTLS]: Implement X509CertificateImplBtls.Verify().

* [BTLS]: Fix X500DistinguishedName quoting.

* MonoBtlsUtils: don't quote special chars in UTF-16 strings.

* X500DistinguishedName: don't decode raw data when passed in a name.

* [ci] Test System.dll with both the legacy and btls TLS provider

* [ci] Only run the additional btls System.dll test run on OSX for now

Otherwise we might run it on platforms where btls isn't supported yet and get errors.

(cherry picked from commit 9638ee9ece)
2016-10-05 13:07:21 +02:00
Marek Safar f2e0fc3f7f [System.Net.Htpp] Add test for large content range headers 2016-10-05 10:18:09 +02:00
Cinerar fe6fb22691 Nowdays Content-Range From could be much more than 2147483647 2016-10-05 10:16:14 +02:00
Zoltan Varga 952a8d634d [jit] Add a small optimization for unbox.any+stobj called with a null on the stack. 2016-10-04 23:51:58 -04:00
Rodrigo Kumpera 10aae2da45 [corlib] Don't load the machine config file if it's missing. Fixes #44707 2016-10-04 18:16:23 -07:00
Vlad Brezae d6f7d6199c Merge pull request #3705 from BrzVlad/fix-sgen-internal-alloc
[sgen] Fix block size computation for allocation size
2016-10-05 03:30:26 +03:00
Alexander Köplinger ead4213eaf Merge pull request #3697 from directhex/fix-make-dist-missing-basic.exe
When basic.exe isn't in DISTFILES, it gets excluded from `make dist`
2016-10-05 01:23:36 +02:00
Alexander Köplinger 7af506b0c3 Merge pull request #3711 from akoeplinger/fix-fullaot-tests
Fix two test failures in the FullAOT Jenkins job
2016-10-05 00:55:07 +02:00
Rodrigo Kumpera d60084ccdc [runtime] Don't do logging from a signal handler. It's not signal safe.
I found this while trying to MONO_LOG_LEVEL=debug an process way bug and the removed log statements
would hang mono in a matter of seconds.
2016-10-04 15:53:36 -07:00
Aleksey Kliger 3a9e18e540 [MonoError] Don't overwrite computed TypeLoadException message with empty string
Fixes [#44729](https://bugzilla.xamarin.com/show_bug.cgi?id=44729).
2016-10-04 17:24:05 -04:00
Aleksey Kliger 0a73f4eef4 [loader] Add descriptive error messages to class failure.
In cases where a class fails to load due to a related class failure,
extract the message from the related failure.
2016-10-04 17:08:15 -04:00
Aleksey Kliger e77ba5ed3d [runtime] Change how class failure is represented.
Use a single bit MonoClass::has_failure to represent whether a class has
failed.  Store detailed error message in MONO_CLASS_PROP_EXCEPTION_DATA property
in the MonoImage of the class.
2016-10-04 17:08:12 -04:00
Alexander Köplinger ff8af9c12b Fix two test failures in the FullAOT Jenkins job
Disable WebOperationsContextTest.Current like on monotouch, it relies on dynamic code generation.
The namedmutex-destroy-race.cs runtime test doesn't work on mobile_static since we don't have named Mutexes.
2016-10-04 22:25:42 +02:00
Alexander Köplinger 844b800098 Add mono-package-runtime to EXTRA_DIST
The file was added in 15b6ef60e4
2016-10-04 20:25:53 +02:00
Marek Safar a5971ec78c [corlib] Enable more RuntimeHelpers tests 2016-10-04 18:53:51 +02:00
Rolf Bjarne Kvinge 2d5815183c [linker] We don't need to mark nested types more than once. 2016-10-04 18:52:26 +02:00
Alexander Köplinger f16c0866a8 Merge pull request #3693 from rolfbjarne/watchos-simplify-http-message-handler-selection
[System.Net.Http] Simplify default http message handler for watchOS since there's only one valid value.
2016-10-04 18:39:18 +02:00
Alexander Köplinger 9ca4e133ed Merge pull request #3704 from rolfbjarne/watchos-servicepointmanager
[System] Add back a few ServicePointManager properties that can be used by multiple networking stacks.
2016-10-04 18:35:48 +02:00
Rolf Bjarne Kvinge 35cbe54378 [linker] We need to mark nested types even if the declaring type isn't marked. 2016-10-04 18:16:53 +02:00
Aleksey Kliger 016b3b9a06 [loader] Make mono_class_get_failure static in class.c 2016-10-04 11:21:53 -04:00
Aleksey Kliger 5fbda1ee6e [loader] Add mono_class_set_type_load_failure ()
- Hide mono_class_set_failure as a static function in class.c
- Use a MonoErrorBoxed to represent a MONO_EXCEPTION_TYPE_LOAD.
2016-10-04 11:21:53 -04:00
Aleksey Kliger e45f8166ba [loader] Use MonoErrorBoxed for mono_class_set_failure (..., MONO_EXCEPTION_INVALID_PROGRAM, ...)
Use a MonoErrorBoxed to represent an invalid program class failure.
2016-10-04 11:21:53 -04:00
Aleksey Kliger 6c86e9794d [MonoError] add mono_error_vset_type_load_class function
A variant of mono_error_set_type_load_class that takes a va_list
argument instead of varargs.
2016-10-04 11:21:53 -04:00
Aleksey Kliger 1392837288 [MonoError] Add MonoErrorBoxed for mempool-stored errors.
The usual MonoError is suitable as a short-lived stack-allocated error
with a lifetime confined to a function call.
Internally it performs allocations using g_malloc/g_free.

The MonoErrorBoxed is a mempool-allocated error whose lifetime is tied
to the lifetime of a MonoImage.

We provide two operations:

1. MonoErrorBoxed* mono_error_box (MonoError *ierror, MonoImage *image);

  Creates a new boxed error in the given mempool from MonoError.
  It does not alter ierror, so you still have to clean it up with
  mono_error_cleanup or mono_error_convert_to_exception or another such function.

2.   gboolean mono_error_set_from_boxed (MonoError *oerror, MonoErrorBoxed *from_box);

  Sets the error condition in the oerror from the contents of the given
  boxed error.  Does not alter the boxed error, so it can be used in a
  future call to mono_error_set_from_boxed as needed.  The oerror
  should've been previously initialized with mono_error_init, as usual.
2016-10-04 11:21:53 -04:00
Vlad Brezae 5a13c41a36 [sgen] Fix block size computation for allocation size
The block size for a slot size is the minimum block size that can fit two slots. Make sure the computation accounts for the fact that even though a slot size might fit twice in the block, it still has to be allocated at aligned addresses, so it can end up using a higher block size.

Fixes 44922.
2016-10-04 18:18:49 +03:00
Aleksey Kliger (λgeek) 633af27d68 Merge pull request #3686 from lambdageek/dev-format-printf
Add MONO_ATTR_FORMAT_PRINTF macro
2016-10-04 10:05:33 -04:00
lateralusX 72a43d3355 Build libmono under none desktop Windows API family.
Initial work to build libmono under none desktop Windows API families.
2016-10-04 15:36:00 +02:00
lateralusX 5233231e65 Build libmonoutils under none desktop Windows API family.
Initial work to build libmonoutils under none desktop Windows API families.
2016-10-04 14:45:43 +02:00
Jo Shields 6843f6d61d Add EXTRA_DIST listing all the files from btls
Apparently there's no way to get CMake to just spit out its own uncached variables, so we can't do this programatically.
2016-10-04 12:27:01 +01:00
Jo Shields 503b18e07f Remove useless BTLS_DEPS variable 2016-10-04 10:48:07 +01:00
Rolf Bjarne Kvinge e41db94cb1 [System] Add back a few ServicePointManager properties that can be used by multiple networking stacks. 2016-10-04 11:13:11 +02:00
Niklas Therning 1e7e96e941 Merge pull request #3695 from ludovic-henry/fix-thread-test
[tests] Fix p/invoke test on windows
2016-10-04 10:35:14 +02:00
Zoltan Varga a6ea12ab4c [sdb] Avoid adding the first file name in the debug info to the list of file names if a method has no seq points. Fixes #44982. (#3696) 2016-10-03 23:10:31 -04:00
Alex Rønne Petersen 95117516f7 Merge pull request #3700 from alexrp/profiler-c9-fixes
[profiler] Fix a regression that caused all buffers to have a zero thread ID.
2016-10-04 04:58:37 +02:00
Alex Rønne Petersen 4a2dc82a42 [profiler] Use macro constants instead of passing a bunch of bools. 2016-10-04 04:28:26 +02:00
Alex Rønne Petersen 00754f933c [profiler] Update a stale comment. 2016-10-04 04:07:27 +02:00
Alex Rønne Petersen a5f75c0462 [profiler] Add some asserts. 2016-10-04 04:07:26 +02:00
Alex Rønne Petersen 5a5875bac0 [profiler] Simplify send_log_unsafe (). 2016-10-04 04:07:25 +02:00
Alex Rønne Petersen a081b99c55 [profiler] Fix a regression that caused all buffers to have a zero thread ID.
This was introduced in 928b840dad.
2016-10-04 04:07:18 +02:00
Zoltan Varga 4df80bc164 [SRE] Remove more dead code. 2016-10-03 22:00:31 -04:00
Zoltan Varga 0c11be9585 [SRE] Remove more unused icall declarations. 2016-10-03 21:17:25 -04:00
Zoltan Varga cea0756ebe [SRE] Remove more unused icalls. 2016-10-03 20:45:42 -04:00
Alexander Köplinger 65c849b377 [btls] Add missing icall definition for mono_btls_x509_revoked_get_revocation_date 2016-10-04 02:39:01 +02:00
Zoltan Varga cf3c15b416 [SRE] Small code cleanup. 2016-10-03 20:16:10 -04:00
Zoltan Varga 7efe967c24 [SRE] Remove unused icall from inside a DISABLE_REFLECTION_EMIT block. 2016-10-03 19:33:55 -04:00
Alex Rønne Petersen a49db8f1c6 Merge pull request #3698 from alexrp/profiler-c9-fixes
More C9 profiler fixes
2016-10-04 00:12:34 +02:00
Zoltan Varga 30c55b9343 [SRE] Delay the creation of the MonoClass for dynamic types until CreateType () is called. Remove some icalls. (#3687) 2016-10-03 17:04:34 -04:00
Ludovic Henry 607278bf6b [tests] Fix thread-native-exit test on windows 2016-10-03 22:25:51 +02:00
Martin Baulig eb0d26e11f [metadata]: Unconditionally enable ves_icall_Mono_Btls_Provider_IsSupported().
The MonoBtlsProvider.IsSupported() icalls ves_icall_Mono_Btls_Provider_IsSupported()
needs to be available whether BTLS is available or not because it is used at
runtime to decide whether or not to enable BTLS.

(cherry picked from commit 7b2a96fbd3)
2016-10-03 22:04:56 +02:00
Alex Rønne Petersen d88f911a87 [profiler] Fix BYTE_SIZE macro conflict on OS X. 2016-10-03 22:02:46 +02:00
Alex Rønne Petersen 820faaee2d [profiler] Fix PROF_TLS_FREE () on pthread TLS systems. 2016-10-03 21:53:59 +02:00
Rodrigo Kumpera 2947739179 [profiler] Fix the build on Android (missing fcntl.h include). 2016-10-03 21:47:52 +02:00
Martin Baulig 7129235d3c Oops, actually correctly revert that commit.
(cherry picked from commit 04379d5d73)
2016-10-03 21:22:00 +02:00
Martin Baulig 0debd082cc [System]: Temporarily switch the default TLS provider back to "legacy".
Also revert the Jenkins commit in c462f4e603.

(cherry picked from commit cd1b0b8edf)
2016-10-03 21:16:09 +02:00
Jo Shields bfa1a309b9 When basic.exe isn't in DISTFILES, it gets excluded from make dist 2016-10-03 20:08:17 +01:00
Marek Safar 67a454ffab [Mono.Debugger.Soft] Move TypeLoadClass types to new file to improve testing 2016-10-03 18:36:54 +02:00
Rolf Bjarne Kvinge 0c6036bcdf [System.Net.Http] Simplify default http message handler for watchOS since there's only one valid value. 2016-10-03 18:22:12 +02:00
Alexander Köplinger 993f805cb7 [ci] Temporarily switch back to legacy TLS provider 2016-10-03 17:10:49 +02:00
Marek Safar 0034b230e8 [Mono.Debugger.Soft] Tweak ClassLocalReflection test 2016-10-03 16:10:57 +02:00
Niklas Therning 2107695a7a Merge pull request #3691 from ntherning/enable-tests-in-pr-builds-on-windows
Enable tests in Windows PR builds
2016-10-03 14:56:26 +02:00
Rolf Bjarne Kvinge 5780d872ad [System*] Throw a PlatformNotSupported exception when using the managed networking stack on watchOS. (#3683)
* [System.Data] System.Data.SqlClient is not supported in watchOS.

System.Data.SqlClient is not supported in watchOS, because it depends on a
working managed networking stack, which we don't have on watchOS.

* [System] Throw PlatformNotSupportedExceptions in the networking stack for watchOS.

* [System] Don't reference/build Mono.Security.dll when building for watchOS.

This means we can't build Mono.Data.Tds.dll either, since it uses
Mono.Security.dll extensively. In any case Mono.Data.Tds.dll is useless
without a working networking stack, and since it's a Mono-only dll (i.e. not
part of netstandard or facades), just remove the entire assembly from the
watchOS profile.

System.Security.dll uses Mono.Security.dll as well, but the required classes
are available inside mscorlib.dll (as internal classes), so just open up
mscorlib internals to System.Security.dll.

* [System] Update tests after API change for watchOS.

* [System.Data] Update tests after API change in watchOS.

* Revert "Fix build break from 81fb20737f810def6dde88d87a1b2f23cdb736c3"

This reverts commit f4475ff013.

* Fix missing trailing newline in monotouch_watch_System.dll.sources 

It breaks the build on Linux if the newline is missing.
2016-10-03 13:00:16 +02:00
Niklas Therning 72c700801d Enable tests in Windows PR builds
Also run the test suite in Windows PR builds. We disable all the test suites
in Windows PR builds that are known to fail.
2016-10-03 11:10:42 +02:00
Marek Safar 166830635e [System] Server property of HttpWebResponse should never be null 2016-10-03 09:38:23 +02:00
Alexander Köplinger aad01ff4db [btls] Fix i386 build on Linux by setting -arch on Darwin only
The -arch option is an Apple extension, it caused failures on i386 Linux: "unrecognized command line option '-arch'"
2016-10-03 00:33:15 +02:00
Alex Rønne Petersen 16e6b7770f Merge pull request #3689 from alexrp/profiler-c9-fixes
Profiler fixes for Cycle 9 (#2)
2016-10-02 21:59:26 +02:00
Alex Rønne Petersen fa4ea4cc55 [profiler] Fix GC finalize object end event not getting invoked. 2016-10-02 21:55:29 +02:00
Alex Rønne Petersen 00b1ceb8ff Revert "[domain] Report domain unloads to the profiler when finalizing the domain."
This reverts commit c8b2029080.

This caused ordering problems with app domain events: https://bugzilla.xamarin.com/show_bug.cgi?id=44552

Conflicts:

	mono/metadata/gc.c
2016-10-02 21:53:09 +02:00
Alex Rønne Petersen 30754eef7e Merge pull request #3688 from alexrp/profiler-c9-fixes
Profiler fixes for Cycle 9
2016-10-02 21:10:58 +02:00
Alex Rønne Petersen 958919f568 [profiler] Bump profiler version to v1.1. 2016-10-02 19:03:18 +02:00
Alex Rønne Petersen c42acf8bf2 [profiler] Don't emit enter/leave events in onlycoverage mode. 2016-10-02 19:03:09 +02:00
Alex Rønne Petersen 61d6684f27 [profiler] Add a nocounters option. 2016-10-02 18:56:27 +02:00
Alex Rønne Petersen cf076ebd1d [profiler] Address a couple of FIXMEs in the counters sampling code. 2016-10-02 18:56:17 +02:00
Alex Rønne Petersen d3ff7dca3e [profiler] Use eglib alloc/free functions everywhere. 2016-10-02 18:56:02 +02:00
Alex Rønne Petersen ffbf540457 [profiler] Warn if we can't detect the CPU count. 2016-10-02 18:55:50 +02:00
Alex Rønne Petersen 76c2b67207 [profiler] Use the native thread wrapper functions to manage threads. 2016-10-02 18:55:36 +02:00
Alex Rønne Petersen d78ba0e327 [utils/threads] Add and export a mono_native_thread_join () function. 2016-10-02 18:55:09 +02:00
Alex Rønne Petersen 7883db95e3 [utils/threads] Export all native thread functions. 2016-10-02 18:55:02 +02:00
Alex Rønne Petersen 36cb2ec977 [profiler] Access in_shutdown atomically. 2016-10-02 18:54:55 +02:00
Alex Rønne Petersen e998d8808f [profiler] Drop support for perf events on Linux. 2016-10-02 18:54:04 +02:00
Alex Rønne Petersen a6f95ab511 [utils/lfa] Add a missing #include to fix the profiler build. 2016-10-02 18:53:52 +02:00
Alex Rønne Petersen 3e9a0d4575 [profiler] Disable GC move events when allocation events are disabled.
They serve no purpose when allocation profiling is enabled, and just make log
files bigger than they have to be.
2016-10-02 18:53:36 +02:00
Alex Rønne Petersen b5205f797c [profiler] Clean up and improve the helper thread code.
* Don't invoke undefined behavior if an fd is >= FD_SETSIZE.
* Allow multiple command sockets.
* Close the command socket(s) on shutdown.
* Properly run cleanup logic on shutdown.
2016-10-02 18:53:20 +02:00
Alex Rønne Petersen 9127dfaf88 [profiler] Process requests in method_jitted (). 2016-10-02 18:53:00 +02:00
Alex Rønne Petersen a22f5779d2 [profiler] Remove the need to pass a MonoProfiler argument to some functions.
This is now available on the MonoProfilerThread structure.
2016-10-02 18:52:52 +02:00
Alex Rønne Petersen 1e4e265ba5 [profiler] Fix the way the profiler frees hazardous data on shutdown. 2016-10-02 18:52:08 +02:00
Alex Rønne Petersen 99af8b644b [profiler] Replace a check with an assert in coverage_filter (). 2016-10-02 18:51:36 +02:00
Alex Rønne Petersen 96f9415c5b [profiler] Add messages to most assertions. 2016-10-02 18:51:22 +02:00
Alex Rønne Petersen f9ad9d913c [profiler] Remove the ign_res () hack. 2016-10-02 18:51:08 +02:00
Alex Rønne Petersen 82f2c9bcca [profiler] Clean up the #include mess in mono-profiler-log.c.
Half of these aren't even needed - get rid of those. Sort the rest.
2016-10-02 18:51:00 +02:00
Alex Rønne Petersen b73e63c5dc [profiler] Remove mono_threads_attach_tools_thread () declaration.
We get this from mono-threads.h now.
2016-10-02 18:50:55 +02:00
Alex Rønne Petersen 9f7349c7c1 [profiler] Remove some broken, commented-out code from register_method_local (). 2016-10-02 18:50:48 +02:00
Alex Rønne Petersen 2a45034926 [profiler] assert () -> g_assert (). 2016-10-02 18:50:41 +02:00
Alex Rønne Petersen d4374ae1c3 [profiler] Always enable the helper thread.
We need it in all cases now that we use it to periodically flush all buffers.
The only platforms it was disabled on was NaCl, which we haven't bothered to
support in a while anyway.
2016-10-02 18:50:35 +02:00
Alex Rønne Petersen 99aa56a5b1 [profiler] Encapsulate some common logic in the ENTER_LOG/EXIT_LOG macros.
This also has the nice effect of reducing the amount of times we attempt to
take the reader lock. Now we take it and release it once for a single event.
2016-10-02 18:50:29 +02:00
Alex Rønne Petersen f802cbb584 [profiler] Add a missing deinit_thread () call to the helper thread. 2016-10-02 18:50:07 +02:00
Alex Rønne Petersen 51a03a7313 [profiler] Fix several race conditions in accessing MonoProfilerThread.buffer.
Only in very few situations is it okay to access this field without first
taking the reader lock or exclusive lock.

Fixes some crashes observed in the profiler stress tests.
2016-10-02 18:46:21 +02:00
Alex Rønne Petersen 4533cd91b2 [profiler] Don't flush empty log buffers. 2016-10-02 18:44:55 +02:00
Alex Rønne Petersen 348688ad75 [profiler] Add an extra assert. 2016-10-02 18:44:51 +02:00
Alex Rønne Petersen 4acc3dfeed [sgen] Always report object moves on the GC thread.
This avoids exposing the SGen worker threads through the profiler APIs. Doing
so had two main problems:

* It's easy for a user of the profiler API to accidentally mess with the state
  of the worker thread in all sorts of ways, which could break the GC.
* It's been a long-standing guarantee that any profiler API callback will be
  invoked on a thread that is, at the very least, attached to the runtime via
  the mono-threads infrastructure. This is not the case for SGen workers.

This fixes a deadlock in the log profiler when using major=marksweep-conc.
2016-10-02 18:44:41 +02:00
Alex Rønne Petersen bb1813cca6 [profiler] Rename decode.c to mprof-report.c. 2016-10-02 18:44:21 +02:00
Alex Rønne Petersen 5640531d0b [profiler] Rename proflog.{c,h} to mono-profiler-log.{c,h} for consistency with other profilers. 2016-10-02 18:44:12 +02:00
Alex Rønne Petersen f1c948536d [profiler] Remove utils.c/utils.h, move the code to proflog.c/decode.c, and clean it up.
* Drop support for fast/null timers.
* Use Mono runtime functions for getting the thread ID and allocating buffers.
2016-10-02 18:44:03 +02:00
Alex Rønne Petersen a2f06128c6 [acceptance-tests] Improve the profiler-stress test runner.
* Emit an NUnit test report file.
* Set a timeout of 6 hours per test.
* Do a thread dump for timed-out tests.
* Don't print stdout/stderr for passing tests.
2016-10-02 18:30:34 +02:00
Alex Rønne Petersen 77bf968f69 [ci] Bump the timeout of the profiler stress test suite to 24 hours. 2016-10-02 18:30:25 +02:00
Alex Rønne Petersen e9a95b9b3f [sgen] Remove bogus mono_profiler_events assert.
This variable can be changed at any time by any thread. It makes no sense to
assert that it has a particular flag.
2016-10-02 18:29:58 +02:00
Alex Rønne Petersen 39080bf5f0 [utils] Move MONO_DEPRECATED to mono-publib.h and make it imply MONO_API + MONO_RT_EXTERNAL_ONLY.
Also make it work with MSVC.
2016-10-02 18:29:15 +02:00
Alex Rønne Petersen c4f5bc9402 [profiler] Remove the long-obsolete hsmode option.
Also refactor the heap walk code a bit.
2016-10-02 18:28:24 +02:00
Alex Rønne Petersen 129560cb97 [profiler] Document and fix the onlycoverage option. 2016-10-02 18:28:04 +02:00
Alex Rønne Petersen 4199952108 [profiler] Remove the countersonly option.
It was never documented and is no longer functional.
2016-10-02 18:27:57 +02:00
Alex Rønne Petersen b9d7a08f26 [man] Update mprof-report.1 to indicate the correct default maxframes value. 2016-10-02 18:27:48 +02:00
Alex Rønne Petersen b334afdbd0 [profiler] Use the signal shutdown logic for the sampling thread for more cases. 2016-10-02 18:27:29 +02:00
Alex Rønne Petersen b6518ecfb8 [profiler] Remove some indirection in setting up GC events.
* mono_gc_enable_events: This did nothing for SGen and we called it
  unconditionally for Boehm. So no point in having it around.
* mono_gc_enable_alloc_events: The performance difference between checking
  a static alloc_events variable versus checking mono_profiler_events is
  marginal at best and doesn't justify the indirection, especially now that
  we support managed allocators while profiling.
2016-10-02 18:25:20 +02:00
Alex Rønne Petersen 46b3f65045 [profiler] Lift profiler limitation in mono_class_get_allocation_ftn ().
This has not actually been necessary since allocation reporting was moved into
the GC implementations.
2016-10-02 18:24:41 +02:00
Alex Rønne Petersen 03d6935654 [profiler] Don't leak counter data structures on shutdown. 2016-10-02 18:24:15 +02:00
Alex Rønne Petersen 0db428169a [profiler] Simplify counters initialization. 2016-10-02 18:24:04 +02:00
Alex Rønne Petersen d933617f69 [profiler] Don't emit a perf counters sample event if none are registered. 2016-10-02 18:23:49 +02:00
Alex Rønne Petersen ae0828fcee [profiler] Fix the code that synthesizes thread end events.
It could previously fail to process a newly allocated buffer.
2016-10-02 18:23:37 +02:00
Alex Rønne Petersen a91319333f [profiler] Add counters for all event types. 2016-10-02 18:23:28 +02:00
Alexander Köplinger 066372dc08 [metadata] Fix FullAOT build
The function was renamed in https://github.com/mono/mono/commit/a0ad8154f7cdca706802aa196d95686e0f8d3b7b#diff-9a532ce56888ac899468740a872fd7e0L1814, but this stub was missed.
2016-10-02 17:24:22 +02:00
Alexander Köplinger 1958bb8b34 [btls] Fix bashism in create-object-library.sh
Found by checkbashisms(1) as "unsafe echo with backslash". Some shells don't expand embedded \n in a string by default,
which broke the build on systems like ArchLinux or Alpine where /bin/sh points to those shells because the generated .lo
file contained just a single line instead of two.

Thanks to @JustArchi for researching this on the Mono Gitter channel, it made fixing the issue a lot easier!
2016-10-02 17:12:45 +02:00
Martin Baulig 8245417cb6 [System]: ChainValidationHelper: ignore port number when validating a certificate's host name.
(cherry picked from commit 4d28eb4b88)
(cherry picked from commit 7c88bf755e)
2016-10-01 21:34:01 +02:00
Martin Baulig ac9d969e40 [BTLS]: Ignore port number when validating certificates.
(cherry picked from commit baebc1d8c0)
2016-10-01 21:33:31 +02:00
Martin Baulig 7cbd69d8ea [BTLS]: Send server name extension on the client.
(cherry picked from commit 2602c52de4)
2016-10-01 21:33:22 +02:00
Alexander Köplinger f4475ff013 Fix build break from 81fb20737f
The HttpWebResponse stub that is used e.g. on the monotouch_watch profile was missing an overload that this commit was using.
2016-10-01 02:42:24 +02:00
Alexander Köplinger f057c1c071 [corlib] Fix a warning 2016-10-01 02:23:52 +02:00
Alexander Köplinger 186ab05987 Fix build break from efd53c8e2f
The new/renamed TypeBuilderInstantiation wasn't available with FULL_AOT_RUNTIME,
breaking the monotouch profile build.
2016-10-01 02:23:32 +02:00
Aleksey Kliger da859cdc93 [sgen] Fix printf-like format warnings 2016-09-30 18:54:19 -04:00
Aleksey Kliger 5ffa156af5 [runtime] Fix printf-like format warnings. 2016-09-30 18:54:17 -04:00
Aleksey Kliger d933c59c19 [runtime] Add MONO_ATTR_FORMAT_PRINTF macro
Expands to __attribute__((format(printf,X,Y))) with gcc and clang.

Use it to check that printf-like format strings get the correct number
and type of arguments.
2016-09-30 18:31:14 -04:00
Marek Safar 81fb20737f [System] Fill more WebException details when CONNECT fails. Fixes #19594 2016-10-01 00:11:23 +02:00
Zoltan Varga 6ddedbfc6d Bump corlib version for efd53c8e2f. 2016-09-30 17:27:46 -04:00
Martin Baulig 067d2f98c2 [scripts]: Add 'btls-cert-sync' script.
(cherry picked from commit 30fabaedd3)
2016-09-30 22:50:54 +02:00
Martin Baulig 1987e8217d [System]: Fix MonoTlsProviderFactory.TryDynamicLoad() logic.
If the MONO_TLS_PROVIDER environment variable is missing, use "default".

(cherry picked from commit 7002264dd2)
2016-09-30 22:47:14 +02:00
Zoltan Varga efd53c8e2f [SRE] Rename MonoGenericClass to TypeBuilderInstantiation to match MS. (#3679) 2016-09-30 13:45:30 -04:00
Zoltan Varga 44364e507d [runtime] Fix a warning. 2016-09-30 13:35:11 -04:00
Martin Baulig 069a1e4f78 [System]: Make BTLS the default TLS Provider on Desktop. 2016-09-30 17:36:50 +02:00
Martin Baulig ecdc3ef482 [cert-sync]: Make the new store the default and add '--legacy' for the old one. 2016-09-30 17:28:52 +02:00
Martin Baulig aa320774ed [BTLS]: Remove some debugging methods. 2016-09-30 17:11:09 +02:00
Alexander Köplinger e698a15af7 Merge pull request #3681 from rolfbjarne/fix-monotouch-build
[System] Fix monotouch* build.
2016-09-30 17:02:57 +02:00
Rolf Bjarne Kvinge 3870c7bab2 [System] Fix monotouch* build. 2016-09-30 16:28:00 +02:00
Martin Baulig 0b045d2b6e [System]: Enable AndroidPlatform.CertStoreLookup().
Uses reflection to call into AndroidEnvironment.CertStoreLookup()
(which as been added in https://github.com/xamarin/xamarin-android/pull/246).
2016-09-30 16:24:38 +02:00
Alexander Köplinger 2417bf1861 Bump boringssl to fix the build 2016-09-30 16:13:02 +02:00
Alexander Köplinger bd1d7650ec [btls] Only use cmake policies CMP0026/CMP0042 if cmake supports it
Some older cmake versions don't.
2016-09-30 15:57:45 +02:00
Martin Baulig f8c6505ad3 [System]: AndroidPlatform.CertStoreLookup(): add to the build, but return null.
This needs to have support added to xamarin-android before we can enable it.

(cherry picked from commit 9e46b5744b)
2016-09-30 15:18:03 +02:00
Alexander Köplinger 12db41477b Merge pull request #3676 from chamons/SignalHandlerAPI_XM45
Add Mono.Runtime to XM 4.5 profile
2016-09-30 14:56:38 +02:00
Martin Baulig 0f8f0c543c [BTLS]: Add managed BTLS sources.
* external/boringssl: unmanaged code from Google (added earlier).

* mono/btls: unmanaged BTLS lives here (added earlier).

* System/Mono.Btls: managed BTLS lives here.

* Mono.Btls.Interface: The purpose of this assembly is to allow test suites
  such as xamarin/web-tests to test parts of the BTLS APIs without making
  System.dll's internals visible.  It is not a stable and maintained API.
2016-09-30 14:07:26 +02:00
Martin Baulig fb93be4490 [Mono.Security]: Add the new certificate store.
BTLS uses a different format and naming scheme for the local certificate store.

Before using BTLS for the first time on desktop, you need to convert the local
certificate store by either using the new `btls-cert-sync` tool (which will convert
your existing certificate store to the new new format) or `cert-sync` with the
`--btls` argument.

The new format and naming scheme is identically to what you'll find in
'/system/etc/security/cacerts/' on an Android device.  It stores the certificates
in PEM format (with a human-readable text section added) using filenames which
are based on the certificate's subject name hash.

Previously, Mono stored the certificates in binary DER format, using a filename
based on either the Subject-Key-Identifier (if available) or the thumbprint.

We cannot access this from BTLS because computing these filenames requires
reading the entire X509 certificate (including the X509v3 extensions), but
their native lookup code only gives us the SubjectName.

This transitioning won't affect Android users as we're using the system
certificate store (including the user certificate store, via a Java callback).

* Mono.Security.X509.X509Store and X509Stores:
  Support both the old and the new format.  Using the new format requires BTLS.

* Mono.Security.X509.X509StoreManager:
  Add `NewCurrentUserPath` and `NewLocalMachinePath` properties for the
  new path names (~/.config/.mono/new-certs).

* Mono.Security.X509.X509StoreManager:
  Add `NewCurrentUser` and `NewLocalMachine` properties.  Requires BTLS.

* tools/security/cert-sync:
  Add new `--btls` argument to use the new store.
2016-09-30 13:38:44 +02:00
Martin Baulig 52b290680c [System]: Add AndroidPlatform.CertStoreLookup().
This is conditional to HAVE_BTLS and needs to have support added
to xamarin-android first.
2016-09-30 13:03:42 +02:00
Martin Baulig d88ce91459 [System]: New X509Helper2 APIs for BTLS.
The managed HAVE_BTLS conditionals will be removed once BTLS itself has landed.
2016-09-30 13:03:42 +02:00
Marek Safar f460c9bb83 [System.Core] Cleanup more warnings 2016-09-30 12:09:02 +02:00
Marek Safar 225ea9235f [System.Data] Cleanup warnings 2016-09-30 12:09:02 +02:00
Marek Safar aebd704d79 [System.Data] Implements SqlClient async readers. Fixes #44843 2016-09-30 12:09:02 +02:00
Martin Baulig c950be01ac [BTLS]: Add the native BTLS sources. 2016-09-30 11:46:46 +02:00
Johan Lorensson 03cf658591 Merge pull request #3663 from lateralusX/jlorenss/win-api-family-support-libgcmonosgen
Build libgcmonosgen under none desktop Windows API family.
2016-09-30 11:40:53 +02:00
lateralusX 3e6a602dd1 Build libgcmonosgen under none desktop Windows API family.
Initial work to build libgcmonosgen under none desktop Windows API families.
Changes are mainly related to header files included by libgcmonosgen sources and shared
by other libraries.
2016-09-30 08:48:00 +02:00
Zoltan Varga a0ad8154f7 Sre cleanup9 (#3661)
* [SRE] Assign pseudo tokens to SRE objects in the BCL instead of doing it in the runtime.

Real tokens are assigned after the dynamic types they depend on have been created, by creating the corresponding finished reflection object
(i.e. a MonoMethod for a MethodOnTypeBuilderInst etc.) and obtaining its token.
In Save mode, this is done in ModuleBuilder.Save ().
In Run mode, this is done on-demand when the JIT tries to resolve a token into its corresponding metadata object, by the runtime calling
the RuntimeResolve () method on the builder object.

* [SRE] Remove dead code.

* [SRE] Remove the MonoGenericMethod/MonoGenericCMethod classes, they have not needed.

* [SRE] Delay the creation of MonoClass-es for MonoGenericClass/GenericTypeParameterBuilder/SymbolType until its needed.

* [SRE] Small code cleanup.

* [SRE] Remove the TypeBuilder.IsGenericParameter () icall, it should return false.

* [SRE] Unify the calling of the various RuntimeResolve () methods by adding a RuntimeResolve () method to ModuleBuilder, and calling that from native code.

* [SRE] Remove unused TypeBuilder::get_event_info () icall.

* [SRE] Remove more unused/empty icalls.
2016-09-29 23:53:22 -04:00
Marius Ungureanu d252071247 [IO] Implement FileOptions.SequentialScan for Mac/BSD
The F_RDAHEAD define seems to be introduced in BSD, being the equivalent of POSIX_FADV_SEQUENTIAL.
This should improve sequential scanning speed by having the read ahead buffer doubled.
2016-09-30 02:34:14 +03:00
Martin Baulig 2d86893ee6 [Mono.Security]: Cleanup the MonoTlsProvider's certificate validation code. (#3674)
* [Mono.Security]: Remove Mono.Security.Interface.IMonoTlsContext.

This interface is not actually used anywhere anymore, so we can also
just get rid of it.

* [System]: Removed unused private TLS classes.

* [Mono.Security]: Cleanup the MonoTlsProvider's certificate validation code.

Each TLS Provider now has its own certificate validator and there is no
automatic fallback anymore.  We only have three different TLS Providers,
"legacy", "appletls" and "btls" - and legacy is the only one which used
the managed validator.  Both AppleTls and BTLS provider their own validator,
which invokes some native API.

All of the following were internal APIs.

* MonoTlsProvider.HasCustomSystemCertificateValidator has been removed.

* MonoTlsProvider.InvokeSystemCertificateValidator() has been renamed
  into ValidateCertificate() and is now abstract.

(cherry picked from commit 63c0803b2b)
2016-09-29 22:52:10 +02:00
Marek Safar 3e735a6171 [mcs] Branch visited labels cache for conditional block. Fixes #44751 2016-09-29 22:39:47 +02:00
Chris Hamons 0c64f16bcb Add Mono.Runtime to XM 4.5 profile
- Extends https://github.com/mono/mono/pull/3624
2016-09-29 14:53:32 -05:00
Miguel de Icaza f133e22342 [mkbundle] Add diagnostics, fix crash, fix registered path to match runtime name on embedded MonoImages (#3669) 2016-09-29 15:13:41 -04:00
Aleksey Kliger (λgeek) 41a25a6aab Merge pull request #3670 from lambdageek/dev/mempool-loader-error-msg
[loader] Store MONO_EXCEPTION_TYPE_LOAD error strings in mempools
2016-09-29 14:10:52 -04:00
Henric Müller d5c972a97b Comparing pid instead of handles in GetModules_internal (#3575)
Process handles can be different for same process id.
Therefore make sure we compare the process ids instead.
2016-09-29 11:19:43 -04:00
Niklas Therning f2896fe33f Merge pull request #3671 from rolfbjarne/pr-fix-system-tests
[System] Fix tests that regressed in e6536dd.
2016-09-29 13:25:07 +02:00
Johan Lorensson 6f7798530e Merge pull request #3664 from lateralusX/jlorenss/extern-test-driver-usage
Enable reuse of eglib native test framework and test driver source.
2016-09-29 12:08:31 +02:00
Rolf Bjarne Kvinge ad6f78afec [System] Fix tests that regressed in e6536dd.
* I got confused between [TestFixtureSetup] and [Setup], so fix tests whose
  [Setup] methods were changed/removed to properly clean up after each test
  (using a [TearDown] method) so that the next time the on-demand creation of
  objects works as expected (i.e. objects created in the [Setup] method should
  be created on-demand once for each method instead of once for each class).

* Also fix SocketAcceptAsyncTest, the change to properly catch exceptions on
  background threads was incorrect.
2016-09-29 12:01:49 +02:00
Ludovic Henry ae4b2d859a [threads] Assert that every thread is detached when exiting (#3620) 2016-09-29 08:49:35 +02:00
Miguel de Icaza 15b6ef60e4 [scripts] Add script to package the basic runtime to reuse by mkbundle 2016-09-28 22:32:18 -04:00
Martin Baulig f08c2659e7 [System]: Rename MonoLegacyTlsProvider into LegacyTlsProvider. (#3666)
LegacyTlsProvider now lives in the 'Mono.Net.Security' namespace
(previously 'Mono.Net.Security.Private') and derives directly from
the public 'Mono.Security.Interface.MonoTlsProvider'.

This allows it to be used by products, for instance replacing
xamarin-macios/src/Security/Tls/OldTlsProvider.cs.

The idea is to have all 'MonoTlsProvider' implementations inside
System.dll and not access any of the private APIs from outside of it.
(cherry picked from commit 9437553e54)
2016-09-29 01:10:39 +02:00
Martin Baulig 1055069416 [configure] Add configure.ac checks for BTLS. (#3668) 2016-09-29 00:53:33 +02:00
Marek Safar 486748776c [corlib] Improve test added in 54ea12e4fa 2016-09-29 00:28:57 +02:00
Aleksey Kliger 4cc2b45bed [runtime] Use mono_error_set_for_class_failure in more places
Also assert if we see anothing other than MONO_EXCEPTION_TYPE_LOAD or
MONO_EXCEPTION_INVALID_PROGRAM in a class failure.
2016-09-28 18:25:33 -04:00
Marek Safar 0987545404 [build] Make monolite output path configurable 2016-09-28 23:34:36 +02:00
Aleksey Kliger a13dd1bdf0 [loader] Use mempool memory for MONO_EXCEPTION_TYPE_LOAD messages.
Prevent memory leaks by storing the error message strings in the same
mempool as the failing class.
2016-09-28 17:25:36 -04:00
Aleksey Kliger 6b60fb6c77 [image] Check mempool of mono_image_property_insert value
When adding an image property, check that the value belongs to the same image.

Ensure that we don't leak the values when the property hashtables are destroyed.
2016-09-28 17:24:14 -04:00
Aleksey Kliger 1e41338e8d [checked] Add CHECKED_METADATA_STORE and CHECKED_METADATA_STORE_LOCAL
When running a checked build with metadata checking enabled, these
macros check that values written to ptr occupy the apropriate mempool.
2016-09-28 17:22:31 -04:00
Aleksey Kliger 56a50a3029 [image] Add mono_image_strdup_printf and mono_image_strdup_vprintf 2016-09-28 17:21:53 -04:00
Aleksey Kliger 276c2c2588 [mempool] Add mono_mempool_strdup_printf and mono_mempool_strdup_vprintf 2016-09-28 17:21:09 -04:00
Marek Safar 9d8e1631b7 [System] Reduce duration of SendGenericExceedBuffer test 2016-09-28 18:12:23 +02:00
Martin Baulig 3c2a11dc91 [System]: Cleanup the internal MobileTlsContext.
* Add SelectClientCertificate().
* ValidateCertificate() now returns bool.
* Add ValidateCertificate() overload.

(cherry picked from commit 0d07c695b5)
2016-09-28 13:52:07 +02:00
Martin Baulig 0bdaa8421c [Mono.Security]: Cleanup the internal ICertificateValidator2.
(cherry picked from commit fcc570920d)
2016-09-28 13:52:00 +02:00
Martin Baulig 6d46c3ec0b Remove all MONO_FEATURE_NEW_TLS conditionals.
(cherry picked from commit c155563d1e)
2016-09-28 13:51:52 +02:00
Martin Baulig 3e751052f1 Cleanup; with the removal of 'PrebuiltSystemAlias', we don't need to use XX509* anymore.
(cherry picked from commit 5b412212cd)
2016-09-28 13:51:43 +02:00
Martin Baulig fa22808b26 [System]: Make Test/System.Net.Sockets compile.
(cherry picked from commit c2e7ca6c99)
2016-09-28 13:37:30 +02:00
lateralusX d4ea732e74 Enable reuse of eglib native test framework and test driver source.
In current eglib test framework there is no mechanism to specify where
the include file describing all tests is located. Current implementation also assumes it is the main
entry point of the process since it defines the main symbol. There are several scenarios
where it could make sense to reuse eglib test framework and its driver in other native unit test projects
unit testing native code. In those scenarios it would be nice to include existing driver.c
from eglib/test (no copy) and use toolchain capabilities to include needed header with test descriptions
and change main symbol name, since main will most likely be defined elsewhere.

This can be achieved by two simple defines that can be set when embedding eglib test framwork in other
native binaries. By default these defines will not be set and current behavior will be preserved.
2016-09-28 12:01:08 +02:00
Marek Safar 94cc2dea31 [build] Update bootstrap info text 2016-09-28 08:43:27 +02:00
Johan Lorensson 2c48afbc63 Merge pull request #3626 from lateralusX/jlorenss/win-api-family-support-eglib
Build eglib under none desktop Windows API family.
2016-09-28 08:40:30 +02:00
Rodrigo Kumpera 8bdce50379 Merge pull request #3658 from kumpera/fix-ios-logging
[logging] Fix logging on iOS. We lost asl redirection and it was sending to stdout instead.
2016-09-27 20:11:23 -04:00
Ludovic Henry 3ae9e2c971 [threads] Signal the w32handle later in the thread destruction process (#3652) 2016-09-27 23:44:51 +02:00
Rodrigo Kumpera 65a4d35202 [logging] Fix logging on iOS. We lost asl redirection and it was sending to stdout instead. 2016-09-27 14:39:24 -07:00
Aleksey Kliger (λgeek) 76b32f3ee3 [coop handles] Add some memory fences (#3617)
When running with async suspend (ie, not coop), a user thread might be
suspended while its manipulating the coop handle stack.  In that case,
we want to present a consitent view to mono_handle_stack_scan () by
adding memory fences to code that updates the stack chunks.  In
particular we want to ensure that the chunk size is increased after
the new slot has a valid (null) value.  Also when creating new chunks
make sure their size is initialized before the chunk stack is updated.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43921 (at least the
one stack trace observed in [comment 1](https://bugzilla.xamarin.com/show_bug.cgi?id=43921#c1)).
2016-09-27 17:02:18 -04:00
Martin Baulig fd6108736c [Mono.Security.Interface] Cleanup and simplify MonoTlsProviderFactory.
The "global" TLS Provider (returned by MonoTlsProviderFactory.GetProvider())
may only be modified at application startup (before any of the TLS / Certificate
code has been used).

* MonoTlsProviderFactory.HasProvider has been removed.

  This property used to initialize the TLS Subsystem without throwing any
  exceptions.  However, properties with side-effects is a bad design principle.

* Add MonoTlsProviderFactory.IsInitialized.

  Does not have any side-effects.

* Add MonoTlsProviderFactory.Initialize() and Initialize(string).

  May only be called at application startup and explicitly initializes the
  TLS Subsystem.

* Rename MonoTlsProviderFactory.GetDefaultProvider() into GetProvider()
  and removed MonoTlsProviderFactory.GetCurrentProvider().

  We do not distinguish between a "default" and a "current" provider anymore;
  there is only one "global" provider.

* Add MonoTlsProviderFactory.IsProviderSupported(string).

  Checks whether a specific TLS Provider is supported, without having side-effects.

* Make the old APIs [Obsolete] until products have been updated.

* Add some documentation to MonoTlsProviderFactory.

(cherry picked from commit 7c3ae83b31)
2016-09-27 22:23:10 +02:00
Zoltan Varga 80950a920f [llvm] Enable support for large basic blocks again.
llc has some performance problems with large basic blocks so we have to break them up into smaller ones. Use some hacks to prevent opt/llc from merging them back again.
2016-09-27 15:25:40 -04:00
Marek Safar ed8d5f669d Merge pull request #3656 from marek-safar/bootstrap
[build] Bootstrap extension for roslyn
2016-09-27 21:24:11 +02:00
Aleksey Kliger a02d938818 [runtime] Fix MonoMethod.get_base_method when abstract methods are not overridden
When there is an abstract class in the middle of an inheritance
hierarchy that doesn't override a method, get_base_methods needs to search
the parent class instead aborting early.

Example:

```
abstract class Root {
  public abstract void Foo ();
}
abstract class Abs : Root { }
class Derived : Abs {
  public override void Foo () { }
}
```

If we ask for the base method of Derived.Foo we used to get Derived.Foo
back because Abs did not provide an override.  Instead we should skip
abs and look in Root.
2016-09-27 15:00:21 -04:00
Marek Habersack 79b828c66d Fix trace logging on Android
Introduction of the structured trace logger accidentally broke Android
logcat logging. The reason for this is that the default logging handler
defined in eglib (in goutput.c) for Android was never called, instead it
was superseeded by the log file logger defined in mono-logger.c

The net effect was that Mono tried to write the messages to some file on
Android leaving logcat devoid of any trace of life :)

This commit fixes the issue by introducing a set of structured logging
functions for Android.

As a side note - file logging on Android is not that useful. Writing to
a file on external storage medium requires app permissions and writing
to a location on internal storage medium, while allowed, might be
subject to space limitations and should not be used for possibly
voluminous data. It's therefore not very practical on Android.
2016-09-27 20:31:19 +02:00
Marek Safar 4d17bdc54e [build] Bootstrap extension for roslyn 2016-09-27 14:27:11 +02:00
Rolf Bjarne Kvinge e6536dd5e1 [System*] Throw a PlatformNotSupported exception when using the networking stack on watchOS. (#3606)
* [System] Fix line endings for a few files.

Best reviewed by not showing whitespace changes (should be empty diff in that case).

* [System] Fix potential crash in CookieParserTests.

Socket.EndAccept can throw an exception, which will crash the process if it
happens on a threadpool. So handle any exceptions when calling
Socket.EndAccept, and propagate those exceptions out of any threadpool code.

* [System.Net.Http] Throw a PlatformNotSupported exception when using HttpClientHandler on watchOS.

* [System.Net.Http] Tweak tests after watchOS API change.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Extract the HttpListenerResponseHelper class to a separate file.

Extract the HttpListenerResponseHelper class to a separate file so that it's
easier to replace the HttpListenerResponse implementation by using a different
file.

* [System] Throw a PlatformNotSupported exception when using the networking stack on watchOS.

* [System] Tweak tests after watchOS API changes.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Fix potential crash in SocketAcceptAsyncTest.

Fix potential crash in SocketAcceptAsyncTest by catching any exceptions in
code executed on the threadpool so that we never end up with unhandled
exceptions (which may terminate the process).

* [System] Avoid logic in SetUp attributes in tests.

Any type of exception in [SetUp] attributes causes all tests to fail with that
exception.

This even happens for tests that do not need the logic in the [SetUp]
attribute.

So rewrite tests a bit to not use [SetUp] when we can reasonably avoid it, and
instead instantiate class-level variables on first use. This ensures that any
exceptions that occur when initializing those variables are attributed to the
corresponding test, and not all of them.

* [System] Make exception handler (for test) catch more exceptions to avoid unhandled exceptions causing process termination.

* [System] Remove Obsolete attribute on API that throws PNSE.
2016-09-27 13:13:38 +02:00
Rolf Bjarne Kvinge 59b6fde1b3 [corlib] Add API to uninstall/reinstall signal handlers.
This API is provided to be used by libraries providing crash reporting, so
that those libraries can install signal handlers and at the same time not
interfere with Mono's signals.

The intended pattern is this:

    Mono.Runtime.RemoveSignalHandlers ();
    InstallThirdPartySignalHandlers ();
    Mono.Runtime.InstallSignalHandlers ();

This ensures that Mono is always notified first of any signals, and will then
chain to the third-party signal handlers if the signal did not originate in
managed code.

Mono's signals must first be removed, so that if third-party signal handler
does signal chaining, we don't end up in Mono's signal handler again.

Mailing-list thread: http://lists.dot.net/pipermail/macios-devel/2016-September/000016.html [Signal-chaining & crash reporters]
Example usage: https://github.com/rolfbjarne/HockeySDK-Xamarin/commit/862721199f1adec210bfc7b1943f975ffb8048a9
2016-09-27 12:35:14 +02:00
Rolf Bjarne Kvinge 14bb051f36 [mini] Provide a free function to the saved signal handler hash table.
This makes the cleanup code simpler, and also makes it easier to
replace saved signal handlers without having to worry about
leaking memory.
2016-09-27 12:35:14 +02:00
Vlad Brezae 4df88aea4b Merge pull request #3647 from BrzVlad/fix-sgen-internal-alloc
[sgen] Fix sgen internal alloc
2016-09-27 13:10:01 +03:00
Martin Baulig 61d76d9642 [Mono.Security]: Cleanup Mono.Security.Interface.CertificateValidationHelper.
* CertificateValidationHelper.GetDefaultValidator(): rename this internal method into
  GetInternalValidator() (keeping the old as [Obsolete] until products have been updated).

* CertificateValidationHelper.GetValidator(): remove the 'provider' argument.

This is part of a set of cleanups and simplifications for the upcoming BTLS integration.
2016-09-27 11:39:07 +02:00
lateralusX 109d34b9c0 Build eglib under none desktop Windows API family.
Initial work to build eglib under none desktop Windows API family. Classic
Windows API have been split into families and partitions in order to support
different subsets on different Windows platforms. In order to build against
other Windows targets/platforms Mono needs to follow these families/partitions
in order to successfully build where API’s have been removed/replaced. Since most
Mono platforms uses the Windows API signatures a new defined has been added to all
platforms, HAVE_CLASSIC_WINAPI_SUPPORT, used to decide what implementation to include.
On none Windows platforms this is always defined and on Windows platforms it follows the
winapifamily.h. In order to keep down regressions, the existing API’s are kept for HAVE_CLASSIC_WINAPI_SUPPORT
even if there are more modern replacements available.
2016-09-27 11:28:57 +02:00
Ludovic Henry 1f15519152 [w32handle] Ensure we initialize begore the gc attach the current thread (#3644) 2016-09-27 10:43:59 +02:00
Marek Safar a064ce84e0 Merge pull request #3643 from marek-safar/bootstrap
[build] Bump mono bootstrap dependency to Mono 4.0+
2016-09-27 08:20:05 +02:00
Miguel de Icaza aae997259a [mini] Add some documentation comments to some IR generating macros 2016-09-26 22:16:49 -04:00
Vlad Brezae 43f369a107 [sgen] Untag the vtable during concurrent mark
For now, concurrent mark runs concurrently with bridge during minors. Since bridge processing might tag object vtables, make sure we don't crash when we scan such objects.
2016-09-27 00:38:43 +03:00
Vlad Brezae 837d12bfc6 [sgen] Fix internal allocation
After recent header size change in 883e0a2d89, we had some slot sizes unaligned which was leading to unaligned memory allocation and therefore SIGBUS-es on some ARMs.

We used to have all allocators use 16k blocks and slot sizes optimized for this. After we switched to allocating in 4k, 8k and 16k blocks the slot sizes were not optimized for the new format.

This commit fixes unaligned problems, at the same time optimizing the size of allocator slots.
2016-09-27 00:38:41 +03:00
Zoltan Varga 8994ce8a09 [aot] Make sure generic wrappers are unique by creating shared versions of the them in the same order that AOT creates them (shared method -> wrapper). 2016-09-26 14:54:45 -04:00
Marek Safar 8a7ff203c8 [System] Fixes SendGenericExceedBuffer test 2016-09-26 20:46:28 +02:00
Zoltan Varga 628d9dac90 [aot] Fix the linux bitcode build. 2016-09-26 13:24:51 -04:00
Marek Safar cbd4cff826 [build] Bump mono bootstrap dependency to Mono 4.0+ 2016-09-26 19:19:23 +02:00
Marek Safar 1306fa1237 [System] Revert copyright change in 8e4a52a374 2016-09-26 16:56:19 +02:00
Marek Safar 8e4a52a374 [System] netstandard compatible Process collections 2016-09-26 16:52:25 +02:00
Alexander Köplinger 3687b18b3d Restructure and update build status section in README
Add links to Windows/OSX builds on Jenkins.
2016-09-26 15:46:03 +02:00
Alexander Köplinger 7fd68f813d Remove appveyor.yml from repository
We now have our own set of Windows bots on our Jenkins CI for building and testing Mono on Windows.

Special thanks to AppVeyor for providing us with build capacity over the last two years <3
2016-09-26 15:45:03 +02:00
Zoltan Varga 43ba3b7a22 [runtime] Make a copy of the wrapper date when instantiating generic wrapper methods, to be able to store a different WrapperInfo for them. (#3634) 2016-09-26 01:21:58 -04:00
Ludovic Henry 13c15c25fb [Socket] Use SemaphoreSlim instead of Queue (#3633)
This uses the same approach as corefx's FileStream. This simplifies the code, as well as make the intent of the queue clearer.
2016-09-25 19:54:07 +02:00
Alexander Köplinger 3a3d080e17 [corlib] Remove unnecessary net_4_x_corlib.dll.sources
It only imports corlib.dll.sources, removing the file has the same effect.
2016-09-25 17:01:55 +02:00
Alexander Köplinger 4d325a0674 [System] Add ISupportInitialize on mobile FileSystemWatcher
The interface was missing on the mobile stub.
2016-09-25 13:59:53 +02:00
Alexander Köplinger 566f0a78b0 [System] Remove obsolete HttpWebRequest/Response constructors again
They were removed from a later revision of netstandard2.0 so we don't need to add them.
2016-09-25 13:02:48 +02:00
Zoltan Varga 47561c7053 [jit] Resurrect the Monitor.Enter () v4 optimization. (#3632) 2016-09-25 03:15:48 -04:00
Alexander Köplinger 015de5d245 Merge pull request #3631 from slide/bz44714
Fix issue with VB projects
2016-09-25 01:54:27 +02:00
Alexander Köplinger 3d0799107b Fix tarball build 2016-09-25 01:45:21 +02:00
Ludovic Henry c5df7e9669 [referencesource] Import parts of System.Net.Sockets.Socket (#3618) 2016-09-24 20:10:01 +02:00
Alexander Köplinger 6a82e9a890 Fix tarball build
The file was removed in 18ada43d3d.
2016-09-24 19:17:16 +02:00
Alex Earl d6bb144980 Fix issue with VB projects
Fixed GenerateFullPathToTool for Vbc task to match behavior of the Csc
task. This allows VB.NET projects to build successfully.

See https://bugzilla.xamarin.com/show_bug.cgi?id=44714
2016-09-24 08:44:33 -07:00
Zoltan Varga 972b78f8bf [SRE] Implement the ModuleBuilder:create_modified_icall () in managed code. Use user types instead of creating derived types of unfinished typebuilders. (#3629) 2016-09-24 09:41:14 -04:00
Alexander Köplinger d0d6b2a33a Bump corlib version
18ada43d3d didn't bump the corlib version and this breaks building with monolite.
2016-09-24 12:20:40 +02:00
Marek Safar a8c8cc7a3f Merge pull request #3625 from slide/master
Fix 16628
2016-09-24 09:33:19 +02:00
Martin Baulig 2cc1b887c1 [AppleTls]: Flush the write queue before finishing the handshake.
It is possible for SSLHandshake() to return SslStatus.Success while we're still
having a pending write (AsyncOperationStatus.WantWrite).

This is because our managed write callback must never return 'WouldBlock', so
SSLHandshake() things that all data have been sent while we still have them in
our write queue.

When this happens, we currently flush the write queue then call SSLHandshake()
again via AsyncOperationStatus.WantWrite -> AsyncOperationStatus.Continue.

This returns SslStatus.Protocol on iOS 10.
2016-09-24 07:38:18 +02:00
Vlad Brezae f726e1bcf0 [gc] Warn if we fail to switch gc 2016-09-23 23:15:44 +03:00
Zoltan Varga 0faf536739 [aot] Fix aot support on android.
Disable the binary writer in llc since it doesn't seem to work. Use $tool_prefix/ld for linking if the tool prefix is set.
2016-09-23 15:40:48 -04:00
Alexander Köplinger 112631f5c6 [bcl] Add missing APIs for netstandard parity and expose a few APIs on mobile
This ensures we're compliant with the upcoming netstandard2.0 API surface area.
2016-09-23 17:50:06 +02:00
Alexander Köplinger fa986f1e36 [bcl] Add CLSComplaint(false) to a few types/methods that aren't compliant 2016-09-23 17:17:59 +02:00
Alex Earl bde7699722 Fix 16628
This changes the IL parser to have the same behavior as ilasm.exe from
MS

https://bugzilla.xamarin.com/show_bug.cgi?id=16628
2016-09-23 07:47:35 -07:00
Zoltan Varga 91014ffb91 [llvm] Add static rgctx trampolines to array access methods in the aot+llvm case too. (#3616) 2016-09-23 09:49:51 -04:00
Alexander Köplinger 7f51d473ef Merge pull request #3622 from rolfbjarne/remove-stray-file
Remove stray file.
2016-09-23 14:31:43 +02:00
Marek Safar 4ec076ab6b [corcompare] More hacks to make breaking change not too disruptive 2016-09-23 14:17:55 +02:00
Rolf Bjarne Kvinge ef972deb08 Remove stray file. 2016-09-23 14:14:47 +02:00
Marek Safar 775c082236 [System.Core] Fixes warnings 2016-09-23 13:36:41 +02:00
Marek Safar 8c7f99a8fe Merge pull request #3621 from kloun/patch-9
fix Another Typo
2016-09-23 13:29:03 +02:00
kloun e9b9b53811 fix Another Typo 2016-09-23 14:26:51 +03:00
Marek Safar 7ba748c8b8 [bcl] Base type update to match netstandard apis 2016-09-23 12:10:11 +02:00
Marek Safar b1b62469da [mono-symbolicate] Include pdb debug symbols support file 2016-09-23 10:27:30 +02:00
Marek Safar 2cba858cb7 Merge pull request #3615 from kloun/patch-8
fix typo, "j-j"
2016-09-23 08:47:21 +02:00
Marek Safar e297a5d2b6 Merge pull request #3614 from kloun/patch-6
fix identical sub-expressions
2016-09-23 08:46:36 +02:00
Zoltan Varga c0e91ae252 [arm64] Handle thunks with ARM64_B relocations as well. 2016-09-22 19:29:53 -04:00
Marek Safar cdf0a4c29f Merge pull request #3613 from kloun/patch-4
fix another ERIC
2016-09-22 23:37:47 +02:00
kloun 90601ba4cf fix typo, "j-j" 2016-09-23 00:24:37 +03:00
kloun ad48ddf483 Update generic.cs 2016-09-23 00:17:38 +03:00
kloun f14f87f1cd Update generic.cs 2016-09-23 00:15:47 +03:00
kloun 7eeb7a9e61 fix identical sub-expressions 2016-09-23 00:12:05 +03:00
Marek Safar b1b28a15d6 Merge pull request #3603 from ninjarobot/socket-write
Send all data to a socket before exit from Socket.Send.
2016-09-22 22:58:57 +02:00
kloun 11022626f0 fix another ERIC 2016-09-22 23:54:36 +03:00
Alexander Köplinger dbb7547576 Merge pull request #3611 from kloun/patch-2
Fix copy-paste error in WinForms DataGrid
2016-09-22 22:29:21 +02:00
kloun fe0643cb31 fix copy-paste ERIC error) 2016-09-22 23:22:54 +03:00
monojenkins 2b26601921 Merge pull request #3609 from xmcclure/checked-imageset
Fix outstanding failures in "metadata" checked build mode

Fix two problems with the checked build metadata mode which were causing spurious failures, one a bug introduced by my last commit, one of which has been present since the start:

- Check assemblies in `references[]` are non-NULL before looking up their images
- A "from" imageset only needs to reference every image in the "to" imageset, it does not need to actually contain every image.

Also added support for a checked build jenkins lane.
2016-09-22 22:15:03 +02:00
Ludovic Henry 828045d259 [mono-threads] Move platform unregister after detach (#3604)
This is important as platform unregister is where we signal the thread handle, and that should be done as late as possible, but still before we switch the thread state to DETACHED and remove it from the thread list.

The fact that we do under the suspend lock shouldn't be an issue as we shouldn't call in any other code than w32handle code.
2016-09-22 22:09:29 +02:00
Andi McClure a3a93f69d1 New run-jenkins tags to allow a checked build job and fix partial checked build support in the coop job 2016-09-22 14:31:58 -04:00
Andi McClure 6ae1985688 Fix imageset->imageset audits in checked-build "metadata" mode
An imageset can reference another imageset if every image in the "to"
imageset is referenced by some image in the "from" imageset.
Previously the checked build code was requiring the stricter criteria
of every image in the "to" imageset being present in the "from"
imageset, which was not only inconsistent with image->imageset and
imageset->image reference checking, but lead to spurious failures.

An example of a scenario where the previous check logic would fail is:
Assembly A:
	class ClassA<T>
Assembly B:
	class ClassB<T> extends ClassA<T>, ClassB2
Attempting to run the constructor for ClassB<ClassB2> would result in
a pointer to memory in imageset [A,B] being written into a structure
located in imageset [B]. This is valid since B references A, however
the MONO_CHECK_MODE=metadata checker would flag it as an error.
2016-09-22 14:27:23 -04:00
Marek Safar 9ed7ac5125 [corcompare] Another try to make breaking change not too discruptive 2016-09-22 20:13:44 +02:00
Zoltan Varga e0f96a41c6 [sdb] Add a SetThis () method to StackFrame which can be used to set the fields of the receiver for valuetype instance methods. Fixes #44341. (#3605) 2016-09-22 10:05:52 -04:00
Henric Müller e2602e1d4a Merge pull request #3600 from henricm/fix-win-network-info-tests
Fix NetworkInformation tests on Windows
2016-09-22 15:57:26 +02:00
Joshua Peterson 087c016f5c Try to use an IPv4 address first for TCP remoting (#3507)
* In the .NET implementation of TcpServerChannel, if IPv4 is supported, the address for the host will use the first IPv4 address.
* Even if the first address is an IPv6 address, it should be skipped, as the server side will expect and IPv4 address.
* Change this implementation to look for an IPv4 address first, then fall back to whatever the first address is (IPv4 or IPv6) if things don't work out.
2016-09-22 09:49:18 -04:00
Miguel de Icaza 2f1e6655e2 [mkbundle] - Add support for bundling native libraries.
* [mkbundle] add support for bundling native libraries

* [glib] add g_mkdtemp

* mono: Load the various library payloads for bundled executables

* [msvc] Export mono_dl_open and mono_loader_register_module
2016-09-22 09:28:17 -04:00
Marek Safar de952507c2 Add missing file 2016-09-22 14:44:42 +02:00
Marek Safar 24867d108c [colrib] Fixes aecdb91a06 and add GC tests 2016-09-22 14:43:00 +02:00
Marek Safar c00853e14b [corcompare] Drop ParameterAttributes from method signature 2016-09-22 12:27:12 +02:00
Johan Lorensson bf29fd5955 Merge pull request #3585 from lateralusX/jlorenss/win-counter-warning
Resolve "you are registering twice the same counter address" warning on Windows Release builds.
2016-09-22 08:54:23 +02:00
Martin Baulig c3db8b00ab [Mono.Security]: Add 'MonoTlsConnectionInfo.PeerDomainName'.
(cherry picked from commit 0bafe8c3c7)
2016-09-22 07:38:41 +02:00
Martin Baulig 32c5acbefd Remove obsolete Mono.Security.Providers.* assemblies (#3595)
* Remove Mono.Security.Providers.NewSystemSource and Mono.Security.Providers.NewTls.

* Remove InternalVisible for "Xamarin.BoringTls".

* Remove Mono.Security.Providers.OldTls and Mono.Security.Providers.DotNet.

(cherry picked from commit 7b7b7c9b64)
2016-09-22 07:35:48 +02:00
Andi McClure fe9ac011d4 Back out trivial crash when running metadata checked-build mode
introduced by f822445711
2016-09-21 17:52:51 -04:00
Zoltan Varga 7f95267f8a [runtime] Fix the managed name of the ReRegisterForFinalize () icall. 2016-09-21 17:51:38 -04:00
Dave Curylo bf58ae6aae Returning during Send in case of error. Splitting send and receive into separate tasks in test. 2016-09-21 14:18:38 -04:00
Niklas Therning 3d023ebb02 Merge pull request #3548 from cmp-/fix-sgen-resume-thread-win32
[sgen] Fix sgen_resume_thread return value on Windows
2016-09-21 19:36:03 +02:00
cmp ba30dc0a96 [sgen] Fix sgen_resume_thread return value on Windows
According to sgen_resume_thread in sgen-os-mach.c, the function is
supposed to return false if the thread was not suspended.
2016-09-21 18:20:17 +01:00
Aleksey Kliger (λgeek) 31d66d692f [gacutil] Use IKVM.Reflection instead of System.Reflection (#3582)
* gacutil should use System.Reflection.Assembly.ReflectionOnlyLoadFrom() since it doesn't need to run the assemblies;
* but in fact, it could also use a managed reflection library. So in this PR we change it to use IKVM.Reflection
2016-09-21 12:49:12 -04:00
Ludovic Henry 18ada43d3d [w32mutex] Move own/disown code to w32mutex-unix.c (#3599)
* [w32handle] Fix race condition

* [w32mutex] Improve logging

* [w32mutex] Only add to owned mutex when we own it for the first time

* [w32mutex] Move own/disown code to w32mutex-unix.c
2016-09-21 18:10:38 +02:00
Dave Curylo a1b1a7c8db Send all data to a socket before exit from Socket.Send. 2016-09-21 11:31:53 -04:00
Andi McClure 3319d6a5a7 Merge pull request #3583 from xmcclure/test-418-checked
Fix issues (leaks, possible crash) around netmodule loading
2016-09-21 10:37:19 -04:00
Alexander Köplinger 626c697b29 Merge pull request #3602 from henricm/fix-configuration-symlink-removed
Removing symlink to make Configuration tests run on Windows
2016-09-21 15:38:51 +02:00
Henric Müller 154e729860 Removing symlink to make Configuration tests run on Windows 2016-09-21 15:32:05 +02:00
Marek Safar 480a8e0d95 [corlib] Simplify terminal evaluator nesting expression 2016-09-21 15:28:13 +02:00
Niklas Therning f6b8e1f10d Merge pull request #3547 from cmp-/remove-obsolete-stack-checks-win32
Remove obsolete stack limit checks on Windows
2016-09-21 14:42:49 +02:00
Alexander Köplinger f5836956c6 [System.Core] Expose a few more System.IO.Pipes APIs on mobile
Required for netstandard matching.
2016-09-21 13:56:03 +02:00
Henric Müller 2cb3807146 Implementation of GetLoopbackInterfaceIndex on Windows 2016-09-21 13:54:34 +02:00
Henric Müller 26d95892e3 Ignoring IsDnsEnabled test on Windows 2016-09-21 13:45:54 +02:00
Henric Müller 03823d39f4 Using InternalAdd to handle read only of IPAddressCollection
The read-only nature of Win32IPAddressCollection is handled by
the base class IPAddressCollection. Therefor removing the read-only
handling in this class and use InternalAdd from base class instead.
2016-09-21 13:45:04 +02:00
Marek Safar 76f97e3073 [mcs] Add compilergenerated attribute for private event backing fields to match newer csc 2016-09-21 12:54:08 +02:00
Alexander Köplinger 87dfebcb22 Merge pull request #3587 from henricm/fix-set-no-delay-tcp-only
Only set NoDelay by default for protocol TCP
2016-09-21 11:37:08 +02:00
Ludovic Henry d62c2c5fa5 [threadpool-ms] Fix race condition on domain unload (#3592)
This race condition has been introduced with 348d793ebb. This is because we would wait on the cleanup_semaphore outside of the threadpool->domains_lock lock.

By using a cond variable instead of a semaphore, we avoid a potential deadlock.
2016-09-21 11:16:35 +02:00
Niklas Therning f66549c12d Merge pull request #3588 from ntherning/fix-line-ending-issue-in-XmlReflectionImporterTests-Bug594490_SerializationOfXmlLangAttribute
Fixes line ending issue in XmlReflectionImporterTests.Bug594490_SerializationOfXmlLangAttribute
2016-09-21 09:39:54 +02:00
Aleksey Kliger (λgeek) 3589fcd39a Merge pull request #3569 from lambdageek/monodis-no-segfault
[monodis] Don't segfault using cooperative GC.
2016-09-20 18:09:27 -04:00
Andi McClure cc522292ae Fix issues in previous commit
- mono_assembly_load_module was not following MONO_RT_EXTERNAL_ONLY
  rules
- New _checked methods were not following init rules
- module[] load code was botched
2016-09-20 17:12:46 -04:00
Ludovic Henry 4b44d9fad8 [threads] Move thread describe code to mono_thread_internal_describe (#3590) 2016-09-20 22:39:30 +02:00
Alexander Köplinger de8a76a1c1 Fix Linux build break due to case sensitivity 2016-09-20 19:30:04 +02:00
Jo Shields 41a1c19ec8 Handle relocatable libMonoPosixHelper.so when --libdir= isn't lib/
Right now, we use a special token in mono/config which replaces $mono_libdir with the runtime-detected assemblies lib dir - e.g. /usr/lib

Unfortunately, this does not handle cases where a --libdir= value is passed to configure, such as on Red Hat where they use --libdir=/usr/lib64 on AMD64

We already have a variable from configure - reloc_libdir - so introduce some helpers to use it in the $mono_libdir replacement.

This assumes the value of --libdir is a subdirectory of --prefix, but I doubt we have ever worked at all when that is not the case.

Fixes: #41953
2016-09-20 17:02:36 +01:00
Marek Safar 9abe4d86d7 [System] Add more types to mobile profile 2016-09-20 17:55:34 +02:00
Marek Safar 7fadb5f6b3 [corlib] Remove duplicate files entries 2016-09-20 17:29:13 +02:00
Marek Safar aecdb91a06 [corlib] GC from referencesource 2016-09-20 17:29:13 +02:00
Marek Safar a83c5fba9e Merge pull request #3589 from ntherning/fix-line-ending-issues-in-System.Data-tests
Fixes line ending issues in System.Data tests
2016-09-20 17:19:12 +02:00
Niklas Therning c0584ca8ee Fixes line ending issues in System.Data tests
To make them run successfully on Windows.
2016-09-20 17:12:59 +02:00
Ludovic Henry 031bb67812 [threads] Detach thread in all possible cases (#3584)
* [threads] Use mono_thread_detach_internal to factor code

* [threads] Make sure we detach the thread before exiting

* [threads] Add mono_thread_internal_current_is_attached

* [threads] Ensure we detach the thread on Boehm
2016-09-20 17:12:37 +02:00
lateralusX b0a7eca6fd Resolve "you are registering twice the same counter address" warning on Windows Release builds.
When registering profile counters on optimized Windows build you will get the following logging twice:

"you are registering twice the same counter address"

This happens since the optimizer will collapse cpu_load_1min, cpu_load_5min and cpu_load15min into
the same function on optimized Windows builds and that is not expected by register_internal.

By preventing inlining of cpu_load we can keep the different callback methods unique and optimizer
won't fold them into one single representation in the final binary.
2016-09-20 17:07:02 +02:00
Niklas Therning bf8fc72e1b Fixes line ending issue in XmlReflectionImporterTests.Bug594490_SerializationOfXmlLangAttribute
This test is sensitive to the line ending mode used by git. When LF is used by
git (which is what Cygwin's git defaults to) this test fails on Windows since
CRLF will be used as line ending in the serialized XML. This patch changes the
test to use Environment.NewLine explicitly in the expected string.
2016-09-20 16:42:24 +02:00
Marek Safar 38bf986142 Merge pull request #3586 from henricm/fix-win-uri-tests
Ignoring URI tests with unix path on windows
2016-09-20 15:05:10 +02:00
Henric Müller cd40eb318e Only set NoDelay by default for protocol TCP 2016-09-20 14:00:39 +02:00
Marek Safar 97ede66a07 Rewrite 67cdb99 to make more sense and don't regress 2016-09-20 13:15:11 +02:00
Henric Müller 99f2a62240 Ignoring URI tests with unix path on windows
In the .NET runtime, parsing unix paths like "/foo"
on Windows fails. Therefore ignoring tests with such paths
when running tests on Windows.
2016-09-20 11:42:09 +02:00
Alexander Köplinger df39947352 Merge pull request #3578 from henricm/fix-win-process-test
Fixes for ProcessTest on Windows
2016-09-20 11:12:01 +02:00
Alexander Köplinger 443b755fbc Add link to Bugzilla ticket for unifying the behavior between .NET and Mono 2016-09-20 11:11:46 +02:00
Marek Safar ce90aa3fb3 [corlib] Cleanup more warnings 2016-09-20 11:05:39 +02:00
Marek Safar 4c90327da2 [mcs] Warn about unused local constants 2016-09-20 11:05:39 +02:00
Marek Safar e24985c6ce Merge pull request #3580 from esdrubal/msym_no_cecil_ref
[mono-symbolicate] Added Mono.Cecil sources.
2016-09-20 10:57:47 +02:00
Niklas Therning 97ed6df1e2 Merge pull request #3577 from ntherning/fix-path-to-mono-exe-in-soft-debugger-tests-on-windows
Use the path of the current executable by default in soft debugger test on Windows to launch the child mono process
2016-09-20 07:50:37 +02:00
Andi McClure 1dc438307e Safety check for "diamond dependencies" on netmodules
This is something I noticed while following up on an issue with
mcs/tests/test-418.exe. The ECMA-335 spec contains the text:

    "Usually, a module belongs only to one assembly, but it is
possible to share it across assemblies. When assembly A is loaded at
runtime, an instance of M3 will be loaded for it. When assembly B is
loaded into the same application domain, possibly simultaneously with
assembly A, M3 will be shared for both assemblies. Both assemblies
also reference F2, for which similar rules apply."

What happens in Mono when two assemblies both load the same module? We
never planned for that possibility in our architecture. Looking at our
current code, when an assembly image loads a module image into its
modules[] or files[] array, it immediately sets the "assembly" field
of that module to its own MonoAssembly. This field is a plain C
pointer with no safety on it whatsoever, and is references in various
places including by icalls. Consider the following scenario:

- Assembly A is loaded, references module M3, sets M3->assembly to
  A->assembly.
- Assembly B is loaded, references module M3, sets M3->assembly to
  b->assembly.
- Assembly B is unloaded.

At this point the image for B is unloaded, but M3 is still alive
because A keeps it alive, and its image contains a C pointer to freed
memory. There is likely some way to trigger a crash from this point.

Because the above scenario is fairly exotic, I dealt with it by just
causing the module loader to detect when multiple assemblies are
referencing the same module and throwing an exception in this case. I
also added a test to verify the exception is thrown. Allowing the
module load to raise an exception required adding _checked versions of
several functions.
2016-09-19 17:55:33 -04:00
Andi McClure f822445711 Fix leaks, checked build support around netmodules loaded as "files"
Test mcs/tests/test-418.exe was failing when running a checked build
with MONO_CHECK_MODE=metadata. I audited how images track their
modules and fixed the following issues:

1. The checked build metadata "reference audit" was following
references stored in the "modules" field, but not the "files" field. I
changed the audit code to follow both.
2. Loading a module into the "modules[]" field was causing a leak
because mono_image_addref() was being called after
mono_image_open_full(), even though mono_image_open_full itself
returns the module +1. I removed the addref.
3. Loading a module into the "files[]" field was causing a leak
because we were opening the module with mono_image_open_full and then
never attempting to close it. I modified our image close to do the
same thing to "files[]" we do to "modules[]".

In order for 1 and 3 to work, I modified MonoImages to track the size
of the "files[]" field.
2016-09-19 17:55:08 -04:00
Vlad Brezae c1051b7029 Merge pull request #3567 from BrzVlad/fix-conc-memusage2
[sgen] Fix concurrent memory usage
2016-09-19 21:05:27 +03:00
Alexander Köplinger f9db34e0cc [Facades] Another define fix
It was missed in https://github.com/mono/mono/commit/c84760250884989e10d707c049fd0aacae79c93e.
2016-09-19 19:57:45 +02:00
Marek Safar c847602508 [Facades] Use correct define 2016-09-19 18:55:49 +02:00
Alexander Köplinger fcca9846c8 Merge pull request #3522 from henricm/fix-csharp-compiler-path-windows
Using running process to determine mono exe path on windows
2016-09-19 18:25:10 +02:00
Marcos Henrich 4c99f5a645 [mono-symbolicate] Added Mono.Cecil sources.
Mono.Cecil.Mdb is not installed with mono.
Instead of reference Mono.Cecil.Mdb we now add its sources directly.
Mono.Cecil internals are visible to Mono.Cecil.Mdb, but not to
mono-symbolicate so we add Mono.Cecil source too.

Fixes mono-symbolicate not working with installed mono.
2016-09-19 17:02:54 +01:00
Alexander Köplinger a1ffb48bdf Merge pull request #3579 from radical/mcs-ignore-args
[mcs] Accept and ignore command line args supported by csc that we don't
2016-09-19 17:15:25 +02:00
Ankit Jain bbb050d0bd [mcs] Accept and ignore command line args supported by csc that we don't
.. support:

	/publicsign+
	/publicsign-
2016-09-19 11:09:55 -04:00
Marek Safar 2b2e902700 [mcs] Fixes codegen of predefined pointer arithmetic operators with user defined operator conversion for one of operands. Fixes #44440 2016-09-19 16:47:21 +02:00
Henric Müller ce1993f362 Fixes for ProcessTest on Windows
* Checking more error codes on whitespace tests.
* Using findstr instead of type to enable stdin/out pipes.
2016-09-19 16:28:30 +02:00
Niklas Therning 7de12c0fed Use the path of the current executable by default in soft debugger tests on
Windows to launch the child mono process

The 'mono' shell script generated by the Cygwin make file system doesn't work
when running the soft debugger tests against an MSVC built mono executable.
This patch first tries with the main module of the current process when
running on Windows (and mono is built using MSVC). If it looks like a mono
executable the tests will use it before falling back to the shell script.
2016-09-19 14:27:35 +02:00
Marek Safar b13b4c3e51 [bcl] Add more reflection types to monotouch 2016-09-19 13:23:16 +02:00
Marek Safar 293efaf0ac Merge pull request #3576 from ntherning/ignore-FileSecurityTest.EveryoneMayNotBeOwner-when-Administrator
Ignore the FileSecurityTest.EveryoneMayNotBeOwner test when running as Administrator
2016-09-19 12:48:19 +02:00
Marek Habersack 787b047886 [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
2016-09-19 11:51:24 +02:00
Niklas Therning c32dafe7d7 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.
2016-09-19 11:08:27 +02:00
Marek Safar 55d0f3f3ec Merge pull request #3573 from ntherning/replace-NUnit-Culture-with-SetCulture
Use NUnit's SetCulture attribute rather than Culture
2016-09-16 20:01:08 +02:00
Vlad Brezae 86044c84c2 [sgen] Trim worker gray queue after finishing concurrent mark
This was keeping around potentially many unused gray queue sections, or even constantly leaking in the case of many majors since every time we start a concurrent major we redirect some additional gray queue sections from main to worker thread gray queues, leading to unbounded growth. The gc thread always trims its gray queues at the end of the collection.

On graph8 this reduces memory usage by 5%. Fixes mem leak from #41995
2016-09-16 20:45:14 +03:00
Vlad Brezae 1a82fb7d51 [sgen] We don't need to trim the free list when finishing gray stack
We always dispose the gray queue at the end of the collection, which implies its trimming.
2016-09-16 20:45:14 +03:00
Vlad Brezae b39bc2adbb [sgen] Increase counter when actually allocating gray sections 2016-09-16 20:45:14 +03:00
Vlad Brezae 889b71116d Merge pull request #3562 from BrzVlad/fix-reverse-wbarrier
[jit] Fix missing wbarrier for array generic setter
2016-09-16 20:43:46 +03:00
Rodrigo Kumpera 1777aff514 Merge pull request #3565 from vargaz/no-free-imt-thunks
[runtime] Avoid freeing IMT thunks, some threads might still be execu…
2016-09-16 10:13:54 -07:00
Marek Safar 86a0c69448 [corlib] Add missing apis 2016-09-16 18:06:06 +02:00
Niklas Therning 5d51431e47 Merge pull request #3574 from ntherning/disable-tests-with-com-instantiation-on-mono-on-windows
Disable tests which instantiate COM objects on Windows
2016-09-16 17:04:13 +02:00
Niklas Therning 7357e0b738 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.
2016-09-16 16:59:03 +02:00
Marek Safar 9cab66800c [System.Net.Http] Show invalid values added to HttpHeaderValueCollection. to Fixes #44413. 2016-09-16 15:48:44 +02:00
Marek Safar 0dfef7b345 [mcs] Delay array base type interfaces initialization. Fixes #44402 2016-09-16 15:48:44 +02:00
Marek Safar f1b81b256d Merge pull request #3564 from henricm/thread-safe-win32eventlog-notifications
Making Win32EventLog notification thread safe
2016-09-16 14:58:29 +02:00
Niklas Therning cd277c2a7b Merge pull request #3545 from ntherning/throw-AbandonedMutexException-on-unix
Correctly handle abandoned mutexes on non-Windows platforms
2016-09-16 14:57:21 +02:00
Niklas Therning 7f78849444 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.
2016-09-16 14:55:24 +02:00
Henric Müller ab274967bc 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.
2016-09-16 14:17:17 +02:00
Ludovic Henry dbb5d536e8 [runtime] Fix build 2016-09-16 11:48:47 +02:00
Ludovic Henry 1c9e34cce5 [threads] Check InternalThread.last just after checking corlib version 2016-09-16 11:46:46 +02:00
Bernhard Urban f11615a21d [io-layer] include w32mutex-utils.h (#3568) 2016-09-16 11:24:27 +02:00
Niklas Therning b8fadb959a 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.
2016-09-16 11:07:38 +02:00
Niklas Therning 5dcbbab04e 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.
2016-09-16 11:06:38 +02:00
Marek Safar 9ed7e83881 [mcs] Report more errors for nameof expressions. Fixes #44168 2016-09-16 10:57:42 +02:00
Marek Safar 1e05158c3c Merge pull request #3566 from ntherning/fix-time-zone-issues-on-windows
Fixes time zone issues when running on Windows
2016-09-16 10:26:38 +02:00
Zoltan Varga 8612b548ee Revert "[loader] Tests for RefereceAssemblyAttribute support"
This reverts commit 31de4df835.

Revert this as the corresponding fix was reverted.
2016-09-15 19:44:10 -04:00
Aleksey Kliger 9f5115a343 [monodis] Don't segfault using cooperative GC.
monodis with coop enabled segfaulted in mono_thread_info_attach
2016-09-15 18:20:06 -04:00
Zoltan Varga 96006931db [winx64] Mark some inline functions static to hopefully fix the mxe build. 2016-09-15 14:06:25 -04:00
Zoltan Varga f732cb997b [runtime] Add a counter for the number of freed IMT trampolines. 2016-09-15 12:30:25 -04:00
Marek Safar 5e245bed38 [corlib] Use simple BinaryCompatibility as anywhere else 2016-09-15 17:22:23 +02:00
Marek Safar 39d34f4c0d [bcl] Fix few warnings 2016-09-15 17:12:38 +02:00
Marek Safar 9e1a781ab8 [man] Update few mcs sections 2016-09-15 17:11:53 +02:00
Niklas Therning c6e0d5d706 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.
2016-09-15 16:18:05 +02:00
Marek Safar 14c783f1ec [build] Add System.Numerics.Vectors to xammac profile 2016-09-15 14:16:46 +02:00
Marek Safar b37ec02e2b [mcs] Improve member lookup rules when type parameter has both non-object effective base class and interface constraint(s) 2016-09-15 13:40:15 +02:00
Zoltan Varga 354d26c852 Revert "[runtime] Check for ReferenceAssemblyAttribute when loading for execution."
This reverts commit bc9461168e.

Revert this to see if it fixes the wrench build.
2016-09-15 07:37:46 -04:00
Zoltan Varga a36b4b2d82 [runtime] Avoid freeing IMT thunks, some threads might still be executing them. This creates a memory leak, but its bounded. Fixes #39832. 2016-09-15 07:35:18 -04:00
Ludovic Henry 6e25454765 [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.
2016-09-15 10:12:07 +02:00
Marek Safar a2ee7a92be Merge pull request #3559 from mistressofjellyfish/httpcookie
[System.Web] HttpCookie load defaults from Web.config
2016-09-15 08:55:06 +02:00
Marek Safar 4c788d5d19 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.
2016-09-15 08:52:44 +02:00
Vlad Brezae 59448e9b7a [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.
2016-09-15 01:16:03 +03:00
Ludovic Henry 7eb2ea6476 [w32handle] Fix race condition when creating named mutex/event/semaphore (#3560)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=41914
2016-09-14 23:18:50 +02:00
Marek Safar 9006b7ac98 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
2016-09-14 18:39:26 +02:00
Katharina Bogad 3f665b84fe [System.Web] HttpCookie load defaults from Web.config
HttpCookie now loads default values from the Web.config,
just like the reference source does.
2016-09-14 17:57:55 +02:00
Rolf Bjarne Kvinge c213a51b70 [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.
2016-09-14 17:37:42 +02:00
Marek Safar 8f7a1683c2 [mcs] Move type constraints checks after base type definition. Fixes #44212 2016-09-14 15:42:26 +02:00
Niklas Therning 25e0b39715 Merge pull request #3536 from henricm/fix-machinename-ignorecase
Ignoring case for MachineName in EventLogTest
2016-09-14 14:57:03 +02:00
Niklas Therning 4f070dea31 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.
2016-09-14 12:00:07 +02:00
Marek Habersack d063541740 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
2016-09-14 11:18:13 +02:00
Zoltan Varga 0bcbe39b14 [runtime] Rename IMT thunks to 'trampolines'. NFC. (#3555) 2016-09-14 02:56:20 +02:00
Ludovic Henry 7421216052 [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
2016-09-13 23:40:58 +02:00
Ludovic Henry 334494de14 [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
2016-09-13 23:40:01 +02:00
Ludovic Henry bdaef1e697 [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
2016-09-13 18:41:29 +02:00
Marek Safar a26fda4e8c [System] Don't compress custom http headers in httplistener response. Fixes #34715 2016-09-13 16:11:43 +02:00
Zoltan Varga 2ffa920376 [runtime] Pass the initial context to mono_walk_stack_with_ctx () in mono_stack_walk_async_safe (). Hopefully fixes #44164. 2016-09-13 08:58:17 -04:00
Vlad Brezae fd3f90982a Merge pull request #3534 from BrzVlad/fix-conc-gcstress-mem
[sgen] Fix conc gcstress mem
2016-09-12 23:27:39 +03:00
Rodrigo Kumpera 3470747e29 Merge pull request #3541 from kumpera/add-tas-to-threading
[abort] Reduce the race window when doing Monitor:Enter.
2016-09-12 16:05:28 -04:00
Zoltan Varga 5a3736606e Bump version to 4.9.0 2016-09-12 20:59:46 +02:00
monojenkins 4e441ecc2a 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
2016-09-12 18:30:08 +01:00
Marek Safar 104fd9c638 Merge pull request #3535 from henricm/fix-always-use-preamble-length
Removing hard coded preamble length
2016-09-12 16:52:30 +02:00
Vlad Brezae ed81b4bd0a [sgen] Free major sections in bulk also on 64bit
On coreclr-gcstress this reduces the OS vmem maps by more than half.
2016-09-12 17:28:52 +03:00
Vlad Brezae f8c983b0e8 [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.
2016-09-12 17:28:52 +03:00
Vlad Brezae e6cec7897e [runtime] Replace uses of alloc functions with glib variants 2016-09-12 17:28:52 +03:00
Mark Probst 883e0a2d89 [utils] Fix internal allocator header size.
The header is always just a pointer.
2016-09-12 17:28:52 +03:00
Mark Probst 56226f83f5 [runtime] Counters for allocated virtual memory. 2016-09-12 17:28:52 +03:00
David Karlaš 8576b11c77 Merge pull request #3552 from DavidKarlas/getScopeChanges
[Debugger] GetLocals was throwing NullReferenceException(li.scopes_start) if ran against older runtime
2016-09-12 14:58:54 +02:00
David Karlaš ca1db0bc7e [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
2016-09-12 13:01:27 +02:00
Emil Sandstø 5a4a9a0e8a [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
2016-09-12 12:19:00 +02:00
Alex Rønne Petersen 0a0be23e6f Merge pull request #3550 from alexrp/revert-tp-monitor
Revert "[threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538)"
2016-09-11 16:19:41 +02:00
Alex Rønne Petersen 6f6987a257 Revert "[threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538)"
This reverts commit 2f88b8eb5a.

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 ().
2016-09-11 15:44:56 +02:00
Zoltan Varga ea15e2c577 [runtime] Remove some dead code. 2016-09-10 00:51:15 +02:00
Bernhard Urban 44520cdd9c [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
2016-09-10 00:43:40 +02:00
Bernhard Urban 802cf1dfbe [arm64] manually flush icache
should fix https://bugzilla.xamarin.com/show_bug.cgi?id=39859
2016-09-10 00:42:58 +02:00
Bernhard Urban 48c3c08e30 [arm64] flush whole emitted thunk 2016-09-09 23:53:41 +02:00
Ludovic Henry 2f88b8eb5a [threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538) 2016-09-09 23:41:34 +02:00
Zoltan Varga aaed951757 Remove a debug printf. 2016-09-09 20:08:06 +02:00
Zoltan Varga 038def9851 Add missing file. 2016-09-09 19:59:45 +02:00
Zoltan Varga 7e3028c2c8 [sdb] Add a MethodMirror:GetScopes () method which returns scope information. 2016-09-09 19:58:59 +02:00
cmp 55125d38c9 Remove obsolete stack limit checks on Windows
mono_thread_info_get_stack_bounds has been updated to correctly report
the stack reserved base address quite some time ago.
Remove a couple of checks that still assume the old behavior of
reporting the committed base address.
2016-09-09 18:25:40 +01:00
Ludovic Henry a81a6173b8 [threads] Add specific field to check size (#3542) 2016-09-09 16:23:34 +02:00
Ludovic Henry 348d793ebb [threadpool-ms] Replace win32 semaphore by coop semaphore (#3519) 2016-09-09 12:09:18 +02:00
Ludovic Henry 299b257efb [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)
2016-09-09 11:38:30 +02:00
Zoltan Varga 2acdc49ff6 [llvm] Disable llvm again for methods with large basic blocks in non-llvm-only mode, the workaround doesn't seem to work. Fixes #42395. 2016-09-09 03:14:24 +02:00
monojenkins c8ab84a20a 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.
2016-09-09 01:45:04 +01:00
Vlad Brezae 3fd54893bc Merge pull request #3528 from BrzVlad/fix-sgen-check-before-collections
[sgen] Fix sgen debug flags
2016-09-09 02:54:48 +03:00
Rodrigo Kumpera 60e0a82be2 [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.
2016-09-08 16:08:40 -07:00
Rodrigo Kumpera 6040e79f92 [threads] Add mono_threads_is_ready_to_be_interrupted helper to figure out whether a thread is ready to be interrupted. 2016-09-08 16:08:40 -07:00
Rodrigo Kumpera cfeda495ea [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.
2016-09-08 16:08:39 -07:00
Rodrigo Kumpera 045c8d9982 [logging] Fix g_error not aborting. 2016-09-08 15:58:08 -07:00
Ludovic Henry 668ee608eb [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
2016-09-08 17:17:28 +02:00
Niklas Therning 8468603a7c Merge pull request #3537 from ntherning/fix-failing-ThreadTest-tests-on-windows
Remove Assert.Fail() calls in ThreadTest when running on Windows
2016-09-08 16:31:58 +02:00
Niklas Therning 17d5e53ac8 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.
2016-09-08 15:28:34 +02:00
Henric Müller 8fd49882a5 Ignoring case for MachineName in EventLogTest 2016-09-08 14:57:44 +02:00
Jonathan Chambers 12d1d63b8a 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
2016-09-08 14:28:59 +02:00
Henric Müller 3ce9192edf 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.
2016-09-08 14:15:32 +02:00
Alexander Köplinger 43ffa41898 Merge pull request #3532 from alexrp/profiler-stress-tests
[acceptance-tests] Add profiler-stress suite.
2016-09-08 07:23:40 +02:00
Alex Rønne Petersen 7d7b674ac5 [acceptance-tests] Add profiler-stress suite. 2016-09-08 07:04:39 +02:00
Alex Rønne Petersen 8f3dacc509 Merge pull request #3531 from alexrp/master
[profiler} Don't crash if a zero sampling frequency is given.
2016-09-08 03:18:40 +02:00
Alex Rønne Petersen e5a68998b7 [profiler} Don't crash if a zero sampling frequency is given. 2016-09-08 02:20:32 +02:00
Henric Müller f577b619e9 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.
2016-09-07 15:30:55 +02:00
Niklas Therning a231b0a82c Merge pull request #3511 from henricm/fix-no-socket-reuse
Not reusing sockets in dual mode tests
2016-09-07 15:23:54 +02:00
Henric Müller 67cdb99406 Using running process to determine mono exe path on windows
Extracting mono, mcs, vbnc, al and gac path lookup to a common class.
On windows we now also check the running process to try to determine
the mono.exe.
2016-09-07 14:49:10 +02:00
Ludovic Henry f4d9546f3c [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
2016-09-07 14:28:46 +02:00
Alex Rønne Petersen 1fd62ac204 Merge pull request #3526 from alexrp/master
[sgen] Don't consider managed write barriers to be critical methods.
2016-09-07 03:00:48 +02:00
Vlad Brezae ad563e4352 [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.
2016-09-07 03:14:32 +03:00
Manu d251fcc2cd Rename local file into socket_fd (#3524)
This is to avoid hiding the static gint `file` and to better understand the code.
2016-09-07 00:28:16 +02:00
Ludovic Henry cf29167326 Merge pull request #3509 from ludovic-henry/iolayer-extract-threading
[mono-threads] Keep cleaning up mono-threads after iolayer extraction
2016-09-07 00:18:23 +02:00
Alex Rønne Petersen 2cfd9db070 [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.
2016-09-06 20:51:13 +02:00
Vlad Brezae 4d577807ed [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.
2016-09-06 20:01:28 +03:00
Vlad Brezae e8bf41f58d [sgen] Fix mod union consistency check
We don't need a mod union to mark an object with concurrent mark&sweep.
2016-09-06 19:59:24 +03:00
Vlad Brezae 743a184be0 [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.
2016-09-06 19:59:23 +03:00
Vlad Brezae 971883045a [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.
2016-09-06 19:59:23 +03:00
Vlad Brezae a6914676d1 [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.
2016-09-06 19:59:22 +03:00
Ludovic Henry fa41710fe0 [mono-threads] Have error in case we cannot set thread priority 2016-09-06 17:01:27 +02:00
Ludovic Henry f4f7bf559b [mono-threads] Fix win32 to posix priority conversion 2016-09-06 17:01:26 +02:00
Ludovic Henry 22fdfbfafe [mono-threads] Store handle related data in MonoThreadInfo 2016-09-06 17:00:02 +02:00
Ludovic Henry e687b1277e [mono-threads] Assert that we do not try to signal the handle multiple times 2016-09-06 17:00:00 +02:00
Alexander Köplinger faf790bd02 Merge pull request #3518 from akoeplinger/fix-fileiopermission
[corlib] Ensure FileIOPermission ctor is not called on mobile
2016-09-06 15:17:30 +02:00
Alexander Köplinger 5e6fdbd71d [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.
2016-09-06 12:27:26 +02:00
Alexander Köplinger ef85a70d45 Merge pull request #3525 from henricm/fix-access-level-get-token
Using max level allowed when getting current token
2016-09-06 12:24:39 +02:00
Henric Müller f99d80d3be 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.
2016-09-06 10:08:50 +02:00
Miguel de Icaza a14e0d7c4b [mcs/Makefile] make the 'btest' (bootstrap test) target work again 2016-09-05 21:39:03 -04:00
Zoltan Varga 534f48a15d [jit] Unify the handling of 'error' and 'exc' in the llvm-only and non llvm-only runtime invoke code. Fixes #41961. 2016-09-06 02:22:03 +02:00
Joshua Peterson 895f3f5ae8 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.
2016-09-05 23:43:55 +02:00
Zoltan Varga 56ec616f73 [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. 2016-09-05 23:02:08 +02:00
Alexander Köplinger b41a4217cc Merge pull request #3521 from ntherning/fix-failures-in-RegistryKeyTest-on-windows
Fix for failures in RegistryKeyTest on Windows
2016-09-05 18:17:22 +02:00
Alexander Köplinger beedbc9116 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
2016-09-05 17:39:33 +02:00
Niklas Therning 48416ee7ac 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.
2016-09-05 15:15:11 +02:00
Alexander Köplinger 71694e1e9d 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
2016-09-05 13:42:57 +02:00
Niklas Therning db075cce35 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
b90617e7b7.
2016-09-05 13:31:51 +02:00
Vlad Brezae 6829e52344 [sgen] Remove unused parameter
We never do nursery collections as part of the concurrent finishing pause
2016-09-05 14:12:00 +03:00
Niklas Therning a611abd2d8 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.
2016-09-05 10:45:26 +02:00
Alexander Köplinger 9d40383ca9 [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.
2016-09-04 20:11:36 +02:00
Alexander Köplinger d06a5075a8 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
2016-09-04 11:12:01 +02:00
Alex Rønne Petersen 2a96404f87 Merge pull request #3517 from alexrp/master
[man] Update mprof-report.1 to cover new profiler options.
2016-09-03 22:14:16 +02:00
Niklas Therning 16bfa4ec2f 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.
2016-09-03 22:10:59 +02:00
Alex Rønne Petersen bc8a54795e [man] Update mprof-report.1 to cover new profiler options.
Also reformat some sections a bit.
2016-09-03 17:05:52 +02:00
Zoltan Varga 8c239d6e51 [SRE] Move the resolving of user types to managed code, the runtime was not using write barriers. (#3515) 2016-09-03 04:08:40 +02:00
Zoltan Varga 462dd05a95 [runtime] Fix a C&P problem introduced by d4052c5563. 2016-09-03 02:59:20 +02:00
Zoltan Varga 5589845bf3 [SRE] Remove empty TypeBuilder:setup_generic_class () icall. 2016-09-02 21:39:53 +02:00
Zoltan Varga d5321089bb [runtime] Remove the stub of ves_icall_TypeBuilder_create_internal_class (). 2016-09-02 21:33:26 +02:00
Zoltan Varga 8638f0605f [corlib] Fix the signature of a few SRE icalls, they already receive a TypeBuilder as the 'this' argument. 2016-09-02 21:30:29 +02:00
Aleksey Kliger (λgeek) c8287cd329 Merge pull request #3446 from lambdageek/bug-42584
[loader] Check for ReferenceAssemblyAttribute when loading
2016-09-02 10:31:42 -04:00
Marek Safar 7e19f1f62b [mcs] Adjust correctly newline counter inside pragma warning 2016-09-02 16:21:25 +02:00
Marek Safar 1a69613fde [corlib] Add timeout to failing test 2016-09-02 15:46:07 +02:00
Marek Safar bc54b1ed7b Merge pull request #3506 from ntherning/make-ZoneTest-succeed-on-mono-on-windows
Make Zone.CreateFromUrl() work with URLs like file://C:\foo\bar
2016-09-02 15:01:32 +02:00
Marek Safar 2ad252a24f Merge pull request #3452 from ntherning/fix-AppDomainSetupTest-on-windows
Validate AppDomainSetup.ApplicationBase path more like .NET does
2016-09-02 11:25:15 +02:00
Henric Müller 54606e4880 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.
2016-09-02 11:09:30 +02:00
Marek Safar ceb298c91e [System.Core] Allow TryConvert to return null for any reference types (not only object). Fixes #41509 2016-09-02 11:02:52 +02:00
Aleksey Kliger bc9461168e [runtime] Check for ReferenceAssemblyAttribute when loading for execution. 2016-09-01 17:53:26 -04:00
Aleksey Kliger 31de4df835 [loader] Tests for RefereceAssemblyAttribute support 2016-09-01 17:53:26 -04:00
Aleksey Kliger c9232d7c61 [runtime] Add mono_assembly_get_reference_assembly_attribute
Checks whether the given assembly has the
System.Runtime.CompilerServices.ReferenceAssemblyAttribute applied.
2016-09-01 17:52:14 -04:00
Rodrigo Kumpera 1a337a898c Merge pull request #3455 from kumpera/abort_cctor
[runtime] Don't abort .cctors. Fixes #43320
2016-09-01 17:49:32 -04:00
Ludovic Henry 012e176979 [mono-threads] Factor common platform create thread code (#3484) 2016-09-01 21:22:51 +02:00
Miguel de Icaza bb1eda94c0 Bundle other options (#3501)
* [mkbundle] add support for baking environment variables, make endian-independent

* [runtime] Bundle support, implement missing stream processing
2016-09-01 12:58:48 -04:00
Alexander Köplinger 5c36996721 Merge pull request #3498 from mattleibow/bug-41723
[Mono.Data.Sqlite] Added checks for entry point existence
2016-09-01 18:17:46 +02:00
Niklas Therning 3a2063b071 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.
2016-09-01 16:43:50 +02:00
Niklas Therning 4a066c4504 Merge pull request #3503 from ntherning/fix-MarshalTest.GetHINSTANCE-on-mono-windows
Ignore the MarshalTest.GetHINSTANCE() test on Mono on Windows
2016-09-01 16:41:58 +02:00
Niklas Therning 72c153f098 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
2016-09-01 16:41:17 +02:00
Niklas Therning c862a7b423 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.
2016-09-01 16:30:40 +02:00
Niklas Therning 133e8a43cb Ignore the MarshalTest.GetHINSTANCE() test on Mono on Windows
Won't work on Mono even when running on Windows.
2016-09-01 16:25:01 +02:00
Matthew Leibowitz f44e145ac5 [Mono.Data.Sqlite] Using the Version class to do the version comparison correctly 2016-09-01 16:02:44 +02:00
Miguel de Icaza be3d436e4a Typo fix 2016-09-01 09:22:16 -04:00
Jo Shields 02f0dd9660 Add a man page for cert-sync (#3424) 2016-09-01 09:21:15 -04:00
Zoltan Varga 4664161ae3 [runtime] Add a mono_threads_close_thread_handle () function and use it to close thread handles instead of CloseHandle (). (#3497) 2016-09-01 13:34:00 +02:00
Bernhard Urban 097c8e17cb 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]
2016-09-01 07:22:17 +02:00
monojenkins 49a0494ecb Merge pull request #3499 from kumpera/fix_logging
[logging] Ensure glib logging redirection and remove unwanted new pub api functions.
2016-09-01 03:40:12 +01:00
Matthew Leibowitz b70d1330a7 [Mono.Data.Sqlite] Instead of try/catch and dlopen/dlsym, use a cross-platform, correct way of determining API features: version 2016-09-01 04:09:00 +02:00
Rodrigo Kumpera 8abb08a8cf [threading] Update comments. 2016-08-31 17:49:48 -07:00
Rodrigo Kumpera 4729a107b1 [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.
2016-08-31 17:45:31 -07:00
Rodrigo Kumpera 1764718ce5 [runtime] Add test for the interactions between thread abort and .cctors.
This covers bug #43320
2016-08-31 17:45:31 -07:00
Rodrigo Kumpera 152a3943ae [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.
2016-08-31 17:45:31 -07:00
Rodrigo Kumpera 48d1f5cd09 [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.
2016-08-31 17:45:31 -07:00
Rodrigo Kumpera 168394fb2f [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.
2016-08-31 17:43:36 -07:00
Matthew Leibowitz d2c68ea932 [Mono.Data.Sqlite] Make the fields read-only 2016-09-01 01:28:06 +02:00
Matthew Leibowitz 4ca0a0b853 [Mono.Data.Sqlite] Added iOS specific checks for entry point existence:
- using dlfcn.dlsym to avoid P/Invoke exceptions
2016-09-01 01:25:04 +02:00
Rodrigo Kumpera e669004045 [logging] Move internals that were landed in public headers by mistake. 2016-08-31 16:23:56 -07:00
Zoltan Varga da7e234b3c [runtime] Fix a warning. 2016-09-01 01:15:54 +02:00
Alex Rønne Petersen b877d6f3d9 [profiler] Fix some off-by-ones in header size calculation. 2016-09-01 01:03:55 +02:00
Alex Rønne Petersen e36583e871 Merge pull request #3493 from alexrp/master
Follow-up PR for #3481
2016-09-01 01:03:41 +02:00
Zoltan Varga 5621b5878b [corlib] Disable CS0169 for RuntimeStructs.cs. 2016-09-01 00:59:30 +02:00
Zoltan Varga 2cab627a7c [llvm] Error out when using --aot=llvmonly in a runtime compiled without llvm. 2016-09-01 00:56:52 +02:00
Zoltan Varga f9fe66adba [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. 2016-09-01 00:41:12 +02:00
Alex Rønne Petersen b0334d6cf9 [profiler] Include arguments, architecture, and OS in format header.
Bumped the major/minor version to 1.0 for this change.
2016-09-01 00:34:26 +02:00
Alex Rønne Petersen 5f419ae489 [profiler] Fix dump_header () to do fflush () in all non-gzip code paths. 2016-09-01 00:34:25 +02:00
Alex Rønne Petersen cd34142b77 [runtime] Export API functions to get arch/os/wordsize strings. 2016-09-01 00:34:25 +02:00
Alex Rønne Petersen ece3faccab [profiler] Remove duplicate #include. 2016-09-01 00:34:24 +02:00
Alex Rønne Petersen 8982a5c794 [profiler] Update documentation for time fields. 2016-09-01 00:34:24 +02:00
Alex Rønne Petersen f1ee1fbf3b [profiler] Document the TYPE_EXCEPTION format. 2016-09-01 00:34:23 +02:00
Alex Rønne Petersen f170865301 [profiler] Clean up some enums a bit. No format change. 2016-09-01 00:34:22 +02:00
Alex Rønne Petersen 414315dca5 [profiler] Update documentation on the backtrace format. 2016-09-01 00:34:22 +02:00
Alex Rønne Petersen cd7478ec96 [profiler] Pump the hazard free queue when shutting down. 2016-09-01 00:34:21 +02:00
Alex Rønne Petersen c17926d622 [utils/hp] Export mono_thread_hazardous_try_free_all () for use in the profiler. 2016-09-01 00:34:20 +02:00
Alex Rønne Petersen 66cf06f9b9 [utils/hp] Keep pumping the free queue even when we encounter hazardous items.
Previously, a single item being hazardous for a while could completely block
pumping of the queue. This fixes that.
2016-09-01 00:34:16 +02:00
Zoltan Varga 02ffe591f7 [runtime] Fix the method stored in the WrapperInfo for delegate-invoke wrappers for shared methods. Fixes #43696. 2016-09-01 00:25:38 +02:00
Bernhard Urban 4e8e5369ae [mini] emit sequence point before branching off for tail call 2016-08-31 22:36:19 +02:00
Niklas Therning 89ce2b94f3 Merge pull request #3473 from ntherning/fix-thread-double-close-handle-on-appdomain-unload
Fix for double CloseHandle() on AppDomain unload
2016-08-31 22:08:29 +02:00
Niklas Therning 3452b3d990 Merge pull request #3496 from ntherning/fix-heap-corruption-on-windows
Fixes two heap corruptions in the corlib tests on Windows
2016-08-31 20:22:13 +02:00
Aleksey Kliger (λgeek) 7dc4bb5aca Merge pull request #3395 from lambdageek/dev/handles-strings
[runtime] Use coop handles in some String-returning icalls
2016-08-31 13:23:52 -04:00
Niklas Therning e8fd99043a Fixes two heap corruptions in the corlib tests on Windows
The patch of mono/metadata/marshal.c makes sure that
Marshal.StringToHGlobalAnsi() allocates a memory area for the returned C
string which is at least as large as the length of the string object. This is
the behavior on non-Windows platforms. Without this patch the
MarshalTest.StringToHGlobalAnsiWithNullValues() test wrote outside of a memory
area and corrupted the heap which later on caused a heap corruption crash when
running the corlib test suite on Windows.

The patch of mono/metadata/mono-security.c fixes the freeing of the memory
returned by GetNamedSecurityInfoW(). When GetNamedSecurityInfoW() is used to
request a DACL one must also pass an argument for the ppSecurityDescriptor
parameter and this is the one that should be freed later on, not the pointer
to the DACL as the original code used to free. Before this patch
DSACryptoServiceProviderTest.UseMachineKeyStore() crashed because of a heap
corruption.
2016-08-31 19:11:24 +02:00
Marek Safar 07f9a6fc17 Bump cecil 2016-08-31 16:28:02 +02:00
Alexander Köplinger 882749b0b2 Merge pull request #3494 from akoeplinger/netstd-fixes
Expose a few more types/methods for netstandard
2016-08-31 13:52:49 +02:00
Alexander Köplinger 02d1ff2d38 [corlib] Add Environment APIs that take EnvironmentVariableTarget on mobile
We only do something when target is "Process", this matches CoreFX behavior.
2016-08-31 13:33:53 +02:00
Alexander Köplinger 19dae8eb86 [System.Core] Add a couple of System.IO.Pipes classes to the mobile profiles
These are required for netstandard parity.
2016-08-31 13:15:14 +02:00
Marek Safar 999fb3c8d1 [System] HttpWebRequest::Headers setter was only setting local variable. Fixes #42408 2016-08-31 12:13:12 +02:00
Bernhard Urban 913d6f9c56 Merge pull request #3470 from lewurm/fix-aot-compiler-toolchain-ld-invoke
[aot] fix linker invocation
2016-08-31 11:45:58 +02:00
Marek Safar 3bfbaa165d Merge pull request #3487 from marek-safar/rs-Threading
[corlib] Flow CultureInfo from parent thread. Fixes #43193
2016-08-31 07:57:02 +02:00
Marek Safar 4b5eace32d Merge pull request #3489 from akoeplinger/fix-latin1-surrogatepair
[corlib] Fix replacement of UTF-16 surrogate pairs in Latin1Encoding
2016-08-31 07:52:38 +02:00
Zoltan Varga e15f21ba18 Only set the attached flag when a client attaches (#3490)
In defer mode, the debugger thread is started as soon as possible before
any clients are attached, but the debugger is_attached flag was being set
immediately. This would cause the runtime (and the System.Diagnostics.Debugger
class) to wrongly report a client as being attached.

Originally fixed in the Unity fork here: https://github.com/Unity-Technologies/mono/commit/797a210e0f2416d779c448bb9e03bb16933e261f
2016-08-31 02:56:54 +02:00
Josh Peterson f4128e317e Only set the attached flag when a client attaches
In defer mode, the debugger thread is started as soon as possible before
any clients are attached, but the debugger is_attached flag was being set
immediately. This would cause the runtime (and the System.Diagnostics.Debugger
class) to wrongly report a client as being attached.

Originally fixed in the Unity fork here: https://github.com/Unity-Technologies/mono/commit/797a210e0f2416d779c448bb9e03bb16933e261f
2016-08-30 20:49:47 -04:00
Rodrigo Kumpera 4f6fb3002d Merge pull request #3488 from Unity-Technologies/threadpool-unhandled-exception-policy-legacy
Always clear thread abort exception for internal/threadpool threads
2016-08-30 15:44:20 -07:00
Alex Rønne Petersen 2b03fe54d7 Merge pull request #3481 from alexrp/master
Even more profiler fixes/improvements
2016-08-31 00:23:43 +02:00
Alex Rønne Petersen 2db49df290 Merge pull request #3464 from alexrp/arm64-native-atomics
[runtime] Fix C and LLVM atomics on ARM64
2016-08-30 21:47:14 +02:00
Alex Rønne Petersen 24b1ec360e [utils] Remove ia64-specific atomics/membar code.
All ia64 compilers have intrinsics that we use. Also, this ia64 code was very
out of date (missing many functions we use now) so it wouldn't compile anyway.
2016-08-30 21:12:32 +02:00
Alex Rønne Petersen 062ccc0d7e [llvm] Fix atomic opcodes on ARM64 to emit correct fences.
This is a workaround. It's needed for the same reason that we need the fix for
Clang's atomic intrinsics in mono/utils/atomic.h.
2016-08-30 21:12:32 +02:00
Alex Rønne Petersen 66fa2d770d [utils/atomic] Fix native atomic intrinsics on buggy ARM64 compilers.
See the comment in atomic.h for details.
2016-08-30 21:12:32 +02:00
Alex Rønne Petersen b23579f4a0 [utils] Add a MONO_GNUC_VERSION macro. 2016-08-30 21:12:32 +02:00
Marek Safar 54ea12e4fa [corlib] Flow CultureInfo from parent thread. Fixes #43193 2016-08-30 20:42:25 +02:00
Alexander Köplinger cc22315b6f [corlib] Fix replacement of UTF-16 surrogate pairs in Latin1Encoding
When encoding a UTF-16 C# string into bytes using "latin-1"/"iso-8859-1" encoding we were
not properly taking surrogate pairs into account. MSDN[1] provides a good introduction about the topic.

For example, this string would fail to encode and throw an IndexOutOfRangeException: "\ud83d\ude0a "
However, this string would not: "\ud83d\ude0a" (note missing space at the end). More on that later.

In https://bugzilla.xamarin.com/show_bug.cgi?id=42887 it was noted that encoding the string
didn't cause the exception on Mono 2.10.8.1 and 3.2.8. Indeed, it doesn't happen until Mono 4.0
where we switched most of the string code to referencesources.

While looking at the output of `Encoding.GetEncoding("latin1").GetBytes("\ud83d\ude0a ")` on the
"working" Mono verions I noticed that they essentially returned wrong results, e.g.:

```
csharp> Encoding.GetEncoding("latin1").GetBytes("\ud83d\ude0a ")
{ 63, 32, 0 }
```

This is wrong, because a) there's only one 63 (i.e. the '?' question mark char which is used as
a replacement char whenever the target encoding doesn't support a specific char,
and b) there is a trailing '\0' which should not be there.

Checking on .NET confirms the expected result: { 63, 63, 32 } i.e. '?? '

Back to the IndexOutOfRangeException in Mono 4.0+: digging into Latin1Encoding.InternalGetBytes() it
turns out that when we detect a surrogate pair we were incrementing charIndex, but we didn't decrement count.
This means that after the fallback characters (the two '?') were added we would still try to encode one more
char in the loop even though we're already at the end of the string, resulting in the exception.
For the "\ud83d\ude0a" example we would not hit the `count > 1` code path which made it work in this case.

Adding the decrement fixes the bug and makes the code consistent with MonoEncoding.cs[2].

The reason why it "worked" in earlier Mono versions was that we had a very simple EncoderReplacementFallbackBuffer
implementation[3] which only output a single '?' for the surrogate pair:

```
csharp> var buf = Encoding.GetEncoding("latin1").EncoderFallback.CreateFallbackBuffer()
csharp> buf.Fallback((char)0xD800, (char)0xDC00, 0)
true
csharp> buf.GetNextChar()
'?'
csharp> buf.GetNextChar()
'\x0

csharp> buf.Fallback((char)0xD800, (char)0xDC00, 0)
true
csharp> buf.GetNextChar()
'?'
csharp> buf.GetNextChar()
'?'
csharp> buf.GetNextChar()
'\x0'
```

This means that for the "\ud83d\ude0a " example from above we would only add one '?' character
for the surrogate pair to the result buffer, then the space and then we'd be done, leaving the
uninitialized array value 0 in the buffer on index 2.

I added tests for Latin1Encoding, mostly copied from ASCIIEncoding with additions for these
specific cases.

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

[1] https://msdn.microsoft.com/en-us/library/ms404377(v=vs.110).aspx
[2] https://github.com/mono/mono/blob/5b69e839e12b3d3512f310aa5a0e873346d7e50e/mcs/class/I18N/Common/MonoEncoding.cs#L62-L66
[3] https://github.com/mono/mono/blob/mono-3.12.0-branch/mcs/class/corlib/System.Text/EncoderReplacementFallbackBuffer.cs
2016-08-30 20:36:20 +02:00
Marek Safar 5b69e839e1 Merge pull request #3477 from Unity-Technologies/create-delegate-exception
Throw an ArgumentException when a delegate is bound to an open generi…
2016-08-30 19:05:29 +02:00
Jonathan Chambers 968b23e5da Reset thread abort exception for internal threads regardless of unhandled exception policy. 2016-08-30 11:32:53 -04:00
Josh Peterson 2a6e768884 Make improvments after code review:
* Use mono_set_pending_exception instead of mono_raise_exception
* Make the test an nunit test instead of a runtime test.
2016-08-30 10:46:02 -04:00
Ludovic Henry 57f8cb189f [mono-threads] Use create_suspended_sem on windows (#3482) 2016-08-30 12:45:53 +02:00
Marek Safar 76a61357ef Merge pull request #3483 from alexavator/bugfix-keepalive
[System] Set KeepAlive flag for HttpWebRequest
2016-08-30 11:02:43 +02:00
Pozdeev b7754c85fd [System] Set KeepAlive flag for HttpWebRequest 2016-08-30 13:36:21 +05:00
Ludovic Henry e8a221683d [pedump] Fix assertion error
We would previously observe the following crash:

```
ludovic-laptop :: ~/Xamarin/mono ‹16c07b5› » (cd tools/pedump && MONO_PATH=../../mcs/class/lib/net_4_x lldb -- ./pedump --verify metadata,code ../.././mono/tests/xdomain-threads.exe)
(lldb) target create "./pedump"
Current executable set to './pedump' (x86_64).
(lldb) settings set -- target.run-args  "--verify" "metadata,code" "../.././mono/tests/xdomain-threads.exe"
(lldb) r
Process 14407 launched: './pedump' (x86_64)
mono_os_mutex_lock: pthread_mutex_lock failed with "Invalid argument" (22)
Process 14407 stopped
* thread #1: tid = 0x27c9715, 0x00007fff93cfcf06 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff93cfcf06 libsystem_kernel.dylib`__pthread_kill + 10
	libsystem_kernel.dylib`__pthread_kill:
	->  0x7fff93cfcf06 <+10>: jae    0x7fff93cfcf10            ; <+20>
	    0x7fff93cfcf08 <+12>: movq   %rax, %rdi
        0x7fff93cfcf0b <+15>: jmp    0x7fff93cf77cd            ; cerror_nocancel
	    0x7fff93cfcf10 <+20>: retq
(lldb) bt
* thread #1: tid = 0x27c9715, 0x00007fff93cfcf06 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff93cfcf06 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff8b9b74ec libsystem_pthread.dylib`pthread_kill + 90
	frame #2: 0x00007fff908d56e7 libsystem_c.dylib`abort + 129
	frame #3: 0x000000010022da6a pedump`monoeg_log_default_handler(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, message="mono_os_mutex_lock: pthread_mutex_lock failed with \"Invalid argument\" (22)", unused_data=0x0000000000000000) + 202 at goutput.c:231
	frame #4: 0x000000010022d98d pedump`monoeg_g_logv(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, format="%s: pthread_mutex_lock failed with \"%s\" (%d)", args=0x00007fff5fbff4a0) + 109 at goutput.c:111
	frame #5: 0x000000010022dbd9 pedump`monoeg_g_log(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, format="%s: pthread_mutex_lock failed with \"%s\" (%d)") + 361 at goutput.c:121
	frame #6: 0x000000010022301e pedump`mono_os_mutex_lock(mutex=0x00000001002ec630) + 110 at mono-os-mutex.h:98
	frame #7: 0x0000000100223a66 pedump`mono_w32handle_new(type=MONO_W32HANDLE_PROCESS, handle_specific=0x00007fff5fbff540) + 246 at w32handle.c:440
	frame #8: 0x00000001001ef8bb pedump`_wapi_processes_init + 123 at processes.c:1149
	frame #9: 0x00000001001fbcc3 pedump`wapi_init + 19 at wapi.c:23
	frame #10: 0x0000000100116486 pedump`mono_init_internal(filename="pedump", exe_filename=0x0000000000000000, runtime_version="v4.0.30319") + 102 at domain.c:528
	frame #11: 0x0000000100117124 pedump`mono_init_version(domain_name="pedump", version="v4.0.30319") + 36 at domain.c:868
	frame #12: 0x0000000100001496 pedump`verify_image_file(fname="../.././mono/tests/xdomain-threads.exe") + 678 at pedump.c:466
	frame #13: 0x0000000100000f87 pedump`main(argc=4, argv=0x00007fff5fbff9a0) + 1095 at pedump.c:708
	frame #14: 0x00007fff93e655ad libdyld.dylib`start + 1
```

That would be because the w32handle wouldn't be initialized before calling into `wapi_init` which allocates w32handle.
2016-08-30 10:26:04 +02:00
Ludovic Henry 16c07b50f3 Merge pull request #3476 from lambdageek/fix-conc-ht
[test-conc-hashtable] Init w32 handles. Fixes OSX+coop.
2016-08-30 10:04:32 +02:00
Alex Rønne Petersen 9a14246053 [profiler] Reject heapshot requests if we're not in on-demand mode.
Previously, we would try to satisfy the heapshot request every single time
process_requests () was invoked, but since heap_walk () would never unset
heapshot_requested, we'd end up doing GCs over and over, causing massive
overhead.
2016-08-30 10:01:07 +02:00
Alex Rønne Petersen 39951e43ef [profiler] Process on-demand heapshot requests on the finalizer thread.
This way, we avoid attempting to fully attached the helper thread when it's
already a tools thread, which can lead to all sorts of problems.
2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 16ea17a5e1 [profiler] Add GC finalization events to the format. 2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 0c0e3702a4 [gc] Expose mono_gc_pending_finalizers () and mono_gc_finalize_notify () as public API.
We need these in the profiler, but they are also generally useful functions
that embedders may very well want to use.
2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 138adfc043 [profiler] Add GC finalization callbacks to the profiler API. 2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 8310af2230 [profiler] Initialize counters in the runtime_initialized () callback.
This way, we don't have to depend on the counters subsystem having been
initialized when the profiler library is loaded (very early).
2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 7240d72222 [profiler] Normalize time fields in the format.
All events now come with a time field right after the event byte, and it is
encoded in the same way for all events (based on LogBuffer.time_base).

This allows readers to queue up events until a sync point event, then sort all
of those events by time, and process them in the order they were actually
written in.
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen 41dc6f631c [profiler] Make the comment in proflog.c only represent the latest version of the format.
Maintaining it for every format version is getting unwieldy and most readers
likely won't care about ancient format versions. Further, we haven't really
stabilized the format yet, so documenting every iteration of it doesn't make
a whole lot of sense. Finally, if somebody does care about older versions,
they can simply look in decode.c to see how mprof-report deals with them.
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen bdd9db1ed1 [profiler] Fix a few format bloat and encoding issues since we're bumping the format version.
* Methods in backtraces are now properly encoded based on the method_base
  rather than the ptr_base.
* The unused IL and native offset fields in TYPE_SAMPLE_HIT's backtrace frame
  format have been removed.
* The unused flags fields in the backtrace format and in metadata events have
  been removed.
* Changed a number of fields to be encoded as a single byte instead of LEB128.
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen 02d148fd88 [profiler] Emit sync point events when flushing all buffers.
These events basically establish points in the event stream where all previous
events can be processed and a complete view of the profiling state can be
formed. For instance, if an allocation event for object A of type T was seen
before a sync point, then it's guaranteed that the class load event for T also
came before that sync point (although it may have arrived after the allocation
event for A).
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen 4f62b5af43 [profiler] Acquire the exclusive buffer lock after the suspend lock.
This prevents possible STW deadlocks.
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen 25edbd406f [profiler] Only flush buffers when they exceed the base capacity.
Other than timely arrival, there was never really a need to force buffers to be
flushed at these arbitrary points. Now that we flush all buffers periodically,
that reason is no longer relevant.
2016-08-30 10:01:04 +02:00
Alex Rønne Petersen a34946226e [profiler] Process requests in enter/leave callbacks regardless of call depth.
Heapshots have nothing to do with call depth, so they should be processed in
any case.

Also flush the local buffer in all enter/leave callbacks if needed.
2016-08-30 10:01:04 +02:00
Alex Rønne Petersen 2ccdecec40 [profiler] Periodically flush all thread-local buffers.
This ensures that even for low-activity threads, it won't take ages before the
events from it arrive. We do this flush every 1sec (as with sampling of perf
counters).
2016-08-30 10:01:04 +02:00
Alex Rønne Petersen 12e4a840ae [profiler] Implement global flush points for thread-local buffers.
The problem is this: Given an allocation of object O on address A1 in thread T1
and a subsequent GC move of O from A1 to A2 in T2, if T2's event buffer is
flushed before T1's buffer, the reader of the log file will a seemingly
nonexistent object being moved, and then see the actual allocation of that
object later. This makes it extremely difficult to keep track of the managed
heap.

The way we solve this is by flushing all thread-local buffers when the GC stops
the world. This way, we know that all prior allocations in the program have
been committed to the log file before any moves that are about to follow as
part of the collection. Similarly, we flush the GC thread's buffer before
restarting the world to ensure that all moves are committed before allocations
that may happen later (which could use some of the addresses freed up for use
due to the moves).

This is reasonably easy now that we have a global LLS of threads which are
attached to the profiler. However, we have to use some kind of lock to ensure
that buffers aren't being written to while we're trying to flush them, or that
a suspended thread was in the middle of modifying its buffer. For this, we use
a reader/writer spin lock of sorts, somewhat similar to the lock used by the
SGen binary protocol. When threads are modifying their own buffer (whether it
be writing to it or flushing it), they take the reader lock. This means that
many different threads can be operating on their own buffers without any lock
contention (which would kinda defeat the purpose of the thread-local buffers).
Now, when a thread -- such as the thread that initiated a GC -- wants to access
the buffers of other threads, it takes the writer lock. In doing so, all other
threads are prevented from modifying their own buffers. This gives the thread
holding the writer lock an opportunity to flush the buffers of other threads.
2016-08-30 10:01:04 +02:00
Alex Rønne Petersen ed552792d4 [utils/threads] Export mono_thread_info_yield () for use in the profiler. 2016-08-30 10:01:04 +02:00
Alex Rønne Petersen 869585c2a6 [profiler] Remove LogBuffer.locked and related debugging code.
This hasn't been needed for a long time.
2016-08-30 10:01:03 +02:00
Alex Rønne Petersen 928b840dad [profiler] Rewrite TLS code.
* Actual thread-local state is now stored in a MonoProfilerThread struct which
  is stored in a single TLS slot per thread. This avoids storing things like
  call_depth in LogBuffer. The current LogBuffer of a thread is also stored in
  the MonoProfilerThread.
* All MonoProfilerThread structs are stored in a global linked list set. This
  LLS is used to manually clean up the thread-local state of threads that, for
  whatever reason, don't have the thread_end () callback invoked.
* Lifetime management of thread-local buffers is now much more straightforward.
* The thread-local list of referenced methods is now only allocated if needed.
* Fixed a MethodInfo memory leak in handle_writer_queue_entry ().
* Fixed some class load events that could be lost in the writer thread when
  fetching the full name of a method.
* TLS slots are now actually freed on shutdown.
2016-08-30 10:01:03 +02:00
Alex Rønne Petersen 91af66e4ab [profiler] Implement process_id () for Windows. 2016-08-30 10:01:03 +02:00
Alex Rønne Petersen 9008efcc56 [utils/lls] Export the linked list set API for use in the profiler.
Also exported a couple of hazard pointer functions used by the LLS macros.
2016-08-30 10:01:03 +02:00
Alex Rønne Petersen 64e35f6d8b [utils/lls] Use mono_thread_hazardous_queue_free () instead of mono_thread_hazardous_try_free ().
We cannot use the latter as we do not know whether the free function is safe to call.
2016-08-30 10:01:03 +02:00
Alex Rønne Petersen c2d170ab30 [utils/lls] Rename get_hazardous_pointer_with_mask () to mono_lls_get_hazardous_pointer_with_mask (). 2016-08-30 10:01:02 +02:00
Alex Rønne Petersen 7352d60f62 [utils/hp] Rename get_hazardous_pointer () to mono_get_hazardous_pointer (). 2016-08-30 10:01:02 +02:00
Alex Rønne Petersen e25f0dd1e7 [utils/hp] Remove HazardFreeLocking and HazardFreeContext enums.
These are no longer useful in the new hazard free API.
2016-08-30 10:01:02 +02:00
Alex Rønne Petersen f8a716f1f0 [profiler] Only forward declare structs that need it. 2016-08-30 10:01:02 +02:00
Zoltan Varga f7a57d5f08 Revert "[runtime] Fix pedump by using the normal embedding APIs instead of in…" (#3479) 2016-08-30 00:01:18 +02:00
Rodrigo Kumpera 770ca46e08 Merge pull request #3478 from vargaz/fix-pedump
[runtime] Fix pedump by using the normal embedding APIs instead of in…
2016-08-29 17:51:30 -04:00
Zoltan Varga a9c75b075c [runtime] Fix pedump by using the normal embedding APIs instead of initializing parts of the runtime. Fixes #43786. 2016-08-29 22:37:31 +02:00
monojenkins 66fd6fd24d Merge pull request #3422 from xmcclure/tarjan-doublefan
Make GC bridge perform well in the "double fan" scenario

The GC bridge currently performs VERY poorly when the object graph has a "double fan" shape. If M Java objects point to 1 C# object which points to N Java objects, the graph exported to Monodroid will currently drop the C# object node and replace it with (M\*N) edges. It is easy to write code where (M\*N) grows ludicrously big.

In testing on device, this patch solves that problem while leaving other cases unaffected. In testing on device, I found:
* All performance tests except double fan: No discernible performance difference after patch
* Double fan test with M=N=1000: Before the patch this took between three and seven seconds. After the patch this took between 0.2 and 0.3 seconds.
* Double fan test with M=N=4000: Before the patch this took anywhere from one to two minutes. After the patch, this took about 1.2 seconds.
* Double fan test with M=N=6000: Before the patch, this took so long I was not able to get it to ever complete. After the patch, this took about 1.3 seconds.
* Double fan test with M=N=20000: I did not attempt this test pre-patch. After the patch, it took about 5.6 seconds.

The commit messages describe the changes in some detail but the short version is:
* Add a mechanism for exporting non-bridged SCCs to the bridge client
* Turn that mechanism on whenever the product fanin*fanout grows too large
* Make the merge cache more aggressive

To function, this patch requires a corresponding change to monodroid. See https://github.com/xamarin/xamarin-android/pull/154
2016-08-29 22:30:06 +02:00
Marek Safar c8c09310f9 [Facades] Remove private facade 2016-08-29 21:41:14 +02:00
Marek Safar 3c045871b5 Merge pull request #3463 from david-mitchell/al-platform-switch
Add missing switch and functionality to al.
2016-08-29 21:31:33 +02:00
Andi McClure 40a1b5afe5 GC bridge: Fix non-buildable assert ()s added in previous commits 2016-08-29 14:34:22 -04:00
Alex Rønne Petersen 6a5599d71e Merge pull request #3468 from alexrp/hwcap-improvements
[utils/hwcap] Clean up and improve the hwcap code.
2016-08-29 20:26:46 +02:00
Andi McClure c300a36dbc GC bridge: Move bridge-require-precise-merge to MONO_GC_PARAMS
This was previously in MONO_GC_DEBUG, but we do not use this for
production-viable flags.
2016-08-29 13:48:48 -04:00
Marek Safar 57497c6e33 [corlib] Improve CanceledContinuationExecuteSynchronouslyTest test 2016-08-29 18:39:14 +02:00
Josh Peterson eaaf9b498f Throw an ArgumentException when a delegate is bound to an open generic method.
* This change was made in Unity's old version of Mono at: https://github.com/Unity-Technologies/mono/commit/9e27edaec9a91a75d6ebf0d21654dedcab74653d
2016-08-29 12:23:13 -04:00
David Mitchell 6fcc60e1c9 Add missing switch and functionality to al.
When running msbuild on mono against an architecture-specific
project that also defines satellite assemblies, the /platform
switch will be passed to al.exe. Mono's implementation of al.exe
does not support this switch, which results in a failed build.

This commit adds the /platform switch, which also required
changing the implementation from System.Reflection to
IKVM.Reflection because Mono's implementation of AssemblyBuilder
does not support the necessary options.

While testing this change, I also noticed a few attributes that
the MS version of al.exe will copy from "template" assemblies,
so I added support for those, as well.
2016-08-29 09:17:24 -07:00
Aleksey Kliger f61f855794 [runtime] Use coop handles in some String-returning icalls
Also begin adding handle definitions for some System.Reflection classes
when needed.
2016-08-29 12:12:57 -04:00
Marek Safar f16a7daaf1 [mcs] Add reference to parent storey when current value type async storey needs fabricated this access. Fixes #40860 2016-08-29 18:04:14 +02:00
Aleksey Kliger 2ef81c56cd [test-conc-hashtable] Init w32 handles. Fixes OSX+coop. 2016-08-29 11:57:31 -04:00
Zoltan Varga a35f78db32 [llvm] Fix the arm cross compiler build when using llvm 3.9. 2016-08-29 16:49:17 +02:00
Marek Safar eb42f74662 Merge pull request #3453 from ntherning/cleanup-AssemblyTest-temp-file-handling
Cleanup temp file handling in AssemblyTest
2016-08-29 16:46:04 +02:00
Niklas Therning b90617e7b7 Cleanup temp file handling in AssemblyTest
SetUp() already sets up a temp folder for the test methods and TearDown()
handles cleaning up and taking into account that on Windows, loaded assemblies
cannot be deleted. However, some of the tests created temp files outside of
this folder and had their own cleanup code which didn't expect temp files to
be undeletable on Windows.

This patch removes any custom temp file creation/cleanup from individual test
methods. It also slightly changes the way SetUp() created the temp folder for
each test, now the paths will be shallower.
2016-08-29 14:27:00 +02:00
Niklas Therning 2d407e62e6 Fix for double CloseHandle() on AppDomain unload
When AppDomain.Unload() is called a new thread is created and attached. When
this thread is done the thread handle is immediately closed using
CloseHandle() but the same handle is also passed to CloseHandle() later on by
the InternalThread destructor. On the second CloseHandle() call Windows will
abort the process with an "Invalid handle" error.

This patch removes the CloseHandle() calls in mono_domain_try_unload() which
is called by AppDomain.Unload(). The patch also wires up some more functions
in mono/utils/mono-threads-windows.c to set the MonoThreadInfo.handle field to
NULL when a thread has exited.
2016-08-29 14:00:48 +02:00
Bernhard Urban fc5305d2af [aot] fix linker invocation
fixes regression introduced by 7d238ddd5e
2016-08-29 12:06:30 +02:00
Alex Rønne Petersen 20d221e596 [utils/hwcap] Clean up and improve the hwcap code.
* Get rid of the arch-specific headers.
* Do verbose printing in one place.
* Simplify the cross compilation case to avoid repetition.
* Define all variables with a macro in a single header.
* Print detected hwcap info via g_print () so it's visible on mobile.
* Expose plain bool variables in the s390x implementation.
2016-08-29 06:38:53 +02:00
Miguel de Icaza 39e345a0e5 [runtime] Bundle support, implement missing stream processing (#3423) 2016-08-27 21:51:53 -04:00
Alexander Köplinger 448da87d44 [corlib] Fix Marshal test to not rely on Assert.Less
It doesn't work on nunitlite e.g. on XA:

```
src/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs(268,11): error CS0117: `NUnit.Framework.Assert' does not contain a definition for `Less'
```
2016-08-27 21:24:45 +02:00
Aleksey Kliger (λgeek) 783593ac12 [runtime] ves_icall_AssemblyBuilder_InternalAddModule is dead code (#3461)
There is no System.Refleciton.Emit.AssemblyBuilder::InternalAddModule method
2016-08-26 17:46:11 -04:00
Vlad Brezae 3806fa0d2c Merge pull request #3451 from BrzVlad/fix-armel-emulation
[arm] Fix armel no fp
2016-08-26 23:57:29 +03:00
Alexander Köplinger 91b2f2d620 Merge pull request #3460 from akoeplinger/remove-net_4_5-ifdef
[mcs] Remove NET_4_5 ifdef from the source files
2016-08-26 21:21:55 +02:00
Alexander Köplinger 94e60c50bf Merge pull request #3459 from akoeplinger/fix-parameter-names
[bcl] Fix method parameter names to match .NET
2016-08-26 21:18:07 +02:00
Alexander Köplinger 3b167e0671 Merge pull request #3457 from akoeplinger/fix-gethrforexception
[corlib] Return e.HResult instead of PlatformNotSupportedException/-1 for Marshal.GetHRForException
2016-08-26 20:58:59 +02:00
Andi McClure d00831f52b PR feedback: Add a runtime switch for the aggressive SCC merging
Previously every time we add a new runtime setting for the bridge
processor we have added a new callback for it. Because this is getting
unweildy, and also because some of these settings might have been
broken by recent init order changes, I created a new set_config
callback and merged the existing set_dump_prefix and enable_processing
with it.
2016-08-26 14:13:44 -04:00
Andi McClure 9bd7907af5 PR feedback: Corrections to aggressive merge cache
hash_perturb was being mixed in in the wrong place. Fix that, also
make the hash function take some input from high bits on 64-bit
systems, also make the types around the hash more reasonable.
2016-08-26 15:00:37 -04:00
Zoltan Varga b1ef3a57d0 [sre] Remove TypeBuilder::create_internal_class () icall, it doesn't seem to be needed. (#3458) 2016-08-26 19:56:12 +02:00
Alexander Köplinger c4692001a9 [bcl] Fix method parameter names to match .NET
The names were fixed only for the subset of methods that are included in netstandard,
and in cases where netstandard differs from Desktop .NET we match with .NET.
2016-08-26 17:49:03 +02:00
Alexander Köplinger d7967505ff Fix tarball build
emitnunit.pl was removed in d3129a7624
2016-08-26 17:31:32 +02:00
Alexander Köplinger 055d9416c4 [corlib] Return e.HResult instead of PlatformNotSupportedException/-1 for Marshal.GetHRForException
Follow what coreclr/corefx does now: https://github.com/dotnet/coreclr/pull/6929.
2016-08-26 17:20:47 +02:00
Zoltan Varga 8c1ef41894 [runtime] Remove most of the contents of MonoDynamicGenericClass, the… (#3441)
* [runtime] Remove most of the contents of MonoDynamicGenericClass, the elements of the 'fields' array are not used anywhere, making all the other fields unneccesary too.

* [runtime] Remove the MonoDynamicGenericClass structure, merge it into MonoGenericClass. Add some comments.
2016-08-26 12:32:05 +02:00
Zoltan Varga 8963cc85bf [jit] Add an assert to the native types code to make sure we are using the matching managed assembly. 2016-08-26 12:02:54 +02:00
Zoltan Varga dcd650d6fc [llvmonly] Initialize native-to-managed wrappers when they are loaded instead of on the first call, since the call might be made on a thread not attached to the runtime. Fixes #43357. 2016-08-25 22:18:45 +02:00
Zoltan Varga 20b49905f2 [jit] Fix an assertion on amd64 when using fixed size buffers and pinvoke. Fixes #33571. 2016-08-25 20:35:25 +02:00
Marek Safar 01038e7c2d [corcompare] Show extension argument changes. Make parameter name difference breaking change. 2016-08-25 18:28:57 +02:00
Marek Safar 6d1a78e35a [mcs] Don't crash when as operand cannot be resolved. Fixes #43718 2016-08-25 18:28:57 +02:00
Marek Safar 0a37c37c77 [mcs] Correctly detect catch resume point marker in scope of resume points. Fixes #43636 2016-08-25 18:28:57 +02:00
Niklas Therning 83e7e0822e Validate AppDomainSetup.ApplicationBase path more like .NET does
On Windows we should check the path for invalid characters. Also expand
relative paths set using file:// URLs like .NET does. This patch also removes
the code which prepends "//" on Windows when a file:// URL is given as .NET
doesn't seem to do that in more recent versions.
2016-08-25 18:25:17 +02:00
Ludovic Henry e3ff1ef240 Merge pull request #3447 from ludovic-henry/iolayer-extract-threading
[threads] Get thread handle from MonoThreadInfo when attaching
2016-08-25 15:55:15 +02:00
Vlad Brezae d3962a8a80 [jit] Don't lower store_r4 and load_r4 on armel with no fp
When having a float variable in memory, we should always access its contents through the fload_r4/fstore_r4 funcs, which do the conversion between float and double and different memsize vs var size. It is common case, to have a temp float, have its address loaded with ldaddr and later do a load_r4_membase on that address to access the contents. If alias analyis lowers this load_r4_membase to an op_fmove directly on the register pair, this would in turn be decomposed into 2 simple int op_moves on soft float, which is wrong if these op_moves are converted to memory accesses.
2016-08-25 11:55:46 +00:00
João Matos ad34387f2c Merge pull request #3449 from lateralusX/jlorenss/win-add-missing-source-file
Add missing source file, sgen-os-coop.c, to libmonoruntime Visual Studio project.
2016-08-25 11:39:54 +01:00
Vlad Brezae 208d127b0f [arm] Fix opcode emulation on armel with no fp
Even though we register emulations for these opcodes, the native function doesn't not map to the opcode logic, being used instead as part of the opcode decomposition along with other instructions. Make sure we don't try to emulate these opcodes through the general emulation pass.
2016-08-25 10:15:16 +00:00
lateralusX 9393bb86e1 Add missing source file, sgen-os-coop.c, to libmonoruntime Visual Studio project.
Add missing source file, sgen-os-coop.c to project.

Add source files and headers into correct filters (Header/Source Files).

Eliminated Visual Studio linker warning LNK4221 for libmonoruntime project generated
by empty source files under certain configurations, boehm-gc.c, lock-tracer.c,
null-gc.c and sgen-os-coop.c
2016-08-25 11:14:33 +02:00
Alexander Köplinger dfbd2bcf82 Merge pull request #3437 from ntherning/fix-DirectoryNotFoundException-thrown-in-FileInfoTest.MoveTo_DestFileName_DirectoryDoesNotExist-on-windows
FileInfo.MoveTo() throws DirectoryNotFoundException rather than FileNotFoundException on Windows when target doesn't exist
2016-08-24 23:38:29 +02:00
Andi McClure 48e498d1cf PR feedback: Formatting, comments, asserts 2016-08-24 15:33:00 -04:00
Ludovic Henry bed939e9f7 [threads] Get thread handle from MonoThreadInfo when attaching 2016-08-24 20:56:24 +02:00
Ludovic Henry 9a54e8d226 Merge pull request #3439 from ludovic-henry/iolayer-extract-threading
[mono-threads] Create Win32 handle when attaching the thread
2016-08-24 20:54:04 +02:00
Alexander Köplinger 399de6b18c Merge pull request #3444 from akoeplinger/fix-netstandard-extensions
[Facades] Implement methods for *Extensions types that are available on the extended type
2016-08-24 20:05:08 +02:00
Alexander Köplinger 0196e9a169 [mini] Wrap error output for NUnit xml in CDATA section
Makes sure that characters like <> (which appear in stack traces) don't confuse the XML parser.
2016-08-24 18:38:23 +02:00
Marek Safar cbffc5e908 [monosymbolicate] Add pdb detection 2016-08-24 17:05:58 +02:00
Ludovic Henry 6c6b7b3f50 [mono-threads-windows] Allocate ThreadStartInfo on the stack 2016-08-24 16:39:18 +02:00
Ludovic Henry fb50573d53 [mono-threads] Create Win32 handle when attaching the thread
This guarantee that a MonoThreadInfo always has a handle.
2016-08-24 16:39:17 +02:00
Ludovic Henry 9f00edd1b4 [w32handle] Remove unused assertions 2016-08-24 16:39:16 +02:00
Ludovic Henry e5a4d23fc7 [w32handle] Initialize them earlier
If we happen to have the debugger or the log profiler enabled, we would run into a use before initialization case for the w32handle. The debugger or profiler would call `mono_gc_base_init` which would attach the current thread, and that would crash in `mono_w32handle_new` at w32handle.c:437 with `scan_mutex` being an invalid value (EINVAL).
2016-08-24 16:39:15 +02:00
Marek Safar 1b2d5e91fa Merge pull request #3445 from rolfbjarne/cecil-update
[tuner/linker] Update code to fix build errors after cecil update.
2016-08-24 16:11:50 +02:00
Marek Safar b430545e06 Revert "[corcompare] Reflects cecil breaking changes"
This reverts commit b0ec389b68.
2016-08-24 16:08:25 +02:00
Rolf Bjarne Kvinge 40abe3056b [tuner/linker] Update code to fix warnings after cecil update. 2016-08-24 15:56:55 +02:00
Marek Safar b0ec389b68 [corcompare] Reflects cecil breaking changes 2016-08-24 15:17:12 +02:00
Niklas Therning 93181627a2 FileInfo.MoveTo() throws DirectoryNotFoundException rather than
FileNotFoundException on Mono on Windows and on .NET when target doesn't exist

FileInfoTest.MoveTo_DestFileName_DirectoryDoesNotExist() expects
FileNotFoundException to be thrown but on Windows a DirectoryNotFoundException
is thrown instead.

This patch changes MoveFile() in mono/io-layer/io.c to set the last error to
ERROR_PATH_NOT_FOUND rather than ERROR_FILE_NOT_FOUND when the destination
path doesn't exist. This results in a DirectoryNotFoundException being thrown
in managed code rather than FileNotFoundException. This is the behaviour
observed in .NET.

Also updated FileInfoTest.MoveTo_DestFileName_DirectoryDoesNotExist() to check
for DirectoryNotFoundException rather than FileNotFoundException.
2016-08-24 15:02:59 +02:00
Niklas Therning b72f1d7327 Merge pull request #3443 from ntherning/do-not-pass-FILE_FLAG_OVERLAPPED-to-CreateFile
Don't pass FILE_FLAG_OVERLAPPED to CreateFile()
2016-08-24 15:02:04 +02:00
Alexander Köplinger 186b0adff4 [Facades] Add argument null validation for extension methods 2016-08-24 14:50:21 +02:00
Alexander Köplinger f8db3589fc [Facades] Implement methods for *Extensions types that are available on the extended type
The methods are already available in our implementations of those types so we can just forward the calls
to the "real" types instead of throwing NotImplementedException.

I audited all code in mcs/class/Facades and the only places where we still throw NotImplementedException
are ones where we really need to add a custom implementation.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43695
2016-08-24 13:53:00 +02:00
Alexander Köplinger cce82f1700 [Facades] Make sure "this" is added to the type extensions
It was missing on a few methods.
2016-08-24 13:46:41 +02:00
Alexander Köplinger fd8c6c1956 [Facades] Throw PlatformNotSupportedException instead of NotImplementedException for ServiceController on mobile
It's unlikely the ServiceController APIs will be supported on mobile since they don't really make sense there,
they were initially designed for controlling Windows Services.
2016-08-24 13:46:40 +02:00
Marek Safar 11fb0e399f Merge pull request #3436 from ntherning/fix-alt-dir-separator-not-replaced-in-Path.CleanPath
Path.CleanPath() does not always replace AltDirectorySeparatorChar
2016-08-24 13:17:24 +02:00
Rolf Bjarne Kvinge 59260ced5a [linker] Mark declaring types of nested types resolved from xml descriptors. Fixes #43658. (#3434)
If the declaring type of a nested type marked by an xml descriptor
is not otherwise marked, the members of the nested type will not
be preserved, because the linker will not process the nested type
(since the parent type isn't marked, MarkStep:InitializeAssembly
will skip it, and thus skip akk its nested types as well).

https://bugzilla.xamarin.com/show_bug.cgi?id=43658
2016-08-24 12:12:48 +02:00
Niklas Therning 3b1ebefb7b Path.CleanPath() does not always replace AltDirectorySeparatorChar
If sub == 0, i.e. there are no repeated separators, this method just returns
the input string. On Windows, where DirectorySeparatorChar (\) is different
from AltDirectorySeparatorChar (/), this means that the call

    Path.GetDirectoryName ("foo/bar/dingus")

won't return "foo\bar" as .NET would but rather returns "foo/bar".

This patch makes sure the '/' -> '\' conversion is run when
AltDirectorySeparatorChar characters have been seen in the input string, even
if sub == 0.

PathTest.GetDirectoryName() triggered this bug.
2016-08-24 11:22:39 +02:00
Niklas Therning 1c6422e455 Don't pass FILE_FLAG_OVERLAPPED to CreateFile()
When a FileStream is opened with the FileOptions.Asynchronous flag set the
code in file-io.c will pass FILE_FLAG_OVERLAPPED to the CreateFile() function.
On Windows this means the file will be in asynchronous mode and when
ReadFile()/WriteFile() are called an OVERLAPPED struct has to be passed. Mono
doesn't do this which means that when reading/writing asynchronous FileStreams
Windows returns an ERROR_INVALID_PARAMETER and an exception is raised in
managed code.

This patch simply removes the code which passes the FILE_FLAG_OVERLAPPED to
CreateFile(). This will work since asynchronous I/O is handled in managed code
anyway, using threads. On the OS level the I/O is still synchronous. The patch
won't affect other platforms since the implementation of
ReadFile()/WriteFile()/etc in mono/io-layer/, which is used on non-Windows, is
always synchronous and ignores the FILE_FLAG_OVERLAPPED.

This bug was triggered by the
MonoTests.System.IO.BinaryWriterTest.AsynchronousModeWrites test.
2016-08-24 10:49:23 +02:00
Marek Safar 5adec5a68a [bcl] More netstandard api matching 2016-08-24 00:27:01 +02:00
Alexander Köplinger a156e55b3a Merge pull request #3430 from akoeplinger/simplify-mini-nunit
[mini] Replace emitnunit.pl with simpler Makefile-based xml generation
2016-08-23 21:02:54 +02:00
Alexander Köplinger 4e84bd13f2 Merge pull request #3431 from mhutch/fix-targetframeworkattribute
[xbuild] Fix incremental build of TargetFrameworkAttribute
2016-08-23 19:20:31 +02:00
Niklas Therning cbda28a9a1 Merge pull request #3435 from ntherning/fix-DirectoryInfoTest-assumes-current-dir-is-c-on-windows
Fix for DirectoryInfoTest assuming current dir is C:\ on Windows
2016-08-23 16:46:27 +02:00
Niklas Therning 08efcc3a52 Fix for DirectoryInfoTest assuming current dir is C:\ on Windows
This test assumes that `new DirectoryInfo (@"c:").Name == "C:\"` when run on
Windows but the actual value depends on the current directory. If current dir
is C:\temp the Name property will return "temp". Similar problem in the
FullName() and Parent() tests.

This patch sets the current directory to C:\ explicitly before running the
failing tests on Windows. The current dir is reset in TearDown().
2016-08-23 15:44:54 +02:00
Alexander Köplinger d3129a7624 [mini] Replace emitnunit.pl with simpler Makefile-based xml generation
In an effort to cut down on the number of different scripts we have that try to output NUnit xml.

It also fixes a bug in emitnunit.pl where it would not output anything when one of the tests crashes
the process, because then the final "Overall results: tests: 22425, 100% pass, opt combinations: 25"
line isn't printed and emitnunit.pl just exits. This happens on Alpine.
2016-08-23 15:34:24 +02:00
Alexander Köplinger c4a5b6b5c3 [mcs] Remove NET_4_5 ifdef from the source files
It is always set in all profiles that we support so we can remove it.
2016-08-23 15:15:51 +02:00
Zoltan Varga 208650e6da [jit] Avoid strengh reducing divisions when using llvm, llvm can do it by itself. 2016-08-23 15:09:21 +02:00
Niklas Therning 82b02262cf Merge pull request #3426 from ntherning/fix-handle-leak-in-DirectoryInfo.EnumerateFileSystemInfos-on-windows
Fixes a handle leak in DirectoryInfo.EnumerateFileSystemInfos()
2016-08-23 13:55:25 +02:00
Niklas Therning 29d229377d Merge pull request #3433 from ntherning/fix-DoubleTest.Parse-assumes-en-US
Don't assume "3 5" is unparseable in the current culture in DoubleTest.Parse()
2016-08-23 12:22:50 +02:00
Niklas Therning fb2afb6d76 Don't assume "3 5" is unparseable in the current culture in DoubleTest.Parse()
DoubleTest.Parse() expects "3 5" to be unparseable in the current culture and
expects an exception to be thrown. In sv-SE however "3 5" parses to 35 and
this test fails.

This patch sets the current culture to en-US when the DoubleTest.Parse() test
is run.
2016-08-23 12:20:28 +02:00
Niklas Therning b8c33e6549 Fixes a handle leak in DirectoryInfo.EnumerateFileSystemInfos()
When running DirectoryInfo.EnumerateFileSystemInfos() on an empty directory
MonoIO.FindFirst() will return null and the method returns without closing the
handle which is opened by FindFirst(). This patch makes sure the finally block
which closes the handle is run even when FindFirst() returns null.

Also added a call to FindClose() and some more cleanup in the native
implementation of MonoIO.FindFirst() when an allocation fails.

This bug caused an exception in DirectyoryInfoTest.TearDown() and several
other TearDown() methods in the MonoTests.System.IO tests on Windows due to
RemoveDirectory() failing on an empty directory which still had an open handle
associated with it.
2016-08-23 12:05:53 +02:00
Marek Safar a9e83f7f6f Merge pull request #3103 from marek-safar/rs-Threading
[corlib] EventWaitHandle from referencesource
2016-08-23 09:17:43 +02:00
Mikayla Hutchinson efd47e8b31 [xbuild] Fix incremental build of TargetFrameworkAttribute
The targets depended on a feature that doesn't exist in
xbuild (https://bugzilla.xamarin.com/show_bug.cgi?id=43645)
and as a consequence would fail to add the generated file to
the build when the GenerateTargetFrameworkMonikerAttribute
target was up to date.
2016-08-22 22:52:31 -04:00
Alexander Köplinger 0d1db0362d Merge pull request #3429 from akoeplinger/fix-signaturedescription
[corlib] Add new values for RSAPKCS1SHA(256/384/512)SignatureDescription to CryptoConfig and fix SignatureDescriptionTest in FullAOT
2016-08-23 02:35:44 +02:00
Alexander Köplinger d326ae2998 Merge pull request #3381 from krytarowski/netbsd-support-20
Resurrect NetBSD support in mono-perfcounters.c
2016-08-23 01:24:39 +02:00
Marek Safar f31d874829 [corlib] EventWaitHandle from referencesource 2016-08-22 23:20:00 +02:00
Vlad Brezae 2d91f05408 [arm64] Bump instruction sizes for atomic ops to match the emmited code 2016-08-22 14:06:23 -07:00
Alexander Köplinger e9205142b2 [corlib] Add new values for RSAPKCS1SHA(256/384/512)SignatureDescription to CryptoConfig and fix SignatureDescriptionTest in FullAOT
With the .NET 4.6.2 merge in https://github.com/mono/mono/commit/b6a30059db8319348ebb454cc303633dfabd6a29#diff-799d44d25450b5b84906cbe7095708a0L86
the RSAPKCS1SignatureDescription class switched from using SHA1CryptoServiceProvider as the DigestAlgorithm to SHA1Cng.

This uncovered an issue when running SignatureDescriptionTest in FullAOT, as we were missing an entry for SHA1Cng
in CryptoConfig.fullaot.cs and so we didn't find the algorithm.

Additionally, 4.6.2 added new variants of the SignatureDescription class using SHA256, SHA384 and 512 which
had to be added alongside the corresponding digest/signature URLs defined by https://msdn.microsoft.com/en-us/library/windows/desktop/dd979768(v=vs.85).aspx

Note that on mobile/FullAOT we're falling back to the *Managed variants of the SHA algorithms as the *Cng/*CryptoServiceProvider variants
aren't exposed there (except for SHA1CryptoServiceProvider since it was in the framework from the beginning) so we need to special case these in the tests.
2016-08-22 20:47:47 +02:00
Aleksey Kliger 9aa7728ec6 [s390x] Fix compilation of sre-save.c 2016-08-22 14:07:59 -04:00
Alexander Köplinger f961e18753 [corlib] Simplify monotouch_*_corlib.dll.sources
They were all using the same .cs source files so just including the generic monotouch .sources
makes it easier to reason about and reduces the risk of forgetting to update one of the lists.
2016-08-22 19:15:50 +02:00
Alexander Köplinger 24a4379898 [corlib] Rename CryptoConfig_2_1.cs to CryptoConfig.common.cs
The file is actually used in all profiles so the 2.1 naming was confusing.
2016-08-22 19:02:34 +02:00
Aleksey Kliger (λgeek) faa06c572d [sre] Fix s390x build (#3427)
Followup for 6be008c409 to fix the s390x build.
2016-08-22 12:28:18 -04:00
Alexander Köplinger 363f36f0cb [mcs] Fix arguments to nunit-lite when FIXTURE or TESTNAME is set
nunit used -fixture for running all tests of a fixture and -run for running a single test,
but nunit-lite uses just -test for both.
2016-08-22 18:21:26 +02:00
Alexander Köplinger 07a2b30de0 Merge pull request #3428 from ntherning/fix-missing-libc-in-FileStreamTest-on-windows
Fixes DllNotFoundException in FileStreamTest.SetUp() on Windows
2016-08-22 17:30:04 +02:00
Niklas Therning ff18095f28 Fixes DllNotFoundException in FileStreamTest.SetUp() on Windows
SetUp() calls uname() in libc to check whether the test is running on OS X. On
Windows this fails since libc isn't available.

This patch removes the call to uname() completely since the result wasn't used
by the test anyway.
2016-08-22 17:21:58 +02:00
Marek Safar 0e700ac819 [mcs] Move more eager references version mismatch checks. Fixes #30821 2016-08-22 17:04:11 +02:00
Marek Safar 2ce89dd94a [corlib] Fix exposed public APIs 2016-08-22 13:28:24 +02:00
Marek Safar 426cf7184f Update ms-test-suite 2016-08-22 13:28:24 +02:00
Kamil Rytarowski d04560589c Fix NetBSD build in proclib.c (#3378) 2016-08-22 08:45:17 +02:00
Marek Safar 53f837f3a4 [corlib] More sources from referencesource 2016-08-20 23:16:48 +02:00
Marek Safar 5fc43f7fb4 [corlib] Print some info on FailFast 2016-08-20 22:35:44 +02:00
Zoltan Varga 9efe45052a [runtime] Use a coop semaphore instead of an io layer one to wait for thread start. (#3383) 2016-08-20 11:36:20 +02:00
Marek Safar 1513f87658 [corlib] Interning of utc literals in TimeZoneInfo conversion. Fixes #43512 2016-08-20 11:05:23 +02:00
Johan Lorensson c16b127027 Visual Studio project updates and enhancements to support static libmono and additional test/debug projects. (#3420)
* Fixing linker warning when building libmono DLL.

After splitting mono runtime into a static library used when building libmono
DLL, we got a linker warning since there were no object files left in the
libmono project. There was also a sematic issue with the current organization
of DllMain since it is located in driver.c that will be compiled into the static
library and then consumed by the linker building the DLL. In cases where the
static library was consumed directly it would still include DllMain entry point.

By splitting the DllMain method implementation into a separate specific windows file
we can both resolve the linker warning and remove the DllMain method implementation from the static
library and only include it when building the libmono DLL.

* Visual Studio projects support to optimally link mono applications using static libmono library.

Added a new property, MONO_USE_STATIC_LIBMONO that can be used to link some
mono applications, for example mono(-sgen).exe, towards static version of libmono.

This gives us the option to build a binary without dependencies on other runtime binaries
minimizing what’s needs to be deployed in order to run mono. This in combination with static linked c-runtime
(another option available through a VS property) will produce a mono runtime binary without
addition dependencies except .NET assemblies deployed by mono runtime users.

The default is still using the dynamic version of libmono as before.

* Visual Studio project to test/debug testdriver tests from within Visual Studio.

Added an additional Visual Studio project preconfigured to run testdriver related tests
directly from within Visual Studio.

Commit also includes an additional configuration script that can be used test projects in order
to setup a mono config file. The testdriver project uses this to create a unique configuration
files pointing to the build libtest.dll for running configuration. The configuration file will then
be used when the tests are executed to make sure the correct libtest.dll for current build configuration
gets used when running test different tests from within the Visual Studio debugger.

The project comes with a number of user macros as well that can be used in order to tailor how the tests are run.
Most of the values are preconfigured and shouldn't need to be changed in order to use
current build. In order to change the test that is executed, use the following user macro
defined in mono-testdriver-test property sheet added to the project:

MONO_TESTDRIVER_RUN_TARGET

and point it to the assembly hosting the tests to execute from within Visual Studio.

* Visual Studio project to test/debug nunit tests from within Visual Studio.

Added an additional Visual Studio project preconfigured to run nunit related tests
directly from within Visual Studio.

The project comes with a number of user macros as well that can be used in order to tailor how the tests are run.
Most of the values are preconfigured and shouldn't need to be changed in order to use
current build. In order to change the test that is executed, use the following user macro
defined in mono-nunit-test property sheet added to the project:

MONO_NUNIT_RUN_TARGET

and point it to the assembly hosting the tests to execute from within Visual Studio.

There is also an additional user macro defined:

MONO_NUNIT_FIXTURE

This can be used to limit the number of nunit test run within a test suite.
2016-08-19 23:20:38 -04:00
Aleksey Kliger (λgeek) 6be008c409 Merge pull request #3413 from lambdageek/reflection-split
[reflection] Divide reflection.c into multiple files. NFC
2016-08-19 18:40:08 -04:00
Andi McClure 72070cc2e0 GC Bridge: Make merge_cache more aggressive, less exact, faster
The merge_cache previously, if it encountered an SCC ("color") with
many outgoing links, would not attempt to merge that SCC with existing
SCCs and instead would just create a new color. Because unbridged SCCs
are now reported to the bridge client, the cost of creating extra
colors has increased. To mitigate this the merge cache now attempts to
merge objects of all sizes, and has been changed to be able to do this
performantly.

The biggest change is that in the case of a hash collision, SCCs will
sometimes be merged without fully checking if they are exactly equal.
This is considered okay because false merges will be infrequent and
nothing worse will happen than short-term failure to reclaim memory.

The bridge-pathologies double fan test has been amended to verify
large-object merging works.
2016-08-19 16:22:31 -04:00
Andi McClure c972ad051a GC bridge: Only export non-bridged objects when it's helpful
Augments each tarjan-bridge SCC ("color") with a count of how many
SCCs are pointing to it. The mechanism for exporting non-bridged SCCs
uses this count to only export those SCCs where the "double fan"
scenario appears to be occurring. In testing this eliminates the
performance overhead imposed by the previous commit.

Also renamed/moved some variable declarations because namespace bugs
were creeping in.
2016-08-19 16:12:45 -04:00
Andi McClure db60c62ff9 GC bridge: Include non-bridged objects in the exported object graph
Introduces a mechanism for non-bridged SCCs which lay between bridged
SCCs in the SCC forest to be reported to the bridge client. In this
version, such non-bridged SCCs are always reported. The result is that
most GCs get a little slower but GCs in which the "double fan" shape
appears (many bridged objects link to one C# object which links to
many bridged objects) become massively faster.

Because before clients were allowed to assume exported SCCs were
always bridged, SGEN_BRIDGE_VERSION has been incremented.
2016-08-19 16:07:22 -04:00
Andi McClure ca48b5e9e2 Remove headers unused by sgen-tarjan-bridge.c 2016-08-19 15:48:17 -04:00
Aleksey Kliger 1a1a9a1743 [win32] Add sre-encode.c and sre-save.c to libmonoruntime project 2016-08-19 14:34:27 -04:00
Aleksey Kliger 91ee154da4 [sre] Separate SRE MonoDynamicImage encoding and SRE Save functions to separate files. NFC
- (sre-encode.c) Encoding SRE builders into a MonoDynamicImage and token creation.

- (sre-save.c) Everything for saving SRE images to disk.
2016-08-19 14:32:38 -04:00
Jonathan Chambers 86b6624cdf Allocate handle stack for Boehm GC (#3421) 2016-08-19 19:14:46 +02:00
Niklas Therning d185b75dd7 Merge pull request #3419 from ntherning/fix-MonoTests.System.IO.DirectoryTest.DeleteDirectoryOnExistingFileName-on-win
Fixes MonoTests.System.IO.DirectoryTest.DeleteDirectoryOnExistingFileName on  Windows
2016-08-19 16:21:40 +02:00
Niklas Therning 9088f5a72a Fixes MonoTests.System.IO.DirectoryTest.DeleteDirectoryOnExistingFileName on
Windows

The error (ERROR_DIRECTORY) wasn't recognized in MonoIO so the error message
became "Win32 IO returned 267. Path: C:\foo\bar" which includes the path. The
test tests that the path isn't include in the message in the thrown
IOException.
2016-08-19 15:54:55 +02:00
Ludovic Henry ddcd0f707d Merge pull request #3416 from ludovic-henry/iolayer-extract-wait
[io-layer] Extract WaitForSingleObjectEx, WaitForMultipleObjectsEx and SignalObjectAndWait
2016-08-19 11:16:35 +02:00
Vlad Brezae c6c9631e1b Merge pull request #3418 from BrzVlad/fix-arm64-finalizer-wait
[arm64] Fix atomics
2016-08-19 11:28:54 +03:00
Vlad Brezae 5914d34fd7 [arm64] Add sequential memory constraint to swap, cas and add
Previously we were wrongly trying to achieve this by doing a load-acq followed by a store-rel. Assuming we have memory access on address A (before) and C (after) while the atomic operation happens on address B, the order of the instructions would look like this :

	[A], [B]load, load-acq, store-rel, [B]store, [C]

In this case a reordering of memory accesses like the following is possible, which clearly breaks the desired constraints :

	[B]load, load-acq, [C], [A], store-rel, [B]store

In order to provide the sequential memory constraint we could emit the barriers like this instead :

	[A], membar, [B]load, [B]store, membar, [C]

We can additionally save an instruction and emit the barriers like this instead (this is also what gcc does) :

	[A], [B]load, store-rel, [B]store, membar, [C]

In this case we only need to worry about the relation between memory accesses on A and the loading of B. We need to consider what happens if B is loaded before the access on A is fulfilled. This only matters if we load an older value for B (rather than the one visible by other threads) before A. In that case the erroneous store will fail due to using exclusive stores. At the retry the value read from B will be the right one.
2016-08-19 04:15:52 +03:00
Marek Safar b303ade7c6 [mcs] Fix wrong range check for pragma warning CSxxx. Fixes #43471 2016-08-18 23:06:26 +02:00
Aleksey Kliger 2a87e4f1bf [sre] Split out MonoDynamicImage and MonoDynamicStream functions 2016-08-18 17:03:16 -04:00
Ludovic Henry 5acc26578d [io-layer] Remove unused WaitForInputIdle 2016-08-18 21:51:15 +02:00
Ludovic Henry 5df6d38e61 [io-layer] Remove unused WaitForMultipleObjects 2016-08-18 21:51:14 +02:00
Ludovic Henry 11e45402b3 [io-layer] Replace use of WaitForSingleObject by WaitForSingleObjectEx 2016-08-18 21:51:13 +02:00
Ludovic Henry 8b0cd42ef7 [io-layer] Extract WaitForSingleObjectEx, WaitForMultipleObjectsEx and SignalObjectAndWait 2016-08-18 21:51:12 +02:00
Ludovic Henry b190f213a3 Merge pull request #3415 from ludovic-henry/net_2_1-to-mobile
[mcs] Replace NET_2_1 by MOBILE
2016-08-18 21:39:39 +02:00
Vlad Brezae 322e7d0be8 [arm64] Add full memory sequencing to atomic loads when necessary
Loads with acquire semantics guarantee that following memory accesses are not reordered with the load. Add full membar before it to ensure full sequencing.
2016-08-18 12:34:24 -07:00
Vlad Brezae 4c1dad1b67 [arm64] Add full memory sequencing to atomic stores when necessary
Stores with release semantics guarantee that previous memory accesses are not reordered with the store. Add a full membar after it to ensure full sequencing.
2016-08-18 12:33:00 -07:00
Niklas Therning 58e6594d4b Merge pull request #3412 from ntherning/fix-stack-alignment-issue-in-handler-block-trampoline-on-win64
Fixes stack alignment issue in handler_block_trampoline on Win64
2016-08-18 18:16:18 +02:00
Aleksey Kliger d8ef8c9444 [win32] Add new reflection files to vcxproj 2016-08-18 10:48:01 -04:00
Aleksey Kliger b6cf4908e0 [reflection] Rename files; adjust comments. 2016-08-18 10:48:00 -04:00
Ludovic Henry 5416358952 [mcs] Remove dead code 2016-08-18 16:38:50 +02:00
Ludovic Henry 249daf43de [mcs] Replace NET_2_1 by MOBILE
NET_2_1 is also defined whenever we define MOBILE, so they have the same effect. Silverlight was 2.1 but it's been dead for a while now, and we do not even support it.
2016-08-18 16:34:36 +02:00
Niklas Therning fe51729712 Fixes stack alignment issue in handler_block_trampoline on Win64
On Win64 Mono doesn't (yet) implement fast JIT TLS (mono_get_jit_tls_offset()
returns -1). This means that the code in
mono_arch_create_handler_block_trampoline() takes the code path in the "else"
which is the same code path taken when AOT compiling. The code generated in
this code path manipulates the stack pointer to ensure it's aligned properly
according to the ABI (RSP-8 is 16-byte aligned on function entry) for the AOT
case where the mono_handler_block_guard_trampoline() C function is called
directly from the handler_block_trampoline.

This patch unifies the JIT and AOT generated code to be as similar as possible
and gets rid of the fast path. There's no need for this code to be fast. The
handler_block_trampoline will after this patch call
mono_handler_block_guard_trampoline() directly, both in JIT and in AOT mode,
and then jump back to the saved return address itself rather than let the
MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD generic trampoline do this.

The tests mono/tests/finally_block_ending_in_dead_bb.exe and
mono/tests/block_guard_restore_aligment_on_exit.exe trigger this bug.
2016-08-18 14:40:17 +02:00
Vlad Brezae 499e5cd490 Merge pull request #3401 from BrzVlad/fix-managed-alloc2
[sgen] Fix managed alloc
2016-08-18 11:29:49 +03:00
Niklas Therning 8075cf3727 Merge pull request #3410 from lateralusX/jlorenss/vs2015-test-debug-projects
Visual Studio test/debug mono runtime utility projects.
2016-08-18 08:49:42 +02:00
Miguel de Icaza 50a4be2c5c [mkbundle] add support for distributing I18N encoding files and improved the man page 2016-08-17 22:49:56 -04:00
Aleksey Kliger 42dab3c0f8 [reflection] Divide reflection.c into multiple files. NFC
Split up reflection.c into three separate files:

1. reflection-query.c: This contains System.Type and  the interrogative System.Reflection APIs.
2. reflection.c: This contains the System.Reflection.Emit APIs
3. reflection-custom-attrs.c: All about dealing with custom attributes.
2016-08-17 18:01:44 -04:00
Vlad Brezae 46e7c742cc [aot] Fallback to slowpath managed alloc if we fail to create the normal one
The slowpath managed allocator doesn't require any tls support.

Fixes #42169.
2016-08-18 01:00:16 +03:00
Vlad Brezae 90ac4014a6 [sgen] Unify tls access across with/without HAVE_KW_THREAD platforms
Simplify code by always accessing tlab information and inside_critial_region through the SgenThreadInfo pointer. This also fixes potential failure to detect that we are in a critical region within the managed allocator.
2016-08-18 01:00:15 +03:00
Vlad Brezae 47f6f8cfde [aot] Don't aot methods that use tls on HAVE_KW_THREAD platforms
MONO_THREAD_VAR_OFFSET definitions don't work when loading mono as a dynamic library. This means that we need to be conservative and don't aot code that contains these tls chunks.

In the future, we should remove HAVE_KW_THREAD altogether and use only pthread since it simplifies the code alot.
2016-08-18 01:00:10 +03:00
Aleksey Kliger (λgeek) 5ac5585482 [runtime] Fix unhandled exception fatal error message. Fixes #43410 (#3404)
Partially revert bcbd0ac0c0
2016-08-17 15:33:03 -04:00
Marek Safar 0bd00f4154 Bump binary-reference-assemblies 2016-08-17 17:49:46 +02:00
Marek Safar 86e6221bec [bcl] Remove wrong ReferenceAssemblyAttribute(s) 2016-08-17 15:15:47 +02:00
lateralusX 8b1292313e Visual Studio test/debug mono runtime utility projects.
Added a couple of new/updated test/debug Visual Studio utility projects.
These projects can be used to quicker get up to speed when there is a need
to run/test/debug mono runtime tests inside Visual Studio debugger.

Added utility projects can be used to run mini regression tests using JIT as
well as compile/run full AOT:ed versions of mini regression tests or other assemblies.
The different .prop files are also organized so they can be reused when adding additional
run/test/debug projects going forward.
2016-08-17 13:56:26 +02:00
Marek Safar 400b5eb8b4 [System] Change WebRequest::BeginGetRequestStream driven IAsyncResult::CompletedSynchronously to match .net. Fixes #32374 2016-08-17 13:47:47 +02:00
Alexander Köplinger 8dbf5df12e [tests] Move constant-division.cs to the BASE_TEST_MOBILE_STATIC_NOT_SUPPORTED group
It relies on System.Reflection.Emit which means it doesn't work on mobile_static.
2016-08-17 11:29:35 +02:00
Craig McQueen 166653eecb mono_os_cond_timedwait: fix function name in g_error string (#3407)
It should say gettimeofday, not pthread_cond_timedwait. (This appears to
be a copy-and-paste error.)
2016-08-17 09:42:48 +02:00
Alexander Kyte eec5d58df8 [runtime] Default mobile_static AOT type to FullAOT 2016-08-16 21:11:53 +00:00
Alexander Köplinger 70602566de [ServiceModel] Don't throw in dummy InstanceContext constructor on mobile/xammac_4_5
Otherwise the NotImplementedException would prevent instantiating the class even though
we just use it as a dummy object on mobile.
2016-08-16 22:23:40 +02:00
Marek Safar 870cbdc8b9 [System] Report an error instead of success when proxy authentication is required. Fixes #19594 2016-08-16 22:22:45 +02:00
Aleksey Kliger 7a60679b15 [linker] Update mscorlib.xml to include some Mono.RuntimeStructs
Followup to
https://github.com/mono/mono/commit/70d7f5e35059bdb64d3c6b7e42d7ad5120b476d6
2016-08-16 16:06:35 -04:00
Zoltan Varga 64918cd5c2 Fix the full-aot build. 2016-08-16 19:21:31 +02:00
Niklas Therning 3761639707 Merge pull request #3403 from ntherning/fix-handler-block-trampoline-crash-on-win64
Fixes illegal CALL emitted in handler_block_trampoline on Win64
2016-08-16 17:26:06 +02:00
Marek Safar 97e51abfcf [System] Put back handling of direct ip addresses to ServicePoint::HostEntry (removed in 932359f). Fixes #42864 2016-08-16 15:15:05 +02:00
Marek Safar 6b26583efd [mcs] Avoid agressive generic members inflation from using static. Fixes #43400 2016-08-16 14:01:03 +02:00
Niklas Therning 89a1552d6f Fixes illegal CALL emitted in handler_block_trampoline on Win64.
The code in mono_arch_create_handler_block_trampoline() in tramp-amd64.c emits
a relative CALL which calls the mono_amd64_handler_block_trampoline_helper()
functions via:

  amd64_call_code (code, mono_amd64_handler_block_trampoline_helper)

This macro however only works properly for offsets less than 32-bits. For
64-bit offsets it truncates the offset to a 32-bit number. On Win64 the offset
in this case is always a number larger than 2^32. The emitted CALL will jump
to an illegal address causing a crash.

This patch changes the emitted code sequence to load the address of
mono_amd64_handler_block_trampoline_helper() to RAX and then calls the address
in RAX.

The test mono/tests/finally_block_ending_in_dead_bb.exe triggered this bug.
After this patch the test still crashes but in a new way related to another
bug.
2016-08-16 10:46:36 +02:00
Miguel de Icaza c3405680eb [linker] Bring various descriptors that were updated in iOS, but not on desktop Mono 2016-08-15 23:56:01 -04:00
Miguel de Icaza 7473246b06 [linker] Update descriptors for mscorlib to include the new _ThreadPoolWaitCallback 2016-08-15 23:42:24 -04:00
Zoltan Varga ac5102e9b4 [runtime] Cleanup naming of SRE icalls. NFC. (#3402)
Name the icall functions ves_icall_<TypeName>_<MethodName>. Move the SRE icalls to reflection.c from icall.c.
2016-08-15 23:24:19 +02:00
Marek Safar 3aa57ed53a [mcs] Don't reset temporary stack fields too early. Fixes #43265 2016-08-15 21:13:30 +02:00
Aleksey Kliger (λgeek) 694b115595 [reflection] Don't crash when building dynamic custom attributes on dynamic types (Fixes #43291) (#3399)
* [corlib] Regression test for non-visible custom attributes.

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

* [reflection] Don't crash when building dynamic custom attributes on dynamic types (Fixes #43291)

1. Don't dereference a NULL custom attribute ctor, throw a type load
   exception.
2. When building MonoCustomAttrInfo from an array of
   MonoReflectinoCustomAttr*, compute the number of
   non-visible (non-public) attributes correctly, and make sure to
   iterate over all the attributes when populating the result array.

Fixes [#43291](https://bugzilla.xamarin.com/show_bug.cgi?id=43291)

* [reflection] Marginally better TLE for custom attrs

At least include a message about what went wrong when trying to
construct a custom attribute from a type that isn't finished yet.
2016-08-15 15:05:14 -04:00
Zoltan Varga e4a17068f5 [runtime] Fix warnings. 2016-08-15 16:30:15 +02:00
Martin Baulig c5072c8f47 Fix the build.
Use the desktop version of MonoTlsProviderFactory.CreateDefaultProviderImpl()
in the 'mobile_static' profile.
2016-08-15 15:57:13 +02:00
Niklas Therning 87a0f5af23 Merge pull request #3396 from ntherning/fix-async-exc-compilation-on-windows
Fix the failure of the async-exc-compilation.exe test on Windows
2016-08-15 09:59:46 +02:00
Henric Müller e7ce5ea9d9 Fix empty hostname in GetHostByName on windows (#3397) 2016-08-14 22:05:32 -04:00
Alexander Köplinger b97fad34be [bcl] Fix netstandard mistake in WebHeaderCollection
I accidentally added this in 3c3ef17376 because I missed that on
full .NET this class inherits from NameValueCollection which provides `this[string name]` already
(the diff tool showed it as missing because it didn't take this into account).
2016-08-12 16:45:19 +02:00
Marek Safar b08769b904 Merge pull request #3398 from henricm/fix-for-test-helpers-symlink
Removing symlink of TestHelpers.cs
2016-08-12 15:55:35 +02:00
Henric Müller ce261e6b94 Removing symlink of TestHelpers.cs 2016-08-12 14:11:57 +02:00
Vlad Brezae 378b6bee20 [jit] Add missing special case for div with mul optimization
The algorithm does not handle the -1, 0 and 1 special divisors.
2016-08-12 14:56:44 +03:00
Niklas Therning 5a561604bf Fix the failure of the async-exc-compilation.exe test on Windows.
The test fails due an ArgumentException being thrown when the catch handler in
the test's Run() method tries to write to the console. The ArgumentException
is thrown in EncodingTable.GetCodePageFromName(string) since the encoding name
passed to it is null. Normally this exception would be caught and the default
encoding would fall back to UTF8. However, since the thread is aborted the
ThreadAbortException will be rethrown and terminates the test with an uncaught
exception. I have verified that the same behavior is seen on OS X if I mock up
the default encoding code to throw the same ArgumentException.

This patch adds a call to Thread.ResetAbort() just before the call to
Console.WriteLine() in the catch handler. This removes the abort status of the
thread and avoids the rethrow of the ThreadAbortException.
2016-08-12 11:16:00 +02:00
Marek Safar f99366e0c3 Merge pull request #3394 from mono/netstandard
NetStandard 1.6 members matching
2016-08-12 09:54:24 +02:00
Alexander Köplinger f8480362ab [bcl] Define NETSTANDARD in xammac profile as well 2016-08-12 02:36:28 +02:00
Vlad Brezae b51beacb8e Merge pull request #2332 from BrzVlad/feature-div-with-mul
[jit] Optimize divisions by immediate
2016-08-12 00:44:00 +03:00
Marek Safar 1d64a37df9 [Facades] Remove wrong facades 2016-08-11 20:53:47 +02:00
Marek Safar 406a5b8177 [Facades] Update version numbers 2016-08-11 20:53:46 +02:00
Marek Safar f5b5a6fdfd [Facades] System.Security.Cryptography.Algorithms on netstandard profiles only 2016-08-11 20:53:45 +02:00
Alexander Köplinger 3c3ef17376 [bcl] Update to match NETStandard 1.6 members 2016-08-11 20:53:38 +02:00
Vlad Brezae 49c169f53f [jit] Enable division by constant optimization on 32 bit 2016-08-11 21:21:41 +03:00
Vlad Brezae 55a6e47160 [arm] Implement OP_BIGMUL 2016-08-11 21:21:41 +03:00
Vlad Brezae ce5df6d400 [tests] Add random immediate division test 2016-08-11 21:21:40 +03:00
Vlad Brezae b518ec10c0 [jit] Register counter for number of optimized divisions 2016-08-11 21:21:39 +03:00
Vlad Brezae 3bc3787974 [jit] Optimize signed division by constant 2016-08-11 21:21:39 +03:00
Vlad Brezae 9b3d453006 [jit] Optimize unsigned division by constant 2016-08-11 21:21:39 +03:00
Marek Safar c37bbef8f0 [corcompare] Use only C# known parameter type attributes for methods signatures 2016-08-11 18:07:54 +02:00
Martin Baulig b0e0d4785e [System]: Use 'HttpWebRequest.Host' for certificate host name validation.
(cherry picked from commit 5200955033)
2016-08-11 17:05:07 +02:00
Martin Baulig a47c56383b [System]: Add new internal X509Certificate2Impl.IntermediateCertificates.
(cherry picked from commit 8ed20455a5)
2016-08-11 17:05:00 +02:00
Martin Baulig 8b541144b1 [System]: Add private Mono.Net.Security APIs which will be shared between AppleTls and BoringTls.
(cherry picked from commit 934a577a94)
2016-08-11 17:04:49 +02:00
Martin Baulig 0ba6c7f3e0 [System]: Cleanup the internal MonoTlsProviderFactory and prepare for BTLS.
(cherry picked from commit b919768e1a)
2016-08-11 17:04:40 +02:00
Aleksey Kliger (λgeek) a232eb3b84 Merge pull request #3389 from lambdageek/bug-43099
[coop] Temporarily restore MonoThreadInfo when TLS destructor runs.  Fixes #43099
2016-08-11 10:43:08 -04:00
Marek Safar a00de00d95 [mcs] More reliable tests 2016-08-11 09:55:23 +02:00
Niklas Therning d22f93ffa6 Merge pull request #3388 from ntherning/fix-thread-priority-on-windows
Fix getting/setting thread priority on Windows
2016-08-11 09:20:54 +02:00
Miguel de Icaza 22f30140f5 [mkbundle] Fix --fetch-target to not require an assembly, embed the proper assembly when --cross RUNTIME is used 2016-08-11 00:33:53 -04:00
Aleksey Kliger 21a4a22997 [handles] offsets-tool should include MonoObjectHandlePayload
Complements 3c05314390
2016-08-10 18:49:40 -04:00
Alexander Kyte f4a87fca69 Merge pull request #3390 from alexanderkyte/fix_nunitlite_build_state
[nunitlite] Pass greedily, not fail greedily
2016-08-10 16:36:13 -04:00
Alexander Kyte d37b48e1f8 [nunitlite] Pass greedily, not fail greedily 2016-08-10 16:29:16 -04:00
Aleksey Kliger 3c05314390 [coop] Fix MONO_HANDLE_PAYLOAD_OFFSET() for cross-compilation
- fix MONO_HANDLE_PAYLOAD_OFFSET when MONO_STRUCT_OFFSET expands to
 token-pasting
- add MonoObjectPayloadHandle decl to object-offset.h machinery.
2016-08-10 16:28:59 -04:00
Alexander Kyte 539ae700e2 Merge pull request #2780 from alexanderkyte/seq_point_optimize
[runtime] Implement performant unbounded-depth sequence point search
2016-08-10 15:47:59 -04:00
Aleksey Kliger 82ce6b8b28 [marshal] Ensure uses_handles is initialized. 2016-08-10 14:56:09 -04:00
Aleksey Kliger 57fb9aa164 [coop] Temporarily restore MonoThreadInfo when TLS destructor runs. Fixes #43099
We need a valid MonoThreadInfo in the TLS key while we run
unregister_thread because we may need to block the thread when it tries
to take the sgen GC mutex.

Fixes [#43099](https://bugzilla.xamarin.com/show_bug.cgi?id=43099)
2016-08-10 12:14:52 -04:00
Marek Safar 3fb3cdf6d7 [mono-api-html] Show assembly version differences 2016-08-10 17:30:56 +02:00
Niklas Therning df867664ee Merge pull request #3213 from henricm/fix-for-win-securestring-to-bstr
Fix for win securestring to bstr
2016-08-10 17:04:53 +02:00
Niklas Therning dca0544211 Fix getting/setting thread priority on Windows
The mono_threads_platform_get_priority()/mono_threads_platform_set_priority()
functions in mono-threads-windows.c assume the "handle" member has been set in
the MonoThreadInfo struct passed to it but it's always NULL. This patch
implements mono_threads_suspend_register() in the same file which sets the
"handle" member at thread registration time, like it's done in
mono-threads-posix.c.

This patch also makes sure the priority of a new thread is set as expected
when the Thread.Priority property has been changed prior to the thread being
started.

Also added a test method to mono/tests/priority.cs which tests that the
priority of the main thread is Normal by default and that it can be changed as
expected.

The changes in this patch fixes the failures in mono/tests/priority.exe on
Windows i386 and x64.
2016-08-10 16:47:33 +02:00
Marek Safar a350474b32 [mcs] Report second level references mismatch only for really used references. Fixes #42702 2016-08-10 15:54:04 +02:00
monojenkins 6e17b26ef5 Merge pull request #3387 from xmcclure/test-suite-bump
Update ms-test-suite to fix broken test
2016-08-10 00:30:10 +02:00
Alexander Köplinger 8ac1adac8e [WinForms] Fix a test to correctly check for Mono
typeof (int).GetType ().GetType ().Name is now RuntimeType since https://github.com/mono/mono/pull/3045.
We did not notice this since most of our bots don't run with en-US locale set which this test requires.
2016-08-10 00:16:06 +02:00
Alexander Köplinger dfdbf0c365 [mono] Use -size 0 instead of -empty as find argument
The latter is not supported by the "find" binary in Alpine. The former works everywhere.
2016-08-10 00:16:06 +02:00
Alexander Köplinger 66881ac454 [mini] Fix mktemp argument in test_op_il_seq_point.sh
mktemp on e.g. Alpine requires at least six 'X' characters in the template argument.
2016-08-10 00:16:05 +02:00
Alexander Köplinger cbe8a553b0 [mdoc] Remove --exclude=.svn from diff arguments
We don't use svn anymore since a very long time and some diff implementations (e.g. in Alpine) don't support --exclude.
Removing the argument is an easy fix.
2016-08-10 00:16:04 +02:00
Alexander Köplinger 421481419d [acceptance-tests] Run ms-test-suite with debug symbols
So we get line numbers in stack traces.
2016-08-10 00:16:04 +02:00
Zoltan Varga d4052c5563 [runtime] Use a coop semaphore instead of the io-layer one in the monitor code. (#3382) 2016-08-09 22:51:30 +02:00
Andi McClure 269608b176 Update ms-test-suite to fix broken test 2016-08-09 16:45:24 -04:00
Alexander Kyte 6718281ee8 Merge pull request #3386 from alexanderkyte/nunit_lite_return_status
[runtime] Make nunitlite return failure exit code when tests fail
2016-08-09 15:03:27 -04:00
Marek Safar 1fe681e47c Merge pull request #3373 from marek-safar/net-4.6.2
[bcl] Update Reference Source to .NET Framework 4.6.2
2016-08-09 21:02:27 +02:00
Alexander Kyte 9f798cb8eb [runtime] Return failure return status if nunit-lite test suite fails 2016-08-09 14:49:14 -04:00
Alexander Kyte e7dc20067c [runtime] Bump nunit-lite dependency for runner change 2016-08-09 14:47:34 -04:00
Marek Safar d948067ae9 [System] Remove one no longer needed uri workaround. Fixes #43032 2016-08-09 19:46:22 +02:00
Marek Safar b6a30059db [bcl] Update Reference Source to .NET Framework 4.6.2 2016-08-09 18:07:14 +02:00
Henric Müller c5cdfaec1e Moving BSTR conv to native code in SecureStringToBSTR.
Previous implementation laid out the BSTR structure
in directly memory in C# code. This layout was not correct
for windows.
Furthermore memory was allocated using AllocCoTaskMem but later freed
using SysFreeString which on windows are different memory areas.
Third issue is that SecureString asumes big-endian when copying the chars
to its internal byte buffer. So on little-endian environments,
a swap of bytes is needed before the buffer is sent to native side
for BSTR conversion. This should probably be handled internally in
SecureString instead.
2016-08-09 14:09:32 +02:00
Kamil Rytarowski ab14520764 Handle NetBSD specific iconv(3) call prototype (#3376)
In the past there were wars between constified and unconstified
second parameter.. NetBSD went with constifying it. POSIX went without
const and most other OSes standarized. NetBSD is still having
incompatible function prototype.

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <iconv.h>

     size_t
     iconv(iconv_t cd, const char ** restrict src, size_t * restrict srcleft,
           char ** restrict dst, size_t * restrict dstleft);
2016-08-09 12:41:54 +02:00
Marcos Henrich 1e6895d366 Merge pull request #3353 from esdrubal/st-format
[corlib] Removed MVID and AOTID metadata.
2016-08-09 10:34:06 +01:00
Alexander Köplinger c4f4517828 [ci] Another Python 3 fix in babysitter
```
  File "./scripts/ci/babysitter", line 424, in run
    for xml in (xml_list + wrote_xml):
TypeError: can only concatenate list (not "map") to list
```
2016-08-09 02:12:53 +02:00
Kamil Rytarowski 3e6701d4b2 Define _NETBSD_SOURCE for mincore(2) (#3380) 2016-08-09 02:00:44 +02:00
Kamil Rytarowski 615f644ca1 Fix the definition of legacy_closer(), detected on NetBSD (#3377) 2016-08-09 01:59:31 +02:00
Kamil Rytarowski 1b7d212ead Resurrect NetBSD support in mono-perfcounters.c 2016-08-09 01:28:48 +02:00
Alexander Köplinger 07cdf4137c [ci] Python3 fix in babysitter script
iteritems() was removed in py3, we can just use items() instead since we're iterating
over the list anyway so we don't need the lazy evaluation behavior of iteritems().
2016-08-08 23:51:45 +02:00
Kamil Rytarowski 5fe8bfae7d Introduce mono-threads-netbsd.c (#3374) 2016-08-08 17:21:38 -04:00
Kamil Rytarowski 736a445ddc Fix shell portability, detected with NetBSD/pkgsrc (#3375) 2016-08-08 17:20:49 -04:00
Aleksey Kliger (λgeek) 70d7f5e350 Merge pull request #3349 from lambdageek/handle-icalls-in-jit
[handles] Add coop handles in wrapper to icalls with HANDLES() declaration
2016-08-08 16:39:13 -04:00
Alexis Christoforides 71a846cace [sgen] Support nursery canaries with managed allocators 2016-08-08 16:22:34 -04:00
Alexis Christoforides 08f47d5693 [sgen] "align-up" requested allocation sizes within the managed allocator, instead of sometimes before.
All code paths will still align-up the size to be allocated, but now it's easier to gather the real size of an object.
2016-08-08 16:22:34 -04:00
Alexis Christoforides 056a0a6ccf [sgen] Nursery canaries option now gives more useful information on failures 2016-08-08 16:22:33 -04:00
Aleksey Kliger 950ec31540 [marshal] Assert if adding handles to an out or inout parameter of an icall.
Eventually should support this (System.RuntimeType.GetInterfaceMapData
could use it, for one) but for now just assert.
2016-08-08 12:50:19 -04:00
Aleksey Kliger 588900f837 [marshal] Load payload from return handle 2016-08-08 12:50:18 -04:00
Aleksey Kliger bb4cb46eb1 [marshal] If an icall is getting handles and MonoError added, it better
check for exceptions.
2016-08-08 12:50:17 -04:00
Aleksey Kliger 106c604f29 [marshal] Wrap icall managed obj input arguments with handles. 2016-08-08 12:50:16 -04:00
Aleksey Kliger fd44a557dd [runtime] Modify Zoltan's prototype to query icall-def.h handles tables
TODO: there's a gratuitous call to mono_lookup_internal_call_full().
Should really cache the uses_handle info along with the addr since the
lookup by name is rather involved.
2016-08-08 12:50:15 -04:00
Aleksey Kliger 8e509d4d09 [runtime] Add HANDLES() macro to icall-def.h
The HANDLES() macro can be wrapped around an ICALL() to signal that
the icall should use the coop handles machinery from handles.h
2016-08-08 12:50:14 -04:00
Zoltan Varga 98705767f9 Add RuntimeStructs class. 2016-08-08 12:50:13 -04:00
Zoltan Varga 9c29176aa2 Pass a MonoError argument to icalls. 2016-08-08 12:50:07 -04:00
João Matos f1efd46acb Merge pull request #3372 from ntherning/fix-g_win32_getlocale
Explicitly use the ANSI version of GetLocaleInfo() in g_win32_getlocale()
2016-08-08 17:26:28 +01:00
Niklas Therning 7945519f84 Explicitly use the ANSI version of GetLocaleInfo() in g_win32_getlocale()
Since UNICODE is defined when Mono is compiled under Windows the
GetLocaleInfo() macro will expand to GetLocaleInfoW() which returns the
current locale identifier in g_win32_getlocale() in 16-bit Unicode.
g_win32_getlocale() however expects an 8-bit encoding. By using
GetLocaleInfoA() explicitly we'll get the identifier back as an ordinary 8-bit
C string.

This patch fixes the mono/tests/threadpool-exceptions5.exe test.
2016-08-08 17:17:19 +02:00
Marcos Henrich 60f8256fd8 [corlib] Removed MVID and AOTID metadata.
MVID and AOTID metadata is no longer displayed at the end of the stack
trace.

Now, every stack frame contains a MVID and AOTID inlined.

An IL offset stackframe looks like:
  at StackTraceDumper.Main () [0x00000] in <a3ec873a838c42c29f4eba7cab7d1dfb>:0

A native offset stack frame looks like:
  at StackTraceDumper.<Main>m__0 () <0x100e15d50 + 0x00029> in <a3ec873a838c42c29f4eba7cab7d1dfb#b37a9d11247b811ffffdaff8090d8a59>:0
2016-08-08 16:12:59 +01:00
Alexander Köplinger 8d1a18d611 Merge pull request #2903 from krytarowski/netbsd-support-4
Implement mremap(2) usage on NetBSD
2016-08-08 11:47:08 +02:00
Zoltan Varga f34c0223fc Fix the loaded llvm build. 2016-08-08 01:40:17 +02:00
Ludovic Henry 7324cd4a7a Merge pull request #3370 from ludovic-henry/fix-finalizer-wait
[gc] Fix crash when doing WaitForPendingFinalizers
2016-08-07 18:58:45 +02:00
Ludovic Henry df3278863a [gc] Fix crash when doing WaitForPendingFinalizers
The crash would come from a use-after-free of stack memory: in coop_cond_timedwait_alertable, we would allocate the struct we pass to the mono_thread_info_install_interrupt function on the stack. But there is no guarantee as to when break_coop_alertable_wait is run. The fix is to allocate the data passed to mono_thread_info_install_interrupt on the heap, and free it in the callback, or if it hasn't been interrupted.
2016-08-07 13:45:56 +02:00
Vincent Povirk 466097af62 [x86] Only pinvoke methods are stdcall. (#3354)
For xamarin bug 30146.
2016-08-07 03:29:41 -04:00
Zoltan Varga 871a3d453b [runtime] Fix the loaded llvm build. 2016-08-06 13:03:40 -04:00
Marek Safar 105085eb95 Merge pull request #3356 from marek-safar/cecil-update
Cecil update
2016-08-06 09:31:04 +02:00
Zoltan Varga d66b50ddb8 [runtime] Store the original invoke method in WrapperInfo for delegate invokes, use that to fix the check in find_aot_method_in_amodule (). 2016-08-05 18:59:07 -04:00
Marek Safar 5b0af84d6a [monosymbolicate] Update project file 2016-08-05 23:08:14 +02:00
Marek Safar 2d34a90a4c [Mono.Cecil] Add special handling of legacy 0.9.5 version 2016-08-05 23:08:13 +02:00
Marek Safar 0eada4ca3b [mono-symbolicate] Better test failure reporting 2016-08-05 23:08:12 +02:00
Marek Safar e3f25930e1 [mdoc] Update project file 2016-08-05 23:08:12 +02:00
Marek Safar 2371e279ae [Mono.Contract] Less obsolete warnings 2016-08-05 23:08:11 +02:00
Marek Safar d80283d1e8 [bcl] Reflect cecil breaking changes 2016-08-05 23:08:10 +02:00
Marek Safar 78bc83d6c6 Update Cecil to the latest master 2016-08-05 23:08:03 +02:00
Alexander Köplinger 2289feac4c Merge pull request #3363 from akoeplinger/fix-42938
[xbuild] Use the xbuild ToolsVersion even if another one is specified in the csproj
2016-08-05 22:54:59 +02:00
Zoltan Varga 32f8df796e [arm] Fix aot support in the sdb soft breakpoint trampolines. 2016-08-05 16:29:14 -04:00
Alexander Köplinger 97076ff919 [ci] Don't build mobile profiles in a monolite build
The mobile profiles rely on system resgen2 which is not present in a monolite build.
2016-08-05 19:44:48 +02:00
Niklas Therning 7e92715a0f Merge pull request #3359 from ntherning/sgen-avoid-scanning-stack-guard-page-on-windows
Prevent SGen from scanning the guard page used by Windows to dynamically grow the stack
2016-08-05 19:25:39 +02:00
Alexander Köplinger c7aa64ab0b Merge pull request #3361 from xmcclure/babysitter-xml
Add mono/tests support to CI babysitter
2016-08-05 18:58:44 +02:00
Zoltan Varga 98f6d1e7ce Initial prototype for handling handle stack setup and argument/return value conversion in icall wrappers. 2016-08-05 12:16:33 -04:00
Niklas Therning 29fecdd2fc Merge pull request #3365 from ntherning/fix-gc-graystack-stress-on-win64
Fixes the mono/tests/gc-graystack-stress test on Windows x64
2016-08-05 17:16:28 +02:00
Alexander Köplinger ca43f903c2 Merge pull request #3337 from akoeplinger/fix-alpine
Fix Alpine build
2016-08-05 16:50:04 +02:00
Alexander Köplinger 23fda51698 [ci] Add a CI_TAGS option for building with monolite
Also ensure that all the CI_TAGS check work with multiple values.
2016-08-05 16:49:37 +02:00
Alexander Köplinger 34bc900fc7 [ci] Run "make" in parallel in run-jenkins.sh
To speed up the build.
2016-08-05 16:49:37 +02:00
Ludovic Henry 8194bea584 Merge pull request #3288 from ludovic-henry/iolayer-extract-threading
[io-layer] Extract threading code
2016-08-05 15:05:34 +02:00
Niklas Therning 84d0f76ec7 Prevent SGen from scanning the guard page used by Windows to dynamically grow
the stack.

Windows uses a guard page before the committed stack memory pages to detect
when the stack needs to be grown. If we suspend a thread just after a function
prolog has decremented the stack pointer to point into the guard page but
before the thread has been able to read or write to that page, starting the
stack scan at the thread's ESP/RSP will raise a STATUS_GUARD_PAGE_VIOLATION and
the process will crash.

This patch uses VirtualQuery() to determine whether the thread's stack_start
value points into the guard page. If it does the stack scan will instead be
started at the following, non-guard page.
2016-08-05 14:54:06 +02:00
Marek Safar 643eadf903 Bump binary-reference-assemblies 2016-08-05 14:29:28 +02:00
Niklas Therning 56664d10bf Fixes the mono/tests/gc-graystack-stress test on Windows x64
Windows x64 only has 1 MB of stack per thread which is less than other x86
64-bit OSes. Using 10000 for "depth" in this test causes a stack overflow on
Windows x64. This patch changes "depth" to 5000 only on Windows x64. 5000 will
fit within the default stack size.
2016-08-05 14:18:27 +02:00
Ludovic Henry b8fff1390a Merge pull request #3355 from ludovic-henry/process-fix-exited
[process] Fix Process.Exited event triggered too soon
2016-08-05 10:59:21 +02:00
Miguel de Icaza 0d1f6eea5b Remove stray comment 2016-08-04 23:56:52 -04:00
Zoltan Varga a9e01245a9 [arm] Fix the initialization of the variable holding the single step trampoline address when using soft breakpoints + aot. 2016-08-04 18:15:34 -04:00
Alexander Kyte 18b834028e Merge pull request #3360 from alexanderkyte/mini_fix_timeout
[runtime] Increase mini bitcode timeout and add parallelism
2016-08-04 16:03:14 -04:00
Alexander Kyte 37210cf0d4 [mobile_static] Give bitcode mini tests parallelism and more time 2016-08-04 16:02:29 -04:00
Alexander Köplinger a1a54b5f14 [xbuild] Use the xbuild ToolsVersion even if another one is specified in the csproj
This is the recent behavior in .NET/MSBuild as well [1]:

> Starting in Visual Studio 2013, the MSBuild Toolset version is the same
> as the Visual Studio version number. MSBuild defaults to this Toolset
> within Visual Studio and on the command line, regardless of the
> toolset version specified in project file.

With this change xbuild will always use its own version instead
of the one specified in the project, unlessa ToolsVersion is forced
via the /tv switch on the command line.

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

[1] https://msdn.microsoft.com/en-us/library/bb383796.aspx#Anchor_1
2016-08-04 21:57:26 +02:00
Andi McClure 3c3dd75865 Add NUnit XML support to test babysitter, also document the communication protocol better
For test harnesses which don't support the full babysitter protocol,
the test harness can now report back paths to NUnit-format XML files
containing test results, or the paths to those XML files can be given
by whoever invoked the babysitter script. Failures listed in the XMLs
are included in the babysitter log.

test-runner.cs has been modified to report its XMLs, so we should now
see mono/tests failures in the babysitter log.
2016-08-04 15:09:34 -04:00
João Matos 427af110f6 Merge pull request #3357 from tritao/zip_delete_entries
[System.IO.Compression] Remove the entry from ZipArchive entries when its deleted
2016-08-04 18:27:37 +01:00
Ludovic Henry 8afaa90625 [process] Fix Process.Exited event triggered too early
The Process.Exited event would be triggered too early, leading to crash in code using this event to access the process exit code. This is because in Process.ExitCode, we first check that the process has really exited.
2016-08-04 18:59:50 +02:00
Niklas Therning 687cb3e46a Merge pull request #3358 from ntherning/disable-sgen-red-zone-on-win64
Set SGen's REDZONE_SIZE=0 on Win64
2016-08-04 16:45:59 +02:00
Niklas Therning eb9d4b44e7 Set SGen's REDZONE_SIZE=0 on Win64 since the ABI defines no red zone and the
ABI states that "All memory beyond the current address of RSP is considered
volatile".

On Windows the stack grows dynamically as the thread needs more stack space.
Windows places a guard page before the page at the top of stack and when this
guard page is accessed by the thread Windows will add a new page to the stack
and resume the thread.

Before this fix SGen on Win64 subtracted 128 from the stack pointer of a
suspended thread and started the stack scan from this address. In the case
when the stack pointer would be less than 128 from the start of the memory
page SGen would attempt to read from the previous page. If this happens to be
the guard page a STATUS_GUARD_PAGE_VIOLATION exception is raised and the
process crashes. The sgen-weakref-stress.exe triggered this bug on almost
every invocation.
2016-08-04 16:07:11 +02:00
Ludovic Henry 257b951a6c [io-layer] Remove threads.h, thread-private.h and wthreads.c 2016-08-04 15:41:47 +02:00
Ludovic Henry 44e8f37286 [io-layer] Remove unused _WAPI_THREAD_CURRENT 2016-08-04 15:41:46 +02:00
Ludovic Henry 3c52d24037 [io-layer] Extract thread MonoW32HandleOps 2016-08-04 15:41:46 +02:00
Ludovic Henry bd07ed29e0 [io-layer] Extract GetThreadPriority and SetThreadPriority 2016-08-04 15:41:45 +02:00
Ludovic Henry 3a3801b1e1 [io-layer] Extract wapi_create_thread_handle 2016-08-04 15:41:44 +02:00
Ludovic Henry fab2d1f531 [io-layer] Extract wapi_thread_own_mutex and wapi_thread_disown_mutex 2016-08-04 15:41:17 +02:00
Ludovic Henry c472a8e636 [io-layer] Extract wapi_current_thread_desc 2016-08-04 15:40:47 +02:00
Ludovic Henry 020ca4264b [io-layer] Extract wapi_ref_thread_handle 2016-08-04 15:40:26 +02:00
Ludovic Henry 27b44e002b [io-layer] Remove _wapi_thread_cur_apc_pending 2016-08-04 15:40:25 +02:00
Ludovic Henry 23613bd913 [io-layer] Extract wapi_get_current_thread_handle 2016-08-04 15:40:25 +02:00
Ludovic Henry 3cd88d5518 [io-layer] Extract wapi_thread_handle_set_exited 2016-08-04 15:40:20 +02:00
Ludovic Henry d19e5eaeae [io-layer] Make _wapi_getpid, _wapi_thread_own_mutex, _wapi_thread_disown_mutex and _wapi_mutex_abandon functions public 2016-08-04 15:00:07 +02:00
Ludovic Henry 523740c04a [io-layer] Make _WapiHandle_thread struct public 2016-08-04 15:00:06 +02:00
Ludovic Henry bd3e01a6ec [mono-threads] Split platform and suspend specific functions
We split mono-threads-{posix,windows,mach}.c functions in 2 categories:
 - platform: depends on the host the runtime is compiled on (possible values: posix or windows)
 - suspend: depends on the mono-threads suspend backend in use (possible values: posix, windows or mach)
2016-08-04 15:00:05 +02:00
Ludovic Henry dfa6daf9ed [io-layer] Make wait.c not depend on _wapi_thread_cur_apc_pending 2016-08-04 15:00:04 +02:00
João Matos 179e33d100 [System.IO.Compression] Remove the entry from ZipArchive entries when its deleted. Fixes #43022.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43022.
2016-08-04 13:21:13 +01:00
Marek Safar c0bd75d8cd [mcs] Better error reporting for missing types during conversion 2016-08-04 12:57:42 +02:00
Miguel de Icaza 5ea18d668c [build] Update order.xml data 2016-08-03 23:14:59 -04:00
Zoltan Varga b32c4cf6d1 [arm64] Assert that the displacement is not out of range int he b/bl macros, instead of in arm_get_disp (), so the assert location is more meaningful. 2016-08-03 19:50:11 -04:00
Alexander Kyte a41a317d69 Merge pull request #3352 from alexanderkyte/mini_bitcode_fix
[runtime] Provide Mono.Simd.dll to llvmonlycheck+fullaotcheck
2016-08-03 13:35:21 -04:00
Alexander Kyte fb726a78e9 [runtime] Provide Mono.Simd.dll to llvmonlycheck+fullaotcheck 2016-08-03 13:24:32 -04:00
Alexander Köplinger 9e132b68e7 Merge pull request #3351 from kasthack/patch-2
Added missing DeliveryFormat property to MailClient
2016-08-03 18:31:35 +02:00
Zoltan Varga 32a3e6815c [arm] Initialize breakpoint_tramp later in full aot mode, its not available in arch_init (). 2016-08-03 11:31:48 -04:00
Konstantin Safonov 0902d69876 Added missing DeliveryFormat property to MailClient
Doesn't actually change the behavior but at least allows to build sources referencing it on mono.
https://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.deliveryformat(v=vs.110).aspx
2016-08-03 17:50:53 +03:00
Aleksey Kliger (λgeek) 9e4743224b Merge pull request #3347 from lambdageek/coop-abort-ignore-unhandled
[coop] Don't call unhandled exn hook for ThreadAbortException
2016-08-03 10:29:33 -04:00
Marek Safar d3582e9b85 [mcs] More tweaks in betterness improvements. Fixes #41724 2016-08-02 20:54:37 +02:00
Aleksey Kliger 65c1b9cc10 [coop] Don't call unhandled exn hook for ThreadAbortException
Fixes the weird Jenkins logs for the coop job.
2016-08-02 12:32:24 -04:00
Alexander Köplinger 74be3019a7 [mini] Fix asm/sigcontext.h include in exceptions-arm.h
We include the header under the PLATFORM_ANDROID ifdef in mono-sigcontext.h as well [1].
It was probably added because older Bionic didn't include this from signal.h [2].

Fixes the build on Alpine/musl-libc.

[1] https://github.com/mono/mono/blob/19a99abf1680c85f8ff58c2b44ea8c15bb557ca5/mono/utils/mono-sigcontext.h#L5
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=859580
2016-07-28 15:56:10 +02:00
Angelo Compagnucci d5aec290cb [libgc] fix musl incorrect sigcontext include
On musl __GLIBC__ is not defined, so the conditional logic will
not produce correct result. Add a specific case to handle when
__GLIBC__ is not defined.
2016-07-28 15:56:09 +02:00
Alexander Köplinger a329632db2 [io-layer] Add include for sys/types.h to processes.h to fix Alpine build
It showed the following error before:

```
In file included from wapi.h:23:0,
                 from wapi.c:2:
../../mono/io-layer/processes.h:218:31: error: unknown type name 'pid_t'
 gchar* wapi_process_get_path (pid_t pid);
                               ^
Makefile:603: recipe for target 'wapi.lo' failed
make[3]: *** [wapi.lo] Error 1
```
2016-07-28 15:04:14 +02:00
Kamil Rytarowski b522eab5ff Implement mremap(2) usage on NetBSD
The NetBSD version of mremap takes additional argument "newp" to hint
new position of a mapped range.

     void *
     mremap(void *oldp, size_t oldsize, void *newp, size_t newsize,
         int flags);

  -- NetBSD's mremap(2)

While Linux by default sets old_address and fails if the resize
operation cannot be finished for the original address.

       void *mremap(void *old_address, size_t old_size,
                    size_t new_size, int flags, ... /* void *new_address */);

  -- Linux's mremap(2)

NetBSD offers inversed logic with the MAP_FIXED flag to Linux's MREMAP_MAYMOVE:

     MAP_FIXED          newp is tried and mremap() fails if that address can't
                        be used as new base address for the range.  Otherwise,
                        oldp and newp are used as hints for the position,
                        factoring in the given alignment.

  -- NetBSD's mremap(2)

       MREMAP_MAYMOVE
              By default, if there is not sufficient space to expand a mapping
              at its current location, then mremap() fails.  If this flag is
              specified, then  the  kernel  is permitted to relocate the
              mapping to a new virtual address, if necessary.  If the mapping
              is relocated, then absolute pointers into the old mapping
              location become invalid (offsets relative to the starting address
              of the mapping should be employed).

  -- Linux's mremap(2)

The thing that bothers is calling mremap(2) syntax from Linux "posix", but we
cannot do anything with it, for now just simulate the Linux behavior on NetBSD.
2016-04-17 02:46:57 +02:00
Alexander Kyte 85d318b725 [runtime] Implement performant unbounded-depth sequence point search
With this change we search for sequence points to unbounded depth and memoize in basic blocks
2016-03-21 12:09:18 -04:00
James Venning 9f488a8c7e Update assertions related to the number of interfaces supported by the runtime 2016-01-08 09:40:46 +10:00
James Venning 6e7f1d94eb Increase the number of interfaces supported by the runtime 2016-01-06 11:59:23 +10:00
4734 changed files with 151912 additions and 313763 deletions

No files matched your search

+8 -6
View File
@@ -1,17 +1,19 @@
# ensure LF endings on all checkouts
configure.ac crlf=input
configure.ac crlf=input
config.rpath crlf=input
configure.host crlf=input
mkinstalldirs crlf=input
*.sh crlf=input
*.sources crlf=input
.gitattributes crlf=input
*akefile* crlf=input
# ensure native line endings on checkout
*.c crlf
*.h crlf
*.cs crlf
*.sh crlf
*.il crlf
.gitattributes crlf
*akefile* crlf
*.sources crlf
# don't do anything to line-endings. Let CRLFs go into the repo, and CRLF on checkout
*.bat -crlf
*.sln -crlf
+1
View File
@@ -39,6 +39,7 @@ obj/
Ankh.NoLoad
*.gpState
.vscode/
*.exp
# Tooling
_ReSharper*/
+24 -3
View File
@@ -7,9 +7,7 @@
[submodule "external/cecil"]
path = external/cecil
url = git://github.com/mono/cecil.git
[submodule "external/debian-snapshot"]
path = external/debian-snapshot
url = git://github.com/directhex/mono-snapshot.git
branch = mono-2017-02
[submodule "external/rx"]
path = external/rx
url = git://github.com/mono/rx.git
@@ -35,3 +33,26 @@
[submodule "external/buildtools"]
path = external/buildtools
url = git://github.com/mono/buildtools.git
[submodule "external/cecil-legacy"]
path = external/cecil-legacy
url = git://github.com/mono/cecil.git
branch = mono-legacy-0.9.5
[submodule "external/boringssl"]
path = external/boringssl
url = git://github.com/mono/boringssl.git
branch = mono
[submodule "external/corefx"]
path = external/corefx
url = git://github.com/mono/corefx.git
[submodule "external/bockbuild"]
path = external/bockbuild
url = git://github.com/mono/bockbuild.git
[submodule "external/linker"]
path = external/linker
url = git://github.com/mono/linker.git
[submodule "external/roslyn-binaries"]
path = external/roslyn-binaries
url = git://github.com/mono/roslyn-binaries.git
[submodule "external/corert"]
path = external/corert
url = git://github.com/mono/corert.git
+11 -16
View File
@@ -19,7 +19,7 @@ all: update_submodules
SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
update_submodules:
@$(srcdir)/scripts/update_submodules
@$(srcdir)/scripts/update_submodules.sh
.PHONY: update_submodules
@@ -42,12 +42,11 @@ dist-hook:
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
rm -rf `find $(top_distdir)/external -path '*\.git'`
rm -f `find $(top_distdir)/external -path '*\.exe'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*'`
cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/
cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/
# Disable this for now because it is very slow and causes wrench to timeout:
# test ! -d $(GIT_DIR) || ./scripts/commits-to-changelog.py --root=$(distdir) last-commit-with-compulsory-changelog-entry
rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
mac-sdk-package:
external/bockbuild/bb MacSDK --package
pkgconfigdir = $(libdir)/pkgconfig
noinst_DATA = mono-uninstalled.pc
@@ -55,17 +54,13 @@ DISTCLEANFILES= mono-uninstalled.pc
# building with monolite
mcslib = $(mcs_topdir)/class/lib
monolite = $(mcslib)/monolite
mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
monolite_url = http://download.mono-project.com/monolite/monolite-$(mono_corlib_version)-latest.tar.gz
monolite_url = https://download.mono-project.com/monolite/monolite-$(MONO_CORLIB_VERSION)-latest.tar.gz
.PHONY: get-monolite-latest
get-monolite-latest:
-rm -fr $(mcslib)/monolite-*
-mkdir -p $(mcslib)
test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
cd $(mcslib) && mv -f monolite-* monolite
-rm -fr $(mcslib)/monolite/$(MONO_CORLIB_VERSION)
-mkdir -p $(mcslib)/monolite
cd $(mcslib) && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
cd $(mcslib) && mv -f monolite-* monolite/$(MONO_CORLIB_VERSION)
if BITCODE
BITCODE_CHECK=yes
+37 -15
View File
@@ -15,19 +15,22 @@ The Mono project is part of the [.NET Foundation](http://www.dotnetfoundation.or
6. [Configuration Options](#configuration-options)
7. [Working with Submodules](#working-with-submodules)
**Build Status**
### Build Status
Officially supported architectures:
| OS | Architecture | Status |
|--------------|--------------------|------------------------------|
| Ubuntu 14.04 | amd64 | [![ubuntu-1404-amd64][1]][2] |
| Ubuntu 14.04 | i386 | [![ubuntu-1404-i386][3]][4] |
| Debian 8 | armel | [![debian-8-armel][5]][6] |
| Debian 8 | armhf | [![debian-8-armhf][7]][8] |
| Debian 8 | arm64 | [![debian-8-arm64][9]][10] |
| OS X | amd64 | [![osx-amd64][11]][12] |
| OS X | i386 | [![osx-i386][13]][14] |
| Windows | amd64 | [![windows-amd64][15]][16] |
| Windows | i386 | [![windows-amd64][17]][18] |
| CentOS | s390x (cs) | [![centos-s390x][19]][20] |
| ubuntu-1404-amd64 | ubuntu-1404-i386 | debian-8-armel | debian-8-armhf | debian-8-arm64 | windows-amd64 |
|------------------------------|-----------------------------|---------------------------|---------------------------|-----------------------------|----------------------------|
| [![ubuntu-1404-amd64][1]][2] | [![ubuntu-1404-i386][3]][4] | [![debian-8-armel][5]][6] | [![debian-8-armhf][7]][8] | [![debian-8-arm64][9]][10] | [![windows-amd64][11]][12] |
Community supported architectures:
| centos-s390x |
|---------------------------|
| [![centos-s390x][13]][14] |
_(cs) = community supported architecture_
[1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64/badge/icon
[2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64
@@ -39,10 +42,16 @@ Community supported architectures:
[8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/
[9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/badge/icon
[10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/
[11]: https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true
[12]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master
[13]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
[14]: https://jenkins.mono-project.com/job/z/label=centos-s390x
[11]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/badge/icon
[12]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/
[13]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/badge/icon
[14]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/
[15]: https://jenkins.mono-project.com/job/z/label=w64/badge/icon
[16]: https://jenkins.mono-project.com/job/z/label=w64/
[17]: https://jenkins.mono-project.com/job/z/label=w32/badge/icon
[18]: https://jenkins.mono-project.com/job/z/label=w32/
[19]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
[20]: https://jenkins.mono-project.com/job/z/label=centos-s390x
Compilation and Installation
============================
@@ -453,6 +462,19 @@ disable it.
* There are a number of runtime options to control this
also, see the man page.
* `--with-csc=roslyn,mcs,default`
* Use this option to configure which C# compiler to use. By default
the configure script will pick Roslyn, except on platforms where
Roslyn does not work (Big Endian systems) where it will pick mcs.
If you specify "mcs", then Mono's C# compiler will be used. This
also allows for a complete bootstrap of Mono's core compiler and
core libraries from source.
  If you specify "roslyn", then Roslyn's C# compiler will be used.
This currently uses Roslyn binaries.
* `--enable-nacl`
* This configures the Mono compiler to generate code
+8 -5
View File
@@ -1,4 +1,5 @@
ACCEPTANCE_TESTS_PATH=external
BENCHMARKER_PATH=$(ACCEPTANCE_TESTS_PATH)/benchmarker
ROSLYN_PATH=$(ACCEPTANCE_TESTS_PATH)/roslyn
CORECLR_PATH=$(ACCEPTANCE_TESTS_PATH)/coreclr
MSTESTSUITE_PATH=$(ACCEPTANCE_TESTS_PATH)/ms-test-suite
@@ -7,17 +8,19 @@ CLEANFILES = *.dll *.exe *.mdb
EXTRA_DIST=README.md SUBMODULES.json versions.mk roslyn.mk coreclr.mk ms-test-suite.mk
CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
TOOLS_CLASS=$(mcs_topdir)/class/lib/build
with_mono_path = MONO_PATH=$(CLASS)
RUNTIME = $(with_mono_path) $(abs_top_builddir)/runtime/mono-wrapper --debug
MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe
ILASM = $(RUNTIME) $(CLASS)/ilasm.exe
RUNTIME = MONO_PATH=$(CLASS) $(abs_top_builddir)/runtime/mono-wrapper --debug
TOOLS_RUNTIME = MONO_PATH=$(TOOLS_CLASS) $(abs_top_builddir)/runtime/mono-wrapper --debug
MCS = $(TOOLS_RUNTIME) $(CSC) -nologo -noconfig -lib:$(CLASS) -r:System.dll -r:System.Core.dll -r:System.Xml.dll -r:Microsoft.CSharp.dll
ILASM = $(TOOLS_RUNTIME) $(TOOLS_CLASS)/ilasm.exe
include versions.mk
include profiler-stress.mk
include roslyn.mk
include coreclr.mk
include ms-test-suite.mk
check-full: check-roslyn check-coreclr check-ms-test-suite
check-full: check-profiler-stress check-roslyn check-coreclr check-ms-test-suite
clean-local: clean-local-coreclr
+9 -1
View File
@@ -18,9 +18,17 @@
{
"name": "ms-test-suite",
"url": "[email protected]:xamarin/ms-test-suite.git",
"rev": "840653918efed24f00f5e166094f06354cae7255",
"rev": "55b6637eb1de61c743323ec82db1e0cadfee5b32",
"remote-branch": "origin/master",
"branch": "master",
"directory": "ms-test-suite"
},
{
"name": "benchmarker",
"url": "git://github.com/xamarin/benchmarker.git",
"rev": "97f618cd585af549dd861b7c142656c496f6a89b",
"remote-branch": "origin/master",
"branch": "master",
"directory": "benchmarker"
}
]
+90 -82
View File
@@ -421,7 +421,6 @@ CORECLR_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/lcs/lcsmixed.cs \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/lcs/lcsval.cs \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/lcs/lcsvalbox.cs \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/misc/arrres.cs \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/misc/gcarr.cs \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/misc/selfref.cs \
$(CORECLR_PATH)/tests/src/JIT/Methodical/AsgOp/i4/i4.cs \
@@ -868,7 +867,6 @@ CORECLR_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b19171/jmp2blk.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b30251/b578931.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b102533/DeadBlock.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b268908/vars2.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b320147/1086745236.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b321799/repro.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b338014/vsw338014.cs \
@@ -939,7 +937,6 @@ CORECLR_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102729/b102729.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102763/gcparamonstack.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102886/ovf.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-M02/b10828/redundant.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-M02/b19394/stringArray114.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-M02/b21015/test.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-M02/b26496/_1d6bgof.cs \
@@ -1048,7 +1045,6 @@ CORECLR_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/cgstress/CgStress3.cs \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeArray.cs \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeArray1.cs \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeField1.cs \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeField2.cs \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/arrayexpr1.cs \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/arrayexpr2.cs \
@@ -1375,7 +1371,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/components/stopwatch/co9600ctor.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/components/stopwatch/co9604get_isrunning.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/action/actionctor.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/action/actioninvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/activator/activatorcreateinstance2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/argumentexception/argumentexceptionctor1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/argumentexception/argumentexceptionmessage.cs \
@@ -1827,8 +1822,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/ienumerator/ienumeratorreset.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/ilist/ilistisfixedsize.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/ilist/ilistitem.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/comparison/comparisonbegininvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/comparison/comparisonendinvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/comparison/comparisoninvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/console/consoleseterror.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/console/consolesetout.cs \
@@ -2060,7 +2053,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimedate.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimegethashcode.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimehour.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimekind.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimemaxvalue.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimemillisecond.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeminute.cs \
@@ -2211,9 +2203,7 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/environment/environmentprocessorcount_cti.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventargs/eventargsctor.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler/eventhandlerinvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerbegininvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerctor.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerendinvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerinvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/exception/exceptionctor1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/exception/exceptionctor2.cs \
@@ -2227,7 +2217,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcgettotalmemory.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gckeepalive.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcmaxgeneration.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcreregisterforfinalize.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcsuppressfinalize.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcwaitforpendingfinalizers.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstday.cs \
@@ -2237,13 +2226,8 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/charunicodeinfo/charunicodeinfogetnumericvalue2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/charunicodeinfo/charunicodeinfogetunicodecategory1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/charunicodeinfo/charunicodeinfogetunicodecategory2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfocompare.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfocompare2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoindexof.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoindexof2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoisprefix.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoissuffix.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfolastindexof.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsignorecase.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsignorekanatype.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsignorenonspace.cs \
@@ -2318,7 +2302,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesnone.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesnumber.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfocurrencysymbol.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfocurrentregion.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfoequals.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfogethashcode.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfoismetric.cs \
@@ -2554,7 +2537,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileshare/fileshareread.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileshare/filesharereadwrite.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileshare/filesharewrite.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filestream/filestreamdispose.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/ioexception/ioexceptionctor1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/ioexception/ioexceptionctor2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/memorystream/memorystreamctor.cs \
@@ -2705,8 +2687,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/platformnotsupportedexception/platformnotsupportedexceptionctor1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/platformnotsupportedexception/platformnotsupportedexceptionctor2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/platformnotsupportedexception/platformnotsupportedexceptionctor3.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/predicate/predicatebegininvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/predicate/predicateendinvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/predicate/predicateinvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomctor1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomctor2.cs \
@@ -3200,7 +3180,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalgetlastwin32error.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalreadint641.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributearraysubtype.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributector1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributector2.cs \
@@ -3298,7 +3277,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompare9.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompareordinal1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompareordinal2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompareto1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat3.cs \
@@ -3311,9 +3289,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringctor5.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringctorchar.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringempty.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals3.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals6.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringformat1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringformat2.cs \
@@ -3667,7 +3642,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencector1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencector2b.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferenceisaliveb.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencetargetb.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencetrackresurrection_cti.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/buffer/asurt_99893.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/collections/generic/hashset/regression_dev10_609271.cs \
@@ -3676,7 +3650,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/generics/negativegenerics.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/miscellaneous/co6010delegateequalstwo.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/miscellaneous/co6031gethashcode.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/regressions/devdivbugs/113347/ddb113347.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/guid/guid_parsing.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/lazyt/lazyttf.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/text/encoding/shift_jis.cs \
@@ -4030,7 +4003,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/1/Box_Unbox.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/1/Desktop/add.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/1/add.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/1/arglist64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/1/array_tests.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/1/cpblk.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/1/field_tests.il \
@@ -4041,7 +4013,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/1/ldloca.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/2/Box_Unbox.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/2/add.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/2/arglist64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/2/array_tests.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/2/cpblk.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/2/field_tests.il \
@@ -4053,7 +4024,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/4/Box_Unbox.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/4/Desktop/add.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/4/add.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/4/arglist64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/4/array_tests.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/4/cpblk.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/4/field_tests.il \
@@ -4065,7 +4035,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/volatile/1/Box_Unbox.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/volatile/1/Desktop/add.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/volatile/1/add.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/volatile/1/arglist64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/volatile/1/array_tests.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/volatile/1/cpblk.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/volatile/1/field_tests.il \
@@ -4107,13 +4076,9 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/catch1.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/catch2.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/catch3.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/filter1.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/filter2.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/filter3.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/try1.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/try2.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/try3.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/refbyref/byrefconvert.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/shift/int8.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/shift/nativeint.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/shift/nativeuint.il \
@@ -4122,11 +4087,9 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Directed/throwbox/finally.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/throwbox/rethrow.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/Dev10_863995.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/init_byte.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/init_int32.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/init_int64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/init_struct.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/init_uint32.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/init_uint64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/tail.il \
$(CORECLR_PATH)/tests/src/JIT/Generics/ConstrainedCall/vt1.il \
@@ -4155,9 +4118,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_u4.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_i4.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_u8.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i4.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i8.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i4.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_u1.il \
@@ -4189,7 +4149,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u2.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u4.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u8.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/huge_struct.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/lcs/lcs_ldlen.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/misc/lengthm2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/misc/selfref.il \
@@ -4231,11 +4190,8 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Methodical/ELEMENT_TYPE_IU/u_vfld.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/FPtrunc/convr4d.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/FPtrunc/convr8d.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param1b.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param1c.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param3b.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param3c.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25paramMixed.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/SEH/catchfault.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/SEH/catchfault_jmp.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/SEH/catchfault_tail.il \
@@ -4264,13 +4220,9 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/fptr/virtftn_t.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/fr4.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/fr8.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/i4u2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/i4u4.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/i8u8.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/ii1.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/ii2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/ii4.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/iu2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/iu4.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/objref.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/thiscall/thisnull.il \
@@ -4311,7 +4263,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Methodical/casts/iface/iface2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/casts/ilseq/typeEqualOp.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/misc/deadlock.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/simple/Desktop/prefldinit3.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/simple/prefldinit1.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/simple/prefldinit2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/simple/prefldinit4.il \
@@ -4351,7 +4302,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug679955/indexMinusOne.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal1.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/int64/arrays/hugedim.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/int64/arrays/lcs_long.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/int64/arrays/lcs_ulong.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/int64/misc/binop.il \
@@ -4386,8 +4336,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Methodical/nonvirtualcall/tailcall.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/nonvirtualcall/valuetype.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/refany/array1.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/refany/array2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/refany/array3.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/refany/native.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/refany/seq.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/refany/stress2.il \
@@ -4400,7 +4348,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Methodical/tailcall/compat_obj.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/tailcall/compat_v.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/tailcall/deep_array.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/tailcall/deep_array_nz.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/tailcall/deep_gc.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/tailcall/deep_inst.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/tailcall/deep_value.il \
@@ -4422,7 +4369,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Methodical/varargs/callconv/gc_ctor.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/varargs/callconv/val_ctor.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/varargs/misc/Dev10_615402.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/xxblk/cpblk3.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/xxblk/initblk3.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/xxobj/ldobj/ldobj_I.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/xxobj/ldobj/ldobj_I8.il \
@@ -4436,7 +4382,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Methodical/xxobj/operand/refanyval.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/xxobj/operand/unbox.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M09.5-PDC/b16935/b16935.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b44018/b44018.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b45046/b45046.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b26323/b26323.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b35455/b35455.il \
@@ -4499,7 +4444,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16881/b16881a.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16881/b16881b.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16886/b16886.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16895/b16895.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16896/b16896.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16922/b16922.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16928/b16928.il \
@@ -4508,7 +4452,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b20217/b20217.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b20249/b20249.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b25458/b25458.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b25459/b25459.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b25463/b25463.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b25468/b25468-ia64.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b25474/b25474.il \
@@ -4534,19 +4477,15 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b27657/b27657.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b27658/b27658.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b27880/b27880.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b27883/b27883.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b27917/b27917.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28080/b28080.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28522/b28522.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28594/b28594.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28595/b28595.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28596/b28596.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28597/b28597.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28805/b28805.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28806/b28806.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28927/b28927.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b29583/b29583.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30125/b30125.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30792/b30792.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30799/b30799.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30838/b30838.il \
@@ -4594,14 +4533,12 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b05933/b05933.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b06435/b06435.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b06436/b06436.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b06595/b06595.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b06730/b06730.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b06754/b06754.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b07082/b07082.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b07411/b07411.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b07458/b07458.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b07704/b07704.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b08107/b08107.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b08109/b08109.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b08672/b08672.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b08797/b08797.il \
@@ -4680,7 +4617,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b28598/b28598.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b28949/b28949a.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b30868/b30868.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31283/b31283.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31289/b31289.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31292/b31292.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31423/b31423.il \
@@ -4826,14 +4762,12 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70335/b70335.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70354/b70354.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70808/b70808.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70909/b70909.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70964/b70964.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70967/b70967.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70992/b70992.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70994/b70994.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71003/b71003.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71179/b71179.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71318/b71318.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71722/b71722.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71831/b71831.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71869/b71869.il \
@@ -4912,14 +4846,9 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b14617/b14617.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b15617/arrayDim.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b18049/loop2.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b102962/t.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b102962/t2.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b102962/vc178279.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b115932/t.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b115932/t1.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b118260/b118260.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b138117/ldsfldainitonlyvt.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b091942/nullref.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309555/x86-test-1084346006.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b323557/1087985874.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b353858/b353858.il \
@@ -4927,8 +4856,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b409617/b409617.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b415164/b415164.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b423755/Desktop/b423755.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b471305/b471305.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b475589/b475589.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b489329/b489329.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b518440/b518440.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b598031/test.il \
@@ -4940,12 +4867,10 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b173313/b173313.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b193264/b193264.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b48850/b48850.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_468598/Test_HndIndex_10_Reordered.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_b473131/b473131.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_b473131/b473131_byte.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_b473131/b473131_fld.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_b473131/b473131_intptr.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_b473131/b473131_struct.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/DevDiv2_11321/DevDiv2_11321.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/External/Dev11_90434/UseUnalignedDouble.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/M00/b102759/b102759.il \
@@ -5023,7 +4948,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b450688/b450688.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V2.0-RTM/b460385/b460385.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/clr-x64-JIT/v4.0/b602182/b602182.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/v4/dev10_804810/dev10_804810.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/localloc/zeroinit/zeroinit01_large.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/localloc/zeroinit/zeroinit01_small.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/il/jmp.il \
@@ -5045,7 +4969,6 @@ CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/regress/vswhidbey/481244/foo2.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/118414/118414.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/127931/127931.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/phoenix/62322/test.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/102974/test.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/153682/test.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/266693/test.il \
@@ -5135,7 +5058,92 @@ CORECLR_DISABLED_TEST_IL_SRC += \
CORECLR_DISABLED_TEST_IL_SRC += \
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/lcliimpl.il
# FIXME: these tests are baselined, i.e. we don't have time to investigate
# them right now but want to make sure we don't introduce new regressions
# in the rest of the tests
CORECLR_DISABLED_TEST_CS_SRC += \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerbegininvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/action/actioninvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/comparison/comparisonendinvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/comparison/comparisonbegininvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimekind.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerendinvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcreregisterforfinalize.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfocompare.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoindexof.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoisprefix.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoissuffix.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfolastindexof.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfocurrentregion.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filestream/filestreamdispose.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/predicate/predicateendinvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/predicate/predicatebegininvoke.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompareto1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals1.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals2.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals3.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencetargetb.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/regressions/devdivbugs/113347/ddb113347.cs \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/misc/arrres.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b268908/vars2.cs \
$(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-M02/b10828/redundant.cs \
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeField1.cs
CORECLR_DISABLED_TEST_IL_SRC += \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/1/arglist64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/2/arglist64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/unaligned/4/arglist64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/PREFIX/volatile/1/arglist64.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/filter1.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/filter2.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/leave/filter3.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/refbyref/byrefconvert.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/init_byte.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/zeroinit/init_uint32.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i4.il \
$(CORECLR_PATH)/tests/src/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i8.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/huge_struct.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param3b.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25paramMixed.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/i4u2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/ii1.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/iu2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/ii2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/simple/Desktop/prefldinit3.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/int64/arrays/hugedim.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/tailcall/deep_array_nz.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/refany/array3.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/refany/array2.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/xxblk/cpblk3.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b44018/b44018.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16895/b16895.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b25459/b25459.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b27883/b27883.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b27917/b27917.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28597/b28597.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30125/b30125.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b08107/b08107.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M10/b06595/b06595.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31283/b31283.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70909/b70909.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71318/b71318.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b102962/t.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b102962/t2.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b115932/t.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b115932/t1.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b091942/nullref.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b471305/b471305.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b475589/b475589.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_468598/Test_HndIndex_10_Reordered.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_b473131/b473131_struct.il \
$(CORECLR_PATH)/tests/src/JIT/Regression/v4/dev10_804810/dev10_804810.il \
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/phoenix/62322/test.il \
$(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param1b.il
# find all CoreCLR *.il test files that aren't mentioned in this file
CORECLR_DEFINED_IL_SRC = $(CORECLR_TEST_IL_SRC) $(CORECLR_DISABLED_TEST_IL_SRC)
CORECLR_UPSTREAM_IL_SRC=$(shell find "$(CORECLR_PATH)/tests" -iname "*.il")
@@ -5164,13 +5172,13 @@ $(CORECLR_PATH)%_il.exe: $(CORECLR_PATH)%.il
$(ILASM) -out:$@ $<
coreclr-testlibrary.dll: $(CORECLR_TESTLIBRARY_CS_SRC)
$(MCS) -unsafe -debug -target:library -d:WINCORESYS -d:MONO -out:$@ $(CORECLR_TESTLIBRARY_CS_SRC)
$(MCS) -unsafe -debug:portable -target:library -d:WINCORESYS -d:MONO -out:$@ $(CORECLR_TESTLIBRARY_CS_SRC)
$(CORECLR_PATH)%.exe: $(CORECLR_PATH)%.cs coreclr-testlibrary.dll
$(MCS) -unsafe -debug -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 -nowarn:0197 -r:coreclr-testlibrary.dll -d:MONO -out:$@ $<
$(MCS) -unsafe -debug:portable -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 -nowarn:0197 -r:coreclr-testlibrary.dll -d:MONO -out:$@ $<
test-runner.exe: $(top_srcdir)/mono/tests/test-runner.cs
$(MCS) -debug -r:Mono.Posix.dll -out:$@ $<
$(MCS) -debug:portable -r:Mono.Posix.dll -out:$@ $<
GCStressTests.exe: $(CORECLR_STRESSTEST_RUNNER_CS_SRC)
$(MCS) -out:$@ -debug -d:PROJECTK_BUILD $(CORECLR_STRESSTEST_RUNNER_CS_SRC)
$(MCS) -out:$@ -debug:portable -d:PROJECTK_BUILD $(CORECLR_STRESSTEST_RUNNER_CS_SRC)
+8 -5
View File
@@ -1,10 +1,13 @@
check-ms-test-suite:
check-ms-test-suite: $(CLASS)/nunitlite.dll
@if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -t:library -warn:1 -r:nunit.framework" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-console.exe -nologo -exclude=MonoBug,BadTest" NUNIT_XML_RESULT=$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml || EXIT_CODE=1; \
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug -warn:1" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -debug:portable -t:library -warn:1 -r:$(CLASS)/nunitlite.dll" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-lite-console.exe -exclude=MonoBug,BadTest -format:nunit2" NUNIT_XML_RESULT="-result:$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml" || EXIT_CODE=1; \
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug:portable -warn:1" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)" || EXIT_CODE=1; \
exit $$EXIT_CODE; \
else \
echo "*** [ms-test-suite] Getting the repository failed, you probably don't have access to this Xamarin-internal resource. Skipping."; \
fi
fi
$(CLASS)/nunitlite.dll:
$(MAKE) -C $(mcs_topdir)/tools/nunit-lite
+13
View File
@@ -0,0 +1,13 @@
SYS_REFS = \
System.dll \
System.Core.dll \
System.Data.dll \
System.Runtime.Serialization.dll \
System.Xml.dll \
System.Xml.Linq.dll \
Mono.Posix.dll
check-profiler-stress:
@$(MAKE) validate-benchmarker RESET_VERSIONS=1
cd profiler-stress && $(MCS) -target:exe $(addprefix -r:, $(SYS_REFS)) -out:runner.exe @runner.exe.sources
cd profiler-stress && $(RUNTIME) runner.exe
+278
View File
@@ -0,0 +1,278 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Xml;
using Mono.Unix.Native;
using Newtonsoft.Json;
// Shut up CLS compliance warnings from Json.NET.
[assembly: CLSCompliant (true)]
namespace Mono.Profiling.Tests.Stress {
// https://github.com/xamarin/benchmarker/blob/master/tools/libdbmodel/Benchmark.cs
sealed class Benchmark {
public string Name { get; set; }
public string TestDirectory { get; set; }
public bool OnlyExplicit { get; set; }
public string[] CommandLine { get; set; }
public string[] ClientCommandLine { get; set; }
public string[] AOTAssemblies { get; set; }
public static Benchmark Load (string file)
{
return JsonConvert.DeserializeObject<Benchmark> (File.ReadAllText (file));
}
}
sealed class TestResult {
public Benchmark Benchmark { get; set; }
public ProcessStartInfo StartInfo { get; set; }
public Stopwatch Stopwatch { get; set; } = new Stopwatch ();
public int? ExitCode { get; set; }
public StringBuilder StandardOutput { get; set; } = new StringBuilder ();
public StringBuilder StandardError { get; set; } = new StringBuilder ();
}
static class Program {
static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
static string FilterInvalidXmlChars (string text) {
return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
}
static int Main ()
{
var depDir = Path.Combine ("..", "external", "benchmarker");
var benchDir = Path.Combine (depDir, "benchmarks");
var testDir = Path.Combine (depDir, "tests");
var benchmarks = Directory.EnumerateFiles (benchDir, "*.benchmark")
.Select (Benchmark.Load)
.Where (b => !b.OnlyExplicit && b.ClientCommandLine == null)
.OrderBy (b => b.Name)
.ToArray ();
var monoPath = Path.GetFullPath (Path.Combine ("..", "..", "runtime", "mono-wrapper"));
var classDir = Path.GetFullPath (Path.Combine ("..", "..", "mcs", "class", "lib", "net_4_x"));
var rand = new Random ();
var cpus = Environment.ProcessorCount;
var results = new List<TestResult> (benchmarks.Length);
var sw = Stopwatch.StartNew ();
for (var i = 0; i < benchmarks.Length; i++) {
var bench = benchmarks [i];
var sampleFreq = rand.Next (0, 1001);
var sampleMode = rand.Next (0, 2) == 1 ? "real" : "process";
var maxSamples = rand.Next (0, cpus * 2000 + 1);
var heapShotFreq = rand.Next (0, 11);
var maxFrames = rand.Next (0, 33);
var allocMode = rand.Next (0, 2) == 1 ? "alloc" : "noalloc";
var profOptions = $"sample=cycles/{sampleFreq},sampling-{sampleMode},maxsamples={maxSamples},heapshot={heapShotFreq}gc,maxframes={maxFrames},{allocMode},output=/dev/null";
var info = new ProcessStartInfo {
UseShellExecute = false,
WorkingDirectory = Path.Combine (testDir, bench.TestDirectory),
FileName = monoPath,
Arguments = $"--debug --profile=log:{profOptions} " + string.Join (" ", bench.CommandLine),
RedirectStandardOutput = true,
RedirectStandardError = true,
};
info.EnvironmentVariables.Clear ();
info.EnvironmentVariables.Add ("MONO_PATH", classDir);
var progress = $"({i + 1}/{benchmarks.Length})";
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] {progress} Running {bench.Name} with profiler options: {profOptions}");
Console.ResetColor ();
var result = new TestResult {
Benchmark = bench,
StartInfo = info,
};
using (var proc = new Process ()) {
proc.StartInfo = info;
proc.OutputDataReceived += (sender, args) => {
if (args.Data != null)
result.StandardOutput.AppendLine (args.Data);
};
proc.ErrorDataReceived += (sender, args) => {
if (args.Data != null)
result.StandardError.AppendLine (args.Data);
};
result.Stopwatch.Start ();
proc.Start ();
proc.BeginOutputReadLine ();
proc.BeginErrorReadLine ();
if (!proc.WaitForExit ((int) _timeout.TotalMilliseconds)) {
// Force a thread dump.
Syscall.kill (proc.Id, Signum.SIGQUIT);
Thread.Sleep (1000);
try {
proc.Kill ();
} catch (Exception) {
}
} else
result.ExitCode = proc.ExitCode;
result.Stopwatch.Stop ();
}
var resultStr = result.ExitCode == null ? "timed out" : $"exited with code: {result.ExitCode}";
Console.ForegroundColor = result.ExitCode != 0 ? ConsoleColor.Red : ConsoleColor.Green;
Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] {progress} {bench.Name} took {result.Stopwatch.Elapsed.ToString ("G")} and {resultStr}");
Console.ResetColor ();
if (result.ExitCode != 0) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine ("===== stdout =====");
Console.ResetColor ();
Console.WriteLine (result.StandardOutput.ToString ());
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine ("===== stderr =====");
Console.ResetColor ();
Console.WriteLine (result.StandardError.ToString ());
}
results.Add (result);
}
sw.Stop ();
var successes = results.Count (r => r.ExitCode == 0);
var failures = results.Count (r => r.ExitCode != null && r.ExitCode != 0);
var timeouts = results.Count (r => r.ExitCode == null);
var settings = new XmlWriterSettings {
NewLineOnAttributes = true,
Indent = true,
};
using (var writer = XmlWriter.Create ("TestResult-profiler-stress.xml", settings)) {
writer.WriteStartDocument ();
writer.WriteComment ("This file represents the results of running a test suite");
writer.WriteStartElement ("test-results");
writer.WriteAttributeString ("name", "profiler-stress-tests.dummy");
writer.WriteAttributeString ("total", results.Count.ToString ());
writer.WriteAttributeString ("failures", failures.ToString ());
writer.WriteAttributeString ("not-run", "0");
writer.WriteAttributeString ("date", DateTime.Now.ToString ("yyyy-MM-dd"));
writer.WriteAttributeString ("time", DateTime.Now.ToString ("HH:mm:ss"));
writer.WriteStartElement ("environment");
writer.WriteAttributeString ("nunit-version", "2.4.8.0");
writer.WriteAttributeString ("clr-version", Environment.Version.ToString ());
writer.WriteAttributeString ("os-version", Environment.OSVersion.ToString ());
writer.WriteAttributeString ("platform", Environment.OSVersion.Platform.ToString ());
writer.WriteAttributeString ("cwd", Environment.CurrentDirectory);
writer.WriteAttributeString ("machine-name", Environment.MachineName);
writer.WriteAttributeString ("user", Environment.UserName);
writer.WriteAttributeString ("user-domain", Environment.UserDomainName);
writer.WriteEndElement ();
writer.WriteStartElement ("culture-info");
writer.WriteAttributeString ("current-culture", CultureInfo.CurrentCulture.Name);
writer.WriteAttributeString ("current-uiculture", CultureInfo.CurrentUICulture.Name);
writer.WriteEndElement ();
writer.WriteStartElement ("test-suite");
writer.WriteAttributeString ("name", "profiler-stress-tests.dummy");
writer.WriteAttributeString ("success", (failures + timeouts == 0).ToString ());
writer.WriteAttributeString ("time", ((int) sw.Elapsed.TotalSeconds).ToString ());
writer.WriteAttributeString ("asserts", (failures + timeouts).ToString ());
writer.WriteStartElement ("results");
writer.WriteStartElement ("test-suite");
writer.WriteAttributeString ("name", "MonoTests");
writer.WriteAttributeString ("success", (failures + timeouts == 0).ToString ());
writer.WriteAttributeString ("time", ((int) sw.Elapsed.TotalSeconds).ToString ());
writer.WriteAttributeString ("asserts", (failures + timeouts).ToString ());
writer.WriteStartElement ("results");
writer.WriteStartElement ("test-suite");
writer.WriteAttributeString ("name", "profiler-stress");
writer.WriteAttributeString ("success", (failures + timeouts == 0).ToString ());
writer.WriteAttributeString ("time", ((int) sw.Elapsed.TotalSeconds).ToString ());
writer.WriteAttributeString ("asserts", (failures + timeouts).ToString ());
writer.WriteStartElement ("results");
foreach (var result in results) {
var timeoutStr = result.ExitCode == null ? "_timeout" : string.Empty;
writer.WriteStartElement ("test-case");
writer.WriteAttributeString ("name", $"MonoTests.profiler-stress.{result.Benchmark.Name}{timeoutStr}");
writer.WriteAttributeString ("executed", "True");
writer.WriteAttributeString ("success", (result.ExitCode == 0).ToString ());
writer.WriteAttributeString ("time", ((int) result.Stopwatch.Elapsed.TotalSeconds).ToString ());
writer.WriteAttributeString ("asserts", result.ExitCode == 0 ? "0" : "1");
if (result.ExitCode != 0) {
writer.WriteStartElement ("failure");
writer.WriteStartElement ("message");
writer.WriteCData (FilterInvalidXmlChars (result.StandardOutput.ToString ()));
writer.WriteEndElement ();
writer.WriteStartElement ("stack-trace");
writer.WriteCData (FilterInvalidXmlChars (result.StandardError.ToString ()));
writer.WriteEndElement ();
writer.WriteEndElement ();
}
writer.WriteEndElement ();
}
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndDocument ();
}
var failureStr = failures + timeouts != 0 ? $" ({failures} failures, {timeouts} timeouts)" : string.Empty;
Console.ForegroundColor = failures + timeouts != 0 ? ConsoleColor.Red : ConsoleColor.Green;
Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] Finished with {successes}/{results.Count} passing tests{failureStr}");
Console.ResetColor ();
return failures + timeouts;
}
}
}
@@ -0,0 +1,156 @@
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryType.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonToken.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonType.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonObjectId.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/BinaryConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DataSetConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DataTableConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/CustomCreationConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DateTimeConverterBase.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/EntityKeyMemberConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/ExpandoObjectConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/KeyValuePairConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/BsonObjectIdConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/RegexConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/StringEnumConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/ConstructorHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/VersionConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/DateFormatHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/DateTimeZoneHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Formatting.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConstructorAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonPosition.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPropertyKeyedCollection.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicProxy.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPath.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JRaw.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Required.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonDynamicContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonISerializableContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonLinqContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonPrimitiveContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DynamicValueProvider.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ErrorEventArgs.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPropertyDescriptor.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultReferenceResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/PreserveReferencesHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/IJsonLineInfo.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonArrayAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonContainerAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/DefaultValueHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverterAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonObjectAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializerSettings.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonValidatingReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/IJEnumerable.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenEqualityComparer.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/MemberSerialization.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/ObjectCreationHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/JavaScriptDateTimeConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonTextReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonPropertyAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonIgnoreAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonTextWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonWriterException.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonReaderException.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverterCollection.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConvert.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializationException.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializer.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/Extensions.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JConstructor.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JContainer.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JEnumerable.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JObject.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JArray.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JToken.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JProperty.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenType.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JValue.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/Extensions.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaException.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaModel.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaModelBuilder.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaNodeCollection.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaNode.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/UndefinedSchemaIdHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/ValidationEventArgs.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/ValidationEventHandler.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/CamelCasePropertyNamesContractResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ErrorContext.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IContractResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IValueProvider.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonDictionaryContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonProperty.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonPropertyCollection.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/MissingMemberHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/NullValueHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/ReferenceLoopHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchema.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaBuilder.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaConstants.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IReferenceResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaType.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonObjectContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerProxy.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonStringContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/CachedAttributeGetter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/LateBoundMetadataTypeAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ReflectionValueProvider.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/OnErrorAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/Base64Encoder.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicProxyMetaObject.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicWrapper.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ObjectConstructor.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ReflectionDelegateFactory.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/LateBoundReflectionDelegateFactory.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MethodCall.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringReference.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ThreadSafeStore.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/TypeNameHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/BidirectionalDictionary.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/CollectionWrapper.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DateTimeUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumValue.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumValues.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/JavaScriptUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonToken.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringBuffer.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/CollectionUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ListWrapper.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MathUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MiscellaneousUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/TypeExtensions.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ValidationUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/WriteState.cs
runner.cs
+10
View File
@@ -3,28 +3,35 @@
SUBMODULES_CONFIG_FILE = $(top_srcdir)/acceptance-tests/SUBMODULES.json
include $(top_srcdir)/scripts/submodules/versions.mk
$(eval $(call ValidateVersionTemplate,benchmarker,BENCHMARKER))
$(eval $(call ValidateVersionTemplate,roslyn,ROSLYN))
$(eval $(call ValidateVersionTemplate,coreclr,CORECLR))
$(eval $(call ValidateVersionTemplate,ms-test-suite,MSTESTSUITE))
# Bump the given submodule to the revision given by the REV make variable
# If COMMIT is 1, commit the change
bump-benchmarker: __bump-benchmarker
bump-roslyn: __bump-version-roslyn
bump-coreclr: __bump-version-coreclr
bump-ms-test-suite: __bump-version-ms-test-suite
# Bump the given submodule to the branch given by the BRANCH/REMOTE_BRANCH make variables
# If COMMIT is 1, commit the change
bump-branch-benchmarker: __bump-branch-benchmarker
bump-branch-roslyn: __bump-branch-roslyn
bump-branch-coreclr: __bump-branch-coreclr
bump-branch-ms-test-suite: __bump-branch-ms-test-suite
# Bump the given submodule to its current GIT version
# If COMMIT is 1, commit the change
bump-current-benchmarker: __bump-current-benchmarker
bump-current-roslyn: __bump-current-version-roslyn
bump-current-coreclr: __bump-current-version-coreclr
bump-current-ms-test-suite: __bump-current-version-ms-test-suite
commit-bump-benchmarker:
$(MAKE) bump-benchmarker COMMIT=1
commit-bump-roslyn:
$(MAKE) bump-roslyn COMMIT=1
@@ -34,6 +41,9 @@ commit-bump-coreclr:
commit-bump-ms-test-suite:
$(MAKE) bump-ms-test-suite COMMIT=1
commit-bump-current-benchmarker:
$(MAKE) bump-current-benchmarker COMMIT=1
commit-bump-current-roslyn:
$(MAKE) bump-current-roslyn COMMIT=1
-79
View File
@@ -1,79 +0,0 @@
#
# Appveyor configuration file for CI build of Mono on Windows (under Cygwin)
#
# For further details see http://www.appveyor.com
#
#
# Custom environment variables
#
environment:
global:
CYG_ROOT: C:\cygwin
CYG_MIRROR: http://cygwin.mirror.constant.com
CYG_CACHE: C:\cygwin\var\cache\setup
CYG_BASH: C:\cygwin\bin\bash
#
# Cache Cygwin files to speed up build
#
cache:
- '%CYG_CACHE%'
#
# Do a shallow clone of the repo to speed up build
#
clone_depth: 1
#
# Initialisation prior to pulling the Mono repository
# Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
#
init:
- git config --global core.autocrlf input
#
# Install needed build dependencies
#
install:
- ps: 'Start-FileDownload "http://cygwin.com/setup-x86.exe" -FileName "setup-x86.exe"'
- 'setup-x86.exe --quiet-mode --no-shortcuts --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --packages autoconf,automake,bison,gcc-core,gcc-g++,mingw-runtime,mingw-binutils,mingw-gcc-core,mingw-gcc-g++,mingw-pthreads,mingw-w32api,libtool,make,python,gettext-devel,gettext,intltool,libiconv,pkg-config,git,curl,libxslt > NUL 2>&1'
- '%CYG_BASH% -lc "cygcheck -dc cygwin"'
# Cygwin build script
#
# NOTES:
#
# The stdin/stdout file descriptor appears not to be valid for the Appveyor
# build which causes failures as certain functions attempt to redirect
# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
#
build_script:
- 'echo Building...'
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ./autogen.sh --prefix=/usr/local --host=i686-pc-mingw32"'
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make get-monolite-latest"'
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make -j2"'
- 'echo Installing...'
- 'mkdir %APPVEYOR_BUILD_FOLDER%\install'
- '%CYG_BASH% -lc "export CYGWIN=winsymlinks:native; mount \"$APPVEYOR_BUILD_FOLDER\install\" /usr/local; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make install; umount /usr/local"'
#
# Disable tests for now
#
test: off
#
# Only build the master branch
#
branches:
only:
- master
#
# NOTE: Currently this is the Mono installation tree. In future we will create an installation package artifact.
# It has to be relative to the project path. Thus we have installed to within the build tree.
#
artifacts:
- path: install
name: mono-binaries
type: zip
+418 -107
View File
@@ -1,8 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
# when bumping version number below, keep it in sync with man/mono.1 too
AC_INIT(mono, [4.7.0],
AC_INIT(mono, [5.0.1],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
@@ -29,6 +28,24 @@ AC_PROG_LN_S
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
MONO_VERSION_MAJOR=`echo $VERSION | cut -d . -f 1`
MONO_VERSION_MINOR=`echo $VERSION | cut -d . -f 2`
MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
# This is the version number of the corlib-runtime interface. When
# making changes to this interface (by changing the layout
# of classes the runtime knows about, changing icall signature or
# semantics etc), increment this variable.
#
# This can be reset to 0 when Mono's version number is bumped
# since it's part of the corlib version (the prefix '1' in the full
# version number is to ensure the number isn't treated as octal in C)
MONO_CORLIB_COUNTER=0
MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
AC_SUBST(MONO_CORLIB_VERSION)
case $host_os in
*cygwin* )
echo "Run configure using ./configure --host=i686-pc-mingw32"
@@ -52,6 +69,8 @@ CPPFLAGS_FOR_LIBGC=$CPPFLAGS
CFLAGS_FOR_LIBGC=$CFLAGS
CPPFLAGS_FOR_EGLIB=$CPPFLAGS
CFLAGS_FOR_EGLIB=$CFLAGS
CPPFLAGS_FOR_BTLS=$CPPFLAGS
CFLAGS_FOR_BTLS=$CFLAGS
# libgc uses some deprecated APIs
CFLAGS_FOR_LIBGC="$CFLAGS -Wno-deprecated-declarations"
@@ -66,7 +85,11 @@ AC_SUBST(libmono_cflags)
AC_SUBST(libmono_ldflags)
# Variable to have relocatable .pc files (lib, or lib64)
reloc_libdir=`basename ${libdir}`
# realpath isn't always available, and requires that all but the tip of the provided
# path exists. Fall back to the old behaviour, but realpath allows depth >1
# e.g. Debian puts Mono in /usr/bin and libs in /usr/lib/x86_64-linux-gnu/ which is
# too deep for the old method to work
reloc_libdir=`realpath --relative-to=${prefix} ${libdir} 2> /dev/null || basename ${libdir}`
AC_SUBST(reloc_libdir)
# Set to yes if Unix sockets cannot be created in an anonymous namespace
@@ -111,6 +134,7 @@ case "$host" in
libgc_threads=win32
with_sigaltstack=no
with_tls=pthread
with_sgen_default_concurrent=yes
LN_S=cp
# This forces libgc to use the DllMain based thread registration code on win32
libgc_configure_args="$libgc_configure_args --enable-win32-dllmain=yes"
@@ -126,6 +150,7 @@ case "$host" in
libgc_threads=pthreads
with_sigaltstack=no
use_sigposix=yes
with_sgen_default_concurrent=yes
;;
*-*-kfreebsd*-gnu)
CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -DTHREAD_LOCAL_ALLOC -pthread"
@@ -136,6 +161,7 @@ case "$host" in
need_link_unlink=yes
with_sigaltstack=no
use_sigposix=yes
with_sgen_default_concurrent=yes
;;
*-*-*freebsd*)
if test "x$PTHREAD_CFLAGS" = "x"; then
@@ -159,6 +185,7 @@ case "$host" in
libgc_threads=pthreads
use_sigposix=yes
has_dtrace=yes
with_sgen_default_concurrent=yes
;;
*-*-*openbsd*)
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DPLATFORM_BSD -D_REENTRANT -DUSE_MMAP"
@@ -173,6 +200,7 @@ case "$host" in
libgc_threads=pthreads
with_sigaltstack=no
use_sigposix=yes
with_sgen_default_concurrent=yes
;;
*-*-linux-android*)
platform_android=yes
@@ -236,6 +264,7 @@ case "$host" in
disable_munmap=yes
;;
esac
with_sgen_default_concurrent=yes
;;
*-*-nacl*)
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
@@ -308,8 +337,10 @@ case "$host" in
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_CPPFLAGS"
CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
with_sgen_default_concurrent=yes
;;
x*64-*-darwin*)
with_sgen_default_concurrent=yes
;;
arm*-darwin*)
has_dtrace=no
@@ -345,6 +376,10 @@ if test x$target_win32 = xyes; then
AC_DEFINE(TARGET_WIN32, 1, [Target Platform is Win32])
fi
# Defined for all targets/platforms using classic Windows API support.
AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
AC_SUBST(extra_runtime_ldflags)
AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
@@ -361,6 +396,10 @@ if test -z "$PLATFORM_LINUX_TRUE"; then :
PLATFORM_AOT_SUFFIX=.so
fi
if test -z "$HOST_WIN32_TRUE"; then :
PLATFORM_AOT_SUFFIX=.dll
fi
AC_SUBST(PLATFORM_AOT_SUFFIX)
## PLATFORM_AOT_SUFFIX not so simple for windows :-)
@@ -414,6 +453,10 @@ AC_HEADER_STDC
AC_LIBTOOL_WIN32_DLL
# This causes monodis to not link correctly
#AC_DISABLE_FAST_INSTALL
#lookup makedev() header
AC_HEADER_MAJOR
AM_PROG_LIBTOOL
# Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
DOLT
@@ -521,7 +564,7 @@ AC_ARG_ENABLE(visibility-hidden,
WARN=''
if test x"$GCC" = xyes; then
WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes'
WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -Wno-format-zero-length'
# We require C99 with some GNU extensions, e.g. `linux` macro
CFLAGS="$CFLAGS -std=gnu99"
@@ -532,9 +575,6 @@ if test x"$GCC" = xyes; then
# We rely on signed overflow to behave
CFLAGS="$CFLAGS -fwrapv"
# We rely on zero length arrays in structs
CFLAGS="$CFLAGS -Wno-zero-length-array"
CFLAGS="$CFLAGS -DMONO_DLL_EXPORT"
if test x"$disable_visibility_hidden" = xno; then
# Don't export any symbols by default
@@ -561,6 +601,8 @@ if test x"$GCC" = xyes; then
# https://bugzilla.samba.org/show_bug.cgi?id=8118
WARN="$WARN -Qunused-arguments"
WARN="$WARN -Wno-unused-function -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address -Wno-constant-logical-operand"
# We rely on zero length arrays in structs
WARN="$WARN -Wno-zero-length-array"
fi
else
# The Sun Forte compiler complains about inline functions that access static variables
@@ -741,21 +783,51 @@ fi
AC_ARG_ENABLE(system-aot, [ --enable-system-aot Enable the Ahead-Of-Time compilation of system assemblies during the build (on by default on some platforms)], enable_system_aot=$enableval, enable_system_aot=default)
DISABLED_FEATURES=none
csc_compiler=default
endian=unknown
AC_C_BIGENDIAN([endian=big],[endian=little],[endian=unknown])
AC_MSG_CHECKING([CSharp compiler to use])
AC_ARG_WITH(csc, [ --with-csc=mcs,roslyn,default Configures the CSharp compiler to use],[
if test x$withval = xmcs; then
csc_compiler=mcs
elif test x$withval = xroslyn; then
csc_compiler=roslyn
elif test x$withval = xdefault; then
:
else
AC_MSG_ERROR([You must supply one of "mcs", "roslyn" or "default" to the --with-csc option])
fi
],[csc_compiler=default])
if test $csc_compiler = default; then
if test $endian = big; then
csc_compiler=mcs
elif test $endian = little; then
csc_compiler=roslyn
else
csc_compiler=mcs
fi
fi
AC_MSG_RESULT($csc_compiler)
#
# Set the build profiles and options before things which use them
#
AC_ARG_WITH(profile4_x, [ --with-profile4=yes,no If you want to install the 4.x FX (defaults to yes)], [], [with_profile4_x=default])
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=default])
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=default])
AC_ARG_WITH(monotouch_watch, [ --with-monotouch_watch=yes,no If you want to build the Xamarin.WatchOS assemblies (defaults to no)],[], [with_monotouch_watch=default])
AC_ARG_WITH(monotouch_tv, [ --with-monotouch_tv=yes,no If you want to build the Xamarin.TVOS assemblies (defaults to no)], [], [with_monotouch_tv=default])
AC_ARG_WITH(bitcode, [ --with-bitcode=yes,no If bitcode is enabled (defaults to no)], [], [with_bitcode=default])
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=default])
AC_ARG_WITH(mobile_static, [ --with-mobile_static=yes,no If you want to build the mobile_static assemblies (defaults to no)], [], [with_mobile_static=default])
AC_ARG_WITH(profile4_x, [ --with-profile4_x=yes,no If you want to install the 4.x FX (defaults to yes)], [], [with_profile4_x=default])
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=default])
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=default])
AC_ARG_WITH(monotouch_watch, [ --with-monotouch_watch=yes,no If you want to build the Xamarin.WatchOS assemblies (defaults to no)], [], [with_monotouch_watch=default])
AC_ARG_WITH(monotouch_tv, [ --with-monotouch_tv=yes,no If you want to build the Xamarin.TVOS assemblies (defaults to no)], [], [with_monotouch_tv=default])
AC_ARG_WITH(bitcode, [ --with-bitcode=yes,no If bitcode is enabled (defaults to no)], [], [with_bitcode=default])
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=default])
AC_ARG_WITH(testing_aot_hybrid, [ --with-testing_aot_hybrid=yes,no If you want to build the testing_aot_hybrid assemblies (defaults to no)], [], [with_testing_aot_hybrid=default])
AC_ARG_WITH(testing_aot_full, [ --with-testing_aot_full=yes,no If you want to build the testing_aot_full assemblies (defaults to no)], [], [with_testing_aot_full=default])
AC_ARG_WITH(winaot, [ --with-winaot=yes,no If you want to build the Windows friendly AOT assemblies (defaults to no)], [], [with_winaot=default])
AC_ARG_WITH(orbis, [ --with-orbis=yes,no If you want to build the Orbis assemblies (defaults to no)], [], [with_orbis=default])
AC_ARG_WITH(runtime_preset, [ --with-runtime_preset=net_4_x,all,mobile_static,bitcode_mobile_static Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
AC_ARG_WITH(runtime_preset, [ --with-runtime_preset=net_4_x,all,aot,hybridaot,fullaot,bitcode Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
dnl
dnl Profile defaults
@@ -763,52 +835,39 @@ dnl
TEST_PROFILE=default
enable_llvm_default=no
INVARIANT_AOT_OPTIONS=nimt-trampolines=900,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=2800
with_profile4_x_default=no
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_xammac_default=no
with_testing_aot_hybrid_default=no
with_testing_aot_full_default=no
with_winaot_default=no
with_orbis_default=no
with_bitcode_default=no
with_cooperative_gc_default=no
INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4000
if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
DISABLE_MCS_DOCS_default=yes
with_profile4_x_default=no
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_xammac_default=no
with_mobile_static_default=no
with_bitcode_default=no
with_cooperative_gc_default=no
elif test x$with_runtime_preset = xnet_4_x; then
with_cooperative_gc_default=no
with_profile4_x_default=yes
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_xammac_default=no
with_mobile_static_default=no
with_bitcode_default=no
elif test x$with_runtime_preset = xall; then
with_cooperative_gc_default=no
with_profile4_x_default=yes
with_monodroid_default=yes
with_monotouch_default=yes
with_monotouch_watch_default=yes
with_monotouch_tv_default=yes
with_xammac_default=yes
with_mobile_static_default=no
with_bitcode_default=no
elif test x$with_runtime_preset = xmobile_static; then
with_winaot_default=yes
with_orbis_default=yes
elif test x$with_runtime_preset = xfullaot; then
DISABLE_MCS_DOCS_default=yes
with_cooperative_gc_default=no
with_profile4_x_default=no
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_xammac_default=no
with_mobile_static_default=yes
with_bitcode_default=no
with_cooperative_gc_default=no
TEST_PROFILE=mobile_static
with_testing_aot_full_default=yes
TEST_PROFILE=testing_aot_full
mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
@@ -817,19 +876,14 @@ elif test x$with_runtime_preset = xmobile_static; then
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="-O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--full-aot"
elif test x$with_runtime_preset = xbitcode_mobile_static; then
elif test x$with_runtime_preset = xbitcode; then
DISABLE_MCS_DOCS_default=yes
with_profile4_x_default=no
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_xammac_default=no
with_mobile_static_default=yes
with_testing_aot_full_default=yes
with_bitcode_default=yes
with_cooperative_gc_default=yes
TEST_PROFILE=mobile_static
TEST_PROFILE=testing_aot_full
enable_llvm_default=yes
mono_feature_disable_com='yes'
@@ -840,16 +894,52 @@ elif test x$with_runtime_preset = xbitcode_mobile_static; then
AOT_BUILD_FLAGS="--aot=llvmonly,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--llvmonly"
elif test x$with_runtime_preset = xhybridaot; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_hybrid_default=yes
TEST_PROFILE=testing_aot_hybrid
mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="--aot=hybrid,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--hybrid-aot"
elif test x$with_runtime_preset = xaot; then
with_profile4_x_default=yes
AOT_BUILD_FLAGS="--aot=$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS=""
DISABLE_MCS_DOCS_default=yes
elif test x$with_runtime_preset = xwinaot; then
DISABLE_MCS_DOCS_default=yes
with_winaot_default=yes
TEST_PROFILE=winaot
mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_reflection_emit_save='yes'
mono_feature_disable_reflection_emit='yes'
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="--aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--full-aot"
elif test x$with_runtime_preset = xorbis; then
DISABLE_MCS_DOCS_default=yes
with_orbis_default=yes
TEST_PROFILE=orbis
mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_reflection_emit_save='yes'
mono_feature_disable_reflection_emit='yes'
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="--aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--full-aot"
else
with_profile4_x_default=yes
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_bitcode_default=no
with_xammac_default=no
with_mobile_static_default=no
with_cooperative_gc_default=no
fi
if test "x$AOT_BUILD_FLAGS" != "x"; then :
@@ -882,9 +972,19 @@ fi
if test "x$with_xammac" = "xdefault"; then
with_xammac=$with_xammac_default
fi
if test "x$with_mobile_static" = "xdefault"; then
with_mobile_static=$with_mobile_static_default
if test "x$with_testing_aot_hybrid" = "xdefault"; then
with_testing_aot_hybrid=$with_testing_aot_hybrid_default
fi
if test "x$with_testing_aot_full" = "xdefault"; then
with_testing_aot_full=$with_testing_aot_full_default
fi
if test "x$with_winaot" = "xdefault"; then
with_winaot=$with_winaot_default
fi
if test "x$with_orbis" = "xdefault"; then
with_orbis=$with_orbis_default
fi
AM_CONDITIONAL(INSTALL_4_x, [test "x$with_profile4_x" = "xyes"])
AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"])
@@ -893,9 +993,12 @@ AM_CONDITIONAL(INSTALL_MONOTOUCH_WATCH, [test "x$with_monotouch_watch" != "xno"]
AM_CONDITIONAL(INSTALL_MONOTOUCH_TV, [test "x$with_monotouch_tv" != "xno"])
AM_CONDITIONAL(BITCODE, test "x$with_bitcode" = "xyes")
AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"])
AM_CONDITIONAL(INSTALL_MOBILE_STATIC, [test "x$with_mobile_static" != "xno"])
AC_SUBST(INSTALL_MOBILE_STATIC)
AM_CONDITIONAL(INSTALL_TESTING_AOT_HYBRID, [test "x$with_testing_aot_hybrid" != "xno"])
AM_CONDITIONAL(INSTALL_TESTING_AOT_FULL, [test "x$with_testing_aot_full" != "xno"])
AM_CONDITIONAL(INSTALL_WINAOT, [test "x$with_winaot" != "xno"])
AM_CONDITIONAL(INSTALL_ORBIS, [test "x$with_orbis" != "xno"])
AM_CONDITIONAL(FULL_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full"] || [test "x$TEST_PROFILE" = "xwinaot"] || [test "x$TEST_PROFILE" = "xorbis"])
AM_CONDITIONAL(HYBRID_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_hybrid"])
default_profile=net_4_x
if test -z "$INSTALL_MONODROID_TRUE"; then :
@@ -907,8 +1010,17 @@ fi
if test -z "$INSTALL_XAMMAC_TRUE"; then :
default_profile=xammac
fi
if test -z "$INSTALL_MOBILE_STATIC_TRUE"; then :
default_profile=mobile_static
if test -z "$INSTALL_TESTING_AOT_HYBRID_TRUE"; then :
default_profile=testing_aot_hybrid
fi
if test -z "$INSTALL_TESTING_AOT_FULL_TRUE"; then :
default_profile=testing_aot_full
fi
if test -z "$INSTALL_WINAOT_TRUE"; then :
default_profile=winaot
fi
if test -z "$INSTALL_ORBIS_TRUE"; then :
default_profile=orbis
fi
if test -z "$INSTALL_4_x_TRUE"; then :
default_profile=net_4_x
@@ -941,7 +1053,7 @@ fi
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, assembly_remapping, shared_perfcounters, remoting,
security, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.],
security, lldb, mdb, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -1030,11 +1142,6 @@ if test "x$mono_feature_disable_attach" = "xyes"; then
AC_MSG_NOTICE([Disabled agent attach])
fi
if test "x$mono_feature_disable_full_messages" = "xyes"; then
AC_DEFINE(DISABLE_FULL_MESSAGES, 1, [Disables building in the full table of WAPI messages])
AC_MSG_NOTICE([Disabled full messages for Win32 errors, only core message strings shipped])
fi
if test "x$mono_feature_disable_verifier" = "xyes"; then
AC_DEFINE(DISABLE_VERIFIER, 1, [Disables the verifier])
AC_MSG_NOTICE([Disabled the metadata and IL verifiers])
@@ -1091,6 +1198,16 @@ if test "x$mono_feature_disable_security" = "xyes"; then
AC_MSG_NOTICE([Disabled CAS/CoreCLR security manager (used e.g. for Moonlight)])
fi
if test "x$mono_feature_disable_lldb" = "xyes"; then
AC_DEFINE(DISABLE_LLDB, 1, [Disable support code for the LLDB plugin.])
AC_MSG_NOTICE([Disabled LLDB plugin support code.])
fi
if test "x$mono_feature_disable_mdb" = "xyes"; then
AC_DEFINE(DISABLE_MDB, 1, [Disable support for .mdb symbol files.])
AC_MSG_NOTICE([Disabled support for .mdb symbol files.])
fi
if test "x$mono_feature_disable_sgen_remset" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_REMSET, 1, [Disable wbarrier=remset support in SGEN.])
AC_MSG_NOTICE([Disabled wbarrier=remset support in SGEN.])
@@ -1156,20 +1273,6 @@ AC_COMPILE_IFELSE([
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for deprecated __attribute__)
AC_TRY_COMPILE([
int doit (void) __attribute__ ((deprecated));
int doit (void) { return 0; }
], [
return 0;
], [
have_deprecated=yes
AC_MSG_RESULT(yes)
], [
have_deprecated=no
AC_MSG_RESULT(no)
])
dnl
dnl Boehm GC configuration
dnl
@@ -1390,7 +1493,15 @@ if test x$host_win32 = xno; then
# We have the new, three-parameter version
AC_MSG_RESULT(no)
])
AC_TRY_COMPILE([#include <sched.h>], [
CPU_COUNT((void *) 0);
], [
AC_MSG_RESULT(yes)
AC_DEFINE(GLIBC_HAS_CPU_COUNT, 1, [GLIBC has CPU_COUNT macro in sched.h])
], [
# We have the new, three-parameter version
AC_MSG_RESULT(no)
])
dnl ******************************************************************
dnl *** Check for large file support ***
@@ -2666,12 +2777,6 @@ fi
AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes)
AC_ARG_ENABLE(perf-events, [ --enable-perf-events Enable using `perf` for profiling on Linux], test_perf_events=$enableval, test_perf_events=no)
if test "x$test_perf_events" = "xyes"; then
AC_DEFINE(ENABLE_PERF_EVENTS, 1, [Enable using `perf` for profiling on Linux])
AC_SUBST(ENABLE_PERF_EVENTS)
fi
AC_MSG_CHECKING([if big-arrays are to be enabled])
AC_ARG_ENABLE(big-arrays, [ --enable-big-arrays Enable the allocation and indexing of arrays greater than Int32.MaxValue], enable_big_arrays=$enableval, enable_big_arrays=no)
if test "x$enable_big_arrays" = "xyes" ; then
@@ -2856,13 +2961,12 @@ if test "x$enable_llvm" = "xyes"; then
LLVM_SYSTEM_LIBS=`$LLVM_CONFIG --system-libs 2>/dev/null | grep -- -`
llvm_jit_supported=yes
llvm_jit_libs="jit mcjit $llvm_codegen"
if test $llvm_api_version -gt 100; then
# Based on llvm 3.9, only aot is currently supported
llvm_jit_libs="orcjit $llvm_codegen"
elif test "x$host" != "x$target"; then
if test "x$host" != "x$target"; then
# No need for jit libs
llvm_jit_supported=no
llvm_jit_libs=""
elif test $llvm_api_version -gt 100; then
llvm_jit_libs="orcjit $llvm_codegen"
fi
LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter $llvm_jit_libs`
if test "x$LLVM_LIBS" = "x"; then
@@ -2948,6 +3052,8 @@ sizeof_register="SIZEOF_VOID_P"
jit_wanted=true
boehm_supported=true
BTLS_SUPPORTED=no
BTLS_PLATFORM=
case "$host" in
mips*)
TARGET=MIPS;
@@ -3000,9 +3106,14 @@ case "$host" in
;;
linux*)
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=i386
AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
;;
darwin*)
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=i386
;;
openbsd*|freebsd*|kfreebsd-gnu*)
;;
@@ -3018,9 +3129,15 @@ case "$host" in
case $host_os in
linux*)
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=x86_64
AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
;;
darwin*)
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=x86_64
boehm_supported=false
;;
openbsd*|freebsd*|kfreebsd-gnu*)
;;
@@ -3141,6 +3258,7 @@ HOST=$TARGET
if test "x$host" != "x$target"; then
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
enable_mcs_build=no
BTLS_SUPPORTED=no
case "$target" in
arm*-darwin*)
TARGET=ARM;
@@ -3426,10 +3544,12 @@ if test "x$target_mach" = "xyes"; then
AC_DEFINE(TARGET_WATCHOS,1,[The JIT/AOT targets WatchOS])
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_WATCHOS"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_WATCHOS"
BTLS_SUPPORTED=no
elif test "x$TARGET" = "xARM" -o "x$TARGET" = "xARM64"; then
AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
BTLS_SUPPORTED=no
else
AC_TRY_COMPILE([#include "TargetConditionals.h"],[
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
@@ -3440,15 +3560,19 @@ if test "x$target_mach" = "xyes"; then
AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX])
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_OSX"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_OSX"
target_osx=yes
], [
AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
BTLS_SUPPORTED=no
])
fi
AC_DEFINE(TARGET_MACH,1,[The JIT/AOT targets Apple platforms])
fi
AM_CONDITIONAL(TARGET_OSX, test x$target_osx = xyes)
if test "x$sizeof_register" = "x4"; then
AC_DEFINE(SIZEOF_REGISTER,4,[size of machine integer registers])
elif test "x$sizeof_register" = "x8"; then
@@ -3473,6 +3597,15 @@ if test "x$have_deprecated" = "xyes"; then
AC_DEFINE(HAVE_DEPRECATED, 1, [Support for the deprecated attribute])
fi
AC_ARG_WITH(interpreter, [ --with-interpreter=yes|no Interpreter, default=no],[buildinterpreter=$with_interpreter],[buildinterpreter=no])
if test "x$buildinterpreter" = "xyes"; then
AC_DEFINE(ENABLE_INTERPRETER, 1, [Enable interpreter in the runtime.])
AC_MSG_NOTICE([Enable interpreter in the runtime.])
fi
AM_CONDITIONAL([ENABLE_INTERPRETER], [test x$buildinterpreter != xno])
dnl
dnl Simple Generational checks (sgen)
dnl
@@ -3751,10 +3884,63 @@ if test ${TARGET} = unknown; then
AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
fi
if test "x$platform_android" = "xyes"; then
case "x${TARGET}" in
xARM)
case "x$arm_ver" in
xARMv5)
BTLS_SUPPORTED=yes
BTLS_PLATFORM=android-armv5
;;
xARMv6)
BTLS_SUPPORTED=yes
BTLS_PLATFORM=android-armv6
;;
xARMv7)
BTLS_SUPPORTED=yes
BTLS_PLATFORM=android-armv7
;;
*)
BTLS_SUPPORTED=no
;;
esac
;;
xARM64)
BTLS_SUPPORTED=yes
BTLS_PLATFORM=android-v8a
;;
xX86)
BTLS_SUPPORTED=yes
BTLS_PLATFORM=android-x86
;;
xAMD64)
BTLS_SUPPORTED=yes
BTLS_PLATFORM=android-x64
;;
*)
BTLS_SUPPORTED=no
;;
esac
fi
if test ${ACCESS_UNALIGNED} = no; then
CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
fi
if test x$host_darwin = xyes; then
AC_MSG_CHECKING([for ranlib that supports -no_warning_for_no_symbols option])
AS_IF(
[$RANLIB -no_warning_for_no_symbols 2>&1 | grep -q "unknown option"],
[AC_MSG_RESULT([no])],
[
# avoid AR calling ranlib, libtool calls it anyway. suppress no symbols warning.
AR_FLAGS="Scru"
RANLIB="$RANLIB -no_warning_for_no_symbols"
AC_MSG_RESULT([yes])
]
)
fi
case "x$libgc" in
xincluded)
# Pass CPPFLAGS to libgc configure
@@ -3873,6 +4059,90 @@ else
fi
AC_SUBST(LIBMONO_LA)
dnl **************
dnl *** Btls ***
dnl **************
AC_ARG_ENABLE(btls, [ --disable-btls Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
AC_ARG_WITH(btls_android_ndk, [ --with-btls-android-ndk Android NDK for BoringTls])
AC_ARG_ENABLE(dynamic-btls, [ --enable-dynamic-btls Place the BTLS provider into a separate shared library/archive.], enable_dynamic_btls=$enableval, enable_dynamic_btls=no)
AM_CONDITIONAL(BTLS, test x$enable_btls = xyes)
btls_android=no
if test "x$enable_btls" = "xyes"; then
AC_PATH_PROG(CMAKE, [cmake], [no], [$PATH:/Applications/CMake.app/Contents/bin:/usr/local/bin])
if test "x$CMAKE" = "xno"; then
AC_MSG_ERROR("cmake not found")
fi
BTLS_ROOT=`cd $srcdir && pwd`/external/boringssl
AC_SUBST(BTLS_ROOT)
btls_arch=
btls_cflags=
BTLS_CMAKE_ARGS=
case "$BTLS_PLATFORM" in
i386)
btls_arch=i386
btls_cflags="-m32"
case $host_os in
darwin*)
btls_cflags="$btls_cflags -arch i386"
esac
;;
x86_64)
btls_arch=x86_64
;;
android-armv5)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=12"
;;
android-armv6)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=12"
;;
android-armv7)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=12"
;;
android-v8a)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=12"
;;
android-x86)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=12"
;;
android-x64)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=12"
;;
*)
AC_MSG_ERROR(Invalid BTLS platform)
esac
if test "x$platform_android" = "xyes"; then
btls_android=yes
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
if test "x$with_btls_android_ndk" != "x"; then
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DANDROID_NDK=\"$with_btls_android_ndk\""
fi
fi
if test "x$btls_arch" != "x"; then
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DBTLS_ARCH=\"$btls_arch\""
fi
BTLS_CFLAGS="$CPPFLAGS_FOR_BTLS $btls_cflags"
AC_SUBST(BTLS_ARCH)
AC_SUBST(BTLS_CFLAGS)
AC_SUBST(BTLS_PLATFORM)
AC_SUBST(BTLS_CMAKE_ARGS)
AC_DEFINE(HAVE_BTLS, 1, [BoringTls is supported])
else
enable_btls=no
fi
AM_CONDITIONAL(BTLS_ANDROID, test x$btls_android = xyes)
if test x$DISABLE_MCS_DOCS = xyes; then
docs_dir=""
else
@@ -3927,10 +4197,20 @@ AC_SUBST(mono_build_root)
mono_runtime=mono/mini/mono
AC_SUBST(mono_runtime)
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.0.0/tools/csc.exe
if test $csc_compiler = mcs; then
CSC=$mcs_topdir/class/lib/build/mcs.exe
else
CSC=$CSC_LOCATION
fi
mono_cfg_root=$mono_build_root/runtime
if test x$host_win32 = xyes; then
if test "x$cross_compiling" = "xno"; then
mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
CSC=`cygpath -m -a $CSC`
CSC_LOCATION=`cygpath -m -a $CSC_LOCATION`
else
mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\'`\\etc
fi
@@ -3939,6 +4219,8 @@ else
fi
AC_SUBST(mono_cfg_dir)
AC_SUBST(CSC)
AC_CONFIG_FILES([po/mcs/Makefile.in])
AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
@@ -4109,6 +4391,7 @@ llvm/Makefile
scripts/mono-find-provides
scripts/mono-find-requires
mono/Makefile
mono/btls/Makefile
mono/utils/Makefile
mono/metadata/Makefile
mono/dis/Makefile
@@ -4130,7 +4413,6 @@ mono/tests/assemblyresolve/Makefile
mono/tests/gc-descriptors/Makefile
mono/unit-tests/Makefile
mono/benchmark/Makefile
mono/io-layer/Makefile
mono/mini/Makefile
mono/profiler/Makefile
m4/Makefile
@@ -4179,7 +4461,7 @@ po/Makefile
])
# Update all submodules recursively to ensure everything is checked out
$srcdir/scripts/update_submodules
$srcdir/scripts/update_submodules.sh
if test x$host_win32 = xyes; then
# Get rid of 'cyg' prefixes in library names
@@ -4216,6 +4498,7 @@ fi
echo "exec_prefix=$exec_prefix" >> $mcs_topdir/build/config.make
echo "sysconfdir=$sysconfdir" >> $mcs_topdir/build/config.make
echo 'mono_libdir=${exec_prefix}/lib' >> $mcs_topdir/build/config.make
echo "mono_build_root=$mono_build_root" >> $mcs_topdir/build/config.make
echo 'IL_FLAGS = /debug' >> $mcs_topdir/build/config.make
echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $mcs_topdir/build/config.make
echo "ILDISASM = $mono_build_root/runtime/monodis-wrapper" >> $mcs_topdir/build/config.make
@@ -4238,6 +4521,7 @@ fi
}')]
echo "MONO_VERSION = $myver" >> $mcs_topdir/build/config.make
echo "MONO_CORLIB_VERSION = $MONO_CORLIB_VERSION" >> $mcs_topdir/build/config.make
if test x$host_darwin = xyes; then
echo "PLATFORM = darwin" >> $mcs_topdir/build/config.make
@@ -4269,19 +4553,42 @@ fi
echo "BCL_OPTIMIZE = 1" >> $srcdir/$mcsdir/build/config.make
fi
echo "CSC_LOCATION = $CSC_LOCATION" >> $srcdir/$mcsdir/build/config.make
if test $csc_compiler = mcs; then
echo "MCS_MODE = 1" >> $srcdir/$mcsdir/build/config.make
fi
if test "x$AOT_BUILD_FLAGS" != "x" ; then
echo "AOT_RUN_FLAGS=$AOT_RUN_FLAGS" >> $srcdir/$mcsdir/build/config.make
echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
fi
if test "x$enable_btls" = "xyes"; then
echo "HAVE_BTLS=1" >> $srcdir/$mcsdir/build/config.make
if test "x$enable_dynamic_btls" = "xyes"; then
echo "HAVE_DYNAMIC_BTLS=1" >> $srcdir/$mcsdir/build/config.make
fi
fi
fi
)
libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
btls_platform_string=
if test x$enable_btls = xyes; then
if test x$btls_android = xyes; then
btls_platform_string=" (android:$BTLS_PLATFORM)"
else
btls_platform_string=" ($BTLS_PLATFORM)"
fi
fi
echo "
mcs source: $mcsdir
C# Compiler: $csc_compiler
Engine:
Host: $host
@@ -4293,6 +4600,7 @@ echo "
BigArrays: $enable_big_arrays
DTrace: $enable_dtrace
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
Interpreter: $buildinterpreter
Libraries:
.NET 4.x: $with_profile4_x
@@ -4301,10 +4609,13 @@ echo "
Xamarin.WatchOS: $with_monotouch_watch
Xamarin.TVOS: $with_monotouch_tv
Xamarin.Mac: $with_xammac
mobile_static: $with_mobile_static
Windows AOT: $with_winaot
Orbis: $with_orbis
Test profiles: AOT Full ($with_testing_aot_full), AOT Hybrid ($with_testing_aot_hybrid)
JNI support: $jdk_headers_found
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
BTLS: $enable_btls$btls_platform_string
$disabled
"
if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
+1
View File
@@ -11,6 +11,7 @@
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
<dllmap dll="MonoPosixHelper" target="$mono_libdir/libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="libmono-btls-shared" target="$mono_libdir/libmono-btls-shared@libsuffix@" os="!windows" />
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
<dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
+5 -7
View File
@@ -167,8 +167,6 @@ class MonoClassPrinter:
return "0x0"
klass = self.val.dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
if klass ["generic_class"].cast (gdb.lookup_type ("guint64")) != 0:
class_name = "{}<{}>".format (class_name, str (klass ["generic_class"]["context"]["class_inst"]))
if add_quotes:
return "\"{}\"".format (class_name)
else:
@@ -198,7 +196,7 @@ class MonoGenericInstPrinter:
inst_args = inst ["type_argv"]
inst_str = ""
for i in range(0, inst_len):
print (inst_args)
# print (inst_args)
type_printer = MonoTypePrinter (inst_args [i])
if i > 0:
inst_str = inst_str + ", "
@@ -240,7 +238,7 @@ class MonoTypePrinter:
def to_string_inner(self, csharp):
try:
t = self.val.dereference ()
t = self.val.referenced_value ()
kind = str (t ["type"]).replace ("MONO_TYPE_", "").lower ()
info = ""
@@ -252,9 +250,9 @@ class MonoTypePrinter:
info = str(t ["data"]["generic_class"])
if info != "":
return "{{}, {}}".format (kind, info)
return "{{{}, {}}}".format (kind, info)
else:
return "{{}}".format (kind)
return "{{{}}}".format (kind)
except:
#print (sys.exc_info ()[0])
#print (sys.exc_info ()[1])
@@ -278,7 +276,7 @@ class MonoMethodRgctxPrinter:
inst_args = inst ["type_argv"]
inst_str = ""
for i in range(0, inst_len):
print (inst_args)
# print (inst_args)
type_printer = MonoTypePrinter (inst_args [i])
if i > 0:
inst_str = inst_str + ", "
-3
View File
@@ -74,9 +74,6 @@
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.web>
<httpHandlers>
-3
View File
@@ -118,9 +118,6 @@
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.runtime.remoting>
-3
View File
@@ -135,9 +135,6 @@
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.runtime.remoting>
-3
View File
@@ -138,9 +138,6 @@
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.runtime.remoting>
+3
View File
@@ -0,0 +1,3 @@
check-coverage crlf=input
check-exports crlf=input
produce-lists crlf=input
+1
View File
@@ -9,3 +9,4 @@
/mono-tools.tree
/mono-tools.zip
/AgilityPack.dll*
/doxygen-output
+5
View File
@@ -64,6 +64,7 @@ dist-hook:
clean-local:
-rm -Rf html
-rm -Rf doxygen-output
-rm -f deploy/* convert.exe* AgilityPack.dll*
-rm -f $(ASSEMBLED_DOCS)
@@ -100,3 +101,7 @@ convert.exe: convert.cs AgilityPack.dll
AgilityPack.dll:
$(TOOL_MAKE) AgilityPack.dll
doxygen:
doxygen doxyfile
.PHONY: doxygen
+92
View File
@@ -0,0 +1,92 @@
ALLOW_UNICODE_NAMES = NO
ALPHABETICAL_INDEX = YES
ALWAYS_DETAILED_SEC = NO
AUTOLINK_SUPPORT = YES
BRIEF_MEMBER_DESC = YES
CALLER_GRAPH = YES
CALL_GRAPH = YES
CASE_SENSE_NAMES = NO
CLASS_DIAGRAMS = YES
COLS_IN_ALPHA_INDEX = 1
CREATE_SUBDIRS = NO
DIRECTORY_GRAPH = YES
DOT_CLEANUP = YES
DOT_IMAGE_FORMAT = svg
DOT_MULTI_TARGETS = YES
DOXYFILE_ENCODING = UTF-8
ENABLE_PREPROCESSING = YES
ENUM_VALUES_PER_LINE = 1
EXCLUDE_SYMLINKS = NO
EXPAND_ONLY_PREDEF = NO
EXTENSION_MAPPING = c=C h=C
EXTRACT_ALL = YES
EXTRACT_STATIC = YES
EXT_LINKS_IN_WINDOW = NO
FILE_PATTERNS = *.c *.h
FULL_PATH_NAMES = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST = YES
GENERATE_HTML = YES
GENERATE_PERLMOD = YES
GENERATE_LEGEND = YES
GENERATE_TESTLIST = YES
GENERATE_TODOLIST = YES
GENERATE_TREEVIEW = YES
GRAPHICAL_HIERARCHY = YES
HAVE_DOT = YES
HIDE_UNDOC_RELATIONS = YES
HTML_COLORSTYLE_GAMMA = 80
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_DYNAMIC_SECTIONS = YES
HTML_FILE_EXTENSION = .html
HTML_INDEX_NUM_ENTRIES = 100
HTML_OUTPUT = doxygen
HTML_TIMESTAMP = YES
INCLUDED_BY_GRAPH = YES
INCLUDE_GRAPH = YES
INHERIT_DOCS = YES
INLINE_INHERITED_MEMB = NO
INLINE_SOURCES = YES
INPUT = ../mono
INPUT_ENCODING = UTF-8
INTERACTIVE_SVG = YES
JAVADOC_AUTOBRIEF = NO
LOOKUP_CACHE_SIZE = 0
MACRO_EXPANSION = NO
MARKDOWN_SUPPORT = YES
MAX_INITIALIZER_LINES = 30
MULTILINE_CPP_IS_BRIEF = NO
OPTIMIZE_OUTPUT_FOR_C = YES
OUTPUT_DIRECTORY = doxygen-output
OUTPUT_LANGUAGE = English
PROJECT_NAME = "Mono"
QT_AUTOBRIEF = NO
QUIET = NO
RECURSIVE = YES
REFERENCED_BY_RELATION = YES
REFERENCES_LINK_SOURCE = YES
REFERENCES_RELATION = YES
REPEAT_BRIEF = YES
SEARCHENGINE = YES
SEARCH_INCLUDES = YES
SEPARATE_MEMBER_PAGES = NO
SHORT_NAMES = NO
SHOW_FILES = YES
SHOW_USED_FILES = YES
SKIP_FUNCTION_MACROS = YES
SORT_BRIEF_DOCS = YES
SORT_GROUP_NAMES = YES
SOURCE_BROWSER = YES
SOURCE_TOOLTIPS = YES
STRIP_CODE_COMMENTS = NO
TAB_SIZE = 4
TREEVIEW_WIDTH = 250
TYPEDEF_HIDES_STRUCT = NO
USE_HTAGS = NO
USE_MDFILE_AS_MAINPAGE = ../README.md
VERBATIM_HEADERS = YES
WARNINGS = YES
WARN_IF_DOC_ERROR = YES
WARN_IF_UNDOCUMENTED = YES
WARN_NO_PARAMDOC = NO
+1 -1
View File
@@ -326,7 +326,7 @@ mono_poll
mono_dynamic_stream_reset
mono_domain_get_tls_offset
mono_domain_add_class_static_data
mono_handle_native_sigsegv
mono_handle_native_crash
mono_set_config_dir
mono_profiler_coverage_alloc
mono_profiler_coverage_free
+3 -4
View File
@@ -40,9 +40,8 @@
<p>The output of the SCC analysis is passed to the
`cross_references()` callback. It is expected to set the
`is_alive` flag on those strongly connected components that it
wishes to be kept alive. Only bridged objects will be
reported to the callback, i.e., non-bridged objects are
removed from the callback graph.
wishes to be kept alive. The value of `is_alive` will be
ignored on any SCCs which lack bridges.
<p>In monodroid each bridged object has a corresponding Java
mirror object. In the bridge callback it reifies the Mono
@@ -63,7 +62,7 @@
<div class="mapi-header">
enum {
SGEN_BRIDGE_VERSION = 4
SGEN_BRIDGE_VERSION = 5
};
typedef enum {
+6 -2
View File
@@ -130,6 +130,10 @@ AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
# Defined for all targets/platforms using classic Windows API support.
AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long)
@@ -140,7 +144,7 @@ AC_CHECK_FUNCS(fork execv execve)
AC_ARG_WITH([overridable-allocators], [ --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])
if test x$with_overridable_allocators == xyes; then
if test x$with_overridable_allocators = xyes; then
AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
AC_MSG_NOTICE([Overridable allocator support enabled])
else
@@ -160,7 +164,7 @@ elif test x$target_ios = xno; then
AC_CHECK_FUNCS(strndup getpwuid_r)
fi
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators == xyes)
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
AM_ICONV()
AC_SEARCH_LIBS(sqrtf, m)
+1 -1
View File
@@ -5,7 +5,7 @@ AM_CFLAGS = $(WERROR_CFLAGS)
win_files = \
eglib-config.hw \
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
gmodule-win32.c gtimer-win32.c
gmodule-win32.c gtimer-win32.c gunicode-win32.c
unix_files = \
gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \
+8
View File
@@ -78,3 +78,11 @@ g_file_test (const gchar *filename, GFileTest test)
}
return FALSE;
}
gchar *
g_mkdtemp (char *tmp_template)
{
char *template_copy = g_strdup (tmp_template);
return mkdtemp (template_copy);
}
+21
View File
@@ -35,6 +35,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <direct.h>
#ifdef G_OS_WIN32
#include <io.h>
@@ -68,6 +69,26 @@ int mkstemp (char *tmp_template)
return fd;
}
gchar *
g_mkdtemp (char *tmp_template)
{
gunichar2* utf16_template;
utf16_template = u8to16 (tmp_template);
utf16_template = _wmktemp(utf16_template);
if (utf16_template && *utf16_template) {
if (_wmkdir (utf16_template) == 0){
char *ret = u16to8 (utf16_template);
g_free (utf16_template);
return ret;
}
}
g_free (utf16_template);
return NULL;
}
#ifdef _MSC_VER
#pragma warning(disable:4701)
#endif
+4 -1
View File
@@ -199,8 +199,11 @@ g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft,
} else {
outleftptr = NULL;
}
#if defined(__NetBSD__)
return iconv (cd->cd, (const gchar **)inbytes, inleftptr, outbytes, outleftptr);
#else
return iconv (cd->cd, inbytes, inleftptr, outbytes, outleftptr);
#endif
}
#endif
+8 -1
View File
@@ -160,7 +160,8 @@ typedef struct _GMemChunk GMemChunk;
* Misc.
*/
const gchar * g_getenv(const gchar *variable);
gboolean g_hasenv(const gchar *variable);
gchar * g_getenv(const gchar *variable);
gboolean g_setenv(const gchar *variable, const gchar *value, gboolean overwrite);
void g_unsetenv(const gchar *variable);
@@ -887,6 +888,8 @@ gboolean g_file_test (const gchar *filename, GFileTest test);
#define g_ascii_strtod strtod
#define g_ascii_isalnum isalnum
gchar *g_mkdtemp (gchar *tmpl);
/*
* Pattern matching
*/
@@ -1062,6 +1065,10 @@ glong g_utf8_pointer_to_offset (const gchar *str, const gchar *pos);
#define _EGLIB_MINOR 0
#define GLIB_CHECK_VERSION(a,b,c) ((a < _EGLIB_MAJOR) || (a == _EGLIB_MAJOR && (b < _EGLIB_MIDDLE || (b == _EGLIB_MIDDLE && c <= _EGLIB_MINOR))))
#define G_HAVE_API_SUPPORT(x) (x)
#define G_UNSUPPORTED_API "%s:%d: '%s' not supported.", __FILE__, __LINE__
#define g_unsupported_api(name) G_STMT_START { g_warning (G_UNSUPPORTED_API, name); } G_STMT_END
G_END_DECLS
+50 -4
View File
@@ -39,23 +39,69 @@
#include <unistd.h>
#endif
static pthread_mutex_t env_lock = PTHREAD_MUTEX_INITIALIZER;
const gchar *
g_getenv(const gchar *variable)
/* MONO Comment
*
* As per the UNIX spec,
* "The return value from getenv() may point to static data which may be overwritten by subsequent calls to getenv(), setenv(), or unsetenv()."
* Source: Unix Manual Pages for getenv, IEEE Std 1003.1
*
* This means that using pointers returned from getenv may (and does) lead to many
* pointers which refer to the same piece of memory. When one is freed, all will be freed.
*
* This is unsafe and an ergonomics risk to fix in the callers. While the caller could lock,
* this introduces the risk for looping or exiting while inside of a lock. For this reason,
* g_getenv does not mimic the behavior of POSIX getenv anymore.
*
* The memory address returned will be unique to the invocaton, and must be freed.
* */
gchar *
g_getenv (const gchar *variable)
{
return getenv(variable);
gchar *ret = NULL;
pthread_mutex_lock (&env_lock);
gchar *res = getenv(variable);
if (res)
ret = g_strdup(res);
pthread_mutex_unlock (&env_lock);
return ret;
}
/*
* This function checks if the given variable is non-NULL
* in the environment. It's useful because it removes memory
* freeing requirements.
*
*/
gboolean
g_hasenv (const gchar *variable)
{
pthread_mutex_lock (&env_lock);
gchar *res = getenv(variable);
gboolean not_null = (res != NULL);
pthread_mutex_unlock (&env_lock);
return not_null;
}
gboolean
g_setenv(const gchar *variable, const gchar *value, gboolean overwrite)
{
return setenv(variable, value, overwrite) == 0;
gboolean res;
pthread_mutex_lock (&env_lock);
res = (setenv(variable, value, overwrite) == 0);
pthread_mutex_unlock (&env_lock);
return res;
}
void
g_unsetenv(const gchar *variable)
{
pthread_mutex_lock (&env_lock);
unsetenv(variable);
pthread_mutex_unlock (&env_lock);
}
gchar*
+39
View File
@@ -0,0 +1,39 @@
/*
* gmisc-win32-uwp.c: UWP misc support.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include <glib.h>
#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
#include <windows.h>
#include <assert.h>
gchar*
g_win32_getlocale(void)
{
gunichar2 buf[19];
gint ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO639LANGNAME, buf, 9);
assert (ccBuf <= 9);
if (ccBuf != 0) {
buf[ccBuf - 1] = L'-';
ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
assert (ccBuf <= 9);
}
// Check for GetLocaleInfoEx failure.
if (ccBuf == 0)
buf[0] = L'\0';
return u16to8 (buf);
}
#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
#ifdef _MSC_VER
// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
void __mono_win32_gmisc_win32_uwp_quiet_lnk4221(void) {}
#endif
#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+58 -16
View File
@@ -26,14 +26,26 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <stdlib.h>
#include <glib.h>
#include <windows.h>
#if _MSC_VER && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
#include <shlobj.h>
#endif
#include <direct.h>
#include <io.h>
#include <assert.h>
const gchar *
gboolean
g_hasenv (const gchar *variable)
{
return g_getenv (variable) != NULL;
}
gchar *
g_getenv(const gchar *variable)
{
gunichar2 *var, *buffer;
@@ -84,16 +96,18 @@ g_unsetenv(const gchar *variable)
g_free(var);
}
#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
gchar*
g_win32_getlocale(void)
{
LCID lcid = GetThreadLocale();
gchar buf[19];
gint ccBuf = GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, buf, 9);
gint ccBuf = GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, buf, 9);
buf[ccBuf - 1] = '-';
ccBuf += GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
ccBuf += GetLocaleInfoA(lcid, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
return g_strdup (buf);
}
#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
gboolean
g_path_is_absolute (const char *filename)
@@ -113,23 +127,52 @@ g_path_is_absolute (const char *filename)
return FALSE;
}
#if _MSC_VER && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
static gchar*
g_get_known_folder_path (void)
{
gchar *folder_path = NULL;
PWSTR profile_path = NULL;
HRESULT hr = SHGetKnownFolderPath (&FOLDERID_Profile, KF_FLAG_DEFAULT, NULL, &profile_path);
if (SUCCEEDED(hr)) {
folder_path = u16to8 (profile_path);
CoTaskMemFree (profile_path);
}
return folder_path;
}
#else
static inline gchar *
g_get_known_folder_path (void)
{
return NULL;
}
#endif
const gchar *
g_get_home_dir (void)
{
/* FIXME */
const gchar *drive = g_getenv ("HOMEDRIVE");
const gchar *path = g_getenv ("HOMEPATH");
gchar *home_dir = NULL;
if (drive && path) {
home_dir = g_malloc(strlen(drive) + strlen(path) +1);
if (home_dir) {
sprintf(home_dir, "%s%s", drive, path);
}
gchar *home_dir = g_get_known_folder_path ();
if (!home_dir) {
home_dir = (gchar *) g_getenv ("USERPROFILE");
}
g_free (drive);
g_free (path);
if (!home_dir) {
const gchar *drive = g_getenv ("HOMEDRIVE");
const gchar *path = g_getenv ("HOMEPATH");
if (drive && path) {
home_dir = g_malloc (strlen (drive) + strlen (path) + 1);
if (home_dir) {
sprintf (home_dir, "%s%s", drive, path);
}
}
g_free (drive);
g_free (path);
}
return home_dir;
}
@@ -163,4 +206,3 @@ g_get_tmp_dir (void)
}
return tmp_dir;
}
+13
View File
@@ -0,0 +1,13 @@
#ifndef __G_MODULE_WINDOWS_INTERNALS_H__
#define __G_MODULE_WINDOWS_INTERNALS_H__
#include <config.h>
#include <glib.h>
#ifdef G_OS_WIN32
#include <gmodule.h>
gpointer
w32_find_symbol (const gchar *symbol_name);
#endif /* G_OS_WIN32 */
#endif /* __G_MODULE_WINDOWS_INTERNALS_H__ */
+43
View File
@@ -0,0 +1,43 @@
/*
* gmodule-win32-uwp.c: UWP gmodule support.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include <glib.h>
#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
#include <windows.h>
#include <gmodule-win32-internals.h>
gpointer
w32_find_symbol (const gchar *symbol_name)
{
g_unsupported_api ("EnumProcessModules");
SetLastError (ERROR_NOT_SUPPORTED);
return NULL;
}
const gchar *
g_module_error (void)
{
gchar *ret = NULL;
TCHAR buf [1024];
DWORD code = GetLastError ();
if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, G_N_ELEMENTS (buf) - 1, NULL) )
buf[0] = TEXT('\0');
ret = u16to8 (buf);
return ret;
}
#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
#ifdef _MSC_VER
// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
void __mono_win32_gmodule_win32_uwp_quiet_lnk4221(void) {}
#endif
#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+7 -2
View File
@@ -28,10 +28,11 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <glib.h>
#include <gmodule.h>
#include <windows.h>
#include <psapi.h>
#include <gmodule-win32-internals.h>
#define LIBSUFFIX ".dll"
#define LIBPREFIX ""
@@ -68,7 +69,8 @@ g_module_open (const gchar *file, GModuleFlags flags)
return module;
}
static gpointer
#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
gpointer
w32_find_symbol (const gchar *symbol_name)
{
HMODULE *modules;
@@ -114,6 +116,7 @@ w32_find_symbol (const gchar *symbol_name)
g_free (modules);
return NULL;
}
#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
gboolean
g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
@@ -134,6 +137,7 @@ g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
}
}
#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
const gchar *
g_module_error (void)
{
@@ -150,6 +154,7 @@ g_module_error (void)
return ret;
}
#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
gboolean
g_module_close (GModule *module)
+6 -2
View File
@@ -47,8 +47,10 @@ g_print (const gchar *format, ...)
va_list args;
va_start (args, format);
if (g_vasprintf (&msg, format, args) < 0)
if (g_vasprintf (&msg, format, args) < 0) {
va_end (args);
return;
}
va_end (args);
if (!stdout_handler)
@@ -65,8 +67,10 @@ g_printerr (const gchar *format, ...)
va_list args;
va_start (args, format);
if (g_vasprintf (&msg, format, args) < 0)
if (g_vasprintf (&msg, format, args) < 0) {
va_end (args);
return;
}
va_end (args);
if (!stderr_handler)
+42
View File
@@ -0,0 +1,42 @@
/*
* gunicode-win32-uwp.c: UWP unicode support.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include <glib.h>
#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
#define CODESET 1
#include <windows.h>
extern const char *my_charset;
static gboolean is_utf8;
gboolean
g_get_charset (G_CONST_RETURN char **charset)
{
if (my_charset == NULL) {
static char buf [14];
CPINFOEXA cp_info;
GetCPInfoExA (CP_ACP, 0, &cp_info);
sprintf (buf, "CP%u", cp_info.CodePage);
my_charset = buf;
is_utf8 = FALSE;
}
if (charset != NULL)
*charset = my_charset;
return is_utf8;
}
#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
#ifdef _MSC_VER
// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
void __mono_win32_gunicode_win32_uwp_quiet_lnk4221(void) {}
#endif
#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+39
View File
@@ -0,0 +1,39 @@
/*
* gunicode-win32.c: Windows unicode support.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include <glib.h>
#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
#define CODESET 1
#include <windows.h>
extern const char *my_charset;
static gboolean is_utf8;
gboolean
g_get_charset (G_CONST_RETURN char **charset)
{
if (my_charset == NULL) {
static char buf [14];
sprintf (buf, "CP%u", GetACP ());
my_charset = buf;
is_utf8 = FALSE;
}
if (charset != NULL)
*charset = my_charset;
return is_utf8;
}
#else /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
#ifdef _MSC_VER
// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
void __mono_win32_mono_gunicode_win32_quiet_lnk4221(void) {}
#endif
#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+6 -14
View File
@@ -39,18 +39,13 @@
#include <unicode-data.h>
#include <errno.h>
#if defined(_MSC_VER) || defined(G_OS_WIN32)
/* FIXME */
# define CODESET 1
# include <windows.h>
#else
#ifndef G_OS_WIN32
# ifdef HAVE_LOCALCHARSET_H
# include <localcharset.h>
# endif
#endif
static const char *my_charset;
static gboolean is_utf8;
const char *my_charset;
/*
* Character set conversion
@@ -205,16 +200,13 @@ g_filename_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gs
return res;
}
#ifndef G_OS_WIN32
static gboolean is_utf8;
gboolean
g_get_charset (G_CONST_RETURN char **charset)
{
if (my_charset == NULL) {
#ifdef G_OS_WIN32
static char buf [14];
sprintf (buf, "CP%u", GetACP ());
my_charset = buf;
is_utf8 = FALSE;
#else
/* These shouldn't be heap allocated */
#if defined(HAVE_LOCALCHARSET_H)
my_charset = locale_charset ();
@@ -222,7 +214,6 @@ g_get_charset (G_CONST_RETURN char **charset)
my_charset = "UTF-8";
#endif
is_utf8 = strcmp (my_charset, "UTF-8") == 0;
#endif
}
if (charset != NULL)
@@ -230,6 +221,7 @@ g_get_charset (G_CONST_RETURN char **charset)
return is_utf8;
}
#endif /* G_OS_WIN32 */
gchar *
g_locale_to_utf8 (const gchar *opsysstring, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)
+7
View File
@@ -28,7 +28,10 @@
#include <config.h>
#include "test.h"
#ifndef DRIVER_EXTERNAL_TESTS
#include "tests.h"
#endif
#include <stdio.h>
#ifdef HAVE_GETOPT_H
@@ -102,7 +105,11 @@ static void print_help(char *s)
printf("\n");
}
#ifdef DRIVER_EXTERNAL_MAIN
gint run_tests_main(gint argc, gchar **argv)
#else
gint main(gint argc, gchar **argv)
#endif
{
gint i, j, c, iterations = 1;
StringArray *tests_to_run = NULL;
+26
View File
@@ -78,4 +78,30 @@
#define VERSION "0.1"
#define HAVE_STRTOK_R 1
#ifndef HAVE_WINAPI_FAMILY_SUPPORT
#define HAVE_WINAPI_FAMILY_SUPPORT
/* WIN API Family support */
#include <winapifamily.h>
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define HAVE_CLASSIC_WINAPI_SUPPORT 1
#define HAVE_UWP_WINAPI_SUPPORT 0
#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define HAVE_CLASSIC_WINAPI_SUPPORT 0
#define HAVE_UWP_WINAPI_SUPPORT 1
#ifndef HAVE_EXTERN_DEFINED_WINAPI_SUPPORT
#error Unsupported WINAPI family
#endif
#else
#define HAVE_CLASSIC_WINAPI_SUPPORT 0
#define HAVE_UWP_WINAPI_SUPPORT 0
#ifndef HAVE_EXTERN_DEFINED_WINAPI_SUPPORT
#error Unsupported WINAPI family
#endif
#endif
#endif
#endif
-9
View File
@@ -1,9 +0,0 @@
This is a copy of a few libunwind headers from https://android.googlesource.com/platform/external/libunwind
We can't make the repo a git submodule because it contains a folder called 'aux' which
is reserved on Windows and would break on checkout there.
These files are unmodified from the originals and should preferably stay that
way to avoid merge hell.
Commit: 338c9755cfe3d009c3dfff7d108e2c3ddaa6f3bb (android-6.0.1_r24)
-219
View File
@@ -1,219 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2001-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
Copyright (C) 2013 Linaro Limited
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <stddef.h>
#include <ucontext.h>
#define UNW_TARGET aarch64
#define UNW_TARGET_AARCH64 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 4096
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
typedef struct
{
/* no aarch64-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
typedef enum
{
/* 64-bit general registers. */
UNW_AARCH64_X0,
UNW_AARCH64_X1,
UNW_AARCH64_X2,
UNW_AARCH64_X3,
UNW_AARCH64_X4,
UNW_AARCH64_X5,
UNW_AARCH64_X6,
UNW_AARCH64_X7,
UNW_AARCH64_X8,
/* Temporary registers. */
UNW_AARCH64_X9,
UNW_AARCH64_X10,
UNW_AARCH64_X11,
UNW_AARCH64_X12,
UNW_AARCH64_X13,
UNW_AARCH64_X14,
UNW_AARCH64_X15,
/* Intra-procedure-call temporary registers. */
UNW_AARCH64_X16,
UNW_AARCH64_X17,
/* Callee-saved registers. */
UNW_AARCH64_X18,
UNW_AARCH64_X19,
UNW_AARCH64_X20,
UNW_AARCH64_X21,
UNW_AARCH64_X22,
UNW_AARCH64_X23,
UNW_AARCH64_X24,
UNW_AARCH64_X25,
UNW_AARCH64_X26,
UNW_AARCH64_X27,
UNW_AARCH64_X28,
/* 64-bit frame pointer. */
UNW_AARCH64_X29,
/* 64-bit link register. */
UNW_AARCH64_X30,
/* 64-bit stack pointer. */
UNW_AARCH64_SP = 31,
UNW_AARCH64_PC,
UNW_AARCH64_PSTATE,
/* 128-bit FP/Advanced SIMD registers. */
UNW_AARCH64_V0 = 64,
UNW_AARCH64_V1,
UNW_AARCH64_V2,
UNW_AARCH64_V3,
UNW_AARCH64_V4,
UNW_AARCH64_V5,
UNW_AARCH64_V6,
UNW_AARCH64_V7,
UNW_AARCH64_V8,
UNW_AARCH64_V9,
UNW_AARCH64_V10,
UNW_AARCH64_V11,
UNW_AARCH64_V12,
UNW_AARCH64_V13,
UNW_AARCH64_V14,
UNW_AARCH64_V15,
UNW_AARCH64_V16,
UNW_AARCH64_V17,
UNW_AARCH64_V18,
UNW_AARCH64_V19,
UNW_AARCH64_V20,
UNW_AARCH64_V21,
UNW_AARCH64_V22,
UNW_AARCH64_V23,
UNW_AARCH64_V24,
UNW_AARCH64_V25,
UNW_AARCH64_V26,
UNW_AARCH64_V27,
UNW_AARCH64_V28,
UNW_AARCH64_V29,
UNW_AARCH64_V30,
UNW_AARCH64_V31,
UNW_AARCH64_FPSR,
UNW_AARCH64_FPCR,
/* For AArch64, the CFA is the value of SP (x31) at the call site of the
previous frame. */
UNW_AARCH64_CFA = UNW_AARCH64_SP,
UNW_TDEP_LAST_REG = UNW_AARCH64_FPCR,
UNW_TDEP_IP = UNW_AARCH64_X30,
UNW_TDEP_SP = UNW_AARCH64_SP,
UNW_TDEP_EH = UNW_AARCH64_X0,
}
aarch64_regnum_t;
/* Use R0 through R3 to pass exception handling information. */
#define UNW_TDEP_NUM_EH_REGS 4
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On AArch64, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
#include "libunwind-common.h"
#include "libunwind-dynamic.h"
/* ANDROID support update. */
/* There is no getcontext in Android. */
#define unw_tdep_getcontext(uc) (({ \
unw_tdep_context_t *unw_ctx = (uc); \
register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs; \
__asm__ __volatile__ ( \
"stp x0, x1, [%[base], #0]\n" \
"stp x2, x3, [%[base], #16]\n" \
"stp x4, x5, [%[base], #32]\n" \
"stp x6, x7, [%[base], #48]\n" \
"stp x8, x9, [%[base], #64]\n" \
"stp x10, x11, [%[base], #80]\n" \
"stp x12, x13, [%[base], #96]\n" \
"stp x14, x13, [%[base], #112]\n" \
"stp x16, x17, [%[base], #128]\n" \
"stp x18, x19, [%[base], #144]\n" \
"stp x20, x21, [%[base], #160]\n" \
"stp x22, x23, [%[base], #176]\n" \
"stp x24, x25, [%[base], #192]\n" \
"stp x26, x27, [%[base], #208]\n" \
"stp x28, x29, [%[base], #224]\n" \
"str x30, [%[base], #240]\n" \
"mov x1, sp\n" \
"stp x1, x30, [%[base], #248]\n" \
: [base] "+r" (unw_base) : : "x1", "memory"); \
}), 0)
/* End of ANDROID update. */
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-308
View File
@@ -1,308 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2008 CodeSourcery
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <stddef.h>
#define UNW_TARGET arm
#define UNW_TARGET_ARM 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
/* FIXME for ARM. Too big? What do other things use for similar tasks? */
#define UNW_TDEP_CURSOR_LEN 4096
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_ARM_R0,
UNW_ARM_R1,
UNW_ARM_R2,
UNW_ARM_R3,
UNW_ARM_R4,
UNW_ARM_R5,
UNW_ARM_R6,
UNW_ARM_R7,
UNW_ARM_R8,
UNW_ARM_R9,
UNW_ARM_R10,
UNW_ARM_R11,
UNW_ARM_R12,
UNW_ARM_R13,
UNW_ARM_R14,
UNW_ARM_R15,
/* VFPv2 s0-s31 (obsolescent numberings). */
UNW_ARM_S0 = 64,
UNW_ARM_S1,
UNW_ARM_S2,
UNW_ARM_S3,
UNW_ARM_S4,
UNW_ARM_S5,
UNW_ARM_S6,
UNW_ARM_S7,
UNW_ARM_S8,
UNW_ARM_S9,
UNW_ARM_S10,
UNW_ARM_S11,
UNW_ARM_S12,
UNW_ARM_S13,
UNW_ARM_S14,
UNW_ARM_S15,
UNW_ARM_S16,
UNW_ARM_S17,
UNW_ARM_S18,
UNW_ARM_S19,
UNW_ARM_S20,
UNW_ARM_S21,
UNW_ARM_S22,
UNW_ARM_S23,
UNW_ARM_S24,
UNW_ARM_S25,
UNW_ARM_S26,
UNW_ARM_S27,
UNW_ARM_S28,
UNW_ARM_S29,
UNW_ARM_S30,
UNW_ARM_S31,
/* FPA register numberings. */
UNW_ARM_F0 = 96,
UNW_ARM_F1,
UNW_ARM_F2,
UNW_ARM_F3,
UNW_ARM_F4,
UNW_ARM_F5,
UNW_ARM_F6,
UNW_ARM_F7,
/* iWMMXt GR register numberings. */
UNW_ARM_wCGR0 = 104,
UNW_ARM_wCGR1,
UNW_ARM_wCGR2,
UNW_ARM_wCGR3,
UNW_ARM_wCGR4,
UNW_ARM_wCGR5,
UNW_ARM_wCGR6,
UNW_ARM_wCGR7,
/* iWMMXt register numberings. */
UNW_ARM_wR0 = 112,
UNW_ARM_wR1,
UNW_ARM_wR2,
UNW_ARM_wR3,
UNW_ARM_wR4,
UNW_ARM_wR5,
UNW_ARM_wR6,
UNW_ARM_wR7,
UNW_ARM_wR8,
UNW_ARM_wR9,
UNW_ARM_wR10,
UNW_ARM_wR11,
UNW_ARM_wR12,
UNW_ARM_wR13,
UNW_ARM_wR14,
UNW_ARM_wR15,
/* Two-byte encodings from here on. */
/* SPSR. */
UNW_ARM_SPSR = 128,
UNW_ARM_SPSR_FIQ,
UNW_ARM_SPSR_IRQ,
UNW_ARM_SPSR_ABT,
UNW_ARM_SPSR_UND,
UNW_ARM_SPSR_SVC,
/* User mode registers. */
UNW_ARM_R8_USR = 144,
UNW_ARM_R9_USR,
UNW_ARM_R10_USR,
UNW_ARM_R11_USR,
UNW_ARM_R12_USR,
UNW_ARM_R13_USR,
UNW_ARM_R14_USR,
/* FIQ registers. */
UNW_ARM_R8_FIQ = 151,
UNW_ARM_R9_FIQ,
UNW_ARM_R10_FIQ,
UNW_ARM_R11_FIQ,
UNW_ARM_R12_FIQ,
UNW_ARM_R13_FIQ,
UNW_ARM_R14_FIQ,
/* IRQ registers. */
UNW_ARM_R13_IRQ = 158,
UNW_ARM_R14_IRQ,
/* ABT registers. */
UNW_ARM_R13_ABT = 160,
UNW_ARM_R14_ABT,
/* UND registers. */
UNW_ARM_R13_UND = 162,
UNW_ARM_R14_UND,
/* SVC registers. */
UNW_ARM_R13_SVC = 164,
UNW_ARM_R14_SVC,
/* iWMMXt control registers. */
UNW_ARM_wC0 = 192,
UNW_ARM_wC1,
UNW_ARM_wC2,
UNW_ARM_wC3,
UNW_ARM_wC4,
UNW_ARM_wC5,
UNW_ARM_wC6,
UNW_ARM_wC7,
/* VFPv3/Neon 64-bit registers. */
UNW_ARM_D0 = 256,
UNW_ARM_D1,
UNW_ARM_D2,
UNW_ARM_D3,
UNW_ARM_D4,
UNW_ARM_D5,
UNW_ARM_D6,
UNW_ARM_D7,
UNW_ARM_D8,
UNW_ARM_D9,
UNW_ARM_D10,
UNW_ARM_D11,
UNW_ARM_D12,
UNW_ARM_D13,
UNW_ARM_D14,
UNW_ARM_D15,
UNW_ARM_D16,
UNW_ARM_D17,
UNW_ARM_D18,
UNW_ARM_D19,
UNW_ARM_D20,
UNW_ARM_D21,
UNW_ARM_D22,
UNW_ARM_D23,
UNW_ARM_D24,
UNW_ARM_D25,
UNW_ARM_D26,
UNW_ARM_D27,
UNW_ARM_D28,
UNW_ARM_D29,
UNW_ARM_D30,
UNW_ARM_D31,
/* For ARM, the CFA is the value of SP (r13) at the call site in the
previous frame. */
UNW_ARM_CFA,
UNW_TDEP_LAST_REG = UNW_ARM_D31,
UNW_TDEP_IP = UNW_ARM_R14, /* A little white lie. */
UNW_TDEP_SP = UNW_ARM_R13,
UNW_TDEP_EH = UNW_ARM_R0 /* FIXME. */
}
arm_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 2 /* FIXME for ARM. */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On ARM, we define our own unw_tdep_context instead of using ucontext_t.
This allows us to support systems that don't support getcontext and
therefore do not define ucontext_t. */
typedef struct unw_tdep_context
{
unsigned long regs[16];
}
unw_tdep_context_t;
/* There is no getcontext() on ARM. Use a stub version which only saves GP
registers. FIXME: Not ideal, may not be sufficient for all libunwind
use cases. Stores pc+8, which is only approximately correct, really. */
#ifndef __thumb__
#define unw_tdep_getcontext(uc) (({ \
unw_tdep_context_t *unw_ctx = (uc); \
register unsigned long *unw_base asm ("r0") = unw_ctx->regs; \
__asm__ __volatile__ ( \
"stmia %[base], {r0-r15}" \
: : [base] "r" (unw_base) : "memory"); \
}), 0)
#else /* __thumb__ */
#define unw_tdep_getcontext(uc) (({ \
unw_tdep_context_t *unw_ctx = (uc); \
register unsigned long *unw_base asm ("r0") = unw_ctx->regs; \
__asm__ __volatile__ ( \
".align 2\nbx pc\nnop\n.code 32\n" \
"stmia %[base], {r0-r15}\n" \
"orr %[base], pc, #1\nbx %[base]" \
: [base] "+r" (unw_base) : : "memory", "cc"); \
}), 0)
#endif
#include "libunwind-dynamic.h"
typedef struct
{
/* no arm-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-308
View File
@@ -1,308 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2001-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/* ANDROID support update. */
#include <sys/types.h>
/* End of ANDROID update. */
#define UNW_VERSION_MAJOR 1
#define UNW_VERSION_MINOR 1
#define UNW_VERSION_EXTRA
#define UNW_VERSION_CODE(maj,min) (((maj) << 16) | (min))
#define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR)
#define UNW_PASTE2(x,y) x##y
#define UNW_PASTE(x,y) UNW_PASTE2(x,y)
#define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn)
#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
#ifdef UNW_LOCAL_ONLY
# ifdef UNW_ADDITIONAL_PREFIX
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UUL,UNW_TARGET),_)
# else
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_)
# endif
#else /* !UNW_LOCAL_ONLY */
# ifdef UNW_ADDITIONAL_PREFIX
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UU,UNW_TARGET),_)
# else
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_)
# endif
#endif /* !UNW_LOCAL_ONLY */
/* Error codes. The unwind routines return the *negated* values of
these error codes on error and a non-negative value on success. */
typedef enum
{
UNW_ESUCCESS = 0, /* no error */
UNW_EUNSPEC, /* unspecified (general) error */
UNW_ENOMEM, /* out of memory */
UNW_EBADREG, /* bad register number */
UNW_EREADONLYREG, /* attempt to write read-only register */
UNW_ESTOPUNWIND, /* stop unwinding */
UNW_EINVALIDIP, /* invalid IP */
UNW_EBADFRAME, /* bad frame */
UNW_EINVAL, /* unsupported operation or bad value */
UNW_EBADVERSION, /* unwind info has unsupported version */
UNW_ENOINFO /* no unwind info found */
}
unw_error_t;
/* The following enum defines the indices for a couple of
(pseudo-)registers which have the same meaning across all
platforms. (RO) means read-only. (RW) means read-write. General
registers (aka "integer registers") are expected to start with
index 0. The number of such registers is architecture-dependent.
The remaining indices can be used as an architecture sees fit. The
last valid register index is given by UNW_REG_LAST. */
typedef enum
{
UNW_REG_IP = UNW_TDEP_IP, /* (rw) instruction pointer (pc) */
UNW_REG_SP = UNW_TDEP_SP, /* (ro) stack pointer */
UNW_REG_EH = UNW_TDEP_EH, /* (rw) exception-handling reg base */
UNW_REG_LAST = UNW_TDEP_LAST_REG
}
unw_frame_regnum_t;
/* Number of exception-handler argument registers: */
#define UNW_NUM_EH_REGS UNW_TDEP_NUM_EH_REGS
typedef enum
{
UNW_CACHE_NONE, /* no caching */
UNW_CACHE_GLOBAL, /* shared global cache */
UNW_CACHE_PER_THREAD /* per-thread caching */
}
unw_caching_policy_t;
typedef int unw_regnum_t;
/* The unwind cursor starts at the youngest (most deeply nested) frame
and is used to track the frame state as the unwinder steps from
frame to frame. It is safe to make (shallow) copies of variables
of this type. */
typedef struct unw_cursor
{
unw_word_t opaque[UNW_TDEP_CURSOR_LEN];
}
unw_cursor_t;
/* This type encapsulates the entire (preserved) machine-state. */
typedef unw_tdep_context_t unw_context_t;
/* unw_getcontext() fills the unw_context_t pointed to by UC with the
machine state as it exists at the call-site. For implementation
reasons, this needs to be a target-dependent macro. It's easiest
to think of unw_getcontext() as being identical to getcontext(). */
#define unw_getcontext(uc) unw_tdep_getcontext(uc)
/* Return 1 if register number R is a floating-point register, zero
otherwise.
This routine is signal-safe. */
#define unw_is_fpreg(r) unw_tdep_is_fpreg(r)
typedef unw_tdep_fpreg_t unw_fpreg_t;
typedef struct unw_addr_space *unw_addr_space_t;
/* Each target may define it's own set of flags, but bits 0-15 are
reserved for general libunwind-use. */
#define UNW_PI_FLAG_FIRST_TDEP_BIT 16
/* The information comes from a .debug_frame section. */
#define UNW_PI_FLAG_DEBUG_FRAME 32
typedef struct unw_proc_info
{
unw_word_t start_ip; /* first IP covered by this procedure */
unw_word_t end_ip; /* first IP NOT covered by this procedure */
unw_word_t lsda; /* address of lang.-spec. data area (if any) */
unw_word_t handler; /* optional personality routine */
unw_word_t gp; /* global-pointer value for this procedure */
unw_word_t flags; /* misc. flags */
int format; /* unwind-info format (arch-specific) */
int unwind_info_size; /* size of the information (if applicable) */
void *unwind_info; /* unwind-info (arch-specific) */
unw_tdep_proc_info_t extra; /* target-dependent auxiliary proc-info */
}
unw_proc_info_t;
/* These are backend callback routines that provide access to the
state of a "remote" process. This can be used, for example, to
unwind another process through the ptrace() interface. */
typedef struct unw_accessors
{
/* Look up the unwind info associated with instruction-pointer IP.
On success, the routine fills in the PROC_INFO structure. */
int (*find_proc_info) (unw_addr_space_t, unw_word_t, unw_proc_info_t *,
int, void *);
/* Release any resources (e.g., memory) that were allocated for
the unwind info returned in by a previous call to
find_proc_info() with NEED_UNWIND_INFO set to 1. */
void (*put_unwind_info) (unw_addr_space_t, unw_proc_info_t *, void *);
/* Return the list-head of the dynamically registered unwind
info. */
int (*get_dyn_info_list_addr) (unw_addr_space_t, unw_word_t *, void *);
/* Access aligned word at address ADDR. The value is returned
according to the endianness of the host (e.g., if the host is
little-endian and the target is big-endian, access_mem() needs
to byte-swap the value before returning it). */
int (*access_mem) (unw_addr_space_t, unw_word_t, unw_word_t *, int,
void *);
/* Access register number REG at address ADDR. */
int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int,
void *);
/* Access register number REG at address ADDR. */
int (*access_fpreg) (unw_addr_space_t, unw_regnum_t,
unw_fpreg_t *, int, void *);
int (*resume) (unw_addr_space_t, unw_cursor_t *, void *);
/* Optional call back to obtain the name of a (static) procedure.
Dynamically generated procedures are handled automatically by
libunwind. This callback is optional and may be set to
NULL. */
int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t,
unw_word_t *, void *);
}
unw_accessors_t;
typedef enum unw_save_loc_type
{
UNW_SLT_NONE, /* register is not saved ("not an l-value") */
UNW_SLT_MEMORY, /* register has been saved in memory */
UNW_SLT_REG /* register has been saved in (another) register */
}
unw_save_loc_type_t;
typedef struct unw_save_loc
{
unw_save_loc_type_t type;
union
{
unw_word_t addr; /* valid if type==UNW_SLT_MEMORY */
unw_regnum_t regnum; /* valid if type==UNW_SLT_REG */
}
u;
unw_tdep_save_loc_t extra; /* target-dependent additional information */
}
unw_save_loc_t;
/* ANDROID support update. */
typedef struct unw_map_cursor
{
void *map_list;
void *cur_map;
}
unw_map_cursor_t;
typedef struct unw_map
{
unw_word_t start;
unw_word_t end;
unw_word_t offset;
unw_word_t load_base;
char *path;
int flags;
}
unw_map_t;
/* End of ANDROID update. */
/* These routines work both for local and remote unwinding. */
#define unw_local_access_addr_space_init UNW_OBJ(local_access_addr_space_init)
#define unw_local_addr_space UNW_OBJ(local_addr_space)
#define unw_create_addr_space UNW_OBJ(create_addr_space)
#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space)
#define unw_get_accessors UNW_ARCH_OBJ(get_accessors)
#define unw_init_local UNW_OBJ(init_local)
#define unw_init_remote UNW_OBJ(init_remote)
#define unw_step UNW_OBJ(step)
#define unw_resume UNW_OBJ(resume)
#define unw_get_proc_info UNW_OBJ(get_proc_info)
#define unw_get_proc_info_by_ip UNW_OBJ(get_proc_info_by_ip)
#define unw_get_reg UNW_OBJ(get_reg)
#define unw_set_reg UNW_OBJ(set_reg)
#define unw_get_fpreg UNW_OBJ(get_fpreg)
#define unw_set_fpreg UNW_OBJ(set_fpreg)
#define unw_get_save_loc UNW_OBJ(get_save_loc)
#define unw_is_signal_frame UNW_OBJ(is_signal_frame)
#define unw_handle_signal_frame UNW_OBJ(handle_signal_frame)
#define unw_get_proc_name UNW_OBJ(get_proc_name)
#define unw_get_proc_name_by_ip UNW_OBJ(get_proc_name_by_ip)
#define unw_set_caching_policy UNW_OBJ(set_caching_policy)
#define unw_regname UNW_ARCH_OBJ(regname)
#define unw_flush_cache UNW_ARCH_OBJ(flush_cache)
#define unw_strerror UNW_ARCH_OBJ(strerror)
extern void unw_local_access_addr_space_init (unw_addr_space_t);
extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int);
extern void unw_destroy_addr_space (unw_addr_space_t);
extern unw_accessors_t *unw_get_accessors (unw_addr_space_t);
extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t);
extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t);
extern const char *unw_regname (unw_regnum_t);
extern int unw_init_local (unw_cursor_t *, unw_context_t *);
extern int unw_init_remote (unw_cursor_t *, unw_addr_space_t, void *);
extern int unw_step (unw_cursor_t *);
extern int unw_resume (unw_cursor_t *);
extern int unw_get_proc_info (unw_cursor_t *, unw_proc_info_t *);
extern int unw_get_proc_info_by_ip (unw_addr_space_t, unw_word_t,
unw_proc_info_t *, void *);
extern int unw_get_reg (unw_cursor_t *, int, unw_word_t *);
extern int unw_set_reg (unw_cursor_t *, int, unw_word_t);
extern int unw_get_fpreg (unw_cursor_t *, int, unw_fpreg_t *);
extern int unw_set_fpreg (unw_cursor_t *, int, unw_fpreg_t);
extern int unw_get_save_loc (unw_cursor_t *, int, unw_save_loc_t *);
extern int unw_is_signal_frame (unw_cursor_t *);
extern int unw_handle_signal_frame (unw_cursor_t *);
extern int unw_get_proc_name (unw_cursor_t *, char *, size_t, unw_word_t *);
extern int unw_get_proc_name_by_ip (unw_addr_space_t, unw_word_t, char *,
size_t, unw_word_t *, void *);
extern const char *unw_strerror (int);
extern int unw_backtrace (void **, int);
/* ANDROID support update. */
extern int unw_map_local_cursor_valid (unw_map_cursor_t *);
extern void unw_map_local_cursor_get (unw_map_cursor_t *);
extern int unw_map_local_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
extern int unw_map_local_create (void);
extern void unw_map_local_destroy (void);
extern void unw_map_set (unw_addr_space_t, unw_map_cursor_t *);
extern void unw_map_cursor_reset (unw_map_cursor_t *);
extern void unw_map_cursor_clear (unw_map_cursor_t *);
extern int unw_map_cursor_create (unw_map_cursor_t *, pid_t);
extern void unw_map_cursor_destroy (unw_map_cursor_t *);
extern int unw_map_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
/* End of ANDROID update. */
extern unw_addr_space_t unw_local_addr_space;
-73
View File
@@ -1,73 +0,0 @@
/* libunwind - a platform-independent unwind library
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef libunwind_coredump_h
#define libunwind_coredump_h
#include <libunwind.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/* Helper routines which make it easy to use libunwind on a coredump.
They're available only if UNW_REMOTE_ONLY is _not_ defined and they
aren't really part of the libunwind API. They are implemented in a
archive library called libunwind-coredump.a. */
struct UCD_info;
extern struct UCD_info *_UCD_create(const char *filename);
extern void _UCD_destroy(struct UCD_info *);
extern int _UCD_get_num_threads(struct UCD_info *);
extern void _UCD_select_thread(struct UCD_info *, int);
extern pid_t _UCD_get_pid(struct UCD_info *);
extern int _UCD_get_cursig(struct UCD_info *);
extern int _UCD_add_backing_file_at_segment(struct UCD_info *, int phdr_no, const char *filename);
extern int _UCD_add_backing_file_at_vaddr(struct UCD_info *,
unsigned long vaddr,
const char *filename);
extern int _UCD_find_proc_info (unw_addr_space_t, unw_word_t,
unw_proc_info_t *, int, void *);
extern void _UCD_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *);
extern int _UCD_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *,
void *);
extern int _UCD_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int,
void *);
extern int _UCD_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *,
int, void *);
extern int _UCD_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *,
int, void *);
extern int _UCD_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t,
unw_word_t *, void *);
extern int _UCD_resume (unw_addr_space_t, unw_cursor_t *, void *);
extern unw_accessors_t _UCD_accessors;
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* libunwind_coredump_h */
-210
View File
@@ -1,210 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2002-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/* This file defines the runtime-support routines for dynamically
generated code. Even though it is implemented as part of libunwind,
it is logically separate from the interface to perform the actual
unwinding. In particular, this interface is always used in the
context of the unwind target, whereas the rest of the unwind API is
used in context of the process that is doing the unwind (which may be
a debugger running on another machine, for example).
Note that the data-structures declared here server a dual purpose:
when a program registers a dynamically generated procedure, it uses
these structures directly. On the other hand, with remote-unwinding,
the data-structures are read from the remote process's memory and
translated into internalized versions. To facilitate remote-access,
the following rules should be followed in declaring these structures:
(1) Declare a member as a pointer only if the the information the
member points to needs to be internalized as well (e.g., a
string representing a procedure name should be declared as
"const char *", but the instruction pointer should be declared
as unw_word_t).
(2) Provide sufficient padding to ensure that no implicit padding
will be needed on any of the supported target architectures. For
the time being, padding data structures with the assumption that
sizeof (unw_word_t) == 8 should be sufficient. (Note: it's not
impossible to internalize structures with internal padding, but
it does make the process a bit harder).
(3) Don't declare members that contain bitfields or floating-point
values.
(4) Don't declare members with enumeration types. Declare them as
int32_t instead. */
typedef enum
{
UNW_DYN_STOP = 0, /* end-of-unwind-info marker */
UNW_DYN_SAVE_REG, /* save register to another register */
UNW_DYN_SPILL_FP_REL, /* frame-pointer-relative register spill */
UNW_DYN_SPILL_SP_REL, /* stack-pointer-relative register spill */
UNW_DYN_ADD, /* add constant value to a register */
UNW_DYN_POP_FRAMES, /* drop one or more stack frames */
UNW_DYN_LABEL_STATE, /* name the current state */
UNW_DYN_COPY_STATE, /* set the region's entry-state */
UNW_DYN_ALIAS /* get unwind info from an alias */
}
unw_dyn_operation_t;
typedef enum
{
UNW_INFO_FORMAT_DYNAMIC, /* unw_dyn_proc_info_t */
UNW_INFO_FORMAT_TABLE, /* unw_dyn_table_t */
UNW_INFO_FORMAT_REMOTE_TABLE, /* unw_dyn_remote_table_t */
UNW_INFO_FORMAT_ARM_EXIDX /* ARM specific unwind info */
}
unw_dyn_info_format_t;
typedef struct unw_dyn_op
{
int8_t tag; /* what operation? */
int8_t qp; /* qualifying predicate register */
int16_t reg; /* what register */
int32_t when; /* when does it take effect? */
unw_word_t val; /* auxiliary value */
}
unw_dyn_op_t;
typedef struct unw_dyn_region_info
{
struct unw_dyn_region_info *next; /* linked list of regions */
int32_t insn_count; /* region length (# of instructions) */
uint32_t op_count; /* length of op-array */
unw_dyn_op_t op[1]; /* variable-length op-array */
}
unw_dyn_region_info_t;
typedef struct unw_dyn_proc_info
{
unw_word_t name_ptr; /* address of human-readable procedure name */
unw_word_t handler; /* address of personality routine */
uint32_t flags;
int32_t pad0;
unw_dyn_region_info_t *regions;
}
unw_dyn_proc_info_t;
typedef struct unw_dyn_table_info
{
unw_word_t name_ptr; /* addr. of table name (e.g., library name) */
unw_word_t segbase; /* segment base */
unw_word_t table_len; /* must be a multiple of sizeof(unw_word_t)! */
unw_word_t *table_data;
}
unw_dyn_table_info_t;
typedef struct unw_dyn_remote_table_info
{
unw_word_t name_ptr; /* addr. of table name (e.g., library name) */
unw_word_t segbase; /* segment base */
unw_word_t table_len; /* must be a multiple of sizeof(unw_word_t)! */
unw_word_t table_data;
}
unw_dyn_remote_table_info_t;
typedef struct unw_dyn_info
{
/* doubly-linked list of dyn-info structures: */
struct unw_dyn_info *next;
struct unw_dyn_info *prev;
unw_word_t start_ip; /* first IP covered by this entry */
unw_word_t end_ip; /* first IP NOT covered by this entry */
unw_word_t gp; /* global-pointer in effect for this entry */
int32_t format; /* real type: unw_dyn_info_format_t */
int32_t pad;
union
{
unw_dyn_proc_info_t pi;
unw_dyn_table_info_t ti;
unw_dyn_remote_table_info_t rti;
}
u;
}
unw_dyn_info_t;
typedef struct unw_dyn_info_list
{
uint32_t version;
uint32_t generation;
unw_dyn_info_t *first;
}
unw_dyn_info_list_t;
/* Return the size (in bytes) of an unw_dyn_region_info_t structure that can
hold OP_COUNT ops. */
#define _U_dyn_region_info_size(op_count) \
((char *) (((unw_dyn_region_info_t *) NULL)->op + (op_count)) \
- (char *) NULL)
/* Register the unwind info for a single procedure.
This routine is NOT signal-safe. */
extern void _U_dyn_register (unw_dyn_info_t *);
/* Cancel the unwind info for a single procedure.
This routine is NOT signal-safe. */
extern void _U_dyn_cancel (unw_dyn_info_t *);
/* Convenience routines. */
#define _U_dyn_op(_tag, _qp, _when, _reg, _val) \
((unw_dyn_op_t) { (_tag), (_qp), (_reg), (_when), (_val) })
#define _U_dyn_op_save_reg(op, qp, when, reg, dst) \
(*(op) = _U_dyn_op (UNW_DYN_SAVE_REG, (qp), (when), (reg), (dst)))
#define _U_dyn_op_spill_fp_rel(op, qp, when, reg, offset) \
(*(op) = _U_dyn_op (UNW_DYN_SPILL_FP_REL, (qp), (when), (reg), \
(offset)))
#define _U_dyn_op_spill_sp_rel(op, qp, when, reg, offset) \
(*(op) = _U_dyn_op (UNW_DYN_SPILL_SP_REL, (qp), (when), (reg), \
(offset)))
#define _U_dyn_op_add(op, qp, when, reg, value) \
(*(op) = _U_dyn_op (UNW_DYN_ADD, (qp), (when), (reg), (value)))
#define _U_dyn_op_pop_frames(op, qp, when, num_frames) \
(*(op) = _U_dyn_op (UNW_DYN_POP_FRAMES, (qp), (when), 0, (num_frames)))
#define _U_dyn_op_label_state(op, label) \
(*(op) = _U_dyn_op (UNW_DYN_LABEL_STATE, _U_QP_TRUE, -1, 0, (label)))
#define _U_dyn_op_copy_state(op, label) \
(*(op) = _U_dyn_op (UNW_DYN_COPY_STATE, _U_QP_TRUE, -1, 0, (label)))
#define _U_dyn_op_alias(op, qp, when, addr) \
(*(op) = _U_dyn_op (UNW_DYN_ALIAS, (qp), (when), 0, (addr)))
#define _U_dyn_op_stop(op) \
(*(op) = _U_dyn_op (UNW_DYN_STOP, _U_QP_TRUE, -1, 0, 0))
/* The target-dependent qualifying predicate which is always TRUE. On
IA-64, that's p0 (0), on non-predicated architectures, the value is
ignored. */
#define _U_QP_TRUE _U_TDEP_QP_TRUE
-131
View File
@@ -1,131 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2003-2004 Hewlett-Packard Co
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET hppa
#define UNW_TARGET_HPPA 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 511
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
typedef union
{
struct { unw_word_t bits[2]; } raw;
double val;
}
unw_tdep_fpreg_t;
typedef enum
{
/* Note: general registers are expected to start with index 0.
This convention facilitates architecture-independent
implementation of the C++ exception handling ABI. See
_Unwind_SetGR() and _Unwind_GetGR() for details. */
UNW_HPPA_GR = 0,
UNW_HPPA_RP = 2, /* return pointer */
UNW_HPPA_FP = 3, /* frame pointer */
UNW_HPPA_SP = UNW_HPPA_GR + 30,
UNW_HPPA_FR = UNW_HPPA_GR + 32,
UNW_HPPA_IP = UNW_HPPA_FR + 32, /* instruction pointer */
/* other "preserved" registers (fpsr etc.)... */
/* PA-RISC has 4 exception-argument registers but they're not
contiguous. To deal with this, we define 4 pseudo
exception-handling registers which we then alias to the actual
physical register. */
UNW_HPPA_EH0 = UNW_HPPA_IP + 1, /* alias for UNW_HPPA_GR + 20 */
UNW_HPPA_EH1 = UNW_HPPA_EH0 + 1, /* alias for UNW_HPPA_GR + 21 */
UNW_HPPA_EH2 = UNW_HPPA_EH1 + 1, /* alias for UNW_HPPA_GR + 22 */
UNW_HPPA_EH3 = UNW_HPPA_EH2 + 1, /* alias for UNW_HPPA_GR + 31 */
/* frame info (read-only) */
UNW_HPPA_CFA,
UNW_TDEP_LAST_REG = UNW_HPPA_IP,
UNW_TDEP_IP = UNW_HPPA_IP,
UNW_TDEP_SP = UNW_HPPA_SP,
UNW_TDEP_EH = UNW_HPPA_EH0
}
hppa_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 4
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On PA-RISC, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_HPPA_FR) < 32)
#include "libunwind-dynamic.h"
typedef struct
{
/* no PA-RISC-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_getcontext UNW_ARCH_OBJ (getcontext)
extern int unw_tdep_getcontext (unw_tdep_context_t *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-197
View File
@@ -1,197 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2001-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#include <inttypes.h>
#include <ucontext.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#ifdef ia64
/* This works around a bug in Intel's ECC v7.0 which defines "ia64"
as "1". */
# undef ia64
#endif
#ifdef __hpux
/* On HP-UX, there is no hope of supporting UNW_LOCAL_ONLY, because
it's impossible to obtain the address of the members in the
sigcontext structure. */
# undef UNW_LOCAL_ONLY
# define UNW_GENERIC_ONLY
#endif
#define UNW_TARGET ia64
#define UNW_TARGET_IA64 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 511
/* If this bit is it indicates that the procedure saved all of ar.bsp,
ar.bspstore, and ar.rnat. If, additionally, ar.bsp != saved ar.bsp,
then this procedure has performed a register-backing-store switch. */
#define UNW_PI_FLAG_IA64_RBS_SWITCH_BIT (UNW_PI_FLAG_FIRST_TDEP_BIT + 0)
#define UNW_PI_FLAG_IA64_RBS_SWITCH (1 << UNW_PI_FLAG_IA64_RBS_SWITCH_BIT)
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
/* On IA-64, we want to access the contents of floating-point
registers as a pair of "words", but to ensure 16-byte alignment, we
make it a union that contains a "long double". This will do the
Right Thing on all known IA-64 platforms, including HP-UX. */
typedef union
{
struct { unw_word_t bits[2]; } raw;
long double dummy; /* dummy to force 16-byte alignment */
}
unw_tdep_fpreg_t;
typedef struct
{
/* no ia64-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
typedef enum
{
/* Note: general registers are excepted to start with index 0.
This convention facilitates architecture-independent
implementation of the C++ exception handling ABI. See
_Unwind_SetGR() and _Unwind_GetGR() for details. */
UNW_IA64_GR = 0, /* general registers (r0..r127) */
UNW_IA64_GP = UNW_IA64_GR + 1,
UNW_IA64_TP = UNW_IA64_GR + 13,
UNW_IA64_NAT = UNW_IA64_GR + 128, /* NaT registers (nat0..nat127) */
UNW_IA64_FR = UNW_IA64_NAT + 128, /* fp registers (f0..f127) */
UNW_IA64_AR = UNW_IA64_FR + 128, /* application registers (ar0..r127) */
UNW_IA64_AR_RSC = UNW_IA64_AR + 16,
UNW_IA64_AR_BSP = UNW_IA64_AR + 17,
UNW_IA64_AR_BSPSTORE = UNW_IA64_AR + 18,
UNW_IA64_AR_RNAT = UNW_IA64_AR + 19,
UNW_IA64_AR_CSD = UNW_IA64_AR + 25,
UNW_IA64_AR_26 = UNW_IA64_AR + 26,
UNW_IA64_AR_SSD = UNW_IA64_AR_26,
UNW_IA64_AR_CCV = UNW_IA64_AR + 32,
UNW_IA64_AR_UNAT = UNW_IA64_AR + 36,
UNW_IA64_AR_FPSR = UNW_IA64_AR + 40,
UNW_IA64_AR_PFS = UNW_IA64_AR + 64,
UNW_IA64_AR_LC = UNW_IA64_AR + 65,
UNW_IA64_AR_EC = UNW_IA64_AR + 66,
UNW_IA64_BR = UNW_IA64_AR + 128, /* branch registers (b0..p7) */
UNW_IA64_RP = UNW_IA64_BR + 0, /* return pointer (rp) */
UNW_IA64_PR = UNW_IA64_BR + 8, /* predicate registers (p0..p63) */
UNW_IA64_CFM,
/* frame info: */
UNW_IA64_BSP,
UNW_IA64_IP,
UNW_IA64_SP,
UNW_TDEP_LAST_REG = UNW_IA64_SP,
UNW_TDEP_IP = UNW_IA64_IP,
UNW_TDEP_SP = UNW_IA64_SP,
UNW_TDEP_EH = UNW_IA64_GR + 15
}
ia64_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 4 /* r15-r18 are exception args */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. On IA-64,
we use this to provide the bit number in which a NaT bit gets
saved. */
uint8_t nat_bitnr;
/* Padding reserved for future use. */
uint8_t reserved[7];
}
unw_tdep_save_loc_t;
/* On IA-64, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_IA64_FR) < 128)
#include "libunwind-dynamic.h"
#include "libunwind-common.h"
#ifdef __hpux
/* In theory, we could use _Uia64_getcontext() on HP-UX as well, but
the benefit of doing so would be marginal given that it can't
support UNW_LOCAL_ONLY. */
# define unw_tdep_getcontext getcontext
#else
# define unw_tdep_getcontext UNW_ARCH_OBJ (getcontext)
extern int unw_tdep_getcontext (unw_tdep_context_t *);
#endif
/* This is a helper routine to search an ia64 unwind table. If the
address-space argument AS points to something other than the local
address-space, the memory for the unwind-info will be allocated
with malloc(), and should be free()d during the put_unwind_info()
callback. This routine is signal-safe for the local-address-space
case ONLY. */
#define unw_search_ia64_unwind_table UNW_OBJ(search_unwind_table)
extern int unw_search_ia64_unwind_table (unw_addr_space_t, unw_word_t,
unw_dyn_info_t *, unw_proc_info_t *,
int, void *);
/* This is a helper routine which the get_dyn_info_list_addr()
callback can use to locate the special dynamic-info list entry in
an IA-64 unwind table. If the entry exists in the table, the
list-address is returned. In all other cases, 0 is returned. */
extern unw_word_t _Uia64_find_dyn_list (unw_addr_space_t, unw_dyn_info_t *,
void *);
/* This is a helper routine to obtain the kernel-unwind info. It is
signal-safe. */
extern int _Uia64_get_kernel_table (unw_dyn_info_t *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-163
View File
@@ -1,163 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2008 CodeSourcery
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <ucontext.h>
#ifdef mips
# undef mips
#endif
#define UNW_TARGET mips
#define UNW_TARGET_MIPS 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
/* FIXME for MIPS. Too big? What do other things use for similar tasks? */
#define UNW_TDEP_CURSOR_LEN 4096
/* The size of a "word" varies on MIPS. This type is used for memory
addresses and register values. To allow a single library to support
multiple ABIs, and to support N32 at all, we must use a 64-bit type
even when addresses are only 32 bits. */
typedef uint64_t unw_word_t;
typedef int32_t unw_sword_t;
/* FIXME: MIPS ABIs. */
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_MIPS_R0,
UNW_MIPS_R1,
UNW_MIPS_R2,
UNW_MIPS_R3,
UNW_MIPS_R4,
UNW_MIPS_R5,
UNW_MIPS_R6,
UNW_MIPS_R7,
UNW_MIPS_R8,
UNW_MIPS_R9,
UNW_MIPS_R10,
UNW_MIPS_R11,
UNW_MIPS_R12,
UNW_MIPS_R13,
UNW_MIPS_R14,
UNW_MIPS_R15,
UNW_MIPS_R16,
UNW_MIPS_R17,
UNW_MIPS_R18,
UNW_MIPS_R19,
UNW_MIPS_R20,
UNW_MIPS_R21,
UNW_MIPS_R22,
UNW_MIPS_R23,
UNW_MIPS_R24,
UNW_MIPS_R25,
UNW_MIPS_R26,
UNW_MIPS_R27,
UNW_MIPS_R28,
UNW_MIPS_R29,
UNW_MIPS_R30,
UNW_MIPS_R31,
UNW_MIPS_PC = 34,
/* FIXME: Other registers! */
/* For MIPS, the CFA is the value of SP (r29) at the call site in the
previous frame. */
UNW_MIPS_CFA,
UNW_TDEP_LAST_REG = UNW_MIPS_R31,
UNW_TDEP_IP = UNW_MIPS_R31,
UNW_TDEP_SP = UNW_MIPS_R29,
UNW_TDEP_EH = UNW_MIPS_R0 /* FIXME. */
}
mips_regnum_t;
typedef enum
{
UNW_MIPS_ABI_O32,
UNW_MIPS_ABI_N32,
UNW_MIPS_ABI_N64
}
mips_abi_t;
#define UNW_TDEP_NUM_EH_REGS 2 /* FIXME for MIPS. */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On x86, we can directly use ucontext_t as the unwind context. FIXME for
MIPS. */
typedef ucontext_t unw_tdep_context_t;
#include "libunwind-dynamic.h"
typedef struct
{
/* no mips-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
/* There is no getcontext() on MIPS. Use a stub version which only saves GP
registers. FIXME: Not ideal, may not be sufficient for all libunwind
use cases. */
#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
extern int unw_tdep_getcontext (ucontext_t *uc);
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-213
View File
@@ -1,213 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2006-2007 IBM
Contributed by
Corey Ashford <[email protected]>
Jose Flavio Aguilar Paulino <[email protected]> <[email protected]>
Copied from libunwind-x86_64.h, modified slightly for building
frysk successfully on ppc64, by Wu Zhou <[email protected]>
Will be replaced when libunwind is ready on ppc64 platform.
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET ppc32
#define UNW_TARGET_PPC32 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/*
* This needs to be big enough to accommodate "struct cursor", while
* leaving some slack for future expansion. Changing this value will
* require recompiling all users of this library. Stack allocation is
* relatively cheap and unwind-state copying is relatively rare, so we want
* to err on making it rather too big than too small.
*
* To simplify this whole process, we are at least initially taking the
* tack that UNW_PPC32_* map straight across to the .eh_frame column register
* numbers. These register numbers come from gcc's source in
* gcc/config/rs6000/rs6000.h
*
* UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size. Since we have 115
* elements in the loc array, each sized 2 * unw_word_t, plus the rest of
* the cursor struct, this puts us at about 2 * 115 + 40 = 270. Let's
* round that up to 280.
*/
#define UNW_TDEP_CURSOR_LEN 280
#if __WORDSIZE==32
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
#else
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
#endif
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_PPC32_R0,
UNW_PPC32_R1, /* called STACK_POINTER in gcc */
UNW_PPC32_R2,
UNW_PPC32_R3,
UNW_PPC32_R4,
UNW_PPC32_R5,
UNW_PPC32_R6,
UNW_PPC32_R7,
UNW_PPC32_R8,
UNW_PPC32_R9,
UNW_PPC32_R10,
UNW_PPC32_R11, /* called STATIC_CHAIN in gcc */
UNW_PPC32_R12,
UNW_PPC32_R13,
UNW_PPC32_R14,
UNW_PPC32_R15,
UNW_PPC32_R16,
UNW_PPC32_R17,
UNW_PPC32_R18,
UNW_PPC32_R19,
UNW_PPC32_R20,
UNW_PPC32_R21,
UNW_PPC32_R22,
UNW_PPC32_R23,
UNW_PPC32_R24,
UNW_PPC32_R25,
UNW_PPC32_R26,
UNW_PPC32_R27,
UNW_PPC32_R28,
UNW_PPC32_R29,
UNW_PPC32_R30,
UNW_PPC32_R31, /* called HARD_FRAME_POINTER in gcc */
/* Count Register */
UNW_PPC32_CTR = 32,
/* Fixed-Point Status and Control Register */
UNW_PPC32_XER = 33,
/* Condition Register */
UNW_PPC32_CCR = 34,
/* Machine State Register */
//UNW_PPC32_MSR = 35,
/* MQ or SPR0, not part of generic Power, part of MPC601 */
//UNW_PPC32_MQ = 36,
/* Link Register */
UNW_PPC32_LR = 36,
/* Floating Pointer Status and Control Register */
UNW_PPC32_FPSCR = 37,
UNW_PPC32_F0 = 48,
UNW_PPC32_F1,
UNW_PPC32_F2,
UNW_PPC32_F3,
UNW_PPC32_F4,
UNW_PPC32_F5,
UNW_PPC32_F6,
UNW_PPC32_F7,
UNW_PPC32_F8,
UNW_PPC32_F9,
UNW_PPC32_F10,
UNW_PPC32_F11,
UNW_PPC32_F12,
UNW_PPC32_F13,
UNW_PPC32_F14,
UNW_PPC32_F15,
UNW_PPC32_F16,
UNW_PPC32_F17,
UNW_PPC32_F18,
UNW_PPC32_F19,
UNW_PPC32_F20,
UNW_PPC32_F21,
UNW_PPC32_F22,
UNW_PPC32_F23,
UNW_PPC32_F24,
UNW_PPC32_F25,
UNW_PPC32_F26,
UNW_PPC32_F27,
UNW_PPC32_F28,
UNW_PPC32_F29,
UNW_PPC32_F30,
UNW_PPC32_F31,
UNW_TDEP_LAST_REG = UNW_PPC32_F31,
UNW_TDEP_IP = UNW_PPC32_LR,
UNW_TDEP_SP = UNW_PPC32_R1,
UNW_TDEP_EH = UNW_PPC32_R12
}
ppc32_regnum_t;
/*
* According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for
* passing parameters to exception handlers.
*/
#define UNW_TDEP_NUM_EH_REGS 4
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On ppc, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
/* XXX this is not ideal: an application should not be prevented from
using the "getcontext" name just because it's using libunwind. We
can't just use __getcontext() either, because that isn't exported
by glibc... */
#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
#include "libunwind-dynamic.h"
typedef struct
{
/* no ppc32-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-270
View File
@@ -1,270 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2006-2007 IBM
Contributed by
Corey Ashford <[email protected]>
Jose Flavio Aguilar Paulino <[email protected]> <[email protected]>
Copied from libunwind-x86_64.h, modified slightly for building
frysk successfully on ppc64, by Wu Zhou <[email protected]>
Will be replaced when libunwind is ready on ppc64 platform.
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET ppc64
#define UNW_TARGET_PPC64 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/*
* This needs to be big enough to accommodate "struct cursor", while
* leaving some slack for future expansion. Changing this value will
* require recompiling all users of this library. Stack allocation is
* relatively cheap and unwind-state copying is relatively rare, so we want
* to err on making it rather too big than too small.
*
* To simplify this whole process, we are at least initially taking the
* tack that UNW_PPC64_* map straight across to the .eh_frame column register
* numbers. These register numbers come from gcc's source in
* gcc/config/rs6000/rs6000.h
*
* UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size. Since we have 115
* elements in the loc array, each sized 2 * unw_word_t, plus the rest of
* the cursor struct, this puts us at about 2 * 115 + 40 = 270. Let's
* round that up to 280.
*/
#define UNW_TDEP_CURSOR_LEN 280
#if __WORDSIZE==32
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
#else
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
#endif
typedef long double unw_tdep_fpreg_t;
/*
* Vector register (in PowerPC64 used for AltiVec registers)
*/
typedef struct {
uint64_t halves[2];
} unw_tdep_vreg_t;
typedef enum
{
UNW_PPC64_R0,
UNW_PPC64_R1, /* called STACK_POINTER in gcc */
UNW_PPC64_R2,
UNW_PPC64_R3,
UNW_PPC64_R4,
UNW_PPC64_R5,
UNW_PPC64_R6,
UNW_PPC64_R7,
UNW_PPC64_R8,
UNW_PPC64_R9,
UNW_PPC64_R10,
UNW_PPC64_R11, /* called STATIC_CHAIN in gcc */
UNW_PPC64_R12,
UNW_PPC64_R13,
UNW_PPC64_R14,
UNW_PPC64_R15,
UNW_PPC64_R16,
UNW_PPC64_R17,
UNW_PPC64_R18,
UNW_PPC64_R19,
UNW_PPC64_R20,
UNW_PPC64_R21,
UNW_PPC64_R22,
UNW_PPC64_R23,
UNW_PPC64_R24,
UNW_PPC64_R25,
UNW_PPC64_R26,
UNW_PPC64_R27,
UNW_PPC64_R28,
UNW_PPC64_R29,
UNW_PPC64_R30,
UNW_PPC64_R31, /* called HARD_FRAME_POINTER in gcc */
UNW_PPC64_F0 = 32,
UNW_PPC64_F1,
UNW_PPC64_F2,
UNW_PPC64_F3,
UNW_PPC64_F4,
UNW_PPC64_F5,
UNW_PPC64_F6,
UNW_PPC64_F7,
UNW_PPC64_F8,
UNW_PPC64_F9,
UNW_PPC64_F10,
UNW_PPC64_F11,
UNW_PPC64_F12,
UNW_PPC64_F13,
UNW_PPC64_F14,
UNW_PPC64_F15,
UNW_PPC64_F16,
UNW_PPC64_F17,
UNW_PPC64_F18,
UNW_PPC64_F19,
UNW_PPC64_F20,
UNW_PPC64_F21,
UNW_PPC64_F22,
UNW_PPC64_F23,
UNW_PPC64_F24,
UNW_PPC64_F25,
UNW_PPC64_F26,
UNW_PPC64_F27,
UNW_PPC64_F28,
UNW_PPC64_F29,
UNW_PPC64_F30,
UNW_PPC64_F31,
/* Note that there doesn't appear to be an .eh_frame register column
for the FPSCR register. I don't know why this is. Since .eh_frame
info is what this implementation uses for unwinding, we have no way
to unwind this register, and so we will not expose an FPSCR register
number in the libunwind API.
*/
UNW_PPC64_LR = 65,
UNW_PPC64_CTR = 66,
UNW_PPC64_ARG_POINTER = 67,
UNW_PPC64_CR0 = 68,
UNW_PPC64_CR1,
UNW_PPC64_CR2,
UNW_PPC64_CR3,
UNW_PPC64_CR4,
/* CR5 .. CR7 are currently unused */
UNW_PPC64_CR5,
UNW_PPC64_CR6,
UNW_PPC64_CR7,
UNW_PPC64_XER = 76,
UNW_PPC64_V0 = 77,
UNW_PPC64_V1,
UNW_PPC64_V2,
UNW_PPC64_V3,
UNW_PPC64_V4,
UNW_PPC64_V5,
UNW_PPC64_V6,
UNW_PPC64_V7,
UNW_PPC64_V8,
UNW_PPC64_V9,
UNW_PPC64_V10,
UNW_PPC64_V11,
UNW_PPC64_V12,
UNW_PPC64_V13,
UNW_PPC64_V14,
UNW_PPC64_V15,
UNW_PPC64_V16,
UNW_PPC64_V17,
UNW_PPC64_V18,
UNW_PPC64_V19,
UNW_PPC64_V20,
UNW_PPC64_V21,
UNW_PPC64_V22,
UNW_PPC64_V23,
UNW_PPC64_V24,
UNW_PPC64_V25,
UNW_PPC64_V26,
UNW_PPC64_V27,
UNW_PPC64_V28,
UNW_PPC64_V29,
UNW_PPC64_V30,
UNW_PPC64_V31,
UNW_PPC64_VRSAVE = 109,
UNW_PPC64_VSCR = 110,
UNW_PPC64_SPE_ACC = 111,
UNW_PPC64_SPEFSCR = 112,
/* frame info (read-only) */
UNW_PPC64_FRAME_POINTER,
UNW_PPC64_NIP,
UNW_TDEP_LAST_REG = UNW_PPC64_NIP,
UNW_TDEP_IP = UNW_PPC64_NIP,
UNW_TDEP_SP = UNW_PPC64_R1,
UNW_TDEP_EH = UNW_PPC64_R12
}
ppc64_regnum_t;
/*
* According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for
* passing parameters to exception handlers.
*/
#define UNW_TDEP_NUM_EH_REGS 4
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On ppc64, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
/* XXX this is not ideal: an application should not be prevented from
using the "getcontext" name just because it's using libunwind. We
can't just use __getcontext() either, because that isn't exported
by glibc... */
#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
#include "libunwind-dynamic.h"
typedef struct
{
/* no ppc64-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-63
View File
@@ -1,63 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef libunwind_ptrace_h
#define libunwind_ptrace_h
#include <libunwind.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/* Helper routines which make it easy to use libunwind via ptrace().
They're available only if UNW_REMOTE_ONLY is _not_ defined and they
aren't really part of the libunwind API. They are implemented in a
archive library called libunwind-ptrace.a. */
extern void *_UPT_create (pid_t);
extern void _UPT_destroy (void *);
extern int _UPT_find_proc_info (unw_addr_space_t, unw_word_t,
unw_proc_info_t *, int, void *);
extern void _UPT_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *);
extern int _UPT_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *,
void *);
extern int _UPT_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int,
void *);
extern int _UPT_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *,
int, void *);
extern int _UPT_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *,
int, void *);
extern int _UPT_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t,
unw_word_t *, void *);
extern int _UPT_resume (unw_addr_space_t, unw_cursor_t *, void *);
extern unw_accessors_t _UPT_accessors;
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* libunwind_ptrace_h */
-120
View File
@@ -1,120 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2008 CodeSourcery
Copyright (C) 2012 Tommi Rantala <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <stddef.h>
#include <ucontext.h>
#define UNW_TARGET sh
#define UNW_TARGET_SH 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 4096
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_SH_R0,
UNW_SH_R1,
UNW_SH_R2,
UNW_SH_R3,
UNW_SH_R4,
UNW_SH_R5,
UNW_SH_R6,
UNW_SH_R7,
UNW_SH_R8,
UNW_SH_R9,
UNW_SH_R10,
UNW_SH_R11,
UNW_SH_R12,
UNW_SH_R13,
UNW_SH_R14,
UNW_SH_R15,
UNW_SH_PC,
UNW_SH_PR,
UNW_TDEP_LAST_REG = UNW_SH_PR,
UNW_TDEP_IP = UNW_SH_PR,
UNW_TDEP_SP = UNW_SH_R15,
UNW_TDEP_EH = UNW_SH_R0
}
sh_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 2
typedef ucontext_t unw_tdep_context_t;
#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
#include "libunwind-dynamic.h"
typedef struct
{
/* no sh-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-193
View File
@@ -1,193 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2002-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <sys/types.h>
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET x86
#define UNW_TARGET_X86 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 127
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
typedef union {
struct { uint8_t b[4]; } val32;
struct { uint8_t b[10]; } val80;
struct { uint8_t b[16]; } val128;
} unw_tdep_fpreg_t;
typedef enum
{
/* Note: general registers are expected to start with index 0.
This convention facilitates architecture-independent
implementation of the C++ exception handling ABI. See
_Unwind_SetGR() and _Unwind_GetGR() for details.
The described register usage convention is based on "System V
Application Binary Interface, Intel386 Architecture Processor
Supplement, Fourth Edition" at
http://www.linuxbase.org/spec/refspecs/elf/abi386-4.pdf
It would have been nice to use the same register numbering as
DWARF, but that doesn't work because the libunwind requires
that the exception argument registers be consecutive, which the
wouldn't be with the DWARF numbering. */
UNW_X86_EAX, /* scratch (exception argument 1) */
UNW_X86_EDX, /* scratch (exception argument 2) */
UNW_X86_ECX, /* scratch */
UNW_X86_EBX, /* preserved */
UNW_X86_ESI, /* preserved */
UNW_X86_EDI, /* preserved */
UNW_X86_EBP, /* (optional) frame-register */
UNW_X86_ESP, /* (optional) frame-register */
UNW_X86_EIP, /* frame-register */
UNW_X86_EFLAGS, /* scratch (except for "direction", which is fixed */
UNW_X86_TRAPNO, /* scratch */
/* MMX/stacked-fp registers */
UNW_X86_ST0, /* fp return value */
UNW_X86_ST1, /* scratch */
UNW_X86_ST2, /* scratch */
UNW_X86_ST3, /* scratch */
UNW_X86_ST4, /* scratch */
UNW_X86_ST5, /* scratch */
UNW_X86_ST6, /* scratch */
UNW_X86_ST7, /* scratch */
UNW_X86_FCW, /* scratch */
UNW_X86_FSW, /* scratch */
UNW_X86_FTW, /* scratch */
UNW_X86_FOP, /* scratch */
UNW_X86_FCS, /* scratch */
UNW_X86_FIP, /* scratch */
UNW_X86_FEA, /* scratch */
UNW_X86_FDS, /* scratch */
/* SSE registers */
UNW_X86_XMM0_lo, /* scratch */
UNW_X86_XMM0_hi, /* scratch */
UNW_X86_XMM1_lo, /* scratch */
UNW_X86_XMM1_hi, /* scratch */
UNW_X86_XMM2_lo, /* scratch */
UNW_X86_XMM2_hi, /* scratch */
UNW_X86_XMM3_lo, /* scratch */
UNW_X86_XMM3_hi, /* scratch */
UNW_X86_XMM4_lo, /* scratch */
UNW_X86_XMM4_hi, /* scratch */
UNW_X86_XMM5_lo, /* scratch */
UNW_X86_XMM5_hi, /* scratch */
UNW_X86_XMM6_lo, /* scratch */
UNW_X86_XMM6_hi, /* scratch */
UNW_X86_XMM7_lo, /* scratch */
UNW_X86_XMM7_hi, /* scratch */
UNW_X86_MXCSR, /* scratch */
/* segment registers */
UNW_X86_GS, /* special */
UNW_X86_FS, /* special */
UNW_X86_ES, /* special */
UNW_X86_DS, /* special */
UNW_X86_SS, /* special */
UNW_X86_CS, /* special */
UNW_X86_TSS, /* special */
UNW_X86_LDT, /* special */
/* frame info (read-only) */
UNW_X86_CFA,
UNW_X86_XMM0, /* scratch */
UNW_X86_XMM1, /* scratch */
UNW_X86_XMM2, /* scratch */
UNW_X86_XMM3, /* scratch */
UNW_X86_XMM4, /* scratch */
UNW_X86_XMM5, /* scratch */
UNW_X86_XMM6, /* scratch */
UNW_X86_XMM7, /* scratch */
UNW_TDEP_LAST_REG = UNW_X86_XMM7,
UNW_TDEP_IP = UNW_X86_EIP,
UNW_TDEP_SP = UNW_X86_ESP,
UNW_TDEP_EH = UNW_X86_EAX
}
x86_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 2 /* eax and edx are exception args */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On x86, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
#include "libunwind-dynamic.h"
typedef struct
{
/* no x86-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
extern int unw_tdep_getcontext (unw_tdep_context_t *);
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-145
View File
@@ -1,145 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2002-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
Modified for x86_64 by Max Asbock <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <sys/types.h>
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET x86_64
#define UNW_TARGET_X86_64 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 127
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_X86_64_RAX,
UNW_X86_64_RDX,
UNW_X86_64_RCX,
UNW_X86_64_RBX,
UNW_X86_64_RSI,
UNW_X86_64_RDI,
UNW_X86_64_RBP,
UNW_X86_64_RSP,
UNW_X86_64_R8,
UNW_X86_64_R9,
UNW_X86_64_R10,
UNW_X86_64_R11,
UNW_X86_64_R12,
UNW_X86_64_R13,
UNW_X86_64_R14,
UNW_X86_64_R15,
UNW_X86_64_RIP,
#ifdef CONFIG_MSABI_SUPPORT
UNW_X86_64_XMM0,
UNW_X86_64_XMM1,
UNW_X86_64_XMM2,
UNW_X86_64_XMM3,
UNW_X86_64_XMM4,
UNW_X86_64_XMM5,
UNW_X86_64_XMM6,
UNW_X86_64_XMM7,
UNW_X86_64_XMM8,
UNW_X86_64_XMM9,
UNW_X86_64_XMM10,
UNW_X86_64_XMM11,
UNW_X86_64_XMM12,
UNW_X86_64_XMM13,
UNW_X86_64_XMM14,
UNW_X86_64_XMM15,
UNW_TDEP_LAST_REG = UNW_X86_64_XMM15,
#else
UNW_TDEP_LAST_REG = UNW_X86_64_RIP,
#endif
/* XXX Add other regs here */
/* frame info (read-only) */
UNW_X86_64_CFA,
UNW_TDEP_IP = UNW_X86_64_RIP,
UNW_TDEP_SP = UNW_X86_64_RSP,
UNW_TDEP_BP = UNW_X86_64_RBP,
UNW_TDEP_EH = UNW_X86_64_RAX
}
x86_64_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 2 /* XXX Not sure what this means */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On x86_64, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
typedef struct
{
/* no x86-64-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-dynamic.h"
#include "libunwind-common.h"
#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_getcontext (unw_tdep_context_t *);
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
-34
View File
@@ -1,34 +0,0 @@
/* Provide a real file - not a symlink - as it would cause multiarch conflicts
when multiple different arch releases are installed simultaneously. */
#ifndef UNW_REMOTE_ONLY
#if defined __aarch64__
#include "libunwind-aarch64.h"
#elif defined __arm__
# include "libunwind-arm.h"
#elif defined __hppa__
# include "libunwind-hppa.h"
#elif defined __ia64__
# include "libunwind-ia64.h"
#elif defined __mips__
# include "libunwind-mips.h"
#elif defined __powerpc__ && !defined __powerpc64__
# include "libunwind-ppc32.h"
#elif defined __powerpc64__
# include "libunwind-ppc64.h"
#elif defined __sh__
# include "libunwind-sh.h"
#elif defined __i386__
# include "libunwind-x86.h"
#elif defined __x86_64__
# include "libunwind-x86_64.h"
#else
# error "Unsupported arch"
#endif
#else /* UNW_REMOTE_ONLY */
# include "libunwind-arm.h"
#endif /* UNW_REMOTE_ONLY */
-154
View File
@@ -1,154 +0,0 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2003 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _UNWIND_H
#define _UNWIND_H
/* For uint64_t */
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Minimal interface as per C++ ABI draft standard:
http://www.codesourcery.com/cxx-abi/abi-eh.html */
typedef enum
{
_URC_NO_REASON = 0,
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
_URC_FATAL_PHASE2_ERROR = 2,
_URC_FATAL_PHASE1_ERROR = 3,
_URC_NORMAL_STOP = 4,
_URC_END_OF_STACK = 5,
_URC_HANDLER_FOUND = 6,
_URC_INSTALL_CONTEXT = 7,
_URC_CONTINUE_UNWIND = 8
}
_Unwind_Reason_Code;
typedef int _Unwind_Action;
#define _UA_SEARCH_PHASE 1
#define _UA_CLEANUP_PHASE 2
#define _UA_HANDLER_FRAME 4
#define _UA_FORCE_UNWIND 8
struct _Unwind_Context; /* opaque data-structure */
struct _Unwind_Exception; /* forward-declaration */
typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
struct _Unwind_Exception *);
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
uint64_t,
struct _Unwind_Exception *,
struct _Unwind_Context *,
void *);
/* The C++ ABI requires exception_class, private_1, and private_2 to
be of type uint64 and the entire structure to be
double-word-aligned. Please note that exception_class stays 64-bit
even on 32-bit machines for gcc compatibility. */
struct _Unwind_Exception
{
uint64_t exception_class;
_Unwind_Exception_Cleanup_Fn exception_cleanup;
unsigned long private_1;
unsigned long private_2;
} __attribute__((__aligned__));
extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
_Unwind_Stop_Fn, void *);
extern void _Unwind_Resume (struct _Unwind_Exception *);
extern void _Unwind_DeleteException (struct _Unwind_Exception *);
extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int);
extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long);
extern unsigned long _Unwind_GetIP (struct _Unwind_Context *);
extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long);
extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*);
extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *);
#ifdef _GNU_SOURCE
/* Callback for _Unwind_Backtrace(). The backtrace stops immediately
if the callback returns any value other than _URC_NO_REASON. */
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *,
void *);
/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why
_UA_END_OF_STACK exists. */
# define _UA_END_OF_STACK 16
/* If the unwind was initiated due to a forced unwind, resume that
operation, else re-raise the exception. This is used by
__cxa_rethrow(). */
extern _Unwind_Reason_Code
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why
_Unwind_GetBSP() exists. */
extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *);
/* Return the "canonical frame address" for the given context.
This is used by NPTL... */
extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *);
/* Return the base-address for data references. */
extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *);
/* Return the base-address for text references. */
extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *);
/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any
cleanup. The first frame for which the callback is invoked is the
one for the caller of _Unwind_Backtrace(). _Unwind_Backtrace()
returns _URC_END_OF_STACK when the backtrace stopped due to
reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it
stops for any other reason. */
extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
/* Find the start-address of the procedure containing the specified IP
or NULL if it cannot be found (e.g., because the function has no
unwind info). Note: there is not necessarily a one-to-one
correspondence between source-level functions and procedures: some
functions don't have unwind-info and others are split into multiple
procedures. */
extern void *_Unwind_FindEnclosingFunction (void *);
/* See also Linux Standard Base Spec:
http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */
#endif /* _GNU_SOURCE */
#ifdef __cplusplus
};
#endif
#endif /* _UNWIND_H */
Vendored Submodule
+1
Submodule external/bockbuild added at 512ba41a94.
Vendored Submodule
+1
Submodule external/boringssl added at c06ac6b33d.
+1 -1
Vendored Submodule
+1
Submodule external/cecil-legacy added at 33d50b874f.
Vendored Submodule
+1
Submodule external/corefx added at bd96ae5f14.
Vendored Submodule
+1
Submodule external/corert added at d87c966d80.
+1 -1
Vendored Submodule
+1
Submodule external/linker added at e4d9784ac3.
Vendored Submodule
+1
Submodule external/roslyn-binaries added at 0d4198b129.
+2
View File
@@ -1,2 +1,4 @@
ltconfig crlf=input
install-sh crlf=input
/BCC_MAKEFILE -crlf
/digimars.mak -crlf
+1
View File
@@ -93,6 +93,7 @@ GC_API GC_PTR (*GC_oom_fn) GC_PROTO((size_t bytes_requested));
/* pointer to a previously allocated heap */
/* object. */
// Keep somewhat in sync with mono/metadata/profiler.h:enum MonoGCEvent
typedef enum {
GC_EVENT_START,
GC_EVENT_MARK_START,
+1 -1
View File
@@ -26,7 +26,7 @@
# define __KERNEL__
# include <asm/signal.h>
# undef __KERNEL__
# else
# elif defined(__GLIBC__)
/* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
/* struct sigcontext. libc6 (glibc2) uses "struct sigcontext" in */
/* prototypes, so we have to include the top-level sigcontext.h to */
+1 -1
View File
@@ -205,7 +205,7 @@ static
GC_key_t GC_thread_key;
#ifdef USE_COMPILER_TLS
__thread MONO_TLS_FAST void* GC_thread_tls;
__thread void* GC_thread_tls;
/*
* gcc errors out with /tmp/ccdPMFuq.s:2994: Error: symbol `.LTLS4' is already defined
+2 -1
View File
@@ -2,6 +2,7 @@ man_MANS = \
al.1 \
cert2spc.1 \
certmgr.1 \
cert-sync.1 \
chktrust.1 \
cilc.1 \
crlupdate.1 \
@@ -18,6 +19,7 @@ man_MANS = \
mconfig.1 \
mcs.1 \
mdassembler.1 \
mdb2ppdb.1 \
mdoc.1 \
mdoc.5 \
mdoc-assemble.1 \
@@ -42,7 +44,6 @@ man_MANS = \
mozroots.1 \
pdb2mdb.1 \
permview.1 \
prj2make.1 \
resgen.1 \
secutil.1 \
setreg.1 \
+10 -10
View File
@@ -11,7 +11,7 @@ caspol \- Command line tool to modify Code Access Security policies.
.PP
.B caspol [options] [policy level] [actions] [parameters] ...
.SH DESCRIPTION
This tools allow to list and modify the different policy levels (user,
This tool allows to list and modify the different policy levels (user,
machine and enterprise).
.SH OPTIONS
.TP
@@ -20,7 +20,7 @@ Do not ask confirmation to change the policy level.
.TP
.I -f[orce]
Caspol.exe is a managed tool. Changing the security policies could affect
it's ability to work properly. This option permit changes that could
it's ability to work properly. This option permits changes that could
disallow caspol.exe from working properly.
.TP
.I -? | /? | -h[elp]
@@ -90,7 +90,7 @@ Remove the specified named permission set from the policy level
.TP
.I -af | -addfulltrust assemblyname
Add the specified assembly to the fully trusted assembly list in the
policy level. If a policy use some custom security permissions then the
policy level. If a policy uses some custom security permissions then the
assembly containing the custom permissions must be in the fully trusted
list. Note that this requirement is recursive (all assemblies required
by the specified assembly must also be in the list). The assembly must be
@@ -148,33 +148,33 @@ Use the option to load a custom condition into the policy. The class that
will deserialize the XML policy must be in a fully trusted assembly.
.TP
.I -hash algo [-hex hash | -file assemblyname]
This condition specify a specific hash that an assembly must generate
This condition specifies a specific hash that an assembly must generate
(from itself) to be satisfied. Any change to the assembly will require the
policy to be updated (as the hash value will have changed).
.TP
.I -pub [-cert certificate | -file signedfile | -hex rawdata]
This condition specify a X.509 Authenticode(r) certificate that must have
This condition specifies a X.509 Authenticode(r) certificate that must have
signed an assembly in order to be satisfied. The certificate can be referenced
as a file (binary DER), a signed file (containing the certificate) or with
the hexadecimal value of the certificate. Note that files outside the
policy must also be protected against tempering.
.TP
.I -strong -file filename [name | -noname] [version | -noversion]
This condition specify a specific StrongName that must have signed an
This condition specifies a specific StrongName that must have signed an
assembly to be satisfied. Use -noname if the assembly name isn't known
(or important) and -version if the version isn't known (or important) in
the resolution.
.TP
.I -site hostname
This condition specify the site from where the assembly must come from to
This condition specifies the site from where the assembly must come from to
be satisfied.
.TP
.I -url URL
This condition specify the URL from where the assembly must come from to
This condition specifies the URL from where the assembly must come from to
be satisfied.
.TP
.I -zone zonename
This condition specify the zone from where the assembly must come from to
This condition specifies the zone from where the assembly must come from to
be satisfied. Existing zones are MyComputer, Internet, Intranet, Trusted
and Untrusted.
@@ -204,7 +204,7 @@ It is possible to chain several commands with the tool, like:
.TP
This will list all machine level code groups, then remove the code group
labeled 1.6, list again all code groups (missing 1.6), reset the policy
and finally showing all code groups (where 1.6 is back).
and finally show all code groups (where 1.6 is back).
.SH KNOWN ISSUES
.TP
+1 -1
View File
@@ -11,7 +11,7 @@ cccheck \- Perform static code contracts verification for CLR assemblies.
.PP
.B cccheck --assembly=<assembly> [options]
.SH DESCRIPTION
Perform static code contracts verification to find bugs and inconsistences
Perform static code contracts verification to find bugs and inconsistencies
between code and specification. This includes non-null, integer analyses.
.PP
The assembly must have been built with the symbol CONTRACTS_FULL defined,
+3 -3
View File
@@ -1,6 +1,6 @@
.\"
.\" ccrewrite manual page.
.\" Copyright (C) 2010 Novell, Inc (http://www.novell.com)
.\" Copyright (C) 2010 Chris Bacon.
.\" Author:
.\" Chris Bacon <[email protected]>
.\"
@@ -28,7 +28,7 @@ specified assembly.
.TP
.I "--assembly <assembly-name>"
The assembly to rewrite. If no --output option is specified, then this file
overwritten with the rewritten version.
is overwritten with the rewritten version.
.TP
.I "--debug"
Use debug information if available to improve the usefulness of contract
@@ -38,7 +38,7 @@ failure messages.
Show help for ccrewrite, listing configuration options.
.TP
.I "--level <level> (default=4)"
Set the which contract types are present in rewritten assembly:
Set which contract types are present in rewritten assembly:
0 = No contracts;
1 = Release requires;
2 = Requires;
+52
View File
@@ -0,0 +1,52 @@
.\"
.\" cert-sync manual page.
.\" Copyright 2016 Microsoft Corp
.\" Author:
.\" Jo Shields <[email protected]>
.\"
.TH Mono "cert-sync"
.SH NAME
cert-sync \- Mono Certificate Store Sync Tool
.SH SYNOPSIS
.PP
.B cert-sync [--quiet] [--user] filename
.SH DESCRIPTION
This tool allows you to populate a Mono certificate store, from a large
concatenated list of certificates in PEM format (commonly provided on most
Linux distributions).
Its use is intended to be automated at Mono install time, by distribution
packagers, to seamlessly provide SSL support to Mono applications without
further user interaction.
.SH OPTIONS
.TP
.I "--quiet"
Suppress verbose output
.TP
.I "--user"
Populate the per-user store in the user's home directory, instead of the
system-wide store.
.TP
.I "filename.crt"
Path to a certificate bundle. The Mono store will have any extra entries
removed, and new entries added, to reflect the provided file.
.SH EXAMPLES
.TP
.B cert-sync /etc/ssl/certs/ca-certificates.crt
Synchronize the machine store, from the Debian cert store location
.TP
.B cert-sync --user /etc/pki/tls/certs/ca-bundle.crt
Synchronize the user store, from the Red Hat cert store location
.SH AUTHOR
Written by Jo Shields
.SH COPYRIGHT
Copyright (C) 2016 Microsoft Corp
.SH MAILING LISTS
Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR certmgr(1)
+10 -10
View File
@@ -15,7 +15,7 @@ certmgr \- Mono Certificate Manager (CLI version)
or
.B certmgr -ssl [options] url
.SH DESCRIPTION
This tool allow to list, add, remove or extract certificates, certificate
This tool allows to list, add, remove or extract certificates, certificate
revocation lists (CRL) or certificate trust lists (CTL) to/from a
certificate store. Certificate stores are used to build and validate
certificate chains for Authenticode(r) code signing validation and SSL
@@ -23,7 +23,7 @@ server certificates.
.SH STORES
The
.I store
represents the certificate store to use. It can be one of the
represents the certificate store to use. It can be one of the
following:
.TP
.I "My"
@@ -46,7 +46,7 @@ This is for untrusted roots
List the certificates, CTL or CTL in the specified store.
.TP
.I "-add"
Add a certificate, CRL or CTL to specified store. If filename it's a pkcs12
Add a certificate, CRL or CTL to specified store. If filename is a pkcs12
or pfx file, and it contains a private key, it will be imported to local key
pair container.
.TP
@@ -64,25 +64,25 @@ Copy a certificate, CRL or CTL from a store to a file.
Download and add the certificates from a SSL session. You'll be asked to
confirm the addition of every certificate received from the server. Note
that SSL/TLS protocols do not requires a server to send the root certificate.
This action assume an certificate (-c) object type and will import the
This action assumes a certificate (-c) object type and will import the
certificates in appropriate stores (i.e. server certificate in the
OtherPeople store, the root certificate in the Trust store, any other
OtherPeople store, the root certificate in the Trust store and any other
intermediate certificates in the IntermediateCA store).
.TP
.I "-importKey"
Allows importing a private key from a pkcs12 file into a local key pair
store. (Usefull when you already have the key's corresponding certificate
store. (Useful when you already have the key's corresponding certificate
installed at the specific store.)
.SH OBJECT TYPES
.TP
.I "-c", "-cert", "-certificate"
Add, Delete or Put certificates. That is the specified file must/will contains
Add, Delete or Put certificates. That is the specified file must/will contain
X.509 certificates in DER binary encoding.
.TP
.I "-crl"
Add, Delete or Put certificate revocation lists (CRL). That is the specified
file must/will contains X.509 CRL in DER binary encoding.
file must/will contain X.509 CRL in DER binary encoding.
.TP
.I "-ctl"
Add, Delete or Put certificate trust lists (CRL). UNSUPPORTED.
@@ -96,7 +96,7 @@ Use the machine's certificate stores (instead of the default user's stores).
More details displayed on the console.
.TP
.I "-p password"
Use the specify password when accessing a pkcs12 file.
Use the specified password when accessing a pkcs12 file.
.TP
.I "-help", "-h", "-?", "/?"
Display help about this tool.
@@ -113,7 +113,7 @@ For example the trusted root certificates for a user would be kept under
.TP
Certificates files are kept in DER (binary) format (extension .cer).
.TP
The filenames either starts with
The filenames either start with
.I tbp
(thumbprint) or
.I ski
+1 -1
View File
@@ -42,7 +42,7 @@ associated with certificates present in user store.
.B mono crlupdate.exe -f -m
Force the download of every CRL associated with certificates present in
the machine store. Note that the user running this needs read/write
access to the machine store or not update will occur.
access to the machine store or update will not occur.
.SH AUTHOR
Written by Sebastien Pouliot
+59 -20
View File
@@ -2,31 +2,22 @@
.if t .sp .5v
.if n .sp
..
.TH csharp 1 "4 September 2008"
.TH csharp 1 "22 March 2017"
.SH NAME
csharp, gsharp \- Interactive C# Shell
csharp \- Interactive C# Shell and Scripting
.SH SYNOPSIS
.B csharp [--attach PID] [-e EXPRESSION] [file1 [file2]]
[options]
.P
.B gsharp [file1 [file2]]
[compiler-options] [--|-s script-options]
.SH DESCRIPTION
The
.I csharp
is an interactive C# shell that allows the user to enter and evaluate
C# statements and expressions from the command line. The regular
command is an interactive C# shell and scripting host that allows
the user to enter and evaluate C# statements and expressions from
the command line or execute C# scripts.
The regular
.I mcs
command line options can be used in this version of the compiler.
.PP
The
.I gsharp
command is a GUI version of the C# interpreter that uses Gtk# and
provides an area to attach widgets as well. This version can be
attached to other Gtk# applications in a safe way as it injects itself
into the main loop of a Gtk# application, avoiding any problems
arising from the multi-threaded nature of injecting itself into a
target process.
.PP
Files specified in the command line will be loaded and executed as
scripts.
.PP
@@ -35,9 +26,31 @@ Starting with Mono 2.10, the
command can be used as an interpreter executed by executables flagged
with the Unix execute attribute. To do this, make the first line of
your C# source code look like this:
.PP
.nf
"#!/usr/bin/csharp"
Console.WriteLine ("Hello, World");
#!/usr/bin/csharp
Console.WriteLine ("Hello, World");
.fi
.PP
Starting with Mono 5.0, command line arguments may now be passed
to the
.I csharp
command by specifying either the
.I -s
or
.I --
(script) options.
.PP
The
.I -s
option is ideal for interpreting executable scripts that utilize
shebang syntax (introduced in Mono 2.10). This allows command line
arguments to be passed to and consumed cleanly by the script:
.PP
.nf
#!/usr/bin/csharp -s
foreach (var arg in Args)
Console.WriteLine ($"script argument: {arg}");
.fi
.SH OPTIONS
The commands accept all of the commands that are available to the
@@ -45,6 +58,23 @@ The commands accept all of the commands that are available to the
command, so you can reference assemblies, specify paths, language
level and so on from the command line. In addition, the following
command line options are supported:
.TP
.I "\-s" SCRIPT_FILE
This option is ideal for authoring executable scripts that utilize
the Unix shebang feature. Unix will implicitly append as an argument
the path of the script to execute. When the executable is invoked,
any arguments then passed to it will be available in the
.I Args
global. Example:
.I "#!/usr/bin/env csharp -s"
.TP
.I "\-\-"
Any arguments that follow will not be passed to the compiler driver,
and instead will be made available in the
.I Args
global. Example:
.I csharp -- a b c
will result in Args = { "a", "b", "c" } in the interactive shell.
.TP
.I "\-\-attach"
This is an advanced option and should only be used if you have a deep
@@ -224,7 +254,7 @@ versions uses the standard Gtk# key bindings.
.PP
The command set is similar to many other applications (cursor keys)
and incorporates some of the Emacs commands for editing as well as a
history mechanism to
history mechanism too.
.PP
.PP
The following keyboard input is supported:
@@ -247,7 +277,7 @@ line in the history.
.TP
.I Down Arrow Key, Control-n
Moves forward in the history, replaces the current line with the next
lien in the history.
line in the history.
.TP
.I Return
Executes the current line if the statement or expression is complete,
@@ -290,6 +320,15 @@ statements and expressions are executed are static, they can be
invoked directly from the shell. These are the available properties
and methods:
.TP
.I Args
An easy to consume array of any arguments specified after either
.I -s
or
.I --
on the command line. Ideal for self-executing scripts utilizing the
.I -s
option.
.TP
.I void LoadAssembly(string assembly)
Loads the given assembly. This is equivalent to passing the compiler
the -r: flag with the specified string.
+1 -1
View File
@@ -29,7 +29,7 @@ option is specified), and saves them to disk.
The following options are available:
.TP
.I "-nologo"
Supress the startup logo.
Suppress the startup logo.
.TP
.I "-nosave"
Do not save the discovered documents to disk. The default is to save the documents.
+1 -1
View File
@@ -8,7 +8,7 @@
.if t .sp .5v
.if n .sp
..
.TH gacutil "Mono 1.0"
.TH Mono "gacutil"
.SH NAME
gacutil \- Global Assembly Cache management utility.
.SH SYNOPSIS
+1 -1
View File
@@ -9,7 +9,7 @@
.if t .sp .5v
.if n .sp
..
.TH lc "Mono 2.6"
.TH Mono "lc"
.SH NAME
lc \- Mono License Compiler
.SH SYNOPSIS
+1 -1
View File
@@ -8,7 +8,7 @@
.if t .sp .5v
.if n .sp
..
.TH macpack "Mono 1.0"
.TH Mono "macpack"
.SH NAME
macpack \- Macintosh OS X Packager for managed gui assemblies
.SH SYNOPSIS
+15 -3
View File
@@ -18,7 +18,8 @@ prepending the @ symbol to the response file name.
The
.I mcs
compiler is used to compile against the latest Mono Base Class Library
version and fully implements C# 1.0, 2.0, 3.0 and 4.0 specifications.
version and fully implements C# 1.0, 2.0, 3.0, 4.0, 5.0 and 6.0
specifications.
.PP
See the section on packages for more information.
.PP
@@ -163,7 +164,7 @@ The possible values are:
.TP
.I "Default"
Instruct compiler to use the latest version. Equivalent is to omit the
switch (this currently defaults to the C# 4.0 language specification).
switch (this currently defaults to the C# 6.0 language specification).
.TP
.I "ISO-1"
Restrict compiler to use only first ISO standardized features.
@@ -183,6 +184,14 @@ Restrict the compiler to use only the features available in C# 3.0
Restrict the compiler to use only the features available in C# 4.0
specification.
.TP
.I "5"
Restrict the compiler to use only the features available in C# 5.0
specification.
.TP
.I "6"
Restrict the compiler to use only the features available in C# 6.0
specification.
.TP
.I "experimental"
Enables unstable features from upcoming versions of the language.
.PP
@@ -229,6 +238,9 @@ Names the output file to be generated.
.I \-\-parse
Used for benchmarking. The compiler will only parse its input files.
.TP
.I \-pathmap:K=V[,Kn=Vn]
Sets a mapping for source path names used in generated output.
.TP
.I \-pkg:package1[,packageN]
Reference assemblies for the given packages.
.Sp
@@ -510,7 +522,7 @@ the MIT X11. Please read the accompanying `COPYING' file for details.
Alternative licensing for the compiler is available from Xamarin.
.PP
.SH SEE ALSO
csharp(1), mdb(1), mono(1), mopen(1), pkg-config(1), sn(1)
csharp(1), mono(1), pkg-config(1), sn(1)
.PP
.SH BUGS
To report bugs in the compiler, you must file them on our bug tracking
+26
View File
@@ -0,0 +1,26 @@
.\"
.\" mdb2ppdb manual page.
.\" Copyright 2017 Microsoft
.\"
.TH Mono "mdb2ppdb"
.SH NAME
mdb2ppdb \- Convert Mono's debug file format (MDB) to Portable Program
Database (PPDB) file formatn
.SH SYNOPSIS
.PP
.B mdb2ppdb input.mdb output.ppdb
.SH DESCRIPTION
\fImdb2ppdb\fP is a tool that can be used to convert debug information
stored in the Mono debug file format (files with the extension .mdb)
which both Mono's compiler and tools that used Mono's
System.Reflection.Emit debug file format on Unix used into the new
debug format Portable Program Database (files with the
extension .ppdb).
.SH MAILING LISTS
Mailing lists are listed at the
http://www.mono-project.com/community/help/mailing-lists/
.SH WEB SITE
http://www.mono-project.com
.SH SEE ALSO
.PP
mcs(1), pdb2mdb(1)
+218 -63
View File
@@ -8,7 +8,7 @@
.if t .sp .5v
.if n .sp
..
.TH mkbundle "mkbundle 1.0"
.TH Mono "mkbundle"
.SH NAME
mkbundle, mkbundle2 \- Creates a bundled executable.
.SH SYNOPSIS
@@ -21,38 +21,237 @@ default only the assemblies specified in the command line will be
included in the bundle. To automatically include all of the
dependencies referenced, use the "--deps" command line option.
.PP
There are two modes of operation, the default one uses the
C compiler to create a bundle and requires a complete C and Mono SDK
to produced executables. The simple mode (enabled when using the
"--simple") command line option does not require this, and also allows
for cross compilation.
There are two modes of operation, one uses an existing Mono binary or
a server-hosted list of binaries and is enabled when you use either
the
.B --cross,
.B --sdk
or the
.B --runtime
command line options.
.PP
An older mechanism creates a small C stub that links against the
libmono library to produce a self-contained executable and requires a
C compiler. It is described in the "OLD EMBEDDING" section below.
.PP
For example, to create a bundle for hello world, use the following
command:
.nf
$ mkbundle -o hello --simple hello.exe
.fi
.PP
You can configure options to be passed to the Mono runtime directly
into your executable, for this, use the
.I --options
flag. For example, the following disables inlining, by passing the
"-O=-inline" command line option to the embedded executable:
.nf
$ mkbundle -o hello --options -O=-inline --simple hello.exe
.PP
The simple version allows for cross-compiling, this requires a Mono
runtime to be installed in the ~/.mono/targets/TARGET/mono to be
available. You can use the "--local-targets" to list all available
targets, and the "--cross" argument to specify the target, like this:
.nf
$ mkbundle --local-targets
Available targets:
default - Current System Mono
4.4.0-macosx-x86
4.4.0-debian-8-arm64
$ mkbundle --cross 4.4.0-debian-8-powerpc hello.exe -o hello-debian
.fi
.PP
The above will bundle your native library into hello-debian for
a Debian 8 system running on a PowerPC machine.
.PP
We provide pre-packages binaries for Mono for various architectures,
which allow you to cross compile, use the
.B --list-targets
to get a list of all targets supported, and use the
.B --fetch-target
flag to retrieve a target that you do not have installed, like this:
.nf
$ mkbundle --list-targets
Cross-compilation targets available:
4.4.0-linux-libc2.13-amd64
4.4.0-linux-libc2.13-armel
4.4.0-linux-libc2.13-armhf
4.4.0-linux-libc2.13-i386
4.4.0-macos-10.7-amd64
4.4.0-macos-10.7-i386
4.4.2-linux-libc2.13-amd64
4.4.2-linux-libc2.13-armel
4.4.2-linux-libc2.13-armhf
4.4.2-linux-libc2.13-i386
4.4.2-macos-10.7-amd64
4.4.2-macos-10.7-i386
$ mkbundle --fetch-target 4.4.2-macos-10.7-i386
.fi
.PP
And then you can produce a binary that will run on 32-bit Mono on
MacOS:
.nf
$ mkbundle --cross 4.4.2-macos-10.7-i386 hello.exe -o hello-macos
.fi
.PP
Downloaded targets are stored
.B ~/.mono/targets
directory.
.SH OPTIONS
.TP
.I "--config FILE"
Specifies that a machine.config file must be bundled as well.
Typically this is $prefix/etc/mono/1.0/machine.config or
$prefix/etc/mono/2.0/machine.config depending on the profile that you
are using (1.0 or 2.0)
.TP
.I "--config-dir DIR"
When passed, DIR will be set for the MONO_CFG_DIR environment variable
.TP
.I "--cross target"
Use this to request mkbundle generate a cross-compiled binary. It
Creates a bundle for the specified target platform. The target must
be a directory in ~/.mono/targets/ that contains an SDK installation
as produced by the mono-package-runtime tool. You can get a list of
the precompiled versions of the runtime using --list-targets and you
can fetch a specific target using the --fetch-target command line
option.
.Sp
This flag is mutually exclusive with
.I --sdk
which is used to specify an absolute path to resolve the Mono runtime
from and the --runtime option which is used to manually construct the
cross-platform package.
.TP
.I "--deps"
This option will bundle all of the referenced assemblies for the
assemblies listed on the command line option. This is useful to
distribute a self-contained image.
.TP
.I "--env KEY=VALUE"
Use this to hardcode an environment variable at runtime for KEY to be
mapped to VALUE. This is useful in scenarios where you want to
enable certain Mono runtime configuration options that are controlled
by environment variables.
.TP
.I "--fetch-target target"
Downloads a precompiled runtime for the specified target from the Mono
distribution site.
.TP
.I "--i18n encoding"
Specified which encoding tables to ship with the executable. By
default, Mono ships the supporting I18N.dll assembly and the
I18N.West.dll assembly. If your application will use the
System.Text.Encoding.GetEncoding with encodings other than the West
encodings, you should specify them here.
.Sp
You can use the
.B none
parameter to request that no implicit encodings should be bundled,
including the supporting I18N.dll, use this option if you have ran a
linker on your own.
.Sp
You can use the
.B all
flag to bundle all available encodings.
.Sp
Or you can use a comma delimited list of the workds CJK, MidWest,
Other, Rare and West to specificy which encoding assemblies to distribute.
.TP
.I "-L path"
Adds the `path' do the search list for assemblies. The rules are the
same as for the compiler -lib: or -L flags.
.TP
.I "--library [LIB,]PATH"
Embeds the dynamic library file pointed to by `PATH' and optionally
give it the name `LIB' into the bundled executable. This is used to
ship native library dependencies that are unpacked at startup and
loaded from the runtime.
.TP
.I "--lists-targets"
Lists all of the available local cross compilation targets available
as precompiled binaries on the Mono distribution server.
.TP
.I "--local-targets"
Lists all of the available local cross compilation targets.
.TP
.I "--machine-config FILE"
Uses the given FILE as the machine.config file for the generated
application.
.TP
.I "--nodeps"
This is the default: \fImkbundle\fP will only include the assemblies that
were specified on the command line to reduce the size of the resulting
image created.
.TP
.I "-o filename"
Places the output on `out'. If the flag -c is specified, this is the
C host program. If not, this contains the resulting executable.
.TP
.I "--options OPTS"
Since the resulting executable will be treated as a standalone
program, you can use this option to pass configuration options to the
Mono runtime and bake those into the resulting executable. These
options are specified as
.I OPTS.
.Sp
You can use the above to configure options that you would typically
pass on the command line to Mono, before the main program is
executed.
.Sp
Additionally, users of your binary can still configure their own
options by setting the
.I MONO_ENV_OPTIONS
environment variable.
.TP
.I "--sdk SDK_PATH"
Use this flag to specify a path from which mkbundle will resolve the
Mono SDK from. The SDK path should be the prefix path that you used
to configure a Mono installation. And would typically contain files
lik
.I SDK_PATH/bin/mono
,
.I SDK_PATH/lib/mono/4.5
and so on.
.Sp
When this flag is specified,
.I mkbundle
will resolve the runtime, the framework libraries, unmanaged resources
and configuration files from the files located in this directory.
.Sp
This flag is mutually exlusive with
.I --cross
.
.TP
.I "--target-server SERVER"
By default the mkbundle tool will download from a Mono server the
target runtimes, you can specify a different server to provide
cross-compiled runtimes.
.SH OLD EMBEDDING
.PP
The old embedding system compiles a small C stub that embeds the
C code and compiles the resulting executable using the system
compiler. This requires both a working C compiler installation and
only works to bundle binaries for the current host.
.PP
The feature is still available, but we recommend the simpler, faster
and more convenient new mode.
.PP
For example, to create a bundle for hello world, use the following
command:
.nf
$ mkbundle -o hello hello.exe
.fi
.PP
@@ -66,6 +265,7 @@ you want to link additional libraries or control the generated output
in more detail. For example, this could be used to link some libraries
statically:
.nf
$ mkbundle -c -o host.c -oo bundles.o --deps hello.exe
$ cc host.c bundles.o /usr/lib/libmono.a -lc -lrt
@@ -77,86 +277,40 @@ both the -c and --nomain options. The resulting host.c file will
not have a main() function. Call mono_mkbundle_init() before
initializing the JIT in your code so that the bundled assemblies
are available to the embedded runtime.
.SH OPTIONS
.SH OLD EMBEDDING OPTIONS
These options can only be used instead of using the
.B --cross, --runtime
or
.B --simple
options.
.TP
.I "-c"
Produce the stub file, do not compile the resulting stub.
.TP
.I "--cross target"
Creates a bundle for the specified target platform. The target
must be a directory in ~/.mono/targets/ that contains a "mono"
binary. You can fetch various targets using the --fetch-target
command line option.
.TP
.I "-o filename"
Places the output on `out'. If the flag -c is specified, this is the
C host program. If not, this contains the resulting executable.
.TP
.I "-oo filename"
Specifies the name to be used for the helper object file that contains
the bundle.
.TP
.I "-L path"
Adds the `path' do the search list for assemblies. The rules are the
same as for the compiler -lib: or -L flags.
.TP "--config FILE"
Specifies that a machine.config file must be bundled as well.
Typically this is $prefix/etc/mono/1.0/machine.config or
$prefix/etc/mono/2.0/machine.config depending on the profile that you
are using (1.0 or 2.0)
.TP
.I "--deps"
This option will bundle all of the referenced assemblies for the
assemblies listed on the command line option. This is useful to
distribute a self-contained image.
.TP
.I "--fetch-target target"
Downloads a precompiled runtime for the specified target from the Mono
distribution site.
.TP
.I "--nodeps"
This is the default: \fImkbundle\fP will only include the assemblies that
were specified on the command line to reduce the size of the resulting
image created.
.TP
.I "--keeptemp"
By default \fImkbundle\fP will delete the temporary files that it uses to
produce the bundle. This option keeps the file around.
.TP
.I "--lists-targets"
Lists all of the available local cross compilation targets available
as precompiled binaries on the Mono distribution server.
.TP
.I "--local-targets"
Lists all of the available local cross compilation targets.
.TP
.I "--machine-config FILE"
Uses the given FILE as the machine.config file for the generated
application.
.TP
.I "--nomain"
With the -c option, generate the host stub without a main() function.
.TP
.I "--config-dir DIR"
When passed, DIR will be set for the MONO_CFG_DIR environment variable
.TP
.I "--static"
By default \fImkbundle\fP dynamically links to mono and glib. This option
causes it to statically link instead.
.TP
.I "--target-server SERVER"
By default the mkbundle tool will download from a Mono server the
target runtimes, you can specify a different server to provide
cross-compiled runtimes.
.TP
.I "-z"
Compresses the assemblies before embedding. This results in smaller
executable files, but increases startup time and requires zlib to be
installed on the target system.
.SH WINDOWS
On Windows systems, it it necessary to have Unix-like toolchain to be
installed for \fImkbundle\fP to work. You can use cygwin's and install gcc,
gcc-mingw and as packages.
If you are using the old embedding on Windows systems, it it necessary
to have Unix-like toolchain to be installed for \fImkbundle\fP to
work. You can use cygwin's and install gcc, gcc-mingw and as
packages.
.SH ENVIRONMENT VARIABLES
.TP
.I "AS"
@@ -175,7 +329,8 @@ cache.
.PP
Targets are loaded from ~/.mono/targets/TARGETNAME/mono
.SH BUGS
The option "--static" is not supported under Windows.
The option "--static" is not supported under Windows when using the
old embedding.
Moreover, a full cygwin environment containing at least "gcc" and "as"
is required for the build process. The generated executable does not
depend on cygwin.
+1 -1
View File
@@ -5,7 +5,7 @@
.\" Miguel de Icaza ([email protected])
.\" Paolo Molaro ([email protected])
.\"
.TH Mono "Mono 1.0"
.TH Mono "mono-config"
.SH NAME
mono-config \- Mono runtime file format configuration
.SH DESCRIPTION
+1 -1
View File
@@ -8,7 +8,7 @@
.if t .sp .5v
.if n .sp
..
.TH Mono "Mono 1.0"
.TH Mono "mono-service"
.SH NAME
mono-service, mono-service2 \- Mono ServiceProcess host
.SH SYNOPSIS
+1 -1
View File
@@ -9,7 +9,7 @@
.if t .sp .5v
.if n .sp
..
.TH mono-xmltool "Mono 1.0"
.TH Mono "mono-xmltool"
.SH NAME
mono-xmltool \- Mono XML validation and transformation tool.
.SH SYNOPSIS
+124 -27
View File
@@ -7,7 +7,7 @@
.\" Author:
.\" Miguel de Icaza ([email protected])
.\"
.TH Mono "Mono 4.7.0"
.TH Mono "mono"
.SH NAME
mono \- Mono's ECMA-CLI native code generator (Just-in-Time and Ahead-of-Time)
.SH SYNOPSIS
@@ -104,11 +104,6 @@ than one can be specified:
.RS
.ne 8
.TP
.I autoreg
The AOT compiler will emit a (ELF only) library initializer to automatically
register the aot compiled module with the runtime. This is only useful in static
mode
.TP
.I asmonly
Instructs the AOT compiler to output assembly code instead of an
object file.
@@ -118,11 +113,6 @@ object file.
If specified, forces the generated AOT files to be bound to the
runtime version of the compiling Mono. This will prevent the AOT
files from being consumed by a different Mono runtime.
.I full
.Sp
This is currently an experimental feature as it is not complete.
This instructs Mono to precompile code that has historically not been
precompiled with AOT.
.TP
.I data-outfile=FILE.dll.aotdata
.Sp
@@ -134,10 +124,59 @@ on demand by using the
.I mono_install_load_aot_data_hook
method.
.TP
.I direct-icalls
.Sp
When this option is specified, icalls (internal calls made from the
standard library into the mono runtime code) are invoked directly
instead of going through the operating system symbol lookup operation.
This requires use of the
.I static
option.
.TP
.I direct-pinvoke
.Sp
When this option is specified, P/Invoke methods are invoked directly
instead of going through the operating system symbol lookup operation.
This requires use of the
.I static
option.
.TP
.I dwarfdebug
Instructs the AOT compiler to emit DWARF debugging information. When
used together with the nodebug option, only DWARF debugging
information is emitted, but not the information that can be used at
runtime.
.TP
.I full
.Sp
This creates binaries which can be used with the --full-aot option.
.TP
.I hybrid
.Sp
This creates binaries which can be used with the --hybrid-aot option.
.TP
.I llvm
AOT will be performed with the LLVM backend instead of the Mono backend where possible. This will be slower to compile but most likely result in a performance improvement.
.TP
.I llvmonly
AOT will be performed with the LLVM backend exclusively and the Mono backend will not be used. The only output in this mode will be the bitcode file normally specified with the
.I llvm-outfile
option. Use of
.I llvmonly
automatically enables the
.I full
and
.I llvm
options. This feature is experimental.
.TP
.I llvm-outfile=[filename]
Gives the path for the temporary LLVM bitcode file created during AOT.
.TP
.I info
Print the architecture the AOT in this copy of Mono targets and quit.
.TP
.I ld-flags
Additional flags to pass to the C linker (if the current AOT mode calls for invoking it).
.TP
.I llvm-path=<PREFIX>
Same for the llvm tools 'opt' and 'llc'.
@@ -156,7 +195,12 @@ llc compiler.
.I nimt-trampolines=[number]
When compiling in full aot mode, the IMT trampolines must be precreated
in the AOT image. You can add additional method trampolines with this argument.
Defaults to 128.
Defaults to 512.
.TP
.I ngsharedvt-trampolines=[number]
When compiling in full aot mode, the value type generic sharing trampolines must be precreated
in the AOT image. You can add additional method trampolines with this argument.
Defaults to 512.
.TP
.I nodebug
Instructs the AOT compiler to not output any debugging information.
@@ -166,23 +210,22 @@ This prevents the AOT compiler from generating a direct calls to a
method. The AOT compiler usually generates direct calls for certain
methods that do not require going through the PLT (for example,
methods that are known to not require a hook like a static
constructor) or call into simple internal calls.
.TP
.I dwarfdebug
Instructs the AOT compiler to emit DWARF debugging information. When
used together with the nodebug option, only DWARF debugging
information is emitted, but not the information that can be used at
runtime.
constructor) or call into simple internal calls.
.TP
.I nrgctx-trampolines=[number]
When compiling in full aot mode, the generic sharing trampolines must be precreated
in the AOT image. You can add additional method trampolines with this argument.
Defaults to 1024.
Defaults to 4096.
.TP
.I nrgctx-fetch-trampolines=[number]
When compiling in full aot mode, the generic sharing fetch trampolines must be precreated
in the AOT image. You can add additional method trampolines with this argument.
Defaults to 128.
.TP
.I ntrampolines=[number]
When compiling in full aot mode, the method trampolines must be precreated
in the AOT image. You can add additional method trampolines with this argument.
Defaults to 1024.
Defaults to 4096.
.TP
.I outfile=[filename]
Instructs the AOT compiler to save the output to the specified file.
@@ -191,6 +234,16 @@ Instructs the AOT compiler to save the output to the specified file.
If the AOT compiler cannot compile a method for any reason, enabling this flag
will output the skipped methods to the console.
.TP
.I profile=[file]
Specify a file to use for profile-guided optimization. See the "AOT PROFILING" section. To specify multiple files, include the
.I profile
option multiple times.
.TP
.I profile-only
AOT *only* the methods described in the files specified with the
.I profile
option. See the "AOT PROFILING" section.
.TP
.I readonly-value=namespace.typename.fieldname=type/value
Override the value of a static readonly field. Usually, during JIT
compilation, the static constructor is ran eagerly, so the value of
@@ -203,7 +256,6 @@ Note that signed/unsigned numbers do not matter here, just the storage size.
This option can be specified multiple times and it doesn't prevent the static
constructor for the type defining the field to execute with the usual rules
at runtime (hence possibly computing a different value for the field).
.TP
.I save-temps,keep-temps
Instructs the AOT compiler to keep temporary files.
@@ -232,6 +284,9 @@ mono_aot_register_module (mono_aot_module_hello_info);
.I stats
Print various stats collected during AOT compilation.
.TP
.I temp_path=[path]
Explicitly specify path to store temporary files created during AOT compilation.
.TP
.I threads=[number]
This is an experimental option for the AOT compiler to use multiple threads
when compiling the methods.
@@ -241,8 +296,11 @@ Prepends <PREFIX> to the name of tools ran by the AOT compiler, i.e. 'as'/'ld'.
example, --tool=prefix=arm-linux-gnueabi- will make the AOT compiler run
'arm-linux-gnueabi-as' instead of 'as'.
.TP
.I write-symbols
Instructs the AOT compiler to emit debug symbol information.
.I verbose
Prints additional information about type loading failures.
.TP
.I write-symbols,no-write-symbols
Instructs the AOT compiler to emit (or not emit) debug symbol information.
.PP
For more information about AOT, see: http://www.mono-project.com/docs/advanced/aot/
.RE
@@ -257,6 +315,9 @@ The default files are /etc/mono/config and ~/.mono/config or the file
specified in the MONO_CONFIG environment variable, if set. See the
mono-config(5) man page for details on the format of this file.
.TP
\fB--aot-path=PATH\fR
List of additional directories to search for AOT images.
.TP
\fB--debugger-agent=[options]\fR
This instructs the Mono runtime to
start a debugging agent inside the Mono runtime and connect it to a
@@ -315,10 +376,12 @@ the heap as much as possible at the expense of slowing down garbage
collection a bit.
.TP
\fB--full-aot\fR
This is an experimental flag that instructs the Mono runtime to not
This flag instructs the Mono runtime to not
generate any code at runtime and depend exclusively on the code
generated from using mono --aot=full previously. This is useful for
platforms that do not permit dynamic code generation.
generated from using mono --aot=full previously. This is useful for
platforms that do not permit dynamic code generation, or if you need
to run assemblies that have been stripped of IL (for example using
mono-cil-strip).
.Sp
Notice that this feature will abort execution at runtime if a codepath
in your program, or Mono's class libraries attempts to generate code
@@ -332,6 +395,12 @@ Currently this merely ensures that you are running either the
\fBMONO_ENV_OPTIONS\fR environment variable to force all of your child
processes to use one particular kind of GC with the Mono runtime.
.TP
\fB--gc-debug=[options]\fR
Command line equivalent of the \fBMONO_GC_DEBUG\fR environment variable.
.TP
\fB--gc-params=[options]\fR
Command line equivalent of the \fBMONO_GC_PARAMS\fR environment variable.
.TP
\fB--arch=32\fR, \fB--arch=64\fR
(Mac OS X only): Selects the bitness of the Mono binary used, if
available. If the binary used is already for the selected bitness, nothing
@@ -342,6 +411,14 @@ will switch to '/bin/mono64' iff '/bin/mono' is a 32-bit build).
\fB--help\fR, \fB-h\fR
Displays usage instructions.
.TP
\fB--hybrid-aot\fR
This flag allows the Mono runtime to run assemblies
that have been stripped of IL, for example using mono-cil-strip. For this to
work, the assembly must have been AOT compiled with --aot=hybrid.
This flag is similar to --full-aot, but it does not disable the JIT. This means
you can use dynamic features such as System.Reflection.Emit.
.TP
\fB--llvm\fR
If the Mono runtime has been compiled with LLVM support (not available
in all configurations), Mono will use the LLVM optimization and code
@@ -844,6 +921,26 @@ The offsets displayed are IL offsets.
.PP
A more powerful coverage tool is available in the module `monocov'.
See the monocov(1) man page for details.
.SH AOT PROFILING
You can improve startup performance by using the AOT profiler.
.PP
Typically the AOT compiler (\fBmono --aot\fR) will not generate code
for generic instantiations. To solve this, you can run Mono with the
AOT profiler to find out all the generic instantiations that are used,
and then instructing the AOT compiler to produce code for these.
.PP
This command will run the specified app.exe and produce the
\fBout.aotprof\fR file with the data describing the generic
instantiations that are needed:
.nf
$ mono --profile=aot:output=out.aotprof app.exe
.fi
.PP
Once you have this data, you can pass this to Mono's AOT compiler to
instruct it to generate code for it:
.nf
$ mono --aot=profile=out.aotprof
.fi
.SH DEBUGGING AIDS
To debug managed applications, you can use the
.B mdb
+67 -89
View File
@@ -1,4 +1,8 @@
.TH mprof-report 1 ""
.de Sp
.if t .sp .5v
.if n .sp
..
.TH mprof-report 1 ""
.SH The Mono log profiler
.PP
The Mono \f[I]log\f[] profiler can be used to collect a lot of
@@ -88,7 +92,7 @@ provided by the Mono runtime and write them to a file named
\f[I]output.mlpd\f[].
When no option is specified, it is equivalent to using:
.PP
\f[B]--profile=log:calls,alloc,output=output.mlpd,maxframes=8,calldepth=100\f[]
\f[B]--profile=log:calls,alloc,output=output.mlpd,maxframes=32,calldepth=100\f[]
.PP
The following options can be used to modify this default behaviour.
Each option is separated from the next by a \f[B],\f[] character,
@@ -135,41 +139,16 @@ garbage collections
to the control port
.RE
.IP \[bu] 2
\f[I]sample[=TYPE[/FREQ]]\f[]: collect statistical samples of the
\f[I]sample[=FREQ]\f[]: collect statistical samples of the
program behaviour.
The default is to collect a 100 times per second (100 Hz) the
instruction pointer.
This is equivalent to the value \[lq]cycles/100\[rq] for
\f[I]TYPE\f[].
On some systems, like with recent Linux kernels, it is possible to
cause the sampling to happen for other events provided by the
performance counters of the cpu.
In this case, \f[I]TYPE\f[] can be one of:
.RS 2
.IP \[bu] 2
\f[I]cycles\f[]: processor cycles
.IP \[bu] 2
\f[I]instr\f[]: executed instructions
.IP \[bu] 2
\f[I]cacherefs\f[]: cache references
.IP \[bu] 2
\f[I]cachemiss\f[]: cache misses
.IP \[bu] 2
\f[I]branches\f[]: executed branches
.IP \[bu] 2
\f[I]branchmiss\f[]: mispredicted branches
.RE
.IP \[bu] 2
\f[I]time=TIMER\f[]: use the TIMER timestamp mode.
TIMER can have the following values:
.RS 2
.IP \[bu] 2
\f[I]fast\f[]: a usually faster but possibly more inaccurate timer
.RE
This is equivalent to the value \[lq]100\[rq].
A value of zero for \f[I]FREQ\f[] effectively disables sampling.
.IP \[bu] 2
\f[I]maxframes=NUM\f[]: when a stack trace needs to be performed,
collect \f[I]NUM\f[] frames at the most.
The default is 8.
The default is 32.
.IP \[bu] 2
\f[I]maxsamples=NUM\f[]: stop allocating reusable sample events
once \f[I]NUM\f[] events have been allocated (a value of zero for
@@ -230,13 +209,15 @@ The following commands are available:
\f[I]heapshot\f[]: perform a heapshot as soon as possible
.RE
.IP \[bu] 2
\f[I]counters\f[]: sample counters values every 1 second. This allow
a really lightweight way to have insight in some of the runtime key
metrics. Counters displayed in non verbose mode are : Methods from AOT,
Methods JITted using mono JIT, Methods JITted using LLVM, Total time
spent JITting (sec), User Time, System Time, Total Time, Working Set,
Private Bytes, Virtual Bytes, Page Faults and CPU Load Average (1min,
5min and 15min).
\f[I]nocounters\f[]: disables sampling of runtime and performance
counters, which is normally done every 1 second.
.IP \[bu] 2
\f[I]coverage\f[]: collect code coverage data. This implies enabling
the \f[I]calls\f[] option.
.IP \[bu] 2
\f[I]onlycoverage\f[]: can only be used with \f[I]coverage\f[]. This
disables most other events so that the profiler mostly only collects
coverage data.
.RE
.SS Analyzing the profile data
.PP
@@ -260,19 +241,15 @@ To see this info invoke mprof-report as follows:
\f[B]mprof-report\ --traces\ output.mlpd\f[]
.PP
The maximum number of methods in each stack trace can be specified
with the \f[I]\[em]maxframes=NUM\f[] option:
with the \f[I]--maxframes=NUM\f[] option:
.PP
\f[B]mprof-report\ --traces\ --maxframes=4\ output.mlpd\f[]
.PP
The stack trace info will be available if method enter/leave events
have been recorded or if stack trace collection wasn't explicitly
disabled with the \f[I]maxframes=0\f[] profiler option.
Note that the profiler will collect up to 8 frames by default at
specific events when the \f[I]nocalls\f[] option is used, so in
that case, if more stack frames are required in mprof-report, a
bigger value for maxframes when profiling must be used, too.
.PP
The \f[I]\[em]traces\f[] option also controls the reverse reference
The \f[I]--traces\f[] option also controls the reverse reference
feature in the heapshot report: for each class it reports how many
references to objects of that class come from other classes.
.SS Sort order for methods and allocations
@@ -362,6 +339,10 @@ version
\f[I]heapshot\f[]: live heap usage at heap shots
.IP \[bu] 2
\f[I]counters\f[]: counters samples
.IP \[bu] 2
\f[I]coverage\f[]: code coverage data
.IP \[bu] 2
\f[I]stats\f[]: event statistics
.PP
It is possible to limit some of the data displayed to a timeframe
of the program execution with the option:
@@ -391,23 +372,23 @@ Instead of printing the usual reports from the profiler data, it is
possible to track some interesting information about some specific
object addresses.
The objects are selected based on their address with the
\f[I]\[em]track\f[] option as follows:
\f[I]--track\f[] option as follows:
.PP
\f[B]--track=0xaddr1[,0xaddr2,...]\f[]
.PP
The reported info (if available in the data file), will be class
name, size, creation time, stack trace of creation (with the
\f[I]\[em]traces\f[] option), etc.
\f[I]--traces\f[] option), etc.
If heapshot data is available it will be possible to also track
what other objects reference one of the listed addresses.
.PP
The object addresses can be gathered either from the profiler
report in some cases (like in the monitor lock report), from the
live application or they can be selected with the
\f[I]\[em]find=FINDSPEC\f[] option.
\f[I]--find=FINDSPEC\f[] option.
FINDSPEC can be one of the following:
.IP \[bu] 2
\f[I]S:SIZE\f[]: where the object is selected if it's size is at
\f[I]S:SIZE\f[]: where the object is selected if its size is at
least \f[I]SIZE\f[]
.IP \[bu] 2
\f[I]T:NAME\f[]: where the object is selected if \f[I]NAME\f[]
@@ -432,6 +413,13 @@ By default mprof-report will print the summary data to the console.
To print it to a file, instead, use the option:
.PP
\f[B]--out=FILENAME\f[]
.SS Processing code coverage data
.PP
If you ran the profiler with the \f[I]coverage\f[] option, you can
process the collected coverage data into an XML file by running
mprof-report like this:
.PP
\f[B]mprof-report --coverage-out=coverage.xml output.mlpd\f[]
.SS Dealing with profiler slowness
.PP
If the profiler needs to collect lots of data, the execution of the
@@ -439,20 +427,20 @@ program will slow down significantly, usually 10 to 20 times
slower.
There are several ways to reduce the impact of the profiler on the
program execution.
.SS Use the statistical sampling mode
.PP
.IP "\f[I]Use the statistical sampling mode\f[]" 4
.Sp
Statistical sampling allows executing a program under the profiler
with minimal performance overhead (usually less than 10%).
This mode allows checking where the program is spending most of
it's execution time without significantly perturbing its behaviour.
.SS Collect less data
.PP
its execution time without significantly perturbing its behaviour.
.IP "\f[I]Collect less data\f[]" 4
.Sp
Collecting method enter/leave events can be very expensive,
especially in programs that perform many millions of tiny calls.
The profiler option \f[I]nocalls\f[] can be used to avoid
collecting this data or it can be limited to only a few call levels
with the \f[I]calldepth\f[] option.
.PP
.Sp
Object allocation information is expensive as well, though much
less than method enter/leave events.
If it's not needed, it can be skipped with the \f[I]noalloc\f[]
@@ -463,21 +451,12 @@ expensive as well.
The impact of stack trace information can be reduced by setting a
low value with the \f[I]maxframes\f[] option or by eliminating them
completely, by setting it to 0.
.PP
The other major source of data is the heapshot profiler option:
especially if the managed heap is big, since every object needs to
be inspected.
.Sp
The other major source of data is the \f[I]heapshot\f[] profiler
option: especially if the managed heap is big, since every object
needs to be inspected.
The \f[I]MODE\f[] parameter of the \f[I]heapshot\f[] option can be
used to reduce the frequency of the heap shots.
.SS Reduce the timestamp overhead
.PP
On many operating systems or architectures what actually slows down
profiling is the function provided by the system to get timestamp
information.
The \f[I]time=fast\f[] profiler option can be usually used to speed
up this operation, but, depending on the system, time accounting
may have some level of approximation (though statistically the data
should be still fairly valuable).
.SS Dealing with the size of the data files
.PP
When collecting a lot of information about a profiled program, huge
@@ -486,15 +465,15 @@ There are a few ways to minimize the amount of data, for example by
not collecting some of the more space-consuming information or by
compressing the information on the fly or by just generating a
summary report.
.SS Reducing the amount of data
.PP
.IP "\f[I]Reducing the amount of data\f[]" 4
.Sp
Method enter/leave events can be excluded completely with the
\f[I]nocalls\f[] option or they can be limited to just a few levels
of calls with the \f[I]calldepth\f[] option.
For example, the option:
.PP
.Sp
\f[B]calldepth=10\f[]
.PP
.Sp
will ignore the method events when there are more than 10 managed
stack frames.
This is very useful for programs that have deep recursion or for
@@ -503,59 +482,59 @@ the call stack.
The optimal number for the calldepth option depends on the program
and it needs to be balanced between providing enough profiling
information and allowing fast execution speed.
.PP
.Sp
Note that by default, if method events are not recorded at all, the
profiler will collect stack trace information at events like
allocations.
To avoid gathering this data, use the \f[I]maxframes=0\f[] profiler
option.
.PP
.Sp
Allocation events can be eliminated with the \f[I]noalloc\f[]
option.
.PP
.Sp
Heap shot data can also be huge: by default it is collected at each
major collection.
To reduce the frequency, you can specify a heapshot mode: for
example to collect every 5 collections (including major and minor):
.PP
.Sp
\f[B]heapshot=5gc\f[]
.PP
.Sp
or when at least 5 seconds passed since the last heap shot:
.PP
.Sp
\f[B]heapshot=5000ms\f[]
.SS Compressing the data
.PP
.IP "\f[I]Compressing the data\f[]" 4
.Sp
To reduce the amout of disk space used by the data, the data can be
compressed either after it has been generated with the gzip
command:
.PP
.Sp
\f[B]gzip\ -9\ output.mlpd\f[]
.PP
.Sp
or it can be compressed automatically by using the \f[I]zip\f[]
profiler option.
Note that in this case there could be a significant slowdown of the
profiled program.
.PP
.Sp
The mprof-report program will tranparently deal with either
compressed or uncompressed data files.
.SS Generating only a summary report
.PP
.IP "\f[I]Generating only a summary report\f[]" 4
.Sp
Often it's enough to look at the profiler summary report to
diagnose an issue and in this case it's possible to avoid saving
the profiler data file to disk.
This can be accomplished with the \f[I]report\f[] profiler option,
which will basically send the data to the mprof-report program for
display.
.PP
.Sp
To have more control of what summary information is reported (or to
use a completely different program to decode the profiler data),
the \f[I]output\f[] profiler option can be used, with \f[B]|\f[] as
the first character: the rest of the output name will be executed
as a program with the data fed in on the standard input.
.PP
.Sp
For example, to print only the Monitor summary with stack trace
information, you could use it like this:
.PP
.Sp
\f[B]output=|mprof-report\ --reports=monitor\ --traces\ -\f[]
.SH WEB SITE
http://www.mono-project.com/docs/debug+profile/profile/profiler/
@@ -563,5 +542,4 @@ http://www.mono-project.com/docs/debug+profile/profile/profiler/
.PP
mono(1)
.SH AUTHORS
Paolo Molaro.
Paolo Molaro, Alex Rønne Petersen
Loaded 100 of 4734 files, more files were not shown because too many files have changed in this diff. Show more