Compare commits

..
698 Commits
Author SHA1 Message Date
monojenkins d01276bb36 Bump API snapshot submodule 2018-10-07 15:25:44 +02:00
Marek Safar 7f1768441c Bump corefx 2018-10-07 15:25:44 +02:00
Alexander Köplinger 39d89a335c Fix build of mono-merp.c
It was missing the format arguments that were in a later iteration of https://github.com/mono/mono/pull/10823
2018-09-27 10:45:44 +02:00
monojenkins a533cb343b [merp] Fix return value handling of posix_spawn (#10824) 2018-09-26 11:46:09 -04:00
Ludovic Henry c5b8988d22 [sdb] Disable an assert to avoid breaking debugging. (#10315)
Fixes https://github.com/mono/mono/issues/8848.
Fixes https://github.com/mono/mono/issues/9262.
Fixes https://github.com/mono/mono/issues/8627.
2018-08-27 17:42:24 -04:00
Alexander Kyte 15eab7066c [2018-02] Add pipeline to convert managed exception into telemetry format (#10249) 2018-08-27 15:56:04 -04:00
Alexander Köplinger e0e035e3b1 Bump xunit-binaries
Gets in fix for invalid NUnit xml output generated by xunit

(cherry picked from commit 0955dd2307)
2018-08-22 14:03:40 +02:00
monojenkins 4e0a2ac0dd [llvm] Avoid using the preserveall calling convention on watchos, xcode10 asserts on it. (#9325)
Fixes https://github.com/mono/mono/issues/9318.
2018-08-20 21:33:45 +02:00
Alexander Köplinger 02928166e5 Bump nunitlite to get NUnit2 xml output fix and failure on file not found fix (#10188)
See mono/NUnitLite#11 and mono/NUnitLite#12

(cherry picked from commit 8f67fb9fb1)
2018-08-20 14:43:14 +02:00
monojenkins 6c1f4b9746 [System.Xml.Linq] Fix namespace conflict with new Xamarin.Mac namespace in test code. (#10185)
macOS 10.14 introduces a Network framework, which means Xamarin.Mac now has a Network namespace.

This conflicts with 'using Network = System.Net':

> mono/mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs(97,27): error CS0576: Namespace '<global namespace>' contains a definition conflicting with alias 'Network'

so just remove the using and use the full 'System.Net' namespace instead.
2018-08-20 12:11:43 +02:00
Marek Safar 4fe3280bba Revert "[sdk] Do not fix android platform-tools version. Make it configurable. (#9508)"
This reverts commit 077307fce4.
2018-07-20 13:56:50 +02:00
Marek Safar 12ae4f9b0c Revert "[runtime] Fix the --enable-minimal=aot build. (#9394)"
This reverts commit 1bdbf71a8b.
2018-07-20 13:56:50 +02:00
Marek Safar a2b95fbb4b Revert "[2018-02] Backport /bin/bash shell set for wasm"
This reverts commit 97aa066389.
2018-07-20 13:56:50 +02:00
monojenkins f795aa5d2d [llvm] Avoid using the preserveall calling convention in another place on watchos. (#9578)
Fixes https://github.com/mono/mono/issues/9318.
2018-07-19 12:49:21 +02:00
monojenkins 04493d2224 Fix LogcatTextWriter_Log interpreting messages it logs, potentially writing random garbage and/or crashing (introduced by https://github.com/mono/mono/commit/984f6484666c2ee6fefec949c81fdff1189c9488) (Fixes https://github.com/xamarin/xamarin-android/issues/1951) (#9612) 2018-07-18 11:41:09 -04:00
Alexander Kyte 35284c340c [runtime] Make sigterm dumper send file to merp (#9586) 2018-07-18 11:38:20 -04:00
monojenkins 077307fce4 [sdk] Do not fix android platform-tools version. Make it configurable. (#9508) 2018-07-14 10:48:31 +02:00
monojenkins 1ad118647c [arm64] Make OP_CHECK_THIS read only a byte, to prevent unaligned access errors. (#9546) 2018-07-14 10:45:50 +02:00
Alexander Köplinger 86f99d31bd Merge pull request #9483 from alexanderkyte/2018-02-merp_params
[Backport 2018-02] Add merp parameters
2018-07-12 21:15:53 +02:00
Alexander Kyte 97aa066389 [2018-02] Backport /bin/bash shell set for wasm 2018-07-11 14:43:56 -04:00
Alexander Kyte 37091f00c2 [runtime] Enable application to register path for MERP restart 2018-07-10 15:28:40 -04:00
Alexander Kyte 955ad4538e [runtime] Make merp eventType icall argument 2018-07-10 15:28:20 -04:00
Jay Krell fc0c12f768 [Coop] Convert Mono.Runtime to coop. (#8599) 2018-07-10 15:27:49 -04:00
Bernhard Urban c495285cac [debugger] more locking and avoid race around mono_threads_join_lock & loader lock 2018-07-10 10:12:39 +02:00
Alexander Kyte d18b8941ab [debugger] Add locking around tls->frames usage/freeing 2018-07-10 10:12:39 +02:00
monojenkins 1bdbf71a8b [runtime] Fix the --enable-minimal=aot build. (#9394)
[2018-02] [runtime] Fix the --enable-minimal=aot build.

Backport of #8952.

/cc @lewurm
2018-07-09 15:25:40 -04:00
monojenkins cae8c54884 [mini] add workaround for AMD Ryzen Threadripper issue (#9358)
[2018-02] [mini] add workaround for AMD Ryzen Threadripper issue

Backport of #9321.

/cc @lewurm
2018-06-30 03:40:24 -04:00
Aleksey Kliger 8b479398bb [loader] LoadFrom of problematic images should reprobe (correctly)
This reverts commit 569bd3bc52
which itself reverted efe1fdeb9d.

Additionally, cherrypick 60f06e6ca2: refonly load
of problematic image is allowed.
2018-06-29 16:43:08 +02:00
monojenkins 9ef7249458 [2018-02] [sdks] Only rebuild MXE when it doesn't exist, not when we just cloned the sources (#9364)
* [sdks] Only rebuild MXE when it doesn't exist, not when we just cloned the sources

* [sdks] Default to ~/android-toolchain and ~/android-archives to better share with XA
2018-06-29 14:15:52 +02:00
Alexander Kyte cd5d306ea0 Merge pull request #9330 from monojenkins/backport-pr-9274-to-2018-02
[2018-02] Make requested MERP file format changes
2018-06-28 11:29:36 -04:00
Alexander Kyte 8b628bb532 [merp] Change XML file output path 2018-06-27 10:21:41 +00:00
Alexander Kyte 671db7c46d [merp] Change and emit event type 2018-06-27 10:21:41 +00:00
monojenkins a57665c315 [2018-02] [runtime] Package merp params in 3 ways needed (#9270)
* [runtime] Package merp params in 3 ways needed

* [runtime] Use GUID rather than assembly name in json
2018-06-25 21:31:50 +02:00
monojenkins f552ff99a1 [runtime] Make mono-state dumper abandon stuck threads (#9271)
Threads which do things with signals and locks may end up unresponsive
to our signals. I cannot get threads that crash in a lock to respond to
SIGTERM on Darwin even if I explicitly unmask SIGTERM on those threads.

In order to defensively program against platform bugs around signals and
stubborn threads, we need to be able to abandon these threads and
continue, dumping other threads.
2018-06-25 21:29:50 +02:00
Bernhard Urban 4e1474e9e3 [interp] check existence of InterpMethod before removing it from interp code hastable
when creating dynamic methods, we put those in a queue so they can be
collected later via `mono_jit_free_method ()`. the interpreter part was
assuming, as soon as we allocate a dynamic method, it will be executed
eventually and therefore an InterpMethod must exist in
`info.interp_code_hash`, but this isn't necessarily the case.
2018-06-18 11:24:55 +02:00
monojenkins f3235f3d03 [Linux,XA build] Fix building of Windows cross-compilers on Ubuntu Linux (#9172)
Ubuntu Linux (possibly others too, but only Ubuntu is tested thus the
limitation) don't need to build or use `mxe`, they instead use mingw packaged
for the distribution, thus making the build faster.

This commit detects the Linux flavor in use and, if it's Ubuntu, configures the
build so that system mingw is used instead of mxe.
2018-06-16 15:16:36 +02:00
monojenkins 3467e374ba [SDKS,Android] Install cmake when provisioning Android SDK (#9140)
Android NDK supports cmake in addition to the older make-based ndk-build as the
build system and Xamarin.Android is in the process of switching the build of its
native bits to cmake. The reason for this switch is that certain parts of
Xamarin.Android (libmonodroid) are built for both the host system and
the Android target. The host system build currently uses hand-crafted code
directly in .csproj to build the native bits while the Android build uses
ndk-build. This results in duplication of code, compiler parameters are
specified in two locations - it is easy to introduce incompatibilities, bug
fixes may be applied only in one scenario etc.

Using cmake allows us to use a single build "script" for all the targets, thus
making the build more reliable. Android SDK has a cmake package which contains
full support for NDK builds and allows us to easily use cmake across all the
supported platforms without having to install cmake on the host system.

This commit adds the cmake package to the Android SDK provisiong process and,
alas, at the same time adds a workaround to properly unpack the package. Unlike
other Android SDK packages, cmake doesn't unpack to a single subdirectory of the
zip root, instead all its files and directories are placed directly in the zip
root. This requires yet another workaround to install the package properly.
2018-06-16 15:14:33 +02:00
Ankit Jain f353dc4db0 Bump msbuild to track mono-2018-02 (#9129) 2018-06-14 14:29:07 -04:00
Rodrigo Kumpera f59eac4c0f [profiler] Don't raise events until the profiler transitions to the ready state. Fixes #8866.
We can't raise event before that as the profiler depends on too much runtime
infrastructure at this point for it to reliably work.

For example, we need the threading infrastructure to be init'd so we can access the
thread-local profiler state to store events there.
2018-06-14 15:02:19 +02:00
Marek Safar a37e6e5739 Bump corefx to fix System.Data windows build 2018-06-13 18:20:52 +02:00
monojenkins 6f9bef3bdb update to Android P final API. (#9078) 2018-06-07 16:22:46 -07:00
Zoltan Varga 1c24c158b0 [bitcode] Fix the generation of invalid llvm IR for some Span code. 2018-06-01 12:22:18 +02:00
monojenkins a49a68c6d7 [interp] Fix native to interp transition (#8957)
When using the interp_wrapper to enter interp from native we don't need to save the lmf since it doesn't make sense to unwind to native. Also make sure we have the interp context set up if we weren't attached at interp transition time.
2018-05-31 09:37:55 +02:00
Marek Safar 92e11812f4 [System.Runtime.Serialization] Makes more APIs work for mobile 2018-05-30 23:54:22 +02:00
monojenkins 260676f948 Bump API snapshot submodule 2018-05-30 23:53:47 +02:00
Matt Sylvia eefdf4ed31 Bump external/cecil to b6c50e3 2018-05-30 23:53:47 +02:00
Alexander Kyte 0754926394 [2018-02] Finalize merp integration (#8869) 2018-05-29 15:19:34 -04:00
monojenkins 7bdb7dd765 Bump API snapshot submodule 2018-05-29 09:52:20 +02:00
Marek Safar 65d719d16e [Facades] Removes System.Memory 2018-05-29 09:52:20 +02:00
Rodrigo Kumpera 88262b52d2 [profiler] Switch tls storage to use mono_thread_info_get/set_tools_data. Fixes #7683
External threads are detached using TLS destructors and this leads to non-determinism around to cleanup ordering of keys.
This causes the profiler to see the profiler tls key null'd even though it was not detached yet.
2018-05-28 10:19:02 +02:00
Rodrigo Kumpera aaed1f77ce [mono-threads] Introduce mono_thread_info_get/set_tools_data so they can store data sanely.
The tools_data is a helper to bind tls data lifecycle to MonoThreadInfo.
This is needed to make it sane to deal with posix TLS destructors.
2018-05-28 10:19:02 +02:00
Alexander Kyte 58637d0ee7 [runtime] Gracefully handle crashes before mono-state dependencies initialized (#8842) 2018-05-24 12:38:14 -04:00
EgorBo c22f532871 don't fail on unsupported ipv6 in BeginConnect 2018-05-24 11:28:56 +02:00
monojenkins d2a4141475 Bump API snapshot submodule 2018-05-24 09:59:48 +02:00
Marek Safar 5db90bde0c Update failing mcs tests 2018-05-24 09:59:48 +02:00
Marek Safar 21716f8b68 [corlib] Hide types which could conflict with System.Memory 2018-05-24 09:59:48 +02:00
monojenkins f2381f329a [monitor] Fix abort of synchronisation wrapper (#8827)
Backport of #8812.

/cc @marek-safar
2018-05-23 10:57:06 -04:00
Alexis Christoforides 4afcb37eca Merge pull request #8837 from monojenkins/backport-pr-7412-to-2018-02
[2018-02] [MacSDK] Update Nuget to 4.7.0
2018-05-23 10:00:17 -04:00
Alexis Christoforides 139d2a441b [MacSDK] Update Nuget to 4.7.0
This update includes (should include) https://github.com/NuGet/NuGet.Client/commit/eca1a8d23a54818c116eef63875de6a554227ea7 which we need in Mono.
2018-05-23 13:58:41 +00:00
Alexander Kyte 76c1c1baec [runtime] Add missing va_start (#8807) 2018-05-22 18:07:07 -04:00
monojenkins 9529b37b69 [android] Fix truncating of messages longer than 4096 characters (#8763)
Backport of #8735.

/cc @marek-safar
2018-05-22 16:57:59 -04:00
Ankit Jain f80aeb547f Bump msbuild to track mono-2018-02 (#8728) 2018-05-22 20:49:52 +02:00
Alexander Kyte cbbe573e20 Merge pull request #8687 from alexanderkyte/2018-02-freeform
Backport "Implement Freeform Unmanaged Error" to 2018-02
2018-05-21 22:05:30 -04:00
Alexander Kyte f80ae8146f [runtime] Fixup freeform unmanaged exception handler 2018-05-21 16:46:00 -04:00
Zoltan Varga 5152e84055 [aot] Fix encoding/decoding of types with custom modifiers. (#8729)
* [aot] Fix encoding/decoding of types with custom modifiers.

Fixes https://github.com/mono/mono/issues/8701.

* [aot] Add a test, disabling for now because it depends on c# 7.2.

* [aot] Bump AOT file format version.

* [aot] Only disable the test with mcs.

* [aot] Fix compilation of test.
2018-05-21 18:39:45 +02:00
Alexander Köplinger 35d4d7e8e6 [ci] Fix URL for apidiff/csprojdiff report
The upgraded HTML publisher plugin on Jenkins now generates a different URL.

(cherry picked from commit fa9579a8fa)
2018-05-18 14:27:16 +02:00
monojenkins d3fa0e12d0 [Mono.CSharp] Mimic the settings from System to track the feature flags, fixes GitHub #8698 (#8705) 2018-05-14 21:04:16 +02:00
Ankit Jain 2c0121911d Bump msbuild to track mono-2018-02 (#8682) 2018-05-14 12:46:41 +02:00
Alexander Kyte fc45400caa [runtime] Make unhandled state dumper OSX-specific
Since this needs to be backported, we're going to make this osx-specific
for now, and then I'll backport this. This is fully working on linux,
including the android SDK at the time of this commit
2018-05-11 19:33:27 -04:00
Alexander Kyte baf8448122 [runtime] Fix windows build 2018-05-11 19:32:41 -04:00
Alexander Kyte e6b6562cdc [runtime] Fix merp reference in mono-state code 2018-05-11 19:32:40 -04:00
Alexander Kyte c0bf542e2a [runtime] Add freeform dumper preprocessor symbols to autogen 2018-05-11 19:32:40 -04:00
Alexander Kyte 4f23989316 [runtime] Add CI dumper using mono-state 2018-05-11 19:32:39 -04:00
Alexander Kyte 514c06b12f [runtime] Integrate signal-based state machine with merp forking 2018-05-11 19:30:43 -04:00
Alexander Kyte d785f7d7f0 [runtime] Write unmanaged exception dumper 2018-05-11 19:30:42 -04:00
Alexander Kyte b7ea31a324 [runtime] Add helper to get portable IP value 2018-05-11 19:28:28 -04:00
Alexander Kyte 8d2dc95494 [runtime] Make assertion message fetchable 2018-05-11 19:28:28 -04:00
Ankit Jain 93e3dafc38 [msbuild] Bump to track mono-2018-02 branch which tracks vs15.7 (#8596)
* Bump msbuild to track mono-2018-02

.. and track changes in the build scripts.

* [msbuild] Zip test results and log files for surfacing in jenkins (#8523)

(cherry picked from commit 0b8f0d2f83)
2018-05-08 19:25:20 +02:00
Alexander Köplinger 965c939531 Merge pull request #8580 from radical/nuget-hash-updates-2018-02
nuget-hash-extractor: updates
2018-05-05 18:28:50 +02:00
monojenkins 7c317d0af3 [native types] fix nfloat:NaN on arm64 JIT and interp (#8564)
interp: If one of the operands is NaN, we have a default result: It is false (0)
when doing a compare (`ceq_r8`), but must be true (1) on `cne_r8`.

JIT: match behaviour what C# compiler would generate for float/double.
2018-05-04 17:08:21 -07:00
Ankit Jain 6ec37b18d9 nuget-hash-extractor: Add msbuild extensions nuget version from
.. mono-2018-02 branch, which tracks vs15.7:

    Microsoft.NET.Build.Extensions:         2.1.200-preview-62827-05

Version from:
https://github.com/dotnet/cli/blob/b390c9805e6730886129e424f9ce23ee4604266c/build/DependencyVersions.props

None of the assemblies were newer, so none of the lists have any
changes.
2018-05-04 17:34:34 -04:00
Ankit Jain 2a90cd598d nuget-hash-extractor: Add msbuild extensions nuget version from
.. xplat-master msbuild branch.

	Microsoft.NET.Build.Extensions:         2.1.300-preview3-62804-06

Version from:
https://github.com/dotnet/cli/blob/8c937a0db08e56660aca456ac088f2d0e70735ab/build/DependencyVersions.props

None of the assemblies were newer, so none of the lists have any
changes.

(cherry picked from commit 7d68b33343)
2018-05-04 17:11:37 -04:00
Ankit Jain 48fcc7e350 nuget-hash-extractor: Add all option to emit all 3 lists
This is faster than invoking the extractor thrice.

(cherry picked from commit 34d79079d2)
2018-05-04 16:57:07 -04:00
Ankit Jain 90b0ea99cd nuget-hash-extractor: Improvements for better, deterministic output
- Ensure the various lists we emit have unique entries, are sorted to be
deterministic
- Ignore ref assemblies

(cherry picked from commit de7a1ec01b)
2018-05-04 16:57:01 -04:00
Ankit Jain 217d0c7ab7 nuget-hash-extractor: Sort the lists for easier reviews
mcs/tools/xbuild/data/deniedAssembliesList.txt:
	- sorted by name and assembly version
	- This file had one duplicate line
		System.Text.Encoding.CodePages.dll,FD178CD4-EF4F-44D5-9C3F-812B1E25126B,4,0,2,0

mono/metadata/image.c:
	- sorted by hashcode
	- This had one duplicate line
		IGNORED_ASSEMBLY (0xFA686A38, SYS_TEXT_ENC_CODEPAGES, "FD178CD4-EF4F-44D5-9C3F-812B1E25126B", "4.3.0 net46"),

(cherry picked from commit 376050c2bc)
2018-05-04 16:56:48 -04:00
Rolf Bjarne Kvinge 9824e260f5 Only show config.log when running on bots. 2018-04-30 23:20:20 +01:00
Rolf Bjarne Kvinge a085951264 [sdks] Wrap configure to provide better output.
Wrap configure in a script that:

* Captures stdout/stderr and only shows it in case of errors.
* If configure fails, and a cache file was used, deletes the cache file and
  tries again.
* If configure really fails, then print config.log in addition to
  stdout/stderr, since a lot of valuable diagnostic output is in that file
  (and it's annoying to track down configure failures on bots when the file
  with the important output has already been deleted).
2018-04-30 23:20:20 +01:00
monojenkins b4a42e6e4b [sdks] fix $(mktemp) usage on older versions of macOS (#8520)
Context: https://unix.stackexchange.com/questions/30091/fix-or-alternative-for-mktemp-in-os-x

When making the bumps to use the `mono-sdks` upstream in Xamarin.Android,
we were getting build errors such as:

    usage: mktemp [-d] [-q] [-t prefix] [-u] template ... (TaskId:404)

The build bot is running Mavericks (10.9), so it must be an issue with older
versions of macOS.

When reading the Unix StackExchange post, it appears that the `-t` option
without a template should work more reliably on older macOS versions.

Then I tested it locally via `make -C sdks/builds provision-android`.

The command:

    mktemp -d unzip_android_archive_XXXXXXXX

Resulted in paths such as:

    creating: unzip_android_archive_Nt1XzgS5/android-P/

And sure enough, looking into `sdks/builds` it had created a directory in
the working directory, so it isn't using a path inside of `$TMPDIR`.

Changing the command to:

    mktemp -d -t unzip_android_archive_XXXXXXXX

Resulted in paths such as:

    creating: /var/folders/nx/rzr6lcqj6j3_vp7vtp28v2cw0000gn/T/unzip_android_archive_W247QkyW/android-P/

The StackExchange post mentions `-t` is a "prefix" that gets expanded to
`$TMPDIR/{prefix}.XXXXXXXX`, so I think it is better to use this option as
long as it works on all platforms.
2018-04-30 17:24:43 -04:00
Vlad Brezae a0228295dc [2018-02][interp] Backport interp entry changes (#8464)
* [interp] Enter in the interp through a single generic trampoline (#8056)

* [arm] Create trampoline for passing fixed arguments

It is the same as static rgctx trampoline, but it clobbers ARMREG_IP

* [arm] Create trampoline for native to interp transition

* [arm] Add interp entry from trampoline

Tweak CallContext methods to work in opposite direction

* [interp] Create wrapper that saves lmf for m2i transitions

If we want to unwind from interpreter directly into managed code we need to have a wrapper whose purpose is to save the lmf, so we can start unwinding frame by frame.

* [arm] Add unwind info for interp entry trampoline

We need to unwind through this trampoline since it sits between jitted code and the interp lmf wrapper.

* [interp] Let the unwinder unwind through trampolines

These frames are still ignored (by EH and stack walking), they are only used for unwiding further to the caller.

* [interp] Interp entry trampoline for arm64

* [interp] Include lmf wrapper in aot image

* [arm64] Add unwind info for native to interp trampoline

* [arm64] Set correct frame type for trampoline frames
2018-04-26 14:18:11 -04:00
Ludovic Henry 91509419f5 [2018-02] [mini] Don't verify types if you store to a pointer byref. (#8424)
* [mini] Don't verify types if you store to a pointer byref. Workarounds #8403.

* [mini] Add regression test for punting a type system check.
2018-04-24 13:46:29 -04:00
monojenkins 07ba54237d [arm] Fix a regression introduced by: (#8416)
[watch] Align cinfo->stack_usage to 16 on watchos. (#8354)

Fixes https://github.com/mono/mono/issues/8409.
2018-04-24 03:55:48 -04:00
monojenkins 5130d89a0d [watch] Align cinfo->stack_usage to 16 on watchos. (#8376)
Fixes https://github.com/mono/mono/issues/7685.
2018-04-23 12:57:15 -04:00
Ludovic Henry 78740e252b [2018-02] [runtime] Add a signal handler for sigterm (#8383)
* [runtime] Add a signal handler for sigterm

* [runtime] Register sigtramp when merp handler enabled

* [runtime] Limit sigterm handler symbol definition to OSX
2018-04-23 08:49:27 -04:00
monojenkins 0d37a86d2c [sdks] Match more closely the pre-SDKs configure flags passed to LLVM (#8380) 2018-04-20 16:07:37 -04:00
monojenkins 9061f77e7f [System.Net] do not use Thread for SocketTest.TestSelect1 (#8369)
it makes the test less reliable. Potentially helps with
https://github.com/mono/mono/issues/8360
2018-04-20 13:49:00 -04:00
monojenkins 700f316825 Fix mono_perfcounter_instance_exists to match prototype when #ifndef DISABLE_PERFCOUNTERS. (#8335) 2018-04-20 11:24:58 -04:00
Niklas Therning 12d764f5a0 Remove unused signal.h include in interp.c
This include breaks compiling the interpreter on platforms which don't have a
signal.h. The code in interp.c doesn't seem to need it to be included anyway.
2018-04-19 22:55:43 +02:00
monojenkins 638a7ed3b0 [corlib] Disable failing test on XA (#8352)
This follows https://github.com/mono/mono/commit/64ec2dd3eb1309b84819b34c4279d946acacd082.
2018-04-19 15:39:09 -04:00
monojenkins 6c5b8bcc39 [sdks] Fix mktemp parameters (#8324) 2018-04-18 19:20:10 -04:00
monojenkins b1dda64bda [corlib] Fix TimeZoneInfo.Local when /usr/share/zoneinfo is a symlink (#8304)
We'd be using the path verbatim to compare with the resolved value of
/etc/localtime but if it's a symlink (like on OSX 10.13+) the comparison failed.

The fix is to resolve any symlinks for /usr/share/zoneinfo too.

Fixes https://github.com/mono/mono/issues/8267 and https://github.com/xamarin/maccore/issues/628
2018-04-18 21:14:38 +02:00
monojenkins 64ec2dd3eb [corlib] SynchronizationContext does not work on non-root AppDomain on Android (#8296)
AndroidEnvironment.GetDefaultSyncContext just crashes when called on an AppDomain which is not the root AppDomain. This started appearing with the mono:2018-02 integration during which https://github.com/mono/mono/commit/252d61d0558b0bfa3461f3339ce617e2e4c285bb was introduced.

Fixes https://github.com/xamarin/xamarin-android/issues/1561\#issuecomment-381736716
2018-04-18 11:09:24 -04:00
monojenkins 9bbc930d62 [w32file-unix] fix mistake in 8430155946 (#8299)
commit message said
> [w32file-unix] convert nano seconds to microseconds properly, by using
> TICKS_PER_MILLISECOND (which has L suffix in its definition)

first it talks about microseconds, but then uses constant for _milli_
seconds
2018-04-18 13:44:28 +02:00
Rolf Bjarne Kvinge 891c01eb6e [2018-02] [runtime] Add public API to set the pending exception. (#8280)
* [runtime] Add public API to set the pending exception.

Xamarin.iOS and Xamarin.Mac need a public API to set the pending exception
when converting Objective-C exceptions to managed exceptions.

This adds a public API to support this scenario.

Partially fixes https://bugzilla.xamarin.com/show_bug.cgi?id=60065.

* [runtime] Document that pending exceptions should not be overwritten when the runtime is handling a thread abort request.
2018-04-17 22:31:41 -04:00
Marek Safar e03516d11f [mcs] Implements C# 7 digits separators 2018-04-18 03:08:17 +02:00
monojenkins 4a00c501b2 [2018-02] Harden JIT job control against cctors deadlocking. (#8235)
* [mini] Don't wait for other threads to finish JITing if the current thread is running a cctor.

This eliminates a possible source of deadlocks found during AOT runs of Roslyn.

* [mini] Introduce a 1s timeout to JIT job control to ensure we don't simply deadlock in case of execution dependency bugs.

* [mini] fix spelling5DD
2018-04-15 13:26:13 -04:00
monojenkins 34b31f05f5 [2018-02] Fix timestamp for file copy (#8247)
* [FileTest] regression for https://github.com/xamarin/xamarin-macios/issues/3929

* [w32file-unix] fix File.Copy timestamps

4a8d840d6f introduced that the destination
file of a copy operation has the same modification and access timestamps
as the source file.

With e0e185d70a this behaviour regresses,
since getting timestamps provides more precise information. Fixing this
by being more accurate when applying timestamps to destination file.

* [w32file-unix] convert nano seconds to microseconds properly, by using TICKS_PER_MILLISECOND (which has L suffix in its definition)

* [w32file-unix] introduce constant for ns->qs conversion with proper suffix

fixes problem on 32bit.
2018-04-15 13:24:29 -04:00
monojenkins 8e08947e1c [sdks] Fix typo + Fix verbosity of unzip-android-archive.sh (#8243) 2018-04-13 19:37:04 -04:00
Ludovic Henry d96186b5e8 [w32handle] Lower minimum memory usage (2nd attempt) (#8154)
Adopts a linked list of MonoW32HandleSlot (based on feedback from Rolf Kvinge). This allows for an unlimited amount of handles to be allocated, as well as for a lower cost to allocate only 1 handle across the process.

Fixes https://github.com/mono/mono/issues/7460
2018-04-13 18:15:07 -04:00
monojenkins 763e7f9d78 [system.net] disable some tests to unblock XI integration (#8205)
regression tracked here: https://github.com/xamarin/xamarin-macios/issues/3827
2018-04-12 21:59:31 -04:00
Rolf Bjarne Kvinge 35cb6bda95 [System.Net.Http] Use '*' as the host instead of '+' in the tests. Fixes xamarin/maccore#673.
Use '*' as the host instead of '+' in the tests.

The behavior should be the same, just faster, because '+' will fail to resolve
("Could not resolve host '+'"), and we'll fall back to the same behavior as
'*': https://github.com/mono/mono/blob/5128cce2dcd097aa4e7b86dd3b56e833c15a9ff0/mcs/class/System/System.Net/EndPointManager.cs#L83-L96

The problem arises when failing to resolve '+' takes a long time: on some of
our bots it takes 5-10 seconds. This adds up quickly since the tests try many
times, effectively increasing a test run from 1-2 seconds to 30+ minutes.

Fixes https://github.com/xamarin/maccore/issues/673.
2018-04-12 17:48:55 +02:00
Aleksey Kliger 61da4c7a5f [eglib] GMarkup: allow all ASCII NameStartChar and NameChar except ':'
Follow https://www.w3.org/TR/xml/#sec-common-syn except don't allow ':' and
non-ASCII.

Element and attribute names must start with a letter or '_'.
Element and attribute names may contain letters, numbers, '.', '-', '_'.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=19436
2018-04-12 01:25:44 +02:00
monojenkins 2710e67296 [sdks] Add ANDROID_BUILD_TOOLS_DIR to differentiate it from ANDROID_BUILD_TOOLS_VERSION (#8192) 2018-04-11 19:10:21 -04:00
monojenkins dbf27d49ad [sdks] Fix typo (#8187) 2018-04-11 18:18:23 -04:00
Ludovic Henry 02390a7414 [sdks] Fix build (#8183) 2018-04-11 15:34:38 -04:00
Marek Safar cea4294912 [corlib] Make more crypto oids work on mobile profiles when not linked out 2018-04-11 17:14:21 +02:00
Marek Safar 9e7efad7be [mcs] Fixes parameter check for interface types used with default parameters 2018-04-11 11:04:20 +02:00
Zoltan Varga d0562a9e6f [sdks] Add support for building llvm unless the USE_PREBUILT_LLVM Make.config var is set. (#8017) (#8150)
* [sdks] Add support for building llvm unless the USE_PREBUILT_LLVM Make.config var is set.

* [sdks] Use prebuilt llvm binaries on ios CI.

* [sdks] Use the IGNORE_PACKAGE_LLVM variable to enable the building of llvm.
2018-04-10 15:26:31 -04:00
Alexander Köplinger 887d3ad27e [System] Don't use http://www.mono-project.com for test (#8147)
When we tried switching mono-project.com to enforce HTTPS these tests
started failing on systems without working SSL configuration.

Use a different domain which is guaranteed to be available over HTTP instead.

(cherry picked from commit a748bad303)
2018-04-10 15:07:25 +02:00
Marek Safar 363790b1ec [corlib] Implements CryptoConfig::AddAlgorithm on all profiles 2018-04-10 11:17:49 +02:00
monojenkins bf838da659 [w32file] Fix memory leak (#8114)
Fixes https://github.com/mono/mono/issues/7655
2018-04-10 02:43:20 +02:00
monojenkins c530c5182f [2018-02] Implement C#7 binary literals (#8119)
* C# 7.0 binary literal support

* [mcs] Add another negative error test
2018-04-10 02:41:59 +02:00
monojenkins e310966925 [2018-02] [Facades] Add System.Drawing.Common on mobile only (#8128)
* [Facades] Add System.Drawing.Common on mobile only

Fixes https://github.com/mono/mono/issues/8089

* Bump API snapshot submodule
2018-04-10 02:36:09 +02:00
Marek Safar 5c2ab44dec [mcs] Adds private protected modifier to the parser only 2018-04-09 19:38:59 +02:00
monojenkins 0fac09cf89 [sdks] Fix arguments passed to llvm on Linux (#8109) 2018-04-09 08:48:01 -04:00
monojenkins 02d69477dd [mcs] Fixes codegen when probing reference type expression is known to pass and pattern variable has to be created (#8085) 2018-04-07 22:23:10 -04:00
Bernhard Urban 54f51bf701 [interp] use same domain as transform phase to register debug data for a method 2018-04-06 19:58:38 -04:00
monojenkins 0ca09346e3 [SDKS] fix Linux (and possibly other OSes) build for Android (#8044)
OS: Ubuntu 18.03
CMake: 3.10

For some reason cmake fails to detect any make program (be it ninja or make)
when cross-compiling for Android in XA. It happens despite the programs being in
$PATH and working correctly. The effect is that CMAKE_MAKE_PROGRAM is set to
"not found" in CMakeCache.txt and configuration fails as follows:

 Call Stack (most recent call first):
   external/mono/external/boringssl/util/android-cmake/android.toolchain.cmake:1140 (CMAKE_FORCE_CXX_COMPILER)
   external/mono/sdks/builds/android-armeabi-v7a-debug/mono/btls/build-shared/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include)
      CMakeLists.txt:3 (project)
   CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
      -- Configuring incomplete, errors occurred!

This commit does not fix the issue, per se, but it works around it by finding
the first ninja/make (as configured) executable in $PATH and setting the
CMAKE_MAKE_PROGRAM to full path of the executable. I haven't spent too much time
investigating *why* cmake fails to find the executable (I merely ran it with
--trace-expand --debug-output which revealed nothing of consequence) but this
workaround should be safe for any version of CMake and any OS we use makefiles
on.
2018-04-06 16:16:08 -04:00
Marek Safar f5989de3b4 [mcs] Implements C# 7.2 stackalloc span conversion in conditional expression 2018-04-06 20:58:53 +02:00
Bernhard Urban 8ad8623646 [interp] workaround undefined behaviour in r8 to u1 cast
This fixes `test_0_simple_double_casts` on iOS/arm64.
According to the C standard (section [conv.fpint]), the behaviour of
such a cast is undefined if the truncated value doesn't fit into the
destination type.

```c
unsigned char __attribute__ ((noinline)) convr8u1 (double i)
{
        return (unsigned char) i;
}
```

for arm64, `clang -O0` produces:

```
_convr8u1:
100006848:  ff 43 00 d1     sub sp, sp, #16
10000684c:  e0 07 00 fd     str d0, [sp, #8]
100006850:  e0 07 40 fd     ldr d0, [sp, #8]
100006854:  08 00 78 1e     fcvtzs  w8, d0
100006858:  00 1d 00 53     uxtb    w0, w8
10000685c:  ff 43 00 91     add sp, sp, #16
100006860:  c0 03 5f d6     ret
```

while `clang -O2` produces:

```
_convr8u1:
100006ae8:  00 00 78 1e     fcvtzs  w0, d0
100006aec:  c0 03 5f d6     ret
```

which is fine according the standard: Any value < 256 gets casted just
fine, but for example `convr8u1 ((double) 0xffff)` would end up with
`0xffff` in `w0`.

We workaround this behaviour by casting to a 32bit int first, the
resulting code looks like this then:

```
_convr8u1:
100006ae4:  08 00 78 1e     fcvtzs  w8, d0
100006ae8:  00 1d 00 12     and w0, w8, #0xff
100006aec:  c0 03 5f d6     ret
```
2018-04-06 08:25:35 -04:00
Zoltan Varga 19cc4c427a [runtime] Fix --disable-btls. 2018-04-06 11:45:19 +02:00
Marek Safar e88bfbcbce [mcs] Implements C# 7.2 conditional ref expression 2018-04-06 08:19:56 +02:00
monojenkins 7048fb45ab [sdks] Use wget in place of curl, it's installed by default on Linux (#8058)
[2018-02] [sdks] Use wget in place of curl, it's installed by default on Linux
2018-04-05 19:23:00 -04:00
Martin Baulig 2c564f83f2 [System]Fix memory leak in the web stack related to Task.Delay (partial fix of #7356).
Using `Task.Delay (timeout)` has the potential of possibly allocating and holding large
chunks of memory throughout the timeout period.  While this is not strictly speaking a
memory leak because those objects will eventually be disposed and garbage collected, it
can cause memory usage of apps to grow quite significantly in the short run.

The default timeout values are as follows:

* `HttpWebRequest.ReadWriteTimeout`: 5 minutes.

* `HttpWebRequest.Timeout`: 100 seconds.

* `ServicePointManager.MaxServicePointIdleTime`: 100 seconds.

And these values can be increased by the user.  This means that we're potentially holding
hundreds, maybe even thousands of timeout objects in memory for 5+ minutes.

This has now been fixed by using the `Task.Delay(int,CancellationToken)` constructor.

Note that disposing a `CancellationTokenSource` will not cancel it, so the following code
will still leak:

	using (var cts = new CancellationTokenSource ()) {
		Task.Delay (TimeSpan.FromDays (3), cts.Token);
		// Work
	}

To actually make the `Task.Delay` instance go away when we're done with it, we need to
use this pattern:

	var cts = new CancellationTokenSource ();
	try {
		Task.Delay (TimeSpan.FromDays (3), cts.Token);
		// Work
	} finally {
		cts.Cancel ();
		cts.Dispose ();
	}

We also cannot use `CancellationToken.CancelAfter()` for timeouts because unfortunately
some of the underlying framework code that we're using does not honor cancellation
requests - like for instance `NetworkStream`.

This is a partial fix for #7356.  While this commit significantly improves the problem,
there may be other unrelated issues left that needs to be investigated.
2018-04-05 14:05:57 -04:00
monojenkins 3c52f0a4a9 [SDKS] Fix Android SDK build on Linux (#8023)
Current build uses `tar` to extract ZIP archives. This works with BSD
tar but not with GNU tar, alas. Tar was used in order to strip the root
directory of Android archive while moving files into place. This commit
replaces `tar` with a call to a shell script (because doing what it does
using Make defines is an exercise in pain) which works both on macOS/BSD
and on Linux.
2018-04-05 11:38:56 -04:00
Bernhard Urban c5f99aa4dc [interp] do not bake object reference into code stream
it won't be scanned by the GC, defer string allocation to
execution-time instead.
2018-04-05 17:33:02 +02:00
monojenkins 1e35db0ae2 [interp] fix i4<>i8 conversion for builtin types, it was inverted (#7986) 2018-04-04 18:23:13 -04:00
monojenkins 88f5058a33 [sdks] Fix MXE_PREFIX for XA (#8010)
It should take 7 characters from the hash, not 6.
2018-04-04 15:28:58 -04:00
monojenkins 0d5eb5c9bb [sdb] Add reference counting for single step requests, they can be accessed concurrently by the single step processing code and the event request clearing code. Fixes #7137. (#7972) 2018-04-04 13:38:43 -04:00
Ludovic Henry 723f194cdc [2018-02] [sdks] Add provisioning for Android SDK and NDK (#7979)
* [sdks] Add provisioning for Android SDK and NDK

This will also be used by XA

* Add missing backslash to mxe.mk

* Only grab bin/autopoint

* [sdks] Use provisioning for MXE

We want to treat MXE the same way we do Android SDK and NDK because it only rarely changes, and it's very long to build it.
2018-04-04 13:48:52 +02:00
monojenkins a5e4482376 [System] Disable SocketTest.AcceptBlockingStatus (#7977)
It frequently fails on ARM: https://github.com/mono/mono/issues/6513
2018-04-04 03:06:36 +02:00
monojenkins 95cc49a65c [2018-02] [Facades] Add System.Memory facade to mobile profiles (#7967)
* [Facades] Add System.Memory facade to mobile profiles

Contains only the types we have right now.

Fixes https://github.com/mono/mono/issues/7610

* Bump API snapshot submodule
2018-04-03 18:56:17 +02:00
Zoltan Varga dea448aa83 Disable building btls/ and support/ on the bcl build, they are not needed. 2018-04-03 14:13:44 +02:00
Zoltan Varga 21cef8b793 [runtime] Add a --disable-btl-lib configure option to disable the building of the btls lib, but compile the managed code with btls support. 2018-04-03 14:13:44 +02:00
Bernhard Urban 0ba54d6bdd [ppc] use ucontext_t
`struct ucontext` has been removed from glibc and `ucontext_t` has been
around for a while now.

Fixes a build failure on Ubuntu 18.04

Related glibc change
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=251287734e89a52da3db682a8241eb6bccc050c9;hp=c86ed71d633c22d6f638576f7660c52a5f783d66
2018-04-02 21:55:17 -04:00
Rodrigo Kumpera c3e00ab9bc [runtime] Add regression test for nested famility visibility. 2018-03-31 23:54:55 +02:00
Rodrigo Kumpera 30b5b2b188 [runtime] Fix class visibility check for protected nested classes. Fixes #7657.
A nested class that has protected access must be checked using the same inheritance based rules as members.
The existing code ignores that and does a plain visibility check that is only amendable for public/internal nested types.
2018-03-31 23:54:55 +02:00
monojenkins 29adf3012f Bump API snapshot submodule 2018-03-30 13:42:46 +02:00
Marek Safar d6fde73640 [corlib] Update linker descriptor with missing types 2018-03-30 13:42:46 +02:00
Marek Safar 572c33ae18 [corlib] Enable machine.config dependant version of CryptoConfig for net_4_x profile only 2018-03-30 13:42:46 +02:00
Bernhard Urban dcdd956e1b [perfcounters] fix alignment issue on 32bit
clang fails to properly align 64bit members of the `MonoPerfCounters` struct on
32bit builds:

```
* thread #1, name = 'tid_403', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_ARM_DA_ALIGN, address=0x16933124)
    frame #0: 0x0066f4b2 mini`mono_atomic_cas_i64(dest=0x16933124, exch=<unavailable>, comp=<unavailable>) at atomic.c:519 [opt]
   516 	gint64
   517 	mono_atomic_cas_i64(volatile gint64 *dest, gint64 exch, gint64 comp)
   518 	{
-> 519 		return  __sync_val_compare_and_swap (dest, comp, exch);
   520 	}
   521
   522 	#elif defined (TARGET_ANDROID)
(lldb) up
frame #1: 0x006292ea mini`ves_icall_System_Threading_ThreadPool_NotifyWorkItemQueued [inlined] mono_atomic_inc_i64 at atomic.h:397 [opt]
   394 		do {
   395 			get = *val;
   396 			set = get + 1;
-> 397 		} while (mono_atomic_cas_i64 (val, set, get) != get);
   398 		return set;
   399 	}
   400
(lldb) up
frame #2: 0x006292d6 mini`ves_icall_System_Threading_ThreadPool_NotifyWorkItemQueued at threadpool.c:743 [opt]
   740 	ves_icall_System_Threading_ThreadPool_NotifyWorkItemQueued (void)
   741 	{
   742 	#ifndef DISABLE_PERFCOUNTERS
-> 743 		mono_atomic_inc_i64 (&mono_perfcounters->threadpool_workitems);
   744 	#endif
   745 	}
   746
```

Note that the member `threadpool_workitems` is on an unnatural alignment
(`0x16933124`) regarding to its type `gint64`.

related https://github.com/xamarin/xamarin-macios/issues/3826
2018-03-30 05:05:07 -04:00
monojenkins 811e3b4dcd [sdks] Fix LLVM build for XA (#7919) 2018-03-29 20:48:45 -04:00
monojenkins 25aba4e86e [2018-02] [sdks] Fix LLVM build on Linux for XA + Fix MXE usage on non-Darwin platforms (#7912)
* [sdks] Fix LLVM build on Linux for XA

* [sdks] Fix MXE usage on non-Darwin platforms
2018-03-29 13:06:52 -04:00
monojenkins ae7f365c06 [sdks] Fix usage of MXE for XA (#7898) 2018-03-28 22:05:25 -04:00
monojenkins cda8574a88 [jit] Add signature checking for CALLI. (#7880)
Fixes #7792.
2018-03-28 21:45:47 -04:00
monojenkins a6b0e1ccbe [2018-02] [sdks] Pass LLVM_SRC from XA to use xamarin-android/external/llvm + Pass IGNORE_PACKAGE_MXE from XA + Only checkout specific MXE and LLVM commit when cloning (#7895)
* [sdks] Pass LLVM_SRC from XA to use `xamarin-android/external/llvm`

We do not clone to `$(LLVM_SRC)` because this is up to XA.

* [sdks] Pass IGNORE_PACKAGE_MXE from XA

This is to avoid rebuilding MXE while XA already took care of it.

* [sdks] Only checkout specific MXE and LLVM commit when cloning
2018-03-28 21:44:19 -04:00
monojenkins 7ee378c904 [sdks] Pass MXE_SRC from XA to use xamarin-android/external/mxe (#7890)
We do not clone to or remove `$(MXE_SRC)` because this is up to XA.
2018-03-28 18:27:28 -04:00
monojenkins 511ca9f507 Whitelist illinkanalyzer in macOS package (#7862)
Fixes #7860
2018-03-28 15:09:39 +02:00
Alexis Christoforides 88b5266376 Merge pull request #7851 from monojenkins/backport-pr-7849-to-2018-02
[2018-02] [corlib] Restores ConcurrentDictionary serialization support.
2018-03-27 17:30:12 -04:00
Ankit Jain 4aa9fd41b8 [msbuild] Bump to pick up updates (#7846) 2018-03-27 21:04:54 +02:00
Marek Safar 4bf541a969 [System] Makes TLS providers linker friendly 2018-03-27 19:26:04 +02:00
Bernhard Urban b250b4a657 [2018-02] [sdk] sync ios and android changes from master into 2018-02 (#7831)
* [sdks] Add targets for the watch cross compiler. (#7061)

* [offsets-tool] Add an '--output' argument to specify the output file directly instead of generating it from the target triple.

* [sdks] Add targets for the watch cross compiler.

* Ios sdk changes (#7258)

* [sdks] Add armv7s device build.

* [sdks] Disable dtrace on the cross compiler builds.

* [sdks] Avoid building mono-dtrace.h for the cross compilers, its not needed anymore.

* [sdks] Add a configure-mono target.

* [sdks] Put back the call to CheckXcodeDir.

* [sdks] Enable ccache if possible.

* [sdks] Generalize iosDeviceTemplate so it can build the tvos runtime as well. Add tvos device build.

* [sdks] Add tv simulator build.

* [sdks] Add watch simulator build.

* [sdks] Add watch device build.

* [sdks] Unify targets to build runtimes (#7394)

* [sdks] Move common targets

* [sdks] Have RELEASE be empty when CONFIGURATION != 'release'

* [sdks] Create common runtime compilation template

* [sdks] Use runtime template for Android

* [sdks] Use runtime template for iOS

* [sdks] IOS fixes. (#7617)

* [sdks] Fix ios build.

* [sdks] Pass -DMONOTOUCH to the ios cross compiler builds. Compile monotouch/tvos/watchos profiles for the bcl build.

* [sdk] missing diffs for ios and android

* [ci] sync run-jenkins.sh regarding sdks android

* [ci] remove package-android-host-Linux
2018-03-27 09:36:26 -04:00
Marek Safar 6c324b91b2 [corlib] Restores ConcurrentDictionary serialization support.
Fixes #7822
2018-03-27 12:59:14 +00:00
Ludovic Henry 77fc4cfa2e Remove suspicious mono_gchandle_free
Fixes https://github.com/mono/mono/issues/7786
2018-03-26 17:58:56 +02:00
Bernhard Urban 3984508a04 [icall] remove DISABLE_PROCESS_HANDLING (#7827)
The only user was Xamarin.iOS in a weird way: The define is only set for
device builds where the icall table is excluded anyway. For the cross
compiler however, the define isn't set, and therefore those icalls can
be resolved by the AOT compiler.

With the interpreter now, this define actually had an effect: The
guarded icalls weren't inclueded in `libmono-icall-table.a`.
2018-03-26 10:25:48 -04:00
monojenkins 67a2468db9 support increment and decrement of nint/nuint (#7790)
update definition to be in sync with XI
2018-03-25 23:13:01 -04:00
monojenkins da0e172ae5 improve error message and add another interp_in signature (#7789) 2018-03-25 23:12:45 -04:00
Zoltan Varga 1c9d8aad07 [sdks] Fix the ios sdk build. (#7801) (#7824) 2018-03-25 19:06:32 -04:00
monojenkins c6fc176f5c Fix Android build for toolchain (#7818) 2018-03-23 21:20:44 -04:00
monojenkins c9bf7a3878 Disable the interpreter on ios device builds. (#7795) 2018-03-23 14:22:50 -04:00
Marek Safar d37075a949 [System] Disable a test file to resolve compilation error 2018-03-23 14:08:19 +01:00
Marek Safar 42fc0bd51f Bump corefx to bring a fix for #7696 2018-03-23 14:08:19 +01:00
monojenkins 2487301faf Fix Android build for mxe (#7782) 2018-03-22 20:49:43 -04:00
Ludovic Henry 0d6be4da5e [sdks] Fix Android build on Linux (#7777) 2018-03-22 18:40:22 -04:00
monojenkins ebbed2bb87 Revert "Swap Close/Dispose calls so that the receiver_thread_main loop will be properly interrupted (#7390)" (#7751)
This reverts commit e7ba41d14c.
2018-03-22 17:51:57 -04:00
monojenkins e5bad88ebb Fix Android build (#7769) 2018-03-22 16:55:46 -04:00
Martin Baulig 238c21cf77 Fix a race condition that was exposed by #7358 (see #7668).
The latest `WebCompletionSource<T>` changes (PR #7358) exposed and
intensified the side-effects of a race condition between `WebOperation`
and `ServicePointScheduler`.

* WebCompletionSource<T> now contains new `CurrentResult` and `CurrentStatus`
  properties, which allow completion status to be checked in a non-blocking way.

* WebOperation.CompleteResponseRead() has been renamed into Finish() and
  contains the continuation that was previouly known as FinishReading().
  Calling this new Finish() method will now complete the `finishedTask`
  completion, which has a new accessor called `Finished`.

* The ServicePointScheduler's main-loop is still woken up by completion of
  `WebOperation.Finished.Task`, but we use the new `CurrentResult` property
  to check state in a non-blocking way.  This ensures the the clean-up and
  bookkeeping work that's necessary after `WebCompletion.Finish()` always
  happens prior to starting new connections.
2018-03-22 19:40:02 +01:00
Alexander Kyte 2fbd5a16a3 [runtime] Fix file handle leak with dedup+aot (#7721) 2018-03-21 16:01:47 -04:00
monojenkins a13c12ac99 [2018-02] [loader] Don't load framework Facade assemblies that are older than expected. (#7708)
* Don't load framework Facade assemblies that are older than expected.

If there is an older framework Facade assembly in the search order before the
one that we want, don't load it.

"older" here means just compare the major components of the version.

Fixes https://github.com/mono/mono/issues/7624
2018-03-21 11:47:37 -04:00
Alexis Christoforides bdf405fae4 Merge pull request #7726 from mono/backport-new-boottime-2018-02
Backport new boottime
2018-03-21 11:12:00 -04:00
Zoltan Varga ce612bb49e Fix partially shared constrained calls in llvmonly mode.
Fixes https://github.com/mono/mono/issues/7535.
2018-03-21 12:55:55 +01:00
Zoltan Varga 0a3d40ac60 Avoid aot-ing the bcl libs twice in make fullaotcheck/llvmonlycheck. 2018-03-21 12:55:55 +01:00
Bernhard Urban c17d8c6dcd remove WildcardConnect () on WatchOS 2018-03-21 10:39:49 +01:00
Alexis Christoforides 07d5a031d4 [runtime] Don't use clock_gettime on WatchOS and tvOS. 2018-03-20 18:35:18 -04:00
Alexis Christoforides ff546b9d8b [runtime] Don't use clock_gettime in MacOS.
Even though it's found during configure when targetting 10.7, it's not "really" available before versions 10.12 and it would crash with "lazy symbol binding failed".
2018-03-20 18:35:16 -04:00
Zoltan Varga 9922d1af20 [runtime] Fix mono_msec_boottime () so it compiles on older ios versions, clock_gettime () is only available from ios 10. (#7671) 2018-03-20 18:35:01 -04:00
Alexis Christoforides 875240538e [mono-time] Replace mono_msec_boottime() with CoreCLR implementation. Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58413 2018-03-20 18:32:45 -04:00
monojenkins e29f146ab3 [2018-02] [sgen] Use current nursery size when computing allowance (#7648)
* Use current nursery size when computing allowance

The allowance is the minimum heap growth that we allow between two majors (which is 4 * nursery_size). We need to use the current nursery size instead of the 4MB default, in order to facilitate low memory uses.

* Account for soft heap limit in allowance calculation

This is relevant in cases where the nursery size and soft heap limit are comparable in size.
2018-03-20 15:07:50 -04:00
Marek Safar 535bfc5d84 Add csc-dim as a prototype if default interface implementation 2018-03-20 17:46:56 +01:00
Ludovic Henry 5b66de0bf0 [2018-02] [sdks] Fix concurrent building of MonoAotOffsetsDumper.exe + Simplify building of support library (#7688)
* [sdks] Simply building of support library

* [sdks] Fix ios targets

* [sdks] Cleanup of some targets
2018-03-20 10:14:59 -04:00
Ankit Jain a6c7b9eca4 [msbuild] Bump msbuild to pick up fix for issue #7184 (#7666)
MSBuild always recompiles project if it has a resx with a windows path.
https://github.com/mono/mono/issues/7184
2018-03-20 13:59:27 +01:00
Bernhard Urban 3577465fcd add LL suffix to constant in order to prevent overflowing on 32bit systems 2018-03-20 06:45:12 -04:00
Bernhard Urban 7d9e106c03 1000ns = 1us and 1us = 10ticks 2018-03-20 06:45:12 -04:00
Bernhard Urban 3931767dca reduce compiler warnings 2018-03-20 06:45:12 -04:00
Bernhard Urban deb3474e7c add regression test for github issue 7646 2018-03-20 06:45:12 -04:00
Bernhard Urban 27c7a4b01e use utimes if available in order to set subsecond information on access and write time 2018-03-20 06:45:12 -04:00
Bernhard Urban da5b39d785 factor setfiletime 2018-03-20 06:45:12 -04:00
Bernhard Urban 7f69ff87b5 use CONVERT_BASE in more places 2018-03-20 06:45:12 -04:00
Bernhard Urban e33bf27c9a replace SECMULT with TICKS_PER_SECOND 2018-03-20 06:45:12 -04:00
Bernhard Urban 79030a3284 remove unused mono_w32file_get_times () 2018-03-20 06:45:12 -04:00
Alexis Christoforides e74d4a6e31 Merge pull request #7686 from mono/backport-gh-7584
[System.Net] Replace use of obsolete `SupportsIPv6` property.
2018-03-19 23:02:01 -04:00
Alexis Christoforides c2fe39f13e Revert "Replace mono_msec_boottime() with CoreCLR implementation. Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58413"
This reverts commit cb89a1575c.

The commit breaks iOS and needs testing on earlier MacOS versions.
2018-03-19 22:58:50 -04:00
Alexis Christoforides 0d8de253cb [System.Net] Replace use of obsolete SupportsIPv6 property.
The obsolete property was always set to false. Fixes https://github.com/mono/mono/issues/6940
2018-03-19 11:53:23 -04:00
Zoltan Varga e9c512092d Increase the buffer size in emit_exception_debug_info ().
Fixes https://github.com/mono/mono/issues/7637.
2018-03-16 13:10:57 +01:00
monojenkins 08a7043b66 [2018-02] [System]: Introduce WebCompletionSource\u003cT\u003e and use it in WebOperation. (#7641)
* Introduce `WebCompletionSource<T>` and use it in `WebOperation`.

* Fix issue in ServicePointScheduler with collection being modified in foreach.

* Update WebOperation.cs

* Work around mcs limitations.

* Use TaskCreationOptions.RunContinuationsAsynchronously in WebCompletionSource.

* Add the test from #7355.

* Put back the 'foreach' loop in ServicePointScheduler.

With the WebCompletionSource changes, this should no longer cause
any problems.
2018-03-16 13:10:31 +01:00
Alexis Christoforides cb89a1575c Replace mono_msec_boottime() with CoreCLR implementation. Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58413 2018-03-15 18:25:58 +01:00
Rodrigo Kumpera 1a0508a58c Handle multiple segments in IsolatedStored::GetFileNames. Fixes bxc #11771 2018-03-15 11:16:27 +01:00
Zoltan Varga d67d75a4f3 Disable delegate-15.exe in the full-aot profile. 2018-03-14 22:32:37 +01:00
Zoltan Varga 6036b45bce Avoid calling mono_class_vtable () for open constructed types. 2018-03-14 22:32:37 +01:00
Bernhard Urban 9136f4c1a0 only target macOS, HOST_DARWIN includes iOS etc. as well 2018-03-14 09:14:04 +01:00
monojenkins abb82546d7 [2018-02] [Facades] Make System.Net.Http.Rtc.dll a net_4_x only facade (#7595)
Backport of #7590.
2018-03-14 00:10:17 +01:00
Alexander Kyte 6af13f6e83 Add icall to configure MERP options / enable it 2018-03-13 11:30:33 +01:00
Alexander Kyte c684567bd7 Add optional Microsoft Telemetry unmanaged dumper 2018-03-13 11:30:33 +01:00
Marek Safar 4ab5e8a495 Update source file location from commit d4816ef1ab 2018-03-13 08:49:13 +01:00
monojenkins ed56e90aca [2018-02] [Facades] Add missing Facades that exist in .NET 4.7.1 (#7551)
* Add missing Facades that exist in .NET 4.7.1

Some of them we had on mobile only, others were missing completely.

Fixes https://github.com/mono/mono/issues/7536

* Bump API snapshot submodule
2018-03-12 13:26:16 +01:00
Zoltan Varga 57e18b15d0 [sgen] Fix the clearing of bits in the gc descriptor bitmap when using weak fields. Fixes #7378. 2018-03-12 09:15:07 +01:00
monojenkins 279d7e230f [2018-02] [threads] Fix race between abort socket syscall and thread shutdown (#7521)
* Fix race between abort socket syscall and thread shutdown

The race happens when we call mono_thread_info_abort_socket_sycall_for_close on
a thread that's about to shut down.

We lookup the MonoThreadInfo for that thread outside the
mono_thread_info_suspend_lock, and then use it to send the signal once we've
taken the lock.

In between those two actions, the other thread already finished
unregister_thread and pthreads may already have destroyed its TLS keys and
otherwise started to dismantle the thread.

The fix is to do a second mono_thread_info_lookup once we have the lock and
only signal the other thread if it still around.

Fixes https://github.com/mono/mono/issues/6998

* Simplify mono_thread_info_abort_socket_syscall_for_close

Call mono_thread_info_lookup while holding the thread info suspend lock.
We no longer need to check for STATE_DETACHED because removing MonoThreadInfo on
detach is done while holding the suspend lock.
2018-03-09 17:54:16 -05:00
Zoltan Varga 2ce1d5f3d5 Comment/stub out some unused icalls to prevent problems with AOT. 2018-03-09 16:36:55 +01:00
Alexander Köplinger 668baf1915 [acceptance-tests] Actually disable gcsuppressfinalize.exe test
d1ed53624b wasn't enough, it needs to be removed from the CORECLR_COREMANGLIB_TEST_CS_SRC list.

(cherry picked from commit 85b605042b)
2018-03-09 14:36:59 +01:00
Martin Baulig 2201952d9a WebRequestStream now throws correct exception on cancellation (#7074). 2018-03-09 13:42:35 +01:00
Alexis Christoforides 4d3e9d53b2 Fix resolution of interfaces in classes implementing IEnumerator. Fixes #59400
Assume a class implementing multiple generic I`1 interfaces. If a virtual call invocation is trying to resolve the correct interface using object O implementing I`1 also , the interface is resolved using a set of rules (not fully implemented in Mono), but a requirement is that the chosen interface is "variant-compatible" with object O, that is its generic parameters are set to the same types.

This last requirement is relaxed as an implementation-specific detail when I`1 is IEnumerator`1, in which case e.g. a virtual call on a class implementing IEnumerator<byte> can happen with an object of type IEnumerator<sbyte> by way of sharing IEnumerator`1 as a generic interface they define. Here, clearly the interfaces are not "variant-compatible", and this is allowed.

Resolution of classes implementing IEnumerator should still attempt to select a compatible interface using the standard rules before attempting to apply this special rule.
2018-03-09 13:41:14 +01:00
monojenkins 2476d2ac06 Move the check for open constructed types later in mono_jit_compile_method_with_opt (), this function can receive gshared methods in llvmonly mode. (#7504)
Fixes https://github.com/mono/mono/issues/7364.
2018-03-08 19:08:17 -05:00
monojenkins 91fe1eb5f5 Fix generated file when passing --bundled-header (#7510)
There would be a compilation error in the XA build as follow:

```
obj/Release/bundles/armeabi-v7a/temp.c: In function 'install_aot_modules':
obj/Release/bundles/armeabi-v7a/temp.c:49:25: error: 'MONO_AOT_MODE_NORMAL' undeclared (first use in this function)
  mono_jit_set_aot_mode (MONO_AOT_MODE_NORMAL);
                         ^
obj/Release/bundles/armeabi-v7a/temp.c:49:25: note: each undeclared identifier is reported only once for each function it appears in
```
2018-03-08 17:23:34 -05:00
Ludovic Henry bb0c123e74 Use runtime template for iOS 2018-03-08 14:28:51 +01:00
Ludovic Henry e965e1647d Use runtime template for Android 2018-03-08 14:28:51 +01:00
Ludovic Henry a652297384 Create common runtime compilation template 2018-03-08 14:28:51 +01:00
Ludovic Henry 685d39238a Have RELEASE be empty when CONFIGURATION != 'release' 2018-03-08 14:28:51 +01:00
Ludovic Henry 3648ace2b9 Move common targets 2018-03-08 14:28:51 +01:00
Aleksey Kliger b62bfdcb55 An array is not an IEnumerator`1
Address https://github.com/mono/mono/issues/7093 in kind of an adhoc way.

The correct fix is to make
```
    ((IEnumerable<U>) (new T[] {...})).GetEnumerator()
```
return an `IEnumerator<U>` (like .NET does) instead of `IEnumerator<T>`
and to stop marking IEnumerator as an array special interface.
2018-03-08 10:51:22 +01:00
Aleksey Kliger 9f2841c3a0 An array is not an IEnumerator`1
regression test for Regression test for https://github.com/mono/mono/issues/7093
2018-03-08 10:51:22 +01:00
Aleksey Kliger 6f90188e9f Add IEnumerator`1 to MonoDefaults struct 2018-03-08 10:51:22 +01:00
Marek Safar 84027bddaa Remove compiler config sections for types which cannot be instantiated
Fixes #7389
2018-03-08 10:32:14 +01:00
Sebastien Lebreton 66f19a974a Swap Close/Dispose calls so that the receiver_thread_main loop will be properly interrupted 2018-03-07 16:03:44 +01:00
monojenkins 99b7f59ddc [2018-02] Fix for gcc 4.4; nominal support for older. (#7435)
Backport of #7419.
2018-03-07 00:50:43 +01:00
Marek Safar f28abdbebd Fixes decoding of CMS/PKCS #7 messages with an explicit cryptographic object identifier 2018-03-06 15:53:36 +01:00
Rolf Bjarne Kvinge 2dc56b5a60 [2018-02] [corlib] Ignore TimeZoneTest.TestCtors on iOS under certain conditions due to an Apple bug. (#7428)
Fixes https://github.com/xamarin/maccore/issues/629.
2018-03-06 14:31:38 +01:00
Alexander Köplinger 58d02a9603 [acceptance-tests] Disable gcsuppressfinalize.exe test that started failing
See https://github.com/mono/mono/issues/7432

(cherry picked from commit d1ed53624b)
2018-03-06 14:07:26 +01:00
Alexander Köplinger fa1ec4ac4d [packaging] Support setting the FULL_VERSION number via env vars (#7414)
The Linux build currently just displays "tarball" since we don't
have the .git directory when building the Linux packages.

This allows us to pass environment variables that contain the
branch+commit to the build for generating version.h so we can
show the more detailed info like on OSX.

(cherry picked from commit 7c34f0c746)
2018-03-05 20:17:34 +01:00
Bernhard Urban 30aadcaa3a [2018-02] [metadata] split IL generation code into seperate compilation units. (#7375)
* [metadata] move ENABLE_ILGEN definition to configure

* [metadata] split IL generation code into seperate compilation units.

By adding callbacks for IL generating runtime code, we can link in code
later into the runtime that does such for configurations which do not
need IL generation initially. This is the case if you configure the
runtime with `--enable-minimal=jit,interpreter`.

In such configuration, the build will produce an additional library,
called `libmono-ilgen`.

An embedded can choose to link this library to the final binary and
initialize IL generation with the following three, newly added, API
calls:

* `void mono_marshal_ilgen_init (void)`
* `void mono_method_builder_ilgen_init (void)`
* `void mono_sgen_mono_ilgen_init (void)`

This change is mostly moving code around, but there are minor changes
like introducing the enum `MarshalTypeCheckPositions`, so we avoid
copy/paste constants accross compilation units.

* [windows] add IL gen files to windows build and set ENABLE_ILGEN

* [fixup!] fix windows build
2018-03-05 13:41:42 -05:00
Ankit Jain 214321dee5 [msbuild] Bump to track msbuild's mono-2018-02 branch (#7395) 2018-03-05 13:18:57 -05:00
monojenkins 413f2fb976 Reenable HttpRequestIgnoreBadCookies in monotouch. (#7391)
The test was ran in the current xamarin-macions and works as expected.
2018-03-03 00:19:07 +01:00
monojenkins 020ac2de89 Problem building on Arch linux #7200 https://github.com/mono/mono/issues/7200 Three styles: 1. LIBS="$LIBS -lfoo" -- common and probably works 2. LIBS+="-lfoo" -- was here and does not work 3. LIBS+=" -lfoo" -- should work (#7383) 2018-03-02 17:28:17 +01:00
Ankit Jain 769bf9ef25 nuget-hash-extractor: Add msbuild extensions nuget version from vs15.6 msbuild branch
Version `2.1.100-preview-62617-01` from:

https://github.com/dotnet/cli/blob/b9e74c65201ef39c74b6d75cedbb605a88cd26ec/build/DependencyVersions.props

Also, update the list in the runtime and deniedAssembliesList.txt
installed for use by msbuild.

(cherry picked from commit 95e48771d0eb30e92c3d9006ba0cd66b5a8b0c91)
2018-03-02 08:46:29 +01:00
Ankit Jain 878a54030a nuget-hash-extractor: Change the nuget repo name to use for
fetching Microsoft.NET.Build.Extensions nuget from `cli-deps` to
`dotnet-core`. Both of these should have the same nugets but sometimes
seem to be off by one.

(cherry picked from commit 89182050a769013e68d1d90d5fbca90415425aec)
2018-03-02 08:46:29 +01:00
Aleksey Kliger a849f9a6e8 Fix path clobbering when trying to shadow copy siblings
The original version of this code overwrote the same string over and over
again.  Because of the order of operations, when looking for siblings of
Test.dll, we would probe for Test.dll.mdb, then Test.pdb, then Test.pdb.config
(note the last one - should be Test.dll.config).

New version of the code uses fresh strings for each sibling.

Fixes https://github.com/mono/mono/issues/7262
2018-03-02 08:43:13 +01:00
monojenkins d9aa6f4083 Use attribute(deprecated) instead of attribute(error). (#7369)
Backport of #7362.
2018-03-01 22:30:35 +01:00
Alexander Köplinger c0b76ff9ae Don't throw NotImplementedException in Dispose()
We had a few stubs that threw not implemented exceptions in Dispose()
which causes the finalizer thread to abort.

Since those classes throw in the constructor already there's no way
to create a valid object and we can remove the throw in Dispose().

Fixes https://github.com/mono/mono/issues/7338
2018-03-01 17:39:08 +01:00
Aleksey Kliger (λgeek) 5cef19dcd2 [2018-02][runtime] Don't assert in mono_class_is_assignable_from on iface gtd (#7290)
* [test] System.Type.IsAssignableFrom of gtd array special interfaces.

Regression test for https://github.com/mono/mono/issues/7095

* [runtime] Don't assert in mono_class_is_assignable_from on iface gtd

Don't assert when comparing if an "array special interface" is assignable from
an array.

The code assumed that the special interface is some sort of generic instance
like ``IList`1<string>``, but it could be a generic type definition
``IList`1``.

There is a case where we would be obligated to return TRUE:
If someone used reflection to get the generic param of ``IList`1`` and then made an
array:
```
   var i = typeof (IList<>);
   var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T
   var a = iparam.MakeArrayType (); // T[]

   Console.WriteLine (i.IsAssignableFrom (a));
```

But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check,
earlier in mono_class_is_assignable_from.

So we can return FALSE here.

Fixes https://github.com/mono/mono/issues/7095
2018-03-01 11:32:24 -05:00
Martin Baulig ffe180c47f Make it build. 2018-03-01 15:30:24 +01:00
Martin Baulig c627c1b4b6 Bump linker. 2018-03-01 15:30:24 +01:00
Martin Baulig d0e7df4717 [System]: Enable some System.Net.Requests tests from CoreFX. (#7339)
Backport of #7080
2018-02-28 21:32:03 +01:00
monojenkins 28c171a337 [2018-02] [System]: Use new WebCompletionSource instead of TaskCompletionSource. (#7298)
Backport of #7293.
2018-02-28 16:52:10 +01:00
Alexis Christoforides 0c8f0774ce Merge pull request #7336 from monojenkins/backport-pr-7321-to-2018-02
[2018-02] Fix gdb not being used for native stacktraces in some cases
2018-02-28 09:30:32 -05:00
Alexis Christoforides 6a1b416592 Fix gdb not being used for native stacktraces in some cases 2018-02-28 14:23:09 +00:00
monojenkins 078760db9b [2018-02] [TermInfo] support new file format terminfo2 introduced with ncurses6.1 (#7308)
[2018-02] [TermInfo] support new file format terminfo2 introduced with ncurses6.1

Backport of #6960.

/cc @lewurm
2018-02-27 15:15:15 -05:00
Zoltan Varga ffc643d10c Fix VirtualMachine.CreateEnumMirror () so it works with types from non-root domains.
Fixes https://github.com/mono/mono/issues/7289.
2018-02-27 11:42:10 +01:00
Vlad Brezae 6ed6a1b568 Check if we are exceeding the worker count limit 2018-02-27 09:28:12 +01:00
Bernhard Urban 33b47292c3 bump nunitlite
Commit list for mono/NUnitLite:

* mono/NUnitLite@70bb70b [FinallyDelegate] rely on PlatformNotSupportedException in order to determine remoting support (#10)
* mono/NUnitLite@09ad9cf [FinallyDelegate] add comments for why CallContext is used (#9)
* mono/NUnitLite@ab5cc9c [FinallyDelegate] Make this work with platforms without remoting. (#8)

Diff: https://github.com/mono/NUnitLite/compare/b7776829bb7b2f9c58db045a6f40be40bcd96761...70bb70b0ffd0109aadaa6e4ea178972d4fb63ea3
2018-02-27 07:38:19 +01:00
Ludovic Henry df0a29e779 Merge mxe-Win32 and mxe-Win64 targets since we are building both in XA anyway 2018-02-26 18:05:51 +01:00
Zoltan Varga 6ccf73c8c8 Pass only the imt argument if both imt and rgctx arguments are required.
Fixes https://github.com/mono/mono/issues/7240
2018-02-26 18:04:21 +01:00
Alexander Köplinger d6b6fc61f1 Bump bockbuild to get curl error changes 2018-02-23 17:35:54 +01:00
Rodrigo Kumpera 8249522f23 Fix the test name. 2018-02-23 09:47:11 +01:00
Rodrigo Kumpera 2623bc3045 Magic interfaces requires the complex stelemref to handle arrays. Fixes gh #6266 2018-02-23 09:47:11 +01:00
Bernhard Urban 3be3714b6e add another signature for interp_in wrappers 2018-02-22 18:44:02 -05:00
Bernhard Urban daace66339 [2018-02] [xbuild] add property that is available in msbuild (#7202)
They fsharp team decided to remove a `#if MONO` with the assumption that
`xbuild` is dead and everything has switched over to `msbuild`:
https://github.com/Microsoft/visualfsharp/pull/3969/files#diff-bcb4028a918d13bbab2d0c1c15c97e6aL181
https://github.com/Microsoft/visualfsharp/pull/3969/commits/5e17e3111f88b1a1f025ac54c8147052e12f347f#r151844561

which, alas, is not true yet.

With this PR we started to ship above modifications in the MDK:
https://github.com/mono/mono/pull/7018

* Bump API snapshot submodule
2018-02-23 00:06:47 +01:00
Alexis Christoforides fd18515516 Bump bockbuild for https://github.com/mono/bockbuild/pull/62 (#7206) 2018-02-22 15:40:18 +01:00
Zoltan Varga c68cc6a4f4 Emit the same instances in hybrid aot mode as in full aot mode.
Fixes https://github.com/mono/mono/issues/7086.
2018-02-22 14:54:11 +01:00
Zoltan Varga 4169af750b Disable partial sharing during JITting, its only been tested in full aot mode, and doesn't seem to work with JITted methods. Fixes https://github.com/mono/mono/issues/7085. 2018-02-22 14:45:53 +01:00
Zoltan Varga ed22f9fa84 Add hybrid aot tests. 2018-02-22 14:45:53 +01:00
Marek Safar d389ff9ff6 Remove reflection calls for value has to be set 2018-02-22 08:40:23 +01:00
monojenkins d1f461c5a3 Expand "ignore" functionality (#7154) (#7176)
Context: https://github.com/xamarin/xamarin-android/pull/1078

xamarin-android uses `mono-api-html` and `mono-api-info` in order to
perform API comparisons; see e.g. 4e459045.

A recent problem has arisen regarding "inter-API-level diffs": there
are many API changes which we consider to be acceptable, and thus
would like to ignore. Unfortunately, `mono-api-html` doesn't support
ignoring many of these constructs, e.g. base class changes:

	<h3>Type Changed: Android.Preferences.CheckBoxPreference</h3>
	Modified base type: <span class='removed removed-inline removed-breaking-inline'>Android.Preferences.Preference</span> <span class='added '>Android.Preferences.TwoStatePreference</span>

and property type changes:

	<h3>Type Changed: Android.Views.InputEvent</h3>
	<p>Modified properties:</p>
	<pre>
	<div data-is-breaking>	public <span class='added added-breaking-inline'>abstract</span> int DeviceId { get; }
	</div><div data-is-breaking>	public <span class='added added-breaking-inline'>abstract</span> InputSourceType Source { get; }

Overhaul the `mono-api-html` "ignore" infrastructure:

  * Introduce ignore "scoping". Previously, the ignore options would
    only match the *member* text against any provided regular
    expression. Thus, `mono-api-html -r ToString` would ignore *all*
    members containing `ToString`. Furthermore, there was no way to
    restrict the ignore to a particular type. Expand the regex
    semantics so that the declaring type is used as a "prefix" for the
    to-be-matched text. For example, if a class `Example` is removed,
    `mono-api-html` will now match the following value against any
    `-r` regular expressions:

        Example: Removed type

  * Add a `mono-api-html -v` option, to control output verbosity.
    When specified, `mono-api-html` will print out available `-r`/etc.
    option values:

        $ mono-api-html expected.xml new.xml -v
        Possible -a value: Android.Resource: Added fields: public static const int AccessibilityEventTypes;
        Possible -r value: Android.Preferences.CheckBoxPreference: Modified base type: 'Android.Preferences.Preference' to 'Android.Preferences.TwoStatePreference'
        Possible -r value: Android.Views.InputEvent: Modified properties: public int DeviceId { get; }
        Possible -n value: Android.Views.UnavailableException: Added type
        ...

Additionally, allow `mono-api-html` to take a
`Mono.Options.ResponseFileSource`, which allows `@response-files` to
be used as command-line options.
2018-02-22 01:31:33 +01:00
Zoltan Varga 4e29f2ef9a [jit] Handle more cases for gsharedvt constrained calls.
Hopefully fixes https://github.com/mono/mono/issues/7016.
2018-02-21 23:12:19 +01:00
monojenkins b242e82ba4 Add ldflags for bitcode (#7144)
Backport of #7141.
2018-02-21 16:10:50 +01:00
monojenkins 9c9d5d9e22 Fix the Android xattr check to not disable it on all other platforms. (#7146)
Backport of #6798.
2018-02-21 00:30:01 +01:00
monojenkins f8ed9bcd12 [2018-02] [corlib] Fix RuntimeFeatureTest.NoNewFeaturesAdded on mobile (#7151)
Backport of #7149.
2018-02-21 00:13:42 +01:00
monojenkins 578cfcd146 [2018-02] [sdks] Fix for XA integration (#7109) 2018-02-20 12:11:02 -05:00
Bernhard Urban 93705443b6 bump nunit-lite
Commit list for mono/NUnitLite:

* mono/NUnitLite@b777682 [FinallyDelegate] only call it if available, on some platforms (e.g. iOS) it can be set to null (#7)

Diff: https://github.com/mono/NUnitLite/compare/0dc7716771023274074160d1816c2fa610e23d2f...b7776829bb7b2f9c58db045a6f40be40bcd96761
2018-02-20 16:15:29 +01:00
Bernhard Urban 5f626db882 [debugger] disable StepOutAsync test because it's flaky
(cherry picked from commit 8f35227b88)
2018-02-19 11:49:31 +01:00
monojenkins 6cb693c4b5 Bug 60088 - Assertion at ../../../../external/mono/mono/mini/debugger-agent.c:4765, condition array->len == 1' not met Problem was that I didn't consider async void` method when adding that assert (#7105) 2018-02-18 23:06:03 -05:00
monojenkins e96f9fbb4a [2018-02] [sdks] Fix for XA integration (#7104) 2018-02-18 21:13:22 -05:00
Alexander Köplinger 6559a504ed [ci] Disable monodoc tests on Windows for now
They fail: https://github.com/mono/mono/issues/6956

(cherry picked from commit 939d720770)
2018-02-16 21:49:17 +01:00
Alexis Christoforides c62864c98e Disable some PngCodecTest that have trouble on CI right now
(cherry picked from commit dcda4c77bc)

See https://github.com/mono/mono/issues/6908
2018-02-16 21:25:53 +01:00
monojenkins c5accf5ebc Bump aot file format version because of 7cac757e60. (#7082) 2018-02-16 03:01:17 -05:00
Ankit Jain 470256aca5 Add denied assembly versions from previous ms extensions nugets
Extracted from Microsoft.NET.Build.Extensions

	2.1.0-preview1-62414-02   # https://github.com/dotnet/cli/blob/501e11d928c21608999c934f0a7078570b688c6c/build/DependencyVersions.props
	15.5.0-preview-20171027-2 # https://github.com/dotnet/cli/blob/ed916bb13e798a470855fb4f60acd3cabb2765fc/build/DependencyVersions.props
	2.0.0-preview3-20170622-1 # https://github.com/dotnet/cli/blob/7c928a9f18f81001e586e5bf0411f9bfa92e30d4/build/DependencyVersions.props

And also remove incorrect entries from earlier version
2.1.0-preview1-62516-03 , which were not committed to mono's msbuild.

A future commit will sort and de-dedup the lists, but this one avoids
removing any existing duplicates, to make review easier.
2018-02-15 10:54:03 +01:00
Zoltan Varga f0f76abc30 Emit the weak field indexes table using the MONO_AOT_TABLE code, so it works with separate aot data files/bitcode.
Fixes https://github.com/mono/mono/issues/6948.
2018-02-14 18:15:06 +01:00
Ludovic Henry e7e28f4b9d Pass null-terminated string for logging 2018-02-14 11:52:12 +01:00
Zoltan Varga 00dec1f0c0 [2018-02] Fix ios sdk. (#7027)
* [sdks] Bring back download of llvm for iOS (#6818)

Revert part of https://github.com/mono/mono/commit/605cadfb09d6c79723763b8afd09480a5941eabf

* [sdks] Fix execution permission of download-llvm.sh

* [sdks] Fix download-llvm.sh

* [sdks] Fix build for iOS (#6878)

* [sdks] Fix ios+llvm. (#6939)
2018-02-13 22:43:52 -05:00
monojenkins e0c46d9114 Bump mono/NUnitLite (#7006)
Commit list for mono/NUnitLite:

* mono/NUnitLite@0dc7716 [FinallyDelegate] make key for `lookupTable` actually unique (#6)

Diff: https://github.com/mono/NUnitLite/compare/a8bef89392920dd0ef5d74ef3563d97083246414...0dc7716771023274074160d1816c2fa610e23d2f
2018-02-14 02:42:38 +01:00
Alexander Köplinger ba542c0b1e [2018-02] Update F# to 4.1.33
Backport of #7003
2018-02-14 02:35:24 +01:00
Alexander Kyte 72aea0056b Revert mkbundle defaulting behavior made in ca8b8bd346
Fixes https://github.com/mono/mono/issues/6187
2018-02-13 19:07:29 +01:00
Aleksey Kliger 0dfa4f85a9 Unlock loader lock on error paths 2018-02-13 12:51:49 -05:00
Alexander Köplinger d956447d56 [System.Data] Add missing api
Backport of https://github.com/mono/mono/pull/6913
2018-02-13 15:34:02 +01:00
monojenkins 4aa717dc82 [2018-02] [runtime] Make icall tables loadable. (#6944)
* Make icall tables loadable.

Move the icall table code into a separate icall-table.c file, which is either linked into libmono or compiled into a
separate libmono-icall-table.a archive which can be linked into an app, and installed by calling mono_icall_table_init ().

* Change ClCompile to ClInclude for new .h file.

* [runtime] Fix the --enable-icall-symbol-map build. (#6943)
2018-02-12 20:45:40 -05:00
Rodrigo Kumpera d8e28e14a5 Merge pull request #6952 from monojenkins/backport-pr-6890-to-2018-02
[2018-02] [interp] disable test_42_arm64_dyncall_vtypebyval
2018-02-12 17:28:33 -05:00
Bernhard Urban 176f127c1b disable test_42_arm64_dyncall_vtypebyval
regression test introduced by https://github.com/mono/mono/pull/6826
fails on ARM64 with interp
2018-02-12 19:29:43 +00:00
Ankit Jain 764b03fcab nuget-hash-extractor: Add msbuild extensions nuget to list of nugets to
.. process. Version from:

https://github.com/dotnet/cli/blob/501e11d928c21608999c934f0a7078570b688c6c/build/DependencyVersions.props

```
    <MicrosoftNETSdkPackageVersion>2.1.0-preview1-62414-02</MicrosoftNETSdkPackageVersion>
    <MicrosoftNETBuildExtensionsPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftNETBuildExtensionsPackageVersion>
```

Also, update the list in the runtime and deniedAssembliesList.txt
installed for use by msbuild.
2018-02-12 17:31:57 +01:00
Ankit Jain 1df45be2e9 nuget-hash-extractor: Add support for handling nuget with multiple
.. assemblies.

This is specifically required for handling .net assemblies in
`Microsoft.NET.Build.Extensions` nuget which don't work on mono. These
assemblies are bundled with msbuild and we want to be able to deny these
at runtime.
2018-02-12 17:31:57 +01:00
Martin Baulig e9fa8a306d WebConnection.Connect() needs to probe all IP addresses.
Fix a regression introduced in the new web stack - when connecting
to a DNS host name that resolves to multiple IP addresses, we need
to probe them all.

On iOS, "localhost" will resolve to both "::1" and "127.0.0.1".
2018-02-12 17:00:29 +01:00
Martin Baulig 7126712f86 [System]: Set NetworkStream.ReadTimeout in WebConnection.InitConnection(). (#6898)
Setting ReadTimeout in WebResponseStream.ctor throws System.Net.Sockets.SocketException : Invalid arguments on iOS.

Set it in WebConnection.InitConnection() immediately after establishing a connection, before we read/write anything.
2018-02-09 21:21:36 +01:00
Zoltan Varga 07a5c686e0 Handle arguments of type ArgVtypeOnStack in the dyn call code. Part of the fix for #59184. 2018-02-08 16:54:32 -05:00
Alexander Köplinger bc64a17db8 [bcl] Fix more assembly identity mismatches (#6870)
As a follow up to https://github.com/mono/mono/issues/6848 I checked
all the assemblies and found some more identity mismatches with .NET

(cherry picked from commit c84e6c81a2,
minus the Microsoft.VisualC.dll version fix)
2018-02-08 22:32:51 +01:00
Martin Baulig f3c1fcd7c9 [System]: Revert my latest WebResponseStream changes. (#6887)
This reverts PR #6662 (commit 18a1a25) and #6771 (commit da03780).

These two changes introduced a regression:
https://github.com/mono/mono/issues/6788

(cherry picked from commit 8bfcb27147)
2018-02-08 21:33:37 +01:00
Alexander Köplinger 268f2ac419 Bump bockbuild to get new gtk+ repo location 2018-02-08 19:48:58 +01:00
Marius Ungureanu ebb26ab546 Bump bockbuild to add gtk# generator fix (#6883)
Bug 61202 - Fatal error when adding aspect ratio constraint
2018-02-08 15:32:58 +01:00
Bernhard Urban 01e35bc383 ignore LocalId test on XAMMAC_4_5 too
https://github.com/xamarin/maccore/issues/628
2018-02-08 10:41:39 +01:00
monojenkins 4e374e8cea [2018-02] [reference-assemblies] Fix public key for some newer v4.7.1 facades (#6865)
Fixes https://github.com/mono/mono/issues/6848
2018-02-08 01:08:23 +01:00
Egor Bogatov 94a8a589c8 Add stubs for Interop.NetSecurityNative 2018-02-07 12:51:15 -05:00
monojenkins fd7c5cdac6 [2018-02] [System.Data] Add missing API (fixes 6767) (#6825)
* Add missing api to System.Data (fixes 6767)

* Bump API snapshot submodule
2018-02-07 14:41:50 +01:00
Alexander Köplinger 942dd07c65 [ci] Add setting artifacts.json status
Needed for QA automation.

(cherry picked from commit f8a4bbd357)
2018-02-07 00:42:22 +01:00
Alexander Köplinger f403697225 [ci] Add Windows .msi PR build (#6815)
Use the trigger `@monojenkins build pkg and msi`.

(cherry picked from commit 687dc212dc)
2018-02-07 00:33:20 +01:00
monojenkins 20ada1bc3b [2018-02] [runtime] Add a 'frame_addr' field to MonoStackFrameInfo, which is equal to either interp_frame or ctx->sp. (#6813)
* Add a 'frame_addr' field to MonoStackFrameInfo, which is equal to either interp_frame or ctx->sp.

Use this field to compare frames with each other or with stack addresses instead of setting ctx->sp to
the interp frame address, which breaks mixed mode, since mixed mode assumes ctx->sp is the real
sp of the last native interpreter frame.

* Reenable mixed mode tests.
2018-02-06 13:13:44 -05:00
Alexander Köplinger 3320f45d98 [ci] Make sure packageFileName is a string
It was the file object before and just got turned into string
by coincidence in most places.

(cherry picked from commit c7f89e7837)
2018-02-05 21:35:43 +01:00
Ludovic Henry f804385745 Bump version to 5.12 (#6791) 2018-02-05 15:13:33 -05:00
Alexander Köplinger 8f16dd35ba [ci] Report pending/failed status on GitHub for pkg/msi
(cherry picked from commit 0bfda265b7)
2018-02-05 18:35:23 +01:00
Alexander Köplinger fe918745d5 [ci] Include commit hash in blob URL of pkg/msi
This makes it easier to infer the commit just based on the URL.

(cherry picked from commit 4682391599)
2018-02-05 18:35:15 +01:00
Calvin d568c0b28d Support IBM AIX on POWER (#6677)
* Get autotools scripts for Mono and Boehm to recognize i

PASE is most similar to AIX, and perhaps I assume other commercial
Unices, as well as PowerPC Linux, so grab variables from them as
needed.

With this, we get glib failing to build due to missing mkdtemp.

* Use better cpp definition to grab more of what we want

* Fix random and 64-bit file offset support

* Set TARGET on IBM i on POWER

* Add hack to gfile-unix.c to work around flawed AIX header

From comment:

/* HACK: the preprocessor will not give us mkdtemp no matter
   what and Mono (for good reason) does
   "-Werror-implicit-function-declaration" so we error out;
   instead declare mkdtemp here; the linker will find mkdtemp
   anwyays. libuv has had similar issues, but they just ignore
   the compiler warning instead of failing on it.

   See: github.com/libuv/libuv/pull/740 */

* Work around missing definition on AIX/PASE

* Fix conflicting definition from due too AIX headers

* Initial work to get JIT working on AIX

* uncertain about NIP; is IAR the right register? need review from
  PPC asm people

* needs calling convention work; AIX does NOT use ELF

* Fix lack of casting on sigcontext macros, fix errnos for AIX

* AIX doesn't distinguish between ENOTEMPTY and EEXIST without a
  define. Handle this case with a conditional cpp directive..

* When ctx is a void pointer, dereferencing as a struct will fail.
  Handle this case with a cast.

* Handle regular AIX as well as PASE

* Implement stack boundaries check for AIX, volume info func

* vol info should be like other Unix, just needs to bridge ifdef

* highly uncertain for the bounds checking, needs further review

* Fix typo in mono/utils/mono-threads-aix.c

* In boehm-gc.c, don't use pthread_getattr_np on AIX even if available

It's not available on IBM i, and even if available, toolchains for AIX
may "helpfully" swap out system headers with variants that remove
functions like pthread_getattr_np.

* Don't use "-export-dynamic" on non-GNU ld

IBM ld considers "-e" to be a flag for setting the entry point.
Detect non-GNU ld, and offer equivalents when possible.

The makefile in mini had to be changed as a result due to
hardcoded flags.

* Use pthread-stop-world.c on AIX

Remove an ifdef that gated this off to AIX. It seems the old AIX
specific files shouldn't be used, and that the changelog for libgc
says pthread should work fine on AIX instead; yet it was blocked.
Restore this, as it compiles and seems to let mono-boehm link fine.

* AIX workarounds for some of support dir

* fstab on AIX is there, but defines a struct more like other
  platforms' checklist struct.

* AIX, like macOS and some BSDs, doesn't define some serial types.

* psignal is another victim of GNU; even then it isn't in PASE
  headers anyways

* More support workarounds for AIX headers

* Replacement function body for syslog2 on vsyslog-less platforms

AIX lacks vsyslog; detect in autoconf and act appropriately.

* Final support hacks for AIX

* Fix problematic stack management on AIX

this gets us past ifdefs, after much handwringing

* get the right end of the stack; r1/stack pointer is on the wrong
  end and ustk is just plain broken

* AIX doesn't seem to like the semantics of the mmap call valloc
  does here; either we're allocating into an area we shouldn't be
  or we're not passing the right flags. Until then, learn to live
  without the stack guard?

* Disable Boehm GC on AIX

Focus on getting SGen working, and avoid legacy debugging nonsense

* Remove AIX ifdef-undef and replace with s/hz/uhz

* Don't use sigaltstack on AIX due to bugginess with guard sections

The valloc call on AIX has issues after issuing mprotect; don't do
do it. I believe it fails because we aren't issuing the right
flags on AIX, or because we're allocating inside of an already
allocated area.

* Perform a 64-bit build on AIX

We still crash at the same place, but probably for the best that
we switch to 64-bit. (Maybe we could make it configurable?)

* Fix func descriptor ifdef, add initial (likely wrong) defs for AIX

* AIX doesn't define __powerpc64__ or __ppc64__ when compiling as
  64-bit. Use an alternate ifdef, and shuffle around that ifdef
  anyways, as it could lead to wrong results on other platforms
  too.

* AIX likely needs special definitions, especially on 32-bit. The
  calling convention is closest to PPC64BE Linux, but not exactly.

* Fix stack size on AIX

Ruby dealt with this before: https://github.com/ruby/ruby/commit/a2594be783c727c6034308f5294333752c3845bb

* Set up initial PPC hwcap for AIX, fix ftnptr ifdefs, tweak AIX defs

* Fix hwcap to use better values on PPC AIX

Still needs more adjustment though

* Fix alignment issue on AIX, tweak mini-ppc values just a bit more

* On AIX, doubles are always aligned by 4 if they're in structs.
  Since we need to have them aligned by 8 on 64-bit, this is bad,
  so change the type on AIX.

* We can use this definition on AIX

Now we can bootstrap Mono!

* Shuffle MonoArray ifdef per suggestion of @vargaz

* Fix System.Decimal division on big endian systems

Before, we got non-sensical overflow on things like
`(Decimal)Int32.MaxValue / 1000`; now they get the same value,
comparing this POWER6 running AIX to my server's output running
OpenBSD/amd64.

* Fix dynamically linked build of Mono on AIX

nm wasn't seeing 64-bit symbools as it defaults to 32-bit mode,
also never try to use GNU nm

* Fix PPC64 define in mono-config

Interestingly, there was an AIX define already present, and that
definition is present in AIX's passed includes, so continue to use
it.

* Don't use __thread even if detected on AIX

tl;dr: The assembler gets angry with __thread and minimal-toc, and
changing options to replace minimal-toc causes linker issues; this
TLS option isn't important anyways if we have pthread instead,
like before when we were using Perzl's old GCC without __thread.

* Get lib.a(lib.o) type archives working with P/Invoke for AIX

AIX libraries are very, very strange compared to other Unices.

I'm not entirely sure if this is correct or optimal; it may need
to special case further. For now, it's enough to get gacutil
up and running.

Some resources I found useful for this charade:
<http://stromberg.dnsalias.org/~dstromberg/AIX-shared-libs.html>

Also set libc and libintl to their proper values.

* Scheduling priority hack for i

PASE doesn't accept anything other than SCHED_OTHER, and the funcs
for getting min/max don't work either. AIX suffers, but only a
little bit.

* Final polish on request

Remove Boehm changes if we don't use Boehm, tweak some defines,
remove some externs, tweak autoconf file

* Be aware of ERESTART, on OSes that use it

Instead of EINTR/EAGAIN, AIX uses ERESTART. Handle this, so things
like xsp are less chatty when performing async IO.
2018-02-05 17:17:20 +01:00
Alexander Köplinger 8fca785bcb Update README.md with new links to builds 2018-02-05 15:01:40 +01:00
Alexander Köplinger eafd6e916f [ci] Consistently use CI_TAGS instead of label (#6782)
The `label` environment variable is set by Jenkins based on the
chroot/node configuration a given job is using.

This crept into the CI scripts while it should have been a
separate concern and caused all sorts of issues when we bumped
from e.g. debian-8-* to debian-9-* in some jobs.

Instead we should consistently use the CI_TAGS env var which we
control exclusively.
2018-02-05 13:58:59 +01:00
Zoltan Varga 73eb0cc2fd Fix a regression introduced by e05343ddf5: Disable the ldobj+stobj optimization
for reference types.

Fixes https://github.com/mono/mono/issues/6777.
2018-02-04 18:34:47 -05:00
Marek Safar 9c3ed250a7 [System] Disable few tests which blocks when run on main loop 2018-02-03 21:17:55 -05:00
Alexander Köplinger 338c7957cd [boringssl] Bump to include Neale's big endian fixes (#6761)
https://github.com/mono/boringssl/pull/4 and followup 2ba8564f8b6.
2018-02-03 03:02:04 +01:00
Ludovic Henry 34a684da0f [sdks] Fix build for llvm (#6770)
* [sdks] Fix build for llvm

* [sdks] Have .stamp-%-configure always depend on .stamp-%-toolchain

* [sdks] Dependencies on directories should always be order-only
2018-02-02 20:48:31 -05:00
Alexander Köplinger 33a445d0fb [m4] Drop autoconf min version in ax_check_compile_flag.m4 (#6764)
It should work with earlier versions too and prevent issues like
https://lists.dot.net/pipermail/mono-devel-list/2018-February/044638.html
2018-02-03 01:02:24 +01:00
Ludovic Henry 605cadfb09 [sdks] Add more targets for XA (#6678)
* [sdks] Remove redundant dependency

* [sdks] Build mxe-Win{32,64}

* [sdks] Build host-{Darwin,Linux,mxe-Win{32,64}}

* [sdks] Build llvm-llvm{win,}{32,64}
2018-02-02 16:14:15 -05:00
monojenkins d3da6980cc [msvc] Update csproj files (#6758) 2018-02-02 20:19:49 +01:00
Zoltan Varga 42feadda8c [jit] Avoid extending the size of Vector2/Vector3 to 16 bytes. Disable SIMD for these types for now, since the SIMD code can't handle types (#6746)
which are smaller than a SIMD reg.

Fixes https://github.com/mono/mono/issues/6411.
2018-02-02 14:18:29 -05:00
Bernhard Urban b86aa686dc [interp] build library of interp even if it's disabled and ship it
so the install directory looks like this:

```
$ find . -name '*interp*'
./lib/libmono-ee-interp.la
./lib/libmono-ee-interp.dylib
./lib/libmono-ee-interp.0.dylib
./lib/libmono-ee-interp.a
```
2018-02-02 17:41:02 +01:00
Marek Habersack 4a99504591 Check for compiler switches to mitigate Spectre/Meltdown
This commit implements checking whether the compiler used to build mono supports
the recently added switches to generate code designed to mitigate the effects of
the Spectre/Meltdown bugs of the modern CPUs (https://meltdownattack.com/).

As of this commit the options are implemented for GCC 8.x, 7.3 and backported to
some older versions of gcc 7.x (e.g. in Ubuntu). The options tested for, and
used, here are:

  -mindirect-branch (https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/x86-Options.html#index--mindirect-branch)
  -mfunction-return (https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/x86-Options.html#index--mfunction-return)

Checks and usage of the above flags is hidden behind the
`--with-spectre-mitigation` configure option, defaulting to `no`.

Two additional options are implemented to specify the kind of thunk to implement
by each of the flags above:

  --with-spectre-indirect-branch-choice=keep,thunk,inline,extern
    Convert indirect branches to the specified kind of thunk (defaults to inline)

  --with-spectre-function-return-choice=keep,thunk,inline,extern
    Convert function return instructions to the specified kind of
    thunk (defaults to inline)
2018-02-02 08:53:02 -05:00
Zoltan Varga 9b3e3187d9 [jit] Fix OP_ICONV_TO_OVF_I8_UN, it should use OP_ZEXT_I4 instead of a 0 shift which can be eliminated by cprop. (#6753)
Fixes https://github.com/mono/mono/issues/6721.
2018-02-01 19:55:27 -05:00
Martin Baulig 5f8a128064 [System]: Use WebClient from CoreFX. (#6711)
The CoreFX version has a few error checks which are not in the
referencesource, switching to CoreFX allows us to enable their tests.

Use Path.GetRandomFileName() and Path.GetTempFileName() in tests.
2018-02-01 23:45:30 +01:00
Martin Baulig 18a1a25345 [System]: Refactor and cleanup WebResponseStream (#6662)
We are now using nested streams to take care of buffering, chunked encoding and automatic decompression.

GZip / Deflate decompression have been moved inside `WebResponseStream`, the `HttpWebResponse` now always returns a `WebResponseStream` (and not a `GZipStream`) because we have to do extra book-keeping after reading the entire content.
2018-02-01 23:39:46 +01:00
Zoltan Varga 115915b3ca [runtime] Fix the build with the --disable-libraries configure option. (#6750) 2018-02-01 13:09:38 -05:00
Zoltan Varga b84d6664c9 [sdks] Remove obsolete --with-glib=embedded configure option. (#6751) 2018-02-01 13:08:32 -05:00
Rodrigo Kumpera 45d6269774 [wasm] Fix nunit dep description. (#6749) 2018-02-01 15:07:23 +01:00
Marek Safar 4a95673dc0 [github] Add issues template (#6739) 2018-02-01 00:40:53 +01:00
Alexander Köplinger ac20560ae5 Merge pull request #6728 from alexrp/master
[sgen] Don't report gc_resize profiler events from worker threads.
2018-01-31 22:52:31 +01:00
Aleksey Kliger (λgeek) ca11e233b1 Fix warnings (#6685)
* [checked-build] Fix warnings in g_free of g_getenv results

```
checked-build.c:63:12: warning: passing 'const gchar *' (aka 'const char *') to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                        g_free (env_string);
                                ^~~~~~~~~~
../../mono/eglib/glib.h:126:20: note: passing argument to parameter 'ptr' here
void g_free (void *ptr);
                   ^
checked-build.c:79:12: warning: passing 'const gchar *' (aka 'const char *') to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                        g_free (env_string);
                                ^~~~~~~~~~
../../mono/eglib/glib.h:126:20: note: passing argument to parameter 'ptr' here
void g_free (void *ptr);
                   ^
```

* [boehm] Fix warning in GC_push_all call

```
boehm-gc.c:603:17: warning: incompatible pointer types passing 'HandleChunkElem [125]' to parameter of type 'ptr_t' (aka 'char *') [-Wincompatible-pointer-types]
                        GC_push_all (cur->elems, (char*)(cur->elems + cur->size) + 1);
                                     ^~~~~~~~~~
../../libgc/include/private/gc_priv.h:1318:34: note: passing argument to parameter 'bottom' here
void GC_push_all GC_PROTO((ptr_t bottom, ptr_t top));
                                 ^
```
2018-01-31 16:30:16 -05:00
Rodrigo Kumpera 8af222e188 [wasm] Fix WASM CI script. (#6741) 2018-01-31 19:22:22 +01:00
Marek Safar fd186ce1b6 [github] Tweaks to issue template 2018-01-31 09:58:46 -05:00
jaykrell 264c1ad840 Save 1K of stack and an extra string copy when a heap allocation was going (#6720)
to be done unconditionally anyway. And make it valid C++.
2018-01-31 09:43:40 -05:00
Bernhard Urban fe9b82fec5 [ci] update ARM label for ignored interpreter tests (#6738)
image got upgraded for interpreter lanes too
2018-01-31 15:41:41 +01:00
jaykrell 28b1a7a79e [threads] Return boolean instead of pointer from Thread_internal (#6661) 2018-01-31 09:27:24 -05:00
Vlad Brezae c0dd0232af Revert "[mini] Align stack when resuming to catch handler"
This reverts commit ab20369d5f.

It breaks llvm EH : https://github.com/xamarin/xamarin-macios/issues/3241
2018-01-31 06:34:32 -05:00
Aleksey Kliger 9a8b2b6c30 [interp] Don't use external only functions in transform.c
Switch over to various _checked alternatives and propagate the MonoError outwards
2018-01-31 11:49:00 +01:00
Aleksey Kliger 833e9c1569 [interp] config.h must be included first; only by .c files
Not by headers.
2018-01-31 11:49:00 +01:00
Aleksey Kliger c7c7b8d0b8 [interp] Fix some leaking error paths in generate ()
If there's an error, we should free the TransformData before returning
2018-01-31 11:49:00 +01:00
Aleksey Kliger 9e96492f47 [metadata] New method mono_method_has_no_body
Returns TRUE if the method flags indicate that it's not expected to have a
body because it is abstract, a PInvoke, an internal call or a
runtime method.
2018-01-31 11:49:00 +01:00
Zoltan Varga 826f931c5c [runtime] Avoid building a separate static library, use the shared object files for the static library as well. (#5233) 2018-01-31 11:48:08 +01:00
EgorBo 90d11817f8 fix leak in FontFamily 2018-01-30 23:03:43 -05:00
Marek Safar 2c52be83e2 Bump corefx 2018-01-30 15:34:52 -05:00
Alex Rønne Petersen 6e596beb22 [sgen] Don't report gc_resize profiler events from worker threads.
See 4acc3dfeed for why this is problematic. The
bug was introduced in d7ac79ccc0.

This fixes an occasional deadlock in the profiler stress tests.
2018-01-30 16:22:06 +01:00
Alex Rønne Petersen 1216780e83 [acceptance-tests] Some improvements to the profiler stress runner.
* Print combined stdout and stderr in console output.
* Print the RNG seed used for a test run on startup and in the test report.
* Set the individual test timeout back to 6 hours.
* Use the nodefaults profiler option.
* Allow configuration through environment variables:
 - MONO_PROFILER_STRESS_OPTIONS: Specify a set of profiler options to use
   instead of the randomly generated ones.
 - MONO_PROFILER_STRESS_REGEX: Specify a regular expression to filter which
   tests should be run.
 - MONO_PROFILER_STRESS_SEED: Specify the RNG seed. Useful for reproducing full
   test runs at a later point.
 - MONO_PROFILER_STRESS_TIMEOUT: Specify a different individual test timeout
   from the default.
2018-01-30 16:22:01 +01:00
Martin Baulig e9d967f661 [System]: Enable ServicePoint tests from CoreFX. 2018-01-30 08:01:50 -05:00
Michael Sørensen 78f653d7f8 fixed markdown syntax 2018-01-29 21:21:18 +01:00
Marek Safar c6369ccce2 [corlib] Optimization for stacktrace build up 2018-01-29 21:20:46 +01:00
Alexander Köplinger 7579c53569 [ci] Reenable System.Runtime.CompilerServices.Unsafe-xunit on 32bits (#6708)
The corefx bump was done so we can reenable this.

Fixes https://github.com/mono/mono/issues/6379.
2018-01-29 19:44:31 +01:00
Marek Safar 030afc1db4 [packaging] Bump mono-basic to bring latest fixes (#6706) 2018-01-29 15:28:42 +01:00
Alexander Köplinger 4831b1cd0b [packaging] Move GitHubCommitStatusSetter into node 2018-01-29 14:01:28 +01:00
Alexander Köplinger 1177d7cad9 [packaging] Add GitHub status for packaging result
PKG-mono for the OSX .pkg and MSI-mono_{x86|x64} for the Windows .msi
2018-01-29 12:42:45 +01:00
Bernhard Urban 0acf7ff606 [interp] use libmonoldflags (to enforce -no-undefined)
it has the right logic to avoid this:

```
ld: -undefined and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
```

i.e. setting `-no-undefined`. However, this requires that we link
against `libmonosgen` on those platforms.
2018-01-29 10:41:36 +01:00
Jonathan Chambers 65389bd4f2 Remove extra reference count on images loaded via byte array. (#6656) 2018-01-28 10:55:58 -05:00
Alexander Köplinger b153e9074a [packaging] Fix variable 2018-01-28 01:34:44 +01:00
Alexander Köplinger 3238bf3586 [packaging] Move setting build description to end
This ensures we don't advertise the link if e.g. signing fails.
2018-01-28 00:05:33 +01:00
Alexander Köplinger 758154731a [packaging] Add signing to Windows build 2018-01-28 00:05:33 +01:00
Alexander Köplinger d9a7a04f05 [packaging] Produce correct Windows .msi file name
We've been using a certain pattern for the Windows .msi for a long
time but the build output used a different name which we simply
manually renamed before publishing.

Since we want to automate as much as possible we can change the
build to produce the correct name right away.
2018-01-28 00:05:33 +01:00
Alexander Köplinger 4248d073d6 [packaging] Set MONO_BUILD_REVISION for OSX package build (#6698)
Otherwise the default bockbuild behavior is to use the tip of
MONO_BRANCH which is not what we want when building on Jenkins.
2018-01-28 00:04:07 +01:00
monojenkins 4506807e67 [msvc] Update csproj files (#6696) 2018-01-27 20:22:02 +01:00
Marek Safar 386d63a13b [build] Add recursive run-xunit-test target 2018-01-27 11:31:13 +01:00
Marek Safar b55c24911f [corlib] Implements StackTraceHiddenAttribute 2018-01-27 09:51:07 +01:00
monojenkins 27480ee50d Bump API snapshot submodule 2018-01-26 19:04:04 +01:00
Marek Safar 1f7a31c9f0 Bump api-snapshot 2018-01-26 19:04:04 +01:00
Marek Safar 8d1928a0a7 [System.Core] Enable more tests 2018-01-26 19:04:04 +01:00
Marek Safar 28d577d63f Bump corefx 2018-01-26 19:04:04 +01:00
Vlad Brezae 3c0e572280 [interp] Don't push lmf with no interp frame data 2018-01-26 13:56:51 +01:00
Alexis Christoforides d7f2e40b7a Merge pull request #6674 from lambdageek/gitignore-string-test
[unit-tests] Add test-mono-string to .gitignore
2018-01-25 19:33:49 -05:00
Alexis Christoforides 4bdc132f51 [scripts] mac-sdk-package.sh now uses command-line arguments. 2018-01-25 17:40:25 -05:00
Aleksey Kliger a03792d8b6 [unit-tests] Add test-mono-string to .gitignore 2018-01-25 11:16:33 -05:00
Alexander Köplinger 5195135825 [System.IO.Compression.FileSystem] Improve ZipCreateFromEntryChangeTimestamp test
`entry.LastWriteTime` is an unspecified/local DateTime but we're
comparing it against `date` which is in UTC. This could lead to
issues where the Day isn't matching when running the test around
midnight.

Examples:

https://github.com/xamarin/maccore/issues/597
https://jenkins.mono-project.com/job/xamarin-android-pr-builder/2387/testReport/Xamarin.Android.Bcl_Tests,%20MonoTests.System.IO.Compression.FileSystem/ZipArchiveTests/ZipCreateFromEntryChangeTimestamp___Debug/
2018-01-25 10:36:26 +01:00
Balló György 693a7c896d Avoid crash under GNOME if no gtk+2 available (#6654)
gtk+2 is non-essential part of the GNOME 3 desktop nowadays.
2018-01-24 17:48:07 -05:00
Sauta, Usevalad a369eb8fb0 [WindowsBase] Use case-insensitive extension match in System.IO.Packaging.ZipPackage 2018-01-24 14:30:43 +01:00
Manuel de la Pena d568da2d1d Address review comments. 2018-01-24 12:50:37 +01:00
Manuel de la Pena 6108d098ce [Test] Skip some tests from System.ServiceModel on WatchOS.
Some of the classes are not supported in the platform while are
supported in MOBILE. Skip them accordingly.
2018-01-24 12:50:37 +01:00
Vlad Brezae 9fca288cab [interp] Abide by the abort threshold constraint
For mono_thread_get_undeniable_exception to work, it needs to unwind the stack and find the first managed frame. This is only possible if we push an interp LMF with a frame for the interp to native transition.
2018-01-24 12:17:02 +02:00
Vlad Brezae 8b1c87bc15 [interp] Interp frames are also managed 2018-01-24 12:17:02 +02:00
Vlad Brezae c52e05c19a [interp] Initialize sp for first interp frame
During interp frame unwinding, we were initializing the sp field (to the corresponding interpreter frame) starting with the parent frames of the first interpreter frame.
2018-01-24 12:17:02 +02:00
Vlad Brezae be280a1fe2 [interp] Remove checks not needed for try blocks
Leave from catch clauses is translated to MINT_LEAVE_S_CHECK, which does the exception reset and abort rethrow.
2018-01-24 12:17:02 +02:00
Marek Safar 07a0edbf4e [ci] Align acceptance tests timeouts 2018-01-24 09:22:14 +01:00
Bernhard Urban 236a8d6dc0 [offsetdumper] remove InterpMethodArguments
Every user of this tool is using architectures that are implementing
`CallContext`.
2018-01-23 21:45:36 +01:00
Jonathan Chambers 8ade62d7ca Reusee class unload cache filter logic from metadata in debugger. (#6641)
Debugger maintains it's own list of loaded classes. The unload/filter
logic does not handle composite types like arrays and generic instances.
Expose and reuse the logic from metadata that properly detects any
usage of an image within a type.

This prevents the cache from containing MonoClass values which have
already been freed by the metadata cleaning code.
2018-01-23 15:32:08 -05:00
Zoltan Varga 5c806eed27 [sgen] Use sgen_is_object_alive_for_current_gen () instead of sgen_is_object_alive (), the latter doesn't work for oldspace objects, causing the gc handle to be freed even through the object is still alive. Fixes https://github.com/mono/mono/issues/6490. (#6501) 2018-01-23 14:52:13 -05:00
jaykrell c8d6314d0c Understand PE32+, at least as much as PE32 is understood. (#6503)
* Minimal fix to Authenticode infrastructure to understand PE32+.
A number of other problems are noticed in the code but commented only.
This fixes https://bugzilla.xamarin.com/show_bug.cgi?id=56071

* Induce many array out of bounds accesses, and some other error paths.

* Tweaks.

* tweak

* Move braces, move addition, document constants and use them.

* whitespace

* fix comment

* remove diff-minimizing hacks

* cosmetic

* move braces and assume zero-initialization; adjust comment.

* improving Makefile but still a ways to go

* fix C# indent

* Change from C++ to C, and cleanup Makefile.

* update clean target in Makefile

* cleanup Makefile and C#

* remove test code that people don't like and it wasn't very useful
wordsmithing and new good information in comments

* Fix indentation
2018-01-23 14:07:20 -05:00
monojenkins b8e80e0ae5 [msvc] Update csproj files (#6642) 2018-01-23 16:59:46 +01:00
Mikhail Filippov 2f6005cc21 Fix NUnit reference generation 2018-01-23 14:40:00 +01:00
Alexander Kyte 49d2d5ae51 [tests] Fix cscs/mcs specific GetMethodBody logic 2018-01-23 14:37:12 +01:00
Michael DeRoy 36ad395368 Fixes an issue where a pipestream handle may be closed twice (Case 942966) 2018-01-23 14:13:07 +01:00
Vlad Brezae 57f08cedc8 [interp] Disable mixed mode tests
When an exception is thrown from jitted code, the EH mechanism correctly sets the interp resume data to the right interp frame that should catch the exception, but it resumes to the interpreter by force, setting the MonoContext. This context has invalid data (for example the SP points to a InterpFrame and it is not the real sp at interp exit)

This bug was exposed by inlining changes from d3763c6c1e
2018-01-23 10:59:12 +01:00
monojenkins 47a4c02dc2 Bump API snapshot submodule 2018-01-23 09:48:49 +01:00
Marek Safar 6b242716fb Bump corefx 2018-01-23 09:48:49 +01:00
Zoltan Varga c4affa12bc [jit] Clear cfg->error after inlining, the error can be ignored, it will happen when the called method is JITted. (#6587) 2018-01-22 20:32:45 -05:00
jaykrell da444c9d51 [perfcounters] Move machine handling from native to managed. (#6543)
* Move machine handling of performance counters from native
to managed -- just slightly less native code therefore.

* PR feedback: Rename ValidMachine to IsValidMachine.
             Use string::operator== instead of .Length/[].
             Change InstanceExistsInternal to return bool/MonoBoolean directly instead of int.
             Remove question mark on FIXME comment for more reliable grep.
             Remove redundant zeroing of a pointer.
2018-01-22 17:40:33 -05:00
Alexander Kyte 3363ec9cc4 [runtime] Apply cctor filters to callees of cctors (#6562) 2018-01-22 15:55:12 -05:00
Marek Safar 51e1e5af32 [mcs] Implements C# 7 tuples implicit deconstruction 2018-01-22 19:11:27 +01:00
Mikhail Filippov b519d42c15 Add test for reproduce problem in debugger stepping 2018-01-22 17:20:27 +01:00
jaykrell 31ec1631c2 Fix configure --disable-boehm to build more tests. (#6614) 2018-01-22 10:37:29 -05:00
Egor Bogatov 056a267752 Fix watchos tests for system.data (#6600) 2018-01-22 10:33:34 -05:00
jaykrell 181aa3c026 Fix missed closedir in commit 947d0bc0ef (#6599) 2018-01-22 10:32:30 -05:00
Aleksey Kliger a529b43453 [mono-error] Use mono_error_assert{f,_msg}_ok instead of if (is_ok (e)) g_error(...) 2018-01-22 10:27:06 -05:00
Aleksey Kliger 77c68b952b [mono-error] Use g_assertf in mono_error_assert_ok implementation
Also add two more variants

* mono_error_assert_msg_ok (err, msg) to print "msg, due to <err>" on failure
* mono_error_assertf_ok (err, fmt, args...) to print
  "<formatted args>, due to <err>" on failure.
2018-01-22 10:27:06 -05:00
Vlad Brezae d3763c6c1e [interp] Decrease stack usage (#6580)
Avoid inlining some functions with high stack frame locals usage (ex functions that use MonoLMFExt which is a big structure).

No performance cost was observed on microbenchmarks, while stack usage decreased by over 3 times on amd64 and over 4 times on arm.
2018-01-22 09:43:01 -05:00
Alexander Köplinger fad6e0cc31 Bump bockbuild to bump gtksharp (#6604)
https://github.com/mono/bockbuild/pull/57
2018-01-22 13:23:49 +01:00
Manuel de la Pena 668c90e2b6 [Tests] Skip a subset of the System.IdentityModel for iOS and Mac. (#6594) 2018-01-22 13:03:22 +01:00
Vlad Brezae 672efa3ef3 [interp] Disable tests on arm due to known issue
Due to clobbering of R8 by interp entry.
2018-01-22 12:28:11 +01:00
Jay Krell 844a927f25 This test is supposed to take between 1 and 2 seconds, but takes slightly longer in practise and fails.
Give it 2.5 seconds.

https://jenkins.mono-project.com/job/test-mono-pull-request-amd64/10727/parsed_console/log.html

Tests run: 120, Passed: 119, Errors: 0, Failures: 1, Inconclusive: 0
Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
Elapsed time: 00:00:32.8320000

Errors and Failures:

    EndBuildWaitsForSubmissionCompletion (MonoTests.Microsoft.Build.Execution.BuildSubmissionTest.EndBuildWaitsForSubmissionCompletion)
    #5
    Expected: less than or equal to 00:00:02
    But was: 00:00:02.0757916

at MonoTests.Microsoft.Build.Execution.BuildSubmissionTest.EndBuildWaitsForSubmissionCompletion () [0x00126] in /mnt/jenkins/workspace/test-mono-pull-request-amd64/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildSubmissionTest.cs:105
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-pull-request-amd64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
2018-01-22 12:24:35 +01:00
jaykrell 3b34235086 Convert dis, profiler, pedump, unit-tests to new MonoError/ERROR_DECL style. (#6607)
Convert dis, profiler, pedump, unit-tests to new MonoError/ERROR_DECL style.
2018-01-21 15:41:05 -08:00
jaykrell 5839d7b434 Split mono_method_get_header_checked into internal and external forms. (#6609)
Split mono_method_get_header_checked into internal and external forms. (#6609)
External form is mono_method_get_header_checked, the preexisting name.
Internal form is mono_method_get_header_internal.
External must initialize the MonoError for compatibility, internal can/should assume it is already initialized per the new pattern.
2018-01-20 22:15:48 -08:00
Zoltan Varga 40adef8a03 [jit] Move more declarations to mini-runtime.h. (#6586) 2018-01-20 21:38:48 -05:00
jaykrell 423cd24649 Check errors when mono_method_to_ir calls handle_delegate_ctor. (#6588) 2018-01-19 18:05:33 -05:00
Marek Safar eef1a5aff2 [mcs] Adds missing default literal conversion test in probing code path 2018-01-19 14:49:47 +01:00
Marek Safar a5e2efe17f [mcs] Fixes assumption that string class has no implicit/explicit conversion operators 2018-01-19 14:45:10 +01:00
Jay Krell 8a968a3550 Cleanup mono_string_to_utf16 -- use unichar2 type to advantage over char. 2018-01-19 03:52:01 -08:00
Marek Safar 44309f79f1 Bump linker 2018-01-19 09:45:20 +01:00
Alexander Köplinger 4e2b3ad0d9 Fix CLA link in CONTRIBUTING.md (#6585)
It was changed when .NET Foundation switched to new CLA infrastructure.
2018-01-19 01:36:45 +01:00
Vlad Brezae 117468d740 [interp] Add check for class failure 2018-01-18 13:33:05 -05:00
Vlad Brezae 0b398d63b0 [tests] Change test to use less stack
The interpreter uses a lot of stack and the stack overflows on this test.
2018-01-18 13:33:05 -05:00
Ramin Zaghi at Mosaic3DX.com 947d0bc0ef [mini] Make sure mkbundle executables work if they are run from a path on the PATH environment variable. (#6147)
* Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

* Review

* Fix build on Windows
2018-01-18 13:31:20 -05:00
jaykrell 12970c4bbd g_assert should be an expression not a statement; provide g_assertf f is format like printf (#6235)
* g_assert should be an expression not a statement; provide g_assertf f is format like printf

- g_assert should be an expression, not a statement
   ANSI C assert gets this correct, and I corrected
   widely used NT ASSERT circa 2001 with no ill effects
   Note that ANSI C assert is void, g_assert here is boolean.

 - provide g_assertf
   f is for format, like printf -- too terse?
   Where you might previously say:
   if (!(expr))
     g_error(...); // like printf
   now:
    g_assertf(expr, ...)

Manual tests provided -- how to provide a test whose success is failure to compile?
Correct existing eglib/test to build and pass, but don't enable in build.
Enabling it is a line in toplevel configure.ac to add eglib/test/Makefile
after eglib/Makefile.

* Fix comment in test code.

* format with s instead of hs

* review
2018-01-18 13:27:43 -05:00
Manuel de la Pena 12d676563e [Tests] Skip System.ServiceModel tests that are not supported on XamMac 4.5 (#6574) 2018-01-18 19:08:03 +01:00
jaykrell 2e029d691e Convert ves_icall_System_Threading_Thread_GetName_internal to coophandle. (#6435)
Convert thread get name to coop/handle (ves_icall_System_Threading_Thread_GetName_internal).
2018-01-18 08:27:56 -08:00
Jay Krell 6a04dc6451 Convert K&R warning farm to ANSI and add static/const.
Also smaller part fix C-vs.-C++-isms.
2018-01-18 14:35:36 +01:00
Rodrigo Kumpera 232af8c206 Add CI to WebAssembly. This is PR based on top of # Only the top 3 commits matter for this PR: (#6488)
* [WASM] Fix System.Core issues and disable broken tests.

* [wasm] Fix cookie computation heap overflow. Use a local to make it thread safe.

* [wasm] Disable System tests that don't work under WASM. Change the wasm profile to disable BSD sockets.

* [wasm] Address reviewer feedback.

* [wasm] Disable test that requires multiple threads.

* [wasm] Add package target to wasm.

* [wasm] Modify the runner to exit(1) if the test suite fails.

* [wasm] Add CI configuration for WebAssembly.

* [wasm] Fix issues found over review.
2018-01-18 14:34:00 +01:00
Alexander Köplinger 0c59209931 [tests] Disable weak-fields.exe on LLVM as well 2018-01-18 12:59:02 +01:00
Ankit Jain 06b9b48420 Bump msbuild (#6569) 2018-01-18 12:37:33 +01:00
Bernhard Urban 5ba19cb478 [configure] fix altstack detection
newer linux headers hide the `struct sigaltstack` definition (e.g. on
Ubuntu 17.10), probably because it is encouraged to use `stack_t`
anyway.

We use `stack_t` in our code anyway:
https://github.com/mono/mono/blob/146346977cea8aaed2de8ab6a84c2a58b30aea24/mono/mini/mini-exceptions.c#L2379

The change introducing the `ifdef` was already wrong imho:
https://github.com/mono/mono/commit/f6d15e14c234c505e4b5e4d5e46a2666370d2b4a
2018-01-18 09:31:03 +01:00
Alex Rønne Petersen 3491b7b604 [profiler] Write out all uncovered classes/methods in a loaded image. (#6544)
* [runtime] Export mono_class_get_checked () for use in profilers.

* [runtime] Expand mono_method_get_header_summary () to collect more info.

It now collects all the trivially-accessible header data that doesn't require
chasing down other metadata.

* [profiler] Use mono_method_get_header_summary () in the coverage code.

We only need code start and size information, not all the data that is present
in the header. By switching to this function, we avoid all the side effects
that come with resolving local variables and exception clauses (which can even
result in loading assemblies in the worst case).

* [profiler] Write out all uncovered classes/methods in a loaded image.

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

This required a bit of refactoring and some workarounds for various special
cases. This also fixes some race conditions with respect to how data was
inserted into the lock-free hash tables and queues.
2018-01-18 09:26:40 +01:00
Zoltan Varga 5e72bd6d01 [sdks] Set more ios version variables to empty to fix the build. (#6571) 2018-01-18 01:16:01 -05:00
Zoltan Varga 511c2fd59c [sdks] Set XCODE_VERSION to 'Xcode' for now to fix the ios build. (#6568) 2018-01-17 23:54:59 -05:00
Alexander Köplinger a99d7f4b13 [ci] Use correct -arch syntax in CFLAGS on OSX (#6570)
In c7d8d247c3 I unified how we're
passing -arch in CFLAGS to "-arch=XXX" since the original change
in 63a49e9eb8 mixed the formats.

Turns out the correct syntax is "-arch XXX" instead and it broke
the ccache build in bockbuild because it complained about the
unknown format.

Also add LDFLAGS in the amd64 case to match what we have in bockbuild.
2018-01-18 03:37:54 +01:00
Vlad Brezae 4490aa5112 [runtime] Fix jit info leak when having aot images loaded
When we had a jit info table for aot images loaded in the domain, we would queue jit infos for freeing at domain unload time. This means leaking during entire application life.

Add comment for jit info freeing when having multiple tables.

Fixes #60986.
2018-01-17 20:51:35 +01:00
Katelyn Gadd a717f377f0 Fix bug 60848: Incorrect unicode custom attribute decoding (#6481) 2018-01-17 20:47:43 +01:00
Radek Doulik 9a183f2c83 [Tests] Do not assume order of returned interfaces
Updated the System.Reflection.Emit/SaveTest to not depend on order of
interfaces returned from the System.Type::GetInterfaces method, as the
order is not guaranted. As described in the [documentation][0].

Also see github [issue][1] for more information and reasoning.

[0]: https://msdn.microsoft.com/en-us/library/system.type.getinterfaces(v=vs.110).aspx#Anchor_2
[1]: https://github.com/xamarin/xamarin-android/issues/1186
2018-01-17 20:44:25 +01:00
Vlad Brezae f162931e25 [mini] Fix seq point info leak (#6522) 2018-01-17 20:06:17 +02:00
Rodrigo Kumpera 146346977c Revert "Implement trivial loop detector in the front end and use it to drive inlining decisions. (#6478)" (#6557)
This reverts commit 411791c469.
2018-01-17 11:18:12 -05:00
Rodrigo Kumpera 411791c469 Implement trivial loop detector in the front end and use it to drive inlining decisions. (#6478)
This cute hack allow us to cut the budget of perf irrelevant blocks[1] while massively boosting those that are perf relevant[2].

It has a ton of missing features, like it doesn't detect nested loops, it doesn't take hints from inlined methods and it doesn't compute EH info.
Beyond that, inlining budget is all but horrible, so there's ton of room for improvement here.

Results are promising.

A marginal improvements in benchmarks like Roslyn (2% user) while as much as 30% in micro benchmarks where the now bigger methods are in loop bodies.
Code size with Roslyn changed from 5433242 to 5501751, IE extra 68.5k, or 1.2% more.

[1] those ending in throw or in a catch handler
[2] Loops
2018-01-17 15:42:40 +01:00
jaykrell b909a77020 return 0 is generally redundant in configure.ac, as the construction (#6528)
of the test program wraps the text in int main() { ... ; return 0; }
2018-01-17 15:32:04 +01:00
jaykrell bbf6b67483 Fix some warnings. (#6526) 2018-01-17 15:31:00 +01:00
Egor Bogatov acea63a9c1 Improve GetArgumentName in MonoOptions. Fixes bug-60904 (#6506)
* Rewrite Options.GetArgumentName to use Regex

* code cleanup

* code cleanup
2018-01-17 15:30:14 +01:00
Bernhard Urban f49e87d42a [exceptions] remove restore_stack_prot from managed code (#6518)
it's dead code. restore happens in `restore_soft_guard_pages` upon
returning from the altstack machinery.
2018-01-17 15:25:03 +01:00
Vlad Brezae cdecb851ff [sgen] Fix overflow on large arrays (#6542) 2018-01-17 15:11:47 +01:00
Bernhard Urban e39acb7a0d [exception] propagte stackoverflow exception to managed code (#6458)
we return the address of the StackOverflowException object in
`restore_soft_guard_pages`, so it ends up in the architecture specific
result register (e.g. %rax) where the exception handler expects it.

fixes https://bugzilla.xamarin.com/show_bug.cgi?id=60862
2018-01-17 15:10:15 +01:00
Marek Safar c282af6df5 [mcs] Implements C# 7.0 discards 2018-01-17 14:43:18 +01:00
Manuel de la Pena 3f372d06ee [Tests] Skip some of the System.ServiceModel tests when using MOBILE (#6545)
Mobile does not support all clases found in System.ServiceModel, we skip
those tests of the not supported classes yet run all the others.
2018-01-17 13:50:28 +01:00
jaykrell 1e4f6b185b Convert thread get/set/clear state to coop/handle. (#6389)
* Coop-handle ves_icall_System_Threading_Thread_GetState, SetState, ClrState.
And cleanup.

* Favor mono_internal_thread_handle_ptr.
2018-01-16 12:55:34 -08:00
Marek Safar 370105c5e0 [profiler] Don't double escape special characters. (#6534)
The output of parse_generic_type_names is processed by escape_string_for_xml and
we were double escaping `&` character
2018-01-16 21:02:34 +01:00
monojenkins 7fa8269076 [msvc] Update csproj files (#6538) 2018-01-16 20:39:25 +01:00
Miguel de Icaza d1649e90fc [corlib] Use Environment.Platform to access the platform, rather than probing the file system (#6535)
Alternatve patch to: #6533
2018-01-16 20:36:50 +01:00
EgorBo 15fad0dac2 fix system.data ssl-bug on linux 2018-01-16 13:49:25 +01:00
Jay Krell 042056452a Remove ampersands on MonoError variables name "error", but not on the others. 2018-01-15 23:51:22 -08:00
Jay Krell 111786f944 Support for removing ampersand on MonoError variables and other
preparation for MonoError cleanup (specific use-cases instead
of one error_init).
2018-01-15 23:51:22 -08:00
Jay Krell 31070dfdc0 In MonoError, provide a uint32_t for initialization with
just one instruction instead of two (at least it makes
a difference on the Apple arm32 target).

Also favor expressions over statements.
2018-01-15 23:51:22 -08:00
Jay Krell 242980e00e replace new MonoError with ERROR_DECL 2018-01-15 23:51:22 -08:00
Jay Krell b68b5ad1be Replace some "error" with "gerror" so that "error" is more often a MonoError or MonoError*. 2018-01-15 23:51:22 -08:00
Marek Safar 00934efe15 [corlib] Fixes StoppedThreadsThrowThreadStateException test build 2018-01-16 08:46:03 +01:00
Alexander Köplinger 0d9c3dfff4 [tests] Bump timeouts in process-stress-?.exe runtime tests (#6515)
* [test-runner] Record test duration in NUnit xml

This allows us to keep track of the time on Jenkins.

Also fix issue where we were recording .Seconds of a TimeSpan instead of .TotalSeconds.

* [tests] Bump timeouts in process-stress-?.exe runtime tests

We're seeing these fail sometimes on Linux Azure VMs, let's try
if bumping the timeouts helps.
2018-01-15 20:09:07 +01:00
Zoltan Varga 902626bb80 [runtime] Disallow casts between int[] and IList<int?> etc. Fixes #6401. 2018-01-15 18:18:27 +01:00
Marek Safar 46bb11eb33 [mcs] C# 7.2 non-trailing named arguments 2018-01-15 17:59:44 +01:00
monojenkins 5929e348e9 [msvc] Update csproj files (#6516) 2018-01-15 16:49:55 +01:00
Alexander Köplinger 2a03be316d [class] Add Obsolete message to ICSharpCode.SharpZipLib.dll (#6511)
* [class] Add Obsolete message to ICSharpCode.SharpZipLib.dll

Users should use the nuget package instead, we'll remove the assembly in Mono 6.0

Don't install it into the 4.7.1 reference assembly directory anymore.

* Bump API snapshot submodule
2018-01-15 16:39:14 +01:00
Vladimir Kazakov 89c76cdfa1 Add System.ServiceModel.Description.UseRequestHeadersForMetadataAddressBehavior. (#6508) 2018-01-15 10:25:15 +01:00
EgorBo dee8dc3245 change messages for some system exceptions (consistency with .net) 2018-01-15 10:05:45 +01:00
Manuel de la Pena 001d4d5082 [Tests] Ensure that tests are runnable on xamarin-macios (#5875) 2018-01-15 09:26:27 +01:00
Zoltan Varga faecfce5d0 [runtime] Fix some default interface method problems. (#6484)
* [runtime] Allow access to protected default interface methods from classes which implement the interface.

* [interp] Add some automatic conversations between virtual and non-virtual calls that .net has. Fixes dim-valuetype.il.

* [bcl] Sort the MethodImpl table in PEAPI.

* [runtime] Enable dim-methodimpl.exe test.

* [runtime] Fix vtable construction tracing.

* [interp] Fix null checks on the receiver when converting virtual calls to non-virtual.
2018-01-12 08:34:18 -05:00
Ludovic Henry 9484143e93 [eglib] Add g_assertf (#6483) 2018-01-12 11:17:06 +01:00
Johan Lorensson 52db7f6ae7 Merge pull request #5964 from lateralusX/lateralusX/add-pending-joinable_support
Wait on runtime threads to complete detach/unregister during shutdown.
2018-01-12 09:32:30 +01:00
Katelyn Gadd 7eb8a58597 Fix bug 60359 2018-01-12 08:59:35 +01:00
Bernhard Urban b30a5d37e4 [exception] unprotect whole stack guard if a stack overflow occurs
Rationale:

1. it asks for double faulting scenarios we can't do anything about
   it anyway, exception just unmap yet another page

2. `mprotect(2)` behaves weirdly (at least on macOS) if you try to
   change permissions for subsequent pages with different permissions.
   With the previous code it happened that the requested memory range
   would go from somewhere in the stack guard and overlap into the
   regular, unprotected stack and end up with unpredictable behaviour.
   We could be more careful about it, but it would complicate things
   even more.
2018-01-12 00:41:50 +01:00
Ludovic Henry cdb93684e7 [sdks] Extract versions into a dedicated file (#6474) 2018-01-11 19:28:56 +01:00
Rodrigo Kumpera 77ba59959f Merge pull request #6480 from kumpera/disable-cross-domain-autointern
[runtime] Don't auto intern a string just because another domain has done the same.
2018-01-11 13:12:55 -05:00
jaykrell c3a9d69c8a mono_string_new_utf32_checked leaks in error path, and produces some unused data. (#6374)
* mono_string_new_utf32_checked leaks in error path, and produces
 some unused data.

* assume equivalence of error and null

* line damage
2018-01-11 11:41:57 +01:00
jaykrell c87842d24e Reduce use of mono_marshal_string_to_utf16 which appears (#6438)
no longer needed. It remains only for register_icall.

Remove casts from void* to HANDLE, as HANDLE always and forever
will also be void*.

Add comments explaining the valid use of INVALID_HANDLE_VALUE (-1).
With CreateFileMapping, for the file handle, it means to
use physical memory / pagefile.
2018-01-11 11:38:40 +01:00
Jonathan Chambers 6c9339dd80 Pass TRUE for 'repeat' of send variants. This matches behavior of receive variants. Fixes blocking send call where Win32 returns WSAEWOULDBLOCK. (#6453)
Related to issue https://github.com/mono/mono/issues/6464
2018-01-11 11:34:14 +01:00
Rodrigo Kumpera bcc32da914 [runtime] Don't auto intern a string just because another domain has done the same.
Previously, we tried to keep the intern status of a string consistent across domains. Meaning
that if you interned "FOO" in domain 0, it would return true for String.IsInterned in domain 1.

This behavior exists in the CLR because the string table is shared between domain as string are
what they call agile objects - those that can exit in multiple domains at the same time.

Mono appdomain isolation doesn't work that way and there's not visible advantage of keeping that property.

The reason for this change is to potentially reduce the amount of interned strings and, more importantly,
reduce the amount of domain lookups, which are quite expensive and unsafe.

This should speed up interning queries.
2018-01-10 17:22:21 -08:00
Marek Safar 111a7b3b12 Bump monolite version (#6475)
missed in 190d357c2739a2a294f781b1939d76cb7c340aca
2018-01-11 02:02:51 +01:00
Vlad Brezae 51c200c71f [test] Rename test
There were 2 vararg.exe
2018-01-11 01:38:31 +01:00
Vlad Brezae 6381b6608c [interp] Add support for ldflda with remoting
Field access for classes like MarshalByRefObject need to go through a wrapper.
2018-01-11 01:38:31 +01:00
Vlad Brezae baaf49441c [interp] Allow interp stack to be greater than il stack 2018-01-11 01:38:31 +01:00
Ludovic Henry b58dee4b87 [coop] Disable failing tests on PR (#6472) 2018-01-10 23:23:37 +01:00
monojenkins ec09d13a8e [msvc] Update csproj files (#6473) 2018-01-10 16:46:43 +01:00
Marek Safar 6aa4e4dac9 [corlib] Optimizes non-intrinsics version of string indexer code 2018-01-10 14:41:59 +01:00
Miguel de Icaza e9913fdc48 Improve sgen error reporting for assemblies it attempts to process (#6463)
Makes it simpler to see what is wrong with an assembly.
2018-01-09 20:23:10 +01:00
Marek Safar 25bff86cee Bump corert (#6420)
* Bump corert

* Bump API snapshot submodule
2018-01-09 17:45:26 +01:00
Alexander Köplinger ad5703adfd [System] Set exception on Finish*Failure in SocketAsyncEventArgs (#6462)
Follow up to https://github.com/mono/mono/pull/6431, we should
capture the exception that is passed to the methods.

Copied the SetResult() method that referencesource uses.
2018-01-09 15:45:47 +01:00
jaykrell e6a167a7cd mono_string_to_utf32 produces unused data. (#6375) 2018-01-09 15:31:06 +01:00
Ludovic Henry ba40387f50 [w32process] Ensure process_handle is a legal value (#6449)
* [w32process] Ensure process_handle is a legal value

Fixes https://github.com/mono/mono/issues/6383

* [w32process] Remove dead code
2018-01-09 15:16:57 +01:00
Miguel de Icaza fc2d278cc4 Add capability to list more than one method to be verbose, document some internal APIs, update man page with more explanations (#6426) 2018-01-09 10:14:52 +01:00
Bernhard Urban 711a02e465 [mini] factor out interp into a library (#6419)
* [mini] factor out interp into a library

It enables us to ship the interpreter as an add-on to the runtime.
Embedder can statically link it into their application on demand.

Usage:

configure mono without the interpreter, such as:

```
$ ./autogen.sh --enable-minimal=interpreter ...
$ make; make install
```

run your favorite program with the interpreter and see it fail:

```
$ ./mono/mini/mono-sgen --interpreter ./mono/mini/basic.exe
Mono IL interpreter support is missing
```

despite `--enable-minimal=interpreter`, we can still build the interp
module:

```
% make -C mono/mini libmono-ee-interp-static.la
  CC       interp/libmono_ee_interp_static_la-interp.lo
  CC       interp/libmono_ee_interp_static_la-mintops.lo
  CC       interp/libmono_ee_interp_static_la-transform.lo
  CCLD     libmono-ee-interp-static.la
```

`libmono-ee-interp-static.a` can be statically linked into the target
application.

* [fixup] include libmono-ee-interp reference in runtime unit-tests
2018-01-09 10:05:29 +01:00
Andrew Au 57a2cce4b1 Fix a typo 2018-01-09 09:55:54 +01:00
jaykrell f4bbf7a3b9 Cleanup arm64 OP_SHL_IMM to share code with OP_LSHL_IMM. (#6444) 2018-01-08 23:14:00 +01:00
jaykrell fa83e7828c Convert thread get and set priority to coop/handle. (#6436) 2018-01-08 23:07:47 +01:00
jaykrell 8422ea56bc Convert GetCurrentThread to coop/handle. (#6437) 2018-01-08 23:06:57 +01:00
Aleksey Kliger (λgeek) ab9ecc9903 [metadata] Mark several functions external only (#6384)
* [runtime] Mark mono_class_get and mono_class_get_full external only.

   Runtime should use mono_class_get_checked and
   mono_class_get_and_inflate_typespec_checked, respectively.

* [runtime] Mark mono_ldtoken external only

   Runtime should use mono_ldtoken_checked

* [metadata] Mark mono_type_create_from_typespec external only

   Runtime should use mono_type_create_from_typespec_checked

* [runtime] Remove mono_class_inflate_generic_method_full.

   Mark mono_class_inflate_generic_method external only.

   Runtime should use mono_class_inflate_generic_method_full_checked.

* [runtime] Mark mono_get_inflated_method external only

   This function is obsolete.  It should have no callers.

* [metadata] Mark mono_field_from_token external only

   Runtime should use mono_field_from_token_checked

* [runtime] Add MonoError arg to mono_class_get_inflated_method

* [metadata] Mark mono_metadata_parse_method_signature external only

   Runtime should use mono_metadata_parse_method_signature_full

* [metadata] Mark mono_metadata_interfaces_from_typedef as external only.

   Runtime should use mono_metadata_interfaces_from_typedef_full

* [mini] Add MonoError arg to mono_class_get_method_generic

   Also move its declaration from metadata/class-internals.h to mini/mini.h
   since it's defined and used in mini/

* [class] Assert that mono_class_get_inflated_method never returns NULL
2018-01-08 16:16:45 -05:00
Marek Safar df0fd973cc Make suggestions in github issue template XML comments 2018-01-08 16:42:54 +01:00
Alexander Köplinger 1b5fa0e059 Fix Windows build
fd325223ba didn't change this occurrence of 'error' to 'gerror'.
2018-01-08 15:14:37 +01:00
Miguel de Icaza 406b40bb77 Implement a couple of SocketAsyncEventArgs methods 2018-01-08 13:18:19 +01:00
Vlad Brezae 6ae3e4795c [interp] Add missing param support for floating types in interp_entry (#6427)
* [interp] Add missing param support for floating types in interp_entry

Remove some duplicated code

* [interp] Reenable thunks.exe on arm

It fails due to the known RGCTX register clobbering by trampolines.
2018-01-08 14:16:24 +02:00
jaykrell 61f6da9cb4 return_val_and_set_pending_if_nok macro is missing do/while0. (#6396) 2018-01-08 10:33:40 +01:00
Robert Nagy e31ecb3b41 openbsd related patches (#6358)
* include netinet/in.h for in_addr_t

* there is no need for an openbsd specific implementation anymore
so you use the generic pthread one

* signal.h is required for sigaltstack

* add missing mono/utils/mono-threads.h include

* there is no malloc.h on OpenBSD either

* sys/socket.h is required for struct sockaddr

* add support for btls on openbsd and default to with_tls=pthread as there is only emultls support which is not enough for mono

* there is no need for pthread_attr_init/destroy anymore

* add -Wl,-zwxneeded to LDFLAGS on OpenBSD

W^X is strictly enforced by default on OpenBSD;
a program can only violate it if it is located on a filesystem mounted
with the wxallowed mount(8) option and has been linked with the
above flag
2018-01-08 10:25:19 +01:00
David Karlaš 3277e2be43 [profiler] Fixed GCResizeEvent value overflow (#6335)
In case application was using more than 2GB of heap memory it started reporting minus values because `emit_value` accepts `int`
2018-01-08 10:24:40 +01:00
jaykrell fd325223ba Rename some occurences of "error" to "gerror" so that (#6447)
"error" is more often specifically MonoError.
2018-01-08 10:15:02 +01:00
jaykrell a4ac0aa8a5 if MONO missing in Fix some ThreadPool performance counters. (#6118) (#6434) 2018-01-08 09:48:22 +01:00
Aleksey Kliger (λgeek) 0fb4f03a1b [centrinel] Suppress warning about body of mono_internal_thread_handle_ptr (#6432)
Since object-internals.h is included in a ton of places, we get one Centrinel warning
about mono_internal_thread_handle_ptr per translation unit every time the
header is included which is ridiculously noisy.

This commit will suppress the warning about the body of this function.

Note that uses of the function will still get a warning since it returns a
MonoInternalThread* and we haven't yet taught Centrinel that those calls are ok since
the thread object is pinned.
2018-01-08 09:47:31 +01:00
Zoltan Varga 48badade21 [jit] Convert stores into sign/zero extensions for small ints during alias-analysis. Fixes gh #6414. (#6440) 2018-01-07 18:43:10 +01:00
Bernhard Urban efb6eb891c [interp] fix build when interpreter is disabled (#6416)
```
mini-amd64.c:1103:36: error: incomplete definition of type 'struct _MonoInterpCallbacks'
                        gpointer ret_storage = interp_cb->frame_arg_to_storage ((MonoInterpFrameHandle)frame, sig, -1);
                                               ~~~~~~~~~^
./mini-runtime.h:162:16: note: forward declaration of 'struct _MonoInterpCallbacks'
typedef struct _MonoInterpCallbacks MonoInterpCallbacks;
               ^
mini-amd64.c:1103:61: error: use of undeclared identifier 'MonoInterpFrameHandle'
                        gpointer ret_storage = interp_cb->frame_arg_to_storage ((MonoInterpFrameHandle)frame, sig, -1);
                                                                                 ^
mini-amd64.c:1134:12: error: incomplete definition of type 'struct _MonoInterpCallbacks'
                interp_cb->frame_arg_to_data ((MonoInterpFrameHandle)frame, sig, i, storage);
                ~~~~~~~~~^
./mini-runtime.h:162:16: note: forward declaration of 'struct _MonoInterpCallbacks'
typedef struct _MonoInterpCallbacks MonoInterpCallbacks;
               ^
mini-amd64.c:1134:34: error: use of undeclared identifier 'MonoInterpFrameHandle'
                interp_cb->frame_arg_to_data ((MonoInterpFrameHandle)frame, sig, i, storage);
                                               ^
mini-amd64.c:1214:11: error: incomplete definition of type 'struct _MonoInterpCallbacks'
        interp_cb->data_to_frame_arg ((MonoInterpFrameHandle)frame, sig, -1, storage);
        ~~~~~~~~~^
./mini-runtime.h:162:16: note: forward declaration of 'struct _MonoInterpCallbacks'
typedef struct _MonoInterpCallbacks MonoInterpCallbacks;
               ^
mini-amd64.c:1214:33: error: use of undeclared identifier 'MonoInterpFrameHandle'
        interp_cb->data_to_frame_arg ((MonoInterpFrameHandle)frame, sig, -1, storage);
```
                                       ^
2018-01-06 23:39:48 +01:00
Jay Krell 17a2fba78d Replace MonoError foo; with ERROR_DECL (foo); 2018-01-06 11:48:39 -08:00
Jay Krell 4aa6582504 Add initial ERROR_DECL for easier to read history. 2018-01-06 11:48:39 -08:00
Alexander Köplinger b5c5c55368 [System] Recursively delete directory in ApplicationSettingsBaseTest
Otherwise we'd get a "directory not empty" exception in the
TestFixtureTearDown (which for some reason isn't shown in the log?).

This was added in https://github.com/mono/mono/pull/6272
2018-01-06 01:40:49 +01:00
Alexander Köplinger e0f362764e [System] Clear XDG_DATA_HOME and XDG_CONFIG_HOME in ApplicationSettingsBase tests (#6417)
They were set in https://github.com/mono/mono/pull/6272 but since
env vars are process wide we'd end up with non-existing paths once
the tests are done. It is safer to unset the variables after the test.
2018-01-06 01:37:26 +01:00
jaykrell ad64e938a2 Merge pull request #6392 from jaykrell/string_equal
Provide g_utf16_ascii_equal and g_utf16_asciiz_equal for comparing utf16 to ascii for equality.
2018-01-05 10:26:22 -08:00
monojenkins 6dd4ff09f6 [msvc] Update csproj files 2018-01-05 16:46:19 +01:00
Alexander Köplinger 261b75e047 [ci] Bump timeout in acceptance-tests 2018-01-05 15:28:45 +01:00
Marek Safar aa2ecc7053 [corlib] Fixes ThreadPoolTest test 2018-01-05 15:09:51 +01:00
Alexander Köplinger 3b6c67d61f [scripts] Ignore build output 2018-01-05 13:35:00 +01:00
Eberhard Beilharz 63a8b08dd7 [System] Improve ApplicationSettingsBase behavior (#6272)
* [System] Add unit test for Xamarin-2315

* [System] Use temporary directory for saving settings files

This change modifies the ApplicationSettingsBaseTests so that they
store the settings files in a temporary directory. This reduces
the risk of failed tests because of stale files from previous test
run, or from a build that runs in parallel.

* [System] Improve Settings behavior (Xamarin-15818)

Improve behavior of ApplicationSettingsBase class to match Windows .NET
more closely.
* Implement Upgrade to allow Upgrading of settings
* Make SettingsPropertyValue serialization work for complex objects
* Make Save and Update throw in unimplemented configurations
* Changed Reload to clear PropertyValues so they are reloaded
  and fire PropertyChanged event for all Properties
* Modified Reset to do what Reload used to do.
* Added a backup Type loading for custom SettingsProviders
* don't call SettingsSaving on Reset()

* [System] Fire SettingsSaving event (Xamarin-2315)

When calling ApplicationSettingsBase.Save() the SettingsSaving
event has to be fired.

* [System] Add unit tests for Xamarin-15818
2018-01-05 13:08:20 +01:00
David Karlaš db5f38402f [PerfCounters] Added "Page File Bytes" which shows VmSwap and made few MacOS counters more accurate 2018-01-05 11:42:13 +01:00
Marek Safar c1c70a3622 [build] Bump bootstrap mcs dependency for mcs builds 2018-01-05 11:39:13 +01:00
Vlad Brezae bb17db90a1 [interp] Interp fixes (#6334)
* [interp] Check for exception at field address failure

For example if the static constructor throws an exception

* [interp] Run class cctor before allocating objects

Otherwise we could end up throwing TypeInitializationException from the finalizer thread. We do the same with jit (emit_class_init).

* [interp] Check for method access failure when doing a call
2018-01-05 11:11:54 +01:00
Bernhard Urban d6e5957ecb [valuetypes] incorporate review feedback for 77a53f0dc9 (#6403) 2018-01-05 10:53:02 +01:00
Katelyn Gadd 4051586e6f Replace explicit make invocations with uses of the MAKE variable 2018-01-05 10:28:11 +01:00
Katelyn Gadd 1f174145d1 Fix a race condition in TcpListenerTest caused by sockets' accept queue not filling instantly when machine is under load 2018-01-05 10:27:26 +01:00
Alexander Köplinger 861e52e25c [runtime] Fix include paths (#6402)
VSCode complains about not finding these.
2018-01-05 01:11:46 +01:00
Vladimir Kazakov d036958986 XMLDSIG from .NET Core. (#6154) 2018-01-04 23:20:13 +01:00
Rodrigo Kumpera 87315d19c6 Merge pull request #6372 from kumpera/wasm-p3
[wasm] Improve docs on how to build/test WebAssembly. Add System and System.Core test suite. Improve dep tracking for bcl test suites.
2018-01-04 10:24:38 -08:00
Rodrigo Kumpera f7f280c739 Merge pull request #6329 from lewurm/unaligned-ptrs-in-valuetype-equals
[valuetypes] use memcmp in default implementation of Equals
2018-01-04 10:17:18 -08:00
Bernhard Urban 866d0ad482 [interp] move up rtm assigment so it won't be NULL on potential usage (#6390)
THROW_EX expands to a potential usage of `rtm`
2018-01-04 18:32:30 +01:00
Alexander Köplinger 0f9bb15622 [I18N] Add CP737 (Greek) and CP775 (Baltic) (#6361)
* [I18N] Add CP737 (Greek) and CP775 (Baltic)

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

* Bump API snapshot submodule
2018-01-04 16:29:43 +01:00
Alexander Köplinger c60f2c4ca2 Bump bockbuild 2018-01-04 16:11:40 +01:00
Alexis Christoforides 83d6abd219 Merge pull request #6385 from akoeplinger/bump-gtksharp
Bump gtksharp in bockbuild
2018-01-04 17:04:30 +02:00
Bernhard Urban 7a5df3c524 [mini] Allow stind.ref only on object references. (#6164)
* [mini] Allow stind.ref only on object references.

* [marshal] stind.ref is invalid for non-reference types
2018-01-04 10:18:20 +01:00
jaykrell dc312c772f Fix some ThreadPool performance counters. (#6118)
* Fix some ThreadPool performance counters.
https://bugzilla.xamarin.com/show_bug.cgi?id=41294

The bug is that some performance counters are always zero.
Because we do not update them.
This addresses two of them: Work items added and thread count.

There is PerformanceCounter class and you can Increment instances,
however its metadata and some of the implementation is in System.dll.
Most of the code is in native.
ThreadPool is in mscorlib.dll, so can't use System.dll.
A few options exist to address this.
We could move and forward the type. We could duplicate and rename
and possibly subset the type.
Here we add a new icall very specifically for the scenario.

There is slight cost for the icall, and for the atomic increment.
There is an attempt to measure but the results were unclear.

Note that the count of work items is not specifically for QueueUserWorkItem
as one might expect, but also for any async calls.

Fix a little bit of typos.

* Take command lines from command line per PR feedback.

* newline at end of file
2018-01-04 10:17:30 +01:00
Miguel de Icaza e0e185d70a Adds support for nanosecond resolution file information where available (Fixes: 6283) (#6307)
* Adds support for nanosecond resolution file information where available.

This patch adds support to the runtime to use the nanosecond
information available on Mac and Linux on `struct stat`.
`stat.st_Xtimespec` strucutre on OSX, and `stat.st_Xtime` and
`stat.st_Xtim.tv_nsec` pair on Linux.

Additionally, this adds support in `Mono.Posix` for MacOS nanosecond stat
data, it already had Linux support before.

* Use ULL here to prevent the computation from overflowing
2018-01-04 10:04:56 +01:00
Jay Krell 7c6f619ae5 Provide g_utf16_ascii_equal and g_utf16_asciiz_equal for comparing
utf16 to ascii for equality.

g_utf16_ascii_equal takes lengths, which are checked first
and unequal length implies unequal strings, and then no characters are looked at.

"z"" for zero means nul terminated and requires scanning the string.
Still, an equality primitive is often desired vs. inverting inequality.

These can cleanup some code -- extracted from a larger not yet commited PR
that uses it.
2018-01-03 19:24:28 -08:00
Marek Safar 975765dbab Bump corefx (#6119) 2018-01-03 18:54:35 +01:00
Alexander Köplinger ffc3a83d9b Bump gtksharp in bockbuild 2018-01-03 17:13:58 +01:00
Alexander Köplinger 3826a69bc0 [packaging] Whitelist vbc command in OSX pkg (#6382)
We added vbc in https://github.com/mono/mono/commit/8be2726e127a969cd73e4e92ed03b053f13ed5d5
but didn't whitelist it in the Mac package.
2018-01-03 16:35:39 +01:00
Alexander Köplinger ccd3e6ff12 Update a few more Bugzilla URLs to GitHub (#6381)
Also update the WinForms readme to remove outdated content while at it.
2018-01-03 13:18:11 +01:00
Bernhard Urban 1710dd74fe [configure] change bug URL (#6378) 2018-01-03 12:06:54 +01:00
Vladimir Kazakov 05e8f2b8d7 Add a possibility to use empty X.509 certificates.
Fixes #6264.
2018-01-03 11:27:20 +01:00
Marek Safar 5de513945b [mcs] Allow calling by-ref types virtual methods which can be devirtualized. 2018-01-03 11:23:29 +01:00
jaykrell e23e916f26 The only call to mono_string_to_utf8_mp is in the file that implements it -- object.c. (#6377)
So remove it from any header, even an internal one, and make it static.
2018-01-03 08:46:33 +01:00
Alexander Köplinger ff197eb405 [packaging] Remove files from gtksharp package that would overwrite Mono files
I found out that we were packaging e.g. MonoPosixHelper.dll from
the gtksharp msi instead of the one we build in Mono :P

This only happened in the x86 build because we don't package
gtksharp in the x64 build.
2018-01-03 00:06:40 +01:00
Bernhard Urban 77a53f0dc9 [valuetypes] use memcmp in default implementation of Equals for unaligned fields
some architectures (e.g. ARM) do not support reads of unaligned pointers

fixes https://github.com/mono/mono/issues/6320
2018-01-02 23:30:25 +01:00
Rodrigo Kumpera 4b0b545236 [wasm] Improve docs on how to build/test WebAssembly. Add System and System.Core test suite. Improve dep tracking for bcl test suites. 2018-01-02 11:37:39 -08:00
Alexander Köplinger d3356e6aab [packaging] Add check for cygwin paths on Windows (#6364)
We don't want to package these, found a few that needed to be removed/fixed.
2018-01-02 20:30:11 +01:00
Marek Safar 23675d6292 [runtime] Adds System.Numeric remapping. Fixes #6339 2018-01-02 18:58:29 +01:00
jaykrell 8bbebd920a Remove duplicated code by factoring on endian parameter. (#6321)
* Remove duplicated code by factoring on endian parameter.

* Force inline to mimic previous.

* fix the forceinline part

* Do not forceinline utf32, we never use it.
2018-01-02 18:21:40 +01:00
Aleksey Kliger 009e2d8835 [sre] Emit a memberref token for fields,methods of a gtd
This can happen when emitting code like:
```
  class Foo<T> {
    T elt;
    public T getter () {
      return elt;  // ILGenerator.Emit (OpCodes.Ldfld, /*FieldBuilder of Foo::elt*/)
    };
  }
```

the old incorrect code emitted a fielddef token for Foo::elt, but it should be a
memberref for Foo<!0>::elt.

Likewise, if we have
```
class Foo<T> {
  public T f () { /*...*/}
  public void g () {
    var x = f (); // ILGenerator.Emit (OpCodes.Call, /* MethodBuilder of Foo::f */)
    /*... */
  }
}
```

Fixes https://github.com/mono/mono/issues/6192

the old incorrect code would emit a fieldref token for Foo::f but it should be
a memberref for Foo<!0>::f
2018-01-02 12:05:48 -05:00
Aleksey Kliger 6102b95385 [tests] SRE check that a memberref token is emitted for a gtd
Regression test for https://github.com/mono/mono/issues/6192
2018-01-02 12:05:48 -05:00
Alexander Köplinger af165436b5 Don't add linker tests to tarball
They contain files with very long names which causes issues with `tar`.

We simply remove them from the dist directory before creating
the tarball since we don't use them in the Mono build anyway.

Fixes https://github.com/mono/mono/issues/6349
2018-01-02 16:51:09 +01:00
Alexander Köplinger c354ac8ac1 Dist files in groups of 100 entries
On some distros the number of strings you can pass to execve()
is limited which means you get the following error when trying
to create the tarball:

```
make[5]: execvp: /bin/sh: Argument list too long
make[5]: * [../../build/rules.make:303: dist-default] Error 127
```

To solve this we split the DISTFILES variable into groups of 100
entries and invoke the shell for each group instead of adding all
into the same invocation. Also removed looking for 'makefile' and
'GNUmakefile' since those don't exist in Mono and simplifies the logic.

Found during investigation of https://github.com/mono/mono/issues/6349
2018-01-02 16:51:09 +01:00
Marek Safar 1003597c4e [mcs] Implements 7.2 stackalloc to Span assignment conversion. 2018-01-02 15:30:28 +01:00
Marek Safar eb3f9147ae [mcs] readonly struct this can be reassigned within ctor 2018-01-02 15:05:20 +01:00
Aleksey Kliger (λgeek) e5246d94ab Merge pull request #6331 from lambdageek/string_new_error_leak
Don't leak glib error in mono_string_new_checked
2017-12-28 12:09:12 -05:00
Alexander Köplinger f93caff1c8 [packaging] Windows: remove FSharp.Core from GAC (#6345)
See https://github.com/mono/mono/pull/6295#issuecomment-354156711.
2017-12-27 22:26:31 +01:00
Alexander Köplinger 7363f1ac3d [utils] Include jemalloc dir in tarball build (#6344)
Fixes https://github.com/mono/mono/issues/6343
2017-12-27 19:53:06 +01:00
Aleksey Kliger (λgeek) f783d29462 Merge pull request #6323 from lambdageek/class-h-minor-cleanups
Mark mono_class_vtable and mono_class_from_typeref external only.
2017-12-27 12:38:20 -05:00
Aleksey Kliger 649f509f04 [unit-tests] A few unit tests for mono_string_new_checked 2017-12-27 10:52:42 -05:00
Alexander Köplinger c7d8d247c3 [ci] Add existing LDFLAGS instead of overwriting 2017-12-27 16:44:39 +01:00
Aleksey Kliger 7bdbadbbb4 [unit-tests] Fix Makefile.am when Mono is compiled with LLVM 2017-12-27 10:10:16 -05:00
Aleksey Kliger 68baa2967d [object] Don't leak glib error in mono_string_new_checked
After we save the UTF8 to UTF16 conversion error to MonoError, free the GError.
2017-12-27 10:10:16 -05:00
Zoltan Varga ab04c61b60 [runtime] Add CallContext to the list of cross offset types to fix the cross compiler build. (#6337) 2017-12-25 16:23:20 -05:00
Aleksey Kliger (λgeek) 8ba48b5a41 [object] mono_string_new should not assert on UTF conversion failures (#6333)
Revert the embedding API behavior change introduced by dcdfb3c500

mono_string_new will:
 * return NULL if the given byte sequence is not a valid UTF-8 sequence
 * assert if there is not enough memory to allocate a new MonoString.

This only changes the behavior of the API function.  The runtime will continue
to use mono_string_new_checked which sets MonoError* for both sorts of
failures.
2017-12-25 10:45:52 +01:00
Vlad Brezae 60b180d24f [interp] Rename functions to be clearer 2017-12-23 18:14:15 +02:00
Vlad Brezae e427266501 [interp] Enable most pinvoke tests 2017-12-23 18:14:15 +02:00
Vlad Brezae 929e4b08a4 [arm64] Rework native entry tramp from interp 2017-12-23 18:14:15 +02:00
Vlad Brezae 23ea930161 [arm] Interp support for pinvoke 2017-12-23 18:14:15 +02:00
Bernhard Urban ee43f5a4ad [arm] use DMB ISH barrier instead of DMB SY
ISH is enough, as a "inner shareability domain" contains all PEs
controlled by a single hypervisor or operating system. That is inline
with GCC, linux kernel etc.

We do the same on ARM64: https://github.com/mono/mono/commit/efdf035cfb928ffe3c0ef81e7ce2bad8402cab26
2017-12-23 12:43:58 +01:00
Alexander Kyte c996dac676 [runtime] Bring jemalloc to mono (#6166)
* [runtime] Bring jemalloc to mono

Jemalloc is known to have much better performance than system memory
allocators, and is safe in concurrent/re-entrant situations.

To use, provide the following options to configure:

--with-jemalloc to enable optionally. To use at runtime,
export MONO_USE_JEMALLOC to the environment.

--with-jemalloc-always to enable and make the default

--with-jemalloc-assert to enable with assertions to catch memory
unsafety. It adds overhead, but an overhead that's much less than
valgrind or asan.

If you export
MONO_JEMALLOC_CONF="stats_print:true"

You will see detailed memory statistics for mono at exit.

Now note that jemalloc is used through an explicit registration, so
C libraries called through pinvoke calls will not use jemalloc unless
they configure themselves to do so separately.

To understand the build work, I'm statically linking jemalloc.a into
the compilation unit for mono/utils/mono-jemalloc.c, which is
responsible for registering it with mono at startup. No further
copying out of the submodule is necessary at installation time.

* [runtime] Fix OSX 32-bit build definition
2017-12-22 21:39:13 +01:00
Zoltan Varga 6b58f13177 [runtime] Avoid padding classes with an explicit size. Fixes #60298. (#6223) 2017-12-22 21:38:18 +01:00
Calvin 83a809553f Unbreak XMM register handling on platforms without MonoContextSimdReg (#6219)
* Unbreak XMM register handling on platforms without MonoContextSimdReg

Platforms like Haiku (and glibc-less Linux, but that was unbroken a few
weeks ago) don't have this implemented on Mono. (yet?) Restore old
behaviour behind an #ifdef (same one as on mono-context.h) - perhaps it
could be a nicer ifdef, but I'm keeping this consistent for now.

* Attempt at a universal ifdef for MonoContextSimdReg presence

Suggestion of @kumpera. I've put #ifdefs in the obvious places, and
verified that the commit ensures we're still in the same position as
before.

* Fix non-MonoContextSimdReg calls in tramp-amd64.c

Follow advice of @joncham wrt the type and function to use instead.
2017-12-22 21:18:37 +01:00
Bernhard Urban b3f9ee4413 [mini] cleanup some code to silent compiler warnings (#6325)
* [method2ir] remove unused ldind_to_load_membase ()

* [method2ir] mono_create_tls_get () can be static

* [method2ir] remove unused mono_create_tls_set () (and thus mono_create_fast_tls_setter ())

* [amd64] remove unused array and guard debug code properly to suppress compiler warning
2017-12-22 21:17:00 +01:00
jaykrell 740013d051 Fix an error ignore, and then remove the support for it, and unused similar. (#6292)
* "Fix" a case of an error being ignored.
* And then remove mono_string_to_utf8_image_ignore which is not used.
And then remove the gboolean ignore_error parameter which is always FALSE.
2017-12-22 15:11:19 -05:00
Alexis Christoforides 381d11c97e Merge pull request #6332 from directhex/fixbuild
Add file missed from e0b1d66519 to Makefile.am
2017-12-22 13:46:24 -05:00
Jo Shields c4d1df972e Add file missed from e0b1d66519 to Makefile.am
(cherry picked from commit 8c7efc8a9a7858e5cdf214a55d7c07ace2907cf6)
2017-12-22 11:42:23 -05:00
Marek Safar 841ffc2334 [mcs] Implements C# 7.0 Generalized async return types 2017-12-22 16:53:31 +01:00
Marek Safar 6e885dec43 [mcs] Support implicit user conversion from nullable type without unwrapping. Fixes #60900 2017-12-22 15:31:45 +01:00
Jason Imison 492f66c60f Bump F# to 4.1.29. Fixes #6281 (#6295)
* Bump F# to 4.1.29. Fixes #6281
2017-12-22 13:23:13 +01:00
Aleksey Kliger 2eba6b82ec [runtime] Rename mono_class_vtable_full to mono_class_vtable_checked
No functional change.
2017-12-21 17:06:49 -05:00
Aleksey Kliger dbb76ea0c3 [runtime] Mark mono_class_vtable external only.
- Runtime should use mono_class_vtable_full.
- Updated callers.
- Added a MonoError argument to:
  - mono_marshal_get_remoting_invoke
  - mono_marshal_get_xappdomain_invoke
  - mono_marshal_get_remoting_invoke_for_target
  - mono_marshal_get_remoting_invoke_with_check
2017-12-21 16:56:59 -05:00
Zoltan Varga bf3d8ce52d [bcl] Avoid rebuilding test libs all the time if the corresponding assembly doesn't exist because of the NO_BUILD flag. (#6318) 2017-12-21 14:47:00 -05:00
Zoltan Varga 9527a8e4dd [ios-sdk] Split non working assemblies into non-compiling and non-working, compile the ones which can be compiled. (#6319) 2017-12-21 12:47:08 -05:00
Marek Safar 8d36d250bc [mcs] Adds parser support for readonly ref syntax 2017-12-21 17:47:13 +01:00
Bernhard Urban 9cfdeb1a2e [arm] replace cp15 barrier usage wih dmb instruction on armv7
on armv8 chips this barrier isn't implemented in hardware and must be
emulated by the kernel if it runs aarch32 code:

https://github.com/torvalds/linux/blob/c9b012e5f4a1d01dfa8abc6318211a67ba7d5db2/arch/arm64/kernel/armv8_deprecated.c#L475
2017-12-21 17:05:50 +01:00
Mathieu Bourgeois 29428d9516 * Generalize commit 0c6932a985 to support LDARG{0|1|2|3}, LDLOC{0|1|2|3}, LDARGS, LDLOCS, LDARG and LDLOC instead of LDLOC and LDLOCS. Improves generated code similar to issue #60945 2017-12-21 16:57:46 +01:00
EgorBo 10ab6b7753 skip dim-valuetype test in interp mode 2017-12-21 12:56:02 +01:00
EgorBo 64ecc5d064 change return value from 100 to 0 (for success) 2017-12-21 12:56:02 +01:00
EgorBo 95f4da3358 add "dim-" prefix for the tests and ignore failed ones 2017-12-21 12:56:02 +01:00
EgorBo 8668a85552 Default interface methods IL tests from CoreCLR 2017-12-21 12:56:02 +01:00
Marek Safar c709e42040 [mcs] Fixes parsing of default literal inside conditional expression 2017-12-21 12:54:49 +01:00
Marek Safar fa9acab811 Update codeowners 2017-12-21 12:04:06 +01:00
Vlad Brezae 6b86787945 [interp] Don't abort during finally blocks
Unlike on the jit (where we set a local variable on the stack frame of the last finally block), use the simple explicit abort protecting code which is used also for cctors. We can't use handler block guard logic since we can't async unwind from the interpreter.
2017-12-21 12:17:08 +02:00
Vlad Brezae 9f8e2cd16a [interp] Remove duplicated code 2017-12-21 12:17:08 +02:00
Vlad Brezae edba55b883 [interp] Check for interruption after class initialization
We can have a pending abort that needs throwing
2017-12-21 12:17:08 +02:00
Vlad Brezae 3495c6054f [interp] Replace old and dead EH code 2017-12-21 12:17:08 +02:00
Vlad Brezae a02ef6352d [interp] Check for class failure when emitting constructor
As we do with the jit.
2017-12-21 12:16:49 +02:00
Aleksey Kliger f202cffa2b [runtime] Mark mono_class_from_typeref external only.
Runtime should use mono_class_from_typeref_checked.
2017-12-20 17:31:15 -05:00
jaykrell 93d0e9ed4d Fix apparent double or invalid free. (#6297) 2017-12-20 20:35:05 +01:00
monojenkins ad179f61d7 [msvc] Update csproj files 2017-12-20 17:30:44 +01:00
Marek Safar 723037ab13 Bump linker & cecil 2017-12-20 16:01:33 +01:00
Ludovic Henry 04a275df98 [interp] Fix build when disabled (2) (#6280) 2017-12-20 10:30:41 +01:00
Egor Bogatov cae8dd6dbd [System.Core] Use corefx System.Linq tests (~25k tests) (#5515) 2017-12-19 23:03:59 +01:00
Atsushi Eno 05d5204da8 [mono-api-html] do not warn about removal of [Obsolete] member. (#5294) 2017-12-19 18:23:32 +01:00
Li Keqing c0e6ecb6c2 [System.Windows.Forms] Fix CJK Encoding on Window Title 2017-12-19 18:22:03 +01:00
jaykrell e0b1d66519 cooperative suspend babystep wrt mono_domain_try_type_resolve(MonoObject*). (#6196)
* cooperative suspend babystep wrt mono_domain_try_type_resolve(MonoObject*).
No reduction in warnings, but remove one call to a function that has
warnings, leaving sre.c alone for now.

We have:
 mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb)
 mono_domain_try_type_resolve_checked (MonoDomain *domain, char *name, MonoObject *tb, MonoError*)

The MonoObject* tb parameter causes a warning under cooperative suspend static validation.

Between name and tb, only one is ever used -- i.e. the non-null one, favoring name.

The non-checked function is embedded, so it survives for the time being.

Internally, we have reflection.c calling _checked(name != null, tb == null) and sre.c the opposite.

So, this fix refactors the function such that one takes const char* and the other MonoObject* (or MonoReflectionTypeBuilder*).

Some calls to a function with a warning are therefore replaced by calls to a function without a warning.

sre.c is left alone for now, therefore the number of warnings does not go down.

The caching within of System.AppDomain.DoTypeResolve is refactored into mono_class_get_appdomain_do_type_resolve_method.
Should we have GENERATE_GET_METHOD_WITH_CACHE like GENERATE_GET_CLASS_WITH_CACHE?  Or GENERATE_GET_METHOD_CACHED?

A few stylistic experiments:
   ternary operator?
   const?
   Some name shortening?
   Non-anonymous struct tags?
   Forward declaration to increase type safety?
   _checked suffix optional if not differentiating from other?

* Cleanup MonoError initialization and usage.
Thread MonoError through a bit -- add mono_class_get_method_from_name_checked.
 Could also be named mono_class_get_method_from_name_flags_checked.
Rename tb to typebuilder.
rename _builder to _typebuilder.
Reduce but don't eliminate struct/typedef change.
Remove extra braces.

* More MonoError tweaking -- the existance of cleanup breaks the model.

* remove a newline that was added

* Remove line breaks.
Put struct forward declaration among others.
Restore g_warning.
i.e. code review feedback

* Remove some newlines.

* more newlines

* Move from public class.h to private class-internals.h.

* Move new forward declarations out of public header object.h
and into new internal header object-forward.h.
2017-12-19 16:35:31 +01:00
Pete Lewis 8c9c37c45b Only call waitpid for processes that Mono tracks, rather than all child processes owned by the calling process. (#6202)
waitpid(-1,...) reaps all zombie child processes of the calling process (see `man waitpid`). After a child process is reaped, it can no longer be queried. Because this reaping step is invoked via the `SIGCHLD` signal, all zombie children of the calling process are reaped every time any child process terminates, regardless of whether that child process was tracked by Mono.

The impact of this bug is that apps using Mono that spawn their own child processes (outside of Mono's `w32process` API) cannot query the exit state of its children. For example, a call to `waitpid(my_child_pid,...)` will return `ECHILD` for "no such child" because Mono has already cleaned up the child the moment `SIGCHLD` was raised.
2017-12-19 16:33:33 +01:00
jaykrell 11e18c2a5d This list is almost sorted -- so repair the sorting and add comment. (#6244) 2017-12-19 16:27:03 +01:00
jaykrell fba6bfc954 Minor cleanup split out and expanded from another larger change. (#6263)
* Minor cleanup split out and expanded from another larger change.
 - Spelling in comment.
 - 'l' is a short identifier that looks like '1' -- use "len".
 - Remove extra braces.
 - Add some g_assert (error) before error_init (error).

* remove unuseful asserts
2017-12-19 16:21:55 +01:00
Alexander Kyte 6ca7b346cd [runtime] Fixes issue when compiling with -no_weak_imports (#6276) 2017-12-19 16:08:03 +01:00
Ludovic Henry 5f5c5e97a0 [threadpool] Replace parked_threads condition variable by a semaphore (#6222) 2017-12-19 15:29:29 +01:00
Ludovic Henry f6bf1d427b [threads] Ensure we remove the thread only once (#6194)
* [threads] Ensure we remove the thread only once

* [threads] Inline unsused function

* [threads] Assert we are on the current thread when detaching
2017-12-19 15:28:53 +01:00
jaykrell 891941ecbe Remove a few braces that are contrary to our prescribed style. (#6245) 2017-12-19 09:07:38 -05:00
Zoltan Varga a2407ac76a IOS SDKs (#6257)
* [ios-sdk] Rename test-runner directory to 'runtime' to be consistent with xamarin.ios.

* [ios-sdk] Add missing xamarin_log () icall used by Console.Write ().

* [ios-sdk] Change the run-ios-sim target so it works on ios11 as well, the --console option to simctl appears to be broken.

* [ios-sdk] Add a test harness.

The test harness is resposible for starting the emulator, installing the app on the emulator, running it, and
collecting application output using the osx logging facilities.

* [ios-sdk] Fix detection of the app exiting with an unhandled exception.

* [ios-sdk] Add CI support for running some test suites on the simulator.

* [ios-sdk] Kill the log reader process on shutdown.

* [ios-sdk] Disable android on CI because the make targets error out if the android sdk is not installed.

* [ios-sdk] Fix error checking in make targets.

* [ios-sdk] Remove accidently commited binary.

* [ios-sdk] Switch to using os_log instead of NSLog (), the latter doesn't seem to show up in the logs anymore. Switch to using the default ios sdk instead of hardcoding 11.1.

* [ios-sdk] Don't hardcode the ios version when creating a simulator.

* [ios-sdk] Parse the output of simctl list runtimes as json.

* [ios-sdk] Use 'syslog' style logging, its supported by older osx versions.

* [ios-sdk] Fix logfile parsing.

* [ios-sdk] Fix log filtering.

* [ios-sdk] Add test exclusions file for System.

* [ios-sdk] Redirect runtime logging to os_log ().

* [ios-sdk] Link libMonoPosixHelper and zlib into the test runner.

* [ios-sdk] Fix the target64 and cross64 builds.

* [ios-sdk] Build target64/cross64 on CI.

* [ios-sdk] Add device support to the runtime lib. Mark strings in os_log () calls as public.

* [ios-sdk] Log stdout messages using a separate subsystem for easier filtering.

* [ios-sdk] Add an 'appbuilder' tool which can generate simulator and device apps.

* [ios-sdk] Build device tests on CI.

* [ios-sdk] Add a test-runner instead of using nunit-lite-console.exe. The two are identical right now, but they might diverge in the future.

* [ios-sdk] Add a script to download prebuild llvm binaries.

* [ios-sdk] Run the runtime initialization on a separate thread, not the UI thread.

* [ios-sdks] Fix the build.

* [ios-sdk] Build the cross compiler against llvm.

* [ios-sdk] Add missing file.

* [ios-sdk] Add llvm support, enabled by passing LLVM=1 to make build-ios-dev-<app>.

* [bcl] Enable System.Security tests on the MOBILE profile.

* [ios-sdk] Enable more test suites.

* [ios-sdk] Fix device builds.

* [ios-sdk] Make some test steps non-fatal.

* [ios-dev] Use ad-hoc signing to sign device apps.

* [ios-sdk] Decrease the timeout on run-sim to 20m.

* [ios-sdk] Send back the test results using a tcp connection, parsing the ios logs is too fragile.

* [ios-sdk] Mark System.Net.Http tests as notworking, they seem to fail on CI.

* [ios-sdk] Compile the 32 bit cross compiler against llvm as well.

* [ios-sdk] Package up the binaries which can be uploaded to storage.

* [ios-sdk] Fix the download-llvm.sh script.

* [ios-sdk] Compile cross32 on CI.

* [ios-sdk] Use Options.cs from the mcs sources instead of making a copy.

* [ios-sdk] Avoid hardcoding the xcode sysroot, obtain it using 'xcode-select -p'.

* [ios-sdk] Fix the previous change.

* [ios-sdk] Add an option to appbuilder to cache aot compilation results between building different apps.

* [ios-sdk] Build device apps with llvm as well on CI.

* [ios-skd] Use XCODE_ROOT in a few more places, update README.md.
2017-12-19 09:04:44 -05:00
Egor Bogatov e9e17e069e [System] System.Net.* tests from corefx (+RemoteExecutorTestBase) (#6136) 2017-12-19 11:37:51 +01:00
Alexis Christoforides 84c9542f15 Merge pull request #6215 from YuriyGS/bug15051
[System.Windows.Forms] DataGridView throw exception when trying to remove a row. Fixes #15051.
2017-12-18 18:47:42 -05:00
jaykrell 57ad62b9ec Just fix one typo in a comment. (#6240) 2017-12-18 19:15:43 +01:00
Vlad Brezae 08938db840 [sgen] Fix behavior of forced collections
Triggering a forced collection means that it should to an immediate full collection of that generation. If we were having a running concurrent collection we were only finishing it. We should also trigger a new serial gc.
2017-12-18 19:35:42 +02:00
Vlad Brezae 4bce944f45 [profiler] Trigger heapshots only on major serial collections
After minor or concurrent collections, we can have dead objects (can not be referenced starting from the current root set) still alive on the heap which can confuse profiling tools.

If we have a heapshot requested and we can't do it on the current collection, defer it to the finalizer.
2017-12-18 19:35:42 +02:00
Vlad Brezae b9b639c6a5 [profiler] Report roots from ephemerons
The ephemeron array is an array of (key, value) pairs where value is alive (root) if key is alive.
2017-12-18 19:35:42 +02:00
Zoltan Varga 1b249d561e [bcl] Allow conversion from enums and their basetypes in both directions with Delegate.CreateDelegate (). Fixes https://github.com/mono/mono/issues/6255. 2017-12-18 15:07:07 +01:00
Marek Safar 742590f5b4 Merge pull request #6168 from radekdoulik/pr-add-linker-analyzer-script 2017-12-18 14:54:19 +01:00
Radek Doulik 69f99f1633 [linker-analyzer] Added man page for the linker analyzer 2017-12-18 13:07:08 +01:00
Radek Doulik c7acb025f5 [linker-analyzer] Rename the tool to illinkanalyzer
As per discussion in https://github.com/mono/mono/pull/6168
2017-12-18 13:07:07 +01:00
resurrexit 4a8adbd8dc [I18N] Include missing subset of shift_jis characters (#6232) 2017-12-17 11:45:21 +01:00
Vlad Brezae 6d018681ee [amd64] Rework native entry tramp from interp 2017-12-16 19:49:33 +01:00
Radek Doulik ff76904cbe [monodroid] Build linker-analyzer tool for monodroid
We would like to include linker analyzer in the Xamarin.Android
installation (https://github.com/xamarin/xamarin-android/issues/1093)
2017-12-16 11:04:33 +01:00
Marek Habersack e3ffc2e984 [android] Android NDK does not contain API level/platform 12
Lack of it causes a build error in XA:

   CMake Error at [..]mono/external/boringssl/util/android-cmake/android.toolchain.cmake:800 (message):
         Specified Android native API level 'android-12' is not supported by your

The set of minimum API levels in `configure.ac` is incorrect. The current
NDK (r16) requires minimum API level of 14 for the 32-bit targets and level 21
for the 64-bit targets.
2017-12-15 19:38:47 +01:00
Marek Safar 9c00f0c0c4 [github] Update issue template not to auto-convert platforms into tasks 2017-12-15 15:38:24 +01:00
Vlad Brezae 43e0e6b941 [interp] Restore valuetype copying for pinvoke case.
Reverts 65a94cb15f for native struct copying.
2017-12-15 13:33:30 +01:00
Vlad Brezae 61dde4b1de [interp] Add some missing icall signatures
For mono_marshal_asany and mono_marshal_free_asany
2017-12-15 13:33:30 +01:00
Vlad Brezae f0bfd787e3 [interp] Replace define
It's confusing
2017-12-15 13:33:30 +01:00
Vlad Brezae 710149b90a [interp] Fix delegate invocation of native functions
For a m2n transition we expect that we are already in managed (interp) and the delegate's method_ptr expects an InterpMethod. Refactoring will be needed in the future.
2017-12-15 13:33:30 +01:00
Vlad Brezae 8aafd8660e [marshal] Avoid using CEE_UNBOX for struct marshaling
Mirror mono_marshal_get_struct_to_ptr. These methods can also handle non valuetypes (with certain attributes), which CEE_UNBOX doesn't logically handle.
2017-12-15 13:33:30 +01:00
Vlad Brezae a90d5c7865 [metadata] Remove unused ldloc
Fixes stack warnings in interp
2017-12-15 13:33:30 +01:00
Vlad Brezae 5a7ff666c5 [interp] Remove assert 2017-12-15 13:33:30 +01:00
Bernhard Urban 7924c406d9 [interp] on cee_ret use underlying type which handles, among other things, ref types correctly
while at it:
    * only get MonoClass if really necessary.
    * use helper function to print method with signature.

fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60756
2017-12-15 12:53:11 +01:00
Josh Peterson 58a491b96c Avoid using BSTR for conversion of a SecureString
There is no need to use BSTR marshaling to convert a SecureString to a
string. On some platforms, BSTR marshaling is not implemented, but we
still want to be able to convert a SecureString to a string on those
platforms.

So instead, use Unicode string marshaling.
2017-12-15 10:40:38 +01:00
monojenkins 99e3bc8904 [msvc] Update csproj files 2017-12-15 10:28:23 +01:00
Katelyn Gadd 252d61d055 Fix bug 60568: SynchronizationContext.Wait not implemented or invoked by runtime (#6062)
* Checkpoint: Implement SynchronizationContext.Wait

* Add missing check for null synchronization context

* Update bug 60568 fix to cover WaitAll and add test cases

* Add missing file
2017-12-14 12:14:47 -05:00
Ludovic Henry 5e9081600f [console] Invoke async console cancel on ThreadPool from managed 2017-12-14 11:14:26 +01:00
lateralusX be683c14b9 Wait on runtime threads to park on joinable thread list during shutdown.
https://github.com/mono/mono/pull/5599 fixed a race condition during shutdown
when runtime threads have come parts of their way through detach, but still
depend on runtime resources, like GC memory. The fix added runtime threads
to the joinable thread list just before they vanished from mono_thread_manage
radar making sure shutdown waited upon the thread before cleaning up.

The above fix slightly changed the behavior of the finalizer thread since it
waits on joinable threads and will now potential block on threads still
executing code (that involves runtime resources). There’s was an assumption
around the threads on the joinable thread list that they should be very close
to complete when added, so join calls coming from the finalizer thread should
almost never block and if it does, the code that remains to execute should not
involve runtime operations risking deadlock situations. Adding the thread to
the list earlier than previously done expose the shutdown to some potential
theoretical problems.

To mitigate the risk and still solve the race condition this commit adds a
mechanism to keep track of active runtime threads until they park on joinable
thread list. The pending counter will be waited upon by the shutdown
thread, just before it does its regular wait on all joinable threads
(after finalizer thread has stopped) to make sure all runtime threads have
been added to the joinable thread list before waiting upon them. Threads are
added to the joinable thread as late as possible, exactly how it’s been done
in the past by sgen_client_thread_detach_with_lock. Shutdown thread will wait
on runtime threads to appear on the list for a short time and if timeout (pending
runtime thread count not reaching 0 before timeout), it will just print a warning
and continue shutdown.

Getting into a wait state during shutdown due to runtime threads not yet added to
joinable threads list should be very rare (hitting previous race condition that was rare),
triggering the timeout should be even more rare, and if that ever happens, we are exposed
to shutdown race condition as we have had in the past, but now we at least get a warning in
the log making it simpler to analyze further.

This commit also fixes a problem with the debugger thread hitting the same race condition as above.
The shutdown thread stopping the debugger thread didn't completely wait for it to stop using runtime
resources before continue shutdown sequence. This triggers the same race condition as when shutting
down regular runtime threads. This commit makes sure stop_debugger_thread waits on the debugger thread
handle to become signaled (happens at the very end of thread lifetime) before continuing the shutdown
logic.
2017-12-14 10:52:51 +01:00
Martin Baulig cd09ddbc55 New PR for the new web stack (#6125) 2017-12-14 10:06:47 +01:00
Alex Rønne Petersen 76d7ab281d [Mono.Profiler.Log] Fix reading of TYPE_JITHELPER events for < v14. 2017-12-14 09:47:31 +01:00
Rodrigo Kumpera f3e04b182a [wasm] Fix runtime compilation. Fixes by Kenneth Pouncey 2017-12-14 09:43:00 +01:00
Rodrigo Kumpera 68eb7bc3f8 [wasm] Update corlib testsuite to disable multi-threaded tests. 2017-12-14 09:43:00 +01:00
Rodrigo Kumpera 9eecae812c [wasm] Run finalizers from a background task. 2017-12-14 09:43:00 +01:00
Rodrigo Kumpera f08f228fcf [wasm] Add comment to generated file that is was... generated. 2017-12-14 09:43:00 +01:00
Rodrigo Kumpera 4ad5fc61c6 [corlib] Mark tests that requires multiple threads with the "MultiThreaded" category. 2017-12-14 09:43:00 +01:00
Rodrigo Kumpera 7ac259dc67 [wasm] Implement a wasm specific threadpool worker. 2017-12-14 09:43:00 +01:00
Rodrigo Kumpera d5ebaad99d [wasm] Move runtime background pumping to utils and make it work with multiple subsystems. 2017-12-14 09:43:00 +01:00
Rodrigo Kumpera 198a7c6482 [wasm] Pass the name of the test suite to the test driver. Disable running tests that fail under the interpreter. 2017-12-14 09:43:00 +01:00
Rodrigo Kumpera 1b1ba678b7 [wasm] Disable mini test that fails due to the interpreter 2017-12-14 09:43:00 +01:00
Jo Shields c593c1e351 [mkbundle] Bundle unmanaged libs 2017-12-14 09:41:50 +01:00
Marek Safar 7bf60c3ec9 [build] Redirect api build to reference-assemblies 2017-12-14 09:24:32 +01:00
Bernhard Urban 746a3d0214 [corlib] rename NotWorkingInterpreter and InterpreterNotWorking categories (#6225) 2017-12-14 00:52:49 +01:00
Bernhard Urban f9287857f2 [mini] isalnum() respects encoding in python3, we only want to have ASCII chars (#6199) 2017-12-14 00:43:27 +01:00
Zoltan Varga 2aadbf1724 [s390x] Fix errors in cpu-s390x.md which are exposed by the new genmdesc. (#6233) 2017-12-13 17:29:39 -05:00
Zoltan Varga c90690310c No mem needs (#6210)
* [jit] Remove unused mono_arch_instrument_mem_needs () function.

* [jit] Remove unused mono_arch_instrument_epilog_full () function, only the non-full version is used.

* [jit] Remove some unused arch specific functions previously used by the global regalloc prototype.
2017-12-13 16:35:33 -05:00
Rodrigo Kumpera e5fa0b75b4 Merge pull request #6234 from vargaz/llvm-weak-fields
[aot] Fix aot+llvm after the weak field changes.
2017-12-13 13:07:22 -08:00
Rodrigo Kumpera aeceaa7e1e Merge pull request #6203 from luhenry/fix-6169
[threads] Fix leak of gchandle to MonoInternalThread
2017-12-13 13:01:39 -08:00
Ludovic Henry 19cba1df37 [interp] Fix build when disabled (#6218) 2017-12-13 08:16:22 -05:00
Zoltan Varga 5ec0243196 [aot] Fix aot+llvm after the weak field changes. 2017-12-13 01:38:18 -05:00
Marek Safar da807f6f90 [mcs] Propagate flow analysis for tuple deconstruct 2017-12-12 23:12:15 +01:00
Ludovic Henry 1e3fb99fa3 [threads] Fix leak of gchandle to MonoInternalThread
Fixes https://github.com/mono/mono/issues/6169
2017-12-12 16:41:51 -05:00
Radek Doulik 85e33cfdba [linker-analyzer] Added to the scripts 2017-12-12 22:19:03 +01:00
Marek Safar 2d43cf694f Add issue template 2017-12-12 14:27:56 +01:00
Miguel de Icaza 4f6e01edcd Create ISSUE_TEMPLATE.md 2017-12-11 14:25:11 -05:00
YuriyGS 61588a1d53 Second issue of bug #15051. first_row_index was corrupted by MoveCurrentCell call. 2017-12-11 14:54:22 +03:00
monojenkins 2b90049bcc [msvc] Update csproj files (#6206) 2017-12-08 11:47:35 -05:00
YuriyGS 09ea581914 Fixed a crash when deleting a row containing a selected cell 2017-12-08 12:32:58 +03:00
Alexis Christoforides 7758f54dcf Merge pull request #1450 from echampet/session
System.Web.SessionState: simplify sessions retrival polling
2017-12-07 20:00:23 -05:00
Alexander Köplinger dd34edb907 Bump roslyn-binaries submodule 2017-12-07 14:41:48 -05:00
Alexander Köplinger 27790b9495 Bump roslyn-binaries submodule 2017-12-07 14:39:47 -05:00
Alex Earl 8be2726e12 Add install of Visual Basic compiler (#6127)
This is a follow on to mono/roslyn-binaries#3 which adds the Roslyn VB.NET compiler to the roslyn-binaries repo. This will then install the binaries to the mono installation.
2017-12-07 13:45:09 -05:00
Marek Safar 1724ce22a3 [mcs] Add a detection for ByRefLikeMarker (#6195) 2017-12-07 13:14:42 -05:00
Alex Rønne Petersen d7ac79ccc0 [profiler] Rework GC roots reporting. (#6144)
This change re-implement GC roots reporting in a way that allows users to correctly track the source of a GC root.

The new design is based on emitting GC root information upfront and only report addresses during heap dumps.

When a GC root is registered we emit an event that is an address range, the root kind, a key and a text description.

A decoder can use this information to match a reported root address with all registration addresses to figure out what they mean.

A GC Root key is used to further its meaning. For example, if kind is thread, key is a tid, if kind is static variables, key is the vtable pointer and so on.

The build of the change is introducing this key argument across all root registration code and rework our root reporting code to encode their addresses.

Some roots use pseudo-addresses when they are not registrable. This is the case of thread stacks/registers and the finalizer queue.

Finally, root reporting was changed to happen only once per collection and at the end, leading to correct and useful data being produced.
2017-12-07 10:47:18 -05:00
Bernhard Urban 4d5d54f7a8 [interp] disable weak-fields.exe (#6191) 2017-12-07 08:28:52 -05:00
Calvin 5a581fb229 Compile on amd64 Haiku (#4473)
* Compile on amd64 Haiku

Use sigcontext (somewhat like win32, or x86) on Haiku amd64.

On amd64, Haiku doesn't have issues with marshalling 64-bit values,
but it currently does have issues with SGen either causing a stall
or a core dump. As such, while it can compile the stdlib (further
than x86 got), it's still a work in progress.

* Use set_real_time_clock for sys-time.c on Haiku

* Get mono-boehm compiling on Haiku again

It still doesn't work. Initialization will call GC_mark_from, which
will cause a segmentation fault as it decrements pointers. (Mono
will enter an infinite loop in mono_get_hazardous_pointer as a result.)

For now, mono-sgen will continue to be used by default.
2017-12-06 15:43:20 -05:00
Rodrigo Kumpera b683e1076a [runtime] Thread MonoError through mono_class_get_overrides_full. (#6069)
* [runtime] Thread MonoError through mono_class_get_overrides_full.

* [runtime] Use goto_if_nok
2017-12-05 22:07:00 -05:00
monojenkins 657ff6d38a [msvc] Update csproj files (#6163) 2017-12-05 17:23:00 -05:00
Alexis Christoforides 233212bd24 Revert "Merge pull request #5643 from alexanderkyte/jemalloc"
This reverts commit 3dac926be3, reversing
changes made to 50b6a2e823.
2017-12-05 15:58:43 -05:00
Alexis Christoforides 3dac926be3 Merge pull request #5643 from alexanderkyte/jemalloc
[DONTMERGEruntime] Bring jemalloc to mono
2017-12-05 14:24:12 -05:00
Egor Bogatov 50b6a2e823 Fix genproj.cs (make update-solution-files) (#6162)
make update-solution-files works but actually throws an ArgumentOutOfRangeException and as a result - corrupted csproj (fails on System.Runtime.CompilerServices.Unsafe -
System.Runtime.CompilerServices.Unsafe.dll.sources is empty)
2017-12-05 11:37:15 -05:00
Alexander Kyte 63a49e9eb8 [runtime] Fix OSX 32-bit build definition 2017-12-05 11:25:26 -05:00
Aleksey Kliger (λgeek) 67c9ed311c README.md: point at GitHub Issues 2017-12-04 22:24:26 -05:00
Radek Doulik 6a867bd856 [linker-analyzer] added --flat option (#5629)
* [linker-analyzer] added --flat option

This options allows to see all dependencies per vertex at once, with
displayed distance in the graph between the vertex and dependent
vertex.

An example of flat output:

    Loading dependency tree from: linker-dependencies.xml.gz

    --- Type dependencies: 'Android.App.Activity' --------------------------

    Distance | TypeDef:Android.App.Activity [total deps: 7]
    ------------------------------------------------------------------------
           1 | TypeDef:XA.App.MainActivity
           2 | Assembly:XA.App, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
           3 | Other:Mono.Linker.Steps.ResolveFromAssemblyStep
           3 | Other:Mono.Tuner.CustomizeActions
           3 | Other:MonoDroid.Tuner.MonoDroidMarkStep
           2 | TypeDef:XA.App.MainActivity/<>c__DisplayClass1_0

* [linker-analyzer] Get back to using "unnamed" tuples

Use unnamed tuples to workaround mcs bug. We can revert this change,
once mcs is updated.

The build with mcs was failing like this, because of mcs bug:

```
MacBook:linker-analyzer rodo$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-local
MCS     [net_4_x-darwin] linkeranalyzer.exe

Unhandled Exception:
System.NotImplementedException: named tuples for .interfaceimpl
  at Mono.CSharp.TypeDefinition.Emit () [0x00028] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.ClassOrStruct.Emit () [0x00025] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeDefinition.Emit () [0x002e8] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.ClassOrStruct.Emit () [0x00025] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.Class.Emit () [0x00000] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeDefinition.EmitContainer () [0x0000f] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00007] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00007] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.ModuleContainer.EmitContainer () [0x0009c] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.AssemblyDefinition.Emit () [0x00098] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00126] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.Driver.Compile () [0x002f3] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <e953cb7042ea446195951c3e14c2cc5a>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NotImplementedException: named tuples for .interfaceimpl
  at Mono.CSharp.TypeDefinition.Emit () [0x00028] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.ClassOrStruct.Emit () [0x00025] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeDefinition.Emit () [0x002e8] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.ClassOrStruct.Emit () [0x00025] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.Class.Emit () [0x00000] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeDefinition.EmitContainer () [0x0000f] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00007] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00007] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.ModuleContainer.EmitContainer () [0x0009c] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.AssemblyDefinition.Emit () [0x00098] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00126] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.Driver.Compile () [0x002f3] in <e953cb7042ea446195951c3e14c2cc5a>:0
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <e953cb7042ea446195951c3e14c2cc5a>:0
make[1]: *** [../../class/lib/net_4_x-darwin/linkeranalyzer.exe] Error 1
make: *** [do-all] Error 2

```
2017-12-04 22:23:36 -05:00
Alexander Köplinger 399c2c89c7 [tests] Disable weak-fields.exe on FullAOT as well 2017-12-04 18:13:04 -05:00
Alexander Köplinger cd5f5282f2 Bump version to 5.11 (#6158) 2017-12-04 15:21:26 -05:00
Alexander Kyte df86ddf49b [dontmerge/forjenkins] Always enable jemalloc, so CI builds with enabled for pkg 2017-10-26 03:01:12 -04:00
Alexander Kyte 27d68cef08 [runtime] Bring jemalloc to mono
Jemalloc is known to have much better performance than system memory
allocators, and is safe in concurrent/re-entrant situations.

To use, provide the following options to configure:

--with-jemalloc to enable optionally. To use at runtime,
export MONO_USE_JEMALLOC to the environment.

--with-jemalloc-always to enable and make the default

--with-jemalloc-assert to enable with assertions to catch memory
unsafety. It adds overhead, but an overhead that's much less than
valgrind or asan.

If you export
MONO_JEMALLOC_CONF="stats_print:true"

You will see detailed memory statistics for mono at exit.

Now note that jemalloc is used through an explicit registration, so
C libraries called through pinvoke calls will not use jemalloc unless
they configure themselves to do so separately.

To understand the build work, I'm statically linking jemalloc.a into
the compilation unit for mono/utils/mono-jemalloc.c, which is
responsible for registering it with mono at startup. No further
copying out of the submodule is necessary at installation time.
2017-10-26 03:01:11 -04:00
Alexander Kyte 4b2d74f1a1 [runtime] Remove overridable allocator flag 2017-10-02 16:11:29 -04:00
Etienne CHAMPETIER 1057d0329a System.Web.SessionState: simplify sessions retrival polling
When using "fat" session (~2MB) and multiple (~20) simultaneous calls
the retrieval sometimes fails and lock the session.
The original code blocks on the calling thread (AutoResetEvent.WaitOne())
and uses another thread with the timer to do the polling.
If the polling succeeds, the TimerCallback AutoResetEvent.Set(),
with no guarantes that it will wake up the thread.
(see Remarks in http://msdn.microsoft.com/en-us/system.threading.eventwaithandle.set%28v=vs.110%29)

In this patch we simply replace all this code with an equivalent
loop + sleep, which give us the same behaviour
(we still block the calling thread with the sleep, but we didn't use another one)

Signed-off-by: Frederic Mestayer <[email protected]>
Signed-off-by: Etienne CHAMPETIER <[email protected]>
2014-12-22 09:20:01 +01:00
738 changed files with 39397 additions and 23397 deletions

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ file in this directory.
CLA
=======
Contributions are now taken under the [.NET Foundation CLA](https://cla2.dotnetfoundation.org/).
Contributions are now taken under the [.NET Foundation CLA](https://cla.dotnetfoundation.org/).
Code Review
=======
+45
View File
@@ -0,0 +1,45 @@
## Steps to Reproduce
1.
2.
3.
<!--
You may drag & drop the attachment (repro code/solution, screenshot, etc.) onto the issue.
-->
## Current Behavior
<!--
What is the current behaviour?
-->
## Expected Behavior
<!--
Please describe the behaviour you are expecting
-->
### On which platforms did you notice this
[ ] macOS
[ ] Linux
[ ] Windows
**Version Used**:
<!--
You can use `mono --version` or About dialog to obtain this information.
-->
### Stacktrace
```
Please paste the stacktrace here if available.
```
<!--
You can join us at https://gitter.im/mono/mono to discuss your reported issue
-->
+9
View File
@@ -0,0 +1,9 @@
<!--
Thank you for your Pull Request!
If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.
Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
-2
View File
@@ -7,7 +7,6 @@
[submodule "external/cecil"]
path = external/cecil
url = git://github.com/mono/cecil.git
branch = mono-2017-12
[submodule "external/rx"]
path = external/rx
url = git://github.com/mono/rx.git
@@ -44,7 +43,6 @@
[submodule "external/linker"]
path = external/linker
url = git://github.com/mono/linker.git
branch = mono-2017-12
[submodule "external/roslyn-binaries"]
path = external/roslyn-binaries
url = git://github.com/mono/roslyn-binaries.git
+8 -3
View File
@@ -58,7 +58,7 @@
/mcs/errors @marek-safar
/mcs/ilasm @marek-safar
/mcs/jay @marek-safar
/mcs/mcs @marek-safar
/mcs/mcs @marek-safar @lewurm
/mcs/tests @marek-safar
/mcs/tools @marek-safar @akoeplinger
@@ -83,13 +83,18 @@
/mono/mini/*exceptions* @lewurm
/mono/mini/*ppc* @lewurm
/mono/mini/*type-check* @lewurm
/mono/mini/interp/* @lewurm
/mono/mini/interp/* @lewurm @BrzVlad
/mono/mini/*profiler* @alexrp
/mono/mini/debugger-agent.c @DavidKarlas
/mono/profiler @alexrp @kumpera
/mono/sgen @brzvlad @kumpera
/mono/sdks @luhenry
/mono/sdks/android @luhenry @jonpryor
/mono/sdks/ios @vargaz @rolfbjarne
/mono/sdks/wasm @kumpera @lrz
/mono/sgen @BrzVlad @kumpera
/mono/utils @kumpera @vargaz
/mono/utils/atomic* @alexrp
+6 -5
View File
@@ -44,6 +44,7 @@ dist-hook:
rm -rf `find $(top_distdir)/external -path '*\.git'`
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/*'`
rm -rf "$(top_distdir)/external/linker/linker/Tests"
pkgconfigdir = $(libdir)/pkgconfig
noinst_DATA = mono-uninstalled.pc
@@ -114,7 +115,7 @@ update-csproj:
-rm msvc/scripts/order.xml
-rm -rf msvc/scripts/inputs
-mkdir msvc/scripts/inputs
(cd runtime; make V=1 extra_targets=csproj-local)
(cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
package-inputs:
echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
@@ -143,9 +144,9 @@ update-llvm-version:
update-solution-files:
make update-csproj
make package-inputs
(cd msvc/scripts; make genproj.exe; mono genproj.exe $(GENPROJ_ARGS))
$(MAKE) update-csproj
$(MAKE) package-inputs
(cd msvc/scripts; $(MAKE) genproj.exe; mono genproj.exe $(GENPROJ_ARGS))
update-solution-files-with-tests:
make "GENPROJ_ARGS=2012 true true" update-solution-files
$(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files
+18 -19
View File
@@ -19,30 +19,30 @@ The Mono project is part of the [.NET Foundation](http://www.dotnetfoundation.or
| 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] |
| Debian 9 | amd64 | [![debian-9-amd64][1]][2] |
| Debian 9 | i386 | [![debian-9-i386][3]][4] |
| Debian 9 | armel | [![debian-9-armel][5]][6] |
| Debian 9 | armhf | [![debian-9-armhf][7]][8] |
| Debian 9 | arm64 | [![debian-9-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] |
| Windows | i386 | [![windows-i386][17]][18] |
| CentOS | s390x (cs) | [![centos-s390x][19]][20] |
| Debian 8 | ppc64el (cs) | [![debian-8-ppc64el][21]][22]|
_(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
[3]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-i386/badge/icon
[4]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-i386/
[5]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armel/badge/icon
[6]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armel/
[7]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/badge/icon
[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/
[1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-amd64/badge/icon
[2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-amd64
[3]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-i386/badge/icon
[4]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-i386/
[5]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armel/badge/icon
[6]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armel/
[7]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armhf/badge/icon
[8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armhf/
[9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-arm64/badge/icon
[10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-arm64/
[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
@@ -174,8 +174,7 @@ section.
Reporting bugs
==============
To submit bug reports, please use [Xamarin's
Bugzilla](https://bugzilla.xamarin.com/)
To submit bug reports, please [open an issue on the mono GitHub repo](https://github.com/mono/mono/issues/new).
Please use the search facility to ensure the same bug hasn't already
been submitted and follow our
@@ -542,7 +541,7 @@ file for information about Microsoft's patent grant.
Mono Trademark Use Policy
=========================
The use of trademarks and logos for Mono can be found [here] (http://www.dotnetfoundation.org/legal/mono-tm).
The use of trademarks and logos for Mono can be found [here](http://www.dotnetfoundation.org/legal/mono-tm).
Maintaining the Class Library Solution Files
============================================
+4 -1
View File
@@ -2217,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/gcsuppressfinalize.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcwaitforpendingfinalizers.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstday.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstfourdayweek.cs \
@@ -3982,6 +3981,10 @@ CORECLR_DISABLED_TEST_CS_SRC += \
$(CORECLR_PATH)/tests/src/JIT/Directed/newarr/newarr.cs \
$(CORECLR_PATH)/tests/src/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs
# https://github.com/mono/mono/issues/7432
CORECLR_DISABLED_TEST_CS_SRC += \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcsuppressfinalize.cs
CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/BBT/Scenario4/Not-Int32.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/Convert/implicitConv.il \
+59 -25
View File
@@ -40,6 +40,7 @@ namespace Mono.Profiling.Tests.Stress {
public int? ExitCode { get; set; }
public string StandardOutput { get; set; }
public string StandardError { get; set; }
public string CombinedOutput { get; set; }
}
static class Program {
@@ -57,7 +58,9 @@ namespace Mono.Profiling.Tests.Stress {
"jit",
};
static readonly TimeSpan _timeout = TimeSpan.FromHours (9);
static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
const RegexOptions _regexOptions = RegexOptions.Compiled | RegexOptions.Singleline;
static readonly Dictionary<string, Predicate<Benchmark>> _filters = new Dictionary<string, Predicate<Benchmark>> {
{ "ironjs-v8", FilterNotOnArm },
@@ -89,26 +92,50 @@ namespace Mono.Profiling.Tests.Stress {
static int Main ()
{
var regex = new Regex (".*", _regexOptions);
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_REGEX") is string envRegex)
regex = new Regex (envRegex, _regexOptions);
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 && IsSupported (b))
.Where (b => !b.OnlyExplicit && b.ClientCommandLine == null && IsSupported (b) && regex.IsMatch (b.Name))
.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 seed = Environment.TickCount;
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_SEED") is string envSeed)
seed = int.Parse (envSeed);
var timeout = (int) _timeout.TotalMilliseconds;
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_TIMEOUT") is string envTimeout)
timeout = (int) TimeSpan.Parse (envTimeout).TotalMilliseconds;
string options = null;
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_OPTIONS") is string envOptions)
options = envOptions;
var rand = new Random (seed);
var cpus = Environment.ProcessorCount;
var results = new List<TestResult> (benchmarks.Length);
var sw = Stopwatch.StartNew ();
Console.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] Starting test session with seed: {seed}");
Console.ResetColor ();
var results = new List<TestResult> (benchmarks.Length);
for (var i = 0; i < benchmarks.Length; i++) {
var bench = benchmarks [i];
@@ -117,17 +144,24 @@ namespace Mono.Profiling.Tests.Stress {
var maxSamples = rand.Next (0, cpus * 2000 + 1);
var heapShotFreq = rand.Next (-10, 11);
var maxFrames = rand.Next (0, 33);
var options = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1)
.Select (x => (x.Value ? string.Empty : "no") + x.Key)
.ToArray ();
var flags = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1)
.Select (x => (x.Value ? string.Empty : "no") + x.Key)
.ToArray ();
var profOptions = $"maxframes={maxFrames},{string.Join (",", options)},output=/dev/null";
var profOptions = "nodefaults,output=/dev/null,";
if (sampleFreq > 0)
profOptions += $",sample{sampleMode}={sampleFreq},maxsamples={maxSamples}";
if (options == null) {
profOptions += $"maxframes={maxFrames},";
if (heapShotFreq > 0)
profOptions += $",heapshot={heapShotFreq}gc";
if (sampleFreq > 0)
profOptions += $"sample{sampleMode}={sampleFreq},maxsamples={maxSamples},";
if (heapShotFreq > 0)
profOptions += $"heapshot={heapShotFreq}gc,";
profOptions += string.Join (",", flags);
} else
profOptions += options;
var info = new ProcessStartInfo {
UseShellExecute = false,
@@ -157,17 +191,22 @@ namespace Mono.Profiling.Tests.Stress {
var stdout = new StringBuilder ();
var stderr = new StringBuilder ();
var combined = new StringBuilder ();
proc.OutputDataReceived += (sender, args) => {
if (args.Data != null)
lock (result)
lock (result) {
stdout.AppendLine (args.Data);
combined.AppendLine (args.Data);
}
};
proc.ErrorDataReceived += (sender, args) => {
if (args.Data != null)
lock (result)
lock (result) {
stderr.AppendLine (args.Data);
combined.AppendLine (args.Data);
}
};
result.Stopwatch.Start ();
@@ -177,7 +216,7 @@ namespace Mono.Profiling.Tests.Stress {
proc.BeginOutputReadLine ();
proc.BeginErrorReadLine ();
if (!proc.WaitForExit ((int) _timeout.TotalMilliseconds)) {
if (!proc.WaitForExit (timeout)) {
// Force a thread dump.
Syscall.kill (proc.Id, Signum.SIGQUIT);
Thread.Sleep (1000);
@@ -194,6 +233,7 @@ namespace Mono.Profiling.Tests.Stress {
lock (result) {
result.StandardOutput = stdout.ToString ();
result.StandardError = stderr.ToString ();
result.CombinedOutput = combined.ToString ();
}
}
@@ -205,16 +245,10 @@ namespace Mono.Profiling.Tests.Stress {
if (result.ExitCode != 0) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine ("===== stdout =====");
Console.WriteLine ("===== stdout + stderr =====");
Console.ResetColor ();
Console.WriteLine (result.StandardOutput);
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine ("===== stderr =====");
Console.ResetColor ();
Console.WriteLine (result.StandardError);
Console.WriteLine (result.CombinedOutput);
}
results.Add (result);
@@ -233,7 +267,7 @@ namespace Mono.Profiling.Tests.Stress {
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.WriteComment ($"This file represents the results of running a test suite (seed: {seed})");
writer.WriteStartElement ("test-results");
writer.WriteAttributeString ("name", "profiler-stress-tests.dummy");
+194 -27
View File
@@ -1,8 +1,8 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [5.10.1],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_INIT(mono, [5.12.0],
[https://github.com/mono/mono/issues/new])
AC_CONFIG_SRCDIR([README.md])
AC_CONFIG_MACRO_DIR([m4])
@@ -40,7 +40,7 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
# 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=4
MONO_CORLIB_COUNTER=5
MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR 0 $MONO_CORLIB_COUNTER`
AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
@@ -100,7 +100,7 @@ extra_runtime_ldflags=""
# Hack for WASM
# Current autotools (v1.15) doesn't have a triplet we can use for wasm so the kludge we do is to
# work around it by using a feature flag instead
AC_ARG_ENABLE(wasm,[ --enable-wasm Hack to set the current runtime to target wasm], enable_wasm=$enableval)
AC_ARG_ENABLE(wasm,[ --enable-wasm Hack to set the current runtime to target wasm], enable_wasm=$enableval)
# Thread configuration inspired by sleepycat's db
AC_MSG_CHECKING([host platform characteristics])
@@ -123,6 +123,7 @@ CFLAGS="$CFLAGS -D_REENTRANT -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1"
CPPFLAGS="$CPPFLAGS -D_REENTRANT -DUSE_MMAP -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1"
libdl="-ldl"
libgc_threads=pthreads
platform_wasm=yes
else
@@ -206,6 +207,7 @@ case "$host" in
;;
*-*-*openbsd*)
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DHOST_BSD -D_REENTRANT -DUSE_MMAP"
LDFLAGS="${LDFLAGS} -Wl,-zwxneeded"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
@@ -215,6 +217,7 @@ case "$host" in
AC_DEFINE(PTHREAD_POINTER_ID)
libdl=
libgc_threads=pthreads
with_tls=pthread
with_sigaltstack=no
use_sigposix=yes
with_sgen_default_concurrent=yes
@@ -368,11 +371,32 @@ case "$host" in
AC_DEFINE(PTHREAD_POINTER_ID)
dnl Haiku does not support static TLS with __thread
with_tls=pthread
dnl Boehm is too much work to backport Haiku support for
support_boehm=no
libgc_threads=pthreads
use_sigposix=yes
;;
*-*-aix*|*-*-os400*)
dnl Set up a 64-bit build
CPPFLAGS="$CPPFLAGS -maix64 -DGC_AIX_THREADS -D_ALL_SOURCE -D_LARGE_FILES -D_REENTRANT"
LDFLAGS="-maix64"
libmono_cflags="-D_REENTRANT"
dnl Would you believe GNU nm doesn't know how to process AIX libraries?
dnl Hardcode IBM binutils in case GNU ones end up on our path. Also
dnl specifiy 64-bit mode for tools.
AR="/usr/bin/ar -X64"
NM="/usr/bin/nm -X64"
dnl SGen is the future (changes to Boehm support code would be
dnl required if you wish to re-enable Boehm)
support_boehm=no
with_gc=sgen
need_link_unlink=yes
use_sigposix=yes
dnl the valloc call to alloc the guard page bombs out, even with extending the data area
with_sigaltstack=no
dnl use pthread TLS, __thread has issues with the compiler flags we use
with_tls=pthread
dnl ppc Linux is the same? test further
disable_munmap=yes
;;
*)
AC_MSG_WARN([*** Please add $host to configure.ac checks!])
libdl="-ldl"
@@ -413,6 +437,7 @@ AM_CONDITIONAL(HOST_SIGPOSIX, test x$use_sigposix = xyes)
AM_CONDITIONAL(HOST_ANDROID, test x$platform_android = xyes)
AM_CONDITIONAL(HOST_TIZEN, test x$platform_tizen = xyes)
AM_CONDITIONAL(HOST_IOS, test x$platform_ios = xyes)
AM_CONDITIONAL(HOST_WASM, test x$platform_wasm = xyes)
if test -z "$HOST_DARWIN_TRUE"; then :
PLATFORM_AOT_SUFFIX=.dylib
@@ -516,7 +541,6 @@ AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
if test x$have_zlib = xyes; then
AC_TRY_COMPILE([#include <zlib.h>], [
#if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
return 0;
#else
#error No good zlib found
#endif
@@ -543,6 +567,7 @@ AC_CHECK_HEADERS(sys/poll.h)
AC_CHECK_HEADERS(sys/wait.h)
AC_CHECK_HEADERS(grp.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_FUNCS(vsyslog)
# for mono/dis
AC_CHECK_HEADERS(wchar.h)
@@ -614,7 +639,6 @@ if test x$platform_android = xyes; then
#include <android/versioning.h>
],[
#if __ANDROID_API_O__ == 26 && defined(__INTRODUCED_IN)
return 0
#else
#error __ANDROID_API_O__ != 26 or the __INTRODUCED_IN macro not defined
#endif
@@ -655,7 +679,6 @@ AC_CACHE_CHECK([for clang],
#else
#error "FAILED"
#endif
return 0;
],
[mono_cv_clang=yes],
[mono_cv_clang=no],
@@ -691,7 +714,6 @@ if test x"$GCC" = xyes; then
CFLAGS="$CFLAGS -Wunused-but-set-variable -Werror"
AC_MSG_CHECKING(for -Wno-unused-but-set-variable option to gcc)
AC_TRY_COMPILE([],[
return 0;
], [
AC_MSG_RESULT(yes)
CFLAGS="$ORIG_CFLAGS -Wno-unused-but-set-variable"
@@ -862,7 +884,6 @@ if test "x$with_xen_opt" = "xyes" -a "x$mono_cv_clang" = "xno"; then
CFLAGS="$CFLAGS -mno-tls-direct-seg-refs"
AC_MSG_CHECKING(for -mno-tls-direct-seg-refs option to gcc)
AC_TRY_COMPILE([], [
return 0;
], [
AC_MSG_RESULT(yes)
# Pass it to libgc as well
@@ -913,6 +934,75 @@ if test $csc_compiler = default; then
fi
AC_MSG_RESULT($csc_compiler)
AC_ARG_WITH(jemalloc, [ --with-jemalloc=yes,no If jemalloc is enabled (defaults to no)], [], [with_jemalloc=no])
AC_ARG_WITH(jemalloc-always, [ --with-jemalloc_always=yes,no If jemalloc is enabled and always used (defaults to yes)], [], [with_jemalloc_always=no])
AC_ARG_WITH(jemalloc-assert, [ --with-jemalloc_assert=yes,no If jemalloc performs runtime checks for memory correctness (defaults to no)], [], [with_jemalloc_assert=no])
if test x$target_win32 = xyes; then
with_jemalloc=no
with_jemalloc_assert=no
with_jemalloc_always=no
fi
AM_CONDITIONAL(MONO_JEMALLOC_ASSERT, [test "x$with_jemalloc_assert" = "xyes"])
if test "x$with_jemalloc_assert" = "xyes"; then
JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_ASSERT"
AC_DEFINE(MONO_JEMALLOC_ASSERT, 1, [Make jemalloc assert for mono])
AC_SUBST(MONO_JEMALLOC_ASSERT, 1)
fi
AM_CONDITIONAL(MONO_JEMALLOC_DEFAULT, [test "x$with_jemalloc_always" = "xyes"])
if test "x$with_jemalloc_always" = "xyes"; then
with_jemalloc=yes
JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_DEFAULT"
AC_DEFINE(MONO_JEMALLOC_DEFAULT, 1, [Make jemalloc default for mono])
AC_SUBST(MONO_JEMALLOC_DEFAULT, 1)
fi
AM_CONDITIONAL(MONO_JEMALLOC_ENABLED, [test "x$with_jemalloc" = "xyes"])
if test "x$with_jemalloc" = "xyes"; then
JEMALLOC_LDFLAGS="-L`pwd`/mono/utils/jemalloc/jemalloc/lib -ljemalloc_pic"
JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_ENABLED -I `pwd`/mono/utils/jemalloc/jemalloc/include"
JEMALLOC_AUTOCONF_FLAGS=" --build=$target --host=$host"
if test "x$target_mach" = "xyes"; then
JEMALLOC_CPPFLAGS=" -stdlib=libc++ "
fi
AC_DEFINE(MONO_JEMALLOC_ENABLED, 1, [Enable jemalloc usage for mono])
AC_SUBST(MONO_JEMALLOC_ENABLED, 1)
AC_SUBST(JEMALLOC_CFLAGS)
AC_SUBST(JEMALLOC_CPPFLAGS)
AC_SUBST(JEMALLOC_LDFLAGS)
AC_SUBST(JEMALLOC_AUTOCONF_FLAGS)
fi
# Terminology:
# Crash privacy - Attempts to not send identifying information in the crash dump / to protect the obscurity of the program control flow
# MERP - The MS telemetry profile. Not for general use.
# Structured crashes - crashes at runtime that trigger a stack walk by mono that happens cooperatively
# Structured crashes are not merp crashes. Structured crashes are json dumps made by mono during crashes. Merp upload is going to use the dumping code is a very specific way, and is enabled at runtime with an icall.
#--with-crash_privacy=yes --with-structured_crashes=no means we don't wanna dump in non-merp-enabled builds, and we want to not send symbol strings. This is going to be the default pair of settings for VS4Mac.
#--with-crash_privacy=yes --with-structured_crashes=yes means you want to see crashes on your console, and you want to not see unmanaged symbol names. This is an option for proprietary apps that have manual bugs filed.
#--with-crash_privacy=no --with-structured_crashes=no means you want to see no crash dumps on failure and you don't care about privacy. This is how you'd set a "don't want it, don't care" configuration.
#--with-crash_privacy=no --with-structured_crashes=yes means you want full crashes and you want to see them in the terminal, not on telemetry. This is going to be how we build for CI.
AC_ARG_WITH(crash-privacy, [ --with-crash_privacy=yes,no If you want your crashes to not include names of symbols present in the binary. ], [], [with_crash_privacy=no])
AC_ARG_WITH(structured-crashes, [ --with-structured_crashes=yes,no If you want your unmanaged crashes to result in a small crash dump file. ], [], [with_structured_crashes=yes])
if test "x$with_crash_privacy" = "xno"; then
AC_DEFINE(MONO_PRIVATE_CRASHES,1,[Do not include names of unmanaged functions in the crash dump])
fi
if test "x$with_structured_crashes" = "xno"; then
AC_DEFINE(DISABLE_STRUCTURED_CRASH,1,[Do not create structured crash files during unmanaged crashes])
fi
#
# Set the build profiles and options before things which use them
#
@@ -933,6 +1023,52 @@ AC_ARG_WITH(wasm, [ --with-wasm=yes,no If you w
AC_ARG_WITH(runtime_preset, [ --with-runtime_preset=net_4_x,all,aot,hybridaot,fullaot,bitcode,unreal Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
AC_ARG_WITH(spectre-mitigation, [ --with-spectre-mitigation=yes,no If you want to build the runtime with compiler flags that enable Spectre mitigation (defaults to no)], [], [with_spectre_mitigation=default])
AC_ARG_WITH(spectre-indirect-branch-choice, [ --with-spectre-indirect-branch-choice=keep,thunk,inline,extern Convert indirect branches to the specified kind of thunk (defaults to inline)], [], [with_spectre_indirect_branch_choice=inline])
AC_ARG_WITH(spectre-function-return-choice, [ --with-spectre-function-return-choice=keep,thunk,inline,extern Convert function return instructions to the specified kind of thunk (defaults to inline)], [], [with_spectre_function_return_choice=inline])
dnl
dnl Spectre compiler mitigation flag checks
dnl
if test "x$with_spectre_mitigation" = "xyes"; then
AC_MSG_NOTICE([Compiler Spectre mitigation support checks])
SPECTRE_CFLAGS=
SPECTRE_INDIRECT_BRANCH_KIND=
case "x$with_spectre_indirect_branch_choice" in
xkeep) SPECTRE_INDIRECT_BRANCH_KIND=keep ;;
xthunk) SPECTRE_INDIRECT_BRANCH_KIND=thunk ;;
xinline) SPECTRE_INDIRECT_BRANCH_KIND=thunk-inline ;;
xextern) SPECTRE_INDIRECT_BRANCH_KIND=thunk-extern ;;
*) AC_MSG_ERROR([Invalid indirect jump thunk kind ($with_spectre_indirect_branch_choice)]) ;;
esac
SPECTRE_FUNCTION_RETURN_KIND=""
case "x$with_spectre_function_return_choice" in
xkeep) SPECTRE_FUNCTION_RETURN_KIND=keep ;;
xthunk) SPECTRE_FUNCTION_RETURN_KIND=thunk ;;
xinline) SPECTRE_FUNCTION_RETURN_KIND=thunk-inline ;;
xextern) SPECTRE_FUNCTION_RETURN_KIND=thunk-extern ;;
*) AC_MSG_ERROR([Invalid function return thunk kind ($with_spectre_function_return_choice)]) ;;
esac
AX_CHECK_COMPILE_FLAG(
[ -mindirect-branch=$SPECTRE_INDIRECT_BRANCH_KIND ],
[ SPECTRE_CFLAGS="$SPECTRE_CFLAGS -mindirect-branch=$SPECTRE_INDIRECT_BRANCH_KIND" ]
)
AX_CHECK_COMPILE_FLAG(
[ -mfunction-return=$SPECTRE_FUNCTION_RETURN_KIND ],
[ SPECTRE_CFLAGS="$SPECTRE_CFLAGS -mfunction-return=$SPECTRE_FUNCTION_RETURN_KIND" ]
)
if test "x$SPECTRE_CFLAGS" != "x" ; then
CFLAGS="$CFLAGS $SPECTRE_CFLAGS"
CXXFLAGS="$CXXFLAGS $SPECTRE_CFLAGS"
spectre_mitigation_status="mitigation enabled"
fi
else
spectre_mitigation_status="no mitigation"
fi
dnl
dnl Profile defaults
@@ -1309,6 +1445,12 @@ fi
AM_CONDITIONAL(DISABLE_INTERPRETER, test x$mono_feature_disable_interpreter = xyes)
if test "x$mono_feature_disable_interpreter" != "xyes" -o "x$mono_feature_disable_jit" != "xyes"; then
AC_DEFINE(ENABLE_ILGEN, 1, [Some VES is available at runtime])
fi
AM_CONDITIONAL(ENABLE_ILGEN, test x$mono_feature_disable_interpreter != xyes -o x$mono_feature_disable_jit != xyes)
if test "x$mono_feature_disable_simd" = "xyes"; then
AC_DEFINE(DISABLE_SIMD, 1, [Disable SIMD intrinsics related optimizations.])
AC_MSG_NOTICE([Disabled SIMD support])
@@ -1671,7 +1813,6 @@ if test x$host_win32 = xno; then
AC_TRY_COMPILE([#include <sched.h>], [
int mask = 1;
sched_setaffinity(0, &mask);
return 0;
], [
# Yes, we have it...
AC_MSG_RESULT(yes)
@@ -2255,11 +2396,7 @@ if test x$host_win32 = xno; then
child ()
{
struct sigaction sa;
#ifdef __APPLE__
stack_t sas;
#else
struct sigaltstack sas;
#endif
pthread_t id;
pthread_attr_t attr;
@@ -2654,7 +2791,7 @@ if test x$host_win32 = xno; then
[#include <sys/types.h>
#include <sys/vfs.h>])
AC_CHECK_MEMBERS(
[struct stat.st_atim, struct stat.st_mtim, struct stat.st_ctim],,,
[struct stat.st_atim, struct stat.st_mtim, struct stat.st_atimespec, struct stat.st_ctim],,,
[#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>])
@@ -2927,6 +3064,12 @@ case "{$build}" in
NAME_DEV_RANDOM="/dev/srandom"
;;
dnl IBM i does not have /dev/random, use unblocking only
*-*-os400*)
NAME_DEV_RANDOM="/dev/urandom"
;;
dnl Win32 does not have /dev/random, they have their own method...
*-mingw*|*-*-cygwin*)
@@ -3248,7 +3391,6 @@ case "$host" in
#if _MIPS_SIM != _ABIN32
#error Not mips n32
#endif
return 0;
],[
AC_MSG_RESULT(yes)
sizeof_register=8
@@ -3298,6 +3440,9 @@ case "$host" in
BTLS_PLATFORM=i386
;;
openbsd*|freebsd*|kfreebsd-gnu*)
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=i386
;;
esac
;;
@@ -3322,6 +3467,9 @@ case "$host" in
boehm_supported=false
;;
openbsd*|freebsd*|kfreebsd-gnu*)
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=x86_64
;;
mingw*)
;;
@@ -3355,7 +3503,8 @@ case "$host" in
INTL="intl"
;;
macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \
powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | powerpc-*-freebsd* )
powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | \
powerpc-*-freebsd* | powerpc-*-aix* | powerpc-*-os400* )
if test "x$ac_cv_sizeof_void_p" = "x8"; then
TARGET=POWERPC64;
CPPFLAGS="$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__"
@@ -3366,6 +3515,13 @@ case "$host" in
fi
arch_target=ppc;
case $host_os in
aix*|os400*)
dnl on AIX/PASE, shared libraries can be inside archives
dnl if they are, we specify them by lib.a(lib.so)
dnl we may hardcode 64-bit names at times, but we don't do 32-bit AIX, so
LIBC="libc.a(shr_64.o)"
INTL="libintl.a(libintl.so.9)"
;;
linux*|darwin*)
;;
esac
@@ -3709,7 +3865,6 @@ if test "x$target_mach" = "xyes"; then
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
#error fail this for ios
#endif
return 0;
], [
AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX])
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_OSX"
@@ -3943,7 +4098,19 @@ AC_SEARCH_LIBS(nanosleep, rt)
AC_SEARCH_LIBS(dlopen, dl)
old_ldflags="${LDFLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
# GNU specific option, this confuses IBM ld, but do offer alternatives when possible
if test $lt_cv_prog_gnu_ld = yes; then
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
else
case $host in
*-*-aix*|*-*-os400*)
;;
*)
dnl Try to use export-dynamic anyways
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
;;
esac
fi
AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
if test $found_export_dynamic = no; then
LDFLAGS="${old_ldflags}"
@@ -3965,7 +4132,7 @@ fi
AC_SUBST(G_HAVE_ISO_VARARGS)
AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h iconv.h localcharset.h sys/types.h sys/resource.h)
AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])])
AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+=" -liconv -lcharset"])])
AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
AC_SUBST(HAVE_ALLOCA_H)
@@ -4057,6 +4224,8 @@ if test "x$icall_tables" = "xno"; then
AC_DEFINE(DISABLE_ICALL_TABLES, 1, [Icall tables disabled])
fi
AM_CONDITIONAL(DISABLE_ICALL_TABLES, test x$icall_tables = xno)
if test "x$with_tls" = "x__thread"; then
AC_DEFINE(HAVE_KW_THREAD, 1, [Have __thread keyword])
# Pass the information to libgc
@@ -4107,7 +4276,6 @@ if test ${TARGET} = ARM; then
#ifndef __ARM_PCS_VFP
#error "Float ABI is not 'hard'"
#endif
return 0;
], [
fpu=VFP_HARD
], [
@@ -4121,7 +4289,6 @@ if test ${TARGET} = ARM; then
#ifdef __SOFTFP__
#error "Float ABI is not 'softfp'"
#endif
return 0;
], [
fpu=VFP
], [
@@ -4146,7 +4313,6 @@ if test ${TARGET} = ARM; then
#if !defined(__ARM_ARCH_5T__) && !defined(__ARM_ARCH_5TE__) && !defined(__ARM_ARCH_5TEJ__)
#error Not on ARM v5.
#endif
return 0;
], [
arm_v5=yes
@@ -4157,7 +4323,6 @@ if test ${TARGET} = ARM; then
#if !defined(__ARM_ARCH_6J__) && !defined(__ARM_ARCH_6ZK__) && !defined(__ARM_ARCH_6K__) && !defined(__ARM_ARCH_6T2__) && !defined(__ARM_ARCH_6M__)
#error Not on ARM v6.
#endif
return 0;
], [
arm_v5=yes
arm_v6=yes
@@ -4169,7 +4334,6 @@ if test ${TARGET} = ARM; then
#if !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_7R__) && !defined(__ARM_ARCH_7EM__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7S__)
#error Not on ARM v7.
#endif
return 0;
], [
arm_v5=yes
arm_v6=yes
@@ -4728,6 +4892,7 @@ scripts/mono-find-requires
mono/Makefile
mono/btls/Makefile
mono/utils/Makefile
mono/utils/jemalloc/Makefile
mono/metadata/Makefile
mono/dis/Makefile
mono/cil/Makefile
@@ -4950,6 +5115,7 @@ echo "
BigArrays: $enable_big_arrays
DTrace: $enable_dtrace
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
Spectre: $spectre_mitigation_status
Libraries:
.NET 4.x: $with_profile4_x
@@ -4967,6 +5133,7 @@ echo "
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
BTLS: $enable_btls$btls_platform_string
jemalloc: $with_jemalloc (always use: $with_jemalloc_always)
$disabled
"
if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
+1 -1
View File
@@ -69,5 +69,5 @@ object for filters is passed in a local variable (cfg->exvar).
throw: we first save all regs into a sigcontext struct and then call the stack
unwinding code.
catch handler: catch hanlders are always called from the stack unwinding
catch handler: catch handlers are always called from the stack unwinding
code. The exception object is passed in a local variable (cfg->exvar).
+1 -1
+1 -1
+1 -1
+1 -1
View File
@@ -49,7 +49,7 @@ obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
backgraph.c win32_threads.c \
pthread_support.c pthread_stop_world.c darwin_stop_world.c \
openbsd_stop_world.c mach_dep.c $(asm_libgc_sources)
mach_dep.c $(asm_libgc_sources)
# Include THREADDLLIBS here to ensure that the correct versions of
# linuxthread semaphore functions get linked:
+4
View File
@@ -104,6 +104,10 @@ case "$THREADS" in
AC_DEFINE(GC_AIX_THREADS)
AC_DEFINE(_REENTRANT)
;;
*-*-haiku*)
AC_DEFINE(GC_HAIKU_THREADS)
AC_DEFINE(_REENTRANT)
;;
*-*-hpux*)
AC_MSG_WARN("Only HP/UX 11 threads are supported.")
AC_DEFINE(GC_HPUX_THREADS)
+18 -1
View File
@@ -59,7 +59,7 @@
!(defined(FREEBSD) && defined(__ELF__)) && \
!(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
!defined(DARWIN)
!defined(DARWIN) && !defined(HAIKU)
--> We only know how to find data segments of dynamic libraries for the
--> above. Additional SVR4 variants might not be too
--> hard to add.
@@ -1258,6 +1258,23 @@ GC_bool GC_register_main_static_data()
#endif /* DARWIN */
#if defined(HAIKU)
#include <kernel/image.h>
void GC_register_dynamic_libraries()
{
image_info info;
int32 cookie = 0;
while (get_next_image_info(0, &cookie, &info) == B_OK)
{
void *data = info.data;
GC_add_roots_inner(data, data + info.data_size, TRUE);
}
}
#endif /* HAIKU */
#else /* !DYNAMIC_LOADING */
#ifdef PCR
+1 -1
View File
@@ -57,7 +57,7 @@
defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \
defined(GC_OPENBSD_THREADS) || \
defined(GC_OPENBSD_THREADS) || defined(GC_HAIKU_THREADS) ||\
(defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
# define GC_PTHREADS
# endif
+2
View File
@@ -1979,6 +1979,8 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
/* Linuxthreads itself uses SIGUSR1 and SIGUSR2. */
# define SIG_SUSPEND SIGPWR
# endif
# elif defined(GC_OPENBSD_THREADS)
# define SIG_SUSPEND SIGXFSZ
# else /* !GC_LINUX_THREADS */
# if defined(_SIGRTMIN)
# define SIG_SUSPEND _SIGRTMIN + 6
+32 -1
View File
@@ -238,6 +238,16 @@
# define BEOS
# define mach_type_known
# endif
# if defined(__HAIKU__) && defined(_X86_)
# define I386
# define HAIKU
# define mach_type_known
# endif
# if defined(__HAIKU__) && defined(__amd64__)
# define X86_64
# define HAIKU
# define mach_type_known
# endif
# if defined(LINUX) && (defined(i386) || defined(__i386__))
# define I386
# define mach_type_known
@@ -1164,6 +1174,15 @@
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# endif
# ifdef HAIKU
# define OS_TYPE "HAIKU"
# include <OS.h>
# define GETPAGESIZE() B_PAGE_SIZE
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# define DYNAMIC_LOADING
# define MPROTECT_VDB
# endif
# ifdef SUNOS5
# define OS_TYPE "SUNOS5"
extern int _etext[], _end[];
@@ -2134,6 +2153,15 @@
/* There seems to be some issues with trylock hanging on darwin. This
should be looked into some more */
# endif
# ifdef HAIKU
# define OS_TYPE "HAIKU"
# include <OS.h>
# define GETPAGESIZE() B_PAGE_SIZE
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# define DYNAMIC_LOADING
# define MPROTECT_VDB
# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
# ifndef GC_FREEBSD_THREADS
@@ -2251,7 +2279,7 @@
# if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \
|| defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
|| defined(DGUX) || defined(BSD) || defined(SUNOS4) \
|| defined(_AIX) || defined(DARWIN) || defined(OSF1)
|| defined(_AIX) || defined(DARWIN) || defined(OSF1) || defined(HAIKU)
# define UNIX_LIKE /* Basic Unix-like system calls work. */
# endif
@@ -2507,6 +2535,9 @@
# if defined(SN_TARGET_PS3)
extern void *ps3_get_mem (size_t size);
# define GET_MEM(bytes) (struct hblk*) ps3_get_mem (bytes)
# elif defined(HAIKU)
ptr_t GC_haiku_get_mem(GC_word bytes);
# define GET_MEM(bytes) (struct hblk*)GC_haiku_get_mem(bytes)
# else
extern ptr_t GC_unix_get_mem(word size);
# define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes)
@@ -1,12 +0,0 @@
#ifndef GC_OPENBSD_STOP_WORLD_H
#define GC_OPENBSD_STOP_WORLD_H
#if !defined(GC_OPENBSD_THREADS)
#error openbsd_stop_world.h included without GC_OPENBSD_THREADS defined
#endif
struct thread_stop_info {
ptr_t stack_ptr; /* Valid only when stopped. */
};
#endif
-2
View File
@@ -8,8 +8,6 @@
#if defined(GC_DARWIN_THREADS)
# include "private/darwin_stop_world.h"
#elif defined(GC_OPENBSD_THREADS)
# include "private/openbsd_stop_world.h"
#else
# include "private/pthread_stop_world.h"
#endif
-161
View File
@@ -1,161 +0,0 @@
#include "private/pthread_support.h"
/* derived from pthread_stop_world.c */
# if defined(GC_OPENBSD_THREADS)
#define THREAD_EQUAL(id1, id2) pthread_equal(id1, id2)
/* We hold allocation lock. Should do exactly the right thing if the */
/* world is stopped. Should not fail if it isn't. */
void GC_push_all_stacks()
{
GC_bool found_me = FALSE;
size_t nthreads = 0;
int i;
GC_thread p;
ptr_t lo, hi;
pthread_t me = pthread_self();
if (!GC_thr_initialized) GC_thr_init();
# if DEBUG_THREADS
GC_printf("Pushing stacks from thread 0x%x\n", (unsigned) me);
# endif
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
if (p -> flags & FINISHED) continue;
++nthreads;
if (THREAD_EQUAL(p -> id, me)) {
# ifdef SPARC
lo = (ptr_t)GC_save_regs_in_stack();
# else
lo = GC_approx_sp();
# endif
found_me = TRUE;
} else {
lo = p -> stop_info.stack_ptr;
}
if ((p -> flags & MAIN_THREAD) == 0) {
hi = p -> stack_end;
} else {
/* The original stack. */
hi = GC_stackbottom;
}
# if DEBUG_THREADS
GC_printf("Stack for thread 0x%x = [%p,%p)\n",
(unsigned)(p -> id), lo, hi);
# endif
if (0 == lo) ABORT("GC_push_all_stacks: sp not set!\n");
# ifdef STACK_GROWS_UP
/* We got them backwards! */
GC_push_all_stack(hi, lo);
# else
GC_push_all_stack(lo, hi);
# endif
}
}
if (!found_me && !GC_in_thread_creation)
ABORT("Collecting from unknown thread.");
}
/* We hold the allocation lock. Suspend all threads that might */
/* still be running. */
void GC_suspend_all()
{
int i;
GC_thread p;
int result;
pthread_t my_thread = pthread_self();
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
if (!THREAD_EQUAL(p -> id, my_thread)) {
if (p -> flags & FINISHED) continue;
if (p -> thread_blocked) /* Will wait */ continue;
# if DEBUG_THREADS
GC_printf("Suspending thread 0x%x\n",
(unsigned)(p -> id));
# endif
if (pthread_suspend_np(p -> id) != 0)
ABORT("pthread_suspend_np failed");
/*
* This will only work for userland pthreads. It will
* fail badly on rthreads. Perhaps we should consider
* a pthread_sp_np() function that returns the stack
* pointer for a suspended thread and implement in
* both pthreads and rthreads.
*/
p -> stop_info.stack_ptr = *(ptr_t*)((char *)p -> id + UTHREAD_SP_OFFSET);
}
}
}
}
void GC_stop_world()
{
int i;
GC_ASSERT(I_HOLD_LOCK());
# if DEBUG_THREADS
GC_printf("Stopping the world from 0x%x\n", (unsigned)pthread_self());
# endif
/* Make sure all free list construction has stopped before we start. */
/* No new construction can start, since free list construction is */
/* required to acquire and release the GC lock before it starts, */
/* and we have the lock. */
# ifdef PARALLEL_MARK
GC_acquire_mark_lock();
GC_ASSERT(GC_fl_builder_count == 0);
/* We should have previously waited for it to become zero. */
# endif /* PARALLEL_MARK */
GC_suspend_all();
# ifdef PARALLEL_MARK
GC_release_mark_lock();
# endif
#if DEBUG_THREADS
GC_printf("World stopped from 0x%x\n", (unsigned)pthread_self());
#endif
}
/* Caller holds allocation lock, and has held it continuously since */
/* the world stopped. */
void GC_start_world()
{
pthread_t my_thread = pthread_self();
register int i;
register GC_thread p;
register int result;
# if DEBUG_THREADS
GC_printf("World starting\n");
# endif
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
if (!THREAD_EQUAL(p -> id, my_thread)) {
if (p -> flags & FINISHED) continue;
if (p -> thread_blocked) continue;
#if DEBUG_THREADS
GC_printf("Resuming thread 0x%x\n",
(unsigned)(p -> id));
#endif
if (pthread_resume_np(p -> id) != 0)
ABORT("pthread_kill failed");
}
}
}
# if DEBUG_THREADS
GC_printf("World started\n");
# endif
}
void GC_stop_init() {
}
#endif
+31 -9
View File
@@ -609,7 +609,7 @@ void GC_enable_signals(void)
&& !defined(MACOS) && !defined(DJGPP) && !defined(DOS4GW) \
&& !defined(NOSYS) && !defined(ECOS) && !defined(SN_TARGET_PS3)
# if defined(sigmask) && !defined(UTS4) && !defined(HURD)
# if defined(sigmask) && !defined(UTS4) && !defined(HURD) && !defined(HAIKU)
/* Use the traditional BSD interface */
# define SIGSET_T int
# define SIG_DEL(set, signal) (set) &= ~(sigmask(signal))
@@ -764,14 +764,14 @@ ptr_t GC_get_stack_base()
# endif /* MS Windows */
# ifdef BEOS
# ifdef HAIKU
# include <kernel/OS.h>
ptr_t GC_get_stack_base(){
thread_info th;
get_thread_info(find_thread(NULL),&th);
return th.stack_end;
}
# endif /* BEOS */
# endif /* HAIKU */
# ifdef OS2
@@ -1122,7 +1122,7 @@ void *GC_set_stackbottom = NULL;
#endif /* FREEBSD_STACKBOTTOM */
#if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \
#if !defined(HAIKU) && !defined(AMIGA) && !defined(MSWIN32) \
&& !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS) \
&& !defined(GC_OPENBSD_THREADS)
@@ -1182,7 +1182,7 @@ ptr_t GC_get_stack_base()
# endif /* STACKBOTTOM */
}
# endif /* ! AMIGA, !OS 2, ! MS Windows, !BEOS, !NOSYS, !ECOS */
# endif /* ! AMIGA, !OS 2, ! MS Windows, !HAIKU, !NOSYS, !ECOS */
#if defined(GC_OPENBSD_THREADS)
@@ -1957,6 +1957,19 @@ word bytes;
}
# endif
#if defined(HAIKU)
#include <stdlib.h>
ptr_t GC_haiku_get_mem(word bytes)
{
void* mem;
if (posix_memalign(&mem, GC_page_size, bytes) == 0)
return mem;
else
return NULL;
}
#endif
#ifdef USE_MUNMAP
/* For now, this only works on Win32/WinCE and some Unix-like */
@@ -2393,7 +2406,9 @@ GC_bool is_ptrfree;
# include <sys/mman.h>
# include <signal.h>
# include <sys/syscall.h>
# if !defined(HAIKU)
# include <sys/syscall.h>
# endif
# define PROTECT(addr, len) \
if (mprotect((caddr_t)(addr), (size_t)(len), \
@@ -2450,13 +2465,13 @@ GC_bool is_ptrfree;
#endif /* SUNOS4 || (FREEBSD && !SUNOS5SIGS) */
#if defined(SUNOS5SIGS) || defined(OSF1) || defined(LINUX) \
|| defined(HURD)
|| defined(HURD) || defined(HAIKU)
# ifdef __STDC__
typedef void (* SIG_PF)(int);
# else
typedef void (* SIG_PF)();
# endif
#endif /* SUNOS5SIGS || OSF1 || LINUX || HURD */
#endif /* SUNOS5SIGS || OSF1 || LINUX || HURD || HAIKU */
#if defined(MSWIN32)
typedef LPTOP_LEVEL_EXCEPTION_FILTER SIG_PF;
@@ -2634,6 +2649,13 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
/* architectures. */
# endif /* LINUX */
# if defined(HAIKU)
# include <errno.h>
# define CODE_OK TRUE
# define SIG_OK (sig == SIGSEGV)
void GC_write_failt_handler(int sig, siginfo_t *scp, void * context)
#endif /* HAIKU */
# if defined(SUNOS5SIGS)
# ifdef __STDC__
void GC_write_fault_handler(int sig, SIGINFO_T *scp, void * context)
@@ -2679,7 +2701,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
# if defined(OSF1) && defined(ALPHA)
char * addr = (char *) (scp -> sc_traparg_a0);
# endif
# ifdef SUNOS5SIGS
# if defined(SUNOS5SIGS) || defined(HAIKU)
char * addr = (char *) (scp -> si_addr);
# endif
# ifdef LINUX
+1 -2
View File
@@ -2,8 +2,7 @@
#if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
&& !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) \
&& !defined(GC_DARWIN_THREADS) && !defined(GC_AIX_THREADS) \
&& !defined(GC_OPENBSD_THREADS)
&& !defined(GC_DARWIN_THREADS) && !defined(GC_AIX_THREADS)
#include <signal.h>
#include <semaphore.h>
+1 -1
View File
@@ -1135,7 +1135,7 @@ void GC_thr_init()
# if defined(GC_HPUX_THREADS)
GC_nprocs = pthread_num_processors_np();
# endif
# if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS)
# if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) || defined(GC_HAIKU_THREADS)
GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
if (GC_nprocs <= 0) GC_nprocs = 1;
# endif
+74
View File
@@ -0,0 +1,74 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <[email protected]>
# Copyright (c) 2011 Maarten Bosmans <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 5
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.63)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS
+1
View File
@@ -13,6 +13,7 @@ man_MANS = \
genxs.1 \
httpcfg.1 \
ilasm.1 \
illinkanalyzer.1 \
lc.1 \
macpack.1 \
makecert.1 \
@@ -1,41 +1,74 @@
.TH illinkanalyzer 1
.SH NAME
illinkanalyzer \- Mono's linker analyzer tool
.SH SYNOPSIS
.B illinkanalyzer
\fR[\fIoptions\fR] <\fIlinker-dependency-file.xml.gz\fR>
.SH DESCRIPTION
Linker analyzer is a command line tool to analyze dependencies, which
were recorded during linker processing, and led linker to mark an item
to keep it in the resulting linked assembly.
.PP
It works on an oriented graph of dependencies, which are collected and
dumped during the linker run. The vertices of this graph are the items
of interest like assemblies, types, methods, fields, linker steps,
etc. The edges represent the dependencies.
How to dump dependencies
------------------------
.SH HOW TO DUMP DEPENDENCIES
The linker analyzer needs a linker dependencies file as an input. It
can be retrieved by enabling dependencies dumping during linking of a
Xamarin.Android or a Xamarin.iOS project.
That can be done on the command line by setting
`LinkerDumpDependencies` property to `true` and building the
project. (make sure the LinkAssemblies task is called, it might
require cleaning the project sometimes) Usually it is enough to build
the project like this:
```msbuild /p:LinkerDumpDependencies=true /p:Configuration=Release YourAppProject.csproj```
.PP
That can be done on the command line by setting LinkerDumpDependencies
property to true and building the project. (make sure the
LinkAssemblies task is called, it might require cleaning the project
sometimes) Usually it is enough to build the project like this:
.PP
.nf
.RS
rm -f obj/Release/link.flag
msbuild /p:LinkerDumpDependencies=true /p:Configuration=Release YourAppProject.csproj
.RE
.fi
.PP
After a successful build, there will be a linker-dependencies.xml.gz
file created, containing the information for the analyzer.
How to use the analyzer
-----------------------
.SH OPTIONS
.nf
.RS
-a, --alldeps show all dependencies
--csvoutput=VALUE outputs types and optionally size analysis to CSV
file
-h, --help show this message and exit.
-l, --linkedpath=VALUE sets the linked assemblies directory path. Enables
displaying size estimates.
-r, --rawdeps=VALUE show raw vertex dependencies. Raw vertex VALUE is
in the raw format written by linker to the
dependency XML file. VALUE can be regular
expression
--roots show root dependencies.
--stat show statistic of loaded dependencies.
--tree reduce the dependency graph to the tree.
--types show all types dependencies.
-t, --typedeps=VALUE show type dependencies. The VALUE can be regular
expression
-f, --flat show all dependencies per vertex and their distance
-v, --verbose be more verbose. Enables stat and roots options.
.RE
.fi
.SH EXAMPLES
Let say you would like to know, why a type, Android.App.Activity for
example, was marked by the linker. So run the analyzer like this:
```mono linkeranalyzer.exe -t Android.App.Activity linker-dependencies.xml.gz```
.PP
.nf
.RS
illinkanalyzer -t Android.App.Activity linker-dependencies.xml.gz
.fi
.RE
.PP
Output:
```
.PP
.nf
.RS
Loading dependency tree from: linker-dependencies.xml.gz
--- Type dependencies: 'Android.App.Activity' -----------------------
@@ -46,34 +79,38 @@ Dependency #1
| TypeDef:XA.App.MainActivity [2 deps]
| Assembly:XA.App, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [3 deps]
| Other:Mono.Linker.Steps.ResolveFromAssemblyStep
```
.fi
.RE
.PP
The output contains dependencies string(s), starting with the type and
continuing with the item of interest, which depends on the type. The
dependency could be result of multiple reasons. For example the type
was referenced from a method, or the type was listed in the linker xml
file to be protected.
In our example there is only one dependency string called `Dependency
#1`. It shows us that the type `Android.App.Activity` was marked
during processing of type `XA.App.MainActivity` by the linker. In this
case because the `MainActivity` type is based on the `Activity` type
and thus the linker marked it and kept it in the linked assembly. We
can also see that there are 2 dependencies for the `MainActivity`
class. Note that in the string (above) we see only 1st dependency of
the 2, the dependency on the assembly `XA.App`. And finally the
assembly vertex depends on the `ResolveFromAssemblyStep` vertex. So we
see that the assembly was processed in the `ResolveFromAssembly`
linker step.
Now we might want to see the `MainActivity` dependencies. That could
be done by the following analyzer run:
```mono linkeranalyzer.exe -r TypeDef:XA.App.MainActivity linker-dependencies.xml.gz```
.PP
In our example there is only one dependency string called Dependency
#1. It shows us that the type Android.App.Activity was marked during
processing of type XA.App.MainActivity by the linker. In this case
because the MainActivity type is based on the Activity type and thus
the linker marked it and kept it in the linked assembly. We can also
see that there are 2 dependencies for the MainActivity class. Note
that in the string (above) we see only 1st dependency of the 2, the
dependency on the assembly XA.App. And finally the assembly vertex
depends on the ResolveFromAssemblyStep vertex. So we see that the
assembly was processed in the ResolveFromAssembly linker step.
.PP
Now we might want to see the MainActivity dependencies. That could be done by the following analyzer run:
.PP
.nf
.RS
illinkanalyzer -r TypeDef:XA.App.MainActivity linker-dependencies.xml.gz
.fi
.RE
.PP
Output:
```
.PP
.nf
.RS
Loading dependency tree from: linker-dependencies.xml.gz
--- Raw dependencies: 'TypeDef:XA.App.MainActivity' -----------------
@@ -89,37 +126,7 @@ Dependency #2
| TypeDef:XA.App.MainActivity [2 deps]
| Assembly:XA.App, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [3 deps]
| Other:Mono.Linker.Steps.ResolveFromAssemblyStep
```
Known issues
------------
Sometimes the linker processing is not straight forward and the
marking is postponed, like processing of some of the methods. They are
queued to be processed later. In such case the dependencies are
"interrupted" and the dependecy string for the method usually shows
just dependency on the Mark step.
Command line help
-----------------
```
Usage:
linkeranalyzer [Options] <linker-dependency-file.xml.gz>
Options:
-a, --alldeps show all dependencies
-h, --help show this message and exit.
-r, --rawdeps=VALUE show raw vertex dependencies. Raw vertex VALUE is
in the raw format written by linker to the
dependency XML file. VALUE can be regular
expression
--roots show root dependencies.
--stat show statistic of loaded dependencies.
--tree reduce the dependency graph to the tree.
--types show all types dependencies.
-t, --typedeps=VALUE show type dependencies. The VALUE can be regular
expression
-v, --verbose be more verbose. Enables stat and roots options.
```
.fi
.RE
.SH SEE ALSO
\fBmsbuild\fR(1)
+43 -1
View File
@@ -65,6 +65,45 @@ and
See the description for
.B MONO_IOMAP
in the environment variables section for more details.
.SH METHOD DESCRIPTIONS
A number of diagnostic command line options take as argument a method
description. A method description is a textual representation that
can be used to uniquely identify a method. The syntax is as follows:
.nf
[namespace]classname:methodname[(arguments)]
.fi
.PP
The values in brackets are optional, like the namespace and the
arguments. The arguments themselves are either empty, or a
comma-separated list of arguments. Both the
\fBclassname\fR
and
\fBmethodname\fR
can be set to the special value '*' to match any values (Unix shell
users should escape the argument to avoid the shell interpreting
this).
.PP
The arguments, if present should be a comma separated list of types
either a full typename, or for built-in types it should use the
low-level ILAsm type names for the built-in types,
like 'void', 'char', 'bool', 'byte', 'sbyte', 'uint16', 'int16', 'uint',
'int', 'ulong', 'long', 'uintptr', 'intptr', 'single', 'double', 'string', 'object'.
.PP
Pointer types should be the name of the type, followed by a '*',
arrays should be the typename followed by '[' one or more commas (to
indicate the rank of the array), and ']'.
.PP
Generic values should use '<', one or more type names, separated by
both a comma and a space and '>'.
.PP
By-reference arguments should include a "&" after the typename.
.PP
Examples:
.nf
*:ctor(int) // All constructors that take an int as an argument
*:Main // Methods named Main in any class
*:Main(string[]) // Methods named Main that take a string array in any class
.fi
.SH RUNTIME OPTIONS
The following options are available:
.TP
@@ -1826,7 +1865,10 @@ for example, to see managed frame names on gdb backtraces.
\fBMONO_VERBOSE_METHOD\fR
Enables the maximum JIT verbosity for the specified method. This is
very helpfull to diagnose a miscompilation problems of a specific
method.
method. This can be a comma-separated list of method names to
match. If the name is simple, this applies to any method with that
name, otherwise you can use a mono method description (see the section
METHOD DESCRIPTIONS).
.TP
\fBMONO_JIT_DUMP_METHOD\fR
Enables sending of the JITs intermediate representation for a specified
+1 -1
View File
@@ -202,7 +202,7 @@ Specify a parameter for a custom step.
.SH COPYRIGHT
Copyright (C) 2007 Novell, Inc (http://www.novell.com)
.SH BUGS
Bugs report are welcome at http://bugzilla.xamarin.com
Bugs report are welcome at https://github.com/mono/linker/issues
.PP
Product Mono Tools, Component linker.
.SH MAILING LISTS
+2 -2
View File
@@ -515,10 +515,10 @@ The Mono SQL Query Tool is released under the terms of the GNU GPL.
Please read the accompanying `COPYING' file for details. Alternative
licenses are available from Novell or Daniel Morgan.
.SH BUGS
To report bugs in the compiler, you can use `bug-buddy', or you can
To report bugs in the compiler, you can
file bug reports in our bug tracking system:
.nf
http://bugzilla.xamarin.com.
https://github.com/mono/mono/issues
.fi
.PP
.SH MAILING LISTS
+1 -1
View File
@@ -42,7 +42,7 @@ class X {
Version min_mono_version;
#if __MonoCS__
min_mono_version = new Version (5, 9);
min_mono_version = new Version (5, 11);
#else
min_mono_version = new Version (4, 9);
#endif
+8 -2
View File
@@ -388,5 +388,11 @@ $(the_libdir)/.doc-stamp: $(the_lib)
gen-deps:
@echo "$(DEPS_TARGET_DIR): $(DEP_DIRS) $(DEP_LIBS)" >> $(DEPS_FILE)
update-corefx-sr: $(RESX_RESOURCE_STRING)
MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resx2sr.exe $(RESX_RESOURCE_STRING) >corefx/SR.cs
update-corefx-sr-generic:
ifneq ($(RESX_STRINGS),)
MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resx2sr.exe $(RESX_STRINGS) >$(SR_OUTPUT)
endif
update-corefx-sr: $(RESX_RESOURCE_STRING) $(XTEST_RESX_RESOURCE_STRING)
make SR_OUTPUT=corefx/SR.cs RESX_STRINGS="$(RESX_RESOURCE_STRING)" update-corefx-sr-generic \
&& make SR_OUTPUT=corefx/SR.tests.cs RESX_STRINGS=$(XTEST_RESX_RESOURCE_STRING) update-corefx-sr-generic
+2
View File
@@ -22,3 +22,5 @@ NO_TEST = yes
NO_INSTALL = yes
FRAMEWORK_VERSION = 4.5
MONO_FEATURE_APPLETLS=1
+1
View File
@@ -24,6 +24,7 @@ PROFILE_MCS_FLAGS = \
-d:WASM \
-d:DISABLE_REMOTING \
-d:DISABLE_COM \
-d:FEATURE_NO_BSD_SOCKETS \
-nowarn:1699 \
-nostdlib \
$(DEFAULT_REFERENCES) \
+12 -9
View File
@@ -161,7 +161,7 @@ gacutil = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/gacutil.exe
GACUTIL = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(gacutil)
endif
STD_TARGETS = test run-test run-test-ondotnet clean install uninstall doc-update
STD_TARGETS = test run-test run-xunit-test run-test-ondotnet clean install uninstall doc-update
$(STD_TARGETS): %: do-%
@@ -288,6 +288,15 @@ dist-recursive: dist-local
(cd $$d && $(MAKE) distdir=$$reldir/$$d $@) || exit 1 ; \
done
# function to dist files in groups of 100 entries to make sure we don't exceed shell char limits
define distfilesingroups
for f in $(wordlist 1, 100, $(1)) ; do \
dest=`dirname "$(distdir)/$$f"` ; \
$(MKINSTALLDIRS) $$dest && cp -p "$$f" $$dest || exit 1 ; \
done
$(if $(word 101, $(1)), $(call distfilesingroups, $(wordlist 101, $(words $(1)), $(1))))
endef
# The following target can be used like
#
# dist-local: dist-default
@@ -296,17 +305,11 @@ dist-recursive: dist-local
# Notes:
# 1. we invert the test here to not end in an error if ChangeLog doesn't exist.
# 2. we error out if we try to dist a nonexistant file.
# 3. we pick up Makefile, makefile, or GNUmakefile.
# 3. we pick up Makefile
dist-default:
-mkdir -p $(distdir)
test '!' -f ChangeLog || cp ChangeLog $(distdir)
if test -f Makefile; then m=M; fi; \
if test -f makefile; then m=m; fi; \
if test -f GNUmakefile; then m=GNUm; fi; \
for f in $${m}akefile $(DISTFILES) ; do \
dest=`dirname "$(distdir)/$$f"` ; \
$(MKINSTALLDIRS) $$dest && cp -p "$$f" $$dest || exit 1 ; \
done
$(call distfilesingroups, Makefile $(DISTFILES))
if test -d Documentation ; then \
find . -name '*.xml' > .files ; \
tar cTf .files - | (cd $(distdir); tar xf -) ; \
+16 -6
View File
@@ -20,9 +20,15 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
ifndef NO_TEST
test_nunit_lib = nunitlite.dll
xunit_core := xunit.core xunit.abstractions xunit.assert Xunit.NetCore.Extensions
xunit_core := xunit.core xunit.execution.desktop xunit.abstractions xunit.assert Xunit.NetCore.Extensions
xunit_deps := System.Runtime
xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs) $(topdir)/../mcs/class/test-helpers/PlatformDetection.cs
ifeq ($(USE_XTEST_REMOTE_EXECUTOR), YES)
XTEST_REMOTE_EXECUTOR = $(xunit_test_lib)_RemoteExecuter.exe
xunit_src += $(topdir)/../mcs/class/test-helpers/AdminHelper.cs $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mono.cs $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.Process.cs $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs $(topdir)/../external/corefx/src/Common/src/System/PasteArguments.cs
endif
xunit_class_deps :=
xunit_libs_ref = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(xunit_core))
@@ -54,6 +60,7 @@ test_makefrag = $(depsdir)/$(test_lib).makefrag
test_flags = $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
ifndef NO_BUILD
test_flags += -r:$(the_assembly)
test_assembly_dep = $(the_assembly)
endif
tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag)
@@ -64,7 +71,7 @@ xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll)
xtest_response = $(depsdir)/$(xunit_test_lib).response
xtest_makefrag = $(depsdir)/$(xunit_test_lib).makefrag
xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS)
xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
ifeq ($(wildcard $(xtest_sourcefile)),)
xtest_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
@@ -108,7 +115,7 @@ run-test-local: run-test-lib
run-test-ondotnet-local: run-test-ondotnet-lib
ifdef TEST_WITH_INTERPRETER
TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotWorking,InterpreterNotWorking,CAS
TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotWorking,NotWorkingRuntimeInterpreter,CAS
else
TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotWorking,CAS
endif
@@ -224,7 +231,7 @@ ifdef HAVE_CS_TESTS
$(test_lib_dir):
mkdir -p $@
$(test_lib_output): $(the_assembly) $(test_response) $(test_nunit_dep) $(test_lib_dir)
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_dir)
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
test_response_preprocessed = $(test_response)_preprocessed
@@ -270,18 +277,21 @@ XTEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(P
endif
check: run-xunit-test-local
run-xunit-test: run-xunit-test-local
xunit-test-local: $(xunit_test_lib)
run-xunit-test-local: run-xunit-test-lib
# cp -rf is a HACK for xunit runner to require xunit.execution.desktop.dll file in local folder on .net only
run-xunit-test-lib: xunit-test-local
run-xunit-test-lib: xunit-test-local $(XTEST_REMOTE_EXECUTOR)
@cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.desktop.dll xunit.execution.desktop.dll
ok=:; \
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) || ok=false; \
$$ok
@rm -f xunit.execution.desktop.dll
# Some xunit tests want to be executed in a separate process (see RemoteExecutorTestBase)
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../mcs/class/test-helpers/RemoteExecutorConsoleApp.cs
$(TEST_COMPILE) $(topdir)/../mcs/class/test-helpers/RemoteExecutorConsoleApp.cs -r:$(xunit_test_lib) $(xtest_flags) /debug-
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src)
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
@@ -20,28 +20,28 @@
// THE SOFTWARE.
//
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Memory<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ReadOnlyMemory<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ReadOnlySpan<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.OperationStatus))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.MemoryExtensions))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Memory<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ReadOnlyMemory<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ReadOnlySpan<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.MemoryHandle))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.OperationStatus))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.StandardFormat))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Binary.BinaryPrimitives))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.MemoryMarshal))]
// TODO: we don't have these types yet
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.MemoryExtensions))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.SequencePosition))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.BuffersExtensions))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.IBufferWriter<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.IMemoryOwner<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.IPinnable))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.MemoryHandle))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.MemoryManager<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.MemoryPool<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ReadOnlySequenceSegment<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ReadOnlySequence<>))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.StandardFormat))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Binary.BinaryPrimitives))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Base64))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Utf8Formatter))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Utf8Parser))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.MemoryMarshal))]
//[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.SequenceMarshal))]
@@ -0,0 +1,35 @@
//
// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
//
// 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.
//
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle ("System.Net.Http.Rtc")]
[assembly: AssemblyDescription ("System.Net.Http.Rtc")]
[assembly: AssemblyDefaultAlias ("System.Net.Http.Rtc")]
[assembly: AssemblyCompany ("Mono development team")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("(c) Various Mono authors")]
[assembly: AssemblyVersion ("4.0.0.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -0,0 +1,21 @@
MCS_BUILD_DIR = ../../../build
thisdir = class/Facades/System.Net.Http.Rtc
SUBDIRS =
include $(MCS_BUILD_DIR)/rules.make
LIBRARY_SUBDIR = Facades
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
LIBRARY = System.Net.Http.Rtc.dll
KEYFILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /nowarn:1616,1699
LIB_REFS = System
LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
NO_TEST = yes
include $(MCS_BUILD_DIR)/library.make
@@ -0,0 +1,2 @@
TypeForwarders.cs
AssemblyInfo.cs
@@ -1,10 +1,5 @@
//
// IWebConnectionState.cs
//
// Author:
// Martin Baulig <[email protected]>
//
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -23,30 +18,8 @@
// 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.
using System;
using System.Threading;
//
namespace System.Net
{
interface IWebConnectionState {
WebConnectionGroup Group {
get;
}
ServicePoint ServicePoint {
get;
}
bool Busy {
get;
}
DateTime IdleSince {
get;
}
bool TrySetBusy ();
void SetIdle ();
}
}
#if false // it is forwarded to System.Net.Http.WebRequest.dll but doesn't actually exist there in the .NET 4.7.1 reference assemblies ...
[assembly:System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Http.RtcRequestFactory))]
#endif
@@ -0,0 +1,35 @@
//
// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
//
// 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.
//
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle ("System.Resources.Reader")]
[assembly: AssemblyDescription ("System.Resources.Reader")]
[assembly: AssemblyDefaultAlias ("System.Resources.Reader")]
[assembly: AssemblyCompany ("Mono development team")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("(c) Various Mono authors")]
[assembly: AssemblyVersion ("4.0.2.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -0,0 +1,23 @@
MCS_BUILD_DIR = ../../../build
thisdir = class/Facades/System.Resources.Reader
SUBDIRS =
include $(MCS_BUILD_DIR)/rules.make
LIBRARY_SUBDIR = Facades
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
LIBRARY = System.Resources.Reader.dll
KEYFILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /nowarn:1616,1699
LIB_REFS = System
LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
NO_TEST = yes
include $(MCS_BUILD_DIR)/library.make
@@ -0,0 +1,3 @@
TypeForwarders.cs
AssemblyInfo.cs
@@ -0,0 +1,25 @@
//
// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
//
// 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.
//
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Resources.ResourceReader))]
@@ -0,0 +1,35 @@
//
// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
//
// 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.
//
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle ("System.Resources.Writer")]
[assembly: AssemblyDescription ("System.Resources.Writer")]
[assembly: AssemblyDefaultAlias ("System.Resources.Writer")]
[assembly: AssemblyCompany ("Mono development team")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("(c) Various Mono authors")]
[assembly: AssemblyVersion ("4.0.2.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -0,0 +1,23 @@
MCS_BUILD_DIR = ../../../build
thisdir = class/Facades/System.Resources.Writer
SUBDIRS =
include $(MCS_BUILD_DIR)/rules.make
LIBRARY_SUBDIR = Facades
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
LIBRARY = System.Resources.Writer.dll
KEYFILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /nowarn:1616,1699
LIB_REFS = System
LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
NO_TEST = yes
include $(MCS_BUILD_DIR)/library.make
@@ -0,0 +1,3 @@
TypeForwarders.cs
AssemblyInfo.cs
@@ -0,0 +1,25 @@
//
// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
//
// 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.
//
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Resources.ResourceWriter))]
+5 -4
View File
@@ -27,7 +27,8 @@ System.Xml.XPath System.Xml.XmlDocument System.Xml.Xsl.Primitives Microsoft.Win3
System.IO.FileSystem.AccessControl System.Reflection.TypeExtensions System.Reflection.Emit.Lightweight System.Reflection.Emit.ILGeneration System.Reflection.Emit \
System.Threading.AccessControl System.ValueTuple \
System.Security.Cryptography.Primitives System.Text.Encoding.CodePages System.IO.FileSystem.Watcher \
System.Security.Cryptography.ProtectedData System.ServiceProcess.ServiceController System.IO.Pipes
System.Security.Cryptography.ProtectedData System.ServiceProcess.ServiceController System.IO.Pipes \
System.Net.Ping System.Resources.Reader System.Resources.Writer System.Runtime.Serialization.Formatters System.Security.Cryptography.Csp
# common_SUBDIRS dependencies
common_DEPS_SUBDIRS = System.Security.Cryptography.X509Certificates System.ServiceModel.Primitives System.Runtime.Serialization.Primitives \
@@ -50,7 +51,7 @@ testing_aot_full_SUBDIRS = $(monotouch_SUBDIRS)
testing_aot_full_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
net_4_x_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS)
net_4_x_PARALLEL_SUBDIRS = $(common_SUBDIRS)
net_4_x_PARALLEL_SUBDIRS = $(common_SUBDIRS) System.Net.Http.Rtc
basic_PARALLEL_SUBDIRS = System.Runtime System.Reflection System.Collections System.Resources.ResourceManager System.Globalization \
System.Threading.Tasks System.Collections.Concurrent System.Text.Encoding System.IO System.Threading System.Diagnostics.Debug \
@@ -89,8 +90,8 @@ unreal_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
wasm_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS) $(mobile_only_DEPS_SUBDIRS)
wasm_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
mobile_only_SUBDIRS = System.Net.Ping System.Runtime.Serialization.Formatters System.Security.Cryptography.Csp System.Security.Cryptography.Pkcs \
System.Security.Cryptography.Cng System.Runtime.Loader System.Xml.XPath.XmlDocument System.Reflection.DispatchProxy System.Memory System.Drawing.Common
mobile_only_SUBDIRS = System.Security.Cryptography.Pkcs \
System.Security.Cryptography.Cng System.Runtime.Loader System.Xml.XPath.XmlDocument System.Reflection.DispatchProxy System.Drawing.Common
mobile_only_DEPS_SUBDIRS = System.Security.Cryptography.OpenSsl
+3 -4
View File
@@ -33,10 +33,9 @@
/*
Well, there looks no jis.table source. Thus, it seems like it is
generated from text files from Unicode Home Page such like
ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0208.TXT
However, it is non-normative and in Japan it is contains many problem.
jis.table is generated from uni2tab.c, which requires CP932.TXT and
Unihan.txt as input files. However, it is non-normative and in Japan it is
contains many problem.
FIXME: Some characters such as 0xFF0B (wide "plus") are missing in
that table.
+9
View File
@@ -161,6 +161,15 @@ namespace MonoTests.I18N.CJK
AssertDecode ("Test/texts/japanese-utf8.txt", "Test/texts/japanese-932.txt", 932);
}
[Test]
public void Bug28321 ()
{
var expected = "\u00D7\u00B4\u00B1\u00F7\u00B6\u00B0\u00A8\u00A7";
var text = Manager.GetEncoding ("shift_jis").GetString (Convert.FromBase64String ("gX6BTIF9gYCB94GLgU6BmA=="));
Assert.AreEqual (expected, text);
}
// EUC-JP
[Test]
Binary file not shown.
+4
View File
@@ -158,6 +158,10 @@ public sealed class Handlers
"I18N.Rare.ENCibm500",
"I18N.Rare.CP708",
"I18N.Rare.ENCasmo_708",
"I18N.Rare.CP737",
"I18N.Rare.ENCibm_737",
"I18N.Rare.CP775",
"I18N.Rare.ENCibm_775",
"I18N.Rare.CP852",
"I18N.Rare.ENCibm852",
"I18N.Rare.CP855",
+462
View File
@@ -0,0 +1,462 @@
/*
* CP737.cs - Greek (DOS) code page.
*
* Copyright (c) 2002 Southern Storm Software, Pty Ltd
*
* 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.
*/
// Generated from "ibm-737.ucm".
// WARNING: Modifying this file directly might be a bad idea.
// You should edit the code generator tools/ucm2cp.c instead for your changes
// to appear in all relevant classes.
namespace I18N.Rare
{
using System;
using System.Text;
using I18N.Common;
[Serializable]
public class CP737 : ByteEncoding
{
public CP737()
: base(737, ToChars, "Greek (DOS)",
"ibm737", "ibm737", "ibm737",
false, false, false, false, 1253)
{}
private static readonly char[] ToChars = {
'\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005',
'\u0006', '\u0007', '\u0008', '\u0009', '\u000A', '\u000B',
'\u000C', '\u000D', '\u000E', '\u000F', '\u0010', '\u0011',
'\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
'\u0018', '\u0019', '\u001C', '\u001B', '\u007F', '\u001D',
'\u001E', '\u001F', '\u0020', '\u0021', '\u0022', '\u0023',
'\u0024', '\u0025', '\u0026', '\u0027', '\u0028', '\u0029',
'\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035',
'\u0036', '\u0037', '\u0038', '\u0039', '\u003A', '\u003B',
'\u003C', '\u003D', '\u003E', '\u003F', '\u0040', '\u0041',
'\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D',
'\u004E', '\u004F', '\u0050', '\u0051', '\u0052', '\u0053',
'\u0054', '\u0055', '\u0056', '\u0057', '\u0058', '\u0059',
'\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F',
'\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065',
'\u0066', '\u0067', '\u0068', '\u0069', '\u006A', '\u006B',
'\u006C', '\u006D', '\u006E', '\u006F', '\u0070', '\u0071',
'\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
'\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D',
'\u007E', '\u001A', '\u0391', '\u0392', '\u0393', '\u0394',
'\u0395', '\u0396', '\u0397', '\u0398', '\u0399', '\u039A',
'\u039B', '\u039C', '\u039D', '\u039E', '\u039F', '\u03A0',
'\u03A1', '\u03A3', '\u03A4', '\u03A5', '\u03A6', '\u03A7',
'\u03A8', '\u03A9', '\u03B1', '\u03B2', '\u03B3', '\u03B4',
'\u03B5', '\u03B6', '\u03B7', '\u03B8', '\u03B9', '\u03BA',
'\u03BB', '\u03BC', '\u03BD', '\u03BE', '\u03BF', '\u03C0',
'\u03C1', '\u03C3', '\u03C2', '\u03C4', '\u03C5', '\u03C6',
'\u03C7', '\u03C8', '\u2591', '\u2592', '\u2593', '\u2502',
'\u2524', '\u2561', '\u2562', '\u2556', '\u2555', '\u2563',
'\u2551', '\u2557', '\u255D', '\u255C', '\u255B', '\u2510',
'\u2514', '\u2534', '\u252C', '\u251C', '\u2500', '\u253C',
'\u255E', '\u255F', '\u255A', '\u2554', '\u2569', '\u2566',
'\u2560', '\u2550', '\u256C', '\u2567', '\u2568', '\u2564',
'\u2565', '\u2559', '\u2558', '\u2552', '\u2553', '\u256B',
'\u256A', '\u2518', '\u250C', '\u2588', '\u2584', '\u258C',
'\u2590', '\u2580', '\u03C9', '\u03AC', '\u03AD', '\u03AE',
'\u03CA', '\u03AF', '\u03CC', '\u03CD', '\u03CB', '\u03CE',
'\u0386', '\u0388', '\u0389', '\u038A', '\u038C', '\u038E',
'\u038F', '\u00B1', '\u2265', '\u2264', '\u03AA', '\u03AB',
'\u00F7', '\u2248', '\u00B0', '\u2219', '\u00B7', '\u221A',
'\u207F', '\u00B2', '\u25A0', '\u00A0',
};
// Get the number of bytes needed to encode a character buffer.
public unsafe override int GetByteCountImpl (char* chars, int count)
{
if (this.EncoderFallback != null) {
//Calculate byte count by actually doing encoding and discarding the data.
return GetBytesImpl(chars, count, null, 0);
}
else
{
return count;
}
}
// Get the number of bytes needed to encode a character buffer.
public override int GetByteCount (String s)
{
if (this.EncoderFallback != null)
{
//Calculate byte count by actually doing encoding and discarding the data.
unsafe
{
fixed (char *s_ptr = s)
{
return GetBytesImpl(s_ptr, s.Length, null, 0);
}
}
}
else
{
//byte count equals character count because no EncoderFallback set
return s.Length;
}
}
//ToBytes is just an alias for GetBytesImpl, but doesn't return byte count
protected unsafe override void ToBytes(char* chars, int charCount,
byte* bytes, int byteCount)
{
//Calling ToBytes with null destination buffer doesn't make any sense
if (bytes == null)
throw new ArgumentNullException("bytes");
GetBytesImpl(chars, charCount, bytes, byteCount);
}
public unsafe override int GetBytesImpl (char* chars, int charCount,
byte* bytes, int byteCount)
{
int ch;
int charIndex = 0;
int byteIndex = 0;
EncoderFallbackBuffer buffer = null;
while (charCount > 0)
{
ch = (int)(chars[charIndex]);
if(ch >= 26) switch(ch)
{
case 0x001B:
case 0x001D:
case 0x001E:
case 0x001F:
case 0x0020:
case 0x0021:
case 0x0022:
case 0x0023:
case 0x0024:
case 0x0025:
case 0x0026:
case 0x0027:
case 0x0028:
case 0x0029:
case 0x002A:
case 0x002B:
case 0x002C:
case 0x002D:
case 0x002E:
case 0x002F:
case 0x0030:
case 0x0031:
case 0x0032:
case 0x0033:
case 0x0034:
case 0x0035:
case 0x0036:
case 0x0037:
case 0x0038:
case 0x0039:
case 0x003A:
case 0x003B:
case 0x003C:
case 0x003D:
case 0x003E:
case 0x003F:
case 0x0040:
case 0x0041:
case 0x0042:
case 0x0043:
case 0x0044:
case 0x0045:
case 0x0046:
case 0x0047:
case 0x0048:
case 0x0049:
case 0x004A:
case 0x004B:
case 0x004C:
case 0x004D:
case 0x004E:
case 0x004F:
case 0x0050:
case 0x0051:
case 0x0052:
case 0x0053:
case 0x0054:
case 0x0055:
case 0x0056:
case 0x0057:
case 0x0058:
case 0x0059:
case 0x005A:
case 0x005B:
case 0x005C:
case 0x005D:
case 0x005E:
case 0x005F:
case 0x0060:
case 0x0061:
case 0x0062:
case 0x0063:
case 0x0064:
case 0x0065:
case 0x0066:
case 0x0067:
case 0x0068:
case 0x0069:
case 0x006A:
case 0x006B:
case 0x006C:
case 0x006D:
case 0x006E:
case 0x006F:
case 0x0070:
case 0x0071:
case 0x0072:
case 0x0073:
case 0x0074:
case 0x0075:
case 0x0076:
case 0x0077:
case 0x0078:
case 0x0079:
case 0x007A:
case 0x007B:
case 0x007C:
case 0x007D:
case 0x007E:
break;
case 0x001A: ch = 0x7F; break;
case 0x001C: ch = 0x1A; break;
case 0x007F: ch = 0x1C; break;
case 0x00A0: ch = 0xFF; break;
case 0x00A7: ch = 0x15; break;
case 0x00B0: ch = 0xF8; break;
case 0x00B1: ch = 0xF1; break;
case 0x00B2: ch = 0xFD; break;
case 0x00B6: ch = 0x14; break;
case 0x00B7: ch = 0xFA; break;
case 0x00F7: ch = 0xF6; break;
case 0x0386: ch = 0xEA; break;
case 0x0388: ch = 0xEB; break;
case 0x0389: ch = 0xEC; break;
case 0x038A: ch = 0xED; break;
case 0x038C: ch = 0xEE; break;
case 0x038E: ch = 0xEF; break;
case 0x038F: ch = 0xF0; break;
case 0x0391:
case 0x0392:
case 0x0393:
case 0x0394:
case 0x0395:
case 0x0396:
case 0x0397:
case 0x0398:
case 0x0399:
case 0x039A:
case 0x039B:
case 0x039C:
case 0x039D:
case 0x039E:
case 0x039F:
case 0x03A0:
case 0x03A1:
ch -= 0x0311;
break;
case 0x03A3:
case 0x03A4:
case 0x03A5:
case 0x03A6:
case 0x03A7:
case 0x03A8:
case 0x03A9:
ch -= 0x0312;
break;
case 0x03AA: ch = 0xF4; break;
case 0x03AB: ch = 0xF5; break;
case 0x03AC: ch = 0xE1; break;
case 0x03AD: ch = 0xE2; break;
case 0x03AE: ch = 0xE3; break;
case 0x03AF: ch = 0xE5; break;
case 0x03B1:
case 0x03B2:
case 0x03B3:
case 0x03B4:
case 0x03B5:
case 0x03B6:
case 0x03B7:
case 0x03B8:
case 0x03B9:
case 0x03BA:
case 0x03BB:
case 0x03BC:
case 0x03BD:
case 0x03BE:
case 0x03BF:
case 0x03C0:
case 0x03C1:
ch -= 0x0319;
break;
case 0x03C2: ch = 0xAA; break;
case 0x03C3: ch = 0xA9; break;
case 0x03C4:
case 0x03C5:
case 0x03C6:
case 0x03C7:
case 0x03C8:
ch -= 0x0319;
break;
case 0x03C9: ch = 0xE0; break;
case 0x03CA: ch = 0xE4; break;
case 0x03CB: ch = 0xE8; break;
case 0x03CC: ch = 0xE6; break;
case 0x03CD: ch = 0xE7; break;
case 0x03CE: ch = 0xE9; break;
case 0x03D5: ch = 0xAD; break;
case 0x2022: ch = 0x07; break;
case 0x203C: ch = 0x13; break;
case 0x207F: ch = 0xFC; break;
case 0x2190: ch = 0x1B; break;
case 0x2191: ch = 0x18; break;
case 0x2192: ch = 0x1A; break;
case 0x2193: ch = 0x19; break;
case 0x2194: ch = 0x1D; break;
case 0x2195: ch = 0x12; break;
case 0x21A8: ch = 0x17; break;
case 0x2219: ch = 0xF9; break;
case 0x221A: ch = 0xFB; break;
case 0x221F: ch = 0x1C; break;
case 0x2248: ch = 0xF7; break;
case 0x2264: ch = 0xF3; break;
case 0x2265: ch = 0xF2; break;
case 0x2302: ch = 0x7F; break;
case 0x2500: ch = 0xC4; break;
case 0x2502: ch = 0xB3; break;
case 0x250C: ch = 0xDA; break;
case 0x2510: ch = 0xBF; break;
case 0x2514: ch = 0xC0; break;
case 0x2518: ch = 0xD9; break;
case 0x251C: ch = 0xC3; break;
case 0x2524: ch = 0xB4; break;
case 0x252C: ch = 0xC2; break;
case 0x2534: ch = 0xC1; break;
case 0x253C: ch = 0xC5; break;
case 0x2550: ch = 0xCD; break;
case 0x2551: ch = 0xBA; break;
case 0x2552: ch = 0xD5; break;
case 0x2553: ch = 0xD6; break;
case 0x2554: ch = 0xC9; break;
case 0x2555: ch = 0xB8; break;
case 0x2556: ch = 0xB7; break;
case 0x2557: ch = 0xBB; break;
case 0x2558: ch = 0xD4; break;
case 0x2559: ch = 0xD3; break;
case 0x255A: ch = 0xC8; break;
case 0x255B: ch = 0xBE; break;
case 0x255C: ch = 0xBD; break;
case 0x255D: ch = 0xBC; break;
case 0x255E: ch = 0xC6; break;
case 0x255F: ch = 0xC7; break;
case 0x2560: ch = 0xCC; break;
case 0x2561: ch = 0xB5; break;
case 0x2562: ch = 0xB6; break;
case 0x2563: ch = 0xB9; break;
case 0x2564: ch = 0xD1; break;
case 0x2565: ch = 0xD2; break;
case 0x2566: ch = 0xCB; break;
case 0x2567: ch = 0xCF; break;
case 0x2568: ch = 0xD0; break;
case 0x2569: ch = 0xCA; break;
case 0x256A: ch = 0xD8; break;
case 0x256B: ch = 0xD7; break;
case 0x256C: ch = 0xCE; break;
case 0x2580: ch = 0xDF; break;
case 0x2584: ch = 0xDC; break;
case 0x2588: ch = 0xDB; break;
case 0x258C: ch = 0xDD; break;
case 0x2590: ch = 0xDE; break;
case 0x2591: ch = 0xB0; break;
case 0x2592: ch = 0xB1; break;
case 0x2593: ch = 0xB2; break;
case 0x25A0: ch = 0xFE; break;
case 0x25AC: ch = 0x16; break;
case 0x25B2: ch = 0x1E; break;
case 0x25BA: ch = 0x10; break;
case 0x25BC: ch = 0x1F; break;
case 0x25C4: ch = 0x11; break;
case 0x25CB: ch = 0x09; break;
case 0x25D8: ch = 0x08; break;
case 0x25D9: ch = 0x0A; break;
case 0x263A: ch = 0x01; break;
case 0x263B: ch = 0x02; break;
case 0x263C: ch = 0x0F; break;
case 0x2640: ch = 0x0C; break;
case 0x2642: ch = 0x0B; break;
case 0x2660: ch = 0x06; break;
case 0x2663: ch = 0x05; break;
case 0x2665: ch = 0x03; break;
case 0x2666: ch = 0x04; break;
case 0x266A: ch = 0x0D; break;
case 0x266C: ch = 0x0E; break;
case 0xFFE8: ch = 0xB3; break;
case 0xFFE9: ch = 0x1B; break;
case 0xFFEA: ch = 0x18; break;
case 0xFFEB: ch = 0x1A; break;
case 0xFFEC: ch = 0x19; break;
case 0xFFED: ch = 0xFE; break;
case 0xFFEE: ch = 0x09; break;
default:
{
if(ch >= 0xFF01 && ch <= 0xFF5E)
{
ch -= 0xFEE0;
}
else
{
HandleFallback (ref buffer, chars, ref charIndex, ref charCount, bytes, ref byteIndex, ref byteCount);
charIndex++;
charCount--;
continue;
}
}
break;
}
//Write encoded byte to buffer, if buffer is defined and fallback was not used
if (bytes != null)
bytes[byteIndex] = (byte)ch;
byteIndex++;
byteCount--;
charIndex++;
charCount--;
}
return byteIndex;
}
}; // class CP737
[Serializable]
public class ENCibm737 : CP737
{
public ENCibm737() : base() {}
}; // class ENCibm737
}; // namespace I18N.Rare
+451
View File
@@ -0,0 +1,451 @@
/*
* CP775.cs - Baltic (DOS) code page.
*
* Copyright (c) 2002 Southern Storm Software, Pty Ltd
*
* 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.
*/
// Generated from "ibm-775.ucm".
// WARNING: Modifying this file directly might be a bad idea.
// You should edit the code generator tools/ucm2cp.c instead for your changes
// to appear in all relevant classes.
namespace I18N.Rare
{
using System;
using System.Text;
using I18N.Common;
[Serializable]
public class CP775 : ByteEncoding
{
public CP775()
: base(775, ToChars, "Baltic (DOS)",
"ibm775", "ibm775", "ibm775",
false, false, false, false, 1257)
{}
private static readonly char[] ToChars = {
'\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005',
'\u0006', '\u0007', '\u0008', '\u0009', '\u000A', '\u000B',
'\u000C', '\u000D', '\u000E', '\u000F', '\u0010', '\u0011',
'\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
'\u0018', '\u0019', '\u001C', '\u001B', '\u007F', '\u001D',
'\u001E', '\u001F', '\u0020', '\u0021', '\u0022', '\u0023',
'\u0024', '\u0025', '\u0026', '\u0027', '\u0028', '\u0029',
'\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035',
'\u0036', '\u0037', '\u0038', '\u0039', '\u003A', '\u003B',
'\u003C', '\u003D', '\u003E', '\u003F', '\u0040', '\u0041',
'\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D',
'\u004E', '\u004F', '\u0050', '\u0051', '\u0052', '\u0053',
'\u0054', '\u0055', '\u0056', '\u0057', '\u0058', '\u0059',
'\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F',
'\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065',
'\u0066', '\u0067', '\u0068', '\u0069', '\u006A', '\u006B',
'\u006C', '\u006D', '\u006E', '\u006F', '\u0070', '\u0071',
'\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
'\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D',
'\u007E', '\u001A', '\u0106', '\u00FC', '\u00E9', '\u0101',
'\u00E4', '\u0123', '\u00E5', '\u0107', '\u0142', '\u0113',
'\u0156', '\u0157', '\u012B', '\u0179', '\u00C4', '\u00C5',
'\u00C9', '\u00E6', '\u00C6', '\u014D', '\u00F6', '\u0122',
'\u00A2', '\u015A', '\u015B', '\u00D6', '\u00DC', '\u00F8',
'\u00A3', '\u00D8', '\u00D7', '\u00A4', '\u0100', '\u012A',
'\u00F3', '\u017B', '\u017C', '\u017A', '\u201D', '\u00A6',
'\u00A9', '\u00AE', '\u00AC', '\u00BD', '\u00BC', '\u0141',
'\u00AB', '\u00BB', '\u2591', '\u2592', '\u2593', '\u2502',
'\u2524', '\u0104', '\u010C', '\u0118', '\u0116', '\u2563',
'\u2551', '\u2557', '\u255D', '\u012E', '\u0160', '\u2510',
'\u2514', '\u2534', '\u252C', '\u251C', '\u2500', '\u253C',
'\u0172', '\u016A', '\u255A', '\u2554', '\u2569', '\u2566',
'\u2560', '\u2550', '\u256C', '\u017D', '\u0105', '\u010D',
'\u0119', '\u0117', '\u012F', '\u0161', '\u0173', '\u016B',
'\u017E', '\u2518', '\u250C', '\u2588', '\u2584', '\u258C',
'\u2590', '\u2580', '\u00D3', '\u00DF', '\u014C', '\u0143',
'\u00F5', '\u00D5', '\u00B5', '\u0144', '\u0136', '\u0137',
'\u013B', '\u013C', '\u0146', '\u0112', '\u0145', '\u2019',
'\u00AD', '\u00B1', '\u201C', '\u00BE', '\u00B6', '\u00A7',
'\u00F7', '\u201E', '\u00B0', '\u2219', '\u00B7', '\u00B9',
'\u00B3', '\u00B2', '\u25A0', '\u00A0',
};
// Get the number of bytes needed to encode a character buffer.
public unsafe override int GetByteCountImpl (char* chars, int count)
{
if (this.EncoderFallback != null) {
//Calculate byte count by actually doing encoding and discarding the data.
return GetBytesImpl(chars, count, null, 0);
}
else
{
return count;
}
}
// Get the number of bytes needed to encode a character buffer.
public override int GetByteCount (String s)
{
if (this.EncoderFallback != null)
{
//Calculate byte count by actually doing encoding and discarding the data.
unsafe
{
fixed (char *s_ptr = s)
{
return GetBytesImpl(s_ptr, s.Length, null, 0);
}
}
}
else
{
//byte count equals character count because no EncoderFallback set
return s.Length;
}
}
//ToBytes is just an alias for GetBytesImpl, but doesn't return byte count
protected unsafe override void ToBytes(char* chars, int charCount,
byte* bytes, int byteCount)
{
//Calling ToBytes with null destination buffer doesn't make any sense
if (bytes == null)
throw new ArgumentNullException("bytes");
GetBytesImpl(chars, charCount, bytes, byteCount);
}
public unsafe override int GetBytesImpl (char* chars, int charCount,
byte* bytes, int byteCount)
{
int ch;
int charIndex = 0;
int byteIndex = 0;
EncoderFallbackBuffer buffer = null;
while (charCount > 0)
{
ch = (int)(chars[charIndex]);
if(ch >= 26) switch(ch)
{
case 0x001B:
case 0x001D:
case 0x001E:
case 0x001F:
case 0x0020:
case 0x0021:
case 0x0022:
case 0x0023:
case 0x0024:
case 0x0025:
case 0x0026:
case 0x0027:
case 0x0028:
case 0x0029:
case 0x002A:
case 0x002B:
case 0x002C:
case 0x002D:
case 0x002E:
case 0x002F:
case 0x0030:
case 0x0031:
case 0x0032:
case 0x0033:
case 0x0034:
case 0x0035:
case 0x0036:
case 0x0037:
case 0x0038:
case 0x0039:
case 0x003A:
case 0x003B:
case 0x003C:
case 0x003D:
case 0x003E:
case 0x003F:
case 0x0040:
case 0x0041:
case 0x0042:
case 0x0043:
case 0x0044:
case 0x0045:
case 0x0046:
case 0x0047:
case 0x0048:
case 0x0049:
case 0x004A:
case 0x004B:
case 0x004C:
case 0x004D:
case 0x004E:
case 0x004F:
case 0x0050:
case 0x0051:
case 0x0052:
case 0x0053:
case 0x0054:
case 0x0055:
case 0x0056:
case 0x0057:
case 0x0058:
case 0x0059:
case 0x005A:
case 0x005B:
case 0x005C:
case 0x005D:
case 0x005E:
case 0x005F:
case 0x0060:
case 0x0061:
case 0x0062:
case 0x0063:
case 0x0064:
case 0x0065:
case 0x0066:
case 0x0067:
case 0x0068:
case 0x0069:
case 0x006A:
case 0x006B:
case 0x006C:
case 0x006D:
case 0x006E:
case 0x006F:
case 0x0070:
case 0x0071:
case 0x0072:
case 0x0073:
case 0x0074:
case 0x0075:
case 0x0076:
case 0x0077:
case 0x0078:
case 0x0079:
case 0x007A:
case 0x007B:
case 0x007C:
case 0x007D:
case 0x007E:
break;
case 0x001A: ch = 0x7F; break;
case 0x001C: ch = 0x1A; break;
case 0x007F: ch = 0x1C; break;
case 0x00A0: ch = 0xFF; break;
case 0x00A2: ch = 0x96; break;
case 0x00A3: ch = 0x9C; break;
case 0x00A4: ch = 0x9F; break;
case 0x00A6: ch = 0xA7; break;
case 0x00A7: ch = 0xF5; break;
case 0x00A9: ch = 0xA8; break;
case 0x00AB: ch = 0xAE; break;
case 0x00AC: ch = 0xAA; break;
case 0x00AD: ch = 0xF0; break;
case 0x00AE: ch = 0xA9; break;
case 0x00B0: ch = 0xF8; break;
case 0x00B1: ch = 0xF1; break;
case 0x00B2: ch = 0xFD; break;
case 0x00B3: ch = 0xFC; break;
case 0x00B5: ch = 0xE6; break;
case 0x00B6: ch = 0xF4; break;
case 0x00B7: ch = 0xFA; break;
case 0x00B9: ch = 0xFB; break;
case 0x00BB: ch = 0xAF; break;
case 0x00BC: ch = 0xAC; break;
case 0x00BD: ch = 0xAB; break;
case 0x00BE: ch = 0xF3; break;
case 0x00C4: ch = 0x8E; break;
case 0x00C5: ch = 0x8F; break;
case 0x00C6: ch = 0x92; break;
case 0x00C9: ch = 0x90; break;
case 0x00D3: ch = 0xE0; break;
case 0x00D5: ch = 0xE5; break;
case 0x00D6: ch = 0x99; break;
case 0x00D7: ch = 0x9E; break;
case 0x00D8: ch = 0x9D; break;
case 0x00DC: ch = 0x9A; break;
case 0x00DF: ch = 0xE1; break;
case 0x00E4: ch = 0x84; break;
case 0x00E5: ch = 0x86; break;
case 0x00E6: ch = 0x91; break;
case 0x00E9: ch = 0x82; break;
case 0x00F3: ch = 0xA2; break;
case 0x00F5: ch = 0xE4; break;
case 0x00F6: ch = 0x94; break;
case 0x00F7: ch = 0xF6; break;
case 0x00F8: ch = 0x9B; break;
case 0x00FC: ch = 0x81; break;
case 0x0100: ch = 0xA0; break;
case 0x0101: ch = 0x83; break;
case 0x0104: ch = 0xB5; break;
case 0x0105: ch = 0xD0; break;
case 0x0106: ch = 0x80; break;
case 0x0107: ch = 0x87; break;
case 0x010C: ch = 0xB6; break;
case 0x010D: ch = 0xD1; break;
case 0x0112: ch = 0xED; break;
case 0x0113: ch = 0x89; break;
case 0x0116: ch = 0xB8; break;
case 0x0117: ch = 0xD3; break;
case 0x0118: ch = 0xB7; break;
case 0x0119: ch = 0xD2; break;
case 0x0122: ch = 0x95; break;
case 0x0123: ch = 0x85; break;
case 0x012A: ch = 0xA1; break;
case 0x012B: ch = 0x8C; break;
case 0x012E: ch = 0xBD; break;
case 0x012F: ch = 0xD4; break;
case 0x0136: ch = 0xE8; break;
case 0x0137: ch = 0xE9; break;
case 0x013B: ch = 0xEA; break;
case 0x013C: ch = 0xEB; break;
case 0x0141: ch = 0xAD; break;
case 0x0142: ch = 0x88; break;
case 0x0143: ch = 0xE3; break;
case 0x0144: ch = 0xE7; break;
case 0x0145: ch = 0xEE; break;
case 0x0146: ch = 0xEC; break;
case 0x014C: ch = 0xE2; break;
case 0x014D: ch = 0x93; break;
case 0x0156: ch = 0x8A; break;
case 0x0157: ch = 0x8B; break;
case 0x015A: ch = 0x97; break;
case 0x015B: ch = 0x98; break;
case 0x0160: ch = 0xBE; break;
case 0x0161: ch = 0xD5; break;
case 0x016A: ch = 0xC7; break;
case 0x016B: ch = 0xD7; break;
case 0x0172: ch = 0xC6; break;
case 0x0173: ch = 0xD6; break;
case 0x0179: ch = 0x8D; break;
case 0x017A: ch = 0xA5; break;
case 0x017B: ch = 0xA3; break;
case 0x017C: ch = 0xA4; break;
case 0x017D: ch = 0xCF; break;
case 0x017E: ch = 0xD8; break;
case 0x2019: ch = 0xEF; break;
case 0x201C: ch = 0xF2; break;
case 0x201D: ch = 0xA6; break;
case 0x201E: ch = 0xF7; break;
case 0x2022: ch = 0x07; break;
case 0x203C: ch = 0x13; break;
case 0x2190: ch = 0x1B; break;
case 0x2191: ch = 0x18; break;
case 0x2192: ch = 0x1A; break;
case 0x2193: ch = 0x19; break;
case 0x2194: ch = 0x1D; break;
case 0x2195: ch = 0x12; break;
case 0x21A8: ch = 0x17; break;
case 0x2219: ch = 0xF9; break;
case 0x221F: ch = 0x1C; break;
case 0x2302: ch = 0x7F; break;
case 0x2500: ch = 0xC4; break;
case 0x2502: ch = 0xB3; break;
case 0x250C: ch = 0xDA; break;
case 0x2510: ch = 0xBF; break;
case 0x2514: ch = 0xC0; break;
case 0x2518: ch = 0xD9; break;
case 0x251C: ch = 0xC3; break;
case 0x2524: ch = 0xB4; break;
case 0x252C: ch = 0xC2; break;
case 0x2534: ch = 0xC1; break;
case 0x253C: ch = 0xC5; break;
case 0x2550: ch = 0xCD; break;
case 0x2551: ch = 0xBA; break;
case 0x2554: ch = 0xC9; break;
case 0x2557: ch = 0xBB; break;
case 0x255A: ch = 0xC8; break;
case 0x255D: ch = 0xBC; break;
case 0x2560: ch = 0xCC; break;
case 0x2563: ch = 0xB9; break;
case 0x2566: ch = 0xCB; break;
case 0x2569: ch = 0xCA; break;
case 0x256C: ch = 0xCE; break;
case 0x2580: ch = 0xDF; break;
case 0x2584: ch = 0xDC; break;
case 0x2588: ch = 0xDB; break;
case 0x258C: ch = 0xDD; break;
case 0x2590: ch = 0xDE; break;
case 0x2591: ch = 0xB0; break;
case 0x2592: ch = 0xB1; break;
case 0x2593: ch = 0xB2; break;
case 0x25A0: ch = 0xFE; break;
case 0x25AC: ch = 0x16; break;
case 0x25B2: ch = 0x1E; break;
case 0x25BA: ch = 0x10; break;
case 0x25BC: ch = 0x1F; break;
case 0x25C4: ch = 0x11; break;
case 0x25CB: ch = 0x09; break;
case 0x25D8: ch = 0x08; break;
case 0x25D9: ch = 0x0A; break;
case 0x263A: ch = 0x01; break;
case 0x263B: ch = 0x02; break;
case 0x263C: ch = 0x0F; break;
case 0x2640: ch = 0x0C; break;
case 0x2642: ch = 0x0B; break;
case 0x2660: ch = 0x06; break;
case 0x2663: ch = 0x05; break;
case 0x2665: ch = 0x03; break;
case 0x2666: ch = 0x04; break;
case 0x266A: ch = 0x0D; break;
case 0x266B: ch = 0x0E; break;
case 0xFFE8: ch = 0xB3; break;
case 0xFFE9: ch = 0x1B; break;
case 0xFFEA: ch = 0x18; break;
case 0xFFEB: ch = 0x1A; break;
case 0xFFEC: ch = 0x19; break;
case 0xFFED: ch = 0xFE; break;
case 0xFFEE: ch = 0x09; break;
default:
{
if(ch >= 0xFF01 && ch <= 0xFF5E)
{
ch -= 0xFEE0;
}
else
{
HandleFallback (ref buffer, chars, ref charIndex, ref charCount, bytes, ref byteIndex, ref byteCount);
charIndex++;
charCount--;
continue;
}
}
break;
}
//Write encoded byte to buffer, if buffer is defined and fallback was not used
if (bytes != null)
bytes[byteIndex] = (byte)ch;
byteIndex++;
byteCount--;
charIndex++;
charCount--;
}
return byteIndex;
}
}; // class CP775
[Serializable]
public class ENCibm775 : CP775
{
public ENCibm775() : base() {}
}; // class ENCibm775
}; // namespace I18N.Rare
@@ -83,6 +83,8 @@
<Compile Include="CP37.cs" />
<Compile Include="CP500.cs" />
<Compile Include="CP708.cs" />
<Compile Include="CP737.cs" />
<Compile Include="CP775.cs" />
<Compile Include="CP852.cs" />
<Compile Include="CP855.cs" />
<Compile Include="CP857.cs" />
@@ -31,6 +31,8 @@ CP21025.cs
CP37.cs
CP500.cs
CP708.cs
CP737.cs
CP775.cs
CP852.cs
CP855.cs
CP857.cs
+411
View File
@@ -0,0 +1,411 @@
# ***************************************************************************
# *
# * Copyright (C) 1995-2002, International Business Machines
# * Corporation and others. All Rights Reserved.
# *
# ***************************************************************************
#
# File created by rptp2ucm (compiled on Dec 3 2002)
# from source files 34B002E1.RPMAP100 and 02E134B0.TPMAP100
#
<code_set_name> "ibm-737_P100-1997"
<char_name_mask> "AXXXX"
<mb_cur_max> 1
<mb_cur_min> 1
<uconv_class> "SBCS"
<subchar> \x7F
<icu:charsetFamily> "ASCII"
<icu:alias> "ibm-737_VSUB"
CHARMAP
<U0000> \x00 |0
<U0001> \x01 |0
<U0002> \x02 |0
<U0003> \x03 |0
<U0004> \x04 |0
<U0005> \x05 |0
<U0006> \x06 |0
<U0007> \x07 |0
<U0008> \x08 |0
<U0009> \x09 |0
<U000A> \x0A |0
<U000B> \x0B |0
<U000C> \x0C |0
<U000D> \x0D |0
<U000E> \x0E |0
<U000F> \x0F |0
<U0010> \x10 |0
<U0011> \x11 |0
<U0012> \x12 |0
<U0013> \x13 |0
<U0014> \x14 |0
<U0015> \x15 |0
<U0016> \x16 |0
<U0017> \x17 |0
<U0018> \x18 |0
<U0019> \x19 |0
<U001A> \x7F |0
<U001B> \x1B |0
<U001C> \x1A |0
<U001D> \x1D |0
<U001E> \x1E |0
<U001F> \x1F |0
<U0020> \x20 |0
<U0021> \x21 |0
<U0022> \x22 |0
<U0023> \x23 |0
<U0024> \x24 |0
<U0025> \x25 |0
<U0026> \x26 |0
<U0027> \x27 |0
<U0028> \x28 |0
<U0029> \x29 |0
<U002A> \x2A |0
<U002B> \x2B |0
<U002C> \x2C |0
<U002D> \x2D |0
<U002E> \x2E |0
<U002F> \x2F |0
<U0030> \x30 |0
<U0031> \x31 |0
<U0032> \x32 |0
<U0033> \x33 |0
<U0034> \x34 |0
<U0035> \x35 |0
<U0036> \x36 |0
<U0037> \x37 |0
<U0038> \x38 |0
<U0039> \x39 |0
<U003A> \x3A |0
<U003B> \x3B |0
<U003C> \x3C |0
<U003D> \x3D |0
<U003E> \x3E |0
<U003F> \x3F |0
<U0040> \x40 |0
<U0041> \x41 |0
<U0042> \x42 |0
<U0043> \x43 |0
<U0044> \x44 |0
<U0045> \x45 |0
<U0046> \x46 |0
<U0047> \x47 |0
<U0048> \x48 |0
<U0049> \x49 |0
<U004A> \x4A |0
<U004B> \x4B |0
<U004C> \x4C |0
<U004D> \x4D |0
<U004E> \x4E |0
<U004F> \x4F |0
<U0050> \x50 |0
<U0051> \x51 |0
<U0052> \x52 |0
<U0053> \x53 |0
<U0054> \x54 |0
<U0055> \x55 |0
<U0056> \x56 |0
<U0057> \x57 |0
<U0058> \x58 |0
<U0059> \x59 |0
<U005A> \x5A |0
<U005B> \x5B |0
<U005C> \x5C |0
<U005D> \x5D |0
<U005E> \x5E |0
<U005F> \x5F |0
<U0060> \x60 |0
<U0061> \x61 |0
<U0062> \x62 |0
<U0063> \x63 |0
<U0064> \x64 |0
<U0065> \x65 |0
<U0066> \x66 |0
<U0067> \x67 |0
<U0068> \x68 |0
<U0069> \x69 |0
<U006A> \x6A |0
<U006B> \x6B |0
<U006C> \x6C |0
<U006D> \x6D |0
<U006E> \x6E |0
<U006F> \x6F |0
<U0070> \x70 |0
<U0071> \x71 |0
<U0072> \x72 |0
<U0073> \x73 |0
<U0074> \x74 |0
<U0075> \x75 |0
<U0076> \x76 |0
<U0077> \x77 |0
<U0078> \x78 |0
<U0079> \x79 |0
<U007A> \x7A |0
<U007B> \x7B |0
<U007C> \x7C |0
<U007D> \x7D |0
<U007E> \x7E |0
<U007F> \x1C |0
<U00A0> \xFF |0
<U00A7> \x15 |1
<U00B0> \xF8 |0
<U00B1> \xF1 |0
<U00B2> \xFD |0
<U00B6> \x14 |1
<U00B7> \xFA |0
<U00F7> \xF6 |0
<U0386> \xEA |0
<U0388> \xEB |0
<U0389> \xEC |0
<U038A> \xED |0
<U038C> \xEE |0
<U038E> \xEF |0
<U038F> \xF0 |0
<U0391> \x80 |0
<U0392> \x81 |0
<U0393> \x82 |0
<U0394> \x83 |0
<U0395> \x84 |0
<U0396> \x85 |0
<U0397> \x86 |0
<U0398> \x87 |0
<U0399> \x88 |0
<U039A> \x89 |0
<U039B> \x8A |0
<U039C> \x8B |0
<U039D> \x8C |0
<U039E> \x8D |0
<U039F> \x8E |0
<U03A0> \x8F |0
<U03A1> \x90 |0
<U03A3> \x91 |0
<U03A4> \x92 |0
<U03A5> \x93 |0
<U03A6> \x94 |0
<U03A7> \x95 |0
<U03A8> \x96 |0
<U03A9> \x97 |0
<U03AA> \xF4 |0
<U03AB> \xF5 |0
<U03AC> \xE1 |0
<U03AD> \xE2 |0
<U03AE> \xE3 |0
<U03AF> \xE5 |0
<U03B1> \x98 |0
<U03B2> \x99 |0
<U03B3> \x9A |0
<U03B4> \x9B |0
<U03B5> \x9C |0
<U03B6> \x9D |0
<U03B7> \x9E |0
<U03B8> \x9F |0
<U03B9> \xA0 |0
<U03BA> \xA1 |0
<U03BB> \xA2 |0
<U03BC> \xA3 |0
<U03BD> \xA4 |0
<U03BE> \xA5 |0
<U03BF> \xA6 |0
<U03C0> \xA7 |0
<U03C1> \xA8 |0
<U03C2> \xAA |0
<U03C3> \xA9 |0
<U03C4> \xAB |0
<U03C5> \xAC |0
<U03C6> \xAD |0
<U03C7> \xAE |0
<U03C8> \xAF |0
<U03C9> \xE0 |0
<U03CA> \xE4 |0
<U03CB> \xE8 |0
<U03CC> \xE6 |0
<U03CD> \xE7 |0
<U03CE> \xE9 |0
<U03D5> \xAD |1
<U2022> \x07 |1
<U203C> \x13 |1
<U207F> \xFC |0
<U2190> \x1B |1
<U2191> \x18 |1
<U2192> \x1A |1
<U2193> \x19 |1
<U2194> \x1D |1
<U2195> \x12 |1
<U21A8> \x17 |1
<U2219> \xF9 |0
<U221A> \xFB |0
<U221F> \x1C |1
<U2248> \xF7 |0
<U2264> \xF3 |0
<U2265> \xF2 |0
<U2302> \x7F |2
<U2500> \xC4 |0
<U2502> \xB3 |0
<U250C> \xDA |0
<U2510> \xBF |0
<U2514> \xC0 |0
<U2518> \xD9 |0
<U251C> \xC3 |0
<U2524> \xB4 |0
<U252C> \xC2 |0
<U2534> \xC1 |0
<U253C> \xC5 |0
<U2550> \xCD |0
<U2551> \xBA |0
<U2552> \xD5 |0
<U2553> \xD6 |0
<U2554> \xC9 |0
<U2555> \xB8 |0
<U2556> \xB7 |0
<U2557> \xBB |0
<U2558> \xD4 |0
<U2559> \xD3 |0
<U255A> \xC8 |0
<U255B> \xBE |0
<U255C> \xBD |0
<U255D> \xBC |0
<U255E> \xC6 |0
<U255F> \xC7 |0
<U2560> \xCC |0
<U2561> \xB5 |0
<U2562> \xB6 |0
<U2563> \xB9 |0
<U2564> \xD1 |0
<U2565> \xD2 |0
<U2566> \xCB |0
<U2567> \xCF |0
<U2568> \xD0 |0
<U2569> \xCA |0
<U256A> \xD8 |0
<U256B> \xD7 |0
<U256C> \xCE |0
<U2580> \xDF |0
<U2584> \xDC |0
<U2588> \xDB |0
<U258C> \xDD |0
<U2590> \xDE |0
<U2591> \xB0 |0
<U2592> \xB1 |0
<U2593> \xB2 |0
<U25A0> \xFE |0
<U25AC> \x16 |1
<U25B2> \x1E |1
<U25BA> \x10 |1
<U25BC> \x1F |1
<U25C4> \x11 |1
<U25CB> \x09 |1
<U25D8> \x08 |1
<U25D9> \x0A |1
<U263A> \x01 |1
<U263B> \x02 |1
<U263C> \x0F |1
<U2640> \x0C |1
<U2642> \x0B |1
<U2660> \x06 |1
<U2663> \x05 |1
<U2665> \x03 |1
<U2666> \x04 |1
<U266A> \x0D |1
<U266C> \x0E |1
<UFF01> \x21 |1
<UFF02> \x22 |1
<UFF03> \x23 |1
<UFF04> \x24 |1
<UFF05> \x25 |1
<UFF06> \x26 |1
<UFF07> \x27 |1
<UFF08> \x28 |1
<UFF09> \x29 |1
<UFF0A> \x2A |1
<UFF0B> \x2B |1
<UFF0C> \x2C |1
<UFF0D> \x2D |1
<UFF0E> \x2E |1
<UFF0F> \x2F |1
<UFF10> \x30 |1
<UFF11> \x31 |1
<UFF12> \x32 |1
<UFF13> \x33 |1
<UFF14> \x34 |1
<UFF15> \x35 |1
<UFF16> \x36 |1
<UFF17> \x37 |1
<UFF18> \x38 |1
<UFF19> \x39 |1
<UFF1A> \x3A |1
<UFF1B> \x3B |1
<UFF1C> \x3C |1
<UFF1D> \x3D |1
<UFF1E> \x3E |1
<UFF1F> \x3F |1
<UFF20> \x40 |1
<UFF21> \x41 |1
<UFF22> \x42 |1
<UFF23> \x43 |1
<UFF24> \x44 |1
<UFF25> \x45 |1
<UFF26> \x46 |1
<UFF27> \x47 |1
<UFF28> \x48 |1
<UFF29> \x49 |1
<UFF2A> \x4A |1
<UFF2B> \x4B |1
<UFF2C> \x4C |1
<UFF2D> \x4D |1
<UFF2E> \x4E |1
<UFF2F> \x4F |1
<UFF30> \x50 |1
<UFF31> \x51 |1
<UFF32> \x52 |1
<UFF33> \x53 |1
<UFF34> \x54 |1
<UFF35> \x55 |1
<UFF36> \x56 |1
<UFF37> \x57 |1
<UFF38> \x58 |1
<UFF39> \x59 |1
<UFF3A> \x5A |1
<UFF3B> \x5B |1
<UFF3C> \x5C |1
<UFF3D> \x5D |1
<UFF3E> \x5E |1
<UFF3F> \x5F |1
<UFF40> \x60 |1
<UFF41> \x61 |1
<UFF42> \x62 |1
<UFF43> \x63 |1
<UFF44> \x64 |1
<UFF45> \x65 |1
<UFF46> \x66 |1
<UFF47> \x67 |1
<UFF48> \x68 |1
<UFF49> \x69 |1
<UFF4A> \x6A |1
<UFF4B> \x6B |1
<UFF4C> \x6C |1
<UFF4D> \x6D |1
<UFF4E> \x6E |1
<UFF4F> \x6F |1
<UFF50> \x70 |1
<UFF51> \x71 |1
<UFF52> \x72 |1
<UFF53> \x73 |1
<UFF54> \x74 |1
<UFF55> \x75 |1
<UFF56> \x76 |1
<UFF57> \x77 |1
<UFF58> \x78 |1
<UFF59> \x79 |1
<UFF5A> \x7A |1
<UFF5B> \x7B |1
<UFF5C> \x7C |1
<UFF5D> \x7D |1
<UFF5E> \x7E |1
<UFFE8> \xB3 |1
<UFFE9> \x1B |1
<UFFEA> \x18 |1
<UFFEB> \x1A |1
<UFFEC> \x19 |1
<UFFED> \xFE |1
<UFFEE> \x09 |1
END CHARMAP
+408
View File
@@ -0,0 +1,408 @@
# ***************************************************************************
# *
# * Copyright (C) 1995-2004, International Business Machines
# * Corporation and others. All Rights Reserved.
# *
# ***************************************************************************
#
# File created by rptp2ucm (compiled on Jan 14 2004)
# from source files 34B00307.RPMAP100 and 030734B0.TPMAP100
#
<code_set_name> "ibm-775_P100-1996"
<char_name_mask> "AXXXX"
<mb_cur_max> 1
<mb_cur_min> 1
<uconv_class> "SBCS"
<subchar> \x7F
<icu:charsetFamily> "ASCII"
<icu:alias> "ibm-775_VSUB"
CHARMAP
<U0000> \x00 |0
<U0001> \x01 |0
<U0002> \x02 |0
<U0003> \x03 |0
<U0004> \x04 |0
<U0005> \x05 |0
<U0006> \x06 |0
<U0007> \x07 |0
<U0008> \x08 |0
<U0009> \x09 |0
<U000A> \x0A |0
<U000B> \x0B |0
<U000C> \x0C |0
<U000D> \x0D |0
<U000E> \x0E |0
<U000F> \x0F |0
<U0010> \x10 |0
<U0011> \x11 |0
<U0012> \x12 |0
<U0013> \x13 |0
<U0014> \x14 |0
<U0015> \x15 |0
<U0016> \x16 |0
<U0017> \x17 |0
<U0018> \x18 |0
<U0019> \x19 |0
<U001A> \x7F |0
<U001B> \x1B |0
<U001C> \x1A |0
<U001D> \x1D |0
<U001E> \x1E |0
<U001F> \x1F |0
<U0020> \x20 |0
<U0021> \x21 |0
<U0022> \x22 |0
<U0023> \x23 |0
<U0024> \x24 |0
<U0025> \x25 |0
<U0026> \x26 |0
<U0027> \x27 |0
<U0028> \x28 |0
<U0029> \x29 |0
<U002A> \x2A |0
<U002B> \x2B |0
<U002C> \x2C |0
<U002D> \x2D |0
<U002E> \x2E |0
<U002F> \x2F |0
<U0030> \x30 |0
<U0031> \x31 |0
<U0032> \x32 |0
<U0033> \x33 |0
<U0034> \x34 |0
<U0035> \x35 |0
<U0036> \x36 |0
<U0037> \x37 |0
<U0038> \x38 |0
<U0039> \x39 |0
<U003A> \x3A |0
<U003B> \x3B |0
<U003C> \x3C |0
<U003D> \x3D |0
<U003E> \x3E |0
<U003F> \x3F |0
<U0040> \x40 |0
<U0041> \x41 |0
<U0042> \x42 |0
<U0043> \x43 |0
<U0044> \x44 |0
<U0045> \x45 |0
<U0046> \x46 |0
<U0047> \x47 |0
<U0048> \x48 |0
<U0049> \x49 |0
<U004A> \x4A |0
<U004B> \x4B |0
<U004C> \x4C |0
<U004D> \x4D |0
<U004E> \x4E |0
<U004F> \x4F |0
<U0050> \x50 |0
<U0051> \x51 |0
<U0052> \x52 |0
<U0053> \x53 |0
<U0054> \x54 |0
<U0055> \x55 |0
<U0056> \x56 |0
<U0057> \x57 |0
<U0058> \x58 |0
<U0059> \x59 |0
<U005A> \x5A |0
<U005B> \x5B |0
<U005C> \x5C |0
<U005D> \x5D |0
<U005E> \x5E |0
<U005F> \x5F |0
<U0060> \x60 |0
<U0061> \x61 |0
<U0062> \x62 |0
<U0063> \x63 |0
<U0064> \x64 |0
<U0065> \x65 |0
<U0066> \x66 |0
<U0067> \x67 |0
<U0068> \x68 |0
<U0069> \x69 |0
<U006A> \x6A |0
<U006B> \x6B |0
<U006C> \x6C |0
<U006D> \x6D |0
<U006E> \x6E |0
<U006F> \x6F |0
<U0070> \x70 |0
<U0071> \x71 |0
<U0072> \x72 |0
<U0073> \x73 |0
<U0074> \x74 |0
<U0075> \x75 |0
<U0076> \x76 |0
<U0077> \x77 |0
<U0078> \x78 |0
<U0079> \x79 |0
<U007A> \x7A |0
<U007B> \x7B |0
<U007C> \x7C |0
<U007D> \x7D |0
<U007E> \x7E |0
<U007F> \x1C |0
<U00A0> \xFF |0
<U00A2> \x96 |0
<U00A3> \x9C |0
<U00A4> \x9F |0
<U00A6> \xA7 |0
<U00A7> \xF5 |0
<U00A9> \xA8 |0
<U00AB> \xAE |0
<U00AC> \xAA |0
<U00AD> \xF0 |0
<U00AE> \xA9 |0
<U00B0> \xF8 |0
<U00B1> \xF1 |0
<U00B2> \xFD |0
<U00B3> \xFC |0
<U00B5> \xE6 |0
<U00B6> \xF4 |0
<U00B7> \xFA |0
<U00B9> \xFB |0
<U00BB> \xAF |0
<U00BC> \xAC |0
<U00BD> \xAB |0
<U00BE> \xF3 |0
<U00C4> \x8E |0
<U00C5> \x8F |0
<U00C6> \x92 |0
<U00C9> \x90 |0
<U00D3> \xE0 |0
<U00D5> \xE5 |0
<U00D6> \x99 |0
<U00D7> \x9E |0
<U00D8> \x9D |0
<U00DC> \x9A |0
<U00DF> \xE1 |0
<U00E4> \x84 |0
<U00E5> \x86 |0
<U00E6> \x91 |0
<U00E9> \x82 |0
<U00F3> \xA2 |0
<U00F5> \xE4 |0
<U00F6> \x94 |0
<U00F7> \xF6 |0
<U00F8> \x9B |0
<U00FC> \x81 |0
<U0100> \xA0 |0
<U0101> \x83 |0
<U0104> \xB5 |0
<U0105> \xD0 |0
<U0106> \x80 |0
<U0107> \x87 |0
<U010C> \xB6 |0
<U010D> \xD1 |0
<U0112> \xED |0
<U0113> \x89 |0
<U0116> \xB8 |0
<U0117> \xD3 |0
<U0118> \xB7 |0
<U0119> \xD2 |0
<U0122> \x95 |0
<U0123> \x85 |0
<U012A> \xA1 |0
<U012B> \x8C |0
<U012E> \xBD |0
<U012F> \xD4 |0
<U0136> \xE8 |0
<U0137> \xE9 |0
<U013B> \xEA |0
<U013C> \xEB |0
<U0141> \xAD |0
<U0142> \x88 |0
<U0143> \xE3 |0
<U0144> \xE7 |0
<U0145> \xEE |0
<U0146> \xEC |0
<U014C> \xE2 |0
<U014D> \x93 |0
<U0156> \x8A |0
<U0157> \x8B |0
<U015A> \x97 |0
<U015B> \x98 |0
<U0160> \xBE |0
<U0161> \xD5 |0
<U016A> \xC7 |0
<U016B> \xD7 |0
<U0172> \xC6 |0
<U0173> \xD6 |0
<U0179> \x8D |0
<U017A> \xA5 |0
<U017B> \xA3 |0
<U017C> \xA4 |0
<U017D> \xCF |0
<U017E> \xD8 |0
<U2019> \xEF |0
<U201C> \xF2 |0
<U201D> \xA6 |0
<U201E> \xF7 |0
<U2022> \x07 |1
<U203C> \x13 |1
<U2190> \x1B |1
<U2191> \x18 |1
<U2192> \x1A |1
<U2193> \x19 |1
<U2194> \x1D |1
<U2195> \x12 |1
<U21A8> \x17 |1
<U2219> \xF9 |0
<U221F> \x1C |1
<U2302> \x7F |2
<U2500> \xC4 |0
<U2502> \xB3 |0
<U250C> \xDA |0
<U2510> \xBF |0
<U2514> \xC0 |0
<U2518> \xD9 |0
<U251C> \xC3 |0
<U2524> \xB4 |0
<U252C> \xC2 |0
<U2534> \xC1 |0
<U253C> \xC5 |0
<U2550> \xCD |0
<U2551> \xBA |0
<U2554> \xC9 |0
<U2557> \xBB |0
<U255A> \xC8 |0
<U255D> \xBC |0
<U2560> \xCC |0
<U2563> \xB9 |0
<U2566> \xCB |0
<U2569> \xCA |0
<U256C> \xCE |0
<U2580> \xDF |0
<U2584> \xDC |0
<U2588> \xDB |0
<U258C> \xDD |0
<U2590> \xDE |0
<U2591> \xB0 |0
<U2592> \xB1 |0
<U2593> \xB2 |0
<U25A0> \xFE |0
<U25AC> \x16 |1
<U25B2> \x1E |1
<U25BA> \x10 |1
<U25BC> \x1F |1
<U25C4> \x11 |1
<U25CB> \x09 |1
<U25D8> \x08 |1
<U25D9> \x0A |1
<U263A> \x01 |1
<U263B> \x02 |1
<U263C> \x0F |1
<U2640> \x0C |1
<U2642> \x0B |1
<U2660> \x06 |1
<U2663> \x05 |1
<U2665> \x03 |1
<U2666> \x04 |1
<U266A> \x0D |1
<U266B> \x0E |1
<UFF01> \x21 |1
<UFF02> \x22 |1
<UFF03> \x23 |1
<UFF04> \x24 |1
<UFF05> \x25 |1
<UFF06> \x26 |1
<UFF07> \x27 |1
<UFF08> \x28 |1
<UFF09> \x29 |1
<UFF0A> \x2A |1
<UFF0B> \x2B |1
<UFF0C> \x2C |1
<UFF0D> \x2D |1
<UFF0E> \x2E |1
<UFF0F> \x2F |1
<UFF10> \x30 |1
<UFF11> \x31 |1
<UFF12> \x32 |1
<UFF13> \x33 |1
<UFF14> \x34 |1
<UFF15> \x35 |1
<UFF16> \x36 |1
<UFF17> \x37 |1
<UFF18> \x38 |1
<UFF19> \x39 |1
<UFF1A> \x3A |1
<UFF1B> \x3B |1
<UFF1C> \x3C |1
<UFF1D> \x3D |1
<UFF1E> \x3E |1
<UFF1F> \x3F |1
<UFF20> \x40 |1
<UFF21> \x41 |1
<UFF22> \x42 |1
<UFF23> \x43 |1
<UFF24> \x44 |1
<UFF25> \x45 |1
<UFF26> \x46 |1
<UFF27> \x47 |1
<UFF28> \x48 |1
<UFF29> \x49 |1
<UFF2A> \x4A |1
<UFF2B> \x4B |1
<UFF2C> \x4C |1
<UFF2D> \x4D |1
<UFF2E> \x4E |1
<UFF2F> \x4F |1
<UFF30> \x50 |1
<UFF31> \x51 |1
<UFF32> \x52 |1
<UFF33> \x53 |1
<UFF34> \x54 |1
<UFF35> \x55 |1
<UFF36> \x56 |1
<UFF37> \x57 |1
<UFF38> \x58 |1
<UFF39> \x59 |1
<UFF3A> \x5A |1
<UFF3B> \x5B |1
<UFF3C> \x5C |1
<UFF3D> \x5D |1
<UFF3E> \x5E |1
<UFF3F> \x5F |1
<UFF40> \x60 |1
<UFF41> \x61 |1
<UFF42> \x62 |1
<UFF43> \x63 |1
<UFF44> \x64 |1
<UFF45> \x65 |1
<UFF46> \x66 |1
<UFF47> \x67 |1
<UFF48> \x68 |1
<UFF49> \x69 |1
<UFF4A> \x6A |1
<UFF4B> \x6B |1
<UFF4C> \x6C |1
<UFF4D> \x6D |1
<UFF4E> \x6E |1
<UFF4F> \x6F |1
<UFF50> \x70 |1
<UFF51> \x71 |1
<UFF52> \x72 |1
<UFF53> \x73 |1
<UFF54> \x74 |1
<UFF55> \x75 |1
<UFF56> \x76 |1
<UFF57> \x77 |1
<UFF58> \x78 |1
<UFF59> \x79 |1
<UFF5A> \x7A |1
<UFF5B> \x7B |1
<UFF5C> \x7C |1
<UFF5D> \x7D |1
<UFF5E> \x7E |1
<UFFE8> \xB3 |1
<UFFE9> \x1B |1
<UFFEA> \x18 |1
<UFFEB> \x1A |1
<UFFEC> \x19 |1
<UFFED> \xFE |1
<UFFEE> \x09 |1
END CHARMAP
+14 -2
View File
@@ -67,6 +67,20 @@ ${UCM2CP} --region Rare --page 708 --wpage 1256 \
--no-browser-save --no-mailnews-display \
--no-mailnews-save Rare/ibm-1089.ucm >Rare/CP708.cs
${UCM2CP} --region Rare --page 737 --wpage 1253 \
--name 'Greek (DOS)' \
--webname ibm737 --bodyname ibm737 \
--headername ibm737 --no-browser-display \
--no-browser-save --no-mailnews-display \
--no-mailnews-save Rare/ibm-737.ucm >Rare/CP737.cs
${UCM2CP} --region Rare --page 775 --wpage 1257 \
--name 'Baltic (DOS)' \
--webname ibm775 --bodyname ibm775 \
--headername ibm775 --no-browser-display \
--no-browser-save --no-mailnews-display \
--no-mailnews-save Rare/ibm-775.ucm >Rare/CP775.cs
${UCM2CP} --region West --page 850 --wpage 1252 \
--name 'Western European (DOS)' \
--webname ibm850 --bodyname ibm850 \
@@ -481,8 +495,6 @@ exit 0
# 709 Arabic - ASMO 449+, BCON V4
# 710 Arabic - Transparent Arabic
# 720 Arabic - Transparent ASMO
# 737 OEM - Greek (formerly 437G)
# 775 OEM - Baltic
# 936 Chinese Simplified (GB2312)
# 949 Korean
# 950 Chinese Traditional (Big5)
+16 -6
View File
@@ -23,12 +23,15 @@
*/
/*
Usage: uni2tab
Required files from ftp.unicode.org: Unihan.txt, CP932.TXT
*/
*
* Usage: uni2tab
*
* Required files from ftp.unicode.org: Unihan.txt, CP932.TXT
*
* Unihan.txt and CP932.TXT can be found at:
* ftp://www.unicode.org/Public/5.0.0/ucd/Unihan.txt
* ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP932.TXT
*/
#include <stdio.h>
#include <string.h>
@@ -321,6 +324,13 @@ static void convertSJISLine(char *buf)
/* Non-CJK characters within JIS */
processJis0208(code, (offset / 94) + 1, (offset % 94) + 1);
}
else if(code >= 0x00A7 && code <= 0x00F7)
{
/* Non-CJK characters within JIS for which unicodeToJis should not be
* edited. In addition to this, do not track lowJis and highJis. */
jisx0208ToUnicode[offset] = (unsigned short)(code & 0xFF);
jisx0208ToUnicode[offset + 1] = (((unsigned short)(code & 0x00FF)) >> 8);
}
}
/*
@@ -102,8 +102,8 @@ namespace MonoTests.Microsoft.Build.Execution
AssertHelper.GreaterOrEqual (endBuildDone, TimeSpan.FromSeconds (1), "#2");
AssertHelper.GreaterOrEqual (waitDone, TimeSpan.FromSeconds (1), "#3");
AssertHelper.GreaterOrEqual (endBuildDone, waitDone, "#4");
AssertHelper.LessOrEqual (endBuildDone, TimeSpan.FromSeconds (2), "#5");
AssertHelper.LessOrEqual (waitDone, TimeSpan.FromSeconds (2), "#6");
AssertHelper.LessOrEqual (endBuildDone, TimeSpan.FromSeconds (2.5), "#5");
AssertHelper.LessOrEqual (waitDone, TimeSpan.FromSeconds (2.5), "#6");
}
[Test]
@@ -84,7 +84,6 @@
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ICSharpBinder.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ICSharpInvokeOrInvokeMemberBinder.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ResetBindException.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderException.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs" />
@@ -125,7 +124,6 @@
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\SemanticChecker.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\SubstitutionContext.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\AggregateSymbol.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\AssemblyQualifiedNamespaceSymbol.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\EventSymbol.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\FieldSymbol.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\IndexerSymbol.cs" />
@@ -150,7 +148,6 @@
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ArrayInitialization.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Assignment.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BinaryOperator.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Block.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BoundAnonymousFunction.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Call.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Cast.cs" />
@@ -161,11 +158,10 @@
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\EXPR.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExpressionIterator.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprOperator.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprWithArgs.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprWithType.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Field.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\FieldInfo.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\HoistedLocal.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\IExprWithArgs.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\IExprWithObject.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\List.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\LocalVariable.cs" />
@@ -174,8 +170,6 @@
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\NamedArgumentSpecification.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Property.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Return.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Statement.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Temporary.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\TypeOf.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UnaryOperator.cs" />
@@ -188,7 +182,6 @@
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ArgumentListType.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ArrayType.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ErrorType.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\MethodGroupType.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\NullableType.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\NullType.cs" />
@@ -200,7 +193,7 @@
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeFactory.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeKind.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeParameterType.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeParameterType_.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeTable.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\VoidType.cs" />
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\UnaOpSig.cs" />
+6
View File
@@ -19,6 +19,12 @@ endif
TEST_MCS_FLAGS =
TEST_LIB_REFS = System.Core
ifndef NO_PROCESS_START
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_PROCESS_START
TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START
endif
LIB_MCS_FLAGS += $(REFERENCE_SOURCES_FLAGS)
BUILT_SOURCES = $(PROFILE)-parser.cs
@@ -19,7 +19,8 @@ namespace Mono.Debugger.Soft
if (!type.IsEnum)
throw new ArgumentException ("type must be an enum type", "type");
TypeMirror t = type.EnumUnderlyingType;
if (value.Value == null || !value.Value.GetType ().IsPrimitive || t != vm.RootDomain.GetCorrespondingType (value.Value.GetType ()))
// Can't access t's domain, so compare type names
if (value.Value == null || !value.Value.GetType ().IsPrimitive || t.Name != vm.RootDomain.GetCorrespondingType (value.Value.GetType ()).Name)
throw new ArgumentException ("Value '" + value.Value + "' does not match the type of the enum.");
}
@@ -434,6 +434,7 @@ public class Tests : TestsBase, ITest2
}
ss7 ();
ss_nested ();
ss_nested_with_two_args_wrapper ();
ss_regress_654694 ();
ss_step_through ();
ss_non_user_code ();
@@ -550,6 +551,21 @@ public class Tests : TestsBase, ITest2
ss_nested_3 ();
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_nested_with_two_args_wrapper () {
ss_nested_with_two_args(ss_nested_arg (), ss_nested_arg ());
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_with_two_args (int a1, int a2) {
return a1 + a2;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_arg () {
return 0;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_nested_1 (int i) {
}
@@ -3509,6 +3509,10 @@ public class DebuggerTests
Assert.AreEqual ("domains", frames [2].Method.Name);
Assert.AreEqual (vm.RootDomain, frames [2].Domain);
// Check enum creation in other domains
var anenum = vm.CreateEnumMirror (d_method.DeclaringType.Assembly.GetType ("AnEnum"), vm.CreateValue (1));
Assert.AreEqual (1, anenum.Value);
// Test breakpoints on already JITted methods in other domains
m = entry_point.DeclaringType.GetMethod ("invoke_in_domain_2");
Assert.IsNotNull (m);
@@ -4307,6 +4311,33 @@ public class DebuggerTests
vm = null;
}
[Test]
[Category("NotWorking")]
public void ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter() {
Event e = run_until ("ss_nested_with_two_args_wrapper");
var req = create_step(e);
req.Enable();
e = step_once();
assert_location(e, "ss_nested_with_two_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg");
e = step_over();
assert_location(e, "ss_nested_arg");
e = step_over();
assert_location(e, "ss_nested_arg");
e = step_over();
assert_location(e, "ss_nested_with_two_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg");
}
[Test]
// Uses a fixed port
[Category("NotWorking")]
+19 -20
View File
@@ -1390,28 +1390,27 @@ namespace Mono.Options
o.Write (s);
}
private static string GetArgumentName (int index, int maxIndex, string description)
static string GetArgumentName (int index, int maxIndex, string description)
{
if (description == null)
return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1);
string[] nameStart;
if (maxIndex == 1)
nameStart = new string[]{"{0:", "{"};
else
nameStart = new string[]{"{" + index + ":"};
for (int i = 0; i < nameStart.Length; ++i) {
int start, j = 0;
do {
start = description.IndexOf (nameStart [i], j);
} while (start >= 0 && j != 0 ? description [j++ - 1] == '{' : false);
if (start == -1)
continue;
int end = description.IndexOf ("}", start);
if (end == -1)
continue;
return description.Substring (start + nameStart [i].Length, end - start - nameStart [i].Length);
var matches = Regex.Matches (description ?? "", @"(?<=(?<!\{)\{)[^{}]*(?=\}(?!\}))"); // ignore double braces
string argName = "";
foreach (Match match in matches) {
var parts = match.Value.Split (':');
// for maxIndex=1 it can be {foo} or {0:foo}
if (maxIndex == 1) {
argName = parts[parts.Length - 1];
}
// look for {i:foo} if maxIndex > 1
if (maxIndex > 1 && parts.Length == 2 &&
parts[0] == index.ToString (CultureInfo.InvariantCulture)) {
argName = parts[1];
}
}
return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1);
if (string.IsNullOrEmpty (argName)) {
argName = maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1);
}
return argName;
}
private static string GetDescription (string description)
@@ -413,6 +413,8 @@ namespace MonoTests.Mono.Options
{ "color2:", "set {color}", v => {} },
{ "rk=", "required key/value option", (k, v) => {} },
{ "rk2=", "required {{foo}} {0:key}/{1:value} option", (k, v) => {} },
{ "rk3=", "required {{foo}} {}", k => {} },
{ "rk4=", "required {{foo}} {0:val}", k => {} },
{ "ok:", "optional key/value option", (k, v) => {} },
{ "long-desc",
"This has a really\nlong, multi-line description that also\ntests\n" +
@@ -456,6 +458,8 @@ namespace MonoTests.Mono.Options
expected.WriteLine (" --color2[=color] set color");
expected.WriteLine (" --rk=VALUE1:VALUE2 required key/value option");
expected.WriteLine (" --rk2=key:value required {foo} key/value option");
expected.WriteLine (" --rk3=VALUE required {foo}");
expected.WriteLine (" --rk4=val required {foo} val");
expected.WriteLine (" --ok[=VALUE1:VALUE2] optional key/value option");
expected.WriteLine (" --long-desc This has a really");
expected.WriteLine (" long, multi-line description that also");
+1 -1
View File
@@ -6,7 +6,7 @@ LIBRARY_SNK = ../mono.snk
LIB_REFS = System System.Core
KEYFILE = $(LIBRARY_SNK)
LIB_MCS_FLAGS = /unsafe /publicsign
LIB_MCS_FLAGS = /unsafe /publicsign /nowarn:0618
LIBRARY_WARN_AS_ERROR = yes
@@ -8,7 +8,7 @@
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{58A188CE-DED8-48B0-98B7-065A260D21DF}</ProjectGuid>
<OutputType>Library</OutputType>
<NoWarn>1699</NoWarn>
<NoWarn>1699,618</NoWarn>
<LangVersion>latest</LangVersion>
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>
@@ -32,7 +32,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<NoWarn>1699</NoWarn>
<NoWarn>1699,618</NoWarn>
<Optimize>false</Optimize>
<DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
@@ -40,7 +40,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<NoWarn>1699</NoWarn>
<NoWarn>1699,618</NoWarn>
<Optimize>true</Optimize>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
@@ -54,6 +54,8 @@ namespace Mono.Profiler.Log {
HeapEnd = 1 << 4,
HeapObject = 2 << 4,
HeapRoots = 3 << 4,
HeapRootRegister = 4 << 4,
HeapRootUnregister = 5 << 4,
SampleHit = 0 << 4,
SampleUnmanagedSymbol = 1 << 4,
@@ -74,6 +76,7 @@ namespace Mono.Profiler.Log {
AppDomain = 4,
Thread = 5,
Context = 6,
VTable = 7,
}
// mono/utils/mono-counters.h : MONO_COUNTER_*
@@ -133,6 +136,7 @@ namespace Mono.Profiler.Log {
// mono/metadata/profiler.h : MonoProfilerGCRootType
[Flags]
[Obsolete ("The event field using this enum is no longer produced.")]
public enum LogHeapRootAttributes {
Pinning = 1 << 8,
WeakReference = 2 << 8,
@@ -147,6 +151,26 @@ namespace Mono.Profiler.Log {
TypeMask = 0xff,
}
// mono/metadata/mono-gc.h : MonoGCRootSource
public enum LogHeapRootSource {
External = 0,
Stack = 1,
FinalizerQueue = 2,
Static = 3,
ThreadStatic = 4,
ContextStatic = 5,
GCHandle = 6,
Jit = 7,
Threading = 8,
AppDomain = 9,
Reflection = 10,
Marshal = 11,
ThreadPool = 12,
Debugger = 13,
Handle = 14,
Ephemeron = 15,
}
// mono/profiler/log.h : MonoProfilerMonitorEvent
public enum LogMonitorEvent {
Contention = 1,
@@ -66,6 +66,10 @@ namespace Mono.Profiler.Log {
{
}
public virtual void Visit (VTableLoadEvent ev)
{
}
public virtual void Visit (JitEvent ev)
{
}
@@ -94,6 +98,14 @@ namespace Mono.Profiler.Log {
{
}
public virtual void Visit (HeapRootRegisterEvent ev)
{
}
public virtual void Visit (HeapRootUnregisterEvent ev)
{
}
public virtual void Visit (GCEvent ev)
{
}
@@ -161,6 +161,20 @@ namespace Mono.Profiler.Log {
}
}
public sealed class VTableLoadEvent : LogEvent {
public long VTablePointer { get; internal set; }
public long AppDomainId { get; internal set; }
public long ClassPointer { get; internal set; }
internal override void Accept (LogEventVisitor visitor)
{
visitor.Visit (this);
}
}
public sealed class JitEvent : LogEvent {
public long MethodPointer { get; internal set; }
@@ -195,8 +209,11 @@ namespace Mono.Profiler.Log {
public sealed class AllocationEvent : LogEvent {
[Obsolete ("This field is no longer produced.")]
public long ClassPointer { get; internal set; }
public long VTablePointer { get; internal set; }
public long ObjectPointer { get; internal set; }
public long ObjectSize { get; internal set; }
@@ -236,8 +253,11 @@ namespace Mono.Profiler.Log {
public long ObjectPointer { get; internal set; }
[Obsolete ("This field is no longer produced.")]
public long ClassPointer { get; internal set; }
public long VTablePointer { get; internal set; }
public long ObjectSize { get; internal set; }
public IReadOnlyList<HeapObjectReference> References { get; internal set; }
@@ -252,13 +272,18 @@ namespace Mono.Profiler.Log {
public struct HeapRoot {
public long AddressPointer { get; internal set; }
public long ObjectPointer { get; internal set; }
[Obsolete ("This field is no longer produced.")]
public LogHeapRootAttributes Attributes { get; internal set; }
[Obsolete ("This field is no longer produced.")]
public long ExtraInfo { get; internal set; }
}
[Obsolete ("This field is no longer produced.")]
public long MaxGenerationCollectionCount { get; internal set; }
public IReadOnlyList<HeapRoot> Roots { get; internal set; }
@@ -269,6 +294,34 @@ namespace Mono.Profiler.Log {
}
}
public sealed class HeapRootRegisterEvent : LogEvent {
public long RootPointer { get; internal set; }
public long RootSize { get; internal set; }
public LogHeapRootSource Source { get; internal set; }
public long Key { get; internal set; }
public string Name { get; internal set; }
internal override void Accept (LogEventVisitor visitor)
{
visitor.Visit (this);
}
}
public sealed class HeapRootUnregisterEvent : LogEvent {
public long RootPointer { get; internal set; }
internal override void Accept (LogEventVisitor visitor)
{
visitor.Visit (this);
}
}
public sealed class GCEvent : LogEvent {
public LogGCEvent Type { get; internal set; }
@@ -127,7 +127,8 @@ namespace Mono.Profiler.Log {
case LogEventType.AllocationBacktrace:
case LogEventType.AllocationNoBacktrace:
ev = new AllocationEvent {
ClassPointer = ReadPointer (),
ClassPointer = StreamHeader.FormatVersion < 15 ? ReadPointer () : 0,
VTablePointer = StreamHeader.FormatVersion >= 15 ? ReadPointer () : 0,
ObjectPointer = ReadObject (),
ObjectSize = (long) _reader.ReadULeb128 (),
Backtrace = ReadBacktrace (extType == LogEventType.AllocationBacktrace),
@@ -305,6 +306,16 @@ namespace Mono.Profiler.Log {
} else
throw new LogException ("Invalid context metadata event.");
break;
case LogMetadataType.VTable:
if (load) {
ev = new VTableLoadEvent {
VTablePointer = ReadPointer (),
AppDomainId = ReadPointer (),
ClassPointer = ReadPointer (),
};
} else
throw new LogException ("Invalid VTable metadata event.");
break;
default:
throw new LogException ($"Invalid metadata type ({metadataType}).");
}
@@ -373,8 +384,8 @@ namespace Mono.Profiler.Log {
case LogEventType.MonitorBacktrace:
ev = new MonitorEvent {
Event = StreamHeader.FormatVersion >= 14 ?
(LogMonitorEvent) _reader.ReadByte () :
(LogMonitorEvent) ((((byte) type & 0xf0) >> 4) & 0x3),
(LogMonitorEvent) _reader.ReadByte () :
(LogMonitorEvent) ((((byte) type & 0xf0) >> 4) & 0x3),
ObjectPointer = ReadObject (),
Backtrace = ReadBacktrace (extType == LogEventType.MonitorBacktrace),
};
@@ -394,7 +405,8 @@ namespace Mono.Profiler.Log {
case LogEventType.HeapObject: {
HeapObjectEvent hoe = new HeapObjectEvent {
ObjectPointer = ReadObject (),
ClassPointer = ReadPointer (),
ClassPointer = StreamHeader.FormatVersion < 15 ? ReadPointer () : 0,
VTablePointer = StreamHeader.FormatVersion >= 15 ? ReadPointer () : 0,
ObjectSize = (long) _reader.ReadULeb128 (),
};
@@ -414,17 +426,22 @@ namespace Mono.Profiler.Log {
}
case LogEventType.HeapRoots: {
// TODO: This entire event makes no sense.
var hre = new HeapRootsEvent ();
var list = new HeapRootsEvent.HeapRoot [(int) _reader.ReadULeb128 ()];
hre.MaxGenerationCollectionCount = (long) _reader.ReadULeb128 ();
if (StreamHeader.FormatVersion < 15)
hre.MaxGenerationCollectionCount = (long) _reader.ReadULeb128 ();
for (var i = 0; i < list.Length; i++) {
list [i] = new HeapRootsEvent.HeapRoot {
AddressPointer = StreamHeader.FormatVersion >= 15 ? ReadPointer () : 0,
ObjectPointer = ReadObject (),
Attributes = StreamHeader.FormatVersion == 13 ? (LogHeapRootAttributes) _reader.ReadByte () : (LogHeapRootAttributes) _reader.ReadULeb128 (),
ExtraInfo = (long) _reader.ReadULeb128 (),
Attributes = StreamHeader.FormatVersion < 15 ?
(StreamHeader.FormatVersion == 13 ?
(LogHeapRootAttributes) _reader.ReadByte () :
(LogHeapRootAttributes) _reader.ReadULeb128 ()) :
0,
ExtraInfo = StreamHeader.FormatVersion < 15 ? (long) _reader.ReadULeb128 () : 0,
};
}
@@ -433,6 +450,20 @@ namespace Mono.Profiler.Log {
break;
}
case LogEventType.HeapRootRegister:
ev = new HeapRootRegisterEvent {
RootPointer = ReadPointer (),
RootSize = (long) _reader.ReadULeb128 (),
Source = (LogHeapRootSource) _reader.ReadByte (),
Key = ReadPointer (),
Name = _reader.ReadCString (),
};
break;
case LogEventType.HeapRootUnregister:
ev = new HeapRootUnregisterEvent {
RootPointer = ReadPointer (),
};
break;
default:
throw new LogException ($"Invalid extended event type ({extType}).");
}
@@ -476,9 +507,9 @@ namespace Mono.Profiler.Log {
Section = section,
SectionName = section == LogCounterSection.User ? _reader.ReadCString () : null,
CounterName = _reader.ReadCString (),
Type = (LogCounterType) _reader.ReadByte (),
Unit = (LogCounterUnit) _reader.ReadByte (),
Variance = (LogCounterVariance) _reader.ReadByte (),
Type = StreamHeader.FormatVersion < 15 ? (LogCounterType) _reader.ReadByte () : (LogCounterType) _reader.ReadULeb128 (),
Unit = StreamHeader.FormatVersion < 15 ? (LogCounterUnit) _reader.ReadByte () : (LogCounterUnit) _reader.ReadULeb128 (),
Variance = StreamHeader.FormatVersion < 15 ? (LogCounterVariance) _reader.ReadByte () : (LogCounterVariance) _reader.ReadULeb128 (),
Index = (long) _reader.ReadULeb128 (),
};
}
@@ -498,7 +529,7 @@ namespace Mono.Profiler.Log {
if (index == 0)
break;
var counterType = (LogCounterType) _reader.ReadByte ();
var counterType = StreamHeader.FormatVersion < 15 ? (LogCounterType) _reader.ReadByte () : (LogCounterType) _reader.ReadULeb128 ();
object value = null;
@@ -544,6 +575,9 @@ namespace Mono.Profiler.Log {
case LogEventType.RuntimeJitHelper: {
var helperType = (LogJitHelper) _reader.ReadByte ();
if (StreamHeader.FormatVersion < 14)
helperType--;
ev = new JitHelperEvent {
Type = helperType,
BufferPointer = ReadPointer (),
@@ -9,7 +9,7 @@ namespace Mono.Profiler.Log {
public sealed class LogStreamHeader {
const int MinVersion = 13;
const int MaxVersion = 14;
const int MaxVersion = 15;
const int Id = 0x4d505a01;
@@ -31,6 +31,64 @@ using System;
using System.IO;
using System.Security.Cryptography;
/*
FIXME There are a number of problems and deficiencies in this code.
- It requires the PE header to fit in 4K. This is not guaranteed
by the file format and it is easy to construct valid files that violate it.
i.e. with a large MS-DOS header. The code should just read the entire
file into memory.
- It has a number of missing or incorrect range checks.
Incorrect, as in, checking that record or field starts within
range, but does not end within range.
- It removes/ignores COFF symbols. These rarely/never occur, but removing
them is not likely correct. It is not mentioned in either of the two specifications.
This seems to be extra unnecessary incorrect code.
- There are two specifications, Authenticode and PE:
https://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/Authenticode_PE.docx
https://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx
https://msdn.microsoft.com/library/windows/desktop/ms680547(v=vs.85).aspx
These are in contradiction regarding hashing of data after the sections.
Such data is usually absent. More comparison is need between
Mono runtime and desktop runtime/tools.
The most common such data is an older signature, which is supposed to be ignored.
The next most common is appended setup data, which isn't likely with managed code.
However this code has nothing to do with signing managed code specifically, just PEs.
There is a slight inconsistency in the Authenticode_PE.doc around the location
of the signature vs. other data past sections.
The picture has the signature first, the text puts last.
- A buffer size of 4K is small and probably not performant.
Buffering makes the code harder to update and correct, vs.
reading the entire file into memory.
- It does not validate NumberOfRvasAndSizes field.
Usually it is valid.
- It is missing a number of other validations.
For example, the optional header magic was ignored, so in the
interest of small change, we treat all non-0x20B values the same.
Mail with Microsoft confirms the documents do not agree, and that the PE document
is outdated and/or incorrect and/or referring to no longer supported v1 Authenticode,
and that the intent is for the signature to be at the end, per the text and not the picture.
And that data past the sections is to be hashed -- there rarely is any.
The plan is therefore:
read the entire file into memory
add missing validation
hash, excluding checksum, security directory, and security content
place security content at the end, replacing what is there if anything
remove the symbol code (here and in formatter)
expose more offsets from here to cleanup the formatter code
There is also no unit tests for this code it seems.
*/
namespace Mono.Security.Authenticode {
// References:
@@ -64,9 +122,20 @@ namespace Mono.Security.Authenticode {
private int dirSecurityOffset;
private int dirSecuritySize;
private int coffSymbolTableOffset;
private bool pe64;
internal bool PE64 {
get {
if (blockNo < 1)
ReadFirstBlock ();
return pe64;
}
}
public AuthenticodeBase ()
{
// FIXME Read the entire file into memory.
// See earlier comments.
fileblock = new byte [4096];
}
@@ -142,11 +211,17 @@ namespace Mono.Security.Authenticode {
peOffset = BitConverterLE.ToInt32 (fileblock, 60);
if (peOffset > fileblock.Length) {
// just in case (0.1%) this can actually happen
// FIXME This does not mean the file is invalid,
// just that this code cannot handle it.
// FIXME Read the entire file into memory.
// See earlier comments.
string msg = String.Format (Locale.GetText (
"Header size too big (> {0} bytes)."),
fileblock.Length);
throw new NotSupportedException (msg);
}
// FIXME This verifies that PE starts within the file,
// but not that it fits.
if (peOffset > fs.Length)
return 4;
@@ -156,12 +231,33 @@ namespace Mono.Security.Authenticode {
if (BitConverterLE.ToUInt32 (fileblock, peOffset) != 0x4550)
return 5;
// 2.2. Locate IMAGE_DIRECTORY_ENTRY_SECURITY (offset and size)
dirSecurityOffset = BitConverterLE.ToInt32 (fileblock, peOffset + 152);
dirSecuritySize = BitConverterLE.ToInt32 (fileblock, peOffset + 156);
// PE signature is followed by 20 byte file header, and
// then 2 byte magic 0x10B for PE32 or 0x20B for PE32+,
// or 0x107 for the obscure ROM case.
// FIXME The code historically ignored this magic value
// entirely, so we only treat 0x20B differently to maintain
// this dubious behavior.
// FIXME The code also lacks range checks in a number of places,
// and will access arrays out of bounds for valid files.
// COFF symbol tables are deprecated - we'll strip them if we see them!
// (otherwise the signature won't work on MS and we don't want to support COFF for that)
ushort magic = BitConverterLE.ToUInt16 (fileblock, peOffset + 24);
const int IMAGE_NT_OPTIONAL_HDR64_MAGIC = 0x20B;
pe64 = magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC;
// FIXME This fails to validate NumberOfRvasAndSizes.
// 2.2. Locate IMAGE_DIRECTORY_ENTRY_SECURITY (offset and size)
// These offsets are from the documentation, but add 24 for
// PE signature and file header.
if (pe64) {
dirSecurityOffset = BitConverterLE.ToInt32 (fileblock, peOffset + 168);
dirSecuritySize = BitConverterLE.ToInt32 (fileblock, peOffset + 168 + 4);
}
else {
dirSecurityOffset = BitConverterLE.ToInt32 (fileblock, peOffset + 152);
dirSecuritySize = BitConverterLE.ToInt32 (fileblock, peOffset + 156);
}
// FIXME Remove this code and the dependency on it.
coffSymbolTableOffset = BitConverterLE.ToInt32 (fileblock, peOffset + 12);
return 0;
@@ -229,14 +325,38 @@ namespace Mono.Security.Authenticode {
// Authenticode(r) gymnastics
// Hash from (generally) 0 to 215 (216 bytes)
// 88 = 64 + 24
// 64 is the offset of Checksum within OptionalHeader.
// 24 is offset of OptionalHeader within PEHeader.
int pe = peOffset + 88;
hash.TransformBlock (fileblock, 0, pe, fileblock, 0);
// then skip 4 for checksum
pe += 4;
// Continue hashing from (generally) 220 to 279 (60 bytes)
hash.TransformBlock (fileblock, pe, 60, fileblock, pe);
// then skip 8 bytes for IMAGE_DIRECTORY_ENTRY_SECURITY
pe += 68;
if (pe64) {
// security_directory, if present, is at offset 144 within OptionalHeader64
// FIXME This code fails to check if the security_directory is present.
// If it is absent, it may or may not be difficult to add, and reject
// the file as valid but unsignable.
// Checksum is at [64, 68].
// 144 - 68 = 76
// Hash from checksum to security_directory.
hash.TransformBlock (fileblock, pe, 76, fileblock, pe);
// then skip 8 bytes for IMAGE_DIRECTORY_ENTRY_SECURITY
pe += 76 + 8;
}
else {
// security_directory, if present, is at offset 128 within OptionalHeader32
// FIXME This code fails to check if the security_directory is present.
// If it is absent, it may or may not be difficult to add, and reject
// the file as valid but unsignable.
// Checksum is at [64, 68].
// 128 - 68 = 60
// Continue hashing from (generally) 220 to 279 (60 bytes)
hash.TransformBlock (fileblock, pe, 60, fileblock, pe);
// then skip 8 bytes for IMAGE_DIRECTORY_ENTRY_SECURITY
pe += 68;
}
// everything is present so start the hashing
if (n == 0) {
@@ -148,19 +148,19 @@ namespace Mono.Security.Authenticode {
}
// pkcs 1
// private const string rsaEncryption = "1.2.840.113549.1.1.1";
// private const string rsaEncryption = "1.2.840.113549.1.1.1";
// pkcs 7
// private const string data = "1.2.840.113549.1.7.1";
// private const string data = "1.2.840.113549.1.7.1";
private const string signedData = "1.2.840.113549.1.7.2";
// pkcs 9
// private const string contentType = "1.2.840.113549.1.9.3";
// private const string messageDigest = "1.2.840.113549.1.9.4";
// private const string contentType = "1.2.840.113549.1.9.3";
// private const string messageDigest = "1.2.840.113549.1.9.4";
private const string countersignature = "1.2.840.113549.1.9.6";
// microsoft spc (software publisher certificate)
private const string spcStatementType = "1.3.6.1.4.1.311.2.1.11";
private const string spcSpOpusInfo = "1.3.6.1.4.1.311.2.1.12";
private const string spcPelmageData = "1.3.6.1.4.1.311.2.1.15";
// private const string individualCodeSigning = "1.3.6.1.4.1.311.2.1.21";
// private const string individualCodeSigning = "1.3.6.1.4.1.311.2.1.21";
private const string commercialCodeSigning = "1.3.6.1.4.1.311.2.1.22";
private const string timestampCountersignature = "1.3.6.1.4.1.311.3.2.1";
@@ -192,8 +192,8 @@ namespace Mono.Security.Authenticode {
else
opus = Attribute (spcSpOpusInfo, Opus (description, url.ToString ()));
pkcs7.SignerInfo.AuthenticatedAttributes.Add (opus);
// When using the MS Root Agency (test) we can't include this attribute in the signature or it won't validate!
// pkcs7.SignerInfo.AuthenticatedAttributes.Add (Attribute (spcStatementType, new ASN1 (0x30, ASN1Convert.FromOid (commercialCodeSigning).GetBytes ())));
// When using the MS Root Agency (test) we can't include this attribute in the signature or it won't validate!
// pkcs7.SignerInfo.AuthenticatedAttributes.Add (Attribute (spcStatementType, new ASN1 (0x30, ASN1Convert.FromOid (commercialCodeSigning).GetBytes ())));
pkcs7.GetASN1 (); // sign
return pkcs7.SignerInfo.Signature;
}
@@ -243,9 +243,14 @@ namespace Mono.Security.Authenticode {
using (FileStream fs = File.Open (fileName, FileMode.Open, FileAccess.ReadWrite)) {
int filesize;
if (SecurityOffset > 0) {
// FIXME Does it fit? Is it always the same size?
// file was already signed, we'll reuse the position for the updated signature
filesize = SecurityOffset;
} else if (CoffSymbolTableOffset > 0) {
// FIXME This is not documented as something to remove.
// However some documentation says to remove after the last
// section, and some does not, and this might be there,
// or it might not.
// strip (deprecated) COFF symbol table
fs.Seek (PEOffset + 12, SeekOrigin.Begin);
for (int i = 0; i < 8; i++)
@@ -263,14 +268,22 @@ namespace Mono.Security.Authenticode {
// IMAGE_DIRECTORY_ENTRY_SECURITY (offset, size)
byte[] data = BitConverterLE.GetBytes (filesize + addsize);
fs.Seek (PEOffset + 152, SeekOrigin.Begin);
if (PE64)
fs.Seek (PEOffset + 168, SeekOrigin.Begin);
else
fs.Seek (PEOffset + 152, SeekOrigin.Begin);
fs.Write (data, 0, 4);
int size = asn.Length + 8;
int addsize_signature = (size & 7);
if (addsize_signature > 0)
addsize_signature = 8 - addsize_signature;
data = BitConverterLE.GetBytes (size + addsize_signature);
fs.Seek (PEOffset + 156, SeekOrigin.Begin);
if (PE64)
fs.Seek (PEOffset + 168 + 4, SeekOrigin.Begin);
else
fs.Seek (PEOffset + 156, SeekOrigin.Begin);
fs.Write (data, 0, 4);
fs.Seek (filesize, SeekOrigin.Begin);
// align certificate entry to a multiple of 8 bytes
@@ -278,8 +291,40 @@ namespace Mono.Security.Authenticode {
byte[] fillup = new byte[addsize];
fs.Write (fillup, 0, fillup.Length);
}
/*
https://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/Authenticode_PE.docx
The Authenticode signature is in a WIN_CERTIFICATE structure, which is declared in Wintrust.h as follows:
typedef struct _WIN_CERTIFICATE
{
DWORD dwLength;
WORD wRevision;
WORD wCertificateType;
BYTE bCertificate[ANYSIZE_ARRAY];
} WIN_CERTIFICATE, *LPWIN_CERTIFICATE;
The fields in WIN_CERTIFICATE are set to the following values:
dwLength is set to the length of bCertificate.
wRevision is set to the WIN_CERTIFICATE version number.
wCertificateType is set to 0x0002 for Authenticode signatures.
This value is defined in Wintrust.h as WIN_CERT_TYPE_PKCS_SIGNED_DATA.
bCertificate is set to a variable-length binary array that contains the Authenticode PKCS #7 signedData.
The PKCS #7 integrity is verified as described in ”PKCS #7: Cryptographic Message Syntax Standard.”
*/
// write WIN_CERTIFICATE.dwLength
fs.Write (data, 0, data.Length); // length (again)
data = BitConverterLE.GetBytes (0x00020200); // magic
// write WIN_CERTIFICATE.wRevision = 0x0200 and wCertificateType = 2.
// /usr/local/Cellar/mingw-w64/5.0.3/toolchain-x86_64/x86_64-w64-mingw32/include/wintrust.h
// const short WIN_CERT_REVISION_1_0 = 0x0100;
const short WIN_CERT_REVISION_2_0 = 0x0200;
// const short WIN_CERT_TYPE_X509 = 0x0001;
const short WIN_CERT_TYPE_PKCS_SIGNED_DATA = 0x0002;
// const short WIN_CERT_TYPE_RESERVED_1 = 0x0003;
// const short WIN_CERT_TYPE_TS_STACK_SIGNED = 0x0004;
data = BitConverterLE.GetBytes (WIN_CERT_REVISION_2_0);
fs.Write (data, 0, data.Length);
data = BitConverterLE.GetBytes (WIN_CERT_TYPE_PKCS_SIGNED_DATA);
fs.Write (data, 0, data.Length);
fs.Write (asn, 0, asn.Length);
if (addsize_signature > 0) {
@@ -700,7 +700,7 @@ namespace MonoTests.Mono.Security.Authenticode {
AuthenticodeDeformatter ad = new AuthenticodeDeformatter (filename);
// note: it's a valid signed PE file - but it doesn't
// mean it's root is trusted on the current system
Assert.IsTrue (((ad.Reason == 0) || (ad.Reason == 6)), $"Reason = {ad.Reason}");
Assert.IsTrue (((ad.Reason == 0) || (ad.Reason == 6)), "Reason");
Assert.AreEqual ("35-A5-21-3B-FC-FE-FA-40-97-AA-BB-DE-3B-52-15-6F", BitConverter.ToString (ad.Hash), "Hash");
Assert.AreEqual (632011370700000000, ad.Timestamp.ToUniversalTime ().Ticks, "Timestamp");
Assert.AreEqual (4, ad.Certificates.Count, "#Certificates");
+5 -1
View File
@@ -25,7 +25,7 @@ LIB_MCS_FLAGS += -d:NET_3_5
endif
ifdef AOT_FRIENDLY_PROFILE
extra_test_flags := -exclude:NotWorkingInterpreter
extra_test_flags := -exclude:NotWorkingLinqInterpreter
LIB_MCS_FLAGS += -d:NO_FEATURE_STATIC_DELEGATE,FEATURE_MAKE_RUN_METHODS
else
LIB_MCS_FLAGS += -d:FEATURE_COMPILE,FEATURE_COMPILE_TO_METHODBUILDER,FEATURE_PDB_GENERATOR
@@ -52,6 +52,10 @@ BUILT_SOURCES = \
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
XTEST_LIB_REFS = System Facades/System.Threading.Tasks Microsoft.CSharp Facades/System.Text.RegularExpressions Facades/System.Reflection Facades/System.Reflection.Extensions Facades/System.Runtime.InteropServices.RuntimeInformation Facades/System.Reflection.Emit
# FEATURE_INTERPRET, FEATURE_COMPILE, NO_FEATURE_STATIC_DELEGATE
XTEST_LIB_FLAGS = -unsafe -d:FEATURE_COMPILE
XTEST_RESX_RESOURCE_STRING = ../../../external/corefx/src/System.Collections.Immutable/src/Resources/Strings.resx
include ../../build/library.make
@@ -0,0 +1,69 @@
../../build/common/SR.cs
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs
# System.Linq.Queryable
../../../external/corefx/src/System.Linq.Queryable/tests/*.cs
../../../external/corefx/src/Common/tests/System/Linq/SkipTakeData.cs
# System.Linq.Expressions
../../../external/corefx/src/System.Linq.Expressions/tests/Array/*.cs:NewArrayBoundsTests.cs,ArrayAccessTests.cs,ArrayIndexTests.cs
../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Block/*.cs:NoParameterBlockTests.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Call/*.cs:CallTests.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Cast/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Conditional/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Constant/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Convert/*.cs:ConvertCheckedTests.cs
../../../external/corefx/src/System.Linq.Expressions/tests/DebuggerTypeProxy/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/DebugInfo/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Default/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/DelegateType/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Dynamic/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/DynamicExpression/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/ExceptionHandling/*.cs:ExceptionHandlingExpressions.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Goto/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/ILReader/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/IndexExpression/*.cs:IndexExpressionTests.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Invoke/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Label/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Lambda/*.cs:LambdaTests.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Lifted/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/ListInit/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Loop/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Member/*.cs:MemberAccessTests.cs
../../../external/corefx/src/System.Linq.Expressions/tests/MemberInit/*.cs:BindTests.cs
../../../external/corefx/src/System.Linq.Expressions/tests/New/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/SequenceTests/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Switch/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Ternary/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/TestExtensions/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/TypeBinary/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Unary/*.cs:UnaryConvertTests.cs,UnaryQuoteTests.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Variables/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Visitor/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Arithmetic/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Assignment/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Bitwise/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Coalesce/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Comparison/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Logical/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/Unary/IncDecAssign/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/*.cs:StackSpillerTests.cs,ReadOnlyCollectionBuilderTests.cs
# System.Linq.Expressions
../../../external/corefx/src/System.Linq.Parallel/tests/Combinatorial/*.cs
../../../external/corefx/src/System.Linq.Parallel/tests/Helpers/*.cs
#../../../external/corefx/src/System.Linq.Parallel/tests/QueryOperators/*.cs
../../../external/corefx/src/System.Linq.Parallel/tests/*.cs:WithCancellationTests.cs,PlinqModesTests.cs,ExchangeTests.cs,EtwTests.cs
../../../external/corefx/src/Common/tests/System/Threading/ThreadPoolHelpers.cs
../../../external/corefx/src/Common/tests/System/Diagnostics/Tracing/TestEventListener.cs
../../../external/corefx/src/Common/tests/System/ShouldNotBeInvokedException.cs
# tests need System.Collections.Immutable.dll
../../../external/corefx/src/Common/src/System/Runtime/Versioning/NonVersionableAttribute.cs
../../../external/corefx/src/System.Collections.Immutable/src/System/Collections/Generic/*.cs
../../../external/corefx/src/System.Collections.Immutable/src/System/Collections/Immutable/*.cs
../../../external/corefx/src/System.Collections.Immutable/src/Validation/*.cs
corefx/SR.tests.cs
@@ -137,7 +137,7 @@ namespace System.IO.Pipes
#pragma warning disable 618
stream = new FileStream (handle.DangerousGetHandle (),
CanRead ? (CanWrite ? FileAccess.ReadWrite : FileAccess.Read)
: FileAccess.Write, true, buffer_size, IsAsync);
: FileAccess.Write, false, buffer_size, IsAsync);
#pragma warning restore 618
}
return stream;
@@ -37,6 +37,7 @@ using NUnit.Framework;
namespace MonoTests.System.IO.MemoryMappedFiles {
[TestFixture]
[Category("NotWasm")]
public class MemoryMappedFileTest {
void AssertThrows<ExType> (Action del) where ExType : Exception {
@@ -403,7 +403,8 @@ namespace MonoTests.System.Linq.Expressions {
[Test]
[Category ("NotDotNet")] // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=319190
[Category ("NotWorkingInterpreter")]
[Category ("NotWorkingLinqInterpreter")]
[Category ("NotWasm")]
public void Connect319190 ()
{
var lambda = Expression.Lambda<Func<bool>> (
@@ -472,7 +472,7 @@ namespace MonoTests.System.Linq.Expressions
}
[Test]
[Category ("NotWorkingInterpreter")]
[Category ("NotWorkingLinqInterpreter")]
public void NullableNullEqual ()
{
var param = Expression.Parameter (typeof (DateTime?), "x");
@@ -324,7 +324,7 @@ namespace MonoTests.System.Linq {
}
[Test]
[Category ("NotWorkingInterpreter")]
[Category ("NotWorkingLinqInterpreter")]
public void UserExtensionMethod ()
{
BindingFlags extensionFlags = BindingFlags.Static | BindingFlags.Public;
@@ -37,6 +37,7 @@ namespace MonoTests.System.Threading.Tasks
public class TaskExtensionsTests
{
[Test]
[Category ("MultiThreaded")]
public void TaskUnwrapingBehavioralTest ()
{
Task<int> t2 = Increment(4)
@@ -343,6 +343,7 @@ namespace MonoTests.System.Threading
}
[Test]
[Category ("MultiThreaded")]
public void EnterReadLock_MultiRead ()
{
var v = new ReaderWriterLockSlim ();
@@ -371,6 +372,7 @@ namespace MonoTests.System.Threading
}
[Test]
[Category ("MultiThreaded")]
public void TryEnterWriteLock_WhileReading ()
{
var v = new ReaderWriterLockSlim ();
@@ -395,6 +397,7 @@ namespace MonoTests.System.Threading
}
[Test]
[Category ("MultiThreaded")]
public void EnterWriteLock_MultiRead ()
{
var v = new ReaderWriterLockSlim ();
@@ -449,7 +452,9 @@ namespace MonoTests.System.Threading
Assert.IsTrue (v.TryEnterWriteLock (100));
v.ExitWriteLock ();
}
[Test]
[Category ("MultiThreaded")]
public void EnterWriteLockWhileInUpgradeAndOtherWaiting ()
{
var v = new ReaderWriterLockSlim ();
@@ -559,6 +564,7 @@ namespace MonoTests.System.Threading
}
[Test]
[Category ("MultiThreaded")]
public void RecursiveReadPropertiesTest ()
{
var v = new ReaderWriterLockSlim (LockRecursionPolicy.SupportsRecursion);
@@ -588,6 +594,7 @@ namespace MonoTests.System.Threading
}
[Test]
[Category ("MultiThreaded")]
public void RecursiveUpgradePropertiesTest ()
{
var v = new ReaderWriterLockSlim (LockRecursionPolicy.SupportsRecursion);
@@ -620,6 +627,7 @@ namespace MonoTests.System.Threading
}
[Test]
[Category ("MultiThreaded")]
public void RecursiveWritePropertiesTest ()
{
var v = new ReaderWriterLockSlim (LockRecursionPolicy.SupportsRecursion);
@@ -739,6 +747,7 @@ namespace MonoTests.System.Threading
}
[Test]
[Category ("MultiThreaded")]
public void RecursiveWriteReadAcquisitionInterleaving ()
{
var v = new ReaderWriterLockSlim (LockRecursionPolicy.SupportsRecursion);
+17
View File
@@ -0,0 +1,17 @@
//
// This file was generated by resx2sr tool
//
partial class SR
{
public const string Arg_KeyNotFoundWithKey = "The given key '{0}' was not present in the dictionary.";
public const string ArrayInitializedStateNotEqual = "Object is not an array with the same initialization state as the array to compare it to.";
public const string ArrayLengthsNotEqual = "Object is not an array with the same number of elements as the array to compare it to.";
public const string CannotFindOldValue = "Cannot find the old value";
public const string CapacityMustBeGreaterThanOrEqualToCount = "Capacity was less than the current Count of elements.";
public const string CapacityMustEqualCountOnMove = "MoveToImmutable can only be performed when Count equals Capacity.";
public const string CollectionModifiedDuringEnumeration = "Collection was modified; enumeration operation may not execute.";
public const string DuplicateKey = "An element with the same key but a different value already exists. Key: {0}";
public const string InvalidEmptyOperation = "This operation does not apply to an empty instance.";
public const string InvalidOperationOnDefaultArray = "This operation cannot be performed on a default instance of ImmutableArray<T>. Consider initializing the array, or checking the ImmutableArray<T>.IsDefault property.";
}
@@ -34,7 +34,7 @@
<DebugType>full</DebugType>
<NoWarn>1699,219,414,649,619</NoWarn>
<Optimize>false</Optimize>
<DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT</DefineConstants>
<DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;MONO_FEATURE_APPLETLS;MONO_FEATURE_BTLS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -42,7 +42,7 @@
<DebugType>pdbonly</DebugType>
<NoWarn>1699,219,414,649,619</NoWarn>
<Optimize>true</Optimize>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT</DefineConstants>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;MONO_FEATURE_APPLETLS;MONO_FEATURE_BTLS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -54,6 +54,8 @@
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Interop.Odbc.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Linux\Interop.Libraries.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs" />
@@ -327,13 +329,10 @@
<Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Xml\XmlDataImplementation.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Xml\XPathNodePointer.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\Common\System\Data\Common\DBConnectionString.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\Common\System\Data\Common\ExternDll.Linux.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\Common\System\Data\Common\NameValuePermission.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\Common\System\Data\Common\SafeNativeMethods.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\Common\System\Data\Common\UnsafeNativeMethods.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\Common\System\Data\ProviderBase\DbBuffer.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\Common\System\HResults.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\Properties\SecurityTransparent.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\System\Data\Odbc\DbDataRecord.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\System\Data\Odbc\Odbc32.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.Odbc\src\System\Data\Odbc\OdbcCommand.cs" />
@@ -409,7 +408,9 @@
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\ProviderBase\DbReferenceCollection.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\ProviderBase\TimeoutTimer.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\Sql\SqlMetaData.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\Sql\SqlNorm.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\Sql\SqlNotificationRequest.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\Sql\SqlSer.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\ApplicationIntent.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\LocalDBAPI.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\LocalDBAPI.Unix.cs" />
@@ -469,8 +470,8 @@
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlInfoMessageEventHandler.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlInternalConnection.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlInternalConnectionTds.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\sqlinternaltransaction.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\sqlmetadatafactory.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlInternalTransaction.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlMetadataFactory_.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlNotificationEventArgs.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlNotificationInfo.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlNotificationSource.cs" />
@@ -489,6 +490,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlStatistics.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlStream.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlTransaction.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlUdtInfo.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlUtil.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\TdsEnums.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\TdsParameterSetter.cs" />
@@ -539,7 +541,6 @@
<Compile Include="..\referencesource\System.Data\System\Data\SqlClient\SqlClientPermission.cs" />
<Compile Include="..\referencesource\System.Data\System\Data\SQLTypes\SqlTypesSchemaImporter.cs" />
<Compile Include="Assembly\AssemblyInfo.cs" />
<Compile Include="corefx\DbConnection.cs" />
<Compile Include="corefx\DbConnectionOptions.cs" />
<Compile Include="corefx\DiagnosticListener.cs" />
<Compile Include="corefx\Odbc\AdapterUtil.cs" />
@@ -553,8 +554,6 @@
<Compile Include="corefx\SqlConnectionStringBuilder.cs" />
<Compile Include="corefx\SqlDependencyUtils.cs" />
<Compile Include="corefx\SqlException.cs" />
<Compile Include="corefx\SqlMetaData.cs" />
<Compile Include="corefx\SqlParameter.cs" />
<Compile Include="corefx\SqlParameterCollection.cs" />
<Compile Include="corefx\SR.cs" />
<Compile Include="corefx\TdsEnums.cs" />
@@ -196,9 +196,6 @@ namespace System.Data.SqlClient
internal void OnReturnStatus(int status)
=> throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
internal void OnReturnValue(SqlReturnValue rec)
=> throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
internal void OnReturnValue(SqlReturnValue rec, TdsParserStateObject stateObj)
=> throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
Loaded 100 of 738 files, more files were not shown because too many files have changed in this diff. Show more