Compare commits

...
215 Commits
Author SHA1 Message Date
Ryan Lucia 476d72b9e3 [IO] Remove read-only logic in mono_w32_get_disk_free_space
This brings us in line with GetDiskFreeSpaceExW on Windows as well as .NET Core.
2019-10-15 10:43:27 +02:00
Aleksey Kliger (λgeek) bdc557612b [2019-06][merp] Don't install SIGTERM handler in EnableMicrosoftTelemetry (#17296)
* [merp] Put thread into async context before running summarizer

[merp] Put thread into async context before running summarizer

Followup work for https://github.com/mono/mono/pull/17090

In order to get managed method info for unmanaged stacktraces, we call
`mini_jit_info_table_find_ext` which calls `decode_exception_debug_info` which may
allocate if it's not in async context.

Do the switch in `mono_threads_summarize_execute` so that non-supervising threads
all switch when they run the `sigterm_signal_handler`.  `mono_threads_summarize`
already does it for the supervisor thread.

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

Backport of #17194.

/cc @lambdageek

* [merp] Don't call install_state_summarizer in EnableMicrosoftTelemetry

install_state_summarizer installs a SIGTERM handler. Unfortunately
sigterm_signal_handler assumes that it will only be called when a crash is
already in progress (it assumes it won't be the supervisor, and so it doesn't
setup the memory for capturing a crash report among other things).

* [merp] Register SIGTERM handler in dump_native_stacktrace

Previously it was installed by EnableMicrosoftTelemetry, which is too early.
Now we get here without a handler installed even when mono_merp_enabled returns true.
2019-10-14 17:24:44 +02:00
Alexander Köplinger 1e2d850ec4 [tests] Bump corefx to get Azure testhost change (#17275)
* Bump corefx to get Azure testhost change

See https://github.com/mono/corefx/pull/360

* Update ClientWebSocketTest as well

(cherry picked from commit d457346e06)

# Conflicts:
#	external/corefx
2019-10-11 09:41:33 +02:00
Alexander Köplinger 703e9a2fad [2019-06] Add drawing type converters to mobile profiles (#17241)
* [2019-06] Add drawing type converters to mobile profiles

Needed for https://github.com/xamarin/xamarin-android/issues/3726

* Bump API snapshot submodule

* [csproj] Update project files
2019-10-09 12:16:23 +02:00
Thays Grazia 4ec605fc9b If there is a perform_wait_callback in the stack there will be another catch generated by the method called in the owner thread, so we don't need to throw as unhandled exception, we can continue and find the next catch.
Fixes #17083

Backport of #17106.
2019-10-09 09:07:21 +02:00
monojenkins 061c225621 [merp] exit_status is 0 if we ran the uploader successfully (#17186)
Not 1 (TRUE)
2019-10-05 11:36:29 -04:00
Alexis Christoforides 07c23f2ca4 [crashing] Remove Mono signal handlers when starting to handle a crash
Fixes https://github.com/mono/mono/issues/16803

Backport of https://github.com/mono/mono/pull/17002
2019-10-02 09:35:59 +02:00
Egor Bogatov 5608fe0abb [2019-06] Update NETStandard 2.1 APIs (#17081)
Contributes to #17064
2019-09-27 17:42:14 +02:00
Steve Pfister a5b8d6fcb5 [2019-06] Fix time zone issue when jumping into DST (#17062)
There is an issue with jumping into DST for some time zones when the incorrect date-time offset is returned for date-time in UTC (which comes from DateTime.Now). The fix is to just check if the incoming date-time is in UTC

Also I added set of tests for some time zones but they verify jumping into DST in general.

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

Backport of https://github.com/mono/mono/pull/16430
2019-09-26 20:03:02 +02:00
Marek Safar 390e6e124f Revert "[metadata] Fix leaks when handling a few attributes (#16675) (#16851)"
This reverts commit a6b5187d76.
2019-09-26 18:49:35 +02:00
Alexander Köplinger 459dd927df [2019-06] Bump bockbuild to get https://github.com/mono/bockbuild/pull/121 2019-09-25 20:00:56 +02:00
Rolf Bjarne Kvinge beb9a1b182 [sdks] Remove the mac32 build.
Xamarin.Mac doesn't need nor use it anymore.

This also removes the last part of the mono archive that required Xcode 9.4.
2019-09-25 16:52:49 +02:00
Alexander Köplinger 747a919a06 [ci] Make ios/mac sdks archive URL more predictable
Requested by xamarin-macios team.

(cherry picked from commit 0a3c9c451b)
2019-09-24 15:26:55 +02:00
Alexander Köplinger 114013096e [ci] Build iOS/Mac Mono sdks archive using Xcode 11
This was requested by the xamarin-macios team.

(cherry picked from commit 6ad929c317)
2019-09-23 17:37:21 +02:00
EgorBo 10a24f3ea1 Implement WriteCore and ReadCore in DeflateStream 2019-09-23 16:48:16 +02:00
Rolf Bjarne Kvinge a925846b1f [offsets-tool] Install clang into the user-specific python directory. (#16933)
Because the system location isn't world writeable on Catalina.
2019-09-19 17:43:35 +02:00
Larry Ewing fe64a4765e [2019-06] Bump msbuild and sdk versions to 3.0.1xx latest (#16870)
* [2019-06] Bump msbuild and sdk versions to 3.0.1xx latest

* Bump msbuild again to pull in the build updates

* pull in roslyn-binaries fix

* One more bump

* Fix the roslyn hash

* [msbuild] Bump to pick up a build fix from https://github.com/mono/msbuild/pull/138

* Pull in final update from msbuild of nuget and sdk
NuGet 5.3.0-rtm.6251
Sdk 3.0.100-rc2.19467.3

* Pick up packaging fix in https://github.com/mono/msbuild/pull/141
2019-09-18 19:13:51 +02:00
monojenkins 7293597b90 [corlib] Fix building nunit-lite twice (#16910)
We sometimes saw the following build error in Mono SDKs builds on Jenkins:

```
[2019-09-16T01:03:30.709Z] CSC     [xammac] nunit-lite-console.exe
[2019-09-16T01:03:30.709Z] error CS0009: Metadata file '/Users/builder/jenkins/workspace/archive-mono/2019-08/mac/release/mcs/class/lib/xammac/nunitlite.dll' could not be opened -- PE image doesn't contain managed metadata.
```

Taking a closer look we found out that nunit-lite was trying to be built twice for the same profile which caused a race where the file was corrupted.

The reason for this is that the corlib Makefile defines two test assemblies: the normal PROFILE_corlib_test.dll and BinarySerializationOverVersionsTest.dll and
integrating the BinarySerializationOverVersionsTest.dll via the `test-vts` target incorrectly overwrote the `test` target instead of using `test-local`.

Backport of #16894.
2019-09-18 13:39:36 +02:00
Rolf Bjarne Kvinge 1648e88687 Rename bundle identifier for the various Mono.frameworks we create for Xamarin.iOS. Fixes xamarin/xamarin-macios#7005. (#16896)
This is the equivalent of
https://github.com/xamarin/xamarin-macios/commit/a9abc07cb357f9f012e3da66c70fa09d96bf02f7,
just for the Mono.frameworks in the mono archive.

Fixes https://github.com/xamarin/xamarin-macios/issues/7005.
2019-09-17 21:16:29 +02:00
Vlad Brezae a6b5187d76 [metadata] Fix leaks when handling a few attributes (#16675) (#16851)
Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.
2019-09-16 14:16:01 +03:00
Steve Pfister 7da9a041b3 [2019-06] Bump to mono/corefx@e79cf5b
Backport of https://github.com/mono/mono/pull/16774
2019-09-12 09:08:26 +02:00
monojenkins 2b7050bdf3 [2019-06] Add RenamedEvent* to FSW sources from CoreFX (#16758)
Add RenamedEvent* to FSW sources from CoreFX

Fixes #16486 - This was only partially fixed until now

* [csproj] Update project files

* Add test files which test these code paths on corefx
2019-09-11 12:29:51 -04:00
Larry Ewing 4f5ed502c6 [msbuild] pick up p4 versions 2019-09-10 09:35:15 +02:00
Larry Ewing f04ee2219d [2019-06][msbuid][roslyn] Bump msbuild and roslyn-binaries to pick up dotnet 3.0.100-p9 toolset 2019-09-10 09:35:15 +02:00
Thays Grazia 6b4b99e571 Vtable [i] can be null so this should be check before use it. Fixes #16712 2019-09-09 19:17:01 +02:00
monojenkins 7af64d1ebe [2019-06] [android] remove text relocations in AOT/arm32 (#16660)
* Revert "[aot] partial revert of #14043 (#14135)"

This reverts commit 223e0bd78d.

* Revert "[aot] change method table generation so that it works for larger assemblies on ARM (#14043)"

This reverts commit 9ff3b0d65e.
2019-09-04 15:31:19 -05:00
monojenkins 2c3aeaf378 [2019-06] [corlib] Add hack for Hebrew calendar data (#16642) 2019-09-03 14:09:37 -04:00
monojenkins 3216a3c1e3 [2019-06] Bump ikvm to pick up caa8e7f54279a47422626005d228447f5d3670d5. (#16575)
* Bump ikvm to pick up caa8e7f54279a47422626005d228447f5d3670d5.

* [monodis] Add a missing cattr parent case.

Backport of #16567.
2019-08-30 12:30:03 +02:00
Alexander Köplinger 7ef99c046c Build pkg-config as 64bit only, libtiff as universal and remove gtk-quartz-engine.py (#16548)
See https://github.com/mono/bockbuild/pull/116

(cherry picked from commit 309cf1bcee)

# Conflicts:
#	external/bockbuild
2019-08-29 20:37:00 +02:00
monojenkins 1604b9df9d [2019-06] Use the right FileSystemWatcher sources (#16555)
* Use the right FileSystemWatcher sources

The corefx code for FileSystemEventArgs has some changes to support
constructing one with a null filename.

Fixes #16486

* Remove the mono sources for the newly replaced files

* [csproj] Update project files
2019-08-29 14:35:35 +02:00
monojenkins fd75f0f487 [2019-06] Implement Read and WriteAsyncMemory in Mono DeflateStream
Resolves https://github.com/mono/mono/issues/16122

Since we put in the corefx version of GZipStream, it is expected that
our version of DeflateStream actually implements Write+ReadAsyncMemory.

This change does that by just calling the plain WriteAsync & ReadAsync
methods until we decide (or not) to pull in the corefx DeflateStream.

Backport of https://github.com/mono/mono/pull/16523.
2019-08-29 08:33:44 -04:00
Steve Pfister 99c1602fcd Allow file:// based Uri's to be used in HttpClient when the BaseAddress is set
Fixes https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/967582

Bumps the HttpClient part in mono/corefx at: https://github.com/mono/corefx/commit/ee3acec16b37bec5016da129e1e3840097ca629b

The test that would have caught this failure was disabled previously via:
https://github.com/mono/mono/commit/2f411750acfd2132f9b4970ef8cf11d9a0f62df9

(cherry picked from commit 580defd967)
2019-08-27 20:04:13 +02:00
Alexander Köplinger 16c2464e24 [acceptance-tests] Bump roslyn test repo to remove a problematic nuget feed
(cherry picked from commit 8d422436f5)
2019-08-27 19:48:42 +02:00
monojenkins 5ecff82230 [2019-06] [w32socket] Translate some errno codes to WSA_ errors imprecisely. (#16489)
* [w32socket] Translate some errno codes to WSA_ errors imprecisely.

These aren't a perfect match, but better than falling into the `default` case
where Mono asserts and crashes.

Addresses part of https://github.com/mono/mono/issues/16024

* [w32error] Add WSA_INVALID_PARAMETER and WSA_INVALID_HANDLE

Backport of #16331.
2019-08-27 01:31:53 +02:00
monojenkins 8966e775a5 [utils] Don't use MAP_32BIT on Apple platforms, fixes crash with XCode 11 beta6 (#16481)
As of XCode 11 beta6 the MacOSX SDK defines the MAP_32BIT symbol.

This causes the `mono_valloc()` function to try to use the `MAP_32BIT` flag for `mmap()`.

However as mentioned in the comment for the symbol in mman.h it seems to require a special entitlement which isn't available/documented anywhere yet.
This in turn causes the mmap call to fail presumably because we're missing that entitlement.

Instead we now skip setting this flag on Apple platforms to make `mmap()` behave like it did before.

Backport of https://github.com/mono/mono/pull/16441
2019-08-26 23:07:37 +02:00
Larry Ewing 3608a49541 [2019-06][msbuild] bump msbuild to pick up latest p9 versions and enable shared compilation again (#16445)
* [2019-06] bump msbuild to stop disabling shared compilation

* Pull in nuget update for preview 9
2019-08-24 09:51:03 +02:00
Ankit Jain 049d9ecb3c [msbuild] Bump to track mono-2019-06 (#16428)
* Bump msbuild to track mono-2019-06

.. to get changes from https://github.com/mono/msbuild/pull/130
which tracks dotnet `release/3.0.100-preview9`.

Also, bump Roslyn to 3.3.1-beta3-19421-04 .

* Bump the roslyn reference
2019-08-23 22:15:13 +02:00
monojenkins 66d623d118 Fix issue in SafeHandle.DangerousReleaseInternal() that caused #16034. (#16424)
Using the CoreCLR version of this line fixed the problem and my investigations
also revealed why.

The `SafePipeHandle` contains a reference to both the Socket as well as the
`SafeSocketHandle`, taking ownership of them.  If there are no additional
references to either of them, so that both are collected in the same GC pass,
their finalizer may be invoked in any order.

If the Socket gets finalized first, it's `SafeSocketHandle` will have a `_mstate`
of 8 (two references) at the beginning of `DangerousReleaseInternal()` - which
will set it to 6 (one reference plus disposed flag).

Then when the `SafePipeHandle` gets collected, it will call `DangerousRelease ()`
on it's `SafeSocketHandle`.  As mentioned above, it's `_mstate` will be 6.
Now we own the handle, so we'll decrease it's reference count by one and set the
`Closed` flag - the new `_mstate` should thus be 3.

However, using

    new_state = (old_state & RefCount_Mask) - RefCount_One;

would set it to 1 - thus effectively clearing the `Disposed' flag.  And since it's
reference count is now also zero, the next finalize pass will then throw.

The CoreCLR version of this class uses

    new_state = old_state - RefCount_One;

which fixes this.

Backport of #16244.
2019-08-23 15:34:57 +02:00
Alexander Köplinger 3e76198aa4 Bump corefx to get https://github.com/mono/corefx/pull/336 2019-08-23 14:44:43 +02:00
Steve Pfister fb26dfd84f [2019-06] Add Compiler Server Workaround for 32-bit Linux (#16422)
Currently, if the process is 32-bit, roslyn tries to determine how much
memory is available. To do that, it tries to pinvoke into GlobalMemoryStatusEx,
which is not supported on mono.

Without it, the compiler server bombs on https://github.com/dotnet/roslyn/blob/0e63260c5afb3fb5b74c357dd250e500172bcd63/src/Compilers/Server/VBCSCompiler/NamedPipeClientConnection.cs#L55-L5

Backport of https://github.com/mono/mono/pull/16405
2019-08-23 12:08:30 +02:00
monojenkins 6434153d8b [android] mono_dl_open_file: use g_file_test only on absolute paths (#16392)
The intention of calling `g_file_test (file, G_FILE_TEST_EXISTS)` where file is
the name of a shared library we want to open is to speed up probing for
non-existent libraries.

See https://github.com/mono/mono/pull/12074

The problem is that if file is just a simple "libdl.so" then `dlopen (file)`
doesn't just look for it in the current working directory, it will probe some
other paths too.  (For example on desktop linux you'd also look in all the
directories in LD_LIBRARY_PATH).  So the g_file_test() call is not a robust way
to avoid calling dlopen if the filename is relative.

But it actually broke more things: https://github.com/xamarin/xamarin-android/issues/3388

When probing for "libdl.so" on Android mono_lookup_pinvoke_call will first try
prepending some paths that it knows about and we end up calling
`dlopen ("/system/lib/libdl.so")` which will fail because Bionic has security
restrictions on what code can dlopen something from /system/lib with an
absolute path.  Eventually mono_lookup_pinvoke_call will go back to trying the
bare "libdl.so" which hits `g_file_test` and returns NULL.

The new code only does the file test if we pass it an absolute path, which
gives Bionic's dlopen a chance to deal with relative paths however it needs to.
2019-08-22 13:36:13 -04:00
Alexander Köplinger cc0632e4f3 Bump corefx to get https://github.com/mono/corefx/pull/332 2019-08-20 20:52:51 +02:00
monojenkins ff5e4b074f [2019-06] Add missing Dispose() call on error in MonoTlsStream.CreateStream(). (#16327)
* Add missing `Dispose()` call on error in `MonoTlsStream.CreateStream()`.

* Remove the `finally` block to make it more easy to read.

Backport of #16233.
2019-08-20 19:45:59 +02:00
Alexander Köplinger 45c7df08f4 [pkg] Bump bockbuild to get gtksharp bump (#16346) 2019-08-20 11:51:03 +02:00
monojenkins e6d44f7ce4 [2019-06] [corlib] Fix sharing mode validation rules (#16280)
Fixes https://github.com/mono/mono/issues/16032

When we switched to corefx File.Copy on unix, the behavior changed where it opened a source and destination stream in order to pass the safe handles to Interop.Sys.CopyFile. This exposed a flaw in our sharing validation rules in MonoIO.Open, which threw an exception in this scenario:

new FileStream("source.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite, 2048, FileOptions.DeleteOnClose);
new FileStream("source.txt", FileMode.Open, FileAccess.Read, FileShare.Read, 2048, FileOptions.None);

Simplified the FileShare check down to:

1. If the caller specifies FileShare.None, then it's an exclusive lock and no
   sharing is allowed.

2. If the caller specifies some other FileShare option, then FileShare.None
    cannot be specified.
2019-08-16 10:23:09 -04:00
monojenkins 4a85530472 (mono.1) Update the MONO_THREADS_SUSPEND description (#16238) 2019-08-14 19:24:21 +02:00
monojenkins 6c97670c23 [sre] Outline typebuilder_setup_fields loop body (#16203)
The loop body uses coop handles, so wrap it in HANDLE_FUNCTION_ENTER/HANDLE_FUNCTION_RETURN

Addresses part of #16179

Backport of #16184.
2019-08-14 12:32:00 +02:00
Alexander Köplinger 4988ad56ad [pkg] Bump libgdiplus to 6.0.2
(cherry picked from commit b60aaea791)
2019-08-13 12:13:48 +02:00
Sebastien Pouliot 4365dce8b7 [2019-06][sdk] Enable the SRE runtime code inside iOS builds
This will allow the interpreter to use System.Reflection.Emit.

Note: There is a small size increase (about 50kb) for an application
built in release mode with the LLVM backend (even if the interpreter
is now used).

Backport of https://github.com/mono/mono/pull/16151
2019-08-12 21:43:22 +02:00
Alexander Köplinger a7919897e8 Bump corefx to fix build break 2019-08-10 23:47:19 +02:00
Alexander Köplinger 9e02c677aa Bump corefx to get https://github.com/mono/corefx/pull/327 2019-08-10 16:20:04 +02:00
Alexander Köplinger 3c1ee41b12 Bump corefx to get https://github.com/mono/corefx/pull/323 2019-08-09 16:17:39 +02:00
monojenkins 63d98369c6 [2019-06] Fixed RuntimeType.GetConstructorCandidates("") to return 0 elements. (#16108)
* Fixed RuntimeType.GetConstructorCandidates("") to return 0 elements.

https://github.com/mono/mono/issues/16010

The current behavior for GetConstructorCandidates when the name is null, "",
or "*" is to return the set of constructors for the type. For "", .NET Core and
.NET Framework return 0 elements.  This PR adds a check for "" to match that
behavior.

* Removed unncessary changes

* Unnecessary spaces

* Made the if check a bit more readable
2019-08-09 11:56:56 +02:00
Alexis Christoforides 893099f23f [2019-06] [System] Guard against attempting to creating out-of-range spans in m… (#16123)
* [System] Guard against attempting to creating out-of-range spans in macOS FileSystemWatcher

Backport of #16049
2019-08-09 00:38:29 +02:00
Ankit Jain 5d9caa2373 [msbuild] Bump to track mono-2019-06 and update roslyn (#16095)
Prompted by mono/msbuild#123 :

This includes:

Update to upstream vs16.3 branch
SDK update to track dotnet release/3.0.100-preview8
Roslyn updated to 3.3.0-beta2-19381-14

* Work around remoting1.exe test issue with new Roslyn
2019-08-08 20:07:00 +02:00
Larry Ewing 8c035c2144 Pull in the unbroken msbuild 2019-08-07 22:53:27 -05:00
Larry Ewing 3683f7d2b8 Bump msbuild cd5b32d36ad51cb5c21621bb5cfe6a7452214eaa to disable compiler server 2019-08-07 11:34:20 -05:00
monojenkins 91adcb5cd1 [2019-06] [arm] respect I1 and I2 on gsharedvt out transition (#16017)
* [arm] respect I1 and I2 on gsharedvt out transition

In order to trigger the problem, we must call into gsharedvt code ("in" transition) and then escape the gsharedvt world ("out" transition). The bug happens in the latter. Also some other stars need to align (I haven't fully understood it), thus the repro is quite long.

The provided repro only triggers with LLVM, which we don't have enabled on CI yet: https://github.com/mono/mono/issues/15999

Fixes https://github.com/mono/mono/issues/15261
Fixes https://github.com/mono/mono/issues/15262
Fixes https://github.com/mono/mono/issues/15263
Fixes https://github.com/mono/mono/issues/15307


Backport of #16000.
2019-08-07 13:28:18 +02:00
Thays Grazia b454f5a9d0 allow emitting DIM 2019-08-07 09:25:31 +02:00
Aleksey Kliger df37100e76 [w32socket] Translate ELOOP and ENAMETOOLONG
Translate to WSAELOOP and WSAENAMETOOLONG, respectively.

See https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2
2019-08-07 09:23:10 +02:00
Egor Bogatov 7581fffa8a Forgot to check IsInvalid state 2019-08-06 19:29:54 +02:00
monojenkins d53c952790 [corlib] Ignore TimeZoneTest.TestCtors on Android GMT (#16038)
TimeZone.CurrentTimeZone.DaylightName returns an empty value on Android
when the system timezone is set to GMT.

Backport of #15987.
2019-08-06 14:03:00 +02:00
monojenkins 6fbdb372b8 [2019-06] Add finalizer to DeflateStream (#16008)
Fixes #15825

Backport of #15879.
2019-08-05 13:21:53 +02:00
Jo Shields 47a3d9204d Bump libgdiplus to new release (#15996)
(cherry picked from commit 9a7b6fd5ee)
2019-08-03 00:50:36 +02:00
monojenkins 5dc37d7ee6 [2019-06] [marshal] Free delegates with target that are passed to native code. (#15966)
* [marshal] Always use gchandles in delegate_hash_table

Makes the code easier to follow and it also fixes race from https://github.com/mono/mono/commit/caa4a753ca8e15d43baaa01adb0f56f374b74a2b with boehm.

* [marshal] Free delegates with target that are passed to native code.

For static method delegates, we have a unique delegate_trampoline that is shared among all delegates. We always keep alive the first static method delegate passed to native, by creating a normal gchandle to it and storing it in delegate_hash_table. For instance methods, each delegate will create a separate wrapper and these wrappers are never shared (which was wrongly assumed in https://github.com/mono/mono/commit/caa4a753ca8e15d43baaa01adb0f56f374b74a2b). We shuldn't keep the delegate alive and this commit reverts the behavior for delegate with instance methods introduced in the mentioned commit.

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

Backport of #15935.
2019-08-01 20:39:33 +02:00
monojenkins 8b837cb9ca [2019-06] Bump corefx (#15962)
This PR brings changes from mono/corefx#313.
Fixes #15887.

Backport of #15932.
2019-08-01 18:39:40 +02:00
monojenkins 84bc821cdc Fix Socket.ConnectAsync(SocketAsyncEventArgs) behavior. (#15949)
We need to clearly distinguish between synchronous and asynchronous completions
and avoid any ambiguities and race conditions when it comes to error handling.

On synchronous completion, we must not invoke the async completion delegate.

In `System.Net.Sockets/Socket.cs`, the internal `BeginSConnect()` and `BeginMConnect()`
now return a `bool` indicating whether or not an async operation is pending.

If any error happens prior to starting the async operation, then we shall call
`SocketAsyncResult.Complete(..., true)` and return `false`.  And since this is
a synchronous completion, it's `AsyncCallback` will not be invoked.

In `referencesource/System/net/System/Net/Sockets/_MultipleConnectAsync.cs`,
I compared the entire file against the CoreFX version and then copied the
`AttemptConnection()` method from their implementation to adapt their behavior.

The difference is that on synchronous completion, the `InternalConnectCallback(null, args)`
should be invoked.

Backport of #15947.
2019-08-01 12:33:37 +02:00
monojenkins f93add7b16 [threads] Enter GC Unsafe before pumping HP queue in unregister_thread (#15940)
[2019-06] [threads] Enter GC Unsafe before pumping HP queue in unregister_thread

If the thread info TLS key dtor runs `unregister_thread` from a foreign thread and we have work in the hazard pointer queue, we need to first switch to GC Unsafe mode because some of the free methods passed to `mono_thread_hazardous_try_free` need to be coop-aware.

Also, added checked mode assertions that `conc_table_free` and `jit_info_table_free` are called from GC Unsafe mode.

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


Backport of #15890.

/cc @lambdageek
2019-08-01 02:35:52 -04:00
monojenkins a5e772c4a1 [2019-06] [sdks] remove 32bit llvm (#15924)
* [sdks] remove 32bit llvm

* remove MonoAotOffsetsDumper leftover

* fix typo
2019-07-31 11:27:33 +02:00
monojenkins 0c44ef150f HANDLE_FUNCTION_RETURN_VAL parameter should not use handles in the current frame. (#15880)
Backport of #15873.
2019-07-30 21:05:36 +02:00
Alexander Köplinger 9df9494bcf [sdks] Disable WASM build on 2019-06 2019-07-30 21:02:35 +02:00
Alexander Köplinger 216d2b2724 [sdks] Make sure python3-pip is installed for Linux Android builds
(cherry picked from commit ee636ee8d9)
2019-07-30 20:46:29 +02:00
Bernhard Urban 17ac7dcfc7 [android] switch to python offset tool (#15848)
Backport of #15834

Warning: Disables WebAssembly build on `2019-06`.
2019-07-29 14:55:21 +02:00
Ankit Jain cec37277df Update nuget.exe to 5.2.0, matching msbuild (#15851)
This is a bit delayed as the 5.2.0 `nuget.exe` wasn't available earlier.
2019-07-27 02:18:49 +02:00
Ankit Jain 1b250ede0a [msbuild] Bump to track HEAD of mono-2019-06
.. to pick up update to track upstream `vs16.3`.
https://github.com/mono/msbuild/pull/118
2019-07-26 18:32:55 -05:00
Ankit Jain 844d5d7c91 Bump msbuild to track mono-2019-06 2019-07-26 18:32:55 -05:00
monojenkins c16ec8c31a Fix http framework module that errors using SDK 2.1.801 (#15854)
- 2.1.801 seems to have a problem with:

```
						using (var uint8Buffer = Uint8Array.From(await request.Content.ReadAsByteArrayAsync ()))
```
2019-07-26 23:39:18 +02:00
Alexander Köplinger 761220d914 [sdks] Report xcode11 builds as a separate GitHub status 2019-07-25 23:45:15 +02:00
Alexander Köplinger f06da77a36 [sdks] Add special build job for building with Xcode 11 2019-07-25 17:13:23 +02:00
Alexander Köplinger c6949d7e3d Bump bockbuild to get pkg-config fix for https://github.com/mono/mono/issues/13804 2019-07-25 00:21:19 +02:00
Vlad Brezae 0cd93e984c [sre] Make creation of dynamic method synchronized (#15814)
[2019-06][sre] Make creation of dynamic method synchronized

Before, reflection_create_dynamic_method could end up being called by two threads simultaneously. At the end of the method the ilgen field of the MonoReflectionDynamicMethod object is cleared, to enable its collection since it is no longer needed. The problem with this is that it can confuse the other thread compiling the dynamic method, making it see that there is no body.

We could either bother making this clearing work with multiple threads (and I'm not 100% convinced that the rest of the code is thread safe), disable the clearing of ilgen (which would make us use more memory) or go with the simple approach of locking on this DynamicMethod so only one thread is compiling it at one time.

Backport of https://github.com/mono/mono/pull/15803
2019-07-24 13:35:56 -04:00
monojenkins d8286ce40b Bump mono/corefx@eb5ba09 (#15813)
Backport of #15799.
2019-07-24 17:30:52 +02:00
Zoltan Varga 4b7a92e09a [runtime] Fix the error message for exceptions created from MonoError.
Fixes https://github.com/mono/mono/issues/15692.
2019-07-23 19:08:44 +02:00
monojenkins 31bf75ed23 [2019-06] Fix ambiguous time at the end of DST period on Windo… (#15785)
As an addition to #15401 it should resolve XA-related issue.

Fixes #9664

Backport of #15548.
2019-07-23 11:15:04 +02:00
Alexander Köplinger 4f29e313aa Add more tests to tarball with EXTRA_DIST
(cherry picked from commit f497893a84)
2019-07-22 15:23:26 +02:00
Bernhard Urban afcf28a366 [2019-06][ios] Switch to python offset tool (#15756)
The C# version doesn't work on 64bit. It would require to update its dependencies, but Zoltan already added a Python version for WebAssembly which works fine.

Some notes:
* changed the semantics of `--xcode-path` in order to match the output of `xcode-select -p`
* switched to python3/pip3
* removed hack for arm64_32, it works properly now because the Python version uses stock `clang`
* removed some leftover usages of `XCODE32_DIR`.

Manually verified by comparing output with the C# version.

This will unblock the iOS team when building on Catalina/Xcode11, as they can't consume SDK archives there. See xamarin/xamarin-macios#6603 (comment)

Contributes to #9621
 master (#15744)
2019-07-19 23:14:17 +02:00
Alexander Köplinger 5bd33de631 [ci] Clean working directory after build in package and sdks build
(cherry picked from commit d159a38c47)
2019-07-19 23:02:19 +02:00
Alexander Köplinger a375e6a090 [packaging] Don't use dl.xamarin.com for gtksharp package anymore
(cherry picked from commit 6407d27000)
2019-07-19 23:02:09 +02:00
Alexander Köplinger 4db3b960c0 [sdks] Calculate sha1 of sdks archive and upload it
This was requested by the XA team.

(cherry picked from commit 49ed255707)
2019-07-19 20:06:31 +02:00
Alexander Köplinger ad226f5d37 [ci] Don't require master node for reportGitHubStatus method
In some jobs we use throttle() logic which would mean only one job can execute on master, blocking other jobs in the meantime.

We don't really care which node executes this so let Jenkins pick one.

(cherry picked from commit 7784f20a26)
2019-07-19 14:50:37 +02:00
Alexander Köplinger aef3c4c16b [sdks] Add linker sources to Android linux archive
(cherry picked from commit a02f3aaf4b)
2019-07-19 11:38:01 +02:00
monojenkins a2bcc639e1 [2019-06] [sdks] Add third party notices to sdks archives (#15755)
It takes all THIRD-PARTY-NOTICES.TXT and LICENSE files from the repo.
2019-07-19 11:09:57 +02:00
Bijan Tabatabai c636636084 Align mcs's tuple deconstruction behavior with csc
Before the code
(a, b) = (b, a);
was the equivalent of
a = b;
b = a;

now, it evaluates it to so something like
tmp1 = a;
tmp2 = b;
a = tmp2;
b = tmp1;

Signed-off-by: Bijan Tabatabai <[email protected]>
2019-07-19 05:01:11 -04:00
monojenkins 1c919ea11c [2019-06] Print two bytes at a time in mono_pe_file_map conversion error (#15726)
* Print two bytes at a time

* Iterate over gunichar2
2019-07-18 14:48:10 -07:00
monojenkins 4b15f9b3ee [mini] Runtime check if boxing is needed for DIM constrained calls (#15730)
This is to handle the following example.  The issue is that in Check() we have
a constrained call where the called method is IAdder`1<!!U>::PlusPlus() which
is a default interface method, and we need to determine at runtime whether to
box the this argument.

```
using System;

public interface IAdder<T> {
	int Add (int x);

	int PlusPlus () {
		return Add (1);
	}
}

interface IGen3<T> { }

struct Adder<T> : IAdder<IGen3<T>> {
	int _field;
	public int Add (int x) {
		_field = x + _field;
		return _field;
	}
}

public class P {
	public static int Check<T, U>(T t) where T : IAdder<U> {
		return t.PlusPlus () + t.PlusPlus ();
	}

	public static void Main () {
		var x = new Adder<object> ();
		int y = Check<Adder<object>, IGen3<object>> (x);
		Console.WriteLine ("expect 2, got {0}", y);
	}
}
```
2019-07-18 16:31:49 -04:00
Larry Ewing 17520a8622 Bump msbuild to msbuild:mono-2019-06 to stop disabling compiler server 2019-07-17 16:47:23 -04:00
monojenkins 048d95d86d Add com.apple.security.cs.allow-unsigned-executable-memory exception to hardened runtime entitlements (#15725)
This avoids the issue from https://github.com/mono/mono/issues/13445 when hardened runtime is enabled.
2019-07-17 20:50:23 +02:00
monojenkins c63edc338b [2019-06] [bcl] Sync recent NS2.1 changes (#15719)
1) Copied changes from corefx for System.Data (also mono/corefx#310)
2) New Tracing api is left empty (because the current API is empty too)
3) New AES types throw PNSE

Bump netstandard.dll AssemblyVersion to 2.1 (fixes #13412)

Backport of #15696.
2019-07-17 14:31:43 +02:00
Alexander Köplinger 74e1f4cbf9 Revert "[ci] Remove separate utils.groovy file" and run step on master instead
This reverts commit d732cef5fc.

The github commit status setter step requires a node context so we now just use on on master instead.

(cherry picked from commit 0509ceccb6)
2019-07-17 14:27:05 +02:00
monojenkins a79115dd7f [2019-06] [bcl] Add Mono.Cecil.Mdb assembly to monodroid_tools… (#15718)
* [bcl] Add Mono.Cecil.Mdb assembly to monodroid_tools profile

Requested by the XA team.

* [csproj] Update project files
2019-07-17 12:44:53 +02:00
Alexander Köplinger d410e07d8b [ci] Remove separate utils.groovy file
For some reason when using a separate file and loading the function
from there Jenkins still requires us to have a node() context when
calling the function which is not what we want.
2019-07-17 10:57:09 +02:00
Alexander Köplinger 058d207f58 [ci] Wait for signing outside of a node() block
We don't need to block the machine just for waiting on signing to finish.

(cherry picked from commit 39472e06a3)
2019-07-17 01:02:55 +02:00
monojenkins a5b77554e4 [2019-06] [System] Keep events from firing from a disposed 'De… (#15706)
Fixes https://github.com/mono/mono/issues/8747

Also try to stop other implementations from dispatching events past Dispose(), without guaranteeing it
2019-07-16 21:45:40 +02:00
Alexander Köplinger ce68c20971 [ci] Bump timeout for .pkg signing job
In preparation for notarizing our .pkg with Apple we need to bump the timeout
since it can take up to an hour for Apple's server to return a result.

(cherry picked from commit 7480830b36)
2019-07-16 21:32:31 +02:00
Alexander Köplinger edc9e70e04 [sdks] Use Azul Zulu OpenJDK for Android Linux build, since Debian 10 has no Java 8 2019-07-15 23:24:20 +02:00
Alexander Köplinger ea8da188ef [sdks] Update android linux builds to Debian 10
This was suggested by XA folks to fix the weird mingw llvm issues we've been seeing.

(cherry picked from commit 4b6f49bb06)
2019-07-15 21:36:27 +02:00
monojenkins fe2a0a8810 [2019-06] [debugger] Don't list finalizer gc thread if it's not executing managed code (#15683)
* The example that reproduces the bug does this: var thread = vm.GetThreads()[0]; greetingValue = program.InvokeMethod(thread, greeting, new Value[0]) as StringMirror;

But sometimes the Thread[0] was the MainThread of the program and it works, and other times was the GC Finalizer, but when it tries to run something on GC Finalizer thread, the thread is not suspended and throws an exception.
In the fix I removed the Finalizer thread of the list that is returned when CMD_VM_ALL_THREADS is called.

Fix #13311

* The example that reproduces the bug does this: var thread = vm.GetThreads()[0]; greetingValue = program.InvokeMethod(thread, greeting, new Value[0]) as StringMirror;

But sometimes the Thread[0] was the MainThread of the program and it works, and other times was the GC Finalizer, but when it tries to run something on GC Finalizer thread, the thread is not suspended and throws an exception.
In the fix I removed the Finalizer thread if ti's not executing a managed code of the list that is returned when CMD_VM_ALL_THREADS is called.

Fix #13311

* Changing what was suggested by Aleksey.

* Removing unused attribute.
2019-07-15 17:14:15 +02:00
monojenkins 7fd5a4da49 [2019-06] Fix marshalling bugs for StringBuilder parameters (#15685)
Fixes #15366 and #15306.

- Fixes NULL termination of `StringBuilder` to UTF-16 marshalling. Additionally an extra NULL is added as defense-in-depth protection for incorrect handling in native calls. This extra NULL adds protection when trying to marshal the NULL-terminated string back and the native function doesn't null-terminate at the size of the buffer.
- Fixes marshalling back from UTF-16/UTF-8 buffers into chunked `StringBuilder`.
- Fixes missing `mono_marshal_free` call causing a memory leak when marshalling `StringBuilder` to UTF-16 and back.
- Skips marshalling back to `StringBuilder` when the parameter doesn't have `[Out]` attribute.

Unit tests are still TBD. Not sure where to put them and how to structure them. Any help would be appreciated. /cc @vargaz @EgorBo 

Backport of #15392.
2019-07-15 16:45:55 +02:00
monojenkins f688049114 [2019-06] [ios] Nil Check to Ensure Local TimeZone Id is Set F… (#15690) 2019-07-15 16:06:45 +02:00
Alexander Köplinger a56786e89e [System] Remove FileSystemWatcher tests from monotouch/xammac
They were already excluded from watch and tv but they don't work on any mobile Apple profile.
2019-07-15 15:16:09 +02:00
monojenkins 675c744a7e [2019-06] [ios] Ensure Local TimeZone Id is Set For TimeZoneIn… (#15670)
* Fixes https://github.com/mono/mono/issues/14839

The local timezone name was not known and defaulted to "Local".
This change adds an sdk function that returns the local name.

Backport of #15667.
2019-07-15 15:11:19 +02:00
Alexander Köplinger 5098258cce [ci] Upload mac-entitlements.plist to azure when uploading .pkg
So it can be used by the codesigning job.

(cherry picked from commit e3d5b23ff9)
2019-07-12 19:48:08 +02:00
Jo Shields 4ec4736af4 Add hardened runtime testing to Catalina lane (#15589)
* Permit DYLD mangling, so p/invokes work from non-system paths

* Add com.apple.security.cs.disable-library-validation

This is required for the .dylibs used in p/invokes to work.

* Use adhoc signing

(cherry picked from commit 202dca075b)
2019-07-12 19:48:08 +02:00
monojenkins 5debe32373 [2019-06] Fix offsets tool for Android NDK r20 (#15650)
Android NDK r20 contains a header file (`ioctl.h`) with this code:

    int ioctl(int __fd, int __request, ...);

    #if !defined(BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD)
    /* enable_if(1) just exists to break overloading ties. */
    int ioctl(int __fd, unsigned __request, ...) __overloadable __enable_if(1, "") __RENAME(ioctl);
    #endif

The `_RENAME` macro is defined as `__asm__(x)` and serves the purpose of
replacing an existing symbol with the new one, decorated with the keyword.
Unfortunately, Mono's `offsets-tool` doesn't parse the header properly as
`CppSharp` doesn't understand `__asm__`:

    Processing triple: armv7-none-linux-androideabi
    Error parsing '/Users/rodo/git/xa2/external/mono/mono/metadata/metadata-cross-helpers.c'
    /Users/rodo/android-toolchain/ndk/sysroot/usr/include/bits/ioctl.h(60,5): error: conflicting types for 'ioctl'
    Error parsing '/Users/rodo/git/xa2/external/mono/mono/mini/mini-cross-helpers.c'
    /Users/rodo/android-toolchain/ndk/sysroot/usr/include/bits/ioctl.h(60,5): error: conflicting types for 'ioctl'
    make: *** [/Users/rodo/git/xa2/external/mono/sdks/builds/android-cross-arm-release/armv7-linux-android.h] Error 1

The workaround, implemented in this commit, is to define the
`BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD` macro thus removing the "conflicting"
declaration from the picture, which changes nothing from the offset tool's point
of view and lets us process the headers in NDK r20 properly.
2019-07-11 20:39:42 +02:00
Alexander Köplinger 5898c9fd07 Bump bockbuild to fix gtk build break 2019-07-11 17:30:51 +02:00
Alexander Köplinger aed9c000ec Bump bockbuild to get https://github.com/mono/bockbuild/pull/105 2019-07-11 16:09:22 +02:00
monojenkins ba719acaa2 [2019-06] Add TypeForwards for FileSystemName & CryptographicOperations (#15657)
* Add TypeForwards for:

* System.IO.Enumeration.FileSystemName
* System.Security.Cryptography.CryptographicOperations

Since these were removed in NS 2.1

* Bump API snapshot submodule
2019-07-11 01:10:10 +02:00
Steve Pfister dfd02351f4 [2019-06] Bump mono/corefx@17dd540 (#15653) 2019-07-10 23:57:36 +02:00
monojenkins 4c710e041c [2019-06] [System]: Allow reading fully buffered `HttpWebRespo… (#15638)
[System]: Allow reading fully buffered `HttpWebResponse` body after close.

If we have already read the entire response body, then we should allow the
user to read it even after the request has been aborted.

* `WebConnectionStream.Read ()`: Move `Operation.ThrowIfClosedOrDisposed ()`
   call down after argument checks and call a new protected abstract method
   called `TryReadFromBufferedContent ()` prior to it.

* `WebResponseStream.TryReadFromBufferedContent ()`: Implement it here.
  If the entire response body has been buffered, then `bufferedEntireContent`
  is true and `innerStream is BufferedReadStream` and we can call the new
  `BufferedReadStream.TryReadFromBuffer ()`.

* `WebResponseStream.ReadAllAsync ()`: Set `bufferedEntireContent = true`
   after reading the entire response body.

* `BufferedReadStream.TryReadFromBuffer ()`: New internal method.

Fixes #10645.

Backport of #15220.
2019-07-10 10:45:12 +02:00
monojenkins d99e13bdea [2019-06] [llvm] avoid FP elimination on iOS/armv7 (#15621)
[2019-06] [llvm] avoid FP elimination on iOS/armv7

Instead of
```
push    {r4, r5, r6, r7, r10, r11, lr}
```

LLVM will generate
```
push    {r4, r5, r6, r7, lr}
add     r7, sp, #12
push    {r9, r10}
```

Seems like this https://github.com/mono/llvm/commit/a04e9e4a0af16f15ace258e81448b7eeca5ff599 assumes that `-disable-fp-elim` is passed for iOS targets. I wondered why this wouldn't break things for them, but when you run `clang` from Xcode with `-v`, you will discover that its driver passes `-mdisable-fp-elim`.

Together with https://github.com/mono/llvm/pull/48 this fixes crashes with FullAOT+LLVM on iOS 32bit.

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

Contributes to https://github.com/mono/mono/issues/9621



Backport of #15617.

/cc @lewurm
2019-07-09 17:25:44 -04:00
Alexander Köplinger c608cf3eaf Make RemoteExecutor a no-op on all mobile profiles (#15611)
Starting another Mono process for the remote executor doesn't work on any of them.

Helps with https://github.com/mono/mono/issues/15328

(cherry picked from commit b2ba8e62ca)
2019-07-09 11:45:35 +02:00
monojenkins 90d32a9d62 Crashes on running the boring.il test from coreclr, the problem was that using [System.Runtime]System.String the type was not understood as the primitive type string. Using ilasm from coreclr and running on mono it works, because of that I decided to fix on ilasm and not on runtime. (#15609)
Fixes #13923
2019-07-08 17:48:55 -03:00
Alexander Köplinger 329145ee73 [sdks] Fix android sdks job, take 2
It needs to work for both debug and release configs.

(cherry picked from commit 784449a077)
2019-07-08 19:35:09 +02:00
Alexander Köplinger a48723b842 [sdks] Fix android sdks job
It would try to execute the .stamp-android-loader-path target in unrelated configurations.

(cherry picked from commit 305b2e76e6)
2019-07-08 18:06:22 +02:00
Nikita Voronchev 08dd9882ce [2019-06] [System.Windows.Forms] Fix crash of DataGridView in in case of assigning a custom Column Header. (#15461)
This PR fixes the crash of DataGridView in case of assigning a custom Column Header.

Backport of #15135
2019-07-05 17:42:07 +02:00
monojenkins 16bf40461d [2019-06] [android] switch cross compilers host from 32bit to… (#15581)
Untested, but we need to do it anyway soon. This will help us to understand the situation on Xamarin.Android while finishing the work for Xamarin.iOS.

Contributes to https://github.com/mono/mono/issues/9621

Backport of https://github.com/mono/mono/issues/15553.
2019-07-05 17:41:08 +02:00
monojenkins 91f98eb2c8 [2019-06] [sdks] Use @loader_path for mono and libmonosgen (#15587)
* [sdks] Use @loader_path for mono and libmonosgen

This way we are able to dynamically load libmonosgen and also use host
mono binary.

The library dependencies look like this after the change:
```
otool -L /Users/rodo/git/mono/sdks/out/android-host-Darwin-release/bin/mono
/Users/rodo/git/mono/sdks/out/android-host-Darwin-release/bin/mono:
	@loader_path/libmonosgen-2.0.dylib (compatibility version 2.0.0, current version 2.0.0)
	...

otool -L /Users/rodo/git/mono/sdks/out/android-host-Darwin-release/lib/libmonosgen-2.0.dylib
/Users/rodo/git/mono/sdks/out/android-host-Darwin-release/lib/libmonosgen-2.0.dylib:
	@loader_path/libmonosgen-2.0.dylib (compatibility version 2.0.0, current version 2.0.0)
	...
```
2019-07-05 17:40:30 +02:00
Steve Pfister 2629c6d8f8 [2019-06] Bump mono/corefx@9354dfd (#15547) 2019-07-05 14:34:55 +02:00
Ankit Jain 972d548394 [2019-06] Bump msbuild to track mono-2019-06 (#15525)
* Bump msbuild to track mono-2019-06

* Bump nuget.exe to 5.1.0 to match what msbuild has.
2019-07-03 10:57:13 +02:00
Alexander Köplinger 39e8153c00 [2019-06] Bump corefx (#15519)
* [2019-06] Bump corefx

* Bump API snapshot submodule
2019-07-03 01:50:47 +02:00
monojenkins 0f75b36c0f [2019-06] [System.Net.Http]: Delete broken `Send_Transfer_Enco… (#15496)
This test was checking a broken Mono-specific behavior, which has been
removed after we switched to the new corefx-based handler. It also does
not make much sense to use a `Transfer-Encoding` header with a GET request.
2019-07-02 01:29:29 +02:00
Alexander Köplinger ffbba36f45 [2019-06] Bump bockbuild to bring in fix for mono/mono#14957 2019-07-02 00:32:12 +02:00
Thays Grazia 567964aff5 Fixes #13925. (#15489)
Backport https://github.com/mono/mono/pull/15433 to 2019-06.
2019-07-01 19:01:09 -03:00
Aleksey Kliger f55e0a671c [loader] remap only System.Threading.Tasks.Dataflow older than 4.0.0.0
Allow through requests for newer versions unchanged.
2019-07-01 17:20:56 +02:00
monojenkins 3702e62c7d [jit] Avoid calling mini_jit_info_table_find () in mini_add_method_trampoline () unless needed. (#15414) 2019-06-30 19:07:07 -04:00
monojenkins 41aad78a9d CreateNLSocket and CloseNLSocket should return gpointer (#15431)
In managed, these functions are used as `static external IntPtr`. This means that previously on arm64 the top bits of the return value were garbage. A comparison with 64-bit -1 like in LinuxNetworkChange.EnsureSocket would never be true, which was causing us to hit other assertions in the runtime.
Co-authored-by: Aleksey Kliger <[email protected]>
2019-06-30 15:06:13 -04:00
Aleksey Kliger fc63d85a38 [sdks] dynamically link libmonosgen to mono-sgen for monodroid host builds 2019-06-28 21:46:35 -05:00
Aleksey Kliger 605f7f04fc [runtime] Mark mono_file_map_error as MONO_API, always
Fixed the `--with-static_mono=no` build on non-Win32
2019-06-28 21:46:35 -05:00
Aleksey Kliger d8e2a049fc [configure] Cosmetic AC_MSG_WARN fix 2019-06-28 21:46:35 -05:00
monojenkins 9fd0d07cfb Correct env vars used for Android directory override (#15471)
This fixes https://github.com/mono/mono/pull/15453

The issue is the env var names differ vs. Xamarin.Android
2019-06-28 15:33:20 -04:00
monojenkins 8c50c1a047 [2019-06] Use /mnt/scratch for Android SDK, to match https://g… (#15468) 2019-06-28 19:23:35 +02:00
monojenkins 89867fd4ea [2019-06] Fix year+ old MIPS compile break. (#15460)
https://github.com/mono/mono/issues/15441
2019-06-28 11:29:50 +02:00
monojenkins 25a7d8c97c [2019-06] Fix time zone transition out of DST (#15445)
* Time zone DST out fix

* Add unit tests for Europe/Vatican, Iran and Europe/Guernsey time zones

* Disable the tests on WINAOT; fixed Iran time zone id
2019-06-27 20:48:40 +02:00
monojenkins dec365d6fd [sgen] Fix crashes in sgen due to xdomain refs (#15426)
CADMessages are passed directly between appdomains. When using contained data, we need to make sure we don't create any cross domain references.

When domains are unloaded, all threads executing code in that appdomain are aborted and the entire heap is traversed and objects in that appdomain are cleared. If any objects in other domains are directly referencing objects in the unloaded domain, they will reference junk. If any, cross domain refs should only be allowed when the referenced object is in the root domain which is never unloaded.
2019-06-27 12:37:19 +02:00
lateralusX 68d1fceba9 Fix race related to final event signaling in RegisteredWaitHandle.
We have seen sporadic failures in thread pool tests on CI related to
test case:

System.Threading.ThreadPools.Tests.ThreadPoolTests.QueueRegisterPositiveAndFlowTest [FAIL]
      Assert.Equal() Failure
      Expected: 0
      Actual:   1
      Stack Trace:
          at System.Threading.ThreadPools.Tests.ThreadPoolTests.QueueRegisterPositiveAndFlowTest () [0x00143] in D:\j\workspace\z3\label\w64\external\corefx\src\System.Threading.ThreadPool\tests\ThreadPoolTests.cs:337
          at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
          at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in D:\j\workspace\z3\label\w64\mcs\class\corlib\System.Reflection\RuntimeMethodInfo.cs:395

Finally managed to track down the issue to a race when using the same final
event in sequential calls to RegisterWaitForSingleObject. The event could, depending on
timing, get signaled multiple times for the same RegisterWaitHandle instance
causing a thread waiting for completion on another RegisterWaitHandle using same event
to be signaled before that callback was completed. That will cause the race seen in the
failing test above.

Fix make sure we only signal the final event one time per RegisterWaitHandle
instance.
2019-06-26 07:12:16 -05:00
monojenkins 9bfdc5c38b [2019-06] [jit] Fix interface cast (#15375)
* [jit] Throw exception if casting fails for special array interface

After the standard interface check (mini_emit_iface_cast), for special interfaces we need to do additional checks. We were skipping these checks if the object was not an array, without throwing a cast exception. This code path is reached for configurations where remoting is disabled.

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

* [tests] Add test for interface casting case

This test would have failed on fullaot lane for example.
2019-06-26 11:38:39 +02:00
Alexander Köplinger ce79aff5be [System] Fix monotouch_watch xunit tests build
Forgot to exclude one more file.

(cherry picked from commit 41767754d5)
2019-06-25 22:22:42 +02:00
monojenkins f481f794ce [2019-06] Exclude a few tests on monotouch_watch/xammac (#15409)
* [System.Core] Exclude AnonymousPipe tests on monotouch/xammac profiles

They should only be run on xammac_net_4_5.

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

* [System] Exclude WebClient and WebSocket tests on monotouch_watch

Fixes https://github.com/mono/mono/issues/15265.
2019-06-25 20:03:44 +02:00
Martin Baulig ed3321827e [test-helpers]Don't use named Mutexes on mobile. 2019-06-25 08:46:26 +02:00
Alexander Köplinger c5d9285ad3 [sdks] Do the WATCHOS5_VERSION -> WATCHOS64_32_VERSION rename in run-jenkins.sh too
It was missed in https://github.com/mono/mono/pull/15202
2019-06-24 19:14:14 +02:00
Bernhard Urban d707d745a6 [arm] set exception handling model to dwarf for iOS
We recently switched the AOT compiler for iOS armv7 from 32bit host to 64bit host. At the same time we _also_ switched from LLVM 3.6 to the newer LLVM 6.0 fork we support.

In a Xamarin.iOS Release build for iOS armv7 exception handling would crash. Specifically the problem was that the exception object wasn't properly injected into the handler block. The way it works is, that the exception handler machinery passes the pointer to the exception object via `r0`.

With the newer LLVM the generated code of the exception handling block
looks like this:
```
LBB1_15:                                @ %EH_CLAUSE0_BB3
Ltmp8:
	ldr	r0, [sp, #24]
	str	r0, [sp, #4]
	ldr	r0, [sp, #28]
	ldr	r0, [sp, #12]
	ldr	r0, [r0]
	cmp	r0, #0
	beq	LBB1_17
```
thus overwriting `r0`, so that the pointer to the exception object is lost.  With the older LLVM 3.6 the generated code looks like this:
```
LBB1_8:                                 @ %EH_CLAUSE0_BB3
Ltmp8:
	str	r0, [sp, #4]
	ldr	r0, [r6]
	cmp	r0, #0
	beq	LBB1_10
```
correctly storing the exception object into a stack slot for later usage.

After some time I figured out that there are _different_ exception handling models. Depending on the model, the exception pointer is passed in `r0` or not:
https://github.com/mono/llvm/blob/2bd2f1db1803f7b36687e5abf912c69baa848305/lib/Target/ARM/ARMISelLowering.cpp#L14416-L14428

`SjLj` stands for "SetJump / LongJump" and  means that exception handling is implemented with this. On iOS this is the default model that is used. We want `dwarf` instead, so we tell this `llc` now and the generated code handles it correctly.

So why was it working before? In our older LLVM 3.6 fork we hardcoded it:
https://github.com/mono/llvm/blob/f80899cb3eb75f7f5640b4519e83bd96991bffb8/lib/Target/ARM/ARMISelLowering.cpp#L756-L762

The `-exception-model=` option is also not available in LLVM 3.6.

Contributes to https://github.com/mono/mono/issues/15058 and https://github.com/mono/mono/issues/9621
2019-06-24 09:48:54 +02:00
Zoltan Varga d0294cf582 [aot] Fix a deadlock in init_plt () by calling create_trampoline () outside the lock.
Fixes https://github.com/mono/mono/issues/15330.
2019-06-24 09:33:44 +02:00
Vlad Brezae 3b576e58c7 [arm64] Add location of this and rgctx arg
Used to fetch the value from async suspend stack frame, during exception handling.
2019-06-24 09:22:39 +02:00
Vlad Brezae 2878c33dfe [arm] Add location of this and rgctx arg
Used to fetch the value from async suspend stack frame, during exception handling.
2019-06-24 09:22:39 +02:00
Vlad Brezae 1398a3d33a [amd64] Fix location saving for *this*
With static methods we were saving location for irrelevant argument.
2019-06-24 09:22:39 +02:00
Aleksey Kliger (λgeek) 6bed4fc2ff [ci] One more workaround for Git 2.22.0 (#15325)
Homebrew Git 2.22.0 misparses the submodule command and passes arguments like --hard and -xdff to git-submodule instead of to git-reset or git-clean.  Passing the entire command as a single argument seems to help.

Git mailing list bug report: https://public-inbox.org/git/[email protected]/
2019-06-21 10:57:25 -04:00
monojenkins f74dc9a395 [2019-06] [debugger] Debugger doesn't break on unhandled exceptions (#15286)
* When the catch found is in a MONO_WRAPPER_RUNTIME_INVOKE the exception should be treated as an UNHANDLED by the debugger.

* Adding unit test.

* trying to fix side effect.

* I've tested the MonoTests.DebuggerTests.UnhandledException_2 test on VsWin using .net Framework and I think the test is wrong because the first break is in throw and the next break will be on breakpoint. In our implementation we were ignoring the unhandled exception and stopping only on breakpoint.
2019-06-21 11:24:21 +02:00
Larry Ewing b2987f714b Merge pull request #15292 from monojenkins/backport-pr-15255-to-2019-06
[2019-06] [jit] Make alias analysis properly handle alias cloberring
2019-06-20 22:42:53 -05:00
Vlad Brezae b869c961ce [jit] Make alias analysis properly handle alias cloberring
Alias analysis attempts to remove indirection when using OP_LDADDR (which fetches the address of a variable). For example :

	ldaddr r1 <- r0
	load_mem r2 <- r1

is equivalent to

	mov r2 <- r0

The remembered r1 alias needs to be forgotten in case r1 is changed. We were handling this for direct assignment with MOV, but not for the more subtle case where an alias to r1 would be passed to a call, which could lead to changing r1.

https://github.com/mono/mono/issues/14872
2019-06-20 18:42:58 +00:00
monojenkins 3379668399 [csproj] Update project files 2019-06-20 18:49:25 +02:00
Marek Safar a49a3ea553 Bump linker & cecil 2019-06-20 18:49:25 +02:00
Bernhard Urban 71e0854e2a [arm] fix some more host/target pointer size issues
As suggested by Jay in https://github.com/mono/mono/issues/15058#issuecomment-501995400

I haven't seen fixing it any specific issue, but we should still backport it to `2019-06` in order to avoid hard-to-debug regressions.

Contributes to https://github.com/mono/mono/issues/9621
2019-06-19 12:58:52 +02:00
Alexis Christoforides 9d1153af22 Improve robustness of post-install script
We have several issues (e.g. https://github.com/mono/mono/issues/14181) where the installer occasionally fails in the postinstall script for unknown causes, on some hosts.

This seems to be sometimes the culpable section and this patch should help trace the issue or alleviate the common symptoms of it (see https://github.com/mono/mono/issues/14181)
2019-06-19 08:48:57 +02:00
Aleksey Kliger 6091b8f209 [coop] Mark a few functions with MONO_PROFILER_API 2019-06-18 19:44:16 +02:00
Aleksey Kliger 7fcdd9f318 [runtime] Don't do GC Unsafe transition in mono_gchandle_free
Xamarin.Mac can call back here from a native thread that isn't attached to the
runtime.  SGen gchandle code is lockfree, and the profiler event can fire
without involving Mono.
2019-06-18 19:44:16 +02:00
Aleksey Kliger 5c36c00915 [profiler] Don't switch to GC Safe when locking if thread isn't attached to the runtime.
Some profiler events (for example gc_handle_deleted) could be raised on threads
that aren't attached to the runtime.  Since the thread won't participate in
Mono's stop the world (since the runtime can't see it), there's no need to do
the transition to GC Safe while the thread is trying to grab the profiler
buffer lock.
2019-06-18 19:44:16 +02:00
monojenkins a099adcbce [2019-06] Implementing reabstraction of default interface methods. (#15229)
* Implementing reabstraction of default interface methods.

* Fixing side effect on unit tests. Tested with another example and changed the implementation: using System; public interface I1 { void M1(); /*void M2(){ System.Console.WriteLine("I1.M2"); }*/ }

public interface I2 : I1
{
    abstract void I1.M1();
    /* void M2(){
        System.Console.WriteLine("I2.M2");
    }*/
}

class Test1 : I2
{
    static void Main()
    {
        I1 i1 = new Test1();
        i1.M1();
        //i1.M2();
    }

    void I1.M1()
    {
        System.Console.WriteLine("Test1.M1");
    }
}

* Fixing side effect on unit tests.

* Fixing side effect on unit tests.

* Implementing unit test. Fixing side effect.

* Fix unit test.

* Fixing reabstraction.il coreclr test.

* Changing comments.

* Changing things pointed by Aleksey.

* Changing things pointed by Aleksey. Implementing generics test.

* Changing things pointed by Aleksey.
2019-06-18 19:43:25 +02:00
Bernhard Urban 70732b33a8 [watch] consistent naming for watchOS min version
See https://github.com/xamarin/xamarin-macios/pull/6307
2019-06-18 16:38:09 +02:00
Bernhard Urban d68b18c9c2 [arm] use target_mgreg_t instead of plain pointer type in sdb breakpoint
Fixes Debug mode for iOS 32bit.

Contributes to https://github.com/mono/mono/issues/15058 & https://github.com/mono/mono/issues/9621
2019-06-17 16:52:42 +02:00
Aleksey Kliger 02311a91c1 [debugger-agent] Ignore thread_end event if thread is detached
The thread_stopped profiler event can be raised by the thread_info_key_dtor tls
key destructor when the thread is already doesn't have a domain set.  In that
case, don't call process_profiler_event since it cannot handle a thread with
null TLS values.

Addresses https://github.com/xamarin/xamarin-android/issues/2920
with the following stack trace

```
* thread #20, name = 'Filter', stop reason = signal SIGSEGV: invalid address (fault address: 0xbc)
  * frame #0: libmonosgen-2.0.so`mono_class_vtable_checked(domain=0x0000000000000000, klass=0x0000007200230648, error=0x00000071e92f9178) at object.c:1890
    frame #1: libmonosgen-2.0.so`get_current_thread_ptr_for_domain(domain=0x0000000000000000, thread=0x00000071ebfec508) at threads.c:595
    frame #2: libmonosgen-2.0.so`mono_thread_current at threads.c:1939
    frame #3: libmonosgen-2.0.so`process_event(event=<unavailable>, arg=<unavailable>, il_offset=<unavailable>, ctx=<unavailable>, events=<unavailable>, suspend_policy=<unavailable>) at debugger-agent.c:3715
    frame #4: libmonosgen-2.0.so`thread_end [inlined] process_profiler_event(event=EVENT_KIND_THREAD_DEATH, arg=0x00000071ebfec508) at debugger-agent.c:3875
    frame #5: libmonosgen-2.0.so`thread_end(prof=<unavailable>, tid=<unavailable>) at debugger-agent.c:3991
    frame #6: libmonosgen-2.0.so`mono_profiler_raise_thread_stopped(tid=<unavailable>) at profiler-events.h:105
    frame #7: libmonosgen-2.0.so`mono_thread_detach_internal(thread=<unavailable>) at threads.c:979
    frame #8: libmonosgen-2.0.so`thread_detach(info=0x00000071e949a000) at threads.c:3215
    frame #9: libmonosgen-2.0.so`unregister_thread(arg=<unavailable>) at mono-threads.c:544
    frame #10: libmonosgen-2.0.so`thread_info_key_dtor(arg=0x00000071e949a000) at mono-threads.c:774
    frame #11: 0x00000072899c58e8 libc.so`pthread_key_clean_all() + 124
    frame #12: 0x00000072899c5374 libc.so`pthread_exit + 76
    frame #13: 0x00000072899c5264 libc.so`__pthread_start(void*) + 44
    frame #14: 0x000000728996617c libc.so`__start_thread + 72
```
2019-06-15 09:31:20 +02:00
Aleksey Kliger 0d00315b97 don't use 'gpointer' in a public header 2019-06-15 09:29:36 +02:00
Aleksey Kliger f73b774483 [mini] Move some MONO_API functions to public header
And mark them all MONO_RT_EXTERNAL_ONLY.

mono_set_use_llvm is new - Xamarin.Android previously assigned to mono_use_llvm
directly.
2019-06-15 09:29:36 +02:00
Jay Krell 507c4d8c99 Add missing read barrier to mono_lazy_initialize().
This is unfortunate.

The general pattern of:

if initialized
  use the data
else:
  initialize the data, possibly with lots of locks and barriers
  mark initialized

is racy, because "use the data" can be scheduled ahead of "if initialized".

"Barriers come in pairs" generally, and this was missing one.

It depends somewhat. If the data is all pointers, initialized in the else path,
from null to non-null, and use includes dereferencing, which is a common
but not universal case, then it is ok on all non-Alpha processors, due
to "data dependency".

But if the data includes reading globals, then there is a race.

This is a bit of a slow down on fast paths on arm, and possibly
other architectures.

There are barrier-free ways to solve this, involving a thread local,
that should seriously be considered, and applied throughout the runtime.

The runtime has a lot of on-demand initialization and a lot of looks racy.

See www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm.
Which would have to be adopted to be coop-friendly which should not be difficult.

Notice that the existing "lazy" mechanism is also not coop-friendly.
That is not changed by this PR.
2019-06-14 23:53:49 +02:00
Jay Krell b60c60f2ab Fix bug and race in mono_lazy_initialize. 2019-06-14 23:53:49 +02:00
monojenkins c15b300298 [2019-06] [System.Net.Http]: Add hack to the legacy HttpClient to pass down Timeout property. #12577. (#15014)
* [System.Net.Http]Add hack to the legacy HttpClient to pass down Timeout property. #12577.

* `HttpClientHandler`, `IMonoHttpClientHandler`: add new internal `MonoSetTimeout (TimeSpan)` function.

* `HttpClient.SendAsyncWorker()`: if `handler` is `HttpClientHandler`, call the new internal
  `MonoSetTimeout()` function to pass down the timeout.

* `MonoWebRequestHandler.SendAsync()`: this is only used here to pass the timeout to the `HttpWebRequest`.

* Address feedback.

* Update HttpMessageInvoker.cs

* Make it build.

* Really make it build (forgot monotouch_watch).
2019-06-14 10:51:02 +02:00
monojenkins 6752005e64 [2019-06] Fix Japan's new era fallback isn't reflected in Mono (#14984)
* Fix Japan's new era fallback isn't reflected in Mono

refs: <https://github.com/dotnet/coreclr/pull/23614>

* Fix array length

* Fix MonoTests.System.Globalization.CalendarTest

* Fix MonoTests.System.Globalization.EastAsianLunisolarCalendarTest

* Fix era index

refs: 1715e1d0e738ce95382ba372c24502967002a2f0

* Amend fixing

refs: 05af6e6f75fcea76e3d9e9f2f95f0caedb753aa7
2019-06-14 10:50:09 +02:00
Ryan Lucia a2424f031e Actually print out *filename correctly 2019-06-14 10:49:46 +02:00
Ryan Lucia 1517a02c09 Naming: err -> error 2019-06-14 10:49:46 +02:00
Ryan Lucia c7a57444dc Switch everything to MonoError 2019-06-14 10:49:46 +02:00
Ryan Lucia 7cf9bf95d4 Remove todos 2019-06-14 10:49:46 +02:00
Ryan Lucia 1477c73eba Print input string when conversion fails 2019-06-14 10:49:46 +02:00
Ryan Lucia 897621178b Remove redundant goto 2019-06-14 10:49:46 +02:00
Ryan Lucia f85685911c Migrate things to _error version where sensible 2019-06-14 10:49:46 +02:00
Ryan Lucia 7490bdd567 Add internal version of mono_unicode_to_external to propagate error 2019-06-14 10:49:46 +02:00
Imran Hameed 23bac8c6e6 Move ternary SSA cfold test from basic.cs to objects.cs. 2019-06-13 23:48:21 -05:00
Imran Hameed e1ebf711eb Treat ternary operations as non-constant... (#13873)
...during constant evaluation and propagation.
2019-06-13 23:48:21 -05:00
monojenkins 46f7a64e38 Bump API snapshot submodule 2019-06-13 08:42:09 +02:00
Zoltan Varga a020195ec7 [corlib] Add missing Unsafe.Unbox () method.
Fixes https://github.com/mono/mono/issues/14871.
2019-06-13 08:42:09 +02:00
Aleksey Kliger 43f00b12ad [llvm] bump to mono/llvm@2bd2f1db18
Emit .fnend directives on arm even for functions which don't have a corresponding mono method.

Fixes https://github.com/mono/mono/issues/15048
2019-06-13 08:38:52 +02:00
Aleksey Kliger e126d67a6e [runtime] Switch to GC Unsafe for all GC external API functions
Fixes https://github.com/mono/mono/issues/14975
2019-06-12 12:55:27 -05:00
monojenkins 0ef4a3b0d9 Trying to unrevert https://github.com/mono/mono/pull/7390. Couldn't reproduce the same side effect as that caused before. (#14969)
This PR fixes #7377
2019-06-12 14:44:28 -03:00
Zoltan Varga 9a5bddb57d [runtime] Fix gshared support for BeginInvoke ()/EndInvoke () wrappers.
Fixes https://github.com/mono/mono/issues/14972.
2019-06-12 18:56:09 +02:00
Zoltan Varga 05e324bce7 [aot] Open AOT profile files using "rb" so it works on windows.
Fixes https://github.com/xamarin/xamarin-android/issues/3168.
2019-06-12 08:31:14 +02:00
monojenkins b96e503690 [2019-06] [llvm] Fix disabling direct calls and inlining (#14886)
* [llvm] Enable disabling inlining on llvm

* [llvm] Fix disabling direct calls on llvm

* [llvm] Rename mono_inited even when doing self_init (generated init functions refer to it)
2019-06-11 18:44:39 +02:00
monojenkins c2c9c2e012 [install] Include .exe extension when symlinking the mono binary (#14965)
Prevent the SDKs from making dangling symlinks when packaging the MXE
cross-compilers: should hav

    mono.exe -> mono-sgen.exe

rather than

    mono -> mono-sgen (dangling).
2019-06-11 07:31:29 -04:00
Martin Baulig 547b34f0ed Do the same thing in HttpListener. 2019-06-08 11:24:54 +02:00
Martin Baulig 63a2ab73ed Implement RSACertificateExtensions.CopyWithPrivateKey(). #14152.
* RSACertificateExtensions.CopyWithPrivateKey(): implement.

Since `RSACertificateExtensions` lives in `System.Core` and only `mscorlib`
internals (but not `System` internals) are visible to it, we need to use a
little trick here:

* System.Security.Cryptography.X509Certificates.X509CertificateImpl:
  add new abstract methods CopyWithPrivateKey() and CreateCertificate().

* System.Security.Cryptography.X509Certificates.X509Certificate2Impl:
  sealed implement them here.

The `httpcfg` tool, only checks whether the key is valid, so we don't really
need to call `CopyWithPrivateKey()` (which requires us to take a dependency
on `System.Core`).
2019-06-08 11:24:54 +02:00
monojenkins ddef564e34 [2019-06] [runtime] Make cross-appdomain wrappers throw NIE for methods with ref struct args (#14867)
* [AppDomain] Cross-appdomain wrapper throws NIE for methods with ref struct arguments

If we have a ref struct and a method that takes it as an argument:

```
[Serializable]
public ref struct R {
  public int i;
}

public interface I {
  public void M1 (R r, SomeClass o);
}

public class M : MarshalByRefObject, I {
  public void M1 (R r, SomeClass o) { ... }
}
```

If we create an instance of M in another domain and try to call it:
```
  I obj = (I)otherDomain.CreateInstanceAndUnwrap (typeof(M).Assembly.FullName,
  nameof(M));
  R r;
  r.i = 42;
  SomeClass o = ...;
  obj.M1 (r, o);
```

Mono will need to create a wrapper that can invoke M.M1 in the other domain.
The way the wrapper works in `mono_marshal_get_xappdomain_invoke` is by
creating an array of all the arguments that need to be serialized (see
`mono_get_xdomain_marshal_type`) and then serializing the whole array (by
calling out to `System.Runtime.Remoting.RemotingServices.SerializeCallData`).
In the example it would make a two element array and try to serialize `r` and
`o` into it. For valuetypes it normally does this by boxing the argument.
However since `R` is a ref-struct, boxing it is not allowed.

This works on .NET Framework.

However for Mono we would need to serilize `R` without boxing it, which seems
challenging with our current setup.

So for now we generate a wrapper that just throws a NotImplementedException if
it is ever called.

This fixes https://github.com/mono/mono/issues/14809 (in that marshalling a
TextWriter across domains works again) but in an unsatisfactory way (because
you can't call any of the ReadOnlySpan<char> overloads on the transparent proxy
object).

* [corlib] Add back Serializable attribute on some reflection classes

Tests that use https://www.nuget.org/packages/NUnit.ApplicationDomain/
need to serialize MethodInfo (and hence MethodBase).

* [corlib] Add test for transparent proxies for classes with methods that take ref struct args

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

* Bump API snapshot submodule
2019-06-07 13:07:13 +02:00
monojenkins fed776b886 [ios] switch cross32/crosswatch to be executed on x86_64 and use newer LLVM (#14856)
Contributes to https://github.com/mono/mono/issues/9621
Fixes https://github.com/mono/mono/issues/14841

Note that it breaks iOS 32bit on devices. The Apple Watch _might_ still works (only tested on `2019-02`).  It unblocks some build related issues on the Xamarin.iOS `2019-06` integration, and we have to do it anyway. I'll come back to it to fix device related issues.
2019-06-07 00:01:18 +02:00
Bernhard Urban 23b831032a [mach] cast objc_msgSend{,Super} usages (#14836)
Fixes #14792

(cherry picked from commit 812357ec51)
2019-06-06 20:16:03 +02:00
monojenkins 2efb7058f5 [2019-06] [llvm] emit call to mini_llvmonly_throw_nullref_exception without exceptions in mind (#14846)
Fixes https://github.com/mono/mono/issues/14243
2019-06-06 19:24:26 +02:00
monojenkins efddb9595c [2019-06] [arm64] Set a llvm target layout. Assert in llvm if the target layout is not set, the defaults used by 'opt' are not correct. (#14844)
It is important to provide this, otherwise the `opt` command will make modifications of every GC safepoint load. For the SmartHotel360 Android app, this can result in `opt` taking 19 minutes and 20 seconds to finish the optimization of the Mono.Android.dll AOT modules.

### IR Example: 

Before Opt:
```
   >   %GC_SAFE_POINT_FLAG_7 = load i64*, i64** getelementptr inbounds ([166068 x i64*], [166068 x i64*]* @mono_aot_Mono_Android_llvm_got, i32 0, i32 7), !invariant.load !139597
    >   %4 = load volatile i64, i64* %GC_SAFE_POINT_FLAG_7
    >   %5 = icmp eq i64 %4, 0
    >   br i1 %5, label %CONT_BB2, label %POLL_BB1
```

After Opt:
```
    <   %GC_SAFE_POINT_FLAG_7 = load i64*, i64** getelementptr inbounds ([166068 x i64*], [166068 x i64*]* @mono_aot_Mono_Android_llvm_got, i64 0, i64 7), align 8, !invariant.load !139597
    <   %3 = load volatile i64, i64* %GC_SAFE_POINT_FLAG_7, align 4
    <   %4 = icmp eq i64 %3, 0
    <   br i1 %4, label %BB2, label %POLL_BB1
```

This has a huge impact on build time, giving InstCombine a huge slowdown. This change removes the need for opt to rewrite all of these basic blocks. 

Backport of #14714.
2019-06-06 18:48:49 +02:00
monojenkins c84d913f41 [2019-06] [sdks] Use 7z format for the android/ios/mac archives (#14838)
It has way better compression performance.
Kept WebAssembly on .zip for now since external users took dependencies on it [1].

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

[1] https://github.com/nventive/Uno.Wasm.Bootstrap/blob/e2bf8946e162642ca1bdf4f003f8de4a94954f73/Readme.md#updating-the-mono-sdk-build
2019-06-06 12:26:52 +02:00
Martin Baulig a59e941662 Bump CoreFX to pickup the fix for #14214.
HttpClient.SendAsync() should not attempt to read response body on a HEAD request.

* CoreFX PR https://github.com/dotnet/corefx/pull/38129.

* Backported in https://github.com/mono/corefx/pull/297.

* Fixes https://github.com/mono/mono/issues/14214.
2019-06-06 09:33:30 +02:00
Ankit Jain b33f230a80 Bump msbuild to track xplat-master (#14816) 2019-06-06 00:51:10 +02:00
monojenkins a2ffc3d3d5 [2019-06] Fix build on macOS 10.15 Catalina + xcode 11 (#14824)
1) CC_MD5_Init, CC_MD5_Update and CC_MD5_Final are deprecated.

```c
mono-md5.c:45:2: error: 'CC_MD5_Init' is deprecated: first deprecated in macOS 10.15 - This function is
      cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256
      (or stronger). [-Werror,-Wdeprecated-declarations]
        CC_MD5_Init (ctx);
        ^
```

2) objc_msgSend is deprecated
```
mono-threads-mach-helper.c:95:17: error: too many arguments to function call, expected 0, have 2
                objc_msgSend (value, release);
                ~~~~~~~~~~~~  ^~~~~~~~~~~~~~
```
XCode has a special switch `Enable Strict Checking of objc_msgSend Calls` which is now `true` by default. It's fixed by `-DOBJC_OLD_DISPATCH_PROTOTYPES=1` flag to clang or the corresponding define in the source file.

3) Fixes https://github.com/mono/mono/issues/14793

It worked on pre 10.15 without `-framework GSS`, because it got pulled in through the dependencies. You can see it by running DYLD_PRINT_LIBRARIES=1 csharp and then trace it back. On Mojave /System/Library/Frameworks/GSS.framework/Versions/A/GSS got loaded as dependency of /usr/lib/libcups.2.dylib and so on. Unlike Windows, macOS will resolve the symbols to whatever is already available so it was just happy that someone loaded GSS before libmono-native[-compat/-unified].
2019-06-06 00:47:14 +02:00
monojenkins 8cfcd89a7a [2019-06] Reflect recent NS2.1 changes (#14822)
Due to few recent updates to dotnet/standard (NETStandard 2.1) we had 40 apicompat issues.
Mostly copy-pasted from dotnet/corefx.
Didn't implement Cryptography stuff yet.
Checked all profiles.

Implements #14609

Backport of #14679.
2019-06-05 21:47:53 +02:00
Alexander Köplinger f1fda814c2 [tests] Exclude more nunit categories on ios/mac (#14807)
A few more that we missed adding to the exclude file in the sdks archive.

(cherry picked from commit 3d9513efd4)
2019-06-05 16:01:44 +02:00
Aleksey Kliger 8ec87bbaec [runtime] Autoconf check for pthread_mutexattr_setprotocol
Android doesn't always declare that function.
2019-06-05 09:55:46 +02:00
monojenkins 1e6cd29e60 [2019-06] [Mono.Profiler.Log] Add profiled data reader APIs (#14763)
* [Mono.Profiler.Log] Add profiled data reader APIs

* Update API

* [csproj] Update project files
2019-06-05 01:24:46 +02:00
monojenkins 829949df54 [2019-06] [arm64] Correct exception filter stack frame size (#14770)
[2019-06] [arm64] Correct exception filter stack frame size

Fixes: https://github.com/mono/mono/issues/14170
Fixes: https://github.com/xamarin/xamarin-android/issues/3112

The `call_filter()` function generated by `mono_arch_get_call_filter()`
was overwriting a part of the previous stack frame because it was not
creating a large enough new stack frame for itself.  This had been
working by luck before the switch to building the runtime with Android
NDK r19.

I used a local build of [xamarin/xamarin-android/d16-1@87a80b][0] to
verify that this change resolved both of the issues linked above.  I
also confirmed that I was able to reintroduce the issues in my local
environment by removing the change and rebuilding.

After this change, the generated `call_filter()` function now starts by
reserving sufficient space on the stack to hold a 64-bit value at the
`ctx_offset` location.  The 64-bit `ctx` value is saved to the
`ctx_offset` location (offset 344 in the new stack frame) shortly
afterwards:

    stp	x29, x30, [sp,#-352]!
    mov	x29, sp
    str	x0, [x29,#344]

As expected, the invocation of `call_filter()` now no longer modifies
the top of the previous stack frame.

Top of the stack before `call_filter()`:

    (gdb) x/8x $sp
    0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
    0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

Top of the stack after `call_filter()` (unchanged):

    (gdb) x/8x $sp
    0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
    0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

<details>
<summary>Additional background information</summary>

### The original lucky, "good" behavior for [mono/mono/2018-08@725ba2a built with Android NDK r14][1]

 1. The `resume` parameter for `mono_handle_exception_internal()` is
    held in register `w23`.

 2. That register is saved into the current stack frame at offset 20 by
    a `str` instruction:

           0x00000000000bc1bc <+3012>:	str	w23, [sp,#20]

 3. `handle_exception_first_pass()` invokes `call_filter()` via a `blr`
    instruction:

        2279							filtered = call_filter (ctx, ei->data.filter);
           0x00000000000bc60c <+4116>:	add	x9, x22, x24, lsl #6
           0x00000000000bc610 <+4120>:	ldr	x8, [x8,#3120]
           0x00000000000bc614 <+4124>:	ldr	x1, [x9,#112]
           0x00000000000bc618 <+4128>:	add	x0, sp, #0x110
           0x00000000000bc61c <+4132>:	blr	x8

    Before the `blr` instruction, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0x0a8b31d8	0x00000071
        0x7fcd2774b0:	0x00000000	0x00000000	0x1ef51980	0x00000071

 4. `call_filter()` runs.  This function is generated by
    `mono_arch_get_call_filter()` and starts with:

           stp	x29, x30, [sp,#-336]!
           mov	x29, sp
           str	x0, [x29,#344]

    Note in particular how the first line subtracts 336 from `sp` to
    start a new stack frame, but the third line writes to a position
    that is 344 bytes beyond that, back within the *previous* stack
    frame.

 5. After the invocations of `call_filter()` and
    `handle_exception_first_pass()`, `w23` is restored from the stack:

           0x00000000000bc820 <+4648>:	ldr	w23, [sp,#20]

    At this step, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0xcd2775b0	0x0000007f
        0x7fcd2774b0:	0x00000000	0x00000000	0x1ef51980	0x00000071

    Notice how `call_filter()` has overwritten bytes 8 through 15 of the
    stack frame.  In this original lucky scenario, this does not affect
    the value restored into register `w23` because that value starts at
    byte 20.

 6. `mono_handle_exception_internal()` tests the value of `w23` to
    decide how to set the `ji` local variable:

        2574			if (resume) {
           0x00000000000bb960 <+872>:	cbz	w23, 0xbb9c4 <mono_handle_exception_internal+972>

    Since `w23` is `0`, `mono_handle_exception_internal()` correctly
    continues into the `else` branch.

### The bad behavior for [mono/mono/2018-08@725ba2a built with Android NDK r19][2] works slightly differently

 1. As before, the local `resume` parameter starts in register `w23`.
 2. This time, the register is saved into the stack frame at offset 12
    (instead of 20):

           0x00000000000bed7c <+3200>:	str	w23, [sp,#12]

 3. As before, `handle_exception_first_pass()` invokes `call_filter()`
    via a `blr` instruction.

    At this step, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
        0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

 4. `call_filter()` runs as before.  And the first few instructions of
    that function are the same as before:

        stp	x29, x30, [sp,#-336]!
        mov	x29, sp
        str	x0, [x29,#344]

 5. `w23` is again restored from the stack, but this time from offset 12:

           0x00000000000bf2c0 <+4548>:	ldr	w23, [sp,#12]

    The problem is that `call_filter()` has again overwritten bytes 8
    through 15 of the stack frame:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0xcd2775b0	0x0000007f
        0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

    So after the `ldr` instruction, `w23` has an incorrect value of
    `0x7f` rather than the correct value `0`.

 6. As before, `mono_handle_exception_internal()` tests the value of `w23` to
    decide how to set the `ji` local variable:

        2574			if (resume) {
           0x00000000000be430 <+820>:	cbz	w23, 0xbe834 <mono_handle_exception_internal+1848>

    But this time because `w23` is *not* zero, execution continues
    *incorrectly* into the `if` branch rather than the `else` branch.
    The result is that `ji` is set to `0` rather than a valid
    `(MonoJitInfo *)` value.  This incorrect value for `ji` leads to a
    null pointer dereference, as seen in the bug reports.

[0]: https://github.com/xamarin/xamarin-android/tree/xamarin-android-9.3.0.22
[1]: https://jenkins.xamarin.com/view/Xamarin.Android/job/xamarin-android-freestyle/1432/Azure/
[2]: https://jenkins.xamarin.com/view/Xamarin.Android/job/xamarin-android-freestyle/1436/Azure/

</details>

Backport of #14757.

/cc @lambdageek @brendanzagaeski
2019-06-03 20:05:59 -04:00
Katelyn Gadd c28e96bda1 Bump roslyn to release 3.1.0 (#14775) 2019-06-03 22:37:04 +02:00
monojenkins 989433530a [sdks] Bump Android NDK, build tools and platform tools versions (#14758)
Try to match Xamarin.Android master

Build tools and Platform tools: https://github.com/xamarin/xamarin-android/blob/f9f5b6cd120484b13df74e94638e07411d8693fa/Configuration.props#L100-L102

NDK: https://github.com/xamarin/xamarin-android/blob/f9f5b6cd120484b13df74e94638e07411d8693fa/build-tools/scripts/Ndk.targets#L4
2019-06-03 12:50:33 +02:00
Alexis Christoforides 03bdf62922 [MacSDK] Properly handle PATHs with spaces during package post-install 2019-06-03 08:58:36 +02:00
Jo Shields da1fa28109 Bump version to 6.4.0 (#14727) 2019-05-31 12:53:23 -04:00
273 changed files with 5897 additions and 2210 deletions

No files matched your search

-1
View File
@@ -24,7 +24,6 @@
*.tlh
*.bak
*.ilk
*.log
*.lib
*.sbr
*.sdf
+1 -1
View File
@@ -2,7 +2,7 @@
{
"name": "roslyn",
"url": "git://github.com/mono/roslyn.git",
"rev": "7a840bd5697ef6ea41f554a09d837636fba9d88d",
"rev": "13a40eedacc799a78710aba5c8e4b2dcc80a7e61",
"remote-branch": "origin/mono-testing",
"branch": "mono-testing",
"directory": "roslyn"
+10 -4
View File
@@ -4,7 +4,7 @@
# This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
# It should remain in the format they expect.
#
AC_INIT(mono, [6.3.0],
AC_INIT(mono, [6.4.0],
[https://github.com/mono/mono/issues/new])
AC_CONFIG_SRCDIR([README.md])
@@ -2646,6 +2646,8 @@ if test x$host_win32 = xno; then
AC_CHECK_FUNCS(pthread_attr_setstacksize)
AC_CHECK_FUNCS(pthread_attr_getstack pthread_attr_getstacksize)
AC_CHECK_FUNCS(pthread_get_stacksize_np pthread_get_stackaddr_np)
dnl check that pthread_mutexattr_setprotocol is declared
AC_CHECK_DECLS([pthread_mutexattr_setprotocol], [], [], [[#include <pthread.h>]])
AC_CHECK_FUNCS(mincore mlock munlock)
dnl ***********************************
@@ -5865,8 +5867,8 @@ fi
AC_SUBST(mono_runtime)
AC_SUBST(mono_runtime_wrapper)
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.1.0/csc.exe
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.1.0/VBCSCompiler.exe
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.1/csc.exe
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.1/VBCSCompiler.exe
if test $csc_compiler = mcs; then
CSC=$mcs_topdir/class/lib/build/mcs.exe
@@ -6110,6 +6112,10 @@ elif test x$target_osx = xyes; then
MONO_NATIVE_PLATFORM=macos
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_MACOS"
if test x$enable_gss = xyes; then
MONO_NATIVE_LDFLAGS="$MONO_NATIVE_LDFLAGS -framework GSS"
fi
AC_MONO_APPLE_AVAILABLE(mono_native_compat, [whether we need the compatibility layer],
[!(MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)])
@@ -6759,5 +6765,5 @@ echo "
$disabled
"
if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
AC_MSG_WARN(Turning off static Mono is a risk, you might run into unexpected bugs)
AC_MSG_WARN([Turning off static Mono is a risk, you might run into unexpected bugs])
fi
+1 -1
+1 -1
+1 -1
+1 -1
+20 -17
View File
@@ -1179,23 +1179,26 @@ If set, tells mono to attempt using native asynchronous I/O services. If not
set, a default select/poll implementation is used. Currently epoll and kqueue
are supported.
.TP
\fBMONO_THREADS_SUSPEND\fR
Selects a mechanism that Mono will use to suspend threads. May be set to
"preemptive", "coop", or "hybrid". Threads may need to be suspended by the
debugger, or using some .NET threading APIs, and most commonly when the SGen
garbage collector needs to stop all threads during a critical phase of garbage
collection. Preemptive mode is the mode that Mono has used historically, going
back to the Boehm days, where the garbage collector would run at any point and
suspend execution of all threads as required to perform a garbage collection.
The cooperative mode on the other hand requires the cooperation of all threads
to stop at a safe point. This makes for an easier to debug garbage collector.
As of Mono 4.3.0 it is a work in progress, and while it works, it has not been
used extensively. This option enables the feature and allows us to find spots
that need to be tuned for this mode of operation. Hybrid mode is a combination
of the two that retains better compatability with scenarios where Mono is
embedded in another application: threads that are running managed code or code
that comprises the Mono runtime will be cooperatively suspended, while threads
running embedder code will be preemptively suspended.
\fBMONO_THREADS_SUSPEND\fR Selects a mechanism that Mono will use to suspend
threads. May be set to "preemptive", "coop", or "hybrid". Threads may need to
be suspended by the debugger, or using some .NET threading APIs, and most
commonly when the SGen garbage collector needs to stop all threads during a
critical phase of garbage collection. Preemptive mode is the mode that Mono
has used historically, going back to the Boehm days, where the garbage
collector would run at any point and suspend execution of all threads as
required to perform a garbage collection. The cooperative mode on the other
hand requires the cooperation of all threads to stop at a safe point. This
makes for an easier to debug garbage collector and it improves the stability of
the runtime because threads are not suspended when accessing critical
resources. In scenarios where Mono is embedded in another application,
cooperative suspend requires the embedder code to follow coding guidelines in
order to cooperate with the garbage collector. Cooperative suspend in embedded
Mono is currently experimental. Hybrid mode is a combination of the two that
retains better compatability with scenarios where Mono is embedded in another
application: threads that are running managed code or code that comprises the
Mono runtime will be cooperatively suspended, while threads running embedder
code will be preemptively suspended. Hybrid suspend is the default on some
desktop platforms.
Alternatively, coop and hybrid mode can be enabled at compile time by using the
--enable-cooperative-suspend or --enable-hybrid-suspend flags, respectively,
+2
View File
@@ -14,3 +14,5 @@ MONO_FEATURE_APPLETLS=
ONLY_APPLETLS=
MONO_FEATURE_APPLE_X509=1
NO_VTS_TEST=1
PROFILE_TEST_HARNESS_EXCLUDES += BitcodeNotSupported
+1 -1
View File
@@ -39,4 +39,4 @@ PROFILE_DISABLE_BTLS=1
MONO_FEATURE_APPLETLS=1
ONLY_APPLETLS=1
PROFILE_TEST_HARNESS_EXCLUDES = MobileNotWorking PKITS
PROFILE_TEST_HARNESS_EXCLUDES = MobileNotWorking PKITS InetAccess
+2
View File
@@ -24,3 +24,5 @@ PROFILE_DISABLE_BTLS=1
MONO_FEATURE_APPLETLS=1
ONLY_APPLETLS=1
ENABLE_GSS=1
PROFILE_TEST_HARNESS_EXCLUDES += InetAccess
+3 -9
View File
@@ -41,19 +41,15 @@ $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnos
$(topdir)/../external/corefx/src/Common/src/System/PasteArguments.cs \
$(topdir)/../external/corefx/src/Common/src/System/PasteArguments.Unix.cs
ifeq ($(PROFILE),monodroid)
ifdef MOBILE_PROFILE
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mobile.cs
else
ifeq ($(PROFILE),monotouch_tv)
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mobile.cs
else
ifeq ($(PROFILE),monotouch_watch)
ifeq ($(PROFILE), xammac_net_4_5)
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mobile.cs
else
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mono.cs $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.Process.cs
endif
endif
endif
endif # ($(USE_XTEST_REMOTE_EXECUTOR), YES)
@@ -132,7 +128,7 @@ $(test_nunit_dep): $(topdir)/build/deps/nunit-$(PROFILE).stamp
@if test -f $@; then :; else rm -f $<; $(MAKE) $<; fi
$(topdir)/build/deps/nunit-$(PROFILE).stamp:
cd ${topdir}/tools/nunit-lite && $(MAKE)
$(MAKE) -C ${topdir}/tools/nunit-lite
echo "stamp" >$@
tests_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp
@@ -382,5 +378,3 @@ $(xtest_makefrag): $(xtest_response)
endif
.PHONY: patch-nunitlite-appconfig
+1 -1
View File
@@ -38,7 +38,7 @@ doc-update-recursive:
@echo "do not recurse the Facades folder"
System System.Core System.ComponentModel.DataAnnotations System.Numerics System.Numerics.Vectors System.Runtime.Serialization System.Transactions System.Xml \
System.ComponentModel.Composition System.ServiceModel System.Xml.Linq System.Data System.IO.Compression.FileSystem System.Runtime.InteropServices.RuntimeInformation \
System.ComponentModel.Composition System.ServiceModel System.Xml.Linq System.Data System.Data.DataSetExtensions System.IO.Compression.FileSystem System.Runtime.InteropServices.RuntimeInformation \
System.ServiceProcess System.Security System.Net.Http.WebRequest System.Net.Http System.ServiceProcess System.IO.Compression System.IdentityModel System.Web \
Facades/System.Drawing.Primitives Facades/System.Drawing.Common System.Drawing System.Web.Services:
@@ -29,67 +29,67 @@
<PropertyGroup Condition=" '$(Platform)' == 'monodroid' ">
<OutputPath>./../../../class/lib/monodroid/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
<OutputPath>./../../../class/lib/monotouch/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch' ">
<OutputPath>./../../../class/lib/monotouch_watch/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_tv' ">
<OutputPath>./../../../class/lib/monotouch_tv/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;MONOTOUCH_TV</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;MONOTOUCH_TV;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_aot_full_interp' ">
<OutputPath>./../../../class/lib/testing_aot_full_interp/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_REMOTING;DISABLE_SECURITY;FULL_AOT_INTERP;DISABLE_COM</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_REMOTING;DISABLE_SECURITY;FULL_AOT_INTERP;DISABLE_COM;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_aot_hybrid' ">
<OutputPath>./../../../class/lib/testing_aot_hybrid/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_REMOTING;DISABLE_SECURITY;MOBILE_DYNAMIC</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_REMOTING;DISABLE_SECURITY;MOBILE_DYNAMIC;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
<OutputPath>./../../../class/lib/testing_aot_full/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_REMOTING;DISABLE_SECURITY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_REMOTING;DISABLE_SECURITY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM;WIN_PLATFORM;WINAOT</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM;WIN_PLATFORM;WINAOT;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac_net_4_5' ">
<OutputPath>./../../../class/lib/xammac_net_4_5/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;NO_SYSTEM_DRAWING_DEPENDENCY;NO_WINFORMS_DEPENDENCY;NO_SYSTEM_WEB_DEPENDENCY;XAMMAC_4_5;XAMARIN_MODERN</DefineConstants>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;NO_SYSTEM_DRAWING_DEPENDENCY;NO_WINFORMS_DEPENDENCY;NO_SYSTEM_WEB_DEPENDENCY;XAMMAC_4_5;XAMARIN_MODERN;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'orbis' ">
<OutputPath>./../../../class/lib/orbis/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;ORBIS;DISABLE_COM</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;ORBIS;DISABLE_COM;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'unreal' ">
<OutputPath>./../../../class/lib/unreal/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;MOBILE;MOBILE_DYNAMIC;NET_3_5;NET_4_0;NET_4_5;MONO</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;MOBILE;MOBILE_DYNAMIC;NET_3_5;NET_4_0;NET_4_5;MONO;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'wasm' ">
<OutputPath>./../../../class/lib/wasm/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;WASM;DISABLE_COM;FEATURE_NO_BSD_SOCKETS;DISABLE_REMOTING;DISABLE_SECURITY</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;WASM;DISABLE_COM;FEATURE_NO_BSD_SOCKETS;DISABLE_REMOTING;DISABLE_SECURITY;FEATURE_TYPECONVERTER</DefineConstants>
</PropertyGroup>
<!-- @ALL_PROFILE_PROPERTIES@ -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@@ -13,7 +13,7 @@ KEYFILE = ../../Open.snk
LIBRARY_SNK = $(KEYFILE)
SIGN_FLAGS = /delaysign /nowarn:1616,1699
LIB_REFS = System
LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS)
LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS) -d:FEATURE_TYPECONVERTER
ifneq (,$(filter build net_4_x, $(PROFILE)))
$(error This profile shouldn't build System.Drawing.Common.dll, it already has System.Drawing.dll)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Mono development team")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("(c) Various Mono authors")]
[assembly: AssemblyVersion ("2.0.0.0")]
[assembly: AssemblyInformationalVersion ("2.0.0.0")]
[assembly: AssemblyFileVersion ("2.0.0.0")]
[assembly: AssemblyVersion ("2.1.0.0")]
[assembly: AssemblyInformationalVersion ("2.1.0.0")]
[assembly: AssemblyFileVersion ("2.1.0.0")]
@@ -113,6 +113,7 @@
<!--Common files-->
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Stubs.cs" />
<Compile Include="TypeForwarders.cs" />
</ItemGroup>
<!--End of common files-->
@@ -169,6 +170,7 @@
<ItemGroup Condition=" '$(Platform)' == 'net_4_x' ">
<ProjectReference Include="../../System.Web/System.Web.csproj" />
<ProjectReference Include="../../System.Drawing/System.Drawing.csproj" />
<ProjectReference Include="../../System.Data.DataSetExtensions/System.Data.DataSetExtensions.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
<ProjectReference Include="../../System.Web.Services/System.Web.Services.csproj" />
+4
View File
@@ -39,6 +39,10 @@ else
LIB_REFS += Facades/System.Drawing.Common
endif
ifeq ($(PROFILE),net_4_x)
LIB_REFS += System.Data.DataSetExtensions
endif
PLATFORM_DEBUG_FLAGS =
NO_TEST = yes
+89
View File
@@ -0,0 +1,89 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if MOBILE || XAMMAC_4_5
namespace System.Data
{
public static partial class DataRowComparer
{
public static System.Data.DataRowComparer<System.Data.DataRow> Default { get => throw new PlatformNotSupportedException(); }
}
public sealed partial class DataRowComparer<TRow> : System.Collections.Generic.IEqualityComparer<TRow> where TRow : System.Data.DataRow
{
internal DataRowComparer() { }
public static System.Data.DataRowComparer<TRow> Default { get => throw new PlatformNotSupportedException(); }
public bool Equals(TRow leftRow, TRow rightRow) => throw new PlatformNotSupportedException();
public int GetHashCode(TRow row) => throw new PlatformNotSupportedException();
}
public static partial class DataRowExtensions
{
public static T Field<T>(this System.Data.DataRow row, System.Data.DataColumn column) => throw new PlatformNotSupportedException();
public static T Field<T>(this System.Data.DataRow row, System.Data.DataColumn column, System.Data.DataRowVersion version) => throw new PlatformNotSupportedException();
public static T Field<T>(this System.Data.DataRow row, int columnIndex) => throw new PlatformNotSupportedException();
public static T Field<T>(this System.Data.DataRow row, int columnIndex, System.Data.DataRowVersion version) => throw new PlatformNotSupportedException();
public static T Field<T>(this System.Data.DataRow row, string columnName) => throw new PlatformNotSupportedException();
public static T Field<T>(this System.Data.DataRow row, string columnName, System.Data.DataRowVersion version) => throw new PlatformNotSupportedException();
public static void SetField<T>(this System.Data.DataRow row, System.Data.DataColumn column, T value) { }
public static void SetField<T>(this System.Data.DataRow row, int columnIndex, T value) { }
public static void SetField<T>(this System.Data.DataRow row, string columnName, T value) { }
}
public static partial class DataTableExtensions
{
public static System.Data.DataView AsDataView(this System.Data.DataTable table) => throw new PlatformNotSupportedException();
public static System.Data.DataView AsDataView<T>(this System.Data.EnumerableRowCollection<T> source) where T : System.Data.DataRow => throw new PlatformNotSupportedException();
public static System.Data.EnumerableRowCollection<System.Data.DataRow> AsEnumerable(this System.Data.DataTable source) => throw new PlatformNotSupportedException();
public static System.Data.DataTable CopyToDataTable<T>(this System.Collections.Generic.IEnumerable<T> source) where T : System.Data.DataRow => throw new PlatformNotSupportedException();
public static void CopyToDataTable<T>(this System.Collections.Generic.IEnumerable<T> source, System.Data.DataTable table, System.Data.LoadOption options) where T : System.Data.DataRow { }
public static void CopyToDataTable<T>(this System.Collections.Generic.IEnumerable<T> source, System.Data.DataTable table, System.Data.LoadOption options, System.Data.FillErrorEventHandler errorHandler) where T : System.Data.DataRow { }
}
public abstract partial class EnumerableRowCollection : System.Collections.IEnumerable
{
internal EnumerableRowCollection() { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => throw new PlatformNotSupportedException();
}
public static partial class EnumerableRowCollectionExtensions
{
public static System.Data.EnumerableRowCollection<TResult> Cast<TResult>(this System.Data.EnumerableRowCollection source) => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector) => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector) => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) => throw new PlatformNotSupportedException();
public static System.Data.EnumerableRowCollection<S> Select<TRow, S>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, S> selector) => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow, TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector) => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow, TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenBy<TRow, TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector) => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenBy<TRow, TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) => throw new PlatformNotSupportedException();
public static System.Data.EnumerableRowCollection<TRow> Where<TRow>(this System.Data.EnumerableRowCollection<TRow> source, System.Func<TRow, bool> predicate) => throw new PlatformNotSupportedException();
}
public partial class EnumerableRowCollection<TRow> : System.Data.EnumerableRowCollection, System.Collections.Generic.IEnumerable<TRow>, System.Collections.IEnumerable
{
internal EnumerableRowCollection() { }
public System.Collections.Generic.IEnumerator<TRow> GetEnumerator() => throw new PlatformNotSupportedException();
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => throw new PlatformNotSupportedException();
}
public sealed partial class OrderedEnumerableRowCollection<TRow> : System.Data.EnumerableRowCollection<TRow>
{
internal OrderedEnumerableRowCollection() { }
}
public static partial class TypedTableBaseExtensions
{
public static System.Data.EnumerableRowCollection<TRow> AsEnumerable<TRow>(this System.Data.TypedTableBase<TRow> source) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
public static TRow ElementAtOrDefault<TRow>(this System.Data.TypedTableBase<TRow> source, int index) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, TKey> keySelector) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, TKey> keySelector) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
public static System.Data.EnumerableRowCollection<S> Select<TRow, S>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, S> selector) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
public static System.Data.EnumerableRowCollection<TRow> Where<TRow>(this System.Data.TypedTableBase<TRow> source, System.Func<TRow, bool> predicate) where TRow : System.Data.DataRow => throw new PlatformNotSupportedException();
}
public abstract partial class TypedTableBase<T> : System.Data.DataTable, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable where T : System.Data.DataRow
{
protected TypedTableBase() { }
protected TypedTableBase(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public System.Data.EnumerableRowCollection<TResult> Cast<TResult>() => throw new PlatformNotSupportedException();
public System.Collections.Generic.IEnumerator<T> GetEnumerator() => throw new PlatformNotSupportedException();
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => throw new PlatformNotSupportedException();
}
}
#endif
@@ -764,6 +764,18 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.SqlTypeException))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.SqlXml))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.StorageState))]
#if !MOBILE && !XAMMAC_4_5
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DataRowComparer))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DataRowComparer<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DataRowExtensions))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DataTableExtensions))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.EnumerableRowCollection))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.EnumerableRowCollection<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.EnumerableRowCollectionExtensions))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.OrderedEnumerableRowCollection<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.TypedTableBase<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.TypedTableBaseExtensions))]
#endif
#endif
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.BooleanSwitch))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.ConditionalAttribute))]
@@ -821,6 +833,15 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.TraceSwitch))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.SuppressMessageAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.AllowNullAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.DisallowNullAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.MaybeNullAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.NotNullAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.NotNullWhenAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Contracts.Contract))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Contracts.ContractAbbreviatorAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Contracts.ContractArgumentValidatorAttribute))]
@@ -1482,6 +1503,7 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.DisablePrivateReflectionAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.DiscardableAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.DynamicAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.EnumeratorCancellationAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.ExtensionAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.FixedAddressValueTypeAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.FixedBufferAttribute))]
@@ -2424,6 +2446,9 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ReadOnlySpan<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ArrayPool<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ArrayBufferWriter<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.SequenceReader<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.SequenceReaderExtensions))]
[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<>))]
@@ -2443,8 +2468,13 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Utf8Parser))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.CollectionExtensions))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.KeyValuePair))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Tracing.DiagnosticCounter))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Tracing.EventSourceCreatedEventArgs))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Tracing.IncrementingEventCounter))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Tracing.IncrementingPollingCounter))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Tracing.PollingCounter))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.KnownColor))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DataReaderExtensions))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbProviderFactories))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.ColorConverter))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.PointConverter))]
@@ -2507,6 +2537,7 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Emit.SignatureToken))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Emit.StringToken))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Emit.TypeToken))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.AmbiguousImplementationException))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.AsyncMethodBuilderAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder<>))]
@@ -2533,8 +2564,12 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.TypeLibVersionAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.Formatters.IFieldInfo))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.SequencePosition))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AesCcm))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AesGcm))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.CryptographicOperations))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECDiffieHellman))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.PbeParameters))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.PbeEncryptionAlgorithm))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Serialization.SchemaImporter))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.CertificateRequest))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.DSACertificateExtensions))]
@@ -2546,4 +2581,5 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Sources.IValueTaskSource<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Sources.ValueTaskSourceStatus))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskAsyncEnumerableExtensions))]
#endif
+18 -7
View File
@@ -1,11 +1,22 @@
#!/bin/sh
# Cloned and Build location of https://github.com/dotnet/standard
STANDARD=/Users/cloned-location-of/dotnet/standard
# https://github.com/dotnet/standard
STANDARD_REPO=/path/to/standard
# Microsoft.DotNet.ApiCompat.exe can be built in https://github.com/dotnet/arcade
APICOMPAT=Microsoft.DotNet.ApiCompat.exe
NSAPI=$(STANDARD)/artifacts/bin/ref/netstandard/Debug/netstandard.dll
# https://github.com/dotnet/arcade
ARCARDE_REPO=/path/to/arcade
dotnet $APICOMPAT $NSAPI --impl-dirs "../../lib/net_4_x/Facades/,../../lib/net_4_x/" --exclude-non-browsable
# --exclude-non-browsable ignores `EditorBrowsableAttribute` issues
APICOMPAT=$ARCARDE_REPO/artifacts/bin/Microsoft.DotNet.ApiCompat/Debug/net472/Microsoft.DotNet.ApiCompat.exe
NSAPI=$STANDARD_REPO/artifacts/bin/ref/netstandard/Debug/netstandard.dll
# uncomment to run only for net_4_x:
# mono $APICOMPAT $NSAPI --impl-dirs "../../lib/net_4_x/Facades/,../../lib/net_4_x/" --exclude-non-browsable > ns21_diff_net_4_x.txt
# run ApiCompat for all profiles (runtime should be built with `--runtime-preset=all` flag)
for profile in net_4_x monodroid monotouch monotouch_watch testing_aot_full_interp testing_aot_full testing_aot_hybrid unreal wasm winaot xammac xammac_net_4_5; do
profile_path=../../lib/$profile
if [ -d "$profile_path" ]; then
echo "checking $(basename $profile_path) ..."
mono $APICOMPAT $NSAPI --impl-dirs "$profile_path/Facades/,$profile_path/" --exclude-non-browsable > ns21_diff_$(basename $profile_path).txt
fi
done
@@ -1,2 +1,3 @@
Stubs.cs
TypeForwarders.cs
AssemblyInfo.cs
+3 -1
View File
@@ -117,10 +117,12 @@ monodroid_dirs_parallel := \
monodroid_tools_dirs_parallel := \
Mono.Cecil \
Mono.Cecil.Mdb \
Mono.CompilerServices.SymbolWriter \
ICSharpCode.SharpZipLib \
monodoc \
Mono.Debugger.Soft
Mono.Debugger.Soft \
Mono.Profiler.Log
monotouch_tools_dirs_parallel := \
Mono.Cecil \
+20 -2
View File
@@ -30,6 +30,11 @@
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-net_4_x-$(HostPlatform)</IntermediateOutputPath>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CECIL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monodroid_tools' ">
<OutputPath>./../../class/lib/monodroid_tools</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-monodroid_tools</IntermediateOutputPath>
<DefineConstants>NET_4_6;MONO;MONODROID_TOOLS;WIN_PLATFORM;CECIL</DefineConstants>
</PropertyGroup>
<!-- @ALL_PROFILE_PROPERTIES@ -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
@@ -58,12 +63,25 @@
</ItemGroup>
<!--End of common files-->
<!-- @ALL_SOURCES@ -->
<!-- @COMMON_PROJECT_REFERENCES@ -->
<ItemGroup>
<ProjectReference Include="../Mono.Cecil/Mono.Cecil.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'net_4_x' ">
<ProjectReference Include="../System/System.csproj" />
<ProjectReference Include="../Mono.Cecil/Mono.Cecil.csproj" />
<ProjectReference Include="../corlib/corlib.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monodroid_tools' ">
<Reference Include="./../../../external/binary-reference-assemblies/v4.6/System.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/v4.6/System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="./../../../external/binary-reference-assemblies/v4.6/mscorlib.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/v4.6/mscorlib.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
<!-- @ALL_RESOURCES@ -->
<PropertyGroup>
@@ -150,8 +150,8 @@ namespace Mono.Debugger.Soft
}
public void Detach () {
conn.VM_Dispose ();
conn.Close ();
conn.VM_Dispose ();
notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, 0, 0, null, 0);
}
@@ -414,6 +414,14 @@ public class Tests : TestsBase, ITest2
unhandled_exception ();
return 0;
}
if (args.Length >0 && args [0] == "unhandled-exception-wrapper") {
unhandled_exception_wrapper ();
return 0;
}
if (args.Length >0 && args [0] == "unhandled-exception-perform-wait-callback") {
unhandled_exception_perform_wait_callback ();
return 0;
}
if (args.Length >0 && args [0] == "unhandled-exception-endinvoke") {
unhandled_exception_endinvoke ();
return 0;
@@ -1483,10 +1491,32 @@ public class Tests : TestsBase, ITest2
Thread.Sleep (10000);
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void unhandled_exception_wrapper () {
throw new ArgumentException("test");
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void unhandled_exception_endinvoke_2 () {
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void unhandled_exception_perform_wait_callback () {
try
{
var results = ResolveAsync().GetAwaiter().GetResult();
}
catch (SocketException sockEx)
{
//Console.WriteLine("correctly handled");
}
}
public static async Task<List<string>> ResolveAsync()
{
var addresses = await System.Net.Dns.GetHostAddressesAsync("foo.bar.baz");
return new List<string>(addresses.Select(addr => addr.ToString()));
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void unhandled_exception_endinvoke () {
Action action = new Action (() =>
@@ -4246,6 +4246,41 @@ public class DebuggerTests
vm = null;
}
[Test]
public void UnhandledException3 () {
vm.Exit (0);
Start (dtest_app_path, "unhandled-exception-wrapper");
var req = vm.CreateExceptionRequest (null, false, true);
req.Enable ();
var e = run_until ("unhandled_exception_wrapper");
vm.Resume ();
var e2 = GetNextEvent ();
Assert.IsTrue (e2 is ExceptionEvent);
vm.Exit (0);
vm = null;
}
[Test]
public void UnhandledException4 () {
vm.Exit (0);
Start (dtest_app_path, "unhandled-exception-perform-wait-callback");
var req = vm.CreateExceptionRequest (null, false, true);
req.Enable ();
var e = run_until ("unhandled_exception_perform_wait_callback");
vm.Resume ();
var e2 = GetNextEvent ();
Assert.IsTrue (e2 is VMDeathEvent);
vm = null;
}
[Test]
public void GCWhileSuspended () {
// Check that objects are kept alive during suspensions
+12 -4
View File
@@ -7,7 +7,9 @@ LIBRARY_WARN_AS_ERROR = yes
KEYFILE = $(LIBRARY_SNK)
LIB_REFS = System System.Core
LIB_MCS_FLAGS = /unsafe /publicsign /nowarn:0618
LIB_MCS_FLAGS = /unsafe /publicsign /nowarn:0618 -D:MONO_DATACONVERTER_STATIC_METHOD
ifeq (net_4_x,$(PROFILE))
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
@@ -17,12 +19,18 @@ $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe: Test/log-p
mkdir -p $(dir $@)
$(CSCOMPILE) $(PLATFORM_DEBUG_FLAGS) /unsafe $(if $(MCS_MODE),,/warnaserror) /r:$(build_libdir)/mscorlib.dll /r:$(build_lib) /out:$@ $<
EXTRA_DISTFILES = \
Test/log-profiler-test.cs
CLEAN_FILES = \
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe \
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe.mdb \
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.pdb
else
NO_TEST = yes
endif
EXTRA_DISTFILES = \
Test/log-profiler-test.cs
include ../../build/library.make
@@ -0,0 +1,16 @@
namespace Mono.Profiler.Aot
{
public sealed class ProfileData
{
public ProfileData (ModuleRecord[] modules, TypeRecord[] types, MethodRecord[] methods)
{
this.Modules = modules;
this.Types = types;
this.Methods = methods;
}
public ModuleRecord[] Modules { get; private set; }
public TypeRecord[] Types { get; private set; }
public MethodRecord[] Methods { get; private set; }
}
}
@@ -0,0 +1,166 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
namespace Mono.Profiler.Aot
{
//
// Read the contents of a .aotprofile created by the AOT profiler
// See mono-profiler-aot.h for a description of the file format
//
public sealed class ProfileReader
{
enum RecordType
{
NONE = 0,
IMAGE = 1,
TYPE = 2,
GINST = 3,
METHOD = 4
}
enum MonoTypeEnum
{
MONO_TYPE_CLASS = 0x12,
}
const string MAGIC = "AOTPROFILE";
const int MAJOR_VERSION = 1;
const int MINOR_VERSION = 0;
DataConverter conv;
byte[] data;
int pos;
public ProfileReader ()
{
conv = DataConverter.LittleEndian;
}
int ReadByte ()
{
int res = data [pos];
pos ++;
return res;
}
int ReadInt ()
{
int res = conv.GetInt32 (data, pos);
pos += 4;
return res;
}
string ReadString ()
{
int len = ReadInt ();
var res = new string (Encoding.UTF8.GetChars (data, pos, len));
pos += len;
return res;
}
public ProfileData ReadAllData (Stream stream)
{
byte[] buf = new byte [16];
int len = stream.Read (buf, 0, MAGIC.Length);
if (len != MAGIC.Length)
throw new IOException ("Input file is too small.");
var magic = new String (Encoding.UTF8.GetChars (buf, 0, MAGIC.Length));
if (magic != MAGIC)
throw new IOException ("Input file is not a AOT profiler output file.");
// Profile files are not expected to be large, so reading them is ok
len = (int)stream.Length - MAGIC.Length;
data = new byte [len];
pos = 0;
int count = stream.Read (data, 0, len);
if (count != len)
throw new IOException ("Can't read profile file.");
int version = ReadInt ();
int expected_version = (MAJOR_VERSION << 16) | MINOR_VERSION;
if (version != expected_version)
throw new IOException (String.Format ("Expected file version 0x{0:x}, got 0x{1:x}.", expected_version, version));
var modules = new List<ModuleRecord> ();
var types = new List<TypeRecord> ();
var methods = new List<MethodRecord> ();
Dictionary<int, ProfileRecord> records = new Dictionary<int, ProfileRecord> ();
while (true) {
RecordType rtype = (RecordType)data [pos];
pos ++;
if (rtype == RecordType.NONE)
break;
int id = ReadInt ();
switch (rtype) {
case RecordType.IMAGE: {
string name = ReadString ();
string mvid = ReadString ();
var module = new ModuleRecord (id, name, mvid);
records [id] = module;
modules.Add (module);
break;
}
case RecordType.GINST: {
int argc = ReadInt ();
TypeRecord[] tr = new TypeRecord [argc];
for (int i = 0; i < argc; ++i) {
int type_id = ReadInt ();
tr [i] = (TypeRecord)records [type_id];
}
var ginst = new GenericInstRecord (id, tr);
records [id] = ginst;
break;
}
case RecordType.TYPE: {
MonoTypeEnum ttype = (MonoTypeEnum)ReadByte ();
switch (ttype) {
case MonoTypeEnum.MONO_TYPE_CLASS: {
int image_id = ReadInt ();
int ginst_id = ReadInt ();
string name = ReadString ();
GenericInstRecord inst = null;
if (ginst_id != -1)
inst = (GenericInstRecord)records [ginst_id];
var module = (ModuleRecord)records [image_id];
var type = new TypeRecord (id, module, name, inst);
types.Add (type);
records [id] = type;
break;
}
default:
throw new NotImplementedException ();
}
break;
}
case RecordType.METHOD: {
int class_id = ReadInt ();
int ginst_id = ReadInt ();
int param_count = ReadInt ();
string name = ReadString ();
string sig = ReadString ();
var type = (TypeRecord)records [class_id];
GenericInstRecord ginst = ginst_id != -1 ? (GenericInstRecord)records [ginst_id] : null;
var method = new MethodRecord (id, type, ginst, name, sig, param_count);
methods.Add (method);
records [id] = method;
break;
}
default:
throw new NotImplementedException (rtype.ToString ());
}
}
return new ProfileData (modules.ToArray (), types.ToArray (), methods.ToArray ());
}
}
}
@@ -0,0 +1,101 @@
namespace Mono.Profiler.Aot
{
//
// Represents the contents of an .aotprofile file created by the
// AOT profiler
//
public class ProfileRecord
{
public ProfileRecord (int id)
{
Id = id;
}
public int Id {
get; set;
}
}
public class ModuleRecord : ProfileRecord
{
public ModuleRecord (int id, string name, string mvid) : base (id)
{
Name = name;
Mvid = mvid;
}
public string Name {
get; set;
}
public string Mvid {
get; set;
}
}
public class GenericInstRecord : ProfileRecord
{
public GenericInstRecord (int id, TypeRecord[] types) : base (id)
{
Types = types;
}
public TypeRecord[] Types {
get; set;
}
}
public class TypeRecord : ProfileRecord
{
public TypeRecord (int id, ModuleRecord module, string name, GenericInstRecord ginst) : base (id)
{
Module = module;
Name = name;
GenericInst = ginst;
}
public ModuleRecord Module {
get; set;
}
public string Name {
get; set;
}
public GenericInstRecord GenericInst {
get; set;
}
}
public class MethodRecord : ProfileRecord
{
public MethodRecord (int id, TypeRecord type, GenericInstRecord ginst, string name, string sig, int param_count) : base (id)
{
Type = type;
GenericInst = ginst;
Name = name;
Signature = sig;
ParamCount = param_count;
}
public TypeRecord Type {
get; set;
}
public GenericInstRecord GenericInst {
get; set;
}
public string Name {
get; set;
}
public string Signature {
get; set;
}
public int ParamCount {
get; set;
}
}
}
@@ -29,7 +29,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'net_4_x' ">
<OutputPath>./../../class/lib/net_4_x-$(HostPlatform)</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-net_4_x-$(HostPlatform)</IntermediateOutputPath>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM</DefineConstants>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MONO_DATACONVERTER_STATIC_METHOD</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monodroid_tools' ">
<OutputPath>./../../class/lib/monodroid_tools</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-monodroid_tools</IntermediateOutputPath>
<DefineConstants>NET_4_6;MONO;MONODROID_TOOLS;WIN_PLATFORM;MONO_DATACONVERTER_STATIC_METHOD</DefineConstants>
</PropertyGroup>
<!-- @ALL_PROFILE_PROPERTIES@ -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@@ -48,8 +53,11 @@
<!--Common files-->
<ItemGroup>
<Compile Include="..\..\build\common\Consts.cs" />
<Compile Include="..\..\build\common\Locale.cs" />
<Compile Include="..\corlib\Mono\DataConverter.cs" />
<Compile Include="Assembly\AssemblyInfo.cs" />
<Compile Include="Mono.Profiler.Aot\ProfileData.cs" />
<Compile Include="Mono.Profiler.Aot\ProfileReader.cs" />
<Compile Include="Mono.Profiler.Aot\Records.cs" />
<Compile Include="Mono.Profiler.Log\LogBufferHeader.cs" />
<Compile Include="Mono.Profiler.Log\LogEnums.cs" />
<Compile Include="Mono.Profiler.Log\LogEvent.cs" />
@@ -77,6 +85,23 @@
<ProjectReference Include="../System.Core/System.Core.csproj" />
<ProjectReference Include="../corlib/corlib.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monodroid_tools' ">
<Reference Include="./../../../external/binary-reference-assemblies/v4.6/System.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/v4.6/System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="./../../../external/binary-reference-assemblies/v4.6/System.Core.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/v4.6/System.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="./../../../external/binary-reference-assemblies/v4.6/mscorlib.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/v4.6/mscorlib.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
<!-- @ALL_RESOURCES@ -->
<PropertyGroup>
@@ -1,6 +1,7 @@
Assembly/AssemblyInfo.cs
../../build/common/Consts.cs
../../build/common/Locale.cs
../corlib/Mono/DataConverter.cs
Mono.Profiler.Log/LogBufferHeader.cs
Mono.Profiler.Log/LogEnums.cs
Mono.Profiler.Log/LogEvent.cs
@@ -12,3 +13,6 @@ Mono.Profiler.Log/LogProfiler.cs
Mono.Profiler.Log/LogReader.cs
Mono.Profiler.Log/LogStream.cs
Mono.Profiler.Log/LogStreamHeader.cs
Mono.Profiler.Aot/ProfileData.cs
Mono.Profiler.Aot/ProfileReader.cs
Mono.Profiler.Aot/Records.cs
@@ -30,7 +30,7 @@ namespace System.Security.Cryptography.X509Certificates
{
public static class RSACertificateExtensions
{
public static RSA GetRSAPrivateKey(this X509Certificate2 certificate)
public static RSA GetRSAPrivateKey (this X509Certificate2 certificate)
{
if (certificate == null)
throw new ArgumentNullException (nameof (certificate));
@@ -41,16 +41,21 @@ namespace System.Security.Cryptography.X509Certificates
return certificate.Impl.GetRSAPrivateKey ();
}
public static RSA GetRSAPublicKey(this X509Certificate2 certificate)
public static RSA GetRSAPublicKey (this X509Certificate2 certificate)
{
if (certificate == null)
throw new ArgumentNullException("certificate");
throw new ArgumentNullException (nameof (certificate));
return certificate.PublicKey.Key as RSA;
}
public static X509Certificate2 CopyWithPrivateKey(this X509Certificate2 certificate, RSA privateKey)
{
throw new PlatformNotSupportedException();
public static X509Certificate2 CopyWithPrivateKey (this X509Certificate2 certificate, RSA privateKey)
{
if (certificate == null)
throw new ArgumentNullException (nameof (certificate));
if (privateKey == null)
throw new ArgumentNullException (nameof (privateKey));
var impl = certificate.Impl.CopyWithPrivateKey (privateKey);
return (X509Certificate2)impl.CreateCertificate ();
}
}
}
@@ -1 +1,7 @@
../../../external/corefx/src/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs
../../../external/corefx/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.CreateClient.cs
../../../external/corefx/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.CreateServer.cs
../../../external/corefx/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Read.cs
../../../external/corefx/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs
../../../external/corefx/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Write.cs
../../../external/corefx/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTestBase.cs
+1
View File
@@ -520,6 +520,7 @@
<Compile Include="Assembly\AssemblyInfo.cs" />
<Compile Include="System.Data.SqlClient\SQLDebugging.cs" />
<Compile Include="System.Data.SqlClient\SqlCredential.cs" />
<Compile Include="corefx\DataReaderExtensions.cs" />
<Compile Include="corefx\DbConnectionOptions.cs" />
<Compile Include="corefx\DbProviderFactories.mobile.cs" />
<Compile Include="corefx\DiagnosticListener.cs" />
@@ -24,6 +24,7 @@ corefx/SqlParameterCollection.cs
corefx/TdsEnums.cs
corefx/SR.cs
corefx/SqlDependencyUtils.cs
corefx/DataReaderExtensions.cs
../referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
../referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs
../referencesource/System.Data/System/Data/OleDb/PropertyAttributes.cs
@@ -0,0 +1,183 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.ComponentModel;
using System.Data.Common;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace System.Data
{
// copied from CoreFX (NS2.1)
public static class DataReaderExtensions
{
public static bool GetBoolean(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetBoolean(reader.GetOrdinal(name));
}
public static byte GetByte(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetByte(reader.GetOrdinal(name));
}
public static long GetBytes(this DbDataReader reader, string name, long dataOffset, byte[] buffer, int bufferOffset, int length)
{
AssertNotNull(reader);
return reader.GetBytes(reader.GetOrdinal(name), dataOffset, buffer, bufferOffset, length);
}
public static char GetChar(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetChar(reader.GetOrdinal(name));
}
public static long GetChars(this DbDataReader reader, string name, long dataOffset, char[] buffer, int bufferOffset, int length)
{
AssertNotNull(reader);
return reader.GetChars(reader.GetOrdinal(name), dataOffset, buffer, bufferOffset, length);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static DbDataReader GetData(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetData(reader.GetOrdinal(name));
}
public static string GetDataTypeName(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetDataTypeName(reader.GetOrdinal(name));
}
public static DateTime GetDateTime(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetDateTime(reader.GetOrdinal(name));
}
public static decimal GetDecimal(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetDecimal(reader.GetOrdinal(name));
}
public static double GetDouble(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetDouble(reader.GetOrdinal(name));
}
public static Type GetFieldType(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetFieldType(reader.GetOrdinal(name));
}
public static T GetFieldValue<T>(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetFieldValue<T>(reader.GetOrdinal(name));
}
public static Task<T> GetFieldValueAsync<T>(this DbDataReader reader, string name, CancellationToken cancellationToken = default(CancellationToken))
{
AssertNotNull(reader);
return reader.GetFieldValueAsync<T>(reader.GetOrdinal(name), cancellationToken);
}
public static float GetFloat(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetFloat(reader.GetOrdinal(name));
}
public static Guid GetGuid(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetGuid(reader.GetOrdinal(name));
}
public static short GetInt16(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetInt16(reader.GetOrdinal(name));
}
public static int GetInt32(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetInt32(reader.GetOrdinal(name));
}
public static long GetInt64(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetInt64(reader.GetOrdinal(name));
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static Type GetProviderSpecificFieldType(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetProviderSpecificFieldType(reader.GetOrdinal(name));
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static object GetProviderSpecificValue(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetProviderSpecificValue(reader.GetOrdinal(name));
}
public static Stream GetStream(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetStream(reader.GetOrdinal(name));
}
public static string GetString(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetString(reader.GetOrdinal(name));
}
public static TextReader GetTextReader(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetTextReader(reader.GetOrdinal(name));
}
public static object GetValue(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.GetValue(reader.GetOrdinal(name));
}
public static bool IsDBNull(this DbDataReader reader, string name)
{
AssertNotNull(reader);
return reader.IsDBNull(reader.GetOrdinal(name));
}
public static Task<bool> IsDBNullAsync(this DbDataReader reader, string name, CancellationToken cancellationToken = default(CancellationToken))
{
AssertNotNull(reader);
return reader.IsDBNullAsync(reader.GetOrdinal(name), cancellationToken);
}
private static void AssertNotNull(DbDataReader reader)
{
if (reader == null)
{
throw new ArgumentNullException(nameof(reader));
}
}
}
}
@@ -188,6 +188,12 @@ namespace System.Net.Http
public IDictionary<string, object> Properties => _delegatingHandler.Properties;
// Only used in MonoWebRequestHandler and ignored by the other handlers.
internal void SetWebRequestTimeout (TimeSpan timeout)
{
_delegatingHandler.SetWebRequestTimeout (timeout);
}
protected internal override Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) =>
_delegatingHandler.SendAsync (request, cancellationToken);
}
@@ -12,6 +12,10 @@ namespace System.Net.Http
return true;
#endif
// Mono URI handling which does not distinguish between file and url absolute paths without scheme
if (uri.Scheme == Uri.UriSchemeFile && uri.OriginalString.StartsWith ("/", StringComparison.Ordinal))
return true;
return HttpUtilities.IsHttpUri (uri);
}
}
@@ -78,5 +78,8 @@ namespace System.Net.Http
}
Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken);
// Only used by MonoWebRequestHandler and ignored by the other handlers.
void SetWebRequestTimeout (TimeSpan timeout);
}
}
@@ -67,6 +67,7 @@ namespace System.Net.Http
bool unsafeAuthenticatedConnectionSharing;
bool sentRequest;
string connectionGroupName;
TimeSpan? timeout;
bool disposed;
internal MonoWebRequestHandler ()
@@ -368,6 +369,9 @@ namespace System.Net.Http
wr.ServicePoint.Expect100Continue = request.Headers.ExpectContinue == true;
if (timeout != null)
wr.Timeout = (int)timeout.Value.TotalMilliseconds;
// Add request headers
var headers = wr.Headers;
foreach (var header in request.Headers) {
@@ -529,5 +533,10 @@ namespace System.Net.Http
throw new NotImplementedException ();
}
}
void IMonoHttpClientHandler.SetWebRequestTimeout (TimeSpan timeout)
{
this.timeout = timeout;
}
}
}
@@ -269,6 +269,9 @@ namespace System.Net.Http
async Task<HttpResponseMessage> SendAsyncWorker (HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
{
using (var lcts = CancellationTokenSource.CreateLinkedTokenSource (cts.Token, cancellationToken)) {
// Hack to pass the timeout to the HttpWebRequest that's created by MonoWebRequestHandler; all other handlers ignore this.
if (handler is HttpClientHandler clientHandler)
clientHandler.SetWebRequestTimeout (timeout);
lcts.CancelAfter (timeout);
var task = base.SendAsync (request, lcts.Token);
@@ -170,6 +170,9 @@ namespace System.Net.Http
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
// Only used in MonoWebRequestHandler and ignored by the other handlers.
internal void SetWebRequestTimeout (TimeSpan timeout) => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
// NS2.1:
public static System.Func<System.Net.Http.HttpRequestMessage, System.Security.Cryptography.X509Certificates.X509Certificate2, System.Security.Cryptography.X509Certificates.X509Chain, System.Net.Security.SslPolicyErrors, bool> DangerousAcceptAnyServerCertificateValidator => throw new PlatformNotSupportedException ();
}
@@ -33,7 +33,7 @@ namespace System.Net.Http
{
public class HttpMessageInvoker : IDisposable
{
HttpMessageHandler handler;
protected private HttpMessageHandler handler;
readonly bool disposeHandler;
public HttpMessageInvoker (HttpMessageHandler handler)
@@ -34,6 +34,7 @@ namespace System.Net.Http
public class HttpResponseMessage : IDisposable
{
HttpResponseHeaders headers;
HttpResponseHeaders trailingHeaders;
string reasonPhrase;
HttpStatusCode statusCode;
Version version;
@@ -137,5 +138,14 @@ namespace System.Net.Http
return sb.ToString ();
}
public HttpResponseHeaders TrailingHeaders {
get {
if (trailingHeaders == null)
trailingHeaders = new HttpResponseHeaders ();
return trailingHeaders;
}
}
}
}
@@ -374,8 +374,7 @@ namespace MonoTests.System.Net.Http
Assert.AreEqual (response, client.SendAsync (request).Result, "#1");
}
[Test]
[Category ("NotWorking")]
[Test]
public void Send_BaseAddress ()
{
var mh = new HttpMessageHandlerMock ();
@@ -798,42 +797,6 @@ namespace MonoTests.System.Net.Http
}
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
// The SocketsHttpHandler permits custom transfer encodings.
public void Send_Transfer_Encoding_Custom ()
{
if (HttpClientTestHelpers.UsingSocketsHandler)
Assert.Ignore ("Requires LegacyHttpClient");
bool? failed = null;
var listener = NetworkHelpers.CreateAndStartHttpListener("http://*:", out int port, "/Send_Transfer_Encoding_Custom/");
AddListenerContext (listener, l => {
failed = true;
});
try {
var client = HttpClientTestHelpers.CreateHttpClientWithHttpClientHandler ();
client.DefaultRequestHeaders.TransferEncoding.Add (new TransferCodingHeaderValue ("chunked2"));
var request = new HttpRequestMessage (HttpMethod.Get, $"http://localhost:{port}/Send_Transfer_Encoding_Custom/");
try {
client.SendAsync (request, HttpCompletionOption.ResponseHeadersRead).Wait ();
Assert.Fail ("#1");
} catch (AggregateException e) {
Assert.AreEqual (typeof (InvalidOperationException), e.InnerException.GetType (), "#2");
}
Assert.IsNull (failed, "#102");
} finally {
listener.Abort ();
listener.Close ();
}
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
@@ -40,6 +40,11 @@ namespace System.Net.Http
}
}
// This is only used by MonoWebRequestHandler.
void IMonoHttpClientHandler.SetWebRequestTimeout (TimeSpan timeout)
{
}
Task<HttpResponseMessage> IMonoHttpClientHandler.SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) => SendAsync (request, cancellationToken);
}
}
@@ -138,30 +138,33 @@ namespace System.Reflection.Emit {
private static extern void create_dynamic_method (DynamicMethod m);
private void CreateDynMethod () {
if (mhandle.Value == IntPtr.Zero) {
if (ilgen == null || ilgen.ILOffset == 0)
throw new InvalidOperationException ("Method '" + name + "' does not have a method body.");
// Clearing of ilgen in create_dynamic_method is not yet synchronized for multiple threads
lock (this) {
if (mhandle.Value == IntPtr.Zero) {
if (ilgen == null || ilgen.ILOffset == 0)
throw new InvalidOperationException ("Method '" + name + "' does not have a method body.");
ilgen.label_fixup (this);
ilgen.label_fixup (this);
// Have to create all DynamicMethods referenced by this one
try {
// Used to avoid cycles
creating = true;
if (refs != null) {
for (int i = 0; i < refs.Length; ++i) {
if (refs [i] is DynamicMethod) {
DynamicMethod m = (DynamicMethod)refs [i];
if (!m.creating)
m.CreateDynMethod ();
// Have to create all DynamicMethods referenced by this one
try {
// Used to avoid cycles
creating = true;
if (refs != null) {
for (int i = 0; i < refs.Length; ++i) {
if (refs [i] is DynamicMethod) {
DynamicMethod m = (DynamicMethod)refs [i];
if (!m.creating)
m.CreateDynMethod ();
}
}
}
} finally {
creating = false;
}
} finally {
creating = false;
create_dynamic_method (this);
ilgen = null;
}
create_dynamic_method (this);
}
}
@@ -66,8 +66,10 @@ namespace System.Threading
} finally {
lock (this) {
_callsInProcess--;
if (_unregistered && _callsInProcess == 0 && _finalEvent != null)
if (_unregistered && _callsInProcess == 0 && _finalEvent != null) {
EventWaitHandle.Set (_finalEvent.SafeWaitHandle);
_finalEvent = null;
}
}
}
}
@@ -239,6 +239,8 @@ Example */
set {
if (headerCell != value) {
headerCell = value;
headerCell.SetDataGridView(DataGridView);
headerCell.SetColumnIndex(Index);
if (DataGridView != null) {
DataGridView.OnColumnHeaderCellChanged(new DataGridViewColumnEventArgs(this));
}
@@ -262,5 +262,17 @@ namespace MonoTests.System.Windows.Forms
dgv.Columns.Add (dvc);
Assert.IsNull (dvc.CellTemplate.DataGridView, "#1");
}
[Test]
public void SetNewHeaderCell ()
{
var dgv = new DataGridView ();
var dvc = new DataGridViewTextBoxColumn ();
var dch = new DataGridViewColumnHeaderCell ();
dgv.Columns.Add (dvc);
dvc.HeaderCell = dch;
Assert.IsNotNull (dch.DataGridView, "#1");
Assert.True (dch.ColumnIndex >= 0, "#2");
}
}
}
@@ -92,3 +92,5 @@ using System.Runtime.InteropServices;
[assembly: TypeForwardedTo (typeof (System.Collections.Generic.Stack<>))]
[assembly: TypeForwardedTo (typeof (System.Collections.Generic.Queue<>))]
[assembly: TypeForwardedTo (typeof (System.IO.Enumeration.FileSystemName))]
[assembly: TypeForwardedTo (typeof (System.Security.Cryptography.CryptographicOperations))]
@@ -120,25 +120,21 @@ namespace Mono.Net.Security
ServicePointManager.CheckCertificateRevocationList).ConfigureAwait (false);
status = WebExceptionStatus.Success;
request.ServicePoint.UpdateClientCertificate (sslStream.InternalLocalCertificate);
} catch (Exception ex) {
WebConnection.Debug ($"MONO TLS STREAM ERROR: {socket.ID} {socket.CleanedUp} {ex.Message}");
if (socket.CleanedUp)
status = WebExceptionStatus.RequestCanceled;
else if (CertificateValidationFailed)
status = WebExceptionStatus.TrustFailure;
else
status = WebExceptionStatus.SecureChannelFailure;
throw;
} finally {
WebConnection.Debug ($"MONO TLS STREAM CREATE STREAM DONE: {socket.ID} {socket.CleanedUp}");
if (CertificateValidationFailed)
status = WebExceptionStatus.TrustFailure;
if (status == WebExceptionStatus.Success)
request.ServicePoint.UpdateClientCertificate (sslStream.InternalLocalCertificate);
else {
request.ServicePoint.UpdateClientCertificate (null);
sslStream.Dispose ();
sslStream = null;
}
request.ServicePoint.UpdateClientCertificate (null);
sslStream.Dispose ();
sslStream = null;
throw;
}
try {
@@ -146,6 +142,7 @@ namespace Mono.Net.Security
await sslStream.WriteAsync (tunnel.Data, 0, tunnel.Data.Length, cancellationToken).ConfigureAwait (false);
} catch {
status = WebExceptionStatus.SendFailure;
sslStream.Dispose ();
sslStream = null;
throw;
}
@@ -104,9 +104,14 @@ namespace System.IO.Compression
{
}
~DeflateStream () => Dispose (false);
protected override void Dispose (bool disposing)
{
native.Dispose (disposing);
if (disposing)
GC.SuppressFinalize (this);
native?.Dispose (disposing);
if (disposing && !disposed) {
disposed = true;
@@ -135,12 +140,15 @@ namespace System.IO.Compression
internal ValueTask<int> ReadAsyncMemory (Memory<byte> destination, CancellationToken cancellationToken)
{
throw new NotImplementedException ();
return base.ReadAsync(destination, cancellationToken);
}
internal int ReadCore (Span<byte> destination)
{
throw new NotImplementedException ();
var buffer = new byte [destination.Length];
int count = Read(buffer, 0, buffer.Length);
buffer.AsSpan(0, count).CopyTo(destination);
return count;
}
public override int Read (byte[] array, int offset, int count)
@@ -175,12 +183,12 @@ namespace System.IO.Compression
internal ValueTask WriteAsyncMemory (ReadOnlyMemory<byte> source, CancellationToken cancellationToken)
{
throw new NotImplementedException ();
return base.WriteAsync(source, cancellationToken);
}
internal void WriteCore (ReadOnlySpan<byte> source)
{
throw new NotImplementedException ();
Write (source.ToArray (), 0, source.Length);
}
public override void Write (byte[] array, int offset, int count)
@@ -380,18 +388,18 @@ namespace System.IO.Compression
if (disposing && !disposed) {
disposed = true;
GC.SuppressFinalize (this);
io_buffer = null;
} else {
// When we are in the finalizer we don't want to access the underlying stream anymore
base_stream = Stream.Null;
}
io_buffer = null;
if (z_stream != null) {
if (z_stream != null && !z_stream.IsInvalid) {
z_stream.Dispose();
}
if (data.IsAllocated) {
if (data != null && data.IsAllocated) {
data.Free ();
}
}
+6 -3
View File
@@ -128,8 +128,10 @@ namespace System.IO {
lock (watches) {
data = (DefaultWatcherData) watches [fsw];
if (data != null) {
data.Enabled = false;
data.DisabledTime = DateTime.UtcNow;
lock (data.FilesLock) {
data.Enabled = false;
data.DisabledTime = DateTime.UtcNow;
}
}
}
}
@@ -221,7 +223,8 @@ namespace System.IO {
}
lock (data.FilesLock) {
IterateAndModifyFilesData (data, directory, dispatch, files);
if (data.Enabled)
IterateAndModifyFilesData (data, directory, dispatch, files);
}
}
@@ -1,75 +0,0 @@
//
// System.IO.FileSystemEventArgs.cs
//
// Author:
// Tim Coleman ([email protected])
//
// Copyright (C) Tim Coleman, 2002
//
//
// 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;
namespace System.IO {
public class FileSystemEventArgs : EventArgs {
#region Fields
WatcherChangeTypes changeType;
string directory;
string name;
#endregion // Fields
#region Constructors
public FileSystemEventArgs (WatcherChangeTypes changeType, string directory, string name)
{
this.changeType = changeType;
this.directory = directory;
this.name = name;
}
internal void SetName (string name)
{
this.name = name;
}
#endregion // Constructors
#region Properties
public WatcherChangeTypes ChangeType {
get { return changeType; }
}
public string FullPath {
get { return Path.Combine (directory, name); }
}
public string Name {
get { return name; }
}
#endregion // Properties
}
}
@@ -1,33 +0,0 @@
//
// System.IO.FileSystemEventHandler.cs
//
// Author:
// Tim Coleman ([email protected])
//
// Copyright (C) Tim Coleman, 2002
// Copyright (C) 2006 Novell, Inc (http://www.novell.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.
//
namespace System.IO {
public delegate void FileSystemEventHandler (object sender, FileSystemEventArgs e);
}
@@ -420,6 +420,8 @@ namespace System.IO {
}
private void RaiseEvent (Delegate ev, EventArgs arg, EventType evtype)
{
if (disposed)
return;
if (ev == null)
return;
@@ -497,11 +499,15 @@ namespace System.IO {
internal void DispatchErrorEvents (ErrorEventArgs args)
{
if (disposed)
return;
OnError (args);
}
internal void DispatchEvents (FileAction act, string filename, ref RenamedEventArgs renamed)
{
if (disposed)
return;
if (waiting) {
lastData = new WaitForChangedResult ();
}
+61 -15
View File
@@ -912,20 +912,61 @@ namespace System.Net.Sockets
try {
IPAddress [] addresses;
SocketAsyncResult ares;
bool pending;
/*
* Both BeginSConnect() and BeginMConnect() now return a `bool` indicating whether or
* not an async operation is pending.
*/
if (!GetCheckedIPs (e, out addresses)) {
//NOTE: DualMode may cause Socket's RemoteEndpoint to differ in AddressFamily from the
// SocketAsyncEventArgs, but the SocketAsyncEventArgs itself is not changed
ares = (SocketAsyncResult) BeginConnect (e.RemoteEndPoint, ConnectAsyncCallback, e);
ares = new SocketAsyncResult (this, ConnectAsyncCallback, e, SocketOperation.Connect) {
EndPoint = e.RemoteEndPoint
};
pending = BeginSConnect (ares);
} else {
DnsEndPoint dep = (DnsEndPoint)e.RemoteEndPoint;
ares = (SocketAsyncResult) BeginConnect (addresses, dep.Port, ConnectAsyncCallback, e);
if (addresses == null)
throw new ArgumentNullException ("addresses");
if (addresses.Length == 0)
throw new ArgumentException ("Empty addresses list");
if (this.AddressFamily != AddressFamily.InterNetwork && this.AddressFamily != AddressFamily.InterNetworkV6)
throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
if (dep.Port <= 0 || dep.Port > 65535)
throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
ares = new SocketAsyncResult (this, ConnectAsyncCallback, e, SocketOperation.Connect) {
Addresses = addresses,
Port = dep.Port,
};
is_connected = false;
pending = BeginMConnect (ares);
}
if (ares.IsCompleted && ares.CompletedSynchronously) {
ares.CheckIfThrowDelayedException ();
return false;
if (!pending) {
/*
* On synchronous completion, the async callback will not be invoked.
*
* We need to call `EndConnect ()` here to close the socket and make sure
* that any pending exceptions are properly propagated.
*
* Note that we're not calling `e.Complete ()` (or resetting `e.in_progress`) here.
*/
e.current_socket.EndConnect (ares);
}
return pending;
} catch (SocketException exc) {
e.SocketError = exc.SocketErrorCode;
e.socket_async_result.Complete (exc, true);
return false;
} catch (Exception exc) {
e.socket_async_result.Complete (exc, true);
return false;
@@ -1044,7 +1085,7 @@ namespace System.Net.Sockets
return sockares;
}
static void BeginMConnect (SocketAsyncResult sockares)
static bool BeginMConnect (SocketAsyncResult sockares)
{
Exception exc = null;
@@ -1053,17 +1094,18 @@ namespace System.Net.Sockets
sockares.CurrentAddress++;
sockares.EndPoint = new IPEndPoint (sockares.Addresses [i], sockares.Port);
BeginSConnect (sockares);
return;
return BeginSConnect (sockares);
} catch (Exception e) {
exc = e;
}
}
sockares.Complete (exc, true);
return false;
throw exc;
}
static void BeginSConnect (SocketAsyncResult sockares)
static bool BeginSConnect (SocketAsyncResult sockares)
{
EndPoint remoteEP = sockares.EndPoint;
// Bug #75154: Connect() should not succeed for .Any addresses.
@@ -1071,14 +1113,15 @@ namespace System.Net.Sockets
IPEndPoint ep = (IPEndPoint) remoteEP;
if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
sockares.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
return;
return false;
}
sockares.EndPoint = remoteEP = sockares.socket.RemapIPEndPoint (ep);
}
if (!sockares.socket.CanTryAddressFamily(sockares.EndPoint.AddressFamily)) {
throw new ArgumentException(SR.net_invalidAddressList);
sockares.Complete (new ArgumentException(SR.net_invalidAddressList), true);
return false;
}
int error = 0;
@@ -1090,8 +1133,10 @@ namespace System.Net.Sockets
sockares.socket.connect_in_progress = false;
sockares.socket.m_Handle.Dispose ();
sockares.socket.m_Handle = new SafeSocketHandle (sockares.socket.Socket_internal (sockares.socket.addressFamily, sockares.socket.socketType, sockares.socket.protocolType, out error), true);
if (error != 0)
throw new SocketException (error);
if (error != 0) {
sockares.Complete (new SocketException (error), true);
return false;
}
}
bool blk = sockares.socket.is_blocking;
@@ -1106,7 +1151,7 @@ namespace System.Net.Sockets
sockares.socket.is_connected = true;
sockares.socket.is_bound = true;
sockares.Complete (true);
return;
return false;
}
if (error != (int) SocketError.InProgress && error != (int) SocketError.WouldBlock) {
@@ -1114,7 +1159,7 @@ namespace System.Net.Sockets
sockares.socket.is_connected = false;
sockares.socket.is_bound = false;
sockares.Complete (new SocketException (error), true);
return;
return false;
}
// continue asynch
@@ -1123,6 +1168,7 @@ namespace System.Net.Sockets
sockares.socket.connect_in_progress = true;
IOSelector.Add (sockares.Handle, new IOSelectorJob (IOOperation.Write, BeginConnectCallback, sockares));
return true;
}
static IOAsyncCallback BeginConnectCallback = new IOAsyncCallback (ares => {
@@ -153,7 +153,7 @@ namespace System.Net.Sockets
Socket completedSocket = socket;
SocketOperation completedOperation = operation;
if (this.AsyncCallback != null) {
if (!CompletedSynchronously && AsyncCallback != null) {
ThreadPool.UnsafeQueueUserWorkItem(state => ((SocketAsyncResult)state).AsyncCallback((SocketAsyncResult)state), this);
}
@@ -64,6 +64,23 @@ namespace System.Net
return await InnerStream.ReadAsync (
buffer, offset, size, cancellationToken).ConfigureAwait (false);
}
internal bool TryReadFromBuffer (byte[] buffer, int offset, int size, out int result)
{
var remaining = readBuffer?.Size ?? 0;
if (remaining <= 0) {
result = 0;
return InnerStream == null;
}
int copy = (remaining > size) ? size : remaining;
Buffer.BlockCopy (readBuffer.Buffer, readBuffer.Offset, buffer, offset, copy);
readBuffer.Offset += copy;
readBuffer.Size -= copy;
offset += copy;
size -= copy;
result = copy;
return true;
}
}
}
@@ -80,8 +80,8 @@ namespace System.Net {
if (!File.Exists (pvk_file))
return null;
var cert = new X509Certificate2 (cert_file);
cert.PrivateKey = PrivateKey.CreateFromFile (pvk_file).RSA;
certificate = cert;
var privateKey = PrivateKey.CreateFromFile (pvk_file).RSA;
certificate = new X509Certificate2 ((X509Certificate2Impl)cert.Impl.CopyWithPrivateKey (privateKey));
return certificate;
} catch {
// ignore errors
@@ -110,11 +110,12 @@ namespace System.Net
return e;
}
protected abstract bool TryReadFromBufferedContent (byte[] buffer, int offset, int count, out int result);
public override int Read (byte[] buffer, int offset, int count)
{
if (!CanRead)
throw new NotSupportedException (SR.net_writeonlystream);
Operation.ThrowIfClosedOrDisposed ();
if (buffer == null)
throw new ArgumentNullException (nameof (buffer));
@@ -125,7 +126,13 @@ namespace System.Net
if (count < 0 || (length - offset) < count)
throw new ArgumentOutOfRangeException (nameof (count));
try {
if (TryReadFromBufferedContent (buffer, offset, count, out var result))
return result;
Operation.ThrowIfClosedOrDisposed ();
try
{
return ReadAsync (buffer, offset, count, CancellationToken.None).Result;
} catch (Exception e) {
throw GetException (e);
@@ -406,6 +406,8 @@ namespace System.Net
return Task.FromException<int> (new NotSupportedException (SR.net_writeonlystream));
}
protected override bool TryReadFromBufferedContent (byte[] buffer, int offset, int count, out int result) => throw new InvalidOperationException ();
protected override void Close_internal (ref bool disposed)
{
WebConnection.Debug ($"{ME} CLOSE: {disposed} {requestWritten} {allowBuffering}");
@@ -184,6 +184,15 @@ namespace System.Net
}, () => Operation.Aborted, cancellationToken);
}
protected override bool TryReadFromBufferedContent (byte[] buffer, int offset, int count, out int result)
{
if (bufferedEntireContent && innerStream is BufferedReadStream bufferedStream)
return bufferedStream.TryReadFromBuffer (buffer, offset, count, out result);
result = 0;
return false;
}
bool CheckAuthHeader (string headerName)
{
var authHeader = Headers[headerName];
@@ -372,6 +381,7 @@ namespace System.Net
var buffer = await ReadAllAsyncInner (cancellationToken).ConfigureAwait (false);
var bos = new BufferOffsetSize (buffer, 0, buffer.Length, false);
innerStream = new BufferedReadStream (Operation, null, bos);
bufferedEntireContent = true;
nextReadCalled = true;
completion.TrySetCompleted ();
@@ -83,6 +83,18 @@ namespace System.Security.Cryptography.X509Certificates
public abstract void AppendPrivateKeyInfo (StringBuilder sb);
public sealed override X509CertificateImpl CopyWithPrivateKey (RSA privateKey)
{
var impl = (X509Certificate2Impl)Clone ();
impl.PrivateKey = privateKey;
return impl;
}
public sealed override X509Certificate CreateCertificate ()
{
return new X509Certificate2 (this);
}
public abstract void Reset ();
}
}
+4 -4
View File
@@ -409,7 +409,11 @@
<Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionLevel.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionMode.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.FileSystem.Watcher\src\System\IO\FileSystemEventArgs.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.FileSystem.Watcher\src\System\IO\FileSystemEventHandler.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.FileSystem.Watcher\src\System\IO\FileSystemWatcher.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.FileSystem.Watcher\src\System\IO\RenamedEventArgs.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.FileSystem.Watcher\src\System\IO\RenamedEventHandler.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.FileSystem.Watcher\src\System\IO\WaitForChangedResult.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Mail\src\System\Net\Base64Stream.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Mail\src\System\Net\BufferBuilder.cs" />
@@ -864,14 +868,10 @@
<Compile Include="System.IO.Compression\DeflateStream.cs" />
<Compile Include="System.IO\ErrorEventArgs.cs" />
<Compile Include="System.IO\ErrorEventHandler.cs" />
<Compile Include="System.IO\FileSystemEventArgs.cs" />
<Compile Include="System.IO\FileSystemEventHandler.cs" />
<Compile Include="System.IO\IODescriptionAttribute.cs" />
<Compile Include="System.IO\InternalBufferOverflowException.cs" />
<Compile Include="System.IO\InvalidDataException.cs" />
<Compile Include="System.IO\NotifyFilters.cs" />
<Compile Include="System.IO\RenamedEventArgs.cs" />
<Compile Include="System.IO\RenamedEventHandler.cs" />
<Compile Include="System.IO\WatcherChangeTypes.cs" />
<Compile Include="System.Net.Mail\AlternateView.cs" />
<Compile Include="System.Net.Mail\AlternateViewCollection.cs" />
@@ -110,6 +110,9 @@ System/RemoteExecutorTests.cs
# System.IO.FileSystemWatcher
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/Utility/*.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/Args.ErrorEventArgs.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/Args.RenamedEventArgs.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs
../../../external/corefx/src/Common/tests/System/IO/TempFile.cs
@@ -4707,9 +4707,10 @@ namespace MonoTests.System.Net.Sockets
socketArgs.RemoteEndPoint = endPoint;
socketArgs.Completed += (sender, e) => mre.Set ();
socket.ConnectAsync (socketArgs);
if (socket.ConnectAsync (socketArgs))
Assert.IsTrue (mre.WaitOne (1000), "ConnectedAsync timeout");
Assert.IsTrue (mre.WaitOne (1000), "ConnectedAsync timeout");
Assert.AreNotEqual (SocketError.Success, socketArgs.SocketError);
}
[Test] // Covers https://bugzilla.xamarin.com/show_bug.cgi?id=52549
@@ -16,7 +16,7 @@ namespace MonoTests.System.Net.WebSockets
[TestFixture]
public class ClientWebSocketTest
{
const string EchoServerUrl = "ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx";
const string EchoServerUrl = "ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx";
ClientWebSocket socket;
MethodInfo headerSetMethod;
@@ -3230,6 +3230,54 @@ namespace MonoTests.System.Net
var gr = wr.BeginGetResponse (delegate { }, null);
Assert.AreEqual (true, gr.AsyncWaitHandle.WaitOne (5000), "#1");
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Read_ErrorResponse_After_Abort ()
{
const string message = "Hello World!";
using (SocketResponder responder = new SocketResponder (out var ep, socket => {
var buffer = new byte [4096];
var bytesReceived = socket.Receive (buffer);
while (bytesReceived > 0) {
// We don't check for Content-Length or anything else here, so we give the client a little time to write
// after sending the headers
Thread.Sleep (200);
if (socket.Available > 0) {
bytesReceived = socket.Receive (buffer);
} else {
bytesReceived = 0;
}
}
var sw = new StringWriter ();
sw.WriteLine ("HTTP/1.1 500 Too Lazy");
sw.WriteLine ($"Content-Length: {message.Length}");
sw.WriteLine ();
sw.Write (message);
sw.Flush ();
return Encoding.UTF8.GetBytes (sw.ToString ());
})) {
string url = $"http://{ep}/test/";
HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
try {
req.GetResponse ();
Assert.Fail ("#1");
} catch (WebException ex) {
req.Abort ();
var res = (HttpWebResponse)ex.Response;
Assert.IsNotNull (res, "#2");
using (var r = new StreamReader(res.GetResponseStream())) {
var body = r.ReadToEnd();
Assert.AreEqual (message, body, "#3");
}
}
}
}
}
static class StreamExtensions {
+5 -5
View File
@@ -29,14 +29,10 @@ System.IO.Compression/DeflateStream.cs
System.IO/ErrorEventArgs.cs
System.IO/ErrorEventHandler.cs
System.IO/FileSystemEventArgs.cs
System.IO/FileSystemEventHandler.cs
System.IO/InternalBufferOverflowException.cs
System.IO/InvalidDataException.cs
System.IO/IODescriptionAttribute.cs
System.IO/NotifyFilters.cs
System.IO/RenamedEventArgs.cs
System.IO/RenamedEventHandler.cs
System.IO/WatcherChangeTypes.cs
System.Net/BasicClient.cs
@@ -873,13 +869,17 @@ ReferenceSources/Win32Exception.cs
../../../external/corefx/src/System.Private.Uri/src/System/UriBuilder.cs
../../../external/corefx/src/System.Runtime.Extensions/src/System/CodeDom/Compiler/IndentedTextWriter.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventHandler.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/RenamedEventArgs.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/RenamedEventHandler.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/WaitForChangedResult.cs
../../../external/corefx/src/System.Runtime.InteropServices/src/System/Security/SecureStringMarshal.cs
../../../external/corefx/src/System.Runtime.Extensions/src/System/StringNormalizationExtensions.cs
../../../external/corefx/src/System.Diagnostics.StackTrace/src/System/Diagnostics/StackFrameExtensions.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs
# Everything except compiled
../../../external/corefx/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Capture.cs
@@ -8,3 +8,9 @@
../../../external/corefx/src/System.CodeDom/tests/Microsoft/CSharp/*.cs
../../../external/corefx/src/System.CodeDom/tests/Microsoft/VisualBasic/*.cs
../../../external/corefx/src/System.CodeDom/tests/*.cs
System/RemoteExecutorTests.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs
@@ -1,14 +1 @@
#include monotouch_System_xtest.dll.exclude.sources
../../../external/corefx/src/System.CodeDom/tests/CodeCollections/*.cs
../../../external/corefx/src/System.CodeDom/tests/CodeExpressions/*.cs
../../../external/corefx/src/System.CodeDom/tests/CodeObjects/*.cs
../../../external/corefx/src/System.CodeDom/tests/CodeStatements/*.cs
../../../external/corefx/src/System.CodeDom/tests/CodeTypeMembers/*.cs
../../../external/corefx/src/System.CodeDom/tests/Compiler/*.cs
../../../external/corefx/src/System.CodeDom/tests/Other/*.cs
../../../external/corefx/src/System.CodeDom/tests/Microsoft/CSharp/*.cs
../../../external/corefx/src/System.CodeDom/tests/Microsoft/VisualBasic/*.cs
../../../external/corefx/src/System.CodeDom/tests/*.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs
@@ -1,17 +1,8 @@
#include monotouch_System_xtest.dll.exclude.sources
../../../external/corefx/src/System.CodeDom/tests/CodeCollections/*.cs
../../../external/corefx/src/System.CodeDom/tests/CodeExpressions/*.cs
../../../external/corefx/src/System.CodeDom/tests/CodeObjects/*.cs
../../../external/corefx/src/System.CodeDom/tests/CodeStatements/*.cs
../../../external/corefx/src/System.CodeDom/tests/CodeTypeMembers/*.cs
../../../external/corefx/src/System.CodeDom/tests/Compiler/*.cs
../../../external/corefx/src/System.CodeDom/tests/Other/*.cs
../../../external/corefx/src/System.CodeDom/tests/Microsoft/CSharp/*.cs
../../../external/corefx/src/System.CodeDom/tests/Microsoft/VisualBasic/*.cs
../../../external/corefx/src/System.CodeDom/tests/*.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.cs
../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs
../../../external/corefx/src/System.Net.Security/tests/FunctionalTests/*.cs
../../../external/corefx/src/System.Net.WebClient/tests/WebClientTest.cs
../../../external/corefx/src/Common/tests/System/Net/WebSockets/WebSocketCreateTest.cs
../../../external/corefx/src/System.Net.WebSockets/tests/WebSocketTests.netcoreapp.cs
@@ -0,0 +1 @@
System/RemoteExecutorTests.cs
+3 -6
View File
@@ -232,7 +232,7 @@ TEST_RESOURCES = $(TEST_RESX_RESOURCES) $(TEST_RESX_RESOURCES_SATELITE)
satellite_assembly1 = $(test_lib_dir)/es-ES/$(patsubst %.dll,%.resources.dll,$(test_lib))
satellite_assembly2 = $(test_lib_dir)/nn-NO/$(patsubst %.dll,%.resources.dll,$(test_lib))
$(test_lib_output): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) $(test_lib_dir)
$(test_lib_output): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) | $(test_lib_dir)
mscorlib_for_profile = $(topdir)/class/lib/$(PROFILE)/mscorlib.dll
@@ -298,11 +298,8 @@ NO_VTS_TEST = yes
endif
ifndef NO_VTS_TEST
test: test-vts
run-test: run-test-vts
else
test:
run-test:
test-local: test-vts
run-test-local: run-test-vts
endif
EXTRA_DISTFILES += \
@@ -34,6 +34,36 @@ namespace System.Globalization
[StructLayout (LayoutKind.Sequential)]
partial class CalendarData
{
private static string[] HEBREW_MONTH_NAMES = new[] {
"\u05EA\u05E9\u05E8\u05D9",
"\u05D7\u05E9\u05D5\u05DF",
"\u05DB\u05E1\u05DC\u05D5",
"\u05D8\u05D1\u05EA",
"\u05E9\u05D1\u05D8",
"\u05D0\u05D3\u05E8",
"\u05D0\u05D3\u05E8\u0020\u05D1",
"\u05E0\u05D9\u05E1\u05DF",
"\u05D0\u05D9\u05D9\u05E8",
"\u05E1\u05D9\u05D5\u05DF",
"\u05EA\u05DE\u05D5\u05D6",
"\u05D0\u05D1",
"\u05D0\u05DC\u05D5\u05DC" };
private static string[] HEBREW_LEAP_MONTH_NAMES = new[] {
"\u05EA\u05E9\u05E8\u05D9",
"\u05D7\u05E9\u05D5\u05DF",
"\u05DB\u05E1\u05DC\u05D5",
"\u05D8\u05D1\u05EA",
"\u05E9\u05D1\u05D8",
"\u05D0\u05D3\u05E8\u0020\u05D0",
"\u05D0\u05D3\u05E8\u0020\u05D1",
"\u05E0\u05D9\u05E1\u05DF",
"\u05D0\u05D9\u05D9\u05E8",
"\u05E1\u05D9\u05D5\u05DF",
"\u05EA\u05DE\u05D5\u05D6",
"\u05D0\u05D1",
"\u05D0\u05DC\u05D5\u05DC" };
public static int nativeGetTwoDigitYearMax (int calID)
{
// -1 mean OS does not override default BCL max year
@@ -43,7 +73,17 @@ namespace System.Globalization
static bool nativeGetCalendarData (CalendarData data, string localeName, int calendarId)
{
// TODO: Convert calendar-id to mono runtime calendar-id when it's used
return data.fill_calendar_data (localeName.ToLowerInvariant (), calendarId);
if (data.fill_calendar_data (localeName.ToLowerInvariant (), calendarId)) {
if ((CalendarId)calendarId == CalendarId.HEBREW) {
// HACK: Generate leap month names because the native code does not do it
// and tests would fail to round-trip dates on leap years.
// https://github.com/mono/mono/issues/16623
data.saMonthNames = HEBREW_MONTH_NAMES;
data.saLeapYearMonthNames = HEBREW_LEAP_MONTH_NAMES;
}
return true;
}
return false;
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
@@ -8,6 +8,7 @@ using System.Text;
namespace System.Reflection
{
[Serializable]
partial class MethodBase
{
//
@@ -28,9 +28,9 @@
namespace System.Diagnostics.Tracing
{
public class EventCounter : IDisposable
public class EventCounter : DiagnosticCounter
{
public EventCounter (string name, EventSource eventSource)
public EventCounter (string name, EventSource eventSource) : base (name, eventSource)
{
}
@@ -38,7 +38,7 @@ namespace System.Diagnostics.Tracing
{
}
public void Dispose ()
public void WriteMetric (double value)
{
}
}
@@ -174,6 +174,10 @@ namespace System.Diagnostics.Tracing
{
}
internal void ReportOutOfBandMessage (string msg, bool flush)
{
}
protected void WriteEvent (int eventId)
{
WriteEvent (eventId, new object[] { } );
@@ -54,6 +54,18 @@ namespace System.Diagnostics.Tracing
internal set;
}
public long OSThreadId
{
get;
internal set;
}
public DateTime TimeStamp
{
get;
internal set;
}
public string EventName
{
get;
@@ -134,30 +134,33 @@ namespace System.Reflection.Emit {
private static extern void create_dynamic_method (DynamicMethod m);
private void CreateDynMethod () {
if (mhandle.Value == IntPtr.Zero) {
if (ilgen == null || ilgen.ILOffset == 0)
throw new InvalidOperationException ("Method '" + name + "' does not have a method body.");
// Clearing of ilgen in create_dynamic_method is not yet synchronized for multiple threads
lock (this) {
if (mhandle.Value == IntPtr.Zero) {
if (ilgen == null || ilgen.ILOffset == 0)
throw new InvalidOperationException ("Method '" + name + "' does not have a method body.");
ilgen.label_fixup (this);
ilgen.label_fixup (this);
// Have to create all DynamicMethods referenced by this one
try {
// Used to avoid cycles
creating = true;
if (refs != null) {
for (int i = 0; i < refs.Length; ++i) {
if (refs [i] is DynamicMethod) {
DynamicMethod m = (DynamicMethod)refs [i];
if (!m.creating)
m.CreateDynMethod ();
// Have to create all DynamicMethods referenced by this one
try {
// Used to avoid cycles
creating = true;
if (refs != null) {
for (int i = 0; i < refs.Length; ++i) {
if (refs [i] is DynamicMethod) {
DynamicMethod m = (DynamicMethod)refs [i];
if (!m.creating)
m.CreateDynMethod ();
}
}
}
} finally {
creating = false;
}
} finally {
creating = false;
create_dynamic_method (this);
ilgen = null;
}
create_dynamic_method (this);
}
}
@@ -365,4 +365,12 @@
clt.un
ret
}
.method public hidebysig static !!T& Unbox<valuetype .ctor ([mscorlib]System.ValueType) T> (object 'box') cil managed aggressiveinlining
{
.maxstack 1
ldarg.0
unbox !!T
ret
}
}
@@ -518,7 +518,7 @@ namespace System.Runtime.InteropServices
return (IntPtr)(-1);
}
#elif !MONOTOUCH
#else
public static IntPtr GetHINSTANCE (Module m) => throw new PlatformNotSupportedException();
public static IntPtr GetIDispatchForObject (object o) => throw new PlatformNotSupportedException();
public static object GetTypedObjectForIUnknown (IntPtr pUnk, Type t) => throw new PlatformNotSupportedException();
@@ -211,12 +211,12 @@ namespace System.Runtime.InteropServices
else
perform_release = true;
/* Attempt the update to the new state, fail and retry if the initial
* state has been modified in the meantime. Decrement the ref count by
* substracting SH_RefCountOne from the state then OR in the bits for
* Dispose (if that's the reason for the Release) and closed (if the
* initial ref count was 1). */
new_state = (old_state & RefCount_Mask) - RefCount_One;
// Not closed, let's propose an update (to the ref count, just add
// StateBits.RefCountOne to the state to effectively add 1 to the ref count).
// Continue doing this until the update succeeds (because nobody
// modifies the state field between the read and write operations) or
// the state moves to closed.
new_state = old_state - RefCount_One;
if ((old_state & RefCount_Mask) == RefCount_One)
new_state |= (int) State.Closed;
if (dispose)
@@ -431,7 +431,11 @@ namespace System.Runtime.Remoting.Messaging {
ArrayList ret = null;
if (null != _serializedArgs) {
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (_serializedArgs));
// Avoid cross domain refs between MemoryStream and _serializedArgs byte array
byte[] copyArray = new byte [_serializedArgs.Length];
Array.Copy (_serializedArgs, copyArray, _serializedArgs.Length);
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (copyArray));
ret = new ArrayList (oret);
_serializedArgs = null;
}
@@ -498,7 +502,11 @@ namespace System.Runtime.Remoting.Messaging {
ArrayList ret = null;
if (null != _serializedArgs) {
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (_serializedArgs));
// Avoid cross domain refs between MemoryStream and _serializedArgs byte array
byte[] copyArray = new byte [_serializedArgs.Length];
Array.Copy (_serializedArgs, copyArray, _serializedArgs.Length);
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (copyArray));
ret = new ArrayList (oret);
_serializedArgs = null;
}
@@ -123,6 +123,10 @@ namespace System.Security.Cryptography.X509Certificates
public abstract byte[] Export (X509ContentType contentType, SafePasswordHandle password);
public abstract X509CertificateImpl CopyWithPrivateKey (RSA privateKey);
public abstract X509Certificate CreateCertificate ();
public sealed override bool Equals (object obj)
{
var other = obj as X509CertificateImpl;
@@ -83,12 +83,14 @@ namespace System.Threading
lock (this) {
_unregistered = true;
if (_callsInProcess == 0 && _finalEvent != null)
if (_callsInProcess == 0 && _finalEvent != null) {
#if NETCORE
throw new NotImplementedException ();
#else
NativeEventCalls.SetEvent (_finalEvent.SafeWaitHandle);
_finalEvent = null;
#endif
}
}
} catch (ObjectDisposedException) {
// Can happen if we called Unregister before we had time to execute Wait
@@ -109,12 +111,14 @@ namespace System.Threading
lock (this)
{
_callsInProcess--;
if (_unregistered && _callsInProcess == 0 && _finalEvent != null)
if (_unregistered && _callsInProcess == 0 && _finalEvent != null) {
#if NETCORE
EventWaitHandle.Set (_finalEvent.SafeWaitHandle);
#else
NativeEventCalls.SetEvent (_finalEvent.SafeWaitHandle);
#endif
_finalEvent = null;
}
}
}
}
@@ -294,6 +294,11 @@ namespace System.Threading {
th.principal = value;
}
}
#else
public static IPrincipal CurrentPrincipal {
get => throw new PlatformNotSupportedException ();
set => throw new PlatformNotSupportedException ();
}
#endif
public static AppDomain GetDomain() {
@@ -44,10 +44,13 @@ namespace System {
public partial class TimeZoneInfo {
[DllImport ("__Internal")]
extern static string xamarin_timezone_get_local_name ();
static TimeZoneInfo CreateLocal ()
{
using (Stream stream = GetMonoTouchData (null)) {
return BuildFromStream ("Local", stream);
return BuildFromStream (xamarin_timezone_get_local_name (), stream);
}
}
@@ -68,7 +71,7 @@ namespace System {
}
}
}
[DllImport ("__Internal")]
extern static IntPtr xamarin_timezone_get_names (ref int count);
+13 -3
View File
@@ -919,8 +919,9 @@ namespace System
DateTime DST_end = TransitionPoint (rule.DaylightTransitionEnd, year + ((rule.DaylightTransitionStart.Month < rule.DaylightTransitionEnd.Month) ? 0 : 1));
if (dateTime.Kind == DateTimeKind.Utc) {
DST_start -= BaseUtcOffset;
DST_end -= (BaseUtcOffset + rule.DaylightDelta);
DST_end -= BaseUtcOffset;
}
DST_end -= rule.DaylightDelta;
return (dateTime >= DST_start && dateTime < DST_end);
}
@@ -1215,10 +1216,13 @@ namespace System
return false;
}
var isUtc = false;
if (dateTime.Kind != DateTimeKind.Utc) {
if (!TryAddTicks (date, -BaseUtcOffset.Ticks, out date, DateTimeKind.Utc))
return false;
}
} else
isUtc = true;
AdjustmentRule current = GetApplicableRule (date);
if (current != null) {
@@ -1230,12 +1234,18 @@ namespace System
if (forOffset)
isDst = true;
offset = baseUtcOffset;
if (date >= new DateTime (tStart.Ticks + current.DaylightDelta.Ticks, DateTimeKind.Utc))
if (isUtc || (date >= new DateTime (tStart.Ticks + current.DaylightDelta.Ticks, DateTimeKind.Utc)))
{
offset += current.DaylightDelta;
isDst = true;
}
if (date >= new DateTime (tEnd.Ticks - current.DaylightDelta.Ticks, DateTimeKind.Utc))
{
offset = baseUtcOffset;
isDst = false;
}
return true;
}
}
@@ -428,7 +428,7 @@ public class CalendarTest {
new Date(28,10,2038,1),
new Date(13,10,1460,1),
new Date(12,2,5799,1),
new Date(10,11,50,4),
new Date(10,11,20,5),
new Date(10,11,127,1),
new Date(10,11,4371,1),
new Date(10,11,2581,1));
@@ -436,7 +436,7 @@ public class CalendarTest {
new Date(5,7,2094,1),
new Date(6,3,1518,1),
new Date(5,11,5854,1),
new Date(18,7,106,4),
new Date(18,7,76,5),
new Date(18,7,183,1),
new Date(18,7,4427,1),
new Date(18,7,2637,1));
@@ -495,7 +495,7 @@ public class CalendarTest {
foreach (Calendar cal in acal) {
int check = 1;
if (cal is JapaneseCalendar)
check = 4;
check = 5;
Assert.AreEqual(check, cal.Eras.Length,
String.Format("D01 {0}.Eras.Length", cal));
cal.Eras[0] = 29;
@@ -507,11 +507,12 @@ public class CalendarTest {
public void TestErasProperty2() {
Assert.AreEqual(1, clcal.Eras.Length, "cn");
Assert.AreEqual(1, tlcal.Eras.Length, "tw");
Assert.AreEqual(2, jlcal.Eras.Length, "jp");
Assert.AreEqual(3, jlcal.Eras.Length, "jp");
Assert.AreEqual(1, klcal.Eras.Length, "kr");
Assert.AreEqual(4, jlcal.Eras [0], "jp.1");
Assert.AreEqual(3, jlcal.Eras [1], "jp.2");
Assert.AreEqual(5, jlcal.Eras [0], "jp.1");
Assert.AreEqual(4, jlcal.Eras [1], "jp.2");
Assert.AreEqual(3, jlcal.Eras [2], "jp.3");
}
[Test]
@@ -49,30 +49,30 @@ namespace MonoTests.System.Globalization
public void ToDateTime ()
{
Assert.AreEqual (new DateTime (2000, 2, 5), cn.ToDateTime (2000, 1, 1, 0, 0, 0, 0), "cn1");
Assert.AreEqual (new DateTime (2000, 2, 5), jp.ToDateTime (12, 1, 1, 0, 0, 0, 0), "jp1"); // since 1988 (current epoch)
Assert.AreEqual (new DateTime (2000, 2, 5), jp.ToDateTime (12, 1, 1, 0, 0, 0, 0, 4), "jp1"); // since 1988 (current epoch)
Assert.AreEqual (new DateTime (2000, 2, 5), tw.ToDateTime (89, 1, 1, 0, 0, 0, 0), "tw1"); // since 1912 (current epoch)
Assert.AreEqual (new DateTime (2000, 2, 5), kr.ToDateTime (2000, 1, 1, 0, 0, 0, 0), "kr1");
Assert.AreEqual (new DateTime (2001, 1, 24), cn.ToDateTime (2001, 1, 1, 0, 0, 0, 0), "cn2");
Assert.AreEqual (new DateTime (2001, 1, 24), jp.ToDateTime (13, 1, 1, 0, 0, 0, 0), "jp2");
Assert.AreEqual (new DateTime (2001, 1, 24), jp.ToDateTime (13, 1, 1, 0, 0, 0, 0, 4), "jp2");
Assert.AreEqual (new DateTime (2001, 1, 24), tw.ToDateTime (90, 1, 1, 0, 0, 0, 0), "tw2");
Assert.AreEqual (new DateTime (2001, 1, 24), kr.ToDateTime (2001, 1, 1, 0, 0, 0, 0), "kr2");
Assert.AreEqual (new DateTime (2002, 2, 12), cn.ToDateTime (2002, 1, 1, 0, 0, 0, 0), "cn3");
Assert.AreEqual (new DateTime (2002, 2, 12), jp.ToDateTime (14, 1, 1, 0, 0, 0, 0), "jp3");
Assert.AreEqual (new DateTime (2002, 2, 12), jp.ToDateTime (14, 1, 1, 0, 0, 0, 0, 4), "jp3");
Assert.AreEqual (new DateTime (2002, 2, 12), tw.ToDateTime (91, 1, 1, 0, 0, 0, 0), "tw3");
Assert.AreEqual (new DateTime (2002, 2, 12), kr.ToDateTime (2002, 1, 1, 0, 0, 0, 0), "kr3");
// actually it is 5th month which is leap, but that
// does not afffect on resulting DateTime
Assert.AreEqual (new DateTime (2001, 5, 23), cn.ToDateTime (2001, 5, 1, 0, 0, 0, 0), "cn4");
Assert.AreEqual (new DateTime (2001, 5, 23), jp.ToDateTime (13, 5, 1, 0, 0, 0, 0), "jp4");
Assert.AreEqual (new DateTime (2001, 5, 23), jp.ToDateTime (13, 5, 1, 0, 0, 0, 0, 4), "jp4");
Assert.AreEqual (new DateTime (2001, 5, 23), tw.ToDateTime (90, 5, 1, 0, 0, 0, 0), "tw4");
Assert.AreEqual (new DateTime (2001, 5, 23), kr.ToDateTime (2001, 5, 1, 0, 0, 0, 0), "kr4");
// here the leap month works.
Assert.AreEqual (new DateTime (2002, 2, 11), cn.ToDateTime (2001, 13, 30, 0, 0, 0, 0), "cn5");
Assert.AreEqual (new DateTime (2002, 2, 11), jp.ToDateTime (13, 13, 30, 0, 0, 0, 0), "jp5");
Assert.AreEqual (new DateTime (2002, 2, 11), jp.ToDateTime (13, 13, 30, 0, 0, 0, 0, 4), "jp5");
Assert.AreEqual (new DateTime (2002, 2, 11), tw.ToDateTime (90, 13, 30, 0, 0, 0, 0), "tw5");
Assert.AreEqual (new DateTime (2002, 2, 11), kr.ToDateTime (2001, 13, 30, 0, 0, 0, 0), "kr5");
@@ -115,7 +115,7 @@ namespace MonoTests.System.Globalization
for (int i = 0; i < 60; i++)
Assert.AreEqual (leapYears [i % 19], cn.IsLeapYear (2000 + i), "cn" + i);
for (int i = 0; i < 48; i++) // only 1-to-61 are allowed
Assert.AreEqual (leapYears [i % 19], jp.IsLeapYear (12 + i), "jp" + i);
Assert.AreEqual (leapYears [i % 19], jp.IsLeapYear (12 + i, 4), "jp" + i);
for (int i = 0; i < 50; i++)
Assert.AreEqual (leapYears [i % 19], tw.IsLeapYear (89 + i), "tw" + i);
for (int i = 0; i < 50; i++)
@@ -178,7 +178,7 @@ namespace MonoTests.System.Globalization
d [29] = 6;
for (int y = 12; y < 32; y++)
for (int m = 1; m <= 12; m++)
Assert.AreEqual (d.ContainsKey (y) && d [y] == m, jp.IsLeapMonth (y, m), "jp" + y + "/" + m);
Assert.AreEqual (d.ContainsKey (y) && d [y] == m, jp.IsLeapMonth (y, m, 4), "jp" + y + "/" + m);
d = new Dictionary<int,int> ();
d [2001] = 5;
@@ -1650,6 +1650,29 @@ namespace MonoTests.System.IO
}
// See https://github.com/mono/mono/issues/16032
[Test]
public void DeleteOnCloseWithFileCopy ()
{
string source = TempFolder + DSC + "source.txt";
string target = TempFolder + DSC + "target.txt";
File.WriteAllText (source, "text");
FileStream fs = new FileStream (source, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite, 2048,
FileOptions.DeleteOnClose);
Assert.AreEqual (true, File.Exists (source), "DCFC#1");
try {
File.Copy (fs.Name, target, true);
} finally {
fs.Dispose();
}
Assert.AreEqual (false, File.Exists (source), "DCFC#2");
Assert.AreEqual (true, File.Exists (target), "DCFC#3");
}
[Test]
public void OpenCharDeviceRepeatedly ()
{
@@ -3135,6 +3135,42 @@ namespace MonoTests.System
Assert.AreEqual (expected.GetName ().CodeBase, codeBaseFromShadowCopy);
}
[Test]
public void CrossDomainProxyMethodWithIsByRefLikeArg ()
{
// Make sure we can create transparent proxies for
// classes that have methods that take IsByRefLike
// arguments (aka ref struct, aka Span<T>).
ad = AppDomain.CreateDomain ("ProxyIsByRefLike");
TestProxyItf it = (TestProxyItf)ad.CreateInstanceAndUnwrap (typeof (AppDomainTest).Assembly.FullName, typeof (TestMarshalByRefWithIsByRefLike).FullName);
Assert.IsNotNull (it, "#1");
Assert.IsTrue (it.NormalMethod (), "#2");
// This is just hardcoding Mono's existing behavior.
Assert.Throws<NotImplementedException> (() => {
TestRefStruct s;
s.i = 123;
it.MethodWithIsByRefLikeArg (s); // On Mono this throws, on .NET Framework this returns true.
});
}
public ref struct TestRefStruct {
public int i;
}
public interface TestProxyItf {
bool NormalMethod ();
bool MethodWithIsByRefLikeArg (TestRefStruct s);
}
public class TestMarshalByRefWithIsByRefLike : MarshalByRefObject, TestProxyItf {
public TestMarshalByRefWithIsByRefLike () { }
public virtual bool NormalMethod () { return true; }
public virtual bool MethodWithIsByRefLikeArg (TestRefStruct s) { return s.i == 123; }
}
private static AppDomain CreateTestDomain (string baseDirectory, bool assemblyResolver)
{
AppDomainSetup setup = new AppDomainSetup ();
Loaded 100 of 273 files, more files were not shown because too many files have changed in this diff. Show more