Compare commits

...
4963 Commits
Author SHA1 Message Date
Bepis 7328415ac5 Marshal extension is finally working 2020-09-04 22:41:37 +10:00
Bepis 20a03cdb8e Separate mono_delegate_to_ftnptr_impl into new method 2020-09-04 21:45:16 +10:00
Bepis 5f805b6b03 Fix extension parameter placement and convention overwriting 2020-09-04 20:07:17 +10:00
Bepis 4205769da9 Implement custom GetFunctionPointerForDelegateInternal extension 2020-09-04 19:34:03 +10:00
Zoltan Varga 5756e65a5c [runtime] Allocate code memory using MAP_JIT on apple silicon, patching code randomly crashes without it. (#20342) 2020-09-03 17:56:24 -04:00
monojenkinsandvargaz dfd7ba8ff6 Add ios support to the cmake build system. (#20333)
Co-authored-by: vargaz <[email protected]>
2020-09-03 19:57:08 +02:00
Vlad Brezae 623fc84874 [interp] Optimize out conditional branches (#20330)
* [interp] Remove unop conditional branch applied to constant

Convert it to unconditional branch

* [interp] Enable more optimization

If we failed to emit stloc.np we no longer track stack contents or try other optimizations

* [interp] Fix emit_store_value_as_local

mint_type for a native type is i4/i8 while we were loading the address of this local using LDLOC_VT. This was wrong. Passing a valuetype this is done with LDLOCA.

* [interp] Fix incorrect cond branch opcodes

We didn't emit correct conditional branch opcode, because we didn't check the new stack types, after the addition of the implicit conversion opcodes.

* [interp] Remove binop conditional branch applied to constant

Convert it to unconditional branch
2020-09-02 00:01:38 +03:00
monojenkinsandCoffeeFlux f6d04a53f9 [mono] Add mono_image_open_from_data_alc to unstable embedding API (#20303)
Xamarin-Android will need this for the net6 migration, so might as well add it before I forget about it. They currently use `mono_image_open_from_data_with_name`. cc: @grendello

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-31 14:53:45 -04:00
monojenkinsandradical e5cb8c4e34 [wasm][debugger] Disable an extraneous debug message (#20317)
Recent debugger test runs were showing lot of
`CWL: Failed to lookup sequence point` messages.

These are being shown for cases like:

`CWL: list_frames: Failed to lookup sequence point. method: runtime_invoke_direct_void, native_offset: 56`

This is a warning, and doesn't need to be emitted by default.

Co-authored-by: radical <[email protected]>
2020-08-31 17:10:47 +02:00
csanchezdll 59ee4edb6e Ignore EINVAL errors on ioctl TIOCMGET/TIOCMSET so (#20219)
pseudo-ttys are usable. (#20218)
2020-08-31 15:15:09 +02:00
Stefanos Kornilios Mitsis Poiitidis c58000534f mono: result of regmask should be stored in regmask_t, not int (#20322) 2020-08-31 15:13:09 +02:00
jeffgoku 30689421ab Fix potential crash for Encoder.Convert (#20271)
GetByteCount will not return the right number of bytes needed, so GetBytes in Encoder.Convert will crash for some input
2020-08-31 15:08:58 +02:00
Eberhard BeilharzandMarkS 728b1e9258 [resgen] Honour absence of -usesourcepath (#20247)
* Only set basepath to the source directory if useSourcePath is set.
* Fixes a regression from mono 4 that happened when changing the code
  to not use reflection.

Co-authored-by: MarkS <[email protected]>
2020-08-31 11:38:39 +02:00
Leslie Zhai d71eff1541 [MIPS32] Fix mono_arch_get_cie_program and ELF_MACHINE undefined issue (#20323) 2020-08-30 12:17:16 -04:00
imhameed 8e75f5a28e [mono] Squelch Mach exception handlers (#20321)
Work around LLDB's unconditionally-installed and inflexible Mach
exception handler by installing a no-op task-wide Mach exception
handler.

See also:
- https://github.com/openjdk/jdk/blob/50cc54c730bb0f130991648d1547d42483edddc1/src/hotspot/os/bsd/os_bsd.cpp#L2810-L2817
- https://github.com/mono/mono/issues/10180#issuecomment-683119507
2020-08-29 11:23:09 -07:00
monojenkinsandvargaz cd226d8452 [runtime] Fix signature of mini_cleanup (). (#20320)
Fixes https://github.com/dotnet/runtime/issues/41470.

Co-authored-by: vargaz <[email protected]>
2020-08-29 04:05:06 -04:00
Alexander Köplinger 481e856031 Revert "[mono] Convert Environment.CurrentManagedThreadId to an icall (#20313)" (#20319)
This reverts commit 5d30ccbafc.
2020-08-28 11:05:29 +02:00
monojenkinsandEgorBo 5d30ccbafc [mono] Convert Environment.CurrentManagedThreadId to an icall (#20313)
In order to avoid the static Thread initialization (System.Thread.CurrentThread inits a static field) see https://github.com/dotnet/runtime/pull/41360

Benchmark:
```csharp
[Benchmark]
public int CurrentThreadId() => Environment.CurrentManagedThreadId;
```

Mono JIT (benchmarked on a slow machine):
```
       |          Method |     Mean |     Error |    StdDev |
       |---------------- |---------:|----------:|----------:|
master | CurrentThreadId | 7.191 ns | 0.0128 ns | 0.0107 ns |
PR     | CurrentThreadId | 5.034 ns | 0.0395 ns | 0.0350 ns |
```

Co-authored-by: EgorBo <[email protected]>
2020-08-28 10:09:43 +03:00
HinTakandRyan Lucia b1b58ccc0d Issue18826 fix (#19580)
* Look for "xmonkeysloveplay" also at the end of LC_SYMTAB section, for signed Mac OS X binaries

This extends Miguel de Icaza's previous work on allowing mono to load embedded
assemblies / shared libraries, which was in turn a workaround on recent
Mac OS X's increased security (and stopping LD_LIBRARY_PATH and friends from
working). Miguel de Icaza came up with the idea of appending all of those
embedded assemblies / shared libraries to the end of mono's main executable,
and getting it to look at its own file and unpacking resources from an offset
number + "xmonkeysloveplay" written to the end of file.

Even more recent Mac OS X starts to prefer /require binaries to be code-signed.
Code signing appends a "LC_CODE_SIGNATURE" section to the binary, thus breaking
mono's embedded resource-loading. Also code-signing requires that the binary
has no unknown parts.

To make mkbundle / mono embedded resource-loading work in a code-signing
situation, two parts are required:

- adjust mkbundle to extend the LC_SYMTAB section to cover the appended
assemblies / shared libraries, so code-signing can happen.
( addresses https://github.com/mono/mono/issues/17881 )

- adjust mono's main executable to also look at the end of the LC_SYMTAB
section for the magic offset +  "xmonkeysloveplay" token to find the embedded
resources.
( addresses https://github.com/mono/mono/issues/18826 )

This change addresses the 2nd of the above. I also tried looking for the
presence and beginnig of the LC_CODE_SIGNATURE section, but that proves
unreliable: Code-signing can pad a few null bytes after "xmonkeysloveplay"
to align the LC_CODE_SIGNATURE section to an 8(?)-byte boundary.

* saving offset before read, so later lseek does not need to backtrack on the read

This is a small simplification of the previous commit on this part of code.

* fixes wrong drop-through from mis-positioning of #endif

* Update mono/mini/main.c

Adding spaces for clarity

Co-authored-by: Ryan Lucia <[email protected]>

* Update mono/mini/main.c

Adding spaces for clarity

Co-authored-by: Ryan Lucia <[email protected]>

* Update mono/mini/main.c

Adding spaces for clarity

Co-authored-by: Ryan Lucia <[email protected]>

* Update mono/mini/main.c

Adding spaces for clarity

Co-authored-by: Ryan Lucia <[email protected]>

* Update mono/mini/main.c

Added comment about what's going on.

Co-authored-by: Ryan Lucia <[email protected]>

* Adding comments for clarity

* rename variable "h" to "bin_header", for clarity

* Limit Apple code-signing work around to only the desktop OS (vs iDevices/TV)

* remove stylistic "else"; no change in functionality

Co-authored-by: Ryan Lucia <[email protected]>
2020-08-27 11:38:38 -04:00
monojenkinsandCoffeeFlux 123ac44eb3 [mono] ALC function restructuring for unloadability (#20306)
We previously had a weird split between the domain and loader headers/files. This makes fewer things public, moves the useful ALC functions to loader-internals.h with the implementation in assembly-load-context.c, and cleans up the flow for some unloading behavior.

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-27 10:56:34 -04:00
monojenkinsandvargaz 6f23092e7c Add support for using cmake in the mono runtime build. (#20309)
Not enabled by default. Ninja is used for building if available, else we fall
back to make.

Co-authored-by: vargaz <[email protected]>
2020-08-27 10:14:06 -04:00
Thays Grazia 26ae896ecb [wasm][debugger] Merge dotnet/runtime to mono/mono (#20307)
* Merge dotnet/runtime.

* Missing file.
2020-08-26 14:14:07 -03:00
monojenkinsandCoffeeFlux 990f516a4b [mono] Add mono_assembly_decref, return value on both decref and addref (#20305)
Needed for unloadability

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-26 10:00:03 -04:00
monojenkinsandCoffeeFlux ad95c02c2a [mono] Enable additional warnings as errors (#20293)
This PR:
* Enables `-Wc++-compat` on all platforms: we support building the runtime as C++, so this helps catch errors before they're found in CI and will help keep the netcore build C++-compatible
* Sets `-Werror` on netcore CI for OSX

It also fixes various warnings currently present in the build.

`-Werror` should probably be extended to cover all CI platforms eventually. Adding a new platform is as simple as adding to the line in mono.proj whitelisting platforms and fixing the warnings.

Not sure if there's a better way to handle the cpuidex function, but if we're using that from mini it should definitely be in a header somewhere.

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-25 17:55:37 -04:00
Alexander Köplinger d543f5e540 Update README.md 2020-08-25 22:13:18 +02:00
Alexander Köplinger d724f744bc Replace gitter links with discord 2020-08-25 22:00:57 +02:00
imhameedandAlexis Christoforides 1f3fbedc39 [runtime] Catch attempts to create enum types with an underlying type that is itself an incomplete enum type. (#20282)
* Catch attempts to create enum types with an underlying type that is itself an incomplete enum type.

Previously, only non-enum types containing fields with incomplete enum
types were forbidden.

* Permit static constant fields with incomplete types if the incomplete type is the type currently being defined

Co-authored-by: Alexis Christoforides <[email protected]>
2020-08-25 10:42:44 -07:00
monojenkinsandlateralusX 45d996b7ba Port EventPipe CoreCLR changes to Mono. (#20278)
Port changes done in the following CoreCLR PR's affecting corresponding Mono runtime EventPipe library sources:

https://github.com/dotnet/runtime/pull/36720
https://github.com/dotnet/runtime/pull/37002
https://github.com/dotnet/runtime/pull/38967
https://github.com/dotnet/runtime/pull/40191
https://github.com/dotnet/runtime/pull/40332
https://github.com/dotnet/runtime/pull/40499

EventPipe native code changes track by https://github.com/dotnet/runtime/issues/36820.

Co-authored-by: lateralusX <[email protected]>
2020-08-25 08:43:03 +02:00
imhameed 8aeab70720 Avoid following invalid pointers in mono_w32process_get_modules on Darwin. (#20277)
* Avoid following invalid pointers in mono_w32process_get_modules on Darwin.

`_dyld_get_image_name` and `_dyld_get_image_header` can return pointers
to data that will be freed or unmapped by concurrent calls to `dlclose`.
Avoid this by using `_dyld_register_func_for_add_image` and
`_dyld_register_func_for_remove_image` to install callbacks that
maintain a runtime-internal set of loaded dynamic libraries.

Some notes:

- dyld doesn't provide a public "app store friendly" API (like
`dl_iterate_phdr`) to traverse a snapshot of all loaded dynamic
libraries in a process. There are two alternative private APIs that do
this: one uses `_dyld_process_info_create` and friends and is present in
macOS 10.12 and above, and the other depends on
`_dyld_get_all_image_infos`, which is documented by Apple (... in a WWDC
video) to "go away" at some point in dyld3.

- `dladdr` linearly scans the dyld loaded image array (and each image's
segment set) for a matching address, so `image_added` will get slower as
more dynamic libraries are loaded in the process. But dyld3's
implementation of dlopen already scales linearly in time with the number
of loaded libraries. The use of `dladdr` can be avoided by using
`_dyld_register_for_image_loads` or
`_dyld_register_for_bulk_image_loads`, but those are both private APIs.

- The callbacks registered with `_dyld_register_func_for_add_image` and
`_dyld_register_func_for_remove_image` can never be unregistered, so
this is yet another thing that makes it impossible to safely unload an
embedded mono.

- `MonoW32ProcessModule::inode` only seems to be used to avoid dupicates
in other implementations of w32process; sorting the returned module list
in `mono_w32process_get_modules` wouldn't be necessary if the
`mono_dyld_image_info`s were also kept in an intrusive circular doubly
linked list.

- It looks like `mono_w32process_get_modules` in `w32process-unix-bsd.c`
has a similar race condition.

Also see: https://github.com/mono/mono/issues/20107

* Formatting.

* Make `image_added` and `image_removed` non-blocking.

It is theoretically possible for `mono_w32process_get_modules` to cause
a deadlock if either `image_added` or `image_removed` is waiting for the
image table mutex to be released and if `g_new0`, `g_strdup`,
`g_hash_table_iter_next`, or any of the symbols they depend on are
lazily bound and haven't already been resolved.

Only one thread may iterate over the image table and only one thread may
add/remove entries to/from the image table.

The writer thread attemps to lock a mutex to block readers from
iterating over the table. If the writer successfully acquires this lock,
then no readers are concurrently iterating over the image table and it
is safe to eagerly free stale data.

If the writer doesn't successfully acquire this lock, then the reader
thread is running concurrently with the writer; if this happens, the
writer pushes stale data into a limbo list. Readers opportunistically
clear this list.

Use `mono_mutex_t` instead of `MonoCoopMutex`. Hand-roll the necessary
GC state transitions inside `mono_w32process_get_modules`.

Add `mono_conc_hashtable_foreach_snapshot` to mono-conc-hashtable.{h,c}.

`MonoConcurrentHashTable` depends on the hazard pointer table
(`hazard_table` inside hazard-pointer.c), which is initialized lazily on
the first call to `mono_thread_small_id_alloc`. Perhaps this should be
explicitly initialized early during `mono_init_internal`.

* Revert "Make `image_added` and `image_removed` non-blocking."

This reverts commit a22a4440df5f0f13da29b1b90e80a3420223c2b9.

* Use mono_mutex_t instead of MonoCoopMutex

* Explicitly load symbols not used by `image_added` before `mono_w32process_get_modules` runs
2020-08-24 19:06:37 -04:00
monojenkinsandBrzVlad ced76ae314 [coop] Add configuration option to disable stack scan (#20264)
When this experiment is enabled, the GC doesn't scan stack or registers. This mode is meant to disable scanning of native frames. This implementation only makes sense in full interpreter mode, where the interp stack is scanned separately from the thread stack. Longer term we could use this mode to scan only the managed stack, also in jit mode.

The point of this mode is to be able to stress test the GC in a wasm like environment, where stack can't be scanned. We can more easily reproduce and investigate GC crashes in this configuration, that would also happen on wasm.

Co-authored-by: BrzVlad <[email protected]>
2020-08-24 23:03:37 +03:00
Zoltan Varga b854e882b4 [wasm] Bump emscripten to 2.0.1. (#20287) 2020-08-24 11:02:27 -04:00
monojenkinsandCoffeeFlux fbfc91536f [mono] Thread DllImportSearchPath flags down to LoadLibraryEx (#20292)
This mostly completes support for the attribute. Our algorithm differs a bit from CoreCLR right now, so we don't support the legacy behavior flag since it makes less since in the context of our algorithm, but this should be good enough for most cases.

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-24 10:40:49 -04:00
monojenkinsandCoffeeFlux 44d5fa37ad [mono] Add more detailed logs for the PInvoke resolution process (#20291)
Similar logging was added to the managed loading algorithm when it proved extremely useful for debugging a Blazor crash, so the equivalent is probably useful for the unmanaged library algorithm as well

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-24 00:24:56 -04:00
monojenkinsandCoffeeFlux eb2267f30b [mono] Don't leak coop handles, fix type in managed ALC struct (#20281)
The important change here is not leaking the coop handles, the other is because I'm too lazy to create two separate PRs for this.

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-22 14:27:52 -04:00
monojenkinsandCoffeeFlux 6f0cc47bbf [mono] Disable XML file loading entirely on netcore (#20280)
Co-authored-by: CoffeeFlux <[email protected]>
2020-08-22 07:09:22 -04:00
monojenkinsandCoffeeFlux 3cb098653b [mono] Add g_ptr_array_find to eglib (#20279)
Co-authored-by: CoffeeFlux <[email protected]>
2020-08-22 07:09:02 -04:00
Zoltan Varga 8afa37c663 [runtime] Make the code which handles pinvoke lookup retries netcore only. (#20289) 2020-08-22 05:19:39 -04:00
monojenkinsandvargaz 5521167e5d [runtime] Ongoing work on mono cmake build (#20268)
Co-authored-by: vargaz <[email protected]>
2020-08-22 01:30:44 -04:00
monojenkinsandEgorBo 84d66c6b35 [mono][llvm] Revert noopt modifier (#20286)
For some reason it leads to a crash on Windows x64+FullAOT+LLVM config, investigating...

Co-authored-by: EgorBo <[email protected]>
2020-08-21 22:31:26 -04:00
monojenkinsandBrzVlad 39138f1ed5 [coop] Add handles for some SRE scenarios (#20259)
Co-authored-by: BrzVlad <[email protected]>
2020-08-22 01:38:59 +03:00
monojenkinsandfanyang-mono dc1bd5bde1 Add missing exception checkpoint (#20274)
Fixes dotnet/runtime#38826

Co-authored-by: fanyang-mono <[email protected]>
2020-08-21 19:35:46 +02:00
Alexander Köplinger e88d9ced3b Bump corefx to disable DateTime test
See https://github.com/mono/mono/issues/16623
2020-08-21 17:17:06 +02:00
monojenkinsandEgorBo f564c1d808 [mono] Add MethodImplOptions.NoOptimization support (#20265)
Mono currently just ignores `MethodImplOptions.NoOptimization` flag, this PR adds support for it.

```csharp
static int Add(int a, int b) => a + b;

[MethodImpl(MethodImplOptions.NoOptimization)]
static int Test(int a, int b) => Add(a, b) * Add(a, b); // NoOpt means - don't inline Add here, don't do opts

static void Main(string[] args)
{
    Test(1, 2);
}
```
Codegen for Test:
```asm
0000000000000000 <gram_Test__int_int_>:
<BB>:2
   0:   48 83 ec 18             sub    $0x18,%rsp
   4:   4c 89 34 24             mov    %r14,(%rsp)
   8:   4c 89 7c 24 08          mov    %r15,0x8(%rsp)
   d:   4c 8b f7                mov    %rdi,%r14
  10:   4c 8b fe                mov    %rsi,%r15
  13:   e8 29 00 00 00          callq  41 <gram_Test__int_int_+0x41>
  18:   48 89 44 24 10          mov    %rax,0x10(%rsp)
  1d:   49 8b fe                mov    %r14,%rdi
  20:   49 8b f7                mov    %r15,%rsi
  23:   e8 19 00 00 00          callq  41 <gram_Test__int_int_+0x41>
  28:   48 8b c8                mov    %rax,%rcx
  2b:   48 8b 44 24 10          mov    0x10(%rsp),%rax
  30:   0f af c1                imul   %ecx,%eax
<BB>:1
  33:   4c 8b 34 24             mov    (%rsp),%r14
  37:   4c 8b 7c 24 08          mov    0x8(%rsp),%r15
  3c:   48 83 c4 18             add    $0x18,%rsp
  40:   c3                      retq
```
with llvm backend (emits `noopt` attribute for llvm function):
```asm
0000000000000000 <gram_Test__int_int_>:
<BB>:1
   0:   55                      push   %rbp
   1:   41 57                   push   %r15
   3:   41 56                   push   %r14
   5:   53                      push   %rbx
   6:   50                      push   %rax
   7:   41 89 f6                mov    %esi,%r14d
   a:   89 fd                   mov    %edi,%ebp
   c:   eb 00                   jmp    e <gram_Test__int_int_+0xe>
   e:   eb 00                   jmp    10 <gram_Test__int_int_+0x10>
  10:   49 bf c0 b6 7c 53 37    movabs $0x5637537cb6c0,%r15
  17:   56 00 00
  1a:   49 8b 07                mov    (%r15),%rax
  1d:   89 ef                   mov    %ebp,%edi
  1f:   44 89 f6                mov    %r14d,%esi
  22:   ff d0                   callq  *%rax
  24:   89 c3                   mov    %eax,%ebx
  26:   49 8b 07                mov    (%r15),%rax
  29:   89 ef                   mov    %ebp,%edi
  2b:   44 89 f6                mov    %r14d,%esi
  2e:   ff d0                   callq  *%rax
  30:   0f af d8                imul   %eax,%ebx
  33:   89 d8                   mov    %ebx,%eax
  35:   48 83 c4 08             add    $0x8,%rsp
  39:   5b                      pop    %rbx
  3a:   41 5e                   pop    %r14
  3c:   41 5f                   pop    %r15
  3e:   5d                      pop    %rbp
  3f:   c3                      retq
```
If I replace `LLVM_ATTR_OPTIMIZE_NONE` with `LLVM_ATTR_OPTIMIZE_FOR_SIZE` it becomes https://www.diffchecker.com/S02HEp0w for llvm.

Co-authored-by: EgorBo <[email protected]>
2020-08-20 13:12:54 +02:00
monojenkinsandYoussef1313 ef1589a6cd Fix trailing whitespaces (#20254)
Related to dotnet/runtime#40887 and dotnet/runtime#40884

Co-authored-by: Youssef1313 <[email protected]>
2020-08-20 12:14:59 +02:00
Alexander Köplinger 07e2ed7708 Add --sdk_root to sdkmanager 2020-08-19 02:24:13 +02:00
Alexander Köplinger c73aa699d6 Support overriding SDK_DIR/NDK_DIR in sdks/android/Makefile
We need this for the new Jenkins Android emulator plugin since it uses a different adb version than what we have in $(ANDROID_TOOLCHAIN_DIR)/sdk.
2020-08-19 01:25:30 +02:00
Zoltan Varga 746ece2e0f [aot] Fix the lookup of jit info for WASM. On wasm, methods have no size, so (#20262)
only the method address can be looked up, jinfo->code_size is set to 1.

Fixes https://github.com/mono/mono/issues/20256.
2020-08-18 14:23:56 -04:00
monojenkinsandlateralusX 1d85cba972 Enable tests failing due to missing array ctor and lbound index checks. (#20100)
Fix https://github.com/mono/mono/pull/19494 adds missing array ctor needed by several tests currently failing as described by https://github.com/dotnet/runtime/issues/34068.

This PR fixes an additional problem hit by the IL array tests using an lbound != 0. Current Mono codegen for Set/Get/Address array methods didn't adjust index with regards to lbound causing failures in several of the array tests. NOTE, this scenario should only be hit when directly calling Set/Get/Address using IL on an array with an lbound != 0. It shouldn't affect regular szarray's at all since that code paths should never be used and the codegen currently looks up the lbounds unconditionally in the array, so if that code path ever gets hit by a szarray, it will imdediate crash, so shouldn't be causing any performance impact on szarrays. There is also an additional check on the array type as well as an additional precaution, so only arrays of type MONO_TYPE_ARRAY, hitting codegen for Set/Get/Address array method calls will adjust index based on lbound.

This PR fix the lbound index codegen for that specific code path and re-eanbles the tests currently listed in https://github.com/dotnet/runtime/issues/34068.

Co-authored-by: lateralusX <[email protected]>
2020-08-18 18:49:26 +02:00
monojenkinsandlateralusX 6d26f8ba24 Fix EventActivityIdControl test on MonoVM. (#20106)
Make EventSource call static version of EventActivityIdControl in EventPipeEventProvider instead of direct calling low level
EventPipeInternal (now only called from EventPipe* sources). Doing it that way will also keep EventPipeEventProvider.EventActivityIdControl in S.P.C meaning that tests like eventactivityidcontrol won't risk
of using methods that has been trimmed away by linker.

Added missing case into Mono's EventPipeInternal::EventActivityIdControl implementations.

Enabled eventactivityidcontrol test on Mono runtime. Adjusted test to use static EventPipeEventProvider.EventActivityIdControl version.

Co-authored-by: lateralusX <[email protected]>
2020-08-18 13:02:40 +02:00
monojenkinsandCoffeeFlux 669ed125e3 [mono] Loader improvements: bundle optimization and logging (#20246)
See individual commits and description.

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-17 18:53:59 -04:00
monojenkinsandimhameed f51cfe74e3 [mono] Add X86Base support. (#20253)
Implement `BitScanForward` and `BitScanReverse` as intrinsics.

Implement `__cpuidex` as a netcore-only icall. Rename `cpuid` (in
mono-hwcap-x86.c) to `mono_cpuidex`, give it extern linkage, and add
support for extended CPUID.

Related: https://github.com/dotnet/runtime/pull/40167

Co-authored-by: imhameed <[email protected]>
2020-08-17 15:21:35 -07:00
Zoltan Varga 1ebc801381 [aot] Avoid emitting generic instances with vtype arguments on wasm to save space. (#20252)
* [aot] Avoid emitting generic instances with vtype arguments on wasm to save space.

* [aot] Avoid dedup-ing gsharedvt methods.
2020-08-17 17:15:27 -04:00
Thays Grazia 70219cc2b5 [wasm] Merge dotnet/runtime changes to mono/mono. (#20249)
* Reformatting files.
Merging dotnet/runtime to mono/mono

* Removing testharnessstartup from browserdebughost.
Fix format of EvaluateOnCallFrameTests.

* Fix package.
2020-08-15 14:03:15 -03:00
monojenkinsandCoffeeFlux 0161714a5a [mono] Make bundle filename changes netcore-only (#20251)
cc: @thaystg

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-15 01:18:40 -03:00
Caleb Cornett 442aeedc5e [wasm] Add extra-emcc-flags parameter to packager (#20220)
* Add extra-emcc-flags parameter to packager

* Style fix
2020-08-14 20:52:36 -07:00
monojenkinsandvargaz 2d845f0711 [runtime] Update cmake build. (#20243)
Co-authored-by: vargaz <[email protected]>
2020-08-14 10:56:35 -04:00
monojenkinsandCoffeeFlux 02b9be1282 [mono] Improve MonoImage filename handling for bundled images (#20245)
This change means we will handle bundles consistently across platforms and ensures that the MonoImageStorage is keyed by the in-memory location rather than the assembly name, which seems less error-prone.

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-14 09:42:34 -04:00
Thays Grazia 2d567b395e [wasm] Renaming debugger files. (#20244)
* Renaming projects and files as we did on dotnet/runtime repo.

* Fixing library-mono.js to run debugger tests.
Fixing typo on DebuggerTestSuite.
2020-08-14 08:29:47 -03:00
monojenkinsandakoeplinger 5f44f27a0d Cleanup old corefx/coreclr GitHub issue links (#20201)
Replace them with the current URL after the redirect.

Similar to @stephentoub's PR: https://github.com/dotnet/runtime/pull/2063.

This is a mechanical find/replace, I did not check whether the references are still accurate or issues are already fixed.

Co-authored-by: akoeplinger <[email protected]>
2020-08-13 23:14:08 +02:00
monojenkinsandthaystg 5b33599427 [wasm] Remove unnecessary console messages. (#20236)
Changing some console.log to console.debug to not pollute the console.
Changing printf to DEBUG_PRINTF to follow the debug level chosen by user.
Remove unnecessary console.log.
Fix dotnet/runtime#40721

Co-authored-by: thaystg <[email protected]>
2020-08-13 08:46:09 +02:00
Zoltan Varga 5e05c87d3d [aot] Fix an assert which is hit for generic instances with a lot of arguments. (#20238)
The c# compiler generates these for anonymous types.

Fixes https://github.com/xamarin/xamarin-macios/issues/9289.
2020-08-12 20:02:19 -04:00
monojenkinsandBrzVlad 89e7e5c210 [interp] Rework OBJREF and fix a GC issue (#20234)
Co-authored-by: BrzVlad <[email protected]>
2020-08-13 01:39:55 +03:00
monojenkinsandCoffeeFlux e3b3a6f864 [mono] Fix configure to actually disable dllmap on non-mobile platforms (#20230)
`$enable_monodroid` and `$enable_monotouch` are set to no by default, not an empty string.

Accidentally enabled globally here: https://github.com/dotnet/runtime/commit/a54d391d9daebf7b53e7f1efc1690c1c35177570#diff-294e5f7514d4059e724506770913e1d7R1386

Fixes https://github.com/dotnet/runtime/issues/40147

Co-authored-by: CoffeeFlux <[email protected]>
2020-08-12 12:35:26 -04:00
monojenkinsandBrzVlad 74243d9b93 [coop] Use handles for mono_runtime_try_invoke_array (#20225)
Co-authored-by: BrzVlad <[email protected]>
2020-08-12 17:25:32 +03:00
Zoltan Varga 92ce33daba [aot] Avoid dedup-ing non-public instances. (#20226)
This will decrease the size of the dedup assembly which can get
large with lots of instances.

Hopefully fixes https://github.com/mono/mono/issues/20224.
2020-08-11 23:35:09 -04:00
monojenkinsandbenaadams 0cd363fb98 Type.IsAssignableTo (#20206)
Resolves https://github.com/dotnet/runtime/issues/30714

Co-authored-by: benaadams <[email protected]>
2020-08-11 11:56:35 +02:00
monojenkinsandvargaz a7aa383fc6 [runtime] If the initial pinvoke lookup fails, emit some code inside the managed-to-native wrapper to retry to lookup on every call until it succeeds. (#20187)
Fixes dotnet/runtime#35219

Co-authored-by: vargaz <[email protected]>
2020-08-10 19:54:40 -04:00
Alex Thibodeau 45f2b54612 Fixing debugger hang that would occur when inspecting a field that has a Debugger.Break in it's accessor. (#20211)
Fixing TypeInfo debugger test. I added a new property which broke the num properties check.
2020-08-10 18:18:10 -03:00
Zoltan Varga 9d9ec219c1 [aot] Fix the handling of r4/r8 parameter types with attributes during generic sharing. (#20217)
The attributes need to be ignored as with the other types, otherwise gsharedvt wrappers for signatures with
parameters like double f = default will not be found.

Fixes https://github.com/mono/mono/issues/20195.
2020-08-10 08:30:49 -04:00
monojenkinsandradical 4835e29470 [wasm][debugger] Add support for invoking getters on ValueTypes (#20222)
- this allows IDEs to let users invoke property getters for ValueTypes

Co-authored-by: radical <[email protected]>
2020-08-09 21:11:58 +02:00
8a2dc9dc32 [wasm] [debugger] Support Exception Break on Debugger (handled and unhandled) (#20215)
* [wasm] [debugger] Support Exception Break on Debugger (handled and unhandled)

Based on https://github.com/mono/mono/pull/20142

* Add missing function to library_mono.js

Co-authored-by: thaystg <[email protected]>
Co-authored-by: Larry Ewing <[email protected]>
2020-08-08 12:32:02 +02:00
monojenkinsandimhameed 61ba224a6e [mono] Allow creating TypedReference * and TypedReference & via reflection. (#20221)
CoreCLR gained support for creating`TypedReference *` and `TypedReference &` via `MakePointerType` and `MakeByRefType` in https://github.com/dotnet/coreclr/pull/25817.

Reenable byref System.Void-related reflection tests.

Fixes https://github.com/dotnet/runtime/issues/31713.
Fixes https://github.com/dotnet/runtime/issues/37489.

Co-authored-by: imhameed <[email protected]>
2020-08-07 14:55:58 -07:00
monojenkinsandsteveisok 350828e54c [Wasm] Ensure monovm_initialize is called on startup and address other startup items (#20129)
This PR addresses:

- Calling monovm_initialize matches how other mono platforms init themselves (Fixes https://github.com/dotnet/runtime/issues/39074)
- Set the entry assembly (Fixes https://github.com/dotnet/runtime/issues/38994)
- Make sure the assembly location is set to empty for assemblies that are loaded from memory (Fixes https://github.com/dotnet/runtime/issues/39650)

Co-authored-by: steveisok <[email protected]>
2020-08-07 09:30:48 -04:00
monojenkins 743ebf9c09 [mono][interp] Optimize box+unbox to no-op (#20174) 2020-08-07 16:08:26 +03:00
monojenkinsandvargaz 1ae5414a2c [wasm] Fix GC support in ves_icall_get_trace (). (#20210)
Co-authored-by: vargaz <[email protected]>
2020-08-06 10:53:01 -04:00
monojenkinsandimhameed 9d4e3ba229 [mono] Don't save byref System.Void into MonoDomain::typeof_void. (#20212)
`mono_type_get_object_checked` will return the `MonoReflectionType`
referred to by `MonoDomain::typeof_void` if present. If a byref
`System.Void` is stored in this field, then
`get_ContainsGenericParameters` applied to `System.Void` will loop
indefinitely, because our implementation of
`get_ContainsGenericParameters` expects `GetElementType` to yield a
`MonoReflectionType` with one layer of "type function application"
removed.

Fixes https://github.com/dotnet/runtime/issues/37489.

Co-authored-by: imhameed <[email protected]>
2020-08-05 17:49:13 -07:00
monojenkinsandakoeplinger 9f129a6b3a Mono: Ensure tasklets are removed in netcore build (#20203)
Tasklets were an old mono-specific extension for continuations that is no longer relevant.

Co-authored-by: akoeplinger <[email protected]>
2020-08-04 22:26:08 +02:00
monojenkinsandakoeplinger 462971120c Fix warning in debugger-agent.c (#20204)
```
  CC       libmono_dbg_la-debugger-agent.lo
/Users/runner/work/1/s/src/mono/mono/mini/debugger-agent.c:1088:9: warning: unused variable 'argv' [-Wunused-variable]
                char *argv [ ] = {
```

Co-authored-by: akoeplinger <[email protected]>
2020-08-04 21:51:16 +02:00
monojenkinsandvargaz ce43eb0beb [runtime] Handle null byref returns in runtime invokes. (#20179)
Fixes https://github.com/dotnet/runtime/issues/39380.

Co-authored-by: vargaz <[email protected]>
2020-08-04 20:02:35 +02:00
monojenkinsandfanyang-mono 4ca4a459ad Check if a method is dynamic when transforming internal calls (#20199)
Fixes dotnet/runtime#38897 , by allowing transforming internal calls when method is dynamic.

Co-authored-by: fanyang-mono <[email protected]>
2020-08-03 22:11:45 -04:00
monojenkinsandakoeplinger 601a2d6e8a Fix ICU_CFLAGS in mono configure.ac (#20198)
We need to set these defines so we don't use obsolete ICU functions and cause warnings, just like we do in the CMakeLists.txt version..

Co-authored-by: akoeplinger <[email protected]>
2020-08-03 16:05:11 +02:00
Ankit Jain d09e9e21b3 [master] Bump msbuild to track xplat-master (#20189) 2020-08-02 15:43:57 +02:00
Zoltan Varga 92f54ee4c2 [runtime] Add a configure workaround for apple silicon + older config.guess versions. (#20192) 2020-08-02 15:42:47 +02:00
Neale Ferguson 71307187cb Fix __asm__ specifications for Clang (#20190)
* Fix __asm__ specs to work with clang

* 1. No need for USE_STRING_INLINES anymore
2. Code around clang bug where %r0 is being rejected from BASR instruction

* Fix a couple of more __asm__ specifications for clang
2020-07-31 15:24:58 +02:00
Zoltan Varga f0229da768 Bump emscripten to 1.40.0. (#20188) 2020-07-31 01:32:08 -04:00
Bernhard Urban-Forster 2921130fa8 [RISCV] Build fixes and simple exception handling (#20184)
* [riscv] add ELF machine definition

* [riscv] add mono_arch_get_cie_program to fix the build

* [interp] remove unused pointer

* [riscv] add offsets for MonoContext members

* [riscv] add pattern to nop_stub, so it is easier to spot in the debugger what caused the hang

* [riscv] minimal exception handling support
2020-07-30 19:20:45 -04:00
Zoltan Varga a57e7e4d5f [jit] Avoid calling mono_marshal_get_native_wrapper () too early, it needs to be called when the pinvoke method is first called. (#20177) 2020-07-30 10:04:44 -04:00
monojenkinsandakoeplinger b258af8b7f [wasm] Remove unused icalls for Environment properties (#20180)
They are no longer needed after https://github.com/dotnet/runtime/pull/38996 since we return values in managed code now.

Co-authored-by: akoeplinger <[email protected]>
2020-07-29 17:34:09 +02:00
Glenn Slayden c16f6e0955 jay.exe (ILASM): Incorrect loop indexing, fixes #14241 (#20144)
Fix incorrect loop indexing.

Fixes #14241
2020-07-29 14:30:24 +02:00
EsmeandVincent Povirk 9a66d68d96 [System] Mark BTLS callbacks as cdecl. (#19872)
Fixes crashes when BTLS is compiled for Windows x86 with Clang.

Co-authored-by: Vincent Povirk <[email protected]>
2020-07-29 14:29:48 +02:00
Karl 957d1942d1 Fix Line problem with wrapping and tabs (#20112)
Also adds a minor improvement to line wrapping, by not updating the wrap
position when it can only move it earlier. This means when processing
end-of-wrapped-line whitespace that it doesn't get adjusted every time.
Also doesn't update the previous wrap position, but that shouldn't be
used in this situation as it is only for wrapping after dashes.

The real problem that this fixes is that wrapping a line at a point such
that there was whitespace including a tab after the wrap position could
cause an infinite loop. Without the fix, with a wrap_pos > 0 (normal),
it only split the line after reaching non-whitespace. In most situations
that was OK as we norwally wrap after whitespace. However a tab is
whitespace we wrap before. Once pos was equal to wrap_pos it stopped
incrementing pos as it was now at the split position and therefore it
shouldn't change. But it didn't set split_tag, so didn't split, and
therefore didn't exit the outer loop.
2020-07-29 14:28:16 +02:00
monojenkinsandEgorBo 4c7c1181cf [mono][interp] Intrinsify MemoryMarshal.GetArrayDataReference (#20163)
it's used under the hood in String, Span, Memory, etc.
It's also a public API now.

Co-authored-by: EgorBo <[email protected]>
2020-07-29 14:11:24 +02:00
Aleksey Kliger (λgeek) b3ce259316 Make install-culture-table write to mono/culture/ (#20124)
As part of https://github.com/mono/mono/pull/19912 we moved the locale files to the mono/culture/ subdirectory.
2020-07-29 12:01:31 +02:00
monojenkinsandCoffeeFlux b6d95e093b [mono] Disable cfgdir config on Windows netcore builds (#20173)
This was already disabled with autotools, but I forgot to update winconfig.h as well.

Co-authored-by: CoffeeFlux <[email protected]>
2020-07-29 11:19:17 +02:00
monojenkinsandvargaz cb2d589e24 [interp] Add null checks to STIND opcodes. (#20176)
Co-authored-by: vargaz <[email protected]>
2020-07-29 11:04:59 +02:00
monojenkinsandkg cb630c292c Update threadpool callback error messages to fix dotnet/runtime#38803 (#20171)
EDIT: Simple test case to trigger an error:
```csharp
        ThreadPool.QueueUserWorkItem((_) => {
            throw new Exception("test");
        });
        var t = typeof(System.Threading.ThreadPool);
        var m = t.GetMethod("PumpThreadPool", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
        m.Invoke(null, null);
```

Co-authored-by: kg <[email protected]>
2020-07-29 10:46:04 +02:00
Thays Grazia cf9935e136 Revert "[debugger] Removing unhandled_exception which was used for android. (#20122)" (#20175)
This reverts commit 60643c36f5.
2020-07-28 19:35:45 -03:00
monojenkinsandCoffeeFlux be199e71b5 [mono] Fix warnings on OSX netcore (#20170)
This commit brings us back to zero warnings for the default build configuration.

Co-authored-by: CoffeeFlux <[email protected]>
2020-07-28 15:57:16 -04:00
Zoltan Varga ae983fe58f Apple Silicon support (#20166)
* Fix configure check for arm64+osx.

* Add mono_codeman_enable_write/disable_write functions.

* Use clang --shared for linking aot images.

* Fix eglib remapping.

* Make code memory writable during code generation.

* Enable/disable writable code around dlmalloc operations, dlmalloc allocates from code memory.

* Fix some defines.

* Fix set/clear_breakpoint.

* Fix llvm jit support.

* Fix gsharedvt.

* Force float32 to be enabled on osx/arm64.

* Add codegen macros for arm64e.

* Disable some crash tests if --disable-crash-reporting is used.

* Disable btls. Disable boehm by default.

* Fix a warning.

* Fix vararg calls, the vararg icalls assume every argument is in in own stack slot, but the default osx/arm64 calling code is the same as ios which allows small arguments to share a stack slot.

* Fix formatting.

* Fix the build.

* Use aarch64-darwin-ios as the target triple when cross compiling to ios so configure can distinguish between osx/arm64 and ios.

* Assume ios when cross compiling to aarch64-darwin.
2020-07-28 08:34:07 -04:00
monojenkinsandalexischr fbe6a9618a [mono] Use DefaultDllSearchPaths attribute for PInvokes (#20090)
So far we have been ignoring the flags contained in the attribute.

Attribute can be applied to a pinvoke method or an assembly. See https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.defaultdllimportsearchpathsattribute.-ctor?view=netcore-3.1#System_Runtime_InteropServices_DefaultDllImportSearchPathsAttribute__ctor_System_Runtime_InteropServices_DllImportSearchPath_

Co-authored-by: alexischr <[email protected]>
2020-07-28 01:22:27 -04:00
Zoltan Varga 218419e77b [wasm] Use interp-only instead of interp-llvmonly as the default execution mode. (#20159)
* [wasm] Use interp-only instead of interp-llvmonly as the default execution mode.

interp-llvmonly caused mono_llvm_only to be set, causing bad behavior like
stack walks not working.

* Address comments.
2020-07-27 21:59:29 -04:00
monojenkinsandvargaz 5d7d1b12be [jit] Add a intrinsic for ThrowForUnsupportedVectorBaseType<T>. (#20167)
Part of https://github.com/dotnet/runtime/issues/38718.

Co-authored-by: vargaz <[email protected]>
2020-07-27 20:21:23 -04:00
monojenkinsandakoeplinger f87a9d7baf [mono] Fix building multiple os/arch combinations in the same working directory (#20168)
After adding the ICU shim code to the runtime we hit an issue when e.g. compiling for "desktop" mono in a working directory that already had Browser wasm artifacts in it.
This is due to automake putting the intermediate compilation artifacts at the same location where a file was referenced from.

This means that e.g. when using `../../../libraries/Native/Unix/System.Globalization.Native/pal_icushim.c` in the Makefile.am we'd get the intermediaries in `artifacts/obj/mono/libraries/` instead of somewhere in `artifacts/obj/mono/OSX.x64.Debug`.

Later on we'd get the following error because it was reusing the existing .o file from another architecture:

```
Undefined symbols for architecture x86_64:
  "_gPalGlobalizationNative", referenced from:
    _c_qcalls in libmonoruntimesgen.a(libmonoruntimesgen_la-native-library-qcall.o)
```

Fix this by symlinking the source files into the build directory.

Co-authored-by: akoeplinger <[email protected]>
2020-07-28 01:00:33 +02:00
Thays Grazia 60643c36f5 [debugger] Removing unhandled_exception which was used for android. (#20122)
* Removing unhandled_exception that was used for android.

* Removing unhandled_exception that was used for android.
2020-07-24 11:42:15 -03:00
Alexander Köplinger c0aa77d2ea Fix Cairo issue on macOS Big Sur
Bumps bockbuild to get the changes from mono/bockbuild#162

BigSur's CoreGraphics seems to need a copy of the data to stick around longer than the surface,
so we provide it a copy of the data instead.

Backport of https://github.com/mono/mono/pull/20154 to master
2020-07-24 13:54:57 +02:00
monojenkinsandvargaz aafaa6d93f [runtime] Fix some more gc tracking problems in create_cattr_named/typed_arg. (#20155)
Co-authored-by: vargaz <[email protected]>
2020-07-24 11:23:49 +02:00
Zoltan Varga 83083ef905 [aot] Avoid a crash in generic sharing for invalid generic instances. (#20157)
Fixes https://github.com/mono/mono/issues/20138.
2020-07-23 20:58:34 -04:00
monojenkinsandvargaz 5d3116f4ff [runtime] Make sure newly created objects are pinned during a runtime invoke in create_cattr_typed/named_arg (). (#20148)
Hopefully helps with https://github.com/dotnet/runtime/issues/39473.

Co-authored-by: vargaz <[email protected]>
2020-07-22 23:05:35 +02:00
monojenkinsandvargaz 850af3ba40 [runtime] Initialize the class if needed in type_is_blittable (). (#20145)
Fixes https://github.com/dotnet/runtime/issues/39100.

Co-authored-by: vargaz <[email protected]>
2020-07-21 18:08:55 -04:00
Zoltan Varga a2fcf072e8 Bump emscripten to 1.39.20. (#20143) 2020-07-21 07:31:37 -04:00
monojenkinsandeerhardt f8d27a4847 Allow Debugger attributes to be trimmed in Mono (#20132)
* Changed debugger-agent to allow for the Debugger Attributes to not exist.
* Removed the Debugger Attributes entries from the Descriptors.xml file.

Fix mono/linker#1355

Co-authored-by: eerhardt <[email protected]>
2020-07-20 23:20:44 +02:00
monojenkinsandBrzVlad 0372a381ad [wasm] Trim down size of dotnet.wasm (#20139)
This disables several debugging features in sgen, helps the compiler remove some unused code related to concurrent collector and disables more assertion messages, but also some other logs. We might have to reenable some of them if this is problematic.

Saves about 60k on wasm

Co-authored-by: BrzVlad <[email protected]>
2020-07-19 00:40:17 +03:00
Ganbarukamo41 2058deb70f Remove some non-unicode characters from source code (#20137)
* Remove ZWS from the source code

* Remove smart quotes from source code
2020-07-18 12:45:25 +02:00
monojenkinsandvargaz 2b6531e9b4 [mono] Fix an assert which happens when marshalling ftnptr types. (#20134)
MonoClass-es created for ftnptr types have an implicit pointer field so their size is not
the same as the computed size.

Co-authored-by: vargaz <[email protected]>
2020-07-17 23:54:15 +02:00
monojenkinsandvargaz e9560636b9 Add a --enable-minimal=eventpipe configure option. Disable eventpipe on wasm. (#20095)
Co-authored-by: vargaz <[email protected]>
2020-07-17 12:28:03 -04:00
Matthew Leibowitz d8dda25c27 [Wasm] Additional signatures for SkiaSharp interop + More (#20133)
* [Wasm] Additional signatures for SkiaSharp interop

* Update InterpToNativeGenerator.cs

* Generate more APIs
Include the bits in https://github.com/dotnet/runtime/commit/aa667de1e3fff0f951d5136a45fbe8acefad9be9
2020-07-17 16:47:40 +02:00
Zoltan Varga e1ba14ff82 [wasm] Fix handling of enum types in the pinvoke generator. (#20125)
Fixes https://github.com/mono/mono/issues/20123.
2020-07-17 02:45:46 -04:00
monojenkinsandkg 28315c66b7 ICU integration and asset loading overhaul (#20029)
Co-authored-by: kg <[email protected]>
2020-07-17 02:28:26 +02:00
monojenkinsandEgorBo f026b9a31c [mono] fix bound checks for Spans in LLVM-jit mode (add extra SROA pass) (#20054)
I noticed that the following code leaves bound checks when compiled using LLVM-JIT:
```csharp
static void Test(Span<int> span)
{
    for (int i = 0; i < span.Length; i++)
        x[i] = 0;
}
```
#### Current codegen:
```asm
Test:
0000000000000000	pushq	%rax
0000000000000001	testl	%esi, %esi
0000000000000003	jle	0x3f
0000000000000005	xorl	%eax, %eax
0000000000000007	movl	%esi, %ecx
0000000000000009	cmpq	%rcx, %rax
000000000000000c	jae	0x2c
000000000000000e	nop
0000000000000010	movl	$0x0, (%rdi)
0000000000000016	incq	%rax
0000000000000019	movslq	%esi, %rcx
000000000000001c	cmpq	%rcx, %rax
000000000000001f	jge	0x3f
0000000000000021	addq	$0x4, %rdi
0000000000000025	movl	%esi, %ecx
0000000000000027	cmpq	%rcx, %rax
000000000000002a	jb	0x10
000000000000002c	movabsq	$0x7fc330531710, %rax
0000000000000036	movl	$0x106, %edi
000000000000003b	callq	*(%rax) ;; <---- bound check
000000000000003d	ud2
000000000000003f	popq	%rax
0000000000000040	retq
```
looks like an additional -sroa pass after lower-expect and instcombine fixes it:
#### New codegen:
```asm
Test:
0000000000000000	testl	%esi, %esi
0000000000000002	jle	0x1f
0000000000000004	movl	%esi, %eax
0000000000000006	nopw	%cs:(%rax,%rax)
0000000000000010	movl	$0x0, (%rdi)
0000000000000016	addq	$0x4, %rdi
000000000000001a	decq	%rax
000000000000001d	jne	0x10
000000000000001f	retq
```
Here is the original LLVM IR before optimizations: https://godbolt.org/z/PLfR6x

Co-authored-by: EgorBo <[email protected]>
2020-07-16 20:08:51 +03:00
Zoltan Varga 3856ef71f8 [wasm] Fix handling of void types in the pinvoke generator. (#20121)
Fixes https://github.com/mono/mono/issues/20120.
2020-07-15 17:56:08 -04:00
monojenkinsandBrzVlad a463d28a41 [interp] Intrinsify span ctor (#20108)
Co-authored-by: BrzVlad <[email protected]>
2020-07-15 18:37:32 +02:00
Zoltan Varga a64bca988d Bump ikvm to pick up unmanaged cconv changes. (#20119) 2020-07-15 11:48:23 -04:00
Zoltan Varga b601abd311 [wasm] Fix the propagation of exceptions through runtime invokes. (#20117)
The previous code would convert exceptions into errors which would
be rethrown later, clearing the resume state.

Hopefully fixes https://github.com/dotnet/runtime/issues/38337.
2020-07-15 02:22:33 -04:00
monojenkinsandimhameed 77ae877253 Update Mono's implementation of Vector<T> intrinsics. (#20118)
Recognize `get_AllBitsSet` instead of `get_AllOnes`; this internal
intrinsic was renamed in https://github.com/dotnet/runtime/pull/36579
(1c66ad1b71bb84a16b71bb5efcef1fa999c1c8bc).

Implement `Vector<T>.One` as an intrinsic.

Co-authored-by: imhameed <[email protected]>
2020-07-14 21:40:32 -07:00
Zoltan Varga b923fc1651 [wasm] Restrict the changes in #20113 to netcore only. (#20114) 2020-07-14 15:50:36 -04:00
monojenkinsandakoeplinger 74782ab634 WASM: Fix System.Diagnostics.Tracing (#20115)
It was missing a few signatures in wasm_m2n_invoke.g.h that caused it to fail with `WASM-ERR: CANNOT HANDLE INTERP ICALL SIG IIILIIII`

Co-authored-by: akoeplinger <[email protected]>
2020-07-14 18:07:05 +02:00
monojenkinsandlateralusX 0bced44f8f Keep weak gc handle for EventPipe delegate callback in provider. (#20110)
Delegate callback can be held in native event pipe provider instance and called multiple times during provider lifetime (enable/disable sessions). Store a weak GC reference to delegate to correctly handle case where delegate gets moved by GC. It should not be collected since delegate should be held alive by managed event pipe class.

Co-authored-by: lateralusX <[email protected]>
2020-07-14 15:09:14 +02:00
monojenkinsandvargaz 4647328f76 [wasm] Fail right away in interp_create_method_pointer () when trying to create a function pointer to a native-to-managed wrapper. (#20113)
The previous method of returning interp_no_native_to_managed doesn't work:
* The runtime expects different function pointers for different methods, returning
  the same pointer leads to all kinds of weird errors.
* On wasm, the native caller expects the function to have the right signature, so
  calling interp_no_native_managed () will leads a to signature mismatch error which is
  hard to debug.

Co-authored-by: vargaz <[email protected]>
2020-07-14 08:49:05 -04:00
monojenkins 3059051ddd Run CoreCLR runtime tests using Mono with LLVM AOT. (#20077)
- coreclr/build-test.sh now has a new subcommand: 'mono_aot', which builds a
new target, named 'MonoAotCompileTests', added to
coreclr/tests/src/runtest.proj. This target compiles the runtime tests using
Mono LLVM AOT in a simple configuration where the host platform is identical to
the target platform. Parallel compilation happens via a hack: actual
compilation happens in mono/msbuild/aot-compile.proj, a single-target msbuild
file, and runtest.proj invokes this single-purpose project and target using
batching to create multiple parallelizable instances of this project. Future
work: use the MonoAOTCompiler custom task currently used to build the iOS
sample program.

- Avoid using the runtimeVariant string when defining
coreClrProductArtifactName in mono/templates/xplat-pipeline-job.yml. There are
no "runtime variants" of CoreCLR configured with this parameter; instead,
depend on a shared non-runtime-variant build of CoreCLR.

- Mark function DISubprograms as local definitions--this is an LLVM 9
compatibility fix.

- Use --tag=CXX when linking libmonosgen-2.0.so via libtool when LLVM is linked
into Mono.

  This makes libtool use the C++ compiler driver when linking Mono--which uses
whatever platform-specific flags are necessary to link against the C++ stdlib.
Previously, libtool would use the C compiler driver, which didn't do this and
would produce shared objects with no explicit dependency on libstdc++.

  This problem is normally masked because of the very lax dynamic linking
semantics on ELF, but Mono on our CI setup is built in a CentOS 7 image (which
does not contain a C++11 libstdc++) that has a GCC 7 compatibility package
installed, along with a clang 9 installation that detects headers from the GCC
7 compatibility package. This compatibility package includes a libstdc++ linker
script that links C++11 libstdc++ components statically into the target while
dynamically linking against components present in pre-C++11 libstdc++. The end
result of all of this is that Mono built with this configuration will
dynamically depend on C++11 libstdc++ symbols that should have been statically
linked into the library, and will outright fail to run on machines without a
newer version of libstdc++ available.

- Add tests that fail after LLVM AOT compilation to issues.targets.
2020-07-13 21:05:55 -07:00
monojenkinsandhughbe c94f94bb17 Add some edge case tests for Array.CreateInstance and fix Mono handling (#19796)
Co-authored-by: hughbe <[email protected]>
2020-07-13 17:16:23 +02:00
monojenkinsandBrzVlad 047ed897dd [interp] Add intrinsics for some common operations (#20071)
These are mostly around string operations and are meant to be a quick boost in performance for some common blazor scenarios, around rendering and json parsing, before interp optimizations catch up. Even if the interpreter will have more advanced optimization passes, it is likely that it would still be much slower on these low level operations. Long term we would have methods like these AOT-ed, but, depending on how easy to maintain and how effective these turn out to be, we could also stick to intrinsifying some bcl code in the future.

Co-authored-by: BrzVlad <[email protected]>
2020-07-13 12:05:13 +03:00
monojenkinsandCoffeeFlux 4456328a3e [mono] Disable config dir lookups on netcore (#20074)
Fixes https://github.com/dotnet/runtime/issues/33079

Co-authored-by: CoffeeFlux <[email protected]>
2020-07-13 10:53:07 +02:00
Ankit Jain ee3a669dc3 [wasm][debugger] Fix callFunctionOn+silent arg behavior (#20044)
`silent` argument for `callFunctionOn` should not cause errors to be
suppressed. According to the protocol docs:

`In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.`

- so, the result returned should have the error, if any.
- Added corresponding JS test, so that we know we are matching the
correct behavior.
2020-07-10 18:54:22 -04:00
monojenkinsandBrzVlad 9ecb588fc7 [interp] Add debug option which reports the hottest methods (#20097)
This tracks how many interpreter opcodes were executed as part of each method and reports them during runtime shutdown. Example output :
```
Total executed opcodes 305590200
11% Opcounts 34261110, calls 81900, Method System.Text.Json.JsonWriterHelper:ToUtf8 (System.ReadOnlySpan`1<byte>,System.Span`1<byte>,int&,int&), imethod ptr 0x55f2d503d870
22% Opcounts 33980080, calls 849502, Method System.Text.ASCIIUtility:WidenFourAsciiBytesToUtf16AndWriteToBuffer (char&,uint), imethod ptr 0x55f2d4d9ce08
29% Opcounts 23040810, calls 81900, Method System.Text.Encodings.Web.DefaultJavaScriptEncoderBasicLatin:FindFirstCharacterToEncode (char*,int), imethod ptr 0x55f2d5038218
36% Opcounts 20590344, calls 1715862, Method System.ReadOnlySpan`1<byte>:.ctor (void*,int), imethod ptr 0x55f2d4d3fee0
```

Co-authored-by: BrzVlad <[email protected]>
2020-07-10 15:00:25 +03:00
monojenkins 47ef5a8d6a [bcl] Update BCL Linked Size (#19446) 2020-07-09 20:39:05 -05:00
24be27d5e7 [mono] Add support for UnmanagedCallersOnlyAttribute (#20060)
* [marshal] Add mono_method_has_unmanaged_callers_only_attribute

* [marshal] Allow calls to mono_marshal_get_managed_wrapped without a delegate class

   In that case, create a wrapper based on the signature of the method itself.

* [aot] Allow decode_method_ref to decode NATIVE_TO_MANAGED wrappers without a delegate class

   Bump the AOT file format

* [interp] ldftn will return a native-to-managed wrapper to UnmanagedCallersOnly methods

* aot: emit byte when we don't expect a class

* jit: create wrapper creation for ldftn in method-to-ir

   Do it at IR generation of the caller, not every time the ldftn is executed

* jit: don't create a jump trampoline for ldftn of a native-to-managed wrapper

   The wrapper might be called from a thread that's not attached to the runtime, and the jump trampoline will look at TLS vars that are not initialized

* interp: transform LDFTN into LDC of a create_method_pointer for UnmanagedCallersOnly method

* marshal: throw invalid program exception for instance and generic methods

* Emit IPE throw instead of aborting JIT or interp compilation for bad UnmanagedCallersOnly methods

   Instead of throwing while JITing (or transforming), throw when the LDFTN is executed.

* disallow delegate constructor calls on UnmanagedCallersOnly methods

* throw IPE if UnmanagedCallersOnly method has non-blittable args

* disallow DllImport and UnmanagedCallersOnly together

   throw NotSupportedException

Co-authored-by: Ryan Lucia <[email protected]>
Co-authored-by: lambdageek <[email protected]>
2020-07-09 20:37:38 -04:00
monojenkinsandvargaz 47777a57c0 [wasm] Add beginnings of support for building with ICU. (#20091)
Co-authored-by: vargaz <[email protected]>
2020-07-10 01:12:51 +02:00
monojenkinsandpi1024e f963132ac8 Change double NOT operation to comparison to 0 (#19960)
If strstr does not return 0, found is true, so instead of using !!, let's use != 0.

Co-authored-by: pi1024e <[email protected]>
2020-07-10 01:11:59 +02:00
monojenkinsandstephentoub 1e27513c9b Improve terminology used in code (#20089)
Co-authored-by: stephentoub <[email protected]>
2020-07-09 20:48:28 +02:00
monojenkinsandlateralusX c9664e6c40 Use mono_runtime_delegate_invoke in EventPipeInternal::CreateProvider. (#20093)
Due to issues on some platforms related to mono_delegate_to_ftnptr_impl, switch to use mono_runtime_delegate_invoke without need for delegate wrapper generation currently not supported on all platforms.

Co-authored-by: lateralusX <[email protected]>
2020-07-09 19:16:09 +02:00
monojenkinsandstephentoub 0edd8d4102 Fix remaining license headers (#20088)
After https://github.com/dotnet/runtime/pull/38793 tweaked the license header on ~30K files, this cleans up after it, handling another ~1300, and adding license headers where they were missing in .cs files under libraries.  It also adds a default license header to the .editorconfig.

cc: @jkotas

Co-authored-by: stephentoub <[email protected]>
2020-07-09 11:08:03 +02:00
monojenkinsandlateralusX b35ae56d96 Fix case where EventPipeInternal::Enable is called with NULL output file. (#20084)
Co-authored-by: lateralusX <[email protected]>
2020-07-08 22:01:51 -04:00
monojenkinsandlambdageek ffea1753d3 [metadata] Move rarely used bits out of MonoMethod and give 1 bit back to MonoMethod:slot (#20061)
The `MonoMethod:slot` width was accidentally changed in https://github.com/dotnet/runtime/commit/8465be73eb40a9c409dc8974b9d6b235a1b5158f

To compensate, we move 3 bits out to image properties
   * `verification_success` - rarely used nowadays, protected by the image lock (like all image properties)
   * `is_reabstracted`, `is_covariant_override_impl` - infrequently used features of newer C# language features (default interface methods and covariant returns).  Setting these assumes the loader lock is held.

Co-authored-by: lambdageek <[email protected]>
2020-07-08 21:22:17 -04:00
Zoltan Varga 1bf3add26d [wasm] Fix the build. (#20085) 2020-07-08 17:22:24 -05:00
Pablo Martínez 9c0121161c Init a timer on TransactionScope initialization to be able to timeout (#20080)
Fixes #19955
2020-07-08 21:05:42 +02:00
Alexander Köplinger 5bd9f53dc0 Update license headers 2020-07-08 17:05:37 +02:00
Thays Grazia 1d94e306fb [wasm][debugger] DebugDirectoryEntryType = Reproducible means that has debug information (#20083)
* Considering DebugDirectoryEntryType = Reproducible as an assembly that has debug information.
Fix #20075

* Adding test which Ankit wrote.
2020-07-08 11:39:50 -03:00
Zoltan Vargaandmonojenkins f047b0b299 [wasm] Implement support for pinvoke callbacks in the interpeter. (#20076)
* [wasm] Refactor the wasm tuner.

Move the pinvoke table generation code into a new PInvokeTableGenerator.cs file,
to be similar to the corresponding code in WasmAppBuilder in dotnet/runtime. NFC.

* [wasm] Implement support for pinvoke callbacks in the interpeter.

* Modify the tuner to generate a table of trampoline functions which
have the same signature as the pinvoke callback methods.
* These functions transfer control to the interpreter.
* Modify the interpreter/wasm runtime to look up the functions
corresponding to the pinvoke callback methods.

* [csproj] Update project files

* Fix license.

* Remove leftover debug code.

Co-authored-by: monojenkins <[email protected]>
2020-07-08 09:47:32 -04:00
monojenkinsandBrzVlad dc7448f15f [interp] Remove usage of some gotos (#20073)
Their usage resulted in worse code on wasm.

Co-authored-by: BrzVlad <[email protected]>
2020-07-08 14:04:08 +03:00
Ankit Jain 1da3a20c8b [wasm][debugger] Add support for deref'ing pointers (#19760)
* [wasm][debugger] Send var names also, to `mono_wasm_get_variables`

- this will be useful in upcoming commits, which will need to use the
names for local pointer vars

* [wasm][debugger] Add support for deref'ing pointers

* [wasm][debugger] Dereference the pointer in js, instead of debugger.c

Based on suggestion from @vargaz

* [wasm][debugger][tests] Fix setting async methods when setting

.. breakpoint by method name. Async methods themselves don't have the
debug information. Instead, that can be found on the generated async
implementation type/method. Here, we just look for a type name
starting with `{original_type_name}/<{async_method_name}>`, and use the
method `MoveNext` from that.

* [wasm][debugger][tests] Update to set bp by method name+lineoffset

* Address review comments from Katelyn Gadd (@kg)

* Add test to check deref'ing invalid pointers

- We should really be handling invalid object ids, and report errors for
those, where appropriate. This will be done in a future PR
- For this PR, I'm adding tests that just check that invalid objects, or
trying to deref regular objects, doesn't blow up

* Remove old unused test code

* [wasm][debugger] Use JsonConvert instead of manually building the json string

- addresses review comment from @lewing
2020-07-07 13:39:12 -04:00
Andrii Vitiv 618cdf6ff7 Fix typo in docs/README (#20070) 2020-07-07 19:17:23 +02:00
Neale Ferguson 6cb3c5bdbb Add eventpipe to dist files (#20079) 2020-07-07 14:10:47 +02:00
Vlad Brezae 6de06a3636 [interp] Access frame arguments as locals (#20040)
* [interp] Make args part of called method stack frame

This also compacts stack usage. A new frame starts at the location of the first pushed argument.

* [interp] Remove ldarg/starg opcodes

We replace them with opcodes that operate on locals instead. This also enables additional optimizations that were applying to locals.

* [interp] Kill stack_args

It is now redundant

* [interp] Actually allocate filter frame in separate space

By mistake, the filter frame was using the same stack space as the original frame. This means that the filter clause could corrupt frames from which we still need to run finally clauses. This also refactors the code a little bit, moving frame copying outside interp_exec_method, which is already overly complex.
2020-07-07 10:46:16 +03:00
Thays Grazia 8b8ee716f4 [wasm][debugger] Don't download unnecessary assemblies to DebugProxy (#20032)
* Identifying if an assembly has debug info and only download it to debug proxy if it has, this will speed up a lot the debugger initialisation.
2020-07-06 09:04:47 -03:00
Martin Baulig b6ef72c244 Fix sdk/wasm/.gitignore to not-ignore the DebuggerTestSuite directory. (#20058)
The top-level .gitignore has `[Dd]ebug*/` - which matches `sdk/wasm/DebuggerTestSuite/*`;
to override, we need to add `!DebuggerTestSuite` to sdk/wasm/.gitignore
2020-07-02 15:05:21 +02:00
Martin Bauligandmonojenkins b70c794f70 [wasm][System.IO.Compression]: Disable BrotliStream on wasm. (#19961)
* [wasm][System.IO.Compression]: Disable Brotli on wasm.

* [csproj] Update project files

Co-authored-by: monojenkins <[email protected]>
2020-07-02 07:54:04 -05:00
monojenkinsandakoeplinger 38850478fd WASM: Add an internal method to pump the threadpool (#20056)
This can by used by the xharness xunit runner to make sure async tasks are executed.

We also need to tweak how `ThreadPoolTaskScheduler` handles `TaskCreationOptions.LongRunning` since the usual mode of starting a new thread doesn't work, instead we treat it like the option wasn't set and queue the task on the threadpool.

Co-authored-by: akoeplinger <[email protected]>
2020-07-02 14:25:37 +02:00
monojenkinsandalexischr 793020489a [mono] Implement getting the type modifiers for DynamicMethod parameters (#20052)
Fixes https://github.com/dotnet/runtime/issues/36271

Co-authored-by: alexischr <[email protected]>
2020-07-01 16:15:03 -04:00
Thays Grazia 96927e3532 Adding qcalls-def.h to Makefile.am 2020-06-30 19:19:06 -03:00
monojenkinsandBrzVlad 163ab2747d [interp] Small improvements around ByReference ctor (#20041)
Co-authored-by: BrzVlad <[email protected]>
2020-06-30 16:04:18 +03:00
monojenkinsandlateralusX ffb6ee3c0a Port EventPipeBuffer, EventPipeBufferList, EventPipeBufferManager to Mono. (#19958)
Continuation of https://github.com/dotnet/runtime/pull/34600, adding BufferManager into the library including unit tests, merging source files and additional library restructuring.

- Port EventPipeBuffer.
- Port EventPipeBufferList.
- Port EventPipeManager.
- Merge internals source files. Changed GETTER_SETTER to only mandate use of inlined functions when calling betweeen source files for different types. Upgraded all use within each source file for direct struct access.
- Changed function entry error checkin strategy. Only apply active checks on outer library API, ep.h, and use EP_ASSERT for all other functions.
- Dropped requires_lock_held in function naming, switch to comment in header or in forward declare for functions that validates that lock is held.
- Removed currently unused GETTER/SETTERS.
- Moved more comments into sources from corresponding CoreCLR EventPipe sources.
- Add EventPipeBuffer/EventPipeBufferManager unit tests.

Next step after this PR will be to enable a file session during runtime and add more unit tests and then start getting diagnostic server component over to Mono.

Co-authored-by: lateralusX <[email protected]>
2020-06-30 14:31:19 +02:00
monojenkinsandBrzVlad f50ea76a08 [interp] Intrinsify ClearWithReferences (#20042)
This greatly impacts Array.Clear performance, which is commonly used in blazor rendering.

Co-authored-by: BrzVlad <[email protected]>
2020-06-30 14:55:34 +03:00
mathieubourgeois 51dfcfe5c0 Bring back previous debug_abbrev offset behavior on Apple platforms (#20031)
https://github.com/mono/mono/pull/19794 broke on iOS. Analyzing the result showed that, while the assembly was generated as expected, the linked result was different. Analyzing the LLVM code (which triggered the original fix) seems to imply that, on Apple platforms, they will not generate a label for it, only doing the 0-offset as we were doing before. Therefore, match the LLVM behavior by bringing back our previous logic when targetting Mach, otherwise use the new way of doing things.

Fixes https://github.com/mono/mono/issues/8806 (again)
2020-06-30 12:01:52 +02:00
Zoltan Varga 174aeaa31c [wasm] Optimize interp->native transitions. (#20034)
* [wasm] Optimize interp->native transitions.

* Generate tables of signatures/transition functions.
* Add mono_wasm_get_interp_to_native_trampoline () function to look up the transition function
for a signature.
* Cache the transition function in a imethod->method_data slot.

Previously, we were calling a mono_wasm_interp_to_native_trampoline () function and a generated
icall_trampoline_dispatch () function which added a lot of overhead.

* Avoid sharing cache entries.
2020-06-30 04:13:18 -04:00
Neale Ferguson 1d3e43ec3a Fix #20022 - changing the signature of mono_handle_native_crash() for s390x (#20028)
* - Update exception signature as per other archs
- Make roslyn the default for s390x

* Put the compiler check in the right place
2020-06-29 21:41:28 -04:00
Martin Baulig b873e91b11 Add mono_exception_try_get_managed_backtrace(). (#20024)
This is an enhanced version of mono_exception_get_managed_backtrace()
that takes an optional `const char *prefix` argument (to indent the
stack-trace) and returns FALSE with a NULL backtrace on error.
2020-06-29 14:10:19 +02:00
Zebediah Figura a79bf1902d [cominterop] Support ClassInterfaceType and auto-dual class interfaces (#19768)
* [cominterop] Don't leak the MonoMethodBuilder in cominterop_get_ccw_checked().

* [cominterop] Support ClassInterfaceAttribute.

* [cominterop] Factor out cominterop_get_ccw_method().

* [cominterop] Implement auto-dual class interfaces.

* [tests] Add tests for ClassInterfaceType and auto-dual class interfaces.
2020-06-27 12:19:47 -04:00
monojenkinsandlambdageek 336bbb079c [mono][mini] Do a non-virtual call for bound delegates (#20030)
When we call a delegate that was bound to a specific function, don't do a virtual call.

Fixes mono/mono#19964

Co-authored-by: lambdageek <[email protected]>
2020-06-27 11:34:24 -04:00
Safia Abdalla 380d60dc70 Re-enable verbose and trace logging in debug proxy (#19926)
* Re-enable verbose and trace logging in debug proxy

* Update LogLevel in ProxyDriver files

* Revert to use LogDebug for verbose messages
2020-06-26 20:31:31 -05:00
Alexis Christoforides 80a9ecba2e [merp] Remove dead code (#20015)
Entry to crash reporting is now more properly handled by mono_dump_start()
2020-06-26 16:42:14 -04:00
Tammy Qiu b3110cd291 [wasm] Fix package update scripts for local builds
Fix package update scripts for local builds
2020-06-26 15:13:51 -04:00
monojenkins c511814182 [metadata] Implement PreserveBaseOverridesAttribute and covariant returns support (#19927)
Covariant return implementation for Mono.

---

There are also a couple of general Mono fixes in here, too:

1. Interpreter support for `MONO_TYPE_FNPTR`  in `mint_type()`
2. a "signature assignment" mode for `mono_class_is_assignable_from` that doesn't treat `IntPtr[]` and `long[]` (or `int[]`) as interchangeable
3. support for unmanaged pointer comparisons in `mono_class_is_assignable_from`
4. Factor `mono_byref_type_is_assignable_from` out of `ves_icall_RuntimeTypeHandle_type_is_assignable_from` and make it generally usable.

---

For covariant returns, there are a couple of pieces here:
1. Method overrides come in two flavors: implicit (matching by name and sig) and explicit (using a `.override` directive).
   * for explicit overrides, we have to check that the override has a signature that is subsumed by (its return type is a subtype of the return type of) the previous override, if any, and the declared method.
   * for implicit overrides, we have to check that the override has a signature that is subsumed by the previous most derived override (not just the one that we happened to find with a precisely matching signature).
2. If any override is marked by `[PreserveBaseOverridesAttribute]` then we need to find all the other slots that may have methods from the override chain and update them.  (The attribute is expected to be applied to a `newslot virtual` method that is an explicit `.override` of some other method).

There's an interesting test case where a class has _both_ an implicit and and explicit override for the same slot, arrived via different methods - in this case, the implicit one is supposed to be ignored.  We implement this by doing the implicit slot filling first, then the explicit, and saving the covariant return checking until after both are done.

---

Because the method (`MethodImpl`) is both an override of another virtual method,
and is itself a `newslot`, it will occupy (at least) 2 slots in the vtable -
its own newslot and the `MethodDecl` that it is overriding.

If a third class subclasses the class with the `MethodImpl` or one of its
descendents and itself overrides either the `MethodDecl` or (one of the)
`MethodImpl` (either implicitly or with another explicit .override)  the
`PreserveBaseOverridesAttribute` is a signal to apply the new override that it
should apply to all the slots.

The way this works is when processing the overrides, we walk up the class
hierarchy looking at the contents of the impl slot and if any of them have the
attribute, we make sure to add a mapping to the "`override_map`" to replace any
occurrences of a previous impl with the newest (most derived) impl.

An (existing) later pass goes through the vtable and applies the override_map.

Contributes to dotnet/runtime#37509


* [metadata] Implement support for PreserveBaseOverridesAttribute

The attribute is expected to be applied to a `newslot virtual` method that
is an explicit .override of some other method.

Becuase the method (MethodImpl) is both an override of another virtual method,
and is itself a `newslot`, it will occupy (at least) 2 slots in the vtable -
its own newslot and the MethodDecl that it is overriding.

If a third class subclasses the class with the MethodImpl or one of its
descendents and itself overrides either the MethodDecl or (one of the)
MethodImpl (either implicitly or with another explicit .override)  the
PreserveBaseOverridesAttribute is a signal to apply the new override that it
should apply to all the slots.

The way this works is when processing the overrides, we walk up the class
hierarchy looking at the contents of the impl slot and if any of them have the
attribute, we make sure to add a mapping to the "override_map" to replace any
occurrences of a previous impl with the newest (most derived) impl.

An (existing) later pass goes through the vtable and applies the override_map.

* add FIXME for dynamic images

* scan entire chain of inheritance, don't stop at the class with the attribute

   Makes OverrideMoreDerivedReturn.il pass

* UnitTestDelegates is also passing

* [metadata] Add mono_metadata_signature_equal_no_ret

* inflate signature->ret when doing covariant checking

* [class] Add mono_class_signature_is_assignable_from_checked

   In ECMA I.8.7.1 "assignment compatability for signature types" we need to
   distinguish IntPtr[] from int32[] and int64[].  The ordinary cast_class for an
   array type in Mono implements the "intermediate type" relation from I.8.7.3
   "general assignment compatability" - IntPtr[] gets treated as inter-castable
   with int32[] or int64[], depending on platform pointer size.

   The new mono_class_signature_is_assignable_from_checked function does the finer
   relation for signatures, while the old mono_class_signature_is_assignable_from_checked
   preserves the existing behavior used elsewhere in the runtime.

* Check every method previously in the slot against the new impl

* UnitTest_GVM passes

* [metadata] Don't infinite loop in mono_class_get_flags for a FNPTR

   When a MonoClass is a MONO_TYPE_FNPTR, the element_class is itself.  We should
   probably not do that, but meanwhile, make `mono_class_get_flags` return
   something else for function pointer types.

   Makes mono_class_is_interface not overflow the stack

* [metadata] Set MonoClass:cast_class for pointer types to the intermediate type

   Ignore signedness differences and set cast_class to the storage type, same as
   for arrays.  This is used by mono_class_is_assignable_from when comparing
   IntPtr* vs ulong*, for example.

* [metadata] Make mono_class_is_assignable_from work for unmanaged pointer types

   The issue is that we need to compare intermediate type or the reduced type of
   the element type, depending on whether we're doing compatability or general
   assignment compatability (upshot: ulong* and long* are always inter-assignable,
   but IntPtr* is not in signatures, but is for general storage)

* [metadata] Pull mono_type_byref_is_assignable_from out of ves_icall_RuntimeTypeHandle_type_is_assignable_from

   Make it a separate internal function

* [metadata] mono_type_byref_is_assignable_from for valuetypes and class types should check for identity

   X& and Y& where both are either a reference types or valuetypes are only
   assignable if X and Y are identical.  The old code was checking for identity
   for valuetypes, but for reference types it would allow any two reference types
   at all, which is incorrect.

* [class-init] Check for byref types in covariant return signatures

Lets us pass Loader/classloader/MethodImpl/CovariantReturns/UnitTest/CompatibleWithTest.il from the CoreCLR testsuite

* [interp] handle MONO_TYPE_FNPTR in mint_type

   It's just a pointer-sized integer, as far as the interpreter's type discipline is concerned

* [class-init] Use a bit for covariant return method impls

   Allows us to check implicit overrides against previous impl's sig when the previous impl potentially had a covariant return type.

   Also use the bit to decide if we need to check signatures of the entire impl chain for explicit instantiations

* ReturnTypeValidation unit tests work on Mono now

* [class-init] check covariant vtable slots after overloads are applied

   The check has to be done after both implicit and explicit overrides have been
   applied because some implicit overrides must be ignored.  If the check is done
   as soon as we detect that a covariant return method override is needed, we will
   incorrectly check implicit overrides that are to be ignored because a later
   explicit override applied to the same slot.

* [metadata] Fix byref IsAssignableFrom

   The reflection API has an interesting behavior, whereas the ECMA definition is
   stricter.

   ```
   public interface I {}
   
   public class B {}
   public class D : B, I {}
   
   public struct S : I { }
   
   class Program {
           static void Main(string[] args)
           {
   	    var tb = typeof (B).MakeByRefType ();
   	    var td = typeof (D).MakeByRefType ();
   	    var ti = typeof (I).MakeByRefType ();
   	    var ts = typeof (S).MakeByRefType ();
   
   	    Console.WriteLine ($"{tb.FullName} is assignable from {td.FullName} ? {tb.IsAssignableFrom (td) }");
   	    Console.WriteLine ($"{td.FullName} is assignable from {tb.FullName} ? {td.IsAssignableFrom (tb) }");
   
   	    Console.WriteLine ($"{ti.FullName} is assignable from {td.FullName} ? {ti.IsAssignableFrom (td) }");
   	    Console.WriteLine ($"{td.FullName} is assignable from {ti.FullName} ? {td.IsAssignableFrom (ti) }");
   
   	    Console.WriteLine ($"{ti.FullName} is assignable from {ts.FullName} ? {ti.IsAssignableFrom (ts) }");
   	    Console.WriteLine ($"{ts.FullName} is assignable from {ti.FullName} ? {ts.IsAssignableFrom (ti) }");
   
           }
   }
   
   // Expected Output:
   // B& is assignable from D& ? True
   // D& is assignable from B& ? False
   // I& is assignable from D& ? True
   // D& is assignable from I& ? False
   // I& is assignable from S& ? False
   // S& is assignable from I& ? False
   ```

* rename mono_class_signature_is_assignable

   No need for _checked suffix

* rename mono_byref_type_is_assignable_from

* [class-init] Move vtable setup to a separate file

   The code is getting quite long, move it to a separate file
2020-06-26 14:16:03 -04:00
Zoltan Varga f562eb8869 [wasm] Use -emit-llvm instead of the obsolete -s WASM_OBJECT_FILES=0 option. (#20026) 2020-06-25 17:32:45 -04:00
Zoltan Varga 28ba000f84 [wasm] Disable the checked build for release builds. (#20020) 2020-06-25 03:28:11 -04:00
Zoltan Varga 0d655a5eb6 [wasm] Remove obsolete --llvm-lto 1 argument, lto is already enabled when -s WASM_OBJECT_FILES=0 is used. (#20021) 2020-06-24 23:46:32 -04:00
Zoltan Varga a654692162 [jit] Add a fastpath to fill_runtime_generic_context (). (#19923)
* [jit] Add a fastpath to fill_runtime_generic_context ().

This is needed in llvmonly mode, since that mode doesn't use the
fastpath lazy rgctx fetch trampolines.

* Fix method_rgctx_array_size ().
2020-06-24 18:21:05 -04:00
Steffen Kieß 82d2277a08 [mcs] Fix help text for default value of -sdk: option (#20011)
The `mcs` help text says that it will use the value `4.5` by default for the option `-sdk:`, but it actually uses `4.x`. Fix the help text.
2020-06-24 19:58:37 +02:00
Alexis Christoforides 7a0425e81f [crashing] Improve crash chaining (#19973)
With this change, `mono_post_native_crash_handler` chains the crashing signal directly, instead of that having to happen after `mono_handle_native_crash` returns (which created a fragile repetitive code pattern). Finally, this way `mono_post_native_crash_handler` can also re-raise the signal right after chaining it. Since we remove our crashing signal handlers in `mono_handle_native_crash`, this should allow the OS to handle the signal as the final action.

Fixes https://github.com/mono/mono/issues/19860
2020-06-24 11:01:48 -04:00
Ankit Jain caf00ee3d6 [master] Bump msbuild to track xplat-master (#19972)
Also, bumps roslyn to `3.7.0-1.20262.2`
2020-06-24 16:29:40 +02:00
Jay Krell 872139a3e0 [wasm][interp] Fix warning about unprototyped mono_wasm_interp_to_native_trampoline. (#19183) 2020-06-24 16:19:32 +02:00
Alexander Köplinger a0231c5fc3 [wasm] Missing signatures for Microsoft.Extensions.EventSource (#20017)
Fixes tests in dotnet/runtime that currently fail with `WASM-ERR: CANNOT HANDLE COOKIE VL`.
2020-06-24 15:37:23 +02:00
David Ávila 9c62b13be4 [WASM] Missing signatures for OpenGLES (#20001)
* Added missing signatures for OpenGLES/WebGL

* Remove duplicated signatures

* Update Wasm_m2n_invoke.g.h to include new signatures
2020-06-24 00:20:33 -04:00
monojenkinsandvargaz d9ce741562 [wasm] Make some libc stubs return an error instead of asserting. (#20010)
Co-authored-by: vargaz <[email protected]>
2020-06-23 23:13:57 +02:00
Tammy Qiu 21e1d30efc Remove xml from download-packages.ps1 2020-06-23 10:31:10 -04:00
Zoltan Varga 09c44c9323 [wasm] Use wasm-opt --strip-dwarf instead of wasm-strip which is missing from recent emscripten versions. (#20006)
Fixes https://github.com/mono/mono/issues/20002.
2020-06-22 18:55:44 -04:00
Tammy Qiu cec9dee254 Fix package update scripts for local builds 2020-06-22 17:56:27 -04:00
monojenkinsandvargaz dba7d43c7e Add threadpool support for webassembly. (#19981)
Register a JS callback when a work item is queued, the callback will call into the runtime/bcl to execute the work item.

Co-authored-by: vargaz <[email protected]>
2020-06-22 20:18:16 +02:00
monojenkinsandam11 32c3b17e50 Enable mono cross-build on SunOS-like OS (#19932)
Summary:
* wire `$(Compiler)` in `mono.proj`, that comes from `eng/build.sh`.
* add configurations for illumos cross-compilation.
* set `-Werror=strict-prototypes` for `madvise` and `posix_madvise` introspection, which is used during the compilation.
* implement `mono-threads-sunos.c`.
* add some solaris-specific thread priority levels.

With this set of changes, `dotnet hwapp.dll` works with mono flavored `System.Private.CoreLib.dll` and `libcoreclr.so` on SmartOS 2020.

Contributes to: dotnet/runtime#34944.

Co-authored-by: am11 <[email protected]>
2020-06-22 09:42:30 -04:00
Vlad Brezae 2c2a1718a9 [interp] Rework frame data storage (#19985)
* [interp] Allocate a single continous stack region

Makes things easier, slightly improving call perf, and enables us to statically know the exact offset of any local / instruction result. We allocate localloc sections separately for this reason.

* [interp] Add allocator for localloc sections

It mostly reuses the original stack fragment allocator. When allocating memory for an interp frame, we remember the original state of the allocator before we started allocating for this frame. When we finish executing the frame code and we pop back the stack, we do the same with this allocator, restoring the previous allocator state.

* [interp] Remove unreachable code that makes no sense

Probably, in ancient times, we had a separate InterpFrame that we were executing for pinvoke / icall methods.

* [interp] Add separate opcodes for returning from methods with localloc

Just to avoid the slight overhead of calls for the common scenario.

* [interp] Add separate memory accounting for interp stack
2020-06-21 19:59:45 +03:00
Vlad Brezae ab3cc22dfe [interp] Fix some warnings that show up on wasm (#19991)
Do overflow checks the same way we do it in the jit.
2020-06-20 14:10:31 +03:00
Vlad Brezae d919597d26 [interp] Add unaligned version for ldfld.vt opcodes (#19993)
Regressed recently with the addition of specialized ldfld.vt opcodes
2020-06-20 14:09:40 +03:00
Zoltan Varga a1b885f1fc [jit] Fix the Activator.CreateInstance () intrinsic for primitive types. (#19989)
Fixes https://github.com/xamarin/xamarin-android/issues/4817.
2020-06-19 20:01:02 -04:00
Larry Ewing 9954695c4c assume double numbers (#19714) 2020-06-19 12:14:51 -05:00
monojenkinsandthaystg 99794efa11 [mono] Add QCalls to the Runtime (#19945)
- Implementing QCalls on mono
- Use QCalls on ICU Shim implementation

Fixes https://github.com/dotnet/runtime/issues/36449

Co-authored-by: thaystg <[email protected]>
2020-06-19 11:43:46 -03:00
Thays Grazia ea8f106187 Fix readme and sample.html. (#19988) 2020-06-18 22:38:07 -03:00
monojenkinsandEgorBo 386ae0405d [mono] Don't contribute to inline_const if ctor has AggressiveInlining (#19930)
Mono's inliner is quite conservative (see https://github.com/dotnet/runtime/issues/34286) so we have to workaround some limitations, e.g.
```csharp
static ReadOnlySpan<byte> Arr => new byte[] {1, 2, 3, 4};

// access example:
byte GetByte(int i) => Arr[i];
```
#### Current codegen for `GetByte` (with https://github.com/dotnet/runtime/pull/37458 included)
```asm
0000000000000000 <gram_GetByte__int_>:
<BB>:1
   0:   48 83 ec 18             sub    $0x18,%rsp
   4:   c5 f8 57 c0             vxorps %xmm0,%xmm0,%xmm0
   8:   c5 f8 29 04 24          vmovaps %xmm0,(%rsp)
   d:   48 b8 50 22 73 d2 6e    movabs $0x556ed2732250,%rax
  14:   55 00 00
  17:   48 89 e7                mov    %rsp,%rdi
  1a:   ff 10                   callq  *(%rax)   ;;;; get_Arr() is not inlined!
  1c:   83 7c 24 08 00          cmpl   $0x0,0x8(%rsp)
  21:   74 0b                   je     2e <gram_GetByte__int_+0x2e>
  23:   48 8b 04 24             mov    (%rsp),%rax
  27:   8a 00                   mov    (%rax),%al
  29:   48 83 c4 18             add    $0x18,%rsp
  2d:   c3                      retq
  2e:   48 b8 68 22 73 d2 6e    movabs $0x556ed2732268,%rax
  35:   55 00 00
  38:   bf 02 01 00 00          mov    $0x102,%edi
  3d:   ff 10                   callq  *(%rax)
```

As you can see, `get_Arr()` is not inlined - it happened because the calculated size is 60 and the major contributor is `ReadOnlySpan<>.ctor` which is marked with [AggressiveInlining], so Mono inlined that `.ctor` into `get_Arr` and the total cost for `get_Arr` increased to 60.

#### Codegen with this PR:
```asm
0000000000000000 <gram_GetByte__int_>:
<BB>:1
   0:   48 b8 00 6e 1f 91 11    movabs $0x5611911f6e00,%rax
   7:   56 00 00
   a:   8a 00                   mov    (%rax),%al
   c:   c3                      retq
```
Thus, the fix helped to inline more and even reduced function size.

There are other places where we append method call costs to `inline_costs` but I decided to start with this one for constructors and only for LLVM to minimize possible regressions.

Possible regressions match current CoreCLR behavior, bad case:  [sharplab.io](https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AXEBDAzgWwB8ABAJgEYBYAKGIAYACY8gOgCUBXAOwwEt8YLAMIR8AB14AbGFADKMgG68wMXAG4aNYgGYm5JE1IMhNAN4MLNCxYDaAWRgYAFhAAmASXGSAFA+dvPMUkAeTE+CC5cFgBBAHNY2FxcXgUYdy5JXi4s2IBKAF0rax09A2IUBgAhXli/F1dvXKKLU2brC2YATm8AIgAJHtyNanb2rt6YQeHR4vJunskptrG53sWh5dn5iCWRmb1ujb2Z8Z6AdV39g96do6vTqEv90/Xp59We1yeTj4BCb4YAF9NMcmLpmGUKtVao56mcoNgxGIZI02q1Qe0APSYqo1OpuRoMXi4IkZLIwVwMPAMGAIZFgDAUhhwBgQADWmws0PxDTu1mB1DaJQhTAqABVVBhUaD0VdsQx3FT8AwuBAMDS6TAGTlcTD/JSMBAGMAYKTMlwmVlDQwJbgpU0MdZ5cAOOreG6SSzVer2ZzdTz4YjkVBGm8LALAUA===)

Co-authored-by: EgorBo <[email protected]>
2020-06-18 15:24:32 +03:00
Zoltan Varga 4ac081d6df Bump emscripten to 1.39.18. (#19980) 2020-06-17 19:07:44 -04:00
Vlad Brezae 61808b8f27 [interp] Switch locals and execution stack order (#19975)
* [interp] Switch locals and execution stack order

The order before was execution stack, vtstack, locals. The order now is locals, vtstack, execution stack. The reason for this is that in the future we would like to access arguments as locals, so the args pushed by the caller will end up being locals in the new frame. Additionally, this enables us to further compact the stack use in the future since a new frame will be allocated immediately following the current stack top. This also provides a small reduction in call overhead.

* [interp] Add stricter assertions for debug build

* [interp] Don't inline vararg calls

They have some weird call semantics

* [interp] Fix failure to align vt result to the vt alignment

* [interp] Remove pointless check

We already know we have a managed pointer on the stack, since we have the constrained prefix. We were actually losing the STACK_TYPE_MP state when storing/loading from a local, which can only be MINT_TYPE_I, and could underflow the vtstack.

* [interp] Replace warnings with asserts
2020-06-17 21:20:47 +03:00
Alexander Köplinger 74f6d2ce2d [netcore] Disable Interpreter CI runs (#19979)
We have those over in dotnet/runtime now.
2020-06-17 14:19:40 +02:00
monojenkinsandvargaz ac71dd3a3a Move the Buffer.Memmove<T> implementation into the runtime specific files since it requires a runtime specific BulkMoveWithWriteBarrier icall. (#19974)
The mono version has an extra type argument since it uses copy functions which are type specific.
Also add an elementCount > 0 check to avoid icall overhead if possible.

Co-authored-by: vargaz <[email protected]>
2020-06-16 14:07:52 -04:00
monojenkinsandvargaz 3a5d91fee2 [netcore] Implement timers for wasm. (#19967)
Co-authored-by: vargaz <[email protected]>
2020-06-16 02:05:41 +02:00
monojenkinsandvargaz bab1cde432 [wasm] Disable aot support in release builds. (#19959)
Co-authored-by: vargaz <[email protected]>
2020-06-15 14:15:23 +02:00
Vlad Brezae 35153475a2 [interp] Refactor ldfld from vt (#19963)
Add separate faster opcode and remove use of MINT_VTRESULT
2020-06-13 01:07:57 +03:00
Alexis Christoforides 540da38191 [merp] Add API methods for getting hashcode/reason of last crash (#19901)
* [merp] Add API methods for getting hashcode/reason of last crash

* Add test

* Review feedback and cleanup
2020-06-11 22:45:12 -04:00
Zoltan Varga e51b4af9cd [llvm] Emit a descriptive name for MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL as well. (#19947) 2020-06-10 15:13:35 -04:00
Zoltan Varga 4966fc22c4 [wasm] Fix marshalling of pointer types. (#19946)
Fixes https://github.com/mono/mono/issues/19943.
2020-06-10 04:00:41 -04:00
Vlad Brezae 07e6f1e605 [interp] Don't save ip twice in InterpFrame (#19909)
We had frame->ip used by EH and debugger and frame->state.ip used to save the ip of the next instruction to be executed when we return from the call. Since both represent more or less the same thing, unify them and avoid duplicate storing inside InterpFrame for each call. Because we use this ip with exception handling, we need to subtract 1 (similar to the jit) so the ip ends up being in the call instruction and not the next.
2020-06-09 22:00:48 +03:00
monojenkinsandakoeplinger c99dcebb15 [mono] Add back sys/types.h include for clockid_t (#19941)
Looks like it was accidentally removed in https://github.com/dotnet/runtime/pull/37457

Co-authored-by: akoeplinger <[email protected]>
2020-06-09 19:06:41 +02:00
monojenkinsandfanyang-mono 363e89b403 Check the existence of clocked_t (#19915)
Fixes https://github.com/mono/mono/issues/19733

Co-authored-by: fanyang-mono <[email protected]>
2020-06-09 11:08:16 -04:00
Tammy Qiu e19ce7b433 Merge pull request #19938 from tqiu8/update-pkg-script
[wasm] Update package update scripts to include debug proxy
2020-06-09 10:31:16 -04:00
Zoltan Varga aa46acadd4 [wasm] Throw PlatformNotSupportedException instead of NotSupportedException when starting threads/waiting on monitors. (#19937)
* [wasm] Throw PlatformNotSupportedException instead of NotSupportedException when starting threads/waiting on monitors.

* Preseve PlatformNotSupportedException.
2020-06-08 19:41:40 -04:00
tqiu8 a0658ed9b4 [wasm] comment out steps updating local mono repo 2020-06-08 16:45:24 -04:00
tqiu8 965b2eb778 [wasm] incorporate pr feedback & fix powershell script 2020-06-08 16:31:58 -04:00
Tammy Qiu f37c1c91dc [wasm] Update package update scripts to include debug proxy 2020-06-08 13:39:59 -04:00
Rickard df2f9b01d2 Avoid setting PTHREAD_PRIO_INHERIT on Alpine, since this causes deadlocks (#19914)
Fixes #7167

The PR 3e8108ea65 introduced a deadlock on Alpine, making it impossible to even build mono. This PR reverts the setting of PTHREAD_PRIO_INHERIT when on Alpine.
Since GCC on Alpine doesn't provide a builtin macro to detect Alpine, I also added a #define in configure.ac.
2020-06-08 18:57:04 +02:00
Mike Gorse faee046f95 Use new ucontext handling for glibc 2.26 (#19935) 2020-06-08 10:36:26 -04:00
Zoltan Varga 5ec4240614 [wasm] Bump emscripten to 1.39.17. (#19929)
* [wasm] Bump emscripten to 1.39.17.

* [interp] Optimize MINT_DIV_I4/DIV_I8/REM_I4/REM_I8 to work around an llvm problem.
2020-06-08 08:24:33 -04:00
monojenkinsandEgorBo 497152e37c [mono] Append -sroa and -instcombine to LLVM-JIT pass manager (#19916)
Partially fixes https://github.com/dotnet/runtime/issues/37449
```csharp
static ReadOnlySpan<byte> Arr
{
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    get => new byte[] {1, 2, 3, 4};
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static byte GetByte(int i) => Arr[0];
```
#### Codegen for GetByte() in LLVM-JIT mode:
```asm
0000000000000000 <gram_GetByte__int_>:
<BB>:1
   0:   48 83 ec 28             sub    $0x28,%rsp
   4:   c5 f8 57 c0             vxorps %xmm0,%xmm0,%xmm0
   8:   c5 f8 29 04 24          vmovaps %xmm0,(%rsp)
   d:   48 b8 b0 bd 55 d2 3f    movabs $0x563fd255bdb0,%rax
  14:   56 00 00
  17:   48 89 04 24             mov    %rax,(%rsp)
  1b:   c7 44 24 08 04 00 00    movl   $0x4,0x8(%rsp)
  22:   00
  23:   48 8b 04 24             mov    (%rsp),%rax
  27:   48 89 44 24 10          mov    %rax,0x10(%rsp)
  2c:   8b 44 24 08             mov    0x8(%rsp),%eax
  30:   89 44 24 18             mov    %eax,0x18(%rsp)
  34:   8b 44 24 0c             mov    0xc(%rsp),%eax
  38:   89 44 24 1c             mov    %eax,0x1c(%rsp)
  3c:   83 7c 24 18 00          cmpl   $0x0,0x18(%rsp)
  41:   74 0c                   je     4f <gram_GetByte__int_+0x4f>
  43:   48 8b 44 24 10          mov    0x10(%rsp),%rax
  48:   8a 00                   mov    (%rax),%al
  4a:   48 83 c4 28             add    $0x28,%rsp
  4e:   c3                      retq
  4f:   48 b8 d0 ae 42 d2 3f    movabs $0x563fd242aed0,%rax
  56:   56 00 00
  59:   bf 02 01 00 00          mov    $0x102,%edi
  5e:   ff 10                   callq  *(%rax)
```

Codegen after I appended `-sroa -instcombine` to the end of LLVM passes list:
```asm
0000000000000000 <gram_GetByte__int_>:
<BB>:1
   0:   48 b8 d0 ef a6 ba 31    movabs $0x5631baa6efd0,%rax
   7:   56 00 00
   a:   8a 00                   mov    (%rax),%al
   c:   c3                      retq
```

This https://godbolt.org/z/YKjzsV link explains motivation (on the left is the "final" LLVM IR our llvm-jit produces after the default optimizations). Zoltan noticed that LLVM-AOT where we use `opt -O2` instead of custom pass order optimized that code perfectly.

The other issue remains: for some reason we don't inline `get_Arr()` without AggressiveInlining, coreclr does inline it:
```
Successfully inlined Program:get_Arr():System.ReadOnlySpan`1[Byte] (12 IL bytes) (depth 1) [below ALWAYS_INLINE size]
```

Co-authored-by: EgorBo <[email protected]>
2020-06-08 09:36:38 +03:00
monojenkinsandCoffeeFlux b4092e2011 [runtime] Add remaining runtime events and fix some existing ones on netcore (#19799)
Fixes https://github.com/mono/mono/issues/16246

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

The commits here should be reasonably chunked up, but a summary of what this accomplishes:

* Wires up OnResourceResolve
* Fixes our corlib satellite assembly check in netcore_load_reference (we were previously comparing "System.Private.Corelib" to "System.Private.Corelib.resources", which does not work)
* Adds some useful classes to mono_defaults
* Removes legacy events from MonoDomain and prevents calling them on netcore
* Fixes UnhandledException to call the correct event
* Wires up FirstChanceException

`AppDomainTests.AssemblyResolve_FirstChanceException` is now failing because of the exception type, so it should work once I sort out https://github.com/dotnet/runtime/issues/34030. Until then, keep it disabled.

Co-authored-by: CoffeeFlux <[email protected]>
2020-06-08 02:17:49 -04:00
Aleksey Kliger (λgeek) ba14e69474 [mono] Move some culture-dependent source files to a separate directory (#19912)
* [mono] Move culture-info-tables.h to a separate directory

We'd like to remove culture-info-tables.h from the dotnet/runtime copy of mono since we use ICU
there for globalization like the rest of .NET 5.

The plan is:
1. We move the file (and some others) to a separate directory (this PR)
2. We tell the sync bot to skip `culture/` in the future
3. We delete the files (or make them empty) in dotnet/runtime
* Also move locale.c and culture-info.h

* Also move mono_w32process_ver_language_name

* [msvc] don't compile locales.c if it doesn't exist

   It exists for now, but won't after we stop syncing culture/ to dotnet/runtime
2020-06-06 14:48:11 -04:00
imhameed ad0b2b8e3d Start unifying unaligned memory access codepaths. (#19913)
The intrinsic expansions for Unsafe.ReadUnaligned and
Unsafe.WriteUnaligned now use mini_emit_memory_load and
mini_emit_memory_store.

stind is now implemented in terms of mini_emit_memory_store; when used
during compilation of the the sgen nursery check wrapper,
mini_emit_memory_store will no longer longer emit a release fence when
storing a reference under the CLR memory model.

mini_emit_memory_load and mini_emit_memory_store also no longer
decompose unaligned loads/stores to explicit byte-wise memcpy move
sequences; the LLVM IR backend already converts
MONO_INST_UNALIGNED-flagged OP_LOAD*/OP_STORE* operations to LLVM memory
movement operations with alignment 1.

Should fix https://github.com/mono/mono/issues/19142.
2020-06-05 13:44:22 -07:00
Zoltan Varga fdb5e61a5b [aot] Fix the binary search in the llvmonly unbox tramp table. (#19922)
Fixes https://github.com/mono/mono/issues/19879.
2020-06-05 12:20:01 -04:00
Zoltan Varga 2321bba344 [wasm] Fix icall linking with netcore. (#19917) 2020-06-05 10:29:52 -04:00
Zoltan Varga 0250810bc9 [interp] Optimize do_jit_call (). (#19904)
* [interp] Optimize do_jit_call ().

* Move the JIT call related fields to a separate JitCallInfo structure.
* Compute calling convention information and store it into JitCallInfo
  to avoid most type processing at call time.

* Address review comments.
2020-06-05 08:38:35 -04:00
Zoltan Varga 5246aaf492 [wasm] Link out the SR resource string code on netcore. (#19919) 2020-06-05 08:21:40 -04:00
Zoltan Varga f27ccd0432 [wasm] Print out the real stack trace when load_runtime () fails. (#19918) 2020-06-05 08:00:46 -04:00
Zoltan Varga dda38c4d17 [wasm] Make aot-profile/runtime.js work with different executables. (#19921) 2020-06-05 07:58:01 -04:00
Zoltan Varga 9dc089f334 [wasm] Fix the print-table.py script. (#19920) 2020-06-05 07:57:46 -04:00
monojenkinsandvargaz 335a5949ad Fix mono_asmctx_get_name () after dotnet/runtime#37264. (#19903)
Co-authored-by: vargaz <[email protected]>
2020-06-03 13:28:17 -04:00
Zoltan Varga eaa32d1365 [runtime] Add a MONO_ASMCTX_INTERNAL assembly context. (#19892)
Use it to avoid triggering managed load events when loading the AOT container image.
2020-06-02 15:53:20 -04:00
Vlad Brezae 3b2e8e1102 [interp] Fix tracing (#19898)
Regressed recently with the change in return value handling.
2020-06-02 21:30:40 +03:00
Alexis Christoforides 51b5fa6421 [runtime] Fix a case where crash chaining was broken (#19891)
We must always have a call to mono_chain_signal() after mono_handle_native_crash(), in case signal chaining and crash chaining are both enabled.
2020-06-02 14:26:37 -04:00
monojenkinsandEgorBo 335750b3ca [mono] Rename libruntime-android.so to libmonodroid.so (#19889)
`libruntime-android.so` was just a random name I used for our test runner but since we need some name for `dlopen` (we can't use dlopen(NULL)) and to be shared between the test runner and Xamarin.Android let's switch to the XA name.

We could add an API for mono embedding to set desired name but 'm not sure if it's worth an effort now.

Co-authored-by: EgorBo <[email protected]>
2020-06-02 13:19:56 +03:00
Bernhard Urban-Forster 3f5ade5246 [github] remove me from codeowners 2020-06-02 10:24:42 +02:00
monojenkinsandlambdageek 5bf43dd0d0 [interp] Switch to GC Unsafe mode before calling get_interp_to_native_trampoline (#19871)
For PInvokes, `ves_pinvoke_method` is called when we're interpreting the
pinvoke wrapper, after it already executed a transition from GC Unsafe to GC
Safe mode.  At that point, calling back into the runtime we have to temporarily
switch back to GC Unsafe mode.

Example stack trace where we don't:

```
     0x10dbdd7d6 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_dump_native_crash_info
      0x10db7f665 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_handle_native_crash
      0x10dbdcf3f - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : sigabrt_signal_handler
      0x7fff6886af5a - /usr/lib/system/libsystem_platform.dylib : _sigtramp
      0x0 - Unknown
      0x7fff686081ae - /usr/lib/system/libsystem_c.dylib : abort
      0x10dd9e887 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : monoeg_assert_abort
      0x10dd75257 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_log_write_logfile
      0x10dd9ed15 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : monoeg_g_logv_nofree
      0x10dd9edd2 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : monoeg_g_log
      0x10dd8b4fc - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_threads_transition_do_blocking
      0x10dd8cc63 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_threads_enter_gc_safe_region_unbalanced_with_info
      0x10dc40a39 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_coop_mutex_lock
      0x10dc41e05 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_domain_alloc0
      0x10dadba6f - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_tramp_info_register_internal
      0x10dbece91 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : get_interp_to_native_trampoline
      0x10dbebaf9 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : ves_pinvoke_method
      0x10dbe0e58 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : interp_exec_method
      0x10dbdf17b - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : interp_runtime_invoke
      0x10dcbae58 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_runtime_invoke_checked
      0x10dcbacf3 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_runtime_object_init_handle
      0x10dc6367f - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_exception_new_by_name_domain
      0x10dc63523 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_exception_from_name_domain
      0x10dbe81c6 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : interp_exec_method
      0x10dbdf17b - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : interp_runtime_invoke
      0x10dcbae58 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : mono_runtime_invoke_checked
      0x10dcd6e69 - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : start_wrapper_internal
      0x10dcd6b9e - /private/tmp/helix/working/B38709D8/p/libcoreclr.dylib : start_wrapper
      0x7fff68874661 - /usr/lib/system/libsystem_pthread.dylib : _pthread_body
      0x7fff6887450d - /usr/lib/system/libsystem_pthread.dylib : _pthread_body
      0x7fff68873bf9 - /usr/lib/system/libsystem_pthread.dylib : thread_start
```

Co-authored-by: lambdageek <[email protected]>
2020-06-01 17:28:43 -04:00
monojenkinsandlambdageek 2d187d76ae [mono][metadata] Add a method custom attribute scanning function (#19880)
Our normal custom attribute lookup method may trigger loading.  This is undesirable during class initialization, for example.  For this reason, we have `mono_class_metadata_foreach_custom_attr` that scans a class for custom attributes without triggering loading.

This PR adds `mono_method_metadata_foreach_custom_attr` that does the same thing - looks for custom attributes on methods without causing any loader activity.

This PR also reorganizes the code in `class-init.c` that uses these metadata custom attribute lookups to be a bit easier to use.

Finally we add a convenience method (unused so far) to look for `PreserveBaseOverridesAttribute` which is defined in dotnet/runtime#35315 and which will be necessary to implement covariant returns.

Co-authored-by: lambdageek <[email protected]>
2020-06-01 14:29:20 -04:00
Vlad Brezae d5ed68483c [interp] Remove saving of clause_args from interp state (#19857)
* [interp] Remove saving of clause_args from interp state

clause_args can be set only from EH. This means that clause_args can be set only in the first executed frame, so there is no need to save it in the interp state. Also make sure we never check for it in the main_loop block, for normal calls and returns. Added exec_frame to the clause_args so we can detect whether a frame is the first frame invoked from EH. We can no longer use clause_args for this purpose because we no longer save it in the interp state.

* [interp] Remove error argument to interp_exec_method

We were doing this to avoid having a MonoError local in interp_exec_method, which is no longer relevant. Avoid reiniting the error with each interp call.
2020-06-01 10:58:52 +03:00
Zoltan Varga b7a100c036 [wasm] Fix netcore+aot support. (#19883)
* Add more substitutions for SIMD get_IsSupported () methods.

* [wasm] Fix netcore+aot support.
2020-05-31 11:13:34 -04:00
Zoltan Varga 9c0403bc46 [wasm] Print a warning in the pinvoke generator if multiple incompatible declarations would be emitted, and error (#19873)
out at runtime.

Fixes https://github.com/mono/mono/issues/19869.
2020-05-30 13:00:47 -04:00
Zoltan Varga d35dc0bcf4 [wasm] Fix netcore support in the packager. (#19881) 2020-05-30 06:35:12 -04:00
monojenkinsandlateralusX 233077f452 Fix Mono C++ build. (#19875)
Co-authored-by: lateralusX <[email protected]>
2020-05-30 02:53:10 +02:00
monojenkinsandBrzVlad a42f4fea6b [interp] Remove assertions from release and add more to debug builds (#19878)
Co-authored-by: BrzVlad <[email protected]>
2020-05-30 01:42:45 +03:00
Alexander Köplinger e163c5b6a2 Add back whitespace at end of sre-save.c 2020-05-29 11:12:01 +02:00
monojenkinsandalexischr da0a7f2352 [mono] Implement AssemblyBuilder.GetReferencedAssemblies (#19818)
Some info from https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.assemblybuilder.getreferencedassemblies?view=netcore-3.1:

> This method does not return a complete list of referenced assemblies. For example, if you apply a custom attribute to the AssemblyBuilder, the assembly in which the attribute was defined is included in the list returned by this method. However, if you use a Type object to specify the type of a method parameter, that type is not included.

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

Co-authored-by: alexischr <[email protected]>
2020-05-29 10:34:48 +02:00
monojenkinsandalexischr d163874806 [mono] Implement AssemblyBuilder.GetSatelliteAssembly (#19870)
Contributes to https://github.com/mono/mono/issues/14788

Co-authored-by: alexischr <[email protected]>
2020-05-29 10:32:40 +02:00
monojenkinsandCoffeeFlux bea273e99c [runtime] Fix Mono BStr marshaling, cleanup IL generation (#19701)
This PR checks in recent string marshaling work and enables a subset of tests that now run successfully. It's possible that this fixes or changes the failure on other tests, but I've only checked the StringMarshalling ones.

Status of string marshaling of this PR:
* AnsiBStr - tests pass
* BStr - tests pass
* LPStr - failure with StringBuilder
* LPTStr - immediate failure
* UTF8Str - crash with invalid malloc in StringBuilder code (??)
* LPWStr - no tests
* TBStr - no tests

Followup work:
- [ ] Fix UTF8 crash (probably corruption, the crash used to be in a free call)
- [ ] Clean up StringBuilder code (lots of issues, some caught by the tests, in progress)
- [ ] Add TBStr and LPWStr tests (in progress)
- [ ] Fix LPTStr to properly handle both ANSI and UTF16 text (or maybe change the test to align with our historical behavior? currently the test uses LPWStr on all platforms)
- [ ] Add a wall of text on string marshaling behavior for classic and netcore Mono at the start of `conv_to_icall`

Co-authored-by: CoffeeFlux <[email protected]>
2020-05-28 15:01:11 -04:00
monojenkinsandvargaz dcfa0ec293 [runtime] Implement the many argument version of the Vector128.Create () intrinsic. (#19851)
Co-authored-by: vargaz <[email protected]>
2020-05-28 09:17:39 -07:00
Zoltan Varga 5c204cfb10 [wasm] Fix the handling of i8/u8 in get_wrapper_shared_type_full (). (#19859)
Previously, these were returned verbatim, which caused sharing issues when the type had
attributes.

Fixes https://github.com/mono/mono/issues/19841.
2020-05-28 10:44:14 -04:00
Jérôme Laban 5c9b63da2e [wasm] Fix packager not emitting debug symbols when ninja is enabled (#19863)
Fix the packager not emitting debug symbols when ninja is enabled (e.g. when statically linking a bitcode file, still using the interpreter).
2020-05-28 11:55:27 +02:00
monojenkinsandsafern 6489563f28 Add ICU App-Local support on Mono (#19852)
This adds AppLocalIcu switch support on Mono. I also refactored GlobalizationMode to share the sources in between Mono and CoreCLR to avoid duplicating all the AppLocal and UseNls switches logic.

cc: @jkotas @thaystg @akoeplinger @tarekgh @ericstj

Co-authored-by: safern <[email protected]>
2020-05-28 10:37:43 +02:00
Zoltan Varga da59b3acab [wasm] Include the pinvoke table into a separate file, so the generated declarations don't conflict with the ones in the header files included by driver.c. (#19853)
Fixes https://github.com/mono/mono/issues/19837.
2020-05-27 09:53:53 -04:00
monojenkinsandBrzVlad 834bf5ede3 [interp] Remove return value indirection (#19845)
When returning from a method we used to save the return value into frame->retval. We would then have separate opcodes for normal and void call and, depending on the type of call, we would access the retval and push it on the stack. In case of valuetype returns, the value is not returned in the proper space so we have an additional MINT_VTRESULT that copies the return around in the caller frame. In addition to this we had retval, is_void locals, saved as part of the current frame state which just make things confusing and are not needed.

This commit simplifies the call procedure by completely moving the responsability of the return to the called method. Simply put, once a method is ready for the call, it will leave its stack and vtstack to the state after pop-ing the arguments. The called method will then directly push the result to the parent frame's stack/vtstack. This means the calling code doesn't care about the type of the return anymore, the IL instructions after the call will just expect the return on the stack, if any, and use it naturally.

We still make use of frame->retval for interp entry frames (since we don't have a parent frame to push to), for pinvoke and jit_call frames out of convenience, but we should consider removing this variable to further trim down InterpFrame.

Co-authored-by: BrzVlad <[email protected]>
2020-05-27 11:58:16 +03:00
Zoltan Varga 14ff5bd29a [wasm] Add more runtime debugging docs. (#19850) 2020-05-26 22:12:57 -04:00
Johan Lorensson 540e8d1d7b Merge pull request #19472 from monojenkins/sync-pr-34600-from-runtime
Initial work porting native diagnostic event pipe library to C library potentially shared between runtimes.
2020-05-26 15:29:18 +02:00
Marek Habersack 53d0017701 [reflection] Check whether a pointer is valid before dereferencing (#19839)
`Xamarin.Android` native runtime calls `mono_reflection_type_from_name`
and passes `NULL` as the `image` parameter.  The parameter is then
propagated all the way to `_mono_reflection_get_type_from_info` where,
in case the assembly isn't loaded yet, it is used to obtain base
directory of the assembly.  However, since the `image` parameter is
`NULL` in our case, attempt to dereference it causes a segfault:

    libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4c0 in tid 11029 (ompanyname.app3), pid 11029 (ompanyname.app3)
    crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
    /system/bin/tombstoned: received crash request for pid 11029
    crash_dump64: performing dump of process 11029 (target tid = 11029)
    DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    DEBUG   : Build fingerprint: 'google/sdk_gphone_x86_64/generic_x86_64:10/QSR1.190920.001/5891938:user/release-keys'
    DEBUG   : Revision: '0'
    DEBUG   : ABI: 'x86_64'
    DEBUG   : Timestamp: 2020-05-25 14:45:29+0200
    DEBUG   : pid: 11029, tid: 11029, name: ompanyname.app3  >>> com.companyname.app3 <<<
    DEBUG   : uid: 10134
    DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4c0
    DEBUG   : Cause: null pointer dereference
    DEBUG   :     rax 000000000000002f  rbx 0000000000000001  rcx 0000000000000000  rdx 0000000000000030
    DEBUG   :     r8  0000000000000003  r9  000000000013e2e2  r10 0173eed800000000  r11 0000000000000206
    DEBUG   :     r12 0000000000000000  r13 00007478530343c0  r14 00007478075eda33  r15 000074780763efb0
    DEBUG   :     rdi 0000000000000000  rsi 00007478e2cb14d0
    DEBUG   :     rbp 00007ffef3a35680  rsp 00007ffef3a355d0  rip 0000747807a4066a
    DEBUG   :
    DEBUG   : backtrace:
    DEBUG   :       #00 pc 00000000003ba66a  /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonosgen-2.0.so (_mono_reflection_get_type_from_info+474)
    DEBUG   :       #01 pc 00000000003ba3d1  /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonosgen-2.0.so (mono_reflection_type_from_name_checked+321)
    DEBUG   :       #02 pc 00000000003ba26d  /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonosgen-2.0.so (mono_reflection_type_from_name+125)
    DEBUG   :       #03 pc 000000000000ddb5  /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonodroid.so (xamarin::android::internal::EmbeddedAssemblies::typemap_java_to_managed(char const*)+389) (BuildId: 9952f1cfe0d910ae631abc73479f88eef34fd71d)
    DEBUG   :       #04 pc 000000000000def3  /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonodroid.so (xamarin::android::internal::EmbeddedAssemblies::typemap_java_to_managed(_MonoString*)+99) (BuildId: 9952f1cfe0d910ae631abc73479f88eef34fd71d)
    DEBUG   :       #05 pc 0000000000069532  <anonymous:5ad25000>

Even though this happens in `Xamarin.Android`, the error may occur for
any embedding application which passes `NULL` for the `image` parameter
in situation when the assembly isn't in memory yet.
2020-05-26 09:25:33 -04:00
Zoltan Varga 38356be989 [wasm] Remove obsolete emscripten options. (#19844) 2020-05-26 07:33:45 -04:00
Johan Lorensson df8f3c3c3d Create Makefile 2020-05-25 21:08:08 +02:00
lateralusX 6bb89469e8 Initial work porting native diagnostic event pipe library to C library potentially shared between runtimes.
PR handling port of EventPipe C++ library from CoreCLR into a C library that can be shared between Mono as well as CoreCLR runtime.

Due to dependencies and current time line it has been decided to initially target Mono runtime (since it doesn't have event pipe functionality at the moment), but library is still designed to integrate into other runtimes, replacing current C++ library implementation, when time permits.

Until that happens, we will need to make sure changes done in C++ code base gets ported over to C library. The amount of changes going into the native library should however be small and if major changes needs to be done, we should first make sure to move over to use the shared version of event pipe C-library in CoreCLR and then only do changes into shared version of the library.

Port is currently mapping existing C++ code base, no focus on rewrite or change current implementation (unless needed to port code over to C).

Library source files are currently placed into mono/eventpipe folder and build as a separate library, linked into runtime, but will be moved when ready to be shared between runtimes. We might also move all code into a loadable library and p/invokes, depending on size, at least for Mono runtime targeting mobile devices.

There is also a unit test runner under mono/eventpipe/tests using eglib test runner, running through a set of unit tests covering the eventpipe library implementation.

Library is split up over a couple of source files closely mapping corresponding coreclr source files. Most code could be shared between runtimes and artifacts that are runtime specific, like locks/lists/maps/strings/pal layer etc, a shim API is defined in `ep-rt.h` and `ep-rt-types.h` that gets implemented by the targeted runtime consuming the event pipe C library, like `ep-rt-mono.h` and `ep-rt-types-mono.h`. All function in the shim API is small and should be inlinable. For example, locking the configuration lock is declared like this in `ep-rt.h`:

```
bool
ep_rt_config_aquire (void);
```

and in `ep-rt-mono.h` it is implemented like this:

```
static
inline
bool
ep_rt_config_aquire (void)
{
	ep_rt_spin_lock_aquire (ep_rt_mono_config_lock_get ());
	return true;
}
```

and CoreCLR should implement the function using its corresponding locking primitives. NOTE, since we primarily target Mono in initial port there might smaller adjustments needed to the shim API once bringing it over to CoreCLR, but those changes/adjustments can be done when needed.

Since library could be shared, it tries to standardize on common C99 data types when available. If there are runtime specific types needed, they are declared in `ep-rt-types.h` and implemented by each runtime in corresponding file. Most of library is currently following Mono coding guidelines.

For shared types naming is done like this, `EventPipe[Type]`, like `EventPipeProvider`. This naming follow naming of other types in Mono as well as CoreCLR. There is one exception to this rule, types that are runtime specific implementation, naming is following function naming with a _t prefix, like `ep_rt_session_provider_list_t`, that is a list specific type, implemented by each runtime. This is done to make it easier to see difference of types implemented in the runtime specific shim and types implemented in the shared library API surface.

Since library shim implemented by targeted runtime will be called by C code, it can't throw exceptions, the C library should however compile under C++, meaning that CoreCLR's shim should be able to use C++ constructions as long as it don't throw any exceptions.

Library function naming follows the following pattern, for "public" functions included in `ep-*.h` , ep_ + object + action, so for example, `ep_config_create_provider`, corresponds to `EventPipe::Configuration::CreateProvider` in C++ library. For "private/internal" functions not, ep_ prefix is dropped, but object + action is still preserved, for example `config_create_provider` and function is marked as being static when possible. If a function assumes a lock is held when getting called, it is using _lock_held (similar to SAL annotations) postfix to indicate that function doesn't claim lock and if function needs lock to be held by caller, it will assert that condition on enter (similar to `PRECONDITION(EventPipe::IsLockOwnedByCurrentThread())`).

Library uses asserts internally to validate state and conditions. This is a debug/checked build assert that should be excluded in release builds. It is defined in `EP_ASSERT` and should be redefined by targeted runtime. Private/internal functions asserts incorrect input parameters and state, while "public" functions return back error to caller when detecting incorrect input parameters. Incorrect state can still be assert in all kinds of functions.

Getters/Setters are setup for accessing type members. All functions except a type's own alloc/init/fini/free implemented in `ep-*.c` are not allowed to use direct type member access and should go through available inlinable getter/setter functions. There is also a way to build the library that catches incorrect use of members at compile time (not in `ep-*-internals.c` since it include alloc/init/fini/free implementations, but in other source files).

Types that can be stack allocated offers a init/fini function pairs. Types that should only be heap allocated, alloc/free, and types supporting both stack/heap, implements alloc/init/fini/free. Since C can't prevent incorrect usage patterns, the implementation needs to follow correct life time management patterns. Types allocated using alloc should be freed with corresponding free function. For example, `ep_event_alloc` should be freed by `ep_event_free`, the init/fini methods are then called by the alloc/free implementations. For types supporting stack allocation and allocated on stack or aggregated within other types, init must be called before first use and fini before going out of scope.

Ownership of allocated objects is only considered complete on successful function calls. If a function fails, caller still owns resource and need to take actions.

Library uses UTF8 strings internally, mainly since Mono runtime already uses that and it is more portable. Number of strings in the library is limited, and in cases where stream protocol uses UTF16 strings, a prealloc string is stored on the type, reducing need to do multiple UTF8 -> UTF16 conversions over the lifetime of the type.

NOTE, this is first PR setting up most of the direction of the library and (as part of doing that) ported a great deal of eventpipe code and added ~40 native unittests. It is however not complete, or fully working, so there will be several follow up PR's building on top of this work in order to get complete library. Next component to integrate into the library, once this PR is merged, is BufferManager.
2020-05-25 19:06:54 +00:00
w-flo dd9bc98945 configure.ac: check for sockaddr_in6 on Win32 (#19812)
HAVE_STRUCT_SOCKADDR_IN6 needs to be defined to enable IPv6 features in
mono/metadata/w32socket.c.

Fixes TcpListener issues in wine-mono.
2020-05-25 17:08:05 +02:00
Zoltan Varga 02e83f0ddc [wasm] Avoid overwriting the pinvoke table if not changed. (#19833) 2020-05-23 00:25:39 -04:00
Zoltan Varga 8446996cab [jit] Return the compiled method and an unbox trampoline from ldvirtftn when calling ldvirtftn on a valuetype method. (#19809)
* [jit] Return the compiled method and an unbox trampoline from ldvirtftn when calling ldvirtftn on a valuetype method.

Fixes https://github.com/dotnet/runtime/issues/34379.

* [runtime] Add some caching to mono_aot_get_unbox_trampoline (). Register unwind info for trampolines.

* Add a 'method' field to MonoTrampInfo to be used by unbox trampolines.

* Refactor delegate initialization code.

Also handle unbox trampolines during the addr->method lookup.

* Merge mono_delegate_ctor () and mono_delegate_ctor_with_method ().
* Move the actual logic to mini_init_delegate ().
* Remove callbacks.create_jump_trampoline, its not used any more.

* Fix the build.

* Remove an interpreter workaround.

* Avoid leaking the amodule->unbox_tramp_per_method array.
2020-05-23 00:17:50 -04:00
Thays Grazia 8f0fbfcd95 Fixing make dist after implementation of static ICU Shim. (#19819) 2020-05-22 17:23:15 -04:00
monojenkinsandCoffeeFlux 8e071069af Add MONO_LOADER_LIBRARY_NAME define (#19830)
Co-authored-by: CoffeeFlux <[email protected]>
2020-05-22 17:21:12 -04:00
Zoltan Varga d2da900426 [wasm] Preserve UnmanagedFunctionPointerAttribute. (#19829)
Fixes https://github.com/mono/mono/issues/19826.
2020-05-22 03:41:19 -04:00
Ankit Jain a1b68d97c3 [wasm][debugger] Allow invoking property getters for objects (#19726)
* [wasm][debugger][tests] Move the test files to `tests/debugger`

- Also, rename `class Math` to `class SampleMath` in `sample.cs`,
to allow building sample.dll, with all the tests added.

(cherry picked from commit dc265710139d7c3a63f714e4b19bdb60014b5bcb)

* [wasm][debugger][tests] Add back missing dependency

(cherry picked from commit 2bc6482bb3049b34da918e2dc91df459774873c9)

* [wasm][debugger][tests] move *datetime-test.cs to `tests/debugger`

(cherry picked from commit 2b43270a42a599fe2bdb460018460e32571bbc79)

* [wasm][debugger][tests] Move CFO test to debugger-cfo-test.cs

(cherry picked from commit aba95ffddad94a613a9a12eaf0dddcc9dd661b58)

* [wasm][debugger] Allow invoking property getters for objects

- These can be invoked interactively by the user from the IDE/chrome
debugger
- Getters on valuetypes are not supported right now

* [wasm][debugger] Fix warnings

* [wasm][debugger][tests] Fix DateTimeLocale test to await getting

.. properties for a DateTime object. Required after rebasing on master.
2020-05-21 22:38:16 -04:00
Alex Thibodeau 7490cc0e2b Adding check to bypass decoding pdbs that have no sequence points. (#19815)
Unity has a pdb with zero sequence points somehow. If a user added a reference to the library and then attempted to set a managed breakpoint mono would hit an assert and crash when it would attempt to decode this pdb.

Call stack would look like:
```
>	mono-2.0-boehm.dll!mono_ppdb_get_seq_points(_MonoDebugMethodInfo * minfo, char * * source_file, _GPtrArray * * source_file_list, int * * source_files, MonoSymSeqPoint * * seq_points, int * n_seq_points) Line 508	C
 	mono-2.0-boehm.dll!mono_debug_get_seq_points(_MonoDebugMethodInfo * minfo, char * * source_file, _GPtrArray * * source_file_list, int * * source_files, MonoSymSeqPoint * * seq_points, int * n_seq_points) Line 1093	C
 	mono-2.0-boehm.dll!get_source_files_for_type(_MonoClass * klass) Line 6920	C
 	mono-2.0-boehm.dll!get_types_for_source_file(void * key, void * value, void * user_data) Line 7003	C
 	mono-2.0-boehm.dll!monoeg_g_hash_table_foreach(_GHashTable * hash, void(*)(void *, void *, void *) func, void * user_data) Line 364	C
 	mono-2.0-boehm.dll!mono_de_foreach_domain(void(*)(void *, void *, void *) func, void * user_data) Line 95	C
 	mono-2.0-boehm.dll!vm_commands(int command, int id, unsigned char * p, unsigned char * end, Buffer * buf) Line 7341	C
 	mono-2.0-boehm.dll!debugger_thread(void * arg) Line 10323	C
 	mono-2.0-boehm.dll!start_wrapper_internal(StartInfo * start_info, unsigned __int64 * stack_ptr) Line 1241	C
 	mono-2.0-boehm.dll!start_wrapper(void * data) Line 1315	C
 	kernel32.dll!00007ffc12017bd4()	Unknown
 	ntdll.dll!00007ffc121ece51()	Unknown
```

Adding a check to ignore pdbs like this prevents the crash and debugging can continue normally.

Related unity issue: https://issuetracker.unity3d.com/issues/macos-editor-crashes-on-mono-log-write-logfile-when-attaching-a-debugger-and-then-setting-a-breakpoint
2020-05-21 14:24:12 -04:00
monojenkinsandthaystg 2f56fc19dc Fixing tests on android that uses Icu Shim Globalization (#19817)
The linker was removing the icu shim functions even exporting them. The unique solution that we found until now is to force the linking using the -u flag.
This is a temporary fix until we don't implement QCalls.
Fixes https://github.com/dotnet/runtime/issues/36685

Co-authored-by: thaystg <[email protected]>
2020-05-21 15:28:13 +02:00
monojenkinsandalexischr 78dbf5b308 [mono] Implement AsAny marshalling for simple arrays (#19683)
Simple here means of rank 1, and with a blittable value type as element type.

Contributes to https://github.com/dotnet/runtime/issues/35225

Co-authored-by: alexischr <[email protected]>
2020-05-21 10:05:56 +02:00
Vlad Brezae 783b96aa4c [interp] Add separate opcode for pop vt (#19814)
* [interp] Add separate opcode for pop vt

Before this change, pop-ing a vt from the stack was done in 2 opcodes, a MINT_POP (decrementing the stack) and the weird MINT_VTRESULT (decrementing the vtstack). However, optimizations could have removed both the initial loading of the value type on the stack as well as the MINT_POP, leaving MINT_VTRESULT underflowing the vtstack. Fix this and cleanup the code by pop-ing a value type from the stack in a single instruction.

* [interp] Re-enable optimizing away loading of unused value type on the stack
2020-05-21 00:35:51 +03:00
Zoltan Varga cec64d9b7f [interp] Fix interp entry for methods with lots of arguments in llvmonly+interp mode. (#19802)
Fixes https://github.com/mono/mono/issues/19801.
2020-05-20 11:20:19 -04:00
Vlad Brezae 0c87593336 [interp] Small cleanups (#19805)
* [interp] Refactor calli code

Previous code was very confusing.

* [interp] Extract string creation into separate opcode

For speed and simplification of code.
2020-05-20 13:51:43 +03:00
Jo Shields e2b1e065d0 Always include Unicode charinfo, so tar made in csc mode works in mcs mode (#19807)
As-is, a tarball created in Roslyn mode is missing the file charinfo.nlp, which mcs needs to build the classlib.
2020-05-20 11:45:20 +02:00
Andy Savage 2918655063 Added hard limit to sub-make jobs. (#19798)
Fixes #19784
2020-05-20 11:40:35 +02:00
Ankit Jain 98320ecbde [wasm][debugger][tests] Allow overriding which browser to use (#19769)
* [wasm][debugger] Reduce debugger-tests timeout to 40m

- And run that before the system tests since the debugger is more likely
to fail at this point.

Based on @lewing's suggestion

* [wasm][tests] Allow overriding which browser to use

.. via the envvar `WASM_TESTS_ChromePath`.

This can also be set in an `appsettings.json` file next to the test
binaries, like:
```
{ "ChromePath": "</path/to/chrome/binary>" }
```

Also, prefer stable Chrome over Canary.

Co-authored by @lewing
2020-05-18 15:02:38 -04:00
Zoltan Varga 4490662bc0 [wasm] Bump emscripten to 1.39.16. (#19793) 2020-05-18 10:36:30 -04:00
monojenkinsandthaystg 01be43b9cb [mono] Linking statically ICU shim on mono (#19699)
Linking statically ICU shim on mono for windows, linux, macOs and android.

Co-authored-by: thaystg <[email protected]>
2020-05-18 11:02:21 -03:00
w-flo 669ba26333 [corlib] Improve RuntimeThread stub (#19782)
The only call site of RuntimeThread.InitializeThreadPoolThread() is in
ThreadPoolCallbackWrapper, and it needs to return a valid RuntimeThread
reference to prevent a NullReferenceException later on. So return
`new RuntimeThread (null)` instead of a null reference.

This fixes a wine-mono crash I have encountered in "ZUSI 3 - Aerosoft
Edition" (in ZusiDisplay), and it might fix mono bug #17994.
2020-05-18 11:52:53 +02:00
monojenkinsandakoeplinger e35988adc0 Fixes for iOS x86 build (#19795)
Needed for the iOS Simulator for 32bit iOS devices.

Co-authored-by: akoeplinger <[email protected]>
2020-05-18 11:28:11 +02:00
Vlad Brezae b552da81ff [interp] Don't share interp_in signatures for different valuetypes (#19788)
* [interp] Don't share interp_in signatures for different valuetypes

We share interp_in wrappers for different types of signatures if the corresponding params are equivalent. This was added in https://github.com/mono/mono/commit/5cbe93884798684efbb81abd79e0e2a170544b75. This was reusing some sharing mechanism used by gsharedvt. Those wrappers are shared with regard to managed->managed transitions so it takes additional freedoms, converting all valuetypes to ValueTuples instances. These can end up being marshalled differently from the initial struct so we can't use this valuetype sharing infrastructure in the interp_in_wrappers which can operate on native structs.

Fixes test_0_marshal_struct_delegate from pinvoke3.cs

* [interp] Keep sharing interp_in signatures with VT if not pinvoke

As suggested by zoltan
2020-05-16 23:47:28 +03:00
Alexander Köplinger 38584afad0 Bump bockbuild to get https://github.com/mono/bockbuild/pull/159 2020-05-15 14:30:41 +02:00
monojenkinsandlambdageek 8c8497e79f [Mono] Don't set thread name of main thread on Linux (#19742)
Fixes https://github.com/dotnet/runtime/issues/35908

This adds a new function `mono_native_thread_main_thread_known` which returns `TRUE` when the `MonoNativeThreadId` (`pthread_t` on Linux) of the main thread is known.  On Linux the main thread is the one where `gettid () == getpid ()`.  There are two complications:
1. `pthread_t` and `pid_t` are distinct tokens, so knowing the `pid_t` ("os id" in Mono) of the main thread doesn't tell us its `pthread_t` (`MonoNativeThreadId`)
2. In an embedding scenario, the main thread may never interact with Mono (for example all the calls to `mono_jit_init`, etc might be happening on a helper thread).
So the solution is to augment `register_thread` (responsible for initializing a `MonoThreadInfo`) to check for `getpid () == gettid()` and to save `pthread_self()` as the "main thread" when it becomes available.

Co-authored-by: lambdageek <[email protected]>
2020-05-14 15:57:03 -04:00
Ankit Jain 1a022edfcb [wasm][debugger] Clear valuetypes cache on Debugger.resume (#19778)
* [wasm][debugger] Clear valuetypes cache on Debugger.resume

- This fixes:
	1. Check valuetype properties
	2. Debugger.resume, over some code that updates that valuetype
	3. That valuetype's properties show older values

* [wasm][debugger] Send mono_wasm_debugger_resume only if stopped on

.. a managed frame.
2020-05-14 11:48:51 -04:00
Thays Grazia 13c5c4129e [debugger] Removing some asserts (#19758)
* Removing some asserts and returning err_invalid_argument with an error message when it's possible.

* if we don't find method get_ObjectIdForDebugger we try to find the property Task to continue async debug.
2020-05-14 09:16:53 -03:00
monojenkinsandakoeplinger f24a85069b Fix mono runtime build warnings when building iOS config (#19779)
```
  /Users/alexander/dev/runtime/src/mono/mono/mini/aot-runtime.c:5647:13: warning: unused variable 'image' [-Wunused-variable]
```
```
  /Users/alexander/dev/runtime/src/mono/mono/mini/simd-intrinsics-netcore.c:11:1: warning: no previous prototype for function 'mono_simd_intrinsics_init' [-Wmissing-prototypes]
```
```
  /Users/alexander/dev/runtime/src/mono/mono/utils/mono-state.c:1230:1: warning: no previous prototype for function 'mono_crash_save_failfast_msg' [-Wmissing-prototypes]
  /Users/alexander/dev/runtime/src/mono/mono/utils/mono-state.c:1236:1: warning: no previous prototype for function 'mono_crash_get_failfast_msg' [-Wmissing-prototypes]
```

Co-authored-by: akoeplinger <[email protected]>
2020-05-14 12:13:04 +02:00
Ankit Jain bab72f364a [wasm][debugger][tests] Rework SetBreakpointInMethod, to get the (#19771)
* [wasm][debugger][tests] Rework SetBreakpointInMethod, to get the

.. location info from the proxy, and then use `setBreakpointByUrl` to
set the breakpoint.

* [wasm][debugger] Bump timeout for debugger tests, since we are not running

.. tests in parallel now.
2020-05-14 02:15:04 -04:00
Maxim Lipnin b9d0edb407 [wasm] Re-enable some corlib tests (#19642) 2020-05-14 00:16:37 -05:00
monojenkinsandimhameed 3905678ac5 Improve Sse41.Multiply compatibility with LLVM 9. (#19777)
The llvm.x86.sse41.pmuldq intrinsic is no longer available as of
https://github.com/dotnet/llvm-project/commit/254ed028a4bd4fa81d0049d90e6ab23d704dd366.

This also adds a convenience wrapper for creating constant LLVM IR
vectors, up to 16 elements long, of arbitrary integral type.

Finally, fix a latent bug in init_function_pass_manager;
llvm::StringRef::size returns a value of type size_t, but the printf
precision specifier requires a value of type int.

Co-authored-by: imhameed <[email protected]>
2020-05-13 20:17:12 -07:00
mathieubourgeois b66f812449 Emit DWARF debug_abbrev offset for compile units as a label instead of 0 (#19770)
When outputting DWARF code to start a compilation unit in .debug_info, the standard expect a 4-byte offset from the .debug_abbrev code. Mono has always output an offset of 0.

However, this doesn't work in every cases. When we have linux+fullaot, we link two object files (one from Mono, one from LLVM). Both have their .debug_abbrev section. If we use 0 as an offset, it seems possible that the linker will keep thinking that our offset is 0, no matter the circumstances. Since the offset is always 0, it can be using the wrong abbreviation table (i.e. the one from the LLVM assembly instead of the one from the Mono assembly). The consequence of this is that the linked file is not valid DWARF (dwarfdump and objdump will complain about invalid offsets). At best, some tools will be able to work with a part of what we have, but any program requiring entirely valid DWARF will fail.

To fix this, we generate a label for the start of our debug_abbrev section and we instead generate it by generating a long with that label. This matches existing behavior seen in the LLVM generated code, and makes dwarfdump and objdump react properly to the linked product.

Fixes https://github.com/mono/mono/issues/8806
2020-05-13 14:22:51 +02:00
Zoltan Varga f265d9a783 [runtime] Move delegate_bound_static_invoke_cache to MonoWrapperCaches. (#19766) 2020-05-13 08:01:40 -04:00
Alexander Köplinger bcbb4cf5a6 Revert accidental api-snapshot commit 2020-05-13 10:53:46 +02:00
monojenkinsandtqiu8 b7274d8a27 [master] [wasm][debugger][tests] Add locale tests for datetime (#19759)
* [wasm][debugger][tests] Add locale tests for datetime

* incorporate PR feedback & reference issue number for disabled locales

Co-authored-by: tqiu8 <[email protected]>
2020-05-12 13:57:35 -04:00
Thays Graziaandmonojenkins 33b0653c2c [debugger] Merge debugger-libs/Mono.Debugger.Soft (#19725)
Trying to make mono/debugger-libs/Mono.Debugger.Soft be the same as mono/mono/mcs/class/Mono.Debugger.Soft

Relates to https://github.com/mono/debugger-libs/pull/323
* Bump API snapshot submodule

Co-authored-by: monojenkins <[email protected]>
2020-05-12 18:18:49 +02:00
Zoltan Varga 430570e18b [wasm] Bump emscripten to 1.39.15. (#19744) 2020-05-11 13:33:27 -04:00
Calvin Buckley 169a842f4e Fix musl PowerPC build (#19747)
PT_NIP and friends are in this kernel header, but glibc includes it
somewhere in the chain implicitly. musl doesn't. Fix that.
2020-05-11 10:34:16 +02:00
Vlad Brezae 866914eeff [tests] Adjustments to interp disabled tests (#19748)
* [interp] Disable fullaotmixed suite on x86

* [interp] Small cleanup of disabled tests

Enable a bunch of tests on arm (which I thought I enabled 2 years ago). Avoid duplication by moving some arch specific disabled tests to all platforms. Enable a few tests that seem to have been fixed in the meantime.
2020-05-10 22:39:56 +03:00
Vlad Brezae 8e1f242bdb [interp] Fix sdks build (#19745)
* [interp] Fix sdks build

* [interp] Fix build
2020-05-09 11:26:30 +03:00
Vlad Brezae 798f22399e [interp] Add x86 support (#19730)
* [interp] Aling data to 8 bytes

On x86 linux, double doesn't guarantee 8 byte alignment, which we need since all objects on the vt stack need to be 8 byte aligned. Use padding instead to achieve this.

* [interp] Add x86 support

This mainly consists of a trampoline that is used when calling from interp into native code, as well as the call convention logic that initializes the CallContext structure (which is passed to the trampoline). On other platforms we also have a single trampoline used when entering interpreter code. That trampoline works in a similar way and its purpose is to avoid compilation of all possible interp entry signatures, which is problematic on full aot scenarios. Given the interp x86 support is currently provided for android, we can avoid using that trampoline for now and use the per signature jit compiled interp_in_wrappers instead.

The few disabled interp tests are the same as on amd64.

We only support pinvoke into cdecl functions.
2020-05-08 17:44:21 +03:00
Zoltan Varga 049de7513a [interp] Fix memory overwrite during pinvoke r4 parameter passing. (#19709)
* [interp] Fix memory overwrite during pinvoke r4 parameter passing.

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

* [interp] Allocate 1 slot for every pinvoke float arg only.
2020-05-08 05:35:04 -04:00
Larry Ewing 680481793a [wasm][debugger] Only send resolved events on load (#19736)
* [wasm][debugger] Only send resolved events on load

* Add the request to the context after potentially loading the store

* improve the resolution logic
2020-05-07 23:27:59 -05:00
Larry Ewing 8d774f90bf [wasm][debugger] Get loaded files without having a round trip (#19735) 2020-05-07 21:37:38 -05:00
Zoltan Varga ae1ba25fb1 [wasm] Use the official emsdk repo. Use the same version of emsdk as emscripten. (#19737)
* [wasm] Use the official emsdk repo. Use the same version of emsdk as emscripten.

* [wasm] Reclone the wasm repo when the version changes.
2020-05-07 22:30:45 -04:00
monojenkinsandBrzVlad cc7c5855c3 [interp] Remove unnecessary code (#19729)
param_count is always 1 and it doesn't need to be computed at runtime.

Co-authored-by: BrzVlad <[email protected]>
2020-05-07 18:22:29 +03:00
monojenkins 258c9de8d9 [mono] Fix 32bit Android build (#19724)
1) Use `HostArch` for AppBuilder tasks 
2) Remove `tkill` for Android 32bit since it's not available in recent Android NDKs anymore.
2020-05-07 15:37:43 +02:00
Katelyn Gadd 3546709b3f Disable per-collection parallelism in debugger tests (#19722)
* Disable per-collection parallelism in debugger tests because moving tests out into more classes has created more collections, causing test failures

* Fix typo
2020-05-06 21:33:52 -04:00
Ankit Jain c2795c9cb5 [master] Bump msbuild to track xplat-master (#19621)
* [master] Bump msbuild to track xplat-master

* [master] Bump msbuild to track xplat-master

* Update nuget.exe to 5.6.0-preview3

- closest version that I could find, to the one in msbuild (`5.7.0-preview.1.6592`)
2020-05-06 11:40:05 -04:00
Thad House c9e6754eea Fix incorrect arg storage for arm softfp interpreter (#19676)
In get_call_info, IS_HARD_FLOAT is checked to switch between using the FP registers and the GP registers. This was not done in arg_get_storage, which was always using the hard float registers. This would mean parameters to the native trampoline wouldn't get copied correctly, and return values would be incorrect as well.

I can't find a way to add this to tests, since no softfp test systems seem to be built. I'm working on testing the use cases I can think of on my softfp system just to be sure.

Any assignments to type RegTypeHFA were locked behind a IS_HARD_FLOAT check as well, so I think its safe to modify that case too.

Fixes #14591
2020-05-06 11:52:05 +02:00
monojenkinsandtqiu8 e96347b0ef [master] [wasm][debugger][tests] Add tests for multiple breakpoints inline (#19719)
* [wasm][debugger][tests] add tests for multiple breakpoints

* [wasm][debugger][tests] Update CheckBreakpoint with more descriptive name and use CheckLocation

* [wasm][debugger][tests] More descriptive test name

* [wasm][debugger][tests] Combine two tests in one using [Theory]

Co-authored-by: tqiu8 <[email protected]>
2020-05-05 23:18:38 -05:00
Larry Ewing f6e347ed11 [wasm][debugger] Rework setBreakpointByUrl location handling (#19688)
* [wasm][debugger] Only choose the best match when mutiple locations are found
2020-05-05 19:42:28 -05:00
Larry Ewing 5d59d699fc [wasm][debugger] Add tests for floating common types (#19712) 2020-05-05 12:16:47 -05:00
Zoltan Varga cff010202b [wasm] Delete an emscripten patch which is no longer needed. (#19705)
* [wasm] Delete an emscripten patch which is no longer needed.

* [wasm] Disable the dynamic runtime build, it has no usage.
2020-05-05 11:06:38 -04:00
Larry Ewing e911de2a8b [wasm][debugger] Fix type argument (#19704) 2020-05-05 08:53:09 -05:00
Neale Ferguson 5633d5ccef Add soft debugger support to s390x (#19697)
* Add soft debugger support to s390x
  - Implement the sdb trampoline
  - Big-endian fixes for ppdb debugger:
    - Fix utf16 strings
    - Fix decoding of ImageDebugDirectory structures
  - New implementation of OP_SEQ_POINT
  - Enable successful unwind by defining markpoints
  - Implement mono_arch_setup_resume_sighandler_ctx
  - Implement unwind ops in epilog

* Fix delegate-invoke processing
  - Handle up to 10 parameters
  - Use sigparam information to correctly "slide" parameters

* Fix floating point negative zero for s390x
  - Add a new instruction for use in OP_RxCONST -0
  - Check for -0 in constant

* Minor indentation fixes

* Fix atomic add implementation

* Check for additional hardware facilities
2020-05-05 11:04:25 +02:00
Zoltan Varga fdc474bc46 [wasm] Add docs about -fsanitize=address. (#19703) 2020-05-04 16:22:09 -04:00
monojenkinsandCoffeeFlux 6b3eb8aa82 [runtime] Mono ALC embedding: use public types, correct hook signature (#19657)
We can't have GLib types in public headers. Oops.

There is potentially still an issue with `mono_alc_get_default_gchandle` not being exported, but that can wait for later.

cc: @garuma

Co-authored-by: CoffeeFlux <[email protected]>
2020-05-04 10:56:09 -04:00
Jeffrey Stedfast ccadc65005 [Mono.Debugger.Soft] Fixed NRE in MethodMirror.FullName when param_info is not yet cached (#19675)
If param_info has not yet been fetched, then the FullName property
will throw a NRE when accessed.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1112185/
2020-05-04 10:26:09 -04:00
monojenkinsandBrzVlad 5270d49f71 [interp] Move label outside of main loop (#19696)
Wasm has control flow limitations which don't go well with gotos. Move label outside of main loop because it translates to very poor wasm code. Other gotos don't seem to negatively impact instruction dispatch code, so leave them alone, for now ..

Co-authored-by: BrzVlad <[email protected]>
2020-05-04 12:24:15 +03:00
Zoltan Varga ec646ff710 [wasm] Bump emscripten to 1.39.14. (#19690)
* [wasm] Bump emscripten to 1.39.14.

* Set PYTHONUTF8=1 to work around emscripten issue 10551.

* Set LC_ALL as well.
2020-05-04 05:02:20 -04:00
Jérôme Laban 88cae11c6b [Wasm] Additional signatures for SkiaSharp interop (#19671) 2020-05-03 13:14:05 -04:00
Zoltan Vargaandmonojenkins 9e1c7d5aa4 [wasm] Integrate the m2n-gen.cs tool into mcs/tools/wasm-tuner. (#19680)
* [wasm] Integrate the m2n-gen.cs tool into mcs/tools/wasm-tuner.

It should be ran as:
mono wasm-tuner.exe --gen-interp-to-native <output file name> <extra assemblies>.

The <extra assemblies> will be searched for pinvoke methods, and their signatures
will be added to the set of supported signatures.

* [csproj] Update project files

Co-authored-by: monojenkins <[email protected]>
2020-05-01 04:20:53 -04:00
Zoltan Varga 3148398386 Disable a few executables if DISABLE_EXECUTABLES is defined. (#19678) 2020-04-30 14:19:35 +02:00
Thays Grazia e934687575 Cleaning error before return Invalid_argument. (#19660) 2020-04-28 10:56:10 -03:00
Junil Um 6442041b8b Fix if already send error to http client, do not callback. (#19664)
Fixed #10435 

HttpListener already closes the Response object, closes the HTTP Client connection, and then sets the value of Response.StatusCode again. If so, an ObjectDisposedException is thrown.

```
Unhandled Exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.HttpListenerResponse'.
  at System.Net.HttpListenerResponse.set_ContentLength64 (System.Int64 value) [0x00013] in <b4473693dd3c4d45883c574a53529fbe>:0
  at MonoConsoleApp1.Program.Main (System.String[] args) [0x000f8] in <a66f6d7d417445dc9f89c691941ca70b>:0
  at MonoConsoleApp1.Program.<Main> (System.String[] args) [0x0000c] in <a66f6d7d417445dc9f89c691941ca70b>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.HttpListenerResponse'.
  at System.Net.HttpListenerResponse.set_ContentLength64 (System.Int64 value) [0x00013] in <b4473693dd3c4d45883c574a53529fbe>:0
  at MonoConsoleApp1.Program.Main (System.String[] args) [0x000f8] in <a66f6d7d417445dc9f89c691941ca70b>:0
  at MonoConsoleApp1.Program.<Main> (System.String[] args) [0x0000c] in <a66f6d7d417445dc9f89c691941ca70b>:0
```

If an error is sent to the HTTP client while processing a request, it is patched so that the next process is not executed anymore.
2020-04-28 15:37:23 +02:00
Zoltan Varga 41508e493d [wasm] Update netcore build. (#19666) 2020-04-28 05:43:04 -04:00
Ankit Jain c0c18ce34b [wasm][debugger][tests] Split tests into separate files (#19647)
* [wasm][debugger][tests] Move helper methods to base class

* [wasm][debugger][tests] Extract EvaluateOnCallFrame tests to new file

* [wasm][debugger][tests] Extract Array tests to a new file

* [wasm][debugger][tests] Extract CallFunctionOn tests to a new file

* [wasm][debugger][tests] Extract Delegate tests to a new file

* [wasm][debugger] Don't inherit from another test class

.. as that ends up running all the tests of the base class too.

* [wasm][debugger][tests] Improve retries in TestHarnessStartup

Sometimes `/json/list` seems to return an empty array (`[ ]`). Treat
that also as a case for retry.

* [wasm][debugger][tests] Bump timeout from 2s to 5s

* [wasm][debugger][tests] Launch chrome in incognito mode

* debugging

* [wasm][debugger] TestHarnessStartup - don't share `ProcessStartInfo`

.. instances. Instead, create one for every use.
We seem to run into cases where the `get_Environment` is modifying it's
`_environmentVariables` field, concurrently from multiple threads,
causing exceptions like:

```
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Diagnostics.Process.CreateEnvp(ProcessStartInfo psi)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at WebAssembly.Net.Debugging.TestHarnessStartup.LaunchAndServe(ProcessStartInfo psi, HttpContext context, Func`2 extract_conn_url) in /Users/radical/dev/w1/sdks/wasm/ProxyDriver/TestHarnessStartup.cs:line 82
   at WebAssembly.Net.Debugging.TestHarnessStartup.<>c__DisplayClass10_0.<<Configure>b__1>d.MoveNext() in /Users/radical/dev/w1/sdks/wasm/ProxyDriver/TestHarnessStartup.cs:line 167
```

* [wasm][debugger] Fix regression in debug.html

Fixes https://github.com/mono/mono/issues/19653 .
2020-04-27 19:31:46 -04:00
monojenkinsandBrzVlad e76b77a6b2 [interp] Fix tracking of local refcount when adding movloc opcode (#19659)
Consider the following IL code pattern:

```
stloc.np 0
dup
stloc 1
```

When `stloc 1` instruction is processed, we know we have local 0 on the top of the stack so we can replace `dup/stloc` with `movloc 0 -> 1`. However, we need to make sure that the refcount for local 0 is increased so we don't prematurely kill instructions that store into this local (the `stloc.np` from above). This is needed because we remove a dependency from the stack but add one from the locals. If the local 0 would have been explicitly pushed with a ldloc, the refcount is updated when we handle the ldloc, and no other updates are necessary.

Co-authored-by: BrzVlad <[email protected]>
2020-04-28 00:03:58 +03:00
Filip Navara f627ac6c16 Bump corefx (#19646)
Bump CoreFX submodule to get https://github.com/mono/corefx/pull/399.
2020-04-27 11:57:58 +02:00
Neale Ferguson aff8690a9b Major fixes to s390x ABI and add TAILCALL trace support (#19611)
* Fixes to s390x ABI to support roslyn
- Add new instructions
- Fix outarg_vt processing
- Add new hardware capabilities check
- Add mono_trace_tail_method() to properly support traceing of tail events

* Further s390x enhancements:
- Support altstack
- Rework localloc
- Fix tail processing
-- Restoration of registers dependent on paramater use and RGCTX
-- Restoration of FP registers

* Reset the debug flag to FALSE

* Fix tabbing etc. to conform with standard
2020-04-25 18:43:45 +02:00
monojenkinsandvargaz fcb8bd80fe Add some missing linker exclusions. (#19652)
Co-authored-by: vargaz <[email protected]>
2020-04-25 17:08:39 +02:00
monojenkinsandfanyang-mono 429d269d0f Refactor get_time_stamp_ns (#19438)
fixes dotnet/runtime#34074

Co-authored-by: fanyang-mono <[email protected]>
2020-04-24 11:35:41 -04:00
Bernhard Urban-Forster b2ec7fbfd9 [jit] use helper to obtain method signature (#19643)
`mini_method_get ()` doesn't guarantee that `method->signature` is set.
2020-04-24 17:15:59 +02:00
Joshua Peterson d4cb7ce150 Prevent a possible assert in the debugger when a thread detaches (#19541)
When a new thread is attached to the VM, the debugger will add it to the
`thread_to_tls` hash table. When that thread detaches, it will be
removed. Once the thread is attached, if a client is debugging, the
client can use the `CMD_THREAD_GET_FRAME_INFO` command to ask for
details about that thread.

This is a possibility that the thread detaches before the
`CMD_THREAD_GET_FRAME_INFO` command is processed, so the thread may not
exist the the `thread_to_tls` hash table any more.

This is a race condition, but is a valid state, so instead of asserting,
the debugger agent should indicate to the client that the thread no
longer exists, using `ERR_UNLOADED`.
2020-04-24 12:52:09 +02:00
vidir-svanberg 7e64403cfa Prevent NullReferenceException in SurrogateProviderAdapter (#19362)
Prevents NullReferenceException in SurrogateProviderAdapter which occurred when SurrogateProviderAdapter is constructed with a null ISerializationSurrogateProvider instance, which results in NullReferenceException in GetDataContractType, GetDeserializedObject and GetObjectToSerialize.
2020-04-24 10:43:29 +02:00
Ankit Jain 0568261f20 [wasm][debugger] Fix evaluateOnCallFrame for valuetype locals (#19638)
* [wasm][debugger] Fix `evaluateOnCallFrame` for valuetype locals

.. including generic, and async methods.

* [wasm][debugger] Remove some debug spew
2020-04-24 00:22:01 -04:00
monojenkinsandCoffeeFlux 98e3eb8345 [meta] Add embedding API function to get the default ALC (#19598)
Also formatting fixes to the unstable header.

We can just return the stored GCHandle for the default ALC because it's both strong and should never change.

cc: @garuma

Co-authored-by: CoffeeFlux <[email protected]>
2020-04-23 11:49:32 -04:00
Александр Хухлаев 82c4f32882 [WinForms] Fix ListView GetItemAt high load (#19639)
When ListView.VirtualMode = true GetItemAt should not access items collection directly to
get bounds of ListViewItem. Otherwise, method OnRetrieveVirtualItem will be called.
Which costs a lot of time.
2020-04-23 16:58:46 +02:00
Mitchell Hwang 946a479729 [System.Runtime.Serialization] Work around specified cast is not valid error (#19620)
During json serialization, if the key was an enum type, then it would fail trying to cast into an XmlDictionaryString.  

The fix is to treat the enum value like a string.
2020-04-23 09:00:35 -04:00
monojenkinsandCoffeeFlux 72b3c27759 [meta] Add GCHandle embedding API v2 with pointer-sized handles (#19599)
I've adopted the v2 convention instead of attempting a more descriptive name, with the hope that it makes iteration easier in the future and simplifies opt-in obsoletion.

cc: @vargaz @garuma

Co-authored-by: CoffeeFlux <[email protected]>
2020-04-23 08:36:24 -04:00
Alexander Köplinger 1763f53a4f freebsd.sh: Fix check for python3
"env python3" would actually run the python repl which would hang in CI provisioning.
2020-04-23 11:47:30 +02:00
Maxim Lipnin 3a04bff395 [wasm] Enable System.Data tests (#19614) 2020-04-22 09:28:12 -05:00
Maxim Lipnin 2c9ccaa46f [wasm] Add throwing PNSE to where currently disabled tests throw something different (#19538)
* Add throwing PNSE to where currently disabled tests throw something different

* Add try-catch + PNSE to public SslStream ctor in case of WASM
2020-04-22 09:27:33 -05:00
Zoltan Varga 1289c36895 [wasm] Preserve MonoPInvokeCallback using a linker xml descriptor. (#19631)
Fixes https://github.com/mono/mono/issues/19594.
2020-04-22 09:46:24 -04:00
Zoltan Varga bc8f971803 Fix a warning. (#19629) 2020-04-22 12:08:56 +02:00
monojenkinsandBrzVlad 7f41366684 [amd64] Fix tailcall with arguments passed on stack (#19502)
On all platforms, OP_TAILCALL copies the arguments (that are passed on the stack) from the param area in the current frame, to the param area in the caller frame, meaning that it expects the arguments to be passed normally on the stack. However, on amd64, mono_arch_emit_call was storing these arguments directly in the param area of the caller (EMIT_NEW_ARGSTORE), instead of the param area of the current frame. OP_TAILCALL would then override the already set stack parameters with random data from the uninitialized param area of the current frame.

Fixes https://github.com/dotnet/runtime/issues/34376

Co-authored-by: BrzVlad <[email protected]>
2020-04-22 11:49:29 +03:00
Ankit Jain e5937caf97 [wasm][debugger] Fix enumerating for this on valuetypes (#19626)
* [wasm][debugger] `mono_wasm_call_function_on` - remove unncessary

.. parameter, since it is already present in the `args` object.

* [wasm] MonoProxy - convert cfo calls to MonoCommands

* [wasm][debugger] Fix enumerating `this` properties for a valuetype

* [wasm][debugger] `evaluateOnCallFrame` - fix `this` for valuetypes

* [wasm][debugger] Remove MonoCommands no longer used

* [wasm][debugger] Fix showing the name for generic methods

- We were using `method.Name` from Cecil, but that we want to the name
with the type arguments for the generic instance.
2020-04-22 01:33:34 -05:00
Larry Ewing 2c5eb1993f [wasm][debugger] Fix command response handling (#19590)
* [wasm][debugger] send failed evaluations to the browser

Make sure that we allways either send a single result or return
false from Accept Command to ensure that we don't leave
messages spinning.
2020-04-20 17:07:50 -05:00
Zoltan Vargaandmonojenkins 0a37eeadec [wasm] Reenable the managed collation code, link it out by default, add a packager option to enable it. (#19570)
* [wasm] Reenable the managed collation code, link it out by default, add a packager option to enable it.

* Disable some xunit tests which fail because the test runner can't handle the [SkipOnTargetFramework(TargetFrameworkMonikers.Mono)] attribute.

* [csproj] Update project files

Co-authored-by: monojenkins <[email protected]>
2020-04-20 12:53:16 -05:00
Alexander Köplinger 068b41946d [tests] Disable sgen-bridge.exe on Windows x64 FullAOT+LLVM (#19604)
See https://github.com/mono/mono/issues/19603
2020-04-20 19:44:41 +02:00
Ankit Jain 17c4a60cd2 [wasm][debugger] Support array expansion in VS via callFunctionOn (#19588)
- This was prompted by vscode/vs requiring this for array expansion.
- It runs a given js function string, on a given object id.
- We handle the case for dotnet object ids.

Implementation:

- We build a proxy object that reflects the details of the real dotnet object/array
- And run the js function on that proxy object

- Then if `returnByValue` was requested, the result is returned as-is
- Else we cache that object, with a new special object id (`dotnet:cfo_res:..`),
  and return that id in the response.

- Subsequently, we would get `Runtime.getProperties` request on this new object id
- And a `Runtime.releaseObject` request, to free that function result.

- All this is handled currently

Tests:

- A few tests were added which invoke `callFunctionOn`, on JS objects, and checks the result
  - And the same checks are performed on equivalent dotnet objects, with the same js function
  - This should help stay in sync with what we think `callFunctionOn` should work as

  - These tests have an additional parameter - `roundtrip`, which calls a simple function
	`function () { return this; }`
    .. on a dotnet object, and gets the result object id. If `roundtrip == true`, then it
    runs that same function on the result object, and gets a new result object id. And the
    tests run their checks on that.

    - this helps to check that outside of the proxy, the result object behaves same as any
      other dotnet object.

- Also, most of the tests were modified to support an additional mode (`use_cfo`).
  - With this, whenever a test wants to run `Runtime.getProperties on an object, we pass that
    object through the earlier "identity" function, and then run `getProperties` on that
    resultant object.

  - This helps to take advantage most of the existing tests, and use them for `callFunctionOn`
    testing too, by ensuring that the results of CFO returns results same as any other object.

Fixes #19229 
Fixes #19531
2020-04-20 18:55:26 +02:00
Alex Thibodeau 4821038587 Add ability to turn on just the portable executable verifier. (#19575)
Helps fix issue: https://issuetracker.unity3d.com/issues/unity-crashes-when-opening-the-project

We were hitting a crash were a corrupted dll would get loaded and then hit an assert later on when something tried to use it. The verifier suite would correctly identify the dll as corrupt but it was impossible to turn on just the PE verification. I've added a new PE only mode above "off" to allow for just the PE verifier to be used instead of the larger verification suite.
2020-04-20 16:39:05 +02:00
Alexander Köplinger 12dd904025 Fix name of MIT license in LICENSE file (#19601)
It should be MIT, not MIT X11.
Fixes https://github.com/mono/mono/issues/18133
2020-04-20 16:33:50 +02:00
imhameed b2f760ddb3 [mono] Fix multidimensional array construction when using programmer-specified lower bounds. (#19572)
* [mono] Fix multidimensional array construction when using programmer-specified lower bounds.

mono_array_full_new_checked and mono_array_full_new (which is marked as
a MONO_API function) both take two pointers to buffers containing
lengths and lower bounds. mono_array_new_n_icall can split the incoming
parameter list in two before forwarding the results to
mono_array_full_new_checked, so mono_array_full_new_checked was
receiving two buffers containing interleaved lower bounds and lengths.

ECMA-335 states that array constructors that specify both lower bounds
and lengths interleave these values. Deinterleave these
in method_to_ir.

Add some tests to iltests.il that verify that multidimensional arrays
with custom lower bounds work.

Fixes https://github.com/dotnet/runtime/issues/34377.
Fixes https://github.com/dotnet/runtime/issues/34378.
Fixes https://github.com/dotnet/runtime/issues/34381.

* Deinterleave lower bounds and array lengths in the interpreter.

Also make the condition in which the deinterleaving code path is taken
more precise. Perhaps this branch should be marked as unlikely.

* Fix a typo.
2020-04-19 16:33:10 -07:00
monojenkinsandCoffeeFlux 90560d3518 [meta] Mono ALC embedding primer (#19458)
After talking with @lambdageek , we decided we wanted the public API for ALCs to just use gchandles instead of a native struct and to handle conversion within the runtime.

This PR takes that approach, exposing the managed ALC fields to the runtime for cheap conversion and adding `mono_assembly_load_full_alc` and preload hook V3 to the unstable headers.

I considered trying to do something fancier with conversion for the preload hook but decided against it in the end; making a V3 that's intended for embedder usage is straightforward and should work fine. When invoking it, we create a new strong gchandle to keep the managed ALC pinned and then free it after the call is done.

I went with `MonoManagedAssemblyLoadContext` instead of `MonoReflectionAssemblyLoadContext` since ALCs aren't really part of reflection, but I have no strong attachment to the name and can change it if preferred to maintain consistency.

cc: @vargaz @mdh1418 @garuma

Co-authored-by: CoffeeFlux <[email protected]>
2020-04-19 04:14:05 -04:00
Larry Ewing 4eb9787f1b [wasm][debugger] Add an option to clear navigator.webdriver on attach (#19584)
* [wasm][debugger] Add an option to clear navigator.webdriver on attach

* Pass the flag when it is useful
2020-04-19 01:19:56 -05:00
Zoltan Varga e400e13324 Bump linker to the tip of mono-2020-02. (#19583) 2020-04-18 03:57:55 -04:00
Larry Ewing 5c5be77f00 [wasm][debugger] Always send the remove breakpoint command to the browser too (#19576) 2020-04-17 17:26:24 -05:00
Ankit Jain 7f0b1b1037 [wasm][debugger] Show pointer type+address (#19537)
* [wasm][debugger] Simplify the interface between debugger.c and

.. library_mono.js .

* [wasm][debugger] Show pointer type+address

* [wasm][debugger] Address review feedback

* [wasm][debugger] Small cleanups, from review feedback

* [wasm][debugger] declare mono_wasm_add_typed_value as extern
2020-04-17 22:16:23 +02:00
monojenkinsandSamMonoRT 3aa1bbb55f Minor changes - Update specific words in mono code base to be PoliCheck/TSA compliant (#19560)
Based on a recent PoliCheck tool run on the code base, there were some words in the code which weren't compliant. List of Mono bugs here :
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevdiv.visualstudio.com%2Fweb%2Fqr.aspx%3Fpguid%3D0bdbc590-a062-4c3f-b0f6-9383f67865ee%26qid%3Da5547394-def7-4a3d-ae81-fe8480583539&data=04%7C01%7Csampatel%40microsoft.com%7C0f0f005f4bf4422e7d5f08d7e1717a81%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637225749822378839%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C-1&sdata=QmWt%2BP%2FzZ2PRyxwHuSJu%2FvE3dnGkahfIdjA%2FH06XoSs%3D&reserved=0

This change fixes some of those. There will be another PR for region/language/locale specific GeoPolitical issues identified by the scan too.

Co-authored-by: SamMonoRT <[email protected]>
2020-04-17 12:39:58 -04:00
Zoltan Varga 80f7953477 [aot] Fix the support for separate aot data files. Reorder the MONO_AOT_TABLE constants so they match the ordering in MonoAotFileInfo. (#19565) 2020-04-17 11:41:07 +02:00
Martin Baulig dfd748b695 Bump CoreFX to pickup https://github.com/mono/corefx/pull/398. (#19564)
Fixes https://github.com/mono/mono/issues/19451.
2020-04-17 11:07:06 +02:00
Zoltan Varga bb019312d3 [wasm] Update netcore support. (#19574) 2020-04-17 03:12:20 -04:00
Ankit Jain 354c9e68b6 [wasm][debugger] Show signature for delegate, or target, if available… (#19535)
* [wasm][debugger] Show signature for delegate, or target, if available (#19505)

* [wasm][debugger] Show signature for delegate, or target, if available

- As object properties, we return a `Target` which has the signature of
the delegate target.

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

* [wasm][debugger] Some tidying up

* [wasm][debugger] Remove unused `sig_desc`

* [wasm][debugger] Simplify code, avoid extra allocations

.. as suggested by @lewing

(cherry picked from commit 4eca12e794)

* [wasm][debugger] Fix tests broken because unused vars are not null

.. anymore, which is because we disabled optimizations in the
interpreter when debugging.

* [wasm][debugger][tests] Add tests to also check delegates in previous

.. frames.

* [wasm][debugger] Disable a test that tried to look at previous async

.. frames. This just happened to work. Currently, the trace has details
of the async machinery, instead of one reflecting what it might have
looked like for a non-async case. So, we can't reliably find the
previous method to inspect it's locals.

* [wasm][debugger] Fix test
2020-04-16 22:38:39 -05:00
monojenkinsandBrzVlad 7ae1d80f03 [jit] Add support for fconv.ovf.*.un opcodes (#19539)
These opcodes have the same effect as their non-_un_ counterpart, since floats are always signed. This means that applying a fconv.ovf.i8.un to a negative float, will result in a negative integer, despite the unsigned suffix (tested against coreclr).

Fixes https://github.com/dotnet/runtime/issues/34084

Co-authored-by: BrzVlad <[email protected]>
2020-04-17 01:38:40 +03:00
Larry Ewing a65055dbdf Change OSPlatform for wasm to "BROWSER" rather than "WEBASSEMBLY"
Following the guidance in https://github.com/dotnet/runtime/issues/33328
Change OSPlatform to BROWSER for wasm runtimeArchitecture.
2020-04-16 22:57:33 +02:00
Larry Ewing eb68dbc2b0 [wasm][debugger] Add comment about embedded pdbs and fix old regression (#19563)
With embedded pdbs we have to try to load symbols even when the
pdb is missing then handle ArgumentException if there is no embedded
pdb.  This restores the intended error path and added an explanation
while still logging unexpected errors
2020-04-16 15:49:17 -05:00
Larry Ewing 42f5d32e12 [wasm][debugger] Handle multi-doc methods and multiple results for breakpoints (#19449)
* [wasm][debugger] Rework source loading

Add logic to support embedded sources and
add all the documents from multi-doc methods

Add logic to check source hashes against
pdb hash.

* [wasm][debugger] Fix breakpoints on delegates

Only add methods to a source once by RID

When column is != 0 specified the fronted only wants results
that match that column exactly.

* Allow checking pdb hash and remove source cache

* Fixup typesByName merge
2020-04-16 11:58:55 -05:00
monojenkinsandvargaz 9545c24a15 Make the -Wsometimes-uninitialized into an error. (#19543)
Co-authored-by: vargaz <[email protected]>
2020-04-16 18:32:41 +02:00
Larry Ewing b1e4d125c7 [wasm][debugger] Fix typo and silence output (#19556) 2020-04-16 09:32:12 -05:00
Thays Grazia 039a6890f4 [debugger] Remove assert when the DebuggerTypeProxy cannot be instantiated
Remove the assert because we don't need to stop the debug if we cannot create the object when calling the constructor using invoke_method, if it's a DebuggerTypeProxy, we are not able to show the value of the DebuggerTypeProxy, but we still can show the Raw View, if it's not the case of DebuggerTypeProxy, we just cannot evaluate this expression, but we can continue the debug session.

Fix #19492
2020-04-16 10:17:09 -03:00
Zoltan Varga be24f101bd [wasm] Debugger test improvements. (#19499)
* Disable the Loaded: messages, they are not very useful.

* Add a Dotnet-test.setBreakpointByMethod protocol extensions to the proxy to set breakpoints in specific methods during testing.

* Add a new sample debugger test using the setBreakpointByMethod API.

* Remove some unrelated changes.

* Restore logging.

* Disable a log message which is printed when a pdb file is missing.
2020-04-15 16:37:50 -04:00
Larry Ewing 123bee9620 [wasm] Use browser style lang (#19544) 2020-04-15 12:12:47 -05:00
Thays Grazia aaf7a193cc [metadata] Identify when a field is overlapped by a non-object field (#19485)
Fix class loader to identify when the class has a field overlapped by a non-object field.
Fix method-to-ir to forward the TypeLoad error.
Fix transform to forward the TypeLoad error.
Fix unit test that has a class with a field that is overlapped by a non-object field.

Fixes dotnet/runtime#34388
2020-04-15 13:09:01 -03:00
Larry Ewing a73d0c028f [wasm] force set a local when running debugger tests (#19546) 2020-04-15 08:23:42 -05:00
Johan Lorensson 5a71ba15f3 Fix missing array ctor(int32,int32) test failures. (#19494)
According to ECMA, VES should add the following methods to arrays:

* A constructor that takes a sequence of int32 arguments, one for
each dimension of the array, that specify the number of elements
in each dimension beginning with the first dimension. A lower bound
of zero is assumed.

* A constructor that takes twice as many int32 arguments as there are dimensions
of the array. These arguments occur in pairs—one pair per dimension—with
the first argument of each pair specifying the lower bound for that
dimension, and the second argument specifying the total number of elements
in that dimension.

* Get.

* Set.

* Address.

In Mono's case we only added the ctor (int32, int32) for rank 1 arrays
if they were "jagged" array. Array with rank 1-4 executed an optimized
code path always using the one int32 per rank constructor.

This doesn't work in cases where the array is constructed using both
a length and a lower bound pattern, like:

newobj instance void int32[10000...10005]::.ctor(int32, int32)

this would trigger a method not found exception, since its not a jagged
array, Mono wouldn't add the ctor(int32, int32) constructor for this type.

Fix will make sure we follow ECMA's definition of this and fix code
to use right instance methods of arrays. Code also adds an assert
to trap if a jagged array is created through this code path
(shouldn't happen) since current implementation would have handled it as
a 2 ranked array.

Fix also adds several tests into iltests.il allocating different
variations of arrays using lower/upper bounds and validating length, rank,
upper/lower bounds of allocated arrays.
2020-04-15 10:44:26 +02:00
monojenkinsandvargaz e71879085d Fix an uninitialized variable error introduced by dotnet/runtime#34877. (#19540)
Co-authored-by: vargaz <[email protected]>
2020-04-14 23:18:55 +02:00
Zoltan Varga a5fd1cd86f [wasm] Fix netcore support. (#19521)
* [wasm] Remove netcore build support from builds/wasm.mk, its not used anymore.

* [wasm] Fix netcore support.

Currently, only local development with a separate dotnet/runtime repo works. The mono runtime, corelib, and the bcl will be taken from that repo.
AOT doesn't work.

* Fix running xunit tests.

* Fix some tests.

* Revert some unrelated changes.
2020-04-14 11:00:56 -04:00
Johan Lorensson a87a90463e Fix infrequent/random crashes on Windows x64 due to use of GC forwarded objects. (#19475)
* Fix infrequent/random crashes on Windows x64 due to use of GC forwarded objects.

Hard to repro and very infrequent crash. Have been analyzing a couple
of crash dumps from retail devices getting different crashes related to
vtable "corruption" on Windows x64. After some deeper analysis it turns
out the object instance has been forwarded by GC
(object vtable pointers lowest bit set to 1), but object still holds
tagged vtable. This will then cause misaligned reads, getting back random
values and pointers from vtable on next object access.

After some further analyzing it turns out that LLVM codegen and some
specific generic vt arrays lowering can cause optimized mem copies
using XMM registers. I have also identified scenarios where vt copies
gets lowered into a c-runtime memcpy that in turn uses XMM registers
as an optimization. Since Windows x64 currently don't include XMM
registers in context, any references in XMM registers will not be
visible and pinned by GC, meaning that they will point to potentially
forwarded objects after completing GC, restarting threads, leading
to these infrequent random crashes.

Fix includes xmm0-xmm15 into MonoContext on Windows x64, making sure
GC will see all references that could be held in those registers,
regardless if getting into those registers due to LLVM optimization
or other native code, like memcpy.
2020-04-14 13:46:08 +02:00
Martin Baulig 6e6f67669d Bump CoreFX to pickup https://github.com/mono/corefx/pull/397. (#19525) 2020-04-14 12:33:10 +02:00
monojenkinsandvargaz a448a33fd7 [wasm] Disable the AOT cache check on wasm as well. (#19522)
Co-authored-by: vargaz <[email protected]>
2020-04-14 00:54:56 -04:00
monojenkinsandvargaz e4eb2f0efc [runtime] Try to load assemblies from bundles on netcore before trying other methods, the ALC might not be initialized yet. (#19520)
Co-authored-by: vargaz <[email protected]>
2020-04-13 22:23:53 -04:00
Tammy Qiu bc3f47fdf5 [wasm] Add readme to package update scripts (#19507)
* add powershell and bash scripts for replacing default webassembly nuget packages from link or path

* [wasm] Add readme to package update scripts
2020-04-13 19:56:26 -05:00
Ankit Jain d5daeeab9a [wasm][debugger] Improve some valuetype visualization (#19490)
* [wasm][debugger] Fix up `value.description` for local vars too

- Local vars, when being enumerated in `mono_wasm_get_variables` don't
have an associated `name`, and so `_fixup_name_value_objects`
*incorrectly* ends up not fixing up the `value.description` field for
them.

* [wasm][debugger] For some types, use `ToString()` for their ..

.. `description`.

- `System.DateTime`
- `System.DateTimeOffset`
- `System.Decimal`
- `System.TimeSpan`
- `System.Guid`

* [wasm][debugger] Invoke all property getters, for some types

- `System.DateTime`
- `System.DateTimeOffset`
- `System.TimeSpan`

* [wasm][debugger] Show char symbol along with the code

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

* [wasm][debugger] Fix DateTime tests, don't use hardcoded strings for

.. description. Instead, use a `DateTime` object in the test to create
the expected string for the test. This should ensure that the expected
and actual were created in the same environment.

* [wasm][debugger] Special case `System.Guid` to use

.. `mono_guid_to_string`, instead of calling `ToString()` on it.

* [wasm][debugger] Don't box valuetypes for calling `ToString()`

Co-authored by @vargaz .

* [wasm][debugger] `System.Guid` is special-cased, so remove it from the

.. allowed list.

* [wasm][debugger] simple cleanup
2020-04-13 19:50:56 -05:00
Larry Ewing fdb3893c09 [wasm][debugger] explicitly pass --lang=en_US for debugger tests (#19529) 2020-04-13 17:37:40 -05:00
monojenkinsandEgorBo 585d92f375 [mono] Implement Sse41, Pclmulqdq, Aes and enable Sse41 intrinsics (#19518)
This PR implements `Sse41`, `Pclmulqdq`, `Aes`  and enables `Sse42` (was implemented but disabled). Thus, Mono-LLVM now fully supports the following intrinsics:
- [ ]  System.Runtime.Intrinsics.X86.*
  - [x] **Sse**
  - [x] **Sse2**
  - [x] **Sse3**
  - [x] **Ssse3**
  - [x] **Sse41**
  - [x] **Sse42**
  - [x] **Aes**
  - [x] **Bm1**
  - [x] **Bm2**
  - [x] **Lzcnt**
  - [x] **Pclmulqdq**
  - [x] **Popcnt**
  - [ ] **Avx**
  - [ ] **Avx2**
  - [ ] **Fma**

- [ ] System.Runtime.Intrinsics.Arm.*
  - [x] **ArmBase**
  - [x] **Crc32**
  - [ ] **AdvSimd**
  - [ ] **Aes**
  - [ ] **Sha1**
  - [ ] **Sha256**

- [ ] System.Runtime.Intrinsics.*
  - [ ] **Vector64** (needed for Arm)
  - [x] **Vector128**
  - [ ] **Vector256** (needed for Avx, Avx2 and Fma)

The changes should be LLVM-9 friendly.

Co-authored-by: EgorBo <[email protected]>
2020-04-14 00:37:11 +03:00
Kenneth Pouncey b653274418 [wasm][sdk][nuget] Bump version. (#19483) 2020-04-13 11:50:16 -05:00
Kenneth Pouncey acddc9c5c9 [wasm][browser][tests] Generate sdk version in global.json file automatically. (#19484) 2020-04-13 11:49:30 -05:00
Zoltan Varga 6e5c15cea5 [wasm] Remove .stamp-build-debugger-test-app, the app can always be built. (#19517) 2020-04-12 03:36:59 -04:00
Larry Ewing 5a45ab6630 [wasm][ci] Always build and package wasm (#19508) 2020-04-11 11:23:10 +02:00
Zoltan Varga f9faa296b8 [wasm] Disable interpreter optimizations when debugging. (#19504)
* [wasm] Disable interpreter optimizations when debugging.

* Fix tests.
2020-04-11 03:08:25 -05:00
Kenneth Pouncey 5a3e168af2 [wasm][bcl] Handle correctly backslash in file name (#19488)
* [wasm][bcl] Handle correctly backslash in file name

- Modify IO file to assign backslash to alternate directory separator by default
- Add tests for issue https://github.com/mono/mono/issues/18933

* [wasm][tests] Skip two tests for wasm

- After internal discussions decided to skip these two tests on wasm

   1. GetDirectories_Backslash
   1. GetFiles_Backslash

* [wasm][tests] PathIsRooted tests failing

- skip subtest #9 if WASM
- To fix issue https://github.com/mono/mono/issues/18933 we set the AltDirectorySeparatorChar as well.  This causes the `Assert.IsTrue (!Path.IsPathRooted ("\\"), "IsPathRooted #09");` to fail. Path.IsPathFullyQualified Method handles paths that use both the DirectorySeparatorChar and the AltDirectorySeparatorChar characters.

* [wasm][tests] PathIsRooted tests failing

- skip if WASM
2020-04-11 09:31:39 +02:00
Immo Landwerth fc7ea0aa0e Fix links to Code of Conduct (#19510) 2020-04-10 23:31:46 +02:00
Tammy Qiu e4fbccac0a add powershell and bash scripts for replacing default webassembly nuget packages from link or path (#19498) 2020-04-10 08:54:59 +02:00
Kenneth Pouncey 9bfe456516 [wasm][bcl][zoneinfo] Fix local zone info marshaling (#19493)
- Correctly marshal Intl.DateTimeFormat().resolvedOptions().timeZone information
2020-04-09 23:41:31 -04:00
Zoltan Varga f821cf4f80 [llvm] Fix a crash in JIT mode. (#19496)
* [llvm] Fix a crash in JIT mode.

* [runtime] Change some g_return_if_fails's to asserts.
2020-04-09 17:07:46 -04:00
dotnet-maestro[bot]anddotnet-maestro[bot] ced27c7de3 Update dependencies from https://github.com/dotnet/arcade build 20200401.2 (#19455)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20201.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20201.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2020-04-09 16:45:30 +02:00
Larry Ewing 34cccfa2fd [wasm][debugger] Wasm debug log level (#19479)
* [wasm][debugging] pass enable_debugging as debug engine log level

enable_debugging was already an int, with this change log_level
will remain at 1 by default but passing -1 will disable the log
spew

* Change the default debug level of 'Failed to lookup sequence point'
2020-04-08 23:31:52 -05:00
Jeff Smith 1167f95932 [metadata] Handle MONO_TYPE_FNPTR case in collect_type_images (#19434)
Fixes abort when PTR-FNPTR field signature is encountered.

Fixes https://github.com/mono/mono/issues/12098
Fixes https://github.com/mono/mono/issues/17113
Fixes https://github.com/mono/mono/issues/19433
2020-04-09 01:22:04 +02:00
Alexis Christoforides fda7280cea [merp] Synchronize (serialize) calls to MERP API (#19429)
Fixes https://github.com/mono/mono/issues/19406
2020-04-08 16:06:37 -04:00
Filip Navaraandmonojenkins 1fa5c1e0eb Add BeginRead/BeginWrite/EndRead/EndWrite overloads back to SslStream (#19442)
* Add BeginRead/BeginWrite/EndRead/EndWrite overloads back to SslStream and underlying implementation. Unlike the default implementation in Stream it allows parallel read along with parallel write using the standard TaskToApm pattern (https://github.com/dotnet/runtime/issues/33447). This reverts part of https://github.com/mono/mono/pull/17393 which could lead to deadlocks as reported in https://github.com/mono/mono/issues/18865.

* Move the TaskToApm pattern from MobileAuthenticatedStream to SslStream

* Bump API snapshot submodule

Co-authored-by: monojenkins <[email protected]>
2020-04-08 20:03:54 +02:00
Karl 29214fcbf1 Fix WinForms LinkLabel drawing (#19386)
MeasureCharacterRanges handles the alignment correctly by itself.

This may have been to handle poor behaviour in libgdiplus, particularly
when Pango text layout was not default.
2020-04-08 19:44:41 +02:00
Karl ed23e5e41a Three small RichTextBox / TextControl fixes (#19401)
1. Fix the height calculated by Line.RecalculatePasswordLine(). Would
   have been roughly double what it should have been - line spacing
   includes the height of the line.

2. In RichTextBox, insert a character for the Quote special character
   tags rather than just printing a message on the console.

3. In TextControl Document.Draw(), fix the criteria for skipping the
   last line. Could probably be improve further, but the previous had a
   problem because it could check with a point well off the bottom of
   the second to last line instead of its bottom. This probably arose
   because I had used line.Height for just the height of the text in the
   line, and later decided that it should be the entire height including
   all spacing, and added line.TextHeight. The earlier behaviour would
   have been wrong too, because it would have pointed to the bottom of
   the text, not the bottom of the line.
2020-04-08 19:44:03 +02:00
Александр Хухлаев a26d2f0c3e [Winforms] fix #18606 PropertyGrid didn`t edit value with CustomTypeDescriptor (#19452)
When using implemeted ICustomTypeDescriptor with overrided SetValue(object component, object value) and there value reference will be changed even if new object`s fields will be equals then in line
current_changed = Object.Equals (properties[i].GetValue (propertyOwners[i]), value);
will not detected change cause of references of object in operands are not equal.
In usual ways references will be equal. So we compare old value ref with new value ref earlier.
In .net winforms do same. And also original winforms did not check CanConvertFrom whith type of editable object. So we do not need block with
converter.CanConvertFrom ((ITypeDescriptorContext)this, valueType))

Fixes #18606
2020-04-08 19:43:10 +02:00
Александр Хухлаев e3f31b2bdc [Winforms] PropertyGrid fix disappearing of items (#19453)
When Category Name match with Item name this GridItem will disappear
2020-04-08 19:41:54 +02:00
Александр Хухлаев 198e323fc2 [WinForms] Fix ToolStripTextBox Width (#19457)
When set non-Empty Size to ToolStripTextBox it will appear with zero with, but must use width from size.
2020-04-08 19:40:21 +02:00
Александр Хухлаев 4f7cc4db7e [WinForms] PropertyGrid must show value text even if CanConvertTo return false (#19463)
If we use PropertyDescriptor with Converter like this

public class MyConverter : TypeConverter
{
    public override bool CanConvertTo(ITypeDescriptorContext context, Type destType)
    {
         return false;
    }
}

GridEntry will not show text of Value which uses MyConverter.
In .net they do not check CanConvertTo, they call ConvertToString directly.
2020-04-08 19:37:55 +02:00
Alexander Köplinger a4a19c3cb4 freebsd.h: Print commands as they're executed 2020-04-08 18:39:16 +02:00
Zoltan Varga b33943df2b [runtime] Fix Type.GetTypeCode () for generic enums. (#19470)
Fixes https://github.com/mono/mono/issues/17735.
2020-04-08 12:05:22 -04:00
Alexander Köplinger c6fa6f773a freebsd.sh: Use yes instead of 1 for ASSUME_ALWAYS_YES 2020-04-08 12:04:30 +02:00
Phil Jaenke cd024dc80f Fix for missing IGNORE_OSVERSION (#19467)
Quarterly is using 1201000, Azure is 1200086, causing forced bootstrap to fail.
2020-04-08 12:01:45 +02:00
Pranav K a0d69a4e87 Produce System.Net.Http.WebAssemblyHttpHandler (#19260)
* Produce System.Net.Http.WebAssemblyMessageHandler

* Branding changes for WebAssembly.Net.Http -> System.Net.Http.WebAssemblyMessageHandler

* Change how fetch options are configured

* Fixup tests

* More fixup

* Update submodule
2020-04-08 11:42:03 +02:00
monojenkinsandCoffeeFlux 1386af6071 [meta] Fix loader printf mistake and outdated info in Makefile (#19459)
Co-authored-by: CoffeeFlux <[email protected]>
2020-04-08 01:10:40 -04:00
Kenneth Pouncey 42c76a9728 [wasm][http] Throw HttpRequestException instead of internal WebAssembly.JSException. (#19454) 2020-04-07 17:50:07 -05:00
Phil Jaenke 8fbdc3ea44 Fix for 2020Q1 FreeBSD pkg upstream, some cleanup. (#19465)
pkg has been updated to 1.12+ which has an incompatible metadata format.
Fix this by force bootstrapping pkg when necessary. Also perform some
general cleanup and go back to the python3 metaport as 2020Q1 uses a
sufficiently current Python for the metaport.
2020-04-07 19:50:16 +02:00
monojenkinsandBrzVlad a562759d6e [sgen] Fix coverity issue (#19462)
Co-authored-by: BrzVlad <[email protected]>
2020-04-07 11:56:08 +02:00
Karl 54256b61e9 When double buffering, flush the buffered graphics (#19460)
Otherwise some stuff doesn't always get drawn.

Fixes https://github.com/mono/libgdiplus/issues/640, and probably other similar things.
2020-04-07 10:28:01 +02:00
monojenkinsandEgorBo c683499ad3 [mono] Implement Arm intrinsics: ArmBase, Crc32 (#19353)
Implement `System.Runtime.Intrinsics.Arm.ArmBase` and `*.Crc32` intrinsics for Arm64 with LLVM-backend. `ArmBase` is enabled by default, `Crc32` for LLVM-AOT can be enabled either via `mcpu=native` or `mattr=+crc` (e.g. when we crosscompile for iOS).

Asm: (`--aot=llvm,mcpu=native System.Private.CoreLib.dll` on Cortex-A57):
```asm
;; ArmBase

; int LeadingZeroCount(int value)
0000000000292c84 <System_Runtime_Intrinsics_Arm_ArmBase_LeadingZeroCount_int>:
  292c84:	clz	w0, w0
  292c88:	ret

; int LeadingZeroCount(uint value)
0000000000292c8c <System_Runtime_Intrinsics_Arm_ArmBase_LeadingZeroCount_uint>:
  292c8c:	clz	w0, w0
  292c90:	ret

; int ReverseElementBits(int value)
0000000000292c94 <System_Runtime_Intrinsics_Arm_ArmBase_ReverseElementBits_int>:
  292c94:	rbit	w0, w0
  292c98:	ret

; uint ReverseElementBits(uint value)
0000000000292c9c <System_Runtime_Intrinsics_Arm_ArmBase_ReverseElementBits_uint>:
  292c9c:	rbit	w0, w0
  292ca0:	ret

;; ArmBase.Arm64

; int LeadingSignCount(int value)
0000000000292cac <System_Runtime_Intrinsics_Arm_ArmBase_Arm64_LeadingSignCount_int>:
  292cac:	cls	w0, w0
  292cb0:	ret

; int LeadingSignCount(long value)
0000000000292cb4 <System_Runtime_Intrinsics_Arm_ArmBase_Arm64_LeadingSignCount_long>:
  292cb4:	cls	x0, x0
  292cb8:	ret

; int LeadingZeroCount(long value)
0000000000292cbc <System_Runtime_Intrinsics_Arm_ArmBase_Arm64_LeadingZeroCount_long>:
  292cbc:	clz	x0, x0
  292cc0:	ret

; int LeadingZeroCount(ulong value)
0000000000292cc4 <System_Runtime_Intrinsics_Arm_ArmBase_Arm64_LeadingZeroCount_ulong>:
  292cc4:	clz	x0, x0
  292cc8:	ret

; long ReverseElementBits(long value)
0000000000292ccc <System_Runtime_Intrinsics_Arm_ArmBase_Arm64_ReverseElementBits_long>:
  292ccc:	rbit	x0, x0
  292cd0:	ret

; ulong ReverseElementBits(ulong value)
0000000000292cd4 <System_Runtime_Intrinsics_Arm_ArmBase_Arm64_ReverseElementBits_ulong>:
  292cd4:	rbit	x0, x0
  292cd8:	ret

;; Crc32

; uint ComputeCrc32(uint crc, byte data)
0000000000292ce4 <System_Runtime_Intrinsics_Arm_Crc32_ComputeCrc32_uint_byte>:
  292ce4:	crc32b	w0, w0, w1
  292ce8:	ret

; uint ComputeCrc32(uint crc, ushort data)
0000000000292cec <System_Runtime_Intrinsics_Arm_Crc32_ComputeCrc32_uint_uint16>:
  292cec:	crc32h	w0, w0, w1
  292cf0:	ret

; uint ComputeCrc32(uint crc, uint data)
0000000000292cf4 <System_Runtime_Intrinsics_Arm_Crc32_ComputeCrc32_uint_uint>:
  292cf4:	crc32w	w0, w0, w1
  292cf8:	ret

; uint ComputeCrc32C(uint crc, byte data)
0000000000292cfc <System_Runtime_Intrinsics_Arm_Crc32_ComputeCrc32C_uint_byte>:
  292cfc:	crc32cb	w0, w0, w1
  292d00:	ret

; uint ComputeCrc32C(uint crc, ushort data)
0000000000292d04 <System_Runtime_Intrinsics_Arm_Crc32_ComputeCrc32C_uint_uint16>:
  292d04:	crc32ch	w0, w0, w1
  292d08:	ret

; uint ComputeCrc32C(uint crc, uint data)
0000000000292d0c <System_Runtime_Intrinsics_Arm_Crc32_ComputeCrc32C_uint_uint>:
  292d0c:	crc32cw	w0, w0, w1
  292d10:	ret

;; Crc32.Arm64

; uint ComputeCrc32(uint crc, ulong data)
0000000000292d1c <System_Runtime_Intrinsics_Arm_Crc32_Arm64_ComputeCrc32_uint_ulong>:
  292d1c:	crc32x	w0, w0, x1
  292d20:	ret

; uint ComputeCrc32C(uint crc, ulong data)
0000000000292d24 <System_Runtime_Intrinsics_Arm_Crc32_Arm64_ComputeCrc32C_uint_ulong>:
  292d24:	crc32cx	w0, w0, x1
  292d28:	ret
```
@tannergooding @echesakovMSFT Could you please take a quick look at asm ^ if it's ok or not.

`Vector64<T>`, `Vector128<T>`, `Vector<T>` are not enabled yet.

Co-authored-by: EgorBo <[email protected]>
2020-04-07 04:25:53 +03:00
Zoltan Varga 36c1034f4b [llvm] Define a separate symbol for the aot method info for every method. Pass this symbol to the init functions instead of the method index. (#19298)
* [llvm] Define a separate symbol for the aot method info for every method. Pass this symbol to the init functions instead of the
method index.

This removes a dependency the generated code has on the method index, hopefully allowing separate compilation etc. in the future.

* Put the method flags into a separate AOT table so they can be accessed without decoding the method info structure, which is not available to the runtime for LLVM methods.

* Make the LLVM methods set the init flag themselves. This will allow the init flag to be changed to a per-method scalar later to remove
a dependency on the method index.

Also rename init_icall_wrapper to init_func, it does much more than just calling the icall.
2020-04-06 18:14:27 -04:00
Thays Grazia c5149e31b4 [wasm][debugger] Improving evaluate expression implementation (#19444)
* - Adding tests to evaluate expression
- Adding a cache to local vars and object properties
- Fixing evaluate expressions like "this.a"
- Fixing evaluate expressions like "d + d"
2020-04-05 22:57:02 -05:00
imhameed c991c1d4c4 [llvm] Enable optimizations for LLVM 9 JIT. (#19445)
Share more code between LLVM 6 and LLVM 9.

Mangler::getNameWithPrefix takes a Twine, not a std::string, so use a
StringRef to avoid an unnecessary allocation.

InstructionCombiningPass grew a dependency on
ProfileSummaryInfoWrapperPass in
https://github.com/dotnet/llvm-project/commit/09e539fcaebb6362795d352cdcf4a818cf4d0d6a,
which depends on the enclosing FunctionPassManager having a valid
reference to a module. This commit adds a dummy module to satisfy this,
instead of recreating a new FunctionPassManager on every compilation.
(See also
http://lists.llvm.org/pipermail/llvm-dev/2019-March/130690.html.)
2020-04-05 12:08:57 -07:00
Thays Grazia 3fba2c8166 Some frames were skipped in MonoProxy but we don't skip the frame_id, doing this the call_stack has a different position than it's in the real stack on mono side. (#19447)
I changed the frame_id, so we will follow the frame_id from callstack even if we don't add all of them into the CallStack list in MonoProxy.
I also added a test.

Fixes #19379
2020-04-05 13:16:28 -05:00
Zoltan Varga 6ec38cc080 [llvm] Replace the LLVM got array with a set of scalar variables which are initialized by a callback called by the runtime. (#19267)
Long term, this will make the generated code depends less on got offsets etc., so it might be possible to
avoid recompiling it if the offsets change.
2020-04-05 10:21:10 -04:00
Thays Grazia 8ba4a2bca1 As suggested by @jbevain we should bump the protocol to implement this. (#19437) 2020-04-04 20:58:01 -03:00
Larry Ewing 2c5a02755d [wasm][debugger] Don't surface evaluation errors to the browser (#19439)
Instead of surfacing the error to the browser log it return
an empty result.
2020-04-04 14:24:08 -05:00
Kenneth Pouncey eb468076a7 [wasm] Wasm TimeZoneInfo implementation VFS (#17760)
* [wasm][bcl] TimeZoneInfo implementation for WebAssembly to read from WASM VFS `/zoneinfo`.

- Remove `TimeZoneInfo.WebAssembly.cs` file
- Remove source dependencies on `TimeZoneInfo.WebAssembly.cs`.
- Modify TimeZoneInfo for specific WASM functionality
   - Default root directory is `zoneinfo`
   -  Add icall `mono_timezone_get_local_name` for WASM in CreateLocal
- Add icall implementation
   - ves_icall_System_TimeZoneInfo_mono_timezone_get_local_name

* [wasm][build] Add `-s FORCE_FILESYSTEM=1` to mono wasm runtime build

- Required so that it includes support for loading pre preload packages

Message when generating the zoneinfo data.
   > Remember to build the main file with  -s FORCE_FILESYSTEM=1  so that it includes support for loading this file package

* [wasm] zoneinfo data and support files.

- Three files for zoneinfo VFS support.
   - `mono-webassembly-zoneinfo-fs-smd.js.metadata` - This is the separate metadata output by emscripten file-packager.  Used to parse the zoneinfo data in non browser environments.  See `runtime-tests.js`
   - `mono-webassembly-zoneinfo-fs.js` - Output by emscripten file-packager that will be referenced by browser environments to load the zoneinfo data into the VFS at `/zoneinfo`
   - `zoneinfo.data` - The binary file output by emscripten file-packager.  The file contains the actual zoneinfo data loaded into the VFS and parsed by `TimeZoneInfo`.

* [wasm][driver] Add backing support for icall `mono_timezone_get_local_name`

* Add TimeZone info test.

* [wasm][packger] Add `-s FORCE_FILESYSTEM=1`

- Required so that it includes support for loading preload packages

Message when generating the zoneinfo data.
   > Remember to build the main file with  -s FORCE_FILESYSTEM=1  so that it includes support for loading this file package

* Fix AOT tzd test

* Remove commented code lines for `TimeZoneInfo.WebAssembly.cs` module

* Regenerated zone info without --no-heap-copy as it causes problems.  This will create a warning in browser for now.

* Add zoneinfo support files to package

* Fix TimeZoneInfo tests to use the `--enable-fs` packager parameter

* Add back icall implementation after rebase
   - ves_icall_System_TimeZoneInfo_mono_timezone_get_local_name

* Add back backing support for icall `mono_timezone_get_local_name` after rebase

* Fix build error

* Add back zoneinfo tests to Makefile after rebase

* Fix packager zoneinfo sample builds.

* Address review comment about volatile not needed

* Address review comment about volatile not needed

* Address review comment about volatile not needed

* Address review comment volatile not needed
2020-04-04 13:37:21 +02:00
Ankit Jain b3210bf1e5 [wasm][debugger] Improve array visualization (#19424)
* [wasm][debugger][tests] Refactor test support methods

.. which will help in the upcoming changes.

* [wasm][debugger][tests] Add tests for arrays

- These don't include the broken cases which are fixed in the next
commits

* [wasm][debugger][tests] Fix enumerating locals in async method on a

.. struct.

* [wasm][debugger] Support ValueTypes in arrays

- ValueTypes in array elements are not expanded by default. Instead,
they get an object id like `dotnet:array:{arrayObjectId}:{index}`
- And these get expanded on request

* [wasm][debugger] Fix calls to `mono_wasm_add_null_var` from js

- when being called from `library_mono.js`, with a native string like -

    `MONO.mono_wasm_add_null_var ("string");`

.. which when passed to `Module.UTF8ToString (className)`, returns
`null`. So, if the result of that call is null, then use the `className`
argument as-is.

* [wasm][debugger][tests] Add test for local structs in an async method

* [wasm][debugger][tests] Add `TEST_ARGS` and `TEST_FILTER` arguments to

.. control `dotnet test` arguments.

Example use:

`make run-debugger-tests TEST_ARGS="--filter FullyQualifiedName~ArraysTests"`
or
`make run-debugger-tests TEST_FILTER="ArraysTests"`

* [wasm][debugger][tests] Make `label` the last argument, consistently.

* [wasm][debugger] Address review comments

- Return a `Result` response, instead of throwing an exception

* dummy commit to kick the pr
2020-04-03 20:36:44 -04:00
Thays GraziaandLarry Ewing 3122edcb7c [debugger][wasm] Implement evaluate in wasm debugger. (#19432)
* [debugger][wasm] Implement evaluate in wasm debugger.
-> evaluate expressions with constant values and variable values are working
-> evaluate expressions with methods not working yet
-> evaluate expressions with assignments not working yet

* removing extra ;

* Update sdks/wasm/Mono.WebAssembly.DebuggerProxy/EvaluateExpression.cs

Co-Authored-By: Larry Ewing <[email protected]>

* Update sdks/wasm/Mono.WebAssembly.DebuggerProxy/EvaluateExpression.cs

Co-Authored-By: Larry Ewing <[email protected]>

* Update sdks/wasm/Mono.WebAssembly.DebuggerProxy/EvaluateExpression.cs

Co-Authored-By: Larry Ewing <[email protected]>

* Fix what was suggested by @radical.

* Changing what @radical suggested

* Changing what @radical suggested

Co-authored-by: Larry Ewing <[email protected]>
2020-04-03 19:14:04 -03:00
Александр Хухлаев f713aef67b [WinForms] Show ToolTips for PropertyTab`s buttons (#19430)
for custom tabs.

when the mouse is on the native tab buttons, tooltips appear, and when on the custom tab buttons, then no
2020-04-03 22:04:46 +02:00
Thays Grazia fcc6731c83 [debugger] Fix set_value and get_value after invoke a method (#19378)
* When we run an invoke in a thread and after this we do a set_value and then a get_value, when we call set_value we consider restore_state, but when we call get_value we are not considering the restore_state.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1077790
2020-04-03 16:14:41 -03:00
Mitchell HwangandMitchell Hwang c6ff50ed49 Bump corefx to get https://github.com/mono/corefx/pull/395 (#19376)
Co-authored-by: Mitchell Hwang <[email protected]>
2020-04-03 19:39:46 +02:00
Zoltan Varga 798ced842a [wasm] Avoid including config.make into wasm/Makefile, its generated by one of the builds triggered by this Makefile. (#19427) 2020-04-03 13:18:08 -04:00
monojenkinsandBrzVlad 4988c9eeca [sgen] Implement api for allocating pinned arrays (#19407)
https://github.com/dotnet/runtime/issues/33583

Co-authored-by: BrzVlad <[email protected]>
2020-04-03 15:49:23 +03:00
monojenkinsandalexischr 5fc01701ad [mono][sre] Add an expected attribute on underlying fields of enum cl… (#19349)
…asses

Follow CoreCLR's example and add the RTSpecialName type attribute to any class field with the 'value__' name when , used as the value store for enumeration class instances.

Second part of the "RTSpecialName fix" that started with https://github.com/dotnet/runtime/pull/33389 - before, our behavior was to add the RTSpecialName immediately, as soon as the EnumBuilder was constructed.
Contributes to https://github.com/dotnet/runtime/issues/2389

Co-authored-by: alexischr <[email protected]>
2020-04-03 08:48:25 -04:00
Alexander Köplinger c55dee223f Fix iOS CI device test build
MONO_ENTER_GC_UNSAFE/MONO_EXIT_GC_UNSAFE aren't in a public header yet: https://github.com/mono/mono/issues/19421
2020-04-03 14:25:32 +02:00
Steve Sanderson bd2ca880f9 Fix Mono WebAssembly regression on Firefox (#19420)
Since 3 days ago, Mono WebAssembly no longer works on Firefox. The error is `ReferenceError: SharedArrayBuffer is not defined`.

This PR adds a trivial fix.
2020-04-03 01:09:25 +02:00
monojenkinsandCoffeeFlux edf3480ade [meta] Add mono_type_get_name_full to public API (#19414)
This is needed by Xamarin.Android to be able to round-trip with names fetched via reflection, as the only public API for this (`mono_type_get_name`) uses the IL format instead.

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

Co-authored-by: CoffeeFlux <[email protected]>
2020-04-02 12:45:51 -04:00
54e6ca20b4 [loader] Add append option to loader hook installation functions (#19371)
* [loader] Add append option to loader hook installation functions

Fixes https://github.com/dotnet/runtime/issues/34273

While this specific issue only affects the preload hook, I've added the append option to all the installation functions since this seems like a generally useful capability, both for internal use and embedders.

@BrzVlad tested locally and confirmed this patch solves the problem.

* Update callers in pedump and monodis

Co-authored-by: CoffeeFlux <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
2020-04-02 12:39:10 -04:00
Larry Ewing 82dc6e8a5e [wasm][debugger] don't try to process commands sessions without context (#19394) 2020-04-02 08:35:34 -05:00
Kenneth Pouncey 2c783ab80b [wasm][README] WASM Dynamic Runtime doc (#19416)
* update sample config

* Add dynamic runtime config

* update dynamic runtime docs
2020-04-02 08:35:11 -05:00
Ankit Jain 2709c812c0 [wasm][debugger] Add support for visualizing valuetypes (#19232)
* [wasm][debugger] Move some of the variable name/value pairs fix up to

.. library_mono.js from MonoProxy.

* [wasm][debugger] Handle invalid scope id

- this would throw NRE, and the request would fail, and so the test
passed.

* [wasm][debugger][tests] Check functionName at breakpoints

.. and fix up tests.

* [wasm][debugger][tests] Remove unnecessary `ctx` arg

* [wasm][debugger] Add support for visualizing valuetypes

- Valuetypes are expanded into json, and cached. That gets used to
answer any `getProperties` request for them.

- When a valuetype is a local var, it's whole value expansion is
returned in `members` json field. This gets cached by MonoProxy, and
used to answer any `getProperties` requests for it's members.

- When a valuetype is part of an object, it is *not* expanded. Instead,
it gets an objectId of the form `dotnet:valuetype:containingObjectId:fieldOffset`.
  - Later, when the debuggers asks for that special id, we expand *all*
  the valuetypes in that containing object, and cache it.

  - For properties, the property "number" as they are enumerated, is
  used instead of the fieldOffset.

- this cache gets cleared whenever we step/resume the debugger.

* [wasm][debugger] Add support for visualizing enums

TODO: Flags

* [wasm][debugger] Don't invoke property getters when enumerating object

.. members.

* [wasm][debugger] Override `ToString` for `Result` class
2020-04-02 09:04:42 -04:00
sharkcz 2a531e04b3 update perf jitdump for ppc64/ppc64le and s390x (#19405)
Add missing constants to handle ppc64/ppc64le and s390x platforms.

Related: https://github.com/mono/mono/commit/68a8b9290958ee5e9b21d8ff6b73a707e2504d39
Fixes: https://github.com/mono/mono/issues/19402
2020-04-01 22:07:22 +02:00
Alex Thibodeau b1d4be3bab Ensure generic parameter constraint type is included when building image (#19395)
sets.

Making associated change to type_in_image to also check the constrained type for a match. Re-adding asserts now they they no longer trigger.

fixup, accidentally used old function

adjusting coding convention to K&R
2020-04-01 16:01:01 -04:00
Zoltan Varga bd635ac8b4 [wasm] Throw an exception when trying to start a thread instead of asserting. (#19396) 2020-04-01 15:13:20 -04:00
Alexis Christoforides 5733960ac4 [ios][sdks] Fix finalizer thread init in runner (#19412)
Starting with https://github.com/mono/mono/pull/16907 , the runtime ends in GC-Safe state (mode) after mono_jit_init_version() is called. mono_gc_init_finalizer_thread() expects the GC to not already be in safe mode.
2020-04-01 21:05:55 +02:00
Alexander Köplinger 9485a66d20 Fix Windows .msi build using newer xar
The old version didn't compile anymore with OpenSSL 1.1
2020-04-01 16:31:27 +02:00
monojenkinsandEgorBo a92528508e [mono] Fix setMArch, getArchName() doesn't work as expected (#19403)
Turns out `llvm::Triple(llvm::sys::getDefaultTargetTriple()).getArchName()` doesn't work as expected on all targets so the only option is to set arch via defines.

NOTE: it accepts "x86-64", not "x86_64

Co-authored-by: EgorBo <[email protected]>
2020-04-01 14:23:31 +02:00
monojenkinsandEgorBo ad0ee22923 [mono] Fix LLVM JIT on Arm64 (#19397)
`EB.selectTarget ();` used to return `NULL` on arm64 (and hit an assert later)
Turns out it needs MArch on arm (e.g. `"aarch64"`) set. No idea why it doesn't use host arch by default on arm (but works on x86).

Co-authored-by: EgorBo <[email protected]>
2020-04-01 12:43:06 +02:00
Alexander Köplinger e10990125d Fix Windows .msi build with recent cygwin updates
Cygwin now ships libssl 1.1 which removed OpenSSL_add_all_ciphers so the xar configure fails.
Replace the configure check with another existing function to fix it.
2020-04-01 12:36:26 +02:00
monojenkinsandpi1024e 49ea50d5b4 Remove duplicated .gitignore patterns (#19370)
Co-authored-by: pi1024e <[email protected]>
2020-04-01 11:46:54 +02:00
monojenkinsandEgorBo f301481bc1 [mono] fix SIMD instructions' availability (#19387)
Fixes: https://github.com/dotnet/runtime/issues/34304

@tannergooding @davidwrighton
Now it fully matches clang/LLVM behavior, e.g. even `-mattr=+avx2` (or `-mavx2` in clang) doesn't enable `pcmul` and `aes`. However, `-mattr=+sse4.2` (`-msse4.2`) enables `popcnt` (see https://godbolt.org/z/RWAp_D). The intel manual says

![image](https://user-images.githubusercontent.com/523221/78015652-59d70e00-7352-11ea-9f88-64772e76f842.png)

So is there a CPU with AVX set but without `popcnt`? The instruction is pretty useful (it is used in BCL) users might forget to define it when they use `mattr=avx` (or `mattr=avx2`).

However in C++ world programmers use named groups e.g. `mcpu=haswell` rather than listing these sets via attributes.

Co-authored-by: EgorBo <[email protected]>
2020-04-01 11:41:50 +02:00
Thays Grazia a17ab75dea Adding static to ss_req_acquire and ss_req_count (#19390) 2020-03-31 15:37:04 -03:00
Fan Yang 68a8b92909 Initial perf jitdump implementation (#19273)
* Initial perf jitdump implementation

* Incorporate PR feedback

* Incorporate feedback round 2

* Incorporate feedback round 3

* Minor change

* Incorporate feedback round 4
2020-03-31 09:03:43 -04:00
Zoltan Varga b9f52f3681 [runtime] Fix a problem with PR #19361. (#19374) 2020-03-31 05:06:12 -04:00
Kenneth Pouncey d525e3d5a3 Document threading setup for webassembly build (#19341) 2020-03-31 06:33:30 +02:00
Kenneth Pouncey 62e6a2e0c6 Reactivate the browser threads tests. (#19365) 2020-03-31 06:32:38 +02:00
monojenkinsandimhameed 722e58cc15 [mono][llvm] Improve LLVM 9 compatibility. (#19340)
Improve LLVM 9 compatibility.

Several intrinsics were removed in LLVM 7 and above; replace them with
IR sequences that generate the desired instructions.

Fix some type mismatch problems with the generated IR (in
Sse2.StoreAlignedNonTemporal, Vector128.CreateScalarUnsafe, and
Sse2.MaskMove); these were caught by running the coreclr hardware
intrinsic JIT tests.

Support the two-argument forms of Sse.SqrtScalar, Sse.ReciprocalScalar,
and Sse.ReciprocalSqrtScalar.

llvm::linkCoreCLRGC(), in llvm/CodeGen/GCs.h, was removed and replaced with
llvm::linkAllBuiltinGCs(), in llvm/CodeGen/BuiltinGCs.h.

In mono_llvm_dump_value and mono_llvm_dump_module, flush the c library's
stdout stream before using (and flushing) LLVM's own buffered output
functions.

Co-authored-by: imhameed <[email protected]>
2020-03-30 14:01:45 -07:00
Zoltan Varga b745e20e84 [wasm] Add a try-catch around GetCallingAssembly () calls in ResourceManager, it can fail on wasm aot. (#19358)
Fixes https://github.com/mono/mono/issues/19314.
2020-03-30 13:57:26 -04:00
Jérôme Laban 5bf237a2a4 [Wasm] Fix string_decoder when running with threading enabled (#19355)
* [Wasm] Fix string_decoder when running with threading enabled

Avoids the following error message:

```
Failed to execute 'decode' on 'TextDecoder': The provided ArrayBufferView value must not be shared.
```

* [Wasm] Cache text decoder
2020-03-30 10:13:55 -05:00
Zoltan Varga 4f6b3f30f0 [wasm] Throw an exception in some blocking operations in non-threaded mode. (#19363)
* [wasm] Throw an exception from Monitor.Wait () in non-threaded mode.

* [wasm] Throw an exception when waiting for unsignalled events in non-threaded mode.
2020-03-30 08:36:22 -04:00
monojenkinsandBrzVlad 771fbddefa [interp] Optimize Span<byte>.Fill (#19351)
Co-authored-by: BrzVlad <[email protected]>
2020-03-30 11:56:02 +03:00
Zoltan Varga a30be514e2 [llvmonly] Avoid marking the rgctx/vtable variable indirect, its not needed. (#19287)
In normal llvm mode, these variables are marked as indirect and stored to a stack slot so the EH code can access them.
2020-03-30 04:54:00 -04:00
Zoltan Varga 07febe2bb0 [runtime] Allocate the memory for gshared gparams from image sets. (#19361)
Fixes https://github.com/mono/mono/issues/18127.
2020-03-30 04:43:38 -04:00
Larry Ewing cf7d5d5f45 [wasm][sdk] fix output files (#19360) 2020-03-29 16:36:48 -04:00
Zoltan Varga fbc3a9757a [wasm] Fix threads support in the packager. (#19359) 2020-03-29 16:17:07 -04:00
Zoltan Varga 6e9e5b8ef2 Bump ikvm to pick up 26a033ed9de36f462946232a9b1b7984618c5e1f. 2020-03-29 13:21:00 +02:00
Zoltan Varga f2878d45d8 [wasm] Bump emscripten to 1.39.11. (#19342)
* [wasm] Bump emscripten to 1.39.11.

* [wasm] Build the debug runtime using -g, -g4 disables dwarf.

* Add runtime debugging docs.

* Avoid copying the dotnet.wasm.map file its not generated anymore with dwarf.
2020-03-29 04:21:53 -04:00
Zoltan Varga d336d6be30 [llvm] Handle this arguments as inputs to phi nodes, i.e. for IL code doing starg.0. (#19323) 2020-03-28 03:59:37 -04:00
Vlad Brezae 450a6d6ac7 [interp] Constant fold also checked conversion opcodes (#19294)
* [interp] Constant fold also checked conversion opcodes

* [interp] Remove duplicated opcode
2020-03-27 23:06:25 +02:00
Alex Thibodeau e5be81d921 Need to convert from uint instead of cast here to maintain consistency with mono_gchandle_new_weakref_internal. (#19333)
Looks like this was missed in: https://github.com/Unity-Technologies/mono/commit/941a335ea0f20c22a02a7947945f53787a56b2d3
2020-03-27 20:58:32 +01:00
monojenkinsandBrzVlad 09f5ce3588 [interp] Fix issues around not yet supported System.Runtime.Intrinsics (#19344)
Special cases around infinite recursiveness were not handled by the interpreter.

Co-authored-by: BrzVlad <[email protected]>
2020-03-27 17:03:17 +02:00
Kenneth Pouncey 42c9cfb1fd [wasm][tests] Cleanup browser tests (#19325)
* fix clean target

* Upgrade project to netstandard2.1 and change to not append framework when publish

* Move projects to netstandard2.1

* Remove code referencing framework paths
2020-03-27 06:05:55 +01:00
Kenneth Pouncey 48871c1ff5 [wasm][sdk] Remove Required attribute from Bindings Directory. (#19326)
- Causes build error if sdk path is not being overridden.
2020-03-27 06:04:49 +01:00
Zoltan Varga 36f41ac8df [wasm] Build aot-hello using --nobinding. (#19331) 2020-03-26 16:56:15 -04:00
Thays Grazia 282320c35f [debugger] Bump protocol for this commit https://github.com/mono/mono/pull/19248 (#19318)
* Bump protocol for this commit https://github.com/mono/mono/pull/19248 as suggested by @vargaz.

* Fix coding convention.
2020-03-26 16:51:45 -03:00
monojenkinsandCoffeeFlux 1add5cbc06 [meta] Make monovm.h public (#19305)
Co-authored-by: CoffeeFlux <[email protected]>
2020-03-26 11:42:21 -04:00
monojenkinsandCoffeeFlux 4c36b361c4 [loader] Initial work to support ALC collectability (#19304)
This should enable creation of a collectible ALC from managed, though it will not actually unload properly when Unload is called. This should be enough to unblock Xamarin porting work.

If you think the `mono_alc_cleanup` work is just noise I can remove that, but I thought it helpful to check in to make future diffs clearer as I split it up with the LoaderAllocator work.

Co-authored-by: CoffeeFlux <[email protected]>
2020-03-26 11:17:57 -04:00
Thays Grazia 78fe8c2969 [debugger] Fix suspend_policy that will be send to debugger-libs (#19317)
- Fix suspend_policy that will be sent to debugger-libs, because on debugger-libs we want to resume the VM only when it's suspended, but we were sending the wrong suspend_policy in the case of EVENT_KIND_VM_START and mono is started with suspend=y.
  With this fix we can do this PR again: https://github.com/mono/debugger-libs/pull/264/

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/999375/
2020-03-26 10:15:11 -03:00
Martin Baulig c9171a63be [wasm][debugger]: Correctly handle null sessionId. (#19327)
When the sessionId is null, don't send "null" but omit the field;
Canary does not permit "sessionId: null".
2020-03-26 14:07:14 +01:00
Zoltan Varga 151ba57d0f [llvm] Disable running the llvm verifier by default, it was enabled by mistake, and it takes a long time. (#19319) 2020-03-26 08:10:30 -04:00
Martin Baulig b0e3196b9f [wasm][debugger]: Move some of the internal helper classes into a separate file. (#19324) 2020-03-26 11:52:38 +01:00
monojenkinsandlateralusX c5a9510329 Add stack guarantee on Mono Windows to handle stack overflow. (#19296)
When hitting stackoverflow on Windows, the amount of stack available to exception handler is too small. Windows doesn't support alt stack as other platforms, but there is a way to guarantee a certain amount of available stack during stack overflow exceptions using
SetThreadStackGuarantee.

Fix add support on Windows platforms including SetThreadStackGuarantee API to reserve space needed to handle stack overflow exceptions. On Windows debug build the size needs to be larger since we might end up calling JIT that could have quite deep callstack that, on unoptimized
builds, will need more stack.

Co-authored-by: lateralusX <[email protected]>
2020-03-26 10:29:52 +01:00
Kenneth Pouncey eb9cb9b302 [wasm] Add make target to clean the framework directory (#19316) 2020-03-26 05:46:51 +01:00
d9089e914b [wasm][bindings] Remove typedarray length validation (#19315)
* [wasm][bindings] Remove typedarray length validation

fixes https://github.com/mono/mono/issues/19288

* Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/TypedArray.cs

Co-Authored-By: campersau <[email protected]>

Co-authored-by: Larry Ewing <[email protected]>
Co-authored-by: campersau <[email protected]>
2020-03-26 05:46:00 +01:00
Matt Mitchell 437ca1d81c Feed cleanup (#19321)
Switch away from blob feeds
2020-03-25 19:52:08 +01:00
Alex ThibodeauandJonathan Chambers b1a1f06110 Do not access unloading domains in debugger (case 1013579) (#19299)
There was a race where a domain was being unloaded while debugger would access it. A domain was only removed from the 'appdomains_list' as a very last step. The domain was already invalid to access at this point (locks freed for example).

Worse, images would be unloaded if only referenced by that domain. All places the debugger iterates domains hold the loader lock. The loader lock is acquired by the domain unloading process, so as long as a domain is not unloading when we access it inside of the loader lock we are safe.

include domain unloading check in collect_domain_bp

Co-authored-by: Jonathan Chambers <[email protected]>
2020-03-25 14:15:08 -03:00
monojenkinsandCoffeeFlux 2881514b3d [loader] Fix some log masks in native-library (#19280)
Copy-paste error

Co-authored-by: CoffeeFlux <[email protected]>
2020-03-25 16:43:41 +01:00
CzBiX 9967b065b2 Refine UnixEndPoint to support Windows Unix socket (#19274)
On windows, remote end point client will not return file name, but socket address size still isn't `0x02`.
So check empty file name after bytes readed.
2020-03-25 16:25:57 +01:00
monojenkinsandCoffeeFlux 45694f7c99 [loader] Clear filename when debugging assembly unloading (#19303)
Co-authored-by: CoffeeFlux <[email protected]>
2020-03-25 11:09:35 -04:00
monojenkinsandCoffeeFlux a89b6d3217 [metadata] Skip symbol name mangling on non-Windows for netcore (#19281)
Fixes dotnet/runtime#33246

Co-authored-by: CoffeeFlux <[email protected]>
2020-03-25 15:23:00 +01:00
Kenneth Pouncey 61830e01f6 [wasm][sdk] Add functionality to override the bindings framework location (#19310)
* [wasm][sdk] Add functionality to override the bindings framework location

- Facilitate testing of intree build during the browser tests.

* white space
2020-03-25 12:02:46 +01:00
Vlad Brezae 8ec501a34f [jit] Initialize correct class for tls fields (#19300)
Initialize the klass containing the field to be accessed, rather than the class of the method from where we are accessing.
2020-03-25 10:06:27 +02:00
Zoltan Varga 8543df76a9 [llvmonly] Throw an ExecutionEngine exception with a helpful message when we try to execute a method which failed AOT compilation. (#19302) 2020-03-25 00:40:09 -04:00
dotnet-maestro[bot]anddotnet-maestro[bot] 4eb25bc4b6 Update dependencies from https://github.com/dotnet/arcade build 20200321.1 (#19289)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20171.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20171.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2020-03-25 00:40:51 +01:00
monojenkinsandCoffeeFlux 9f390a7d8a [metadata] Fix leak in custom attribute lookup (#19279)
https://github.com/dotnet/runtime/commit/9dec6ae2ea81d46884bf49d2df8b26cc1e28eb12#r37604565

Co-authored-by: CoffeeFlux <[email protected]>
2020-03-24 19:40:34 -04:00
a9bf876bb7 [debugger] Implementing step through multithreaded code. (#19103)
* Implementing step through multithreaded code.

* Fixing concurrency in the case that more than one thread will run the same code, then when the jit is finished, the thread which jitted the code calls jit_done and the others that were waiting don't call, in this case, the other threads can run before the thread which is calling the jit_done set the breakpoint, so the other threads will not stop in the breakpoint.
As I understood we don't need to check if the try_suspend_runtime is returning false or true when we  hit a breakpoint from context, so removed the call.

Fixes #14456

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
Co-authored-by: monojenkins <[email protected]>
2020-03-24 18:24:33 -03:00
Alexander Köplinger 4cbcc9195d Reenable a bunch of disabled iOS Mono SDKs test suites (#19301)
* Reenable a bunch of disabled iOS Mono SDKs test suites

System, System.Net.Http, System.Web.Services, Mono.CSharp and Mono.Data.Sqlite test suites are running now.

Also tweaks the test UI so you can query it via Xcode's UITest in an automated way.

* Switch to APIs from public headers added in 1425b4d4d0
2020-03-24 20:41:38 +01:00
monojenkinsandlambdageek 1425b4d4d0 [mono] Make some API functions public and private (#19259)
See https://github.com/dotnet/runtime/pull/33633 and https://github.com/xamarin/xamarin-macios/blob/master/runtime/exports.t4

* `mono_install_load_aot_data_hook` was already a `MONO_API`, but it was not in a public header.
  It is added to `mono/jit/mono-private-unstable.h`
* `mono_gc_init_finalizer_thread` was [used by Xamarin.iOS](https://github.com/xamarin/xamarin-macios/blob/63ab48e679716264b33af00f86c24426da1d9f97/runtime/mono-runtime.h.t4#L278) for a long time without being in any public header.  It's one of the reasons we have to compile Mono for XI with `--disable-visibility-hidden`.  Make the function a proper `MONO_API` unconditionally - but make it do nothing if the runtime is compiled without `--with-lazy-thread-creation` (the default).  It is now a public Mono API function.
* `mono_trace_init` was a `MONO_API` function in a non-public header that was already used by embedders that need to set up logger hooks.  It is now not necessary to call this before calling the logger functions to set up logger hooks such as `mono_trace_set_log_handler`

Co-authored-by: lambdageek <[email protected]>
2020-03-24 09:29:34 -04:00
Vlad Brezae 77bcd7497d [interp] Replace ldloca + ldfld/stfld pairs with ldloc/stloc (#19286)
* [interp] Move INDIRECT flag to a separat counter variable

We will optimize away some ldlocas, so a local can stop being indirect at a future cprop iteration.

* [interp] Replace ldloca + ldfld/stfld pairs with ldloc/stloc

If loaded/stored field is the only field of the valuetype. This is meant to mainly optimize IntPtr accesses.

* [interp] Add counter for removed LDLOCA
2020-03-24 13:59:03 +02:00
Alexander Köplinger 81939f45c4 Bump nunitlite to get https://github.com/mono/NUnitLite/pull/26 2020-03-24 11:17:32 +01:00
monojenkinsandlateralusX db7c5aa72e Remove Mono runtime vcruntime140.dll release build dependency. (#19270)
CoreCLR static link vcruntime140.dll, but dynamic link rest of C-runtime using ucrt.lib in release build. Commit align Mono runtime to follow same pattern, removing dependency on vcruntime140.dll.

Co-authored-by: lateralusX <[email protected]>
2020-03-24 08:24:01 +01:00
monojenkinsandlateralusX 7d33bd36f1 Implement icall used by RuntimeHelpers.EnsureSufficientExecutionStack on netcore Mono. (#19271)
Current implementation always returned true for Windows/Linux/Android. There are however use of this API in Task library to make sure recursive tasks won't hit stackoverflow. There are several tests in System.Threading.Tasks that currently hit this, at least on Windows, causing test failures.

Fix use stack limits already setup in register_thread and used by GC when doing conservative stack scan. If the limits have not been setup or is not supported on platform, we will use old defaults, always assume there is enough stack space available. Heuristics around size of minimum execution
stack needed are picked from corresponding CoreCLR implementation.

With this fix all tests run in System.Threading.Tasks.Tests pass on Windows using Mono runtime:

```
=== TEST EXECUTION SUMMARY ===
     System.Threading.Tasks.Tests  Total: 682, Errors: 0, Failed: 0, Skipped: 3, Time: 11,419s
----- end 2020-03-20 13:43:35,72 ----- exit code 0 ----------------------------------------------------------
```

Before fix the following tests hit stackoverflow:

LongContinuationChain_ContinueWith_DoesNotStackOverflow
LongContinuationChain_Unwrap_DoesNotStackOverflow
LongContinuationChain_Await_DoesNotStackOverflow
RunStackGuardTests

Co-authored-by: lateralusX <[email protected]>
2020-03-24 08:22:32 +01:00
Johan Lorensson fa0f2ce8ab Move unbox tramp method address table to data segment, MONO_ARCH_CODE_EXEC_ONLY. (#19292)
unbox tramp method addresses are emitted as a table of calls and read
at runtime by get_call_table_entry. This is problematic on platforms
that doesn't allow data to be read from instruction stream.

Fix follow same pattern as we method address table emitted as function
pointers into table in data segment when using MONO_ARCH_CODE_EXEC_ONLY.
2020-03-24 00:28:15 -04:00
monojenkinsandlambdageek 9504df9ad2 [mono] retry mono_threads_pthread_kill if result == EAGAIN on Linux (#19291)
Try to address https://github.com/dotnet/runtime/issues/32377
(signal queue overflow) by sleeping and retrying a few times.

This is kind of a hack, but it would be good to see if it will address the issue

Co-authored-by: lambdageek <[email protected]>
2020-03-23 23:14:00 -04:00
monojenkinsandlambdageek 0102498d01 [mono] Add headers for unstable APIs (#19272)
We have functions that are de-facto part of the Mono embedding API that are
used by Xamarin.iOS or Xamarin.Android that are not in a state where we want to
commit to supporting them forever in their current form.

Nonetheless, we would like to make sure that the symbols for these functions
are visible even if we otherwise compile the runtime with
`-fvisisibility=hidden`, and we would like to discourage declaring the
functions in the embedder's own headers.

The functions that go into the
`mono/{utils,metadata,jit}/mono-private-unstable.h` headers will all be marked
with `MONO_API MONO_RT_EXTERNAL_ONLY` but we will not guarantee that the
functions will be there from one release to the next or that they will not
change their signatures or their behaviors.

Co-authored-by: lambdageek <[email protected]>
2020-03-23 19:54:25 -04:00
Zoltan Varga bf75db1199 [jit] Perform inlining earlier during call processing to avoid loading vtable/rgctx args which are not needed. (#19283)
* [jit] Perform inlining earlier during call processing to avoid loading vtable/rgctx args which are not needed.

* Avoid inlining calls marked with .tail.
2020-03-23 15:16:56 -04:00
Jay Krell 93457ec8c3 [debug_interp] Do not use uninitialized local. (#19275) 2020-03-23 12:38:37 +01:00
CoffeeFlux 47d542a1b8 [loader] Fix mistake in netcore_load_reference comment
The code here was right, the comment wrong. Also updated to mention that we now check APP_PATHS.
2020-03-23 07:11:05 +01:00
Zoltan Varga 3a08f494a9 [llvm] Unify the emission of GOT access. NFC. (#19250)
* [llvm] Use the _typed version of get_aotconst () everywhere. Lowercase aotconst variable names.

* [llvm] Unify the emission of GOT access. NFC.

* [llvm] Unify the mini_llvm_init_method icalls, use only 1 icall.
2020-03-21 21:17:58 -04:00
Vlad Brezae e0ea5d5de5 [interp] Remove MINT_TYPE_P (#19269)
MINT_TYPE_P is equivalent to the integer versions. By removing it we reduce the number of interpreter types and instructions, making it also easier to apply optimizations on instructions targeting these types.
2020-03-20 17:08:38 +02:00
campersau 12055c887b [wasm] WasmHttpMessageHandler abort connection when response or response content is disposed (#18765) 2020-03-20 16:07:52 +01:00
Aleksey Kliger (λgeek) a416864867 [coop] Make MONO_ENTER_GC_UNSAFE fatal if no_safepoints is set (#18992)
Previously it would print a warning, only, because otherwise we would get a
second assert in the same place while the crash machinery would run from the
current thread from the abort in `mono_fatal_with_history`

The solution is to turn off the "no safepoints" bit since we know we're
definitely going to assert here.

Also record the current state in the checked mode state transition history to
make it a bit easier to diagnose where the problem surfaced.

Also fixed up a pair of other debugging/tracing messages so the message strings
accurately reflect the state.
2020-03-20 10:58:41 -04:00
41d607b629 Updating the Copyright line display when running 'mono --version' (#19060)
Removes the copyright year.

```
$ mono --version
Mono JIT compiler version 6.6.0.166 (2019-08/d9001b5ae70 Wed Feb 12 19:20:16 EST 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	Interpreter:   yes
	LLVM:          yes(610)
	Suspend:       hybrid
	GC:            sgen (concurrent by default)
```

Co-authored-by: Alfonso, Ivan <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
2020-03-20 13:22:08 +01:00
Thays Grazia 871bfad41d [debugger] Fix NOT_IMPLEMENTED while debugging. (#19248)
- Changed the behavior on debugger-agent, if we can't parse the new behavior is to return invalid_argument and not assert and stop debugging
- Changed the mono_domain_set_fast before return from assembly_commands.
- Add error message when return INVALID_ARGUMENT

Fixes #19146
2020-03-20 09:21:26 -03:00
Jay Krell ca1e5c3214 Remove dead code from bug-10127.cs. (#18762) 2020-03-20 13:08:06 +01:00
Phil Jaenke aa688393ba [FreeBSD] Fix for libinotify support and compile (#19234)
Resolves #18528 in for both detection and compiling. This should backport cleanly to next release.

Tested on 12.1-RELEASE with libinotify; configure detects features correctly, compiles successfully, resolves some observed issues during run.

```
#define HAVE_SYS_INOTIFY_H 1
#define HAVE_LIBINOTIFY 1
#define HAVE_INOTIFY_INIT 1
#define HAVE_INOTIFY_ADD_WATCH 1
#define HAVE_INOTIFY_RM_WATCH 1
#define HAVE_INOTIFY 1
```
2020-03-20 13:00:13 +01:00
dotnet-maestro[bot]anddotnet-maestro[bot] 4a22f285e5 Update dependencies from https://github.com/dotnet/arcade build 20200312.3 (#19236)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20162.3
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20162.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2020-03-20 12:49:55 +01:00
Alexander Köplinger 0763fb8b13 Bump boringssl submodule 2020-03-20 11:54:54 +01:00
monojenkinsandlambdageek 2a11ec6687 [mono] Enter GC Unsafe mode in some string allocation functions (#19261)
All these functions are MONO_RT_EXTERNAL_ONLY and they all allocate managed
objects.

Fixes a coop state machine assertion if an embedder calls the function and it needs to take the GC
lock to do a collection.

Co-authored-by: lambdageek <[email protected]>
2020-03-19 19:00:26 -04:00
monojenkinsandEgorBo d1362b026e [mono] return false for AdvSimd.IsSupported and friends (#19263)
Fixes StackOverflow in https://github.com/dotnet/runtime/pull/33749#issuecomment-601271356
Intrinsify all `get_IsSupported` under `System.Runtime.Intrinsics*` to just `false` (except the sets we support, see mono_emit_simd_intrinsics).

Co-authored-by: EgorBo <[email protected]>
2020-03-20 01:30:02 +03:00
Zoltan Varga 8ca4d3e6a2 [runtime] Fix the mapping of 'int' in jit icall signatures, it should be int32 not native int. (#19249)
* [runtime] Fix the mapping of 'int' in jit icall signatures, it should be int32 not native int.

* Add a sizet type to icall signatures.
2020-03-19 06:38:19 -04:00
monojenkinsandlateralusX 729bd0a88d Ignore register unwinder callback for empty patch_info data table on Windows Mono Runtime. (#19254)
Running System.Runtime.Serialization.Xml test suite triggers calls to mono_code_manager_reserve with 0 size code block. On Windows, allocating code regions from code manager will also add callback for code region into unwinder function table, but since region could be 0 length, it will be causing a crash in RtlInstallFunctionTableCallback OS call.

Fix hardens code to not try to register callbacks for code regions of size 0, since that is considered a critical error by Windows OS API.

Co-authored-by: lateralusX <[email protected]>
2020-03-19 11:02:03 +01:00
Vlad Brezae 4359b8ff6f [interp] Optimize out intptr ctor (#19252)
* [interp] Extract nint/nfloat intrisifying code into separate method

* [interp] Optimize out intptr ctor

We avoid the newobj_vt opcode and the ctor's contents by emitting a conversion opcode directly.
2020-03-19 10:37:21 +02:00
monojenkinsandlateralusX 468ef7b362 Mono DISABLE_SIMD still emits OP codes depending on SIMD support. (#19251)
Fix makes sure runtime checks also report that SIMD has been disabled. Returning FALSE from is_simd_supported will turn of MONO_OPT_SIMD and disable all SSE/AVX cpu features will prevent code checking cpu capabilities to emit SIMD instructions.

Co-authored-by: lateralusX <[email protected]>
2020-03-18 23:31:47 -04:00
monojenkinsandlateralusX d43e869bc8 Fix warning building Mono using -Wint-conversion. (#19253)
Co-authored-by: lateralusX <[email protected]>
2020-03-18 23:29:25 -04:00
Vlad Brezae 001d4b3338 [interp] Inline also constructors of valuetypes (#19238)
* [interp] Inline also valuetype constructors

* [interp] Unify vt and non-vt inlining code

* [interp] Fix c++
2020-03-18 23:47:08 +02:00
Vlad Brezae 0d9d923e94 [interp] Do cfold for a few more unary operators (#19200)
That are accessing the stack value at level -2.
2020-03-18 23:11:30 +02:00
Johan Lorensson 56088a653f Fix additional constants embedded in instruction stream on AMD64. (#19246)
A couple of more op codes embedded constant values in instruction stream.
When using MONO_ARCH_CODE_EXEC_ONLY these needs to be moved into GOT slots.
2020-03-18 13:51:00 +01:00
Jay Krell acfa161730 Remove useless ip += from MINT_JMP, it is assigned later. (#19217) 2020-03-18 02:42:56 -04:00
Kenneth Pouncey c1b0b95549 [wasm] cleanup npm/node install. (#19244)
browser tests were failing with node command not being found if the other tests were not run before.  This makes sure that the  NPM command can be found by installing it if not there.

This also separates out the npm version that is being installed.
2020-03-17 11:11:53 +01:00
Johan Lorensson 696ec4da7e Fix usage of JIT_FLAG_CODE_EXEC_ONLY flag. (#19237)
Current implementation didn't convert the JIT flags into options on cfg
meaning that code currently checked JIT_FLAG_CODE_EXEC_ONLY never
executed. Fix handles the new JIT flag in same way as other JIT flags,
converted into bit field on cfg.
2020-03-17 00:51:10 -04:00
Alexis ChristoforidesandAleksey Kliger edf6c286a1 [merp] Add breadcrumb for StackHash (#19240)
* [merp] Add breadcrumb for StackHash

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

* Update mono/utils/mono-state.c

Co-Authored-By: Aleksey Kliger (λgeek) <[email protected]>

* Update mono/metadata/threads.c

Co-Authored-By: Aleksey Kliger (λgeek) <[email protected]>

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
2020-03-16 22:23:21 -04:00
Zoltan Varga 05880086f5 [jit] Transition the SIMD code to use the MONO_CPU_... set of flags instead of the SIMD_VERSION_... flags. (#19139)
* [jit] Transition the SIMD code to use the MONO_CPU_... set of flags instead of the SIMD_VERSION_... flags.

* Enable SIMD version checking when targeting llvm.
* AOT test assemblies using -mcpu=native.

* Remove unused mono_arch_cpu_enumerate_simd_versions (). Move the SIMD_VERSION_ constants to simd-intrinsics.c.

* Use -mcpu=native for aot testing.
2020-03-16 21:02:32 -04:00
Mitchell HwangandMitchell Hwang ab893a369a [Loader] Change mono_trace level from info to debug (#19110)
* [metadata] Change mono_trace levels from info to debug

* [mini] Change mono_trace level from info to debug

* [sgen] Change mono_trace levels from info to debug

* Amended metadata changes

* Amended mini changes

* Amend assembly.c no special case

* Amend sgen-mono.c elevate to warning level

Co-authored-by: Mitchell Hwang <[email protected]>
2020-03-16 08:27:24 -04:00
monojenkinsandEgorBo 2e73a3a25a [mono] Implement all Ssse3 and Sse42 intrinsics (#19225)
Implement all `Ssse3` and `Sse42` intrinsics for LLVM back-end.
`Sse41` is left over (that's why `Sse42.IsSupported` still returns false always outside of corelib)

Godbolt: https://godbolt.org/z/7cd7q5

Co-authored-by: EgorBo <[email protected]>
2020-03-14 23:20:24 -04:00
Zoltan Varga 4ac244261c [wasm] Add a sample for collecting coverage data. (#19223) 2020-03-14 15:16:43 -04:00
monojenkinsandEgorBo 8248c90656 [mono] Implement missing SSE2 intrinsics (#19222)
https://github.com/dotnet/runtime/pull/33465 implemented 99% of them but a few were missing. This PR implements the missing pieces and unlocks `Sse2.IsSupported`.

@vargaz I hope I didn't step on your toe (feel free to close if you already have it locally).

Co-authored-by: EgorBo <[email protected]>
2020-03-13 23:36:01 -04:00
Zoltan Varga d147c60e31 [jit] Add support for emitting r4/r8 constants outside of the text segment. (#19219) 2020-03-13 18:26:29 -04:00
Zoltan Varga 786fdf6a38 [runtime] Coverage profiler improvements. (#19213)
* [interp] Add support for the coverage profiler.

* [runtime] Add 'write-at-method' and 'send-to-method' options to the coverage profiler, they work similarly to options in the AOT profiler.

* Fix c++-isms.
2020-03-13 18:01:00 -04:00
monojenkinsandlambdageek ed2df9c816 [threads] If shutting_down, don't create new thread, kill current thread (#19082)
If the runtime is shutting down, instead of creating a new thread, or throwing
an exception on the current thread, just shut down the current thread.

This takes advantage of `mono_threads_set_shutting_down`'s behavior that if you
call it after shutdown is already started, it will suspend, detach and exit
from the current thread.

Fixes https://github.com/dotnet/runtime/issues/31842

Co-authored-by: lambdageek <[email protected]>
2020-03-13 10:45:14 -04:00
monojenkinsandjkotas 873067cb27 Fix line endings under src/mono (#19215)
Fixes dotnet/runtime#2222

Co-authored-by: jkotas <[email protected]>
2020-03-13 09:54:51 -04:00
Thays Grazia b777471fca If there is a crash and the debugger is attached, we call mini_get_dbg_callbacks ()->send_crash(). (#19191)
That call ends up in mono_debugger_agent_send_crash which does all kinds of questionable stuff like trying to take the loader lock. Eventually it ends up calling socket_transport_send which tries to do a transition to GC Safe mode.
I inserted a MONO_ENTER_GC_UNSAFE in mono_debugger_agent_send_crash function and this fixes the assert.

Fixes #18794
2020-03-13 00:46:06 -03:00
Thays Grazia 0c2f59e016 [wasm][debugger] Continue SS after leaving managed code (#19140)
* Continue stepping over/into/out of managed code to native code, without this fix the behavior was resume when a SS leaves the managed code.
2020-03-13 00:44:49 -03:00
Larry Ewing 6e7146041a [wasm][tests] be slightly more careful looking for the connection string (#19211)
be slightly more strict about connection strings from chrome
2020-03-12 21:42:31 -05:00
monojenkinsandvargaz cb39826fc6 [jit] Add more SSE2 opcodes. Enable SSE2. (#19187)
Co-authored-by: vargaz <[email protected]>
2020-03-12 21:47:42 -04:00
Larry Ewing 150ffb7af3 [wasm][bindings] rework argument marshalling in call_method (#19150)
store a converter object for each type string passed in
use that object to simplify the marshalling step. do one allocation
for arguments and exceptions.
2020-03-12 20:43:43 -05:00
Larry Ewing 35415b28a7 [wasm][bindings] clean up symbol resolution (#19149)
Instead of hard coding a switch of available types we do a one type lookup for each type by name and store that result.
2020-03-12 20:37:30 -05:00
Larry Ewing 54f64a9d08 [wasm][websocket] Buffer writes when endOfMessage == false (#19185)
* [wasm][websocket] Buffer writes when endOfMessage == false

* [wasm][websocket] Set binaryType to arrayBuffer and handle that case
2020-03-12 20:32:24 -05:00
Aleksey Kliger (λgeek) f72f47b90e [corlib] Capture the ExceptionDispatchInfo when rethrowing from TaskContinuation (#19168)
* [corlib] Capture the ExceptionDispatchInfo when rethrowing from TaskContinuation

In `task.GetAwaiter().OnCompleted(action)` if `action` throws, the
`TaskContinuation.RunOrScheduleAction method will catch the exception and then
call `RuntimeAugments.ReportUnhandledException`.  We must not simply throw the
exception again - in that case we will lose all the frames leading up to the
`catch` in `RunOrScheduleAction`.  Instead use ExceptionDispatchInfo to
caputure the original throw.

Addresses https://github.com/mono/mono/issues/19166

* [test] Add regression test

For annoying reasons we can't run this as a simple NUnit test because the
exception is unhandled on some arbitrary threadpool worker thread, and those
don't show up within an NUnit setup.

Additionally because the unhandled exception in the root domain would normally
terminate the application, we need to run this in a new appdomain.
2020-03-12 20:07:08 -04:00
Ankit Jain e0ec8de4b2 [master] Bump msbuild to track xplat-master (#19204) 2020-03-12 23:38:30 +01:00
Alexander Köplinger dcdec02b84 [metadata] Disable three icalls on netcore monodroid (#19198)
They aren't used there.
2020-03-12 19:17:36 +01:00
Johan Lorensson b58d7489be Disable Windows as default build host for WSL sdk builds. (#19196)
SDK builds done under WSL was done like Cygwin in order to be a
Cygwin replacement going forward. This has caused issues when building
sdk's under WSL when Linux is the assumed build host.

Adding an additional define where WSL build host can be overridden to
Windows, but default will now be Linux. This can in future be used
from configure scripts, setting it in sdks/Make.config when needed,
but will be an opt in feature to override Linux as default build host
for WSL.
2020-03-12 13:12:33 -04:00
Zoltan Varga 8fe10ad8e3 [wasm] Add some makefile dependencies. (#19193) 2020-03-12 11:25:08 -05:00
monojenkinsandlateralusX 70141f4959 Share managed EventSource/EventPipe implementation between CoreCLR and Mono. (#19173)
First set of changes needed in order to start sharing managed EventSource/EventPipe code between CoreCLR and Mono runtime. Shareable code has been moved into S.P.C library project and split into runtime specific source files when needed, kept within each runtime specific S.P.C project files.

Mono runtime has been extended with a set of icalls needed by EventPipeInternal, just to make sure EventPipe can be initialized, current Mono runtime implementation returns dummy values.

Current change also enables ETW provider support on Mono Windows runtime.

NOTE, this is just initial changes needed in order to share managed EventSource/EventPipe code between runtimes. Future changes will incrementally add EventPipe native code into Mono runtime.

Co-authored-by: lateralusX <[email protected]>
2020-03-12 13:36:24 +01:00
Alexis Christoforides 662f744a93 [merp] Remove unnecessary call to msync in mono_state_free_mem (#19167)
Closes https://github.com/mono/mono/issues/19136
2020-03-12 06:51:36 -04:00
Alexander Köplinger aeda6f0b26 Fix mistake in previous commit 2020-03-12 01:19:38 +01:00
Alexander Köplinger 306ebdfd30 Don't disable dllmap for mobile on netcore 2020-03-12 01:13:27 +01:00
Alexander Köplinger 0cc83ec613 Add assert when dllmap is disabled and fix support build in netcore mode
Ported from https://github.com/dotnet/runtime/commit/a54d391d9daebf7b53e7f1efc1690c1c35177570
2020-03-12 01:09:46 +01:00
Vlad Brezae b99f79fa94 [interp] Add more Math intrinsics (#19174)
* [interp] Add missing intrinsics for double Math operations

* [interp] Add math intrinsics for float operations

* [interp] Add more math intrinsics

With different type of signature

* [interp] Remove intrinsic for Round for now

Which has different semantics from the libc's round
2020-03-12 00:14:41 +02:00
Larry Ewing 691665884b [wasm][benchmarks] Add --wasm-package to bench runner to consume package builds (#19190)
This adds an option the standalone-benchmark runner to extract the package zips created with the package target and available from jenkins for commits to master.
2020-03-11 15:20:33 -05:00
Zoltan Varga 19fa221a33 Avoid passing /features:peverify-compat to csc, it generates very inefficient code in some cases. (#19144)
See https://github.com/mono/mono/issues/18572#issuecomment-595924767.

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

Disable the IL verifier for now, it can't handle code compiled without /features:peverify-compat.
2020-03-11 19:43:19 +01:00
Vlad Brezae 94ff330b60 [interp] Optimize delegate invokes (#19065)
Add a specialized MINT_CALL_DELEGATE invoke, which is faster than executing a separate generic managed wrapper method.
2020-03-11 20:09:55 +02:00
monojenkinsandEgorBo 7d623e5e62 [mono] Optimize boxing in Pattern Matching idioms (#18812)
This PR optimizes boxing for pattern matching idioms. Basically, it copies existing optimizations from CoreCLR to mono, see [impBoxPatternMatch](https://github.com/dotnet/runtime/blob/084dd1a5aae0fbe6ed4f9164ac4ee1c5f0b2398f/src/coreclr/src/jit/importer.cpp#L5856-L6032) (one of them was recently added by me for coreclr, see https://github.com/dotnet/runtime/pull/1817)
#### 1) `box + isinst + brtrue/brfalse`  -->  `ldc.i4.0/1 + brtrue/brfalse`
```csharp
public static int Case1<T>(T t)
{
    if (t is int)
        return 42;
    return 0;
}
/*
    IL_0000: ldarg.0
    IL_0001: box !!T
    IL_0006: isinst [System.Private.CoreLib]System.Int32
    IL_000b: brfalse.s IL_0010
    IL_000d: ldc.i4.s 42
    IL_000f: ret
    IL_0010: ldc.i4.0
    IL_0011: ret
*/
```
#### 2) `box + isinst + ldnull + ceq/cgt.un`  -->  `ldc.i4.0/1`
```csharp
public static bool Case2<T>(T t)
{
    return t is int;
}
/*
    IL_0000: ldarg.0
    IL_0001: box !!T
    IL_0006: isinst [System.Private.CoreLib]System.Int32
    IL_000b: ldnull
    IL_000c: cgt.un
    IL_000e: ret
*/
```
#### 3) `box + isinst + unbox.any`  -->  `nop`
```csharp
public static int Case3_1<T>(T o)
{
    if (o is int x)
        return x;
    return 0;
}

// or

public static int Case3_2<T>(T o) => o is int n ? n : 42;

// or

public static int Case3_3<T>(T o)
{
    return o switch
    {
        int n => n,
        string str => str.Length,
        _ => 0
    };
}
```
Tests can be found here: https://github.com/dotnet/runtime/tree/master/src/coreclr/tests/src/JIT/Generics/Conversions/Boxing

[Sharplab.io link](https://sharplab.io/#v2:EYLgtghgzgLgpgJwDQxASwDYB8CwAoAAQAYACAZQAsIEAHAGQmADoAlAVwDsY0w4BufPgIBmEgQCMANjEAmEgGF8Ab3wk1Y0ROlouC6HHEAeACoA+ABTGSMAJSr1KvOuck0AMxLmYrqK652nFyCCAHYSABYZAUDgsKJo5wBfezUUjTEpEmAAe2yMPSg4GRMLK1s0xyC1UOsfPxgE9WSYkjSRDO1deX1hAH0jM0sSbIDnSqr3T2y6nW8AD1Gq5xq5xtiSeLTmts1M2YK4PuLBqxGSAF5TYZndDhIAfhI7kAiowRb2rXqDvuESoZGFTSyzC0ygAHc0DAAMYUYFVcZLIL7O6XJ5IeFIjKkWAIC5XXFMOhwDgAcxgFAxLSxal6+I2mJciTWJGaznwiSAA===) to observe IL code for the samples above.

#### Codegen diff example:
```csharp
static bool Test(int n) => Validate(n);

static bool Validate<T>(T t) => t is int;
```
Before (for `Test`):
```asm
0000000000000000	pushq	%r14
0000000000000002	pushq	%rbx
0000000000000003	pushq	%rax
0000000000000004	movl	%edi, %ebx
0000000000000006	movabsq	$0x7fdf9c5090c0, %rax
0000000000000010	movabsq	$0x7fdfad0268e8, %r14
000000000000001a	leaq	0x1be800(%r14), %rdi
0000000000000021	movl	$0x14, %esi
0000000000000026	callq	*(%rax)
0000000000000028	movl	%ebx, 0x10(%rax)
000000000000002b	movq	(%rax), %rax
000000000000002e	cmpq	%r14, (%rax)
0000000000000031	sete	%al
0000000000000034	addq	$0x8, %rsp
0000000000000038	popq	%rbx
0000000000000039	popq	%r14
000000000000003b	retq
```
After:
```asm
0000000000000000	movb	$0x1, %al
0000000000000002	retq
```

Co-authored-by: EgorBo <[email protected]>
2020-03-11 19:45:48 +03:00
imhameed b74bbe9269 [arm] Fix branch island disassembly for arm64 and thumb. (#19188)
Followup to https://github.com/mono/mono/pull/19126 and
https://github.com/mono/mono/pull/19169.

Bring arm64 `mono_arch_get_call_target` in line with other platforms by
returning NULL on failure instead of asserting. Bits 30-26 in an arm64
unconditional branch are exactly 0b00101, so 0x1f (0b11111) is used as a
mask to determine if the branch uses an immediate target--0x7 (0b111)
would incorrectly match against branches using register targets. The
extracted immediate is now sign extended in a branch-free way.

Avoid following blx entries in the method address table; ld64 can emit 4
different instruction sequences for islands involving thumb, and I'd
rather not implement support for them all now because 32-bit iOS is old
and large unlinked assemblies seem rare.
2020-03-11 13:43:08 +01:00
monojenkinsandpi1024e 30f5d34400 No need to have a "while (TRUE)" statement if we can check at the end of the loop or at the beginning. (#19111)
Whenever there must be a loop that goes indefinitely, there are either return statements or break statements in the code.

However, in this codebase, there are "infinite loops" that appear as such until the next line is checked, which is an if statement saying to break if a condition is true.

This unneeded complexity can be resolved by inverting the condition and making that the while-loop condition.

Co-authored-by: pi1024e <[email protected]>
2020-03-11 13:41:15 +01:00
Jay Krell 2746d98c1e [interp][32bit] Fix warning about precedence/parentheses. (#19184)
/s/mono2/mono/mini/interp/transform.c:3166:25: note: place parentheses around
      the '&&' expression to silence this warning
        if (mt >= MINT_TYPE_I1 && mt <= MINT_TYPE_I4
            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
2020-03-11 10:20:40 +01:00
Jay Krell 60a192b98d [tools/sgen] Fix warnings about adding integers to string pointers. (#19180)
Kind of a silly warning.

mono/sgen/sgen-protocol-def.h:102:1: warning: adding 'unsigned long' to
      a string does not append to the string [-Wstring-plus-int]

BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_block_alloc, TYPE_POINTER, addr, TYPE_SIZE, size)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/sgen/sgen-grep-binprot.c:394:2: note: expanded from macro
      'BEGIN_PROTOCOL_ENTRY_HEAVY2'
        BEGIN_PROTOCOL_ENTRY2 (method,t1,f1,t2,f2)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/sgen/sgen-grep-binprot.c:291:26:
  note: BEGIN_PROTOCOL_ENTRY3 (binary_protocol_world_stopping,
  TYPE_INT, generation, TYPE_LONGLONG, timestamp, TYPE_POINTER, thread)exp

mono/sgen/sgen-protocol-def.h:102:1: note: use array indexing to
  silence this warning
2020-03-11 10:19:26 +01:00
Jay Krell 731b9cac54 [mini] Fix warning about unused variables. (#19182)
/s/mono2/mono/mini/mini-generic-sharing.c:1415:9: warning: unused variable
      'param_names' [-Wunused-variable]
        char **param_names;
2020-03-11 10:17:53 +01:00
Jay Krell 0ef53bae78 [wasm] Fix warnings about unused variables. (#19179)
/s/mono2/mono/metadata/sgen-mono.c:2883:16: warning: unused variable
      'last_major_gc_warned' [-Wunused-variable]
        static gint32 last_major_gc_warned = -1;
                      ^
/s/mono2/mono/metadata/sgen-mono.c:2884:16: warning: unused variable
      'num_degraded' [-Wunused-variable]
        static gint32 num_degraded = 0;
                      ^
/s/mono2/mono/metadata/sgen-mono.c:2886:9: warning: unused variable
      'major_gc_count' [-Wunused-variable]
        gint32 major_gc_count = mono_atomic_load_i32 (&mono_gc_stats.maj...
               ^
2020-03-11 10:13:36 +01:00
Jay Krell be9ced1a0f Fix warnings about misleading indentation. (#19186)
This is subtle and not actually misleading,
because it tends to be space tab or space tab, not wrong
number of tabs or significant wrong number of spaces.

/s/mono2/mono/metadata/class.c:4010:6: warning: misleading indentation;
      statement is not part of the previous 'if' [-Wmisleading-indentation]
                                 if (mono_class_implement_interface_slo...

/s/mono2/mono/metadata/class.c:4039:3: warning: misleading indentation;
      statement is not part of the previous 'if' [-Wmisleading-indentation]
        if (m_class_is_delegate (target) && mono_class_has_variant_gener...

/s/mono2/mono/mini/driver.c:1780:4: warning: misleading indentation; statement
      is not part of the previous 'if' [-Wmisleading-indentation]
                if (strncmp (argv [i], "--debugger-agent=", 17) == 0) {
2020-03-11 10:11:39 +01:00
Jay Krell fe5078961f [wasm] Fix warnings about unused variables. (#19181)
/s/mono2/mono/mini/mini-runtime.c:2284:15: warning: unused variable 'ji'
      [-Wunused-variable]
        MonoJitInfo *ji;
2020-03-11 10:08:41 +01:00
Larry Ewing 10cf3041d6 [wasm][packager] add option to pull from a different runtime directory (#19178) 2020-03-10 18:53:53 -05:00
Larry Ewing 488da04761 [wasm][standalone-benchmarks] Support mac (#19175)
This just handles systems (mac) without realpath installed and with a version of bash
that doesn't support &>>. It also trims path information from the benchmark name
2020-03-10 15:03:07 -05:00
monojenkinsandmdh1418 9ce7798c41 [mono] Include filename in Invalid image error messages (#19112)
Fixes dotnet/runtime#31649
Fixes dotnet/runtime#31650

**Testing**:
Reproduced Error via
`<Runtime Repo Root>/build.sh /p:RuntimeFlavor=mono`
Removing `[ActiveIssue("https://github.com/dotnet/runtime/issues/31650", TestRuntimes.Mono)]` in AssemblyTests.cs
Running `dotnet msbuild /t:RebuildAndTest /p:XunitMethodName=System.Reflection.Tests.AssemblyTests.LoadFile_NoSuchPath_ThrowsFileNotFoundException`

Fixing issue resulted in no errors.

Co-authored-by: mdh1418 <[email protected]>
2020-03-10 10:48:43 -04:00
monojenkinsandEgorBo 84bc62d113 [mono] Disable SIMD support for Windows target (#19172)
A temp fix for https://github.com/dotnet/runtime/issues/1933

Co-authored-by: EgorBo <[email protected]>
2020-03-10 14:45:55 +01:00
Jay Krell 5a065f628f [interp] Add EXCEPTION_CHECKPOINT to MINT_JMP consistent with other method tranform paths. (#19157) 2020-03-10 13:00:59 +01:00
Johan Lorensson fd61732c83 Convert PLT table and call site to execute only on AMD64. (#19114)
Current implementation embedded critical runtime information directly
into PLT slot. It also depends on finding call site in generic trampoline
reading call target from instruction stream in order to locate PLT slot
in use and then read GOT offset as well as PLT info offset from PLT slot
instruction stream.

This is problematic on platforms where code is execute only. Fix changes
how the metadata needed in order to correctly patch PLT is discovered.
Instead of depending on reading instruction stream, it is loaded into
RAX (free to be used when calling through PLT on AMD64) in PLT slot
before jmp takes place that moves control over to generic trampoline.

The PLT slot is the only place where we have access to both GOT index
(used in jmp), PLT info offset (currently embedded after jmp instruction)
and emitted PLT slot index. Since PLT slot index can be used to recover
GOT offset used by PLT slot as well as PLT info offset at runtime,
PLT slot index will be emitted into instruction stream and loaded into
RAX (prepared to be configurable to other reg if needed) before doing the
jump over to generic trampoline. Size of emitted imm constant is optimized
based on number of total PLT slots used in image, meaning that 1, 2, or 4
bytes could be used to store PLT slot index as an imm constant in
instruction stream. The additional jmp should have minimal to no
performance overhead since it should complete within 1 cycle, reading
imm constant from instruction stream that shouldn’t incur additional
cache misses and sine there is no data dependency between mov and jmp,
there should be options to pipeline both instructions. Since mov has
smaller latency than indirect jmp, mov should be complete once control
gets into the generic tramp (if pipelined).

In order to resolve plt info offset at runtime, needed information is
now emitted as part of got_info_offsets, increase table with 4 bytes/plt
slot, same size currently emitted into the PLT slot instruction stream.

Code size of PLT slot is currently 10 bytes (6 bytes jmp and 4 byte PLT
info offset). Since PLT info offset has been moved into got_info_offset
table, size of PLT slot will be 2, 4, 5 byte mov (depending on needed imm
size) and 6 bytes jmp instruction. As an example, mscorlib can emit all
its PLT slots using 2 byte imm constant, meaning that the PLT slot will
still be 10 bytes, but since PLT info offset of 4 bytes is moved into
got_info_offset, total image increase will be 4 bytes/PLT slot. This is
however still cheaper than alternatives that would burn 1 trampoline/PLT
slot (at least 10 additional bytes/slot) or setup lookup tables in image
or calculate more info at runtime, all-consuming more memory in total.

Note, using this approach is optional and runtime needs to be built using
MONO_ARCH_CODE_EXEC_ONLY in order to enable it since it’s only an opt in
features on platforms that can't read from instructions stream.

Current implementation is AMD64 only, but same pattern could be applied
to other architectures when needed.
2020-03-10 12:19:52 +01:00
monojenkinsandEgorBo 1ec2c9f7fd [Mono] Intrinsify Interlocked.And and Interlocked.Or using LLVM (#19135)
These APIs were introduced recently in https://github.com/dotnet/runtime/pull/33042 and already used in several places e.g. in `Task`, `InterlockedBitVector32`, `SafeHandle`, `RegexCharClass`

It should emit `%reg = atomicrmw and (or)` in LLVM IR. (and unlike `Interlocked.Add` these API return old value, see https://github.com/dotnet/runtime/pull/33102

Addresses https://github.com/dotnet/runtime/issues/32239 for Mono.

Co-authored-by: EgorBo <[email protected]>
2020-03-10 11:49:09 +03:00
monojenkinsandvargaz 5b644ae5a9 [jit] Implement support for all Sse1 intrinsics for netcore. (#19155)
* Add generic OP_XOP opcodes for opcodes which the JIT doesn't care about.
  Add a SimdOp enum to list the operations performed by these opcodes.
* Add a SimdIntrinsic struct so the mapping between the .net methods
  and the JIT opcodes can be specified declaratively.
* Add all intrinsics from the Sse class.

Co-authored-by: vargaz <[email protected]>
2020-03-09 22:48:05 -04:00
monojenkinsandpi1024e 8b447b4ccf No need to force to bool, when C does that automatically in the if statement. (#19095)
In C, the if statement checks if the value is 0 or not 0. !!, or forcing to 1 or 0, is unnecessary here.

Co-authored-by: pi1024e <[email protected]>
2020-03-09 20:28:36 +01:00
imhameed 90430277a1 [arm][ios] Follow branch islands when determining method entry addresses. (#19126)
Fixes https://github.com/mono/mono/issues/18612; `aot_code_low_addr` and
`aot_code_high_addr` were set to a range that included only first-level
branch islands, so `find_aot_module` would fail early when passed a
genuine function address.

This change only affects monotouch for now.

Why not use relative offsets stored in a read-only section? One reason
is that llvm-as cannot handle a `.long` directive containing a
subtraction expression involving externally-defined symbols. The AOT
method address table and AOT LLVM-generated code are currently emitted
in separate object files, so the method address table would include
expressions with undefined symbols.

Related: https://xamarin.github.io/bugzilla-archives/70/707/bug.html
2020-03-09 12:28:13 -07:00
Larry Ewing 9057498794 [wasm] Convert MonoString to string without utf8 intermediate (#19156)
* [wasm] Convert MonoString to string without utf8

Previously when converting strings from mono objects to js we used a utf8 intermediate buffer, this change builds the js string from the mono string without an intermediate.
2020-03-09 13:42:21 -05:00
Larry Ewing 66545a2abd [wasm] remove m_strdup (#19158) 2020-03-09 11:58:11 -04:00
Rares95andRares Sebastian Popa a25fe91245 Remove redundant mono_gc_collect during domain unload (#19130)
* Remove redundant mono_gc_collect during domain unload

Ifdef out mono_gc_collect when Boehm GC is present as it doesn't use remsets

* Fix trailing whitespace

Co-authored-by: Rares Sebastian Popa <[email protected]>
2020-03-09 16:47:45 +01:00
Aleksey Kliger (λgeek) 621a2219ef [corlib] Suppress finalization of underlying console FileStreams (#19137)
* [corlib] Suppress finalization of underlying console FileStreams

We already suppress the finalization of the CStreamReader and CStreamWriter,
but during shutdown, the underlying FileStream may be finalized which
invalidates its access field which can lead to a crash.

Addresses https://github.com/mono/mono/issues/19005
2020-03-09 10:01:16 -04:00
Marek Safar 1d575d8fe7 Bump linker (#19151) 2020-03-09 13:29:21 +01:00
dotnet-maestro[bot]anddotnet-maestro[bot] ebe382d49d Update dependencies from https://github.com/dotnet/arcade build 20200308.2 (#19163)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20158.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2020-03-09 13:27:40 +01:00
monojenkins 1713304e55 [bcl] Update BCL Linked Size 2020-03-09 07:14:17 +01:00
Marek Safar c6a3143c1e Freeze linker on mono-2020-02 branch 2020-03-08 10:35:42 +01:00
Zoltan Varga 8daffc3e4c Bump emscripten to 1.39.9. (#19147) 2020-03-07 23:16:18 -06:00
Zoltan Varga d083e2a828 [llvm] Move intrinsics definitions into a template header file llvm-intrinsics.h. (#19133)
* [llvm] Move intrinsics definitions into a template header file llvm-intrinsics.h.

* [llvm] Add a call_intrins () helper function.

* [llvm] Add globals for the SSE vector types to make code more compact.

* [llvm] Refactor the registration and lookup of intrinsics.

* Use the Intrinsics class from LLVM to register intrinsics.
* Identify intrinsics using an id instead of their name.

* Disable the wasm intrinsics on older llvm versions.

* Simplify mono_llvm_register_overloaded_intrinsic ().
2020-03-07 00:49:17 -05:00
monojenkinsandpi1024e 1690cadee2 Changed signedness of iterator to fix warnings. (#19014)
numOperands is an unsigned integer. In addition, getArgOperand has unsigned int arguments. As a result, I have no idea why i is an int, but to fix compiler warnings, I made it an unsigned int.

Co-authored-by: pi1024e <[email protected]>
2020-03-06 14:19:11 +01:00
Zoltan Varga be52633175 [jit] Use OP_EXTRACT_R4 in simd-intrinsics.c when using LLVM. (#19129)
* [jit] Use OP_EXTRACT_R4 in simd-intrinsics.c when using LLVM.

* [jit] Check for sse41 support before using the sse41.dpps intrinsic.
2020-03-06 07:32:47 -05:00
Larry Ewing 9ab10fd987 [wasm][debugger] Hash messages and sessions directly (#19128)
* [wasm][debugger] Hash messages and sessions directly
2020-03-05 16:07:19 -06:00
Larry Ewing f95d1413d3 [wasm][debugger] Check runtime state before attempting to resolve breakpoints (#19134)
Handle the case where the breakpoint request comes in very early before the runtime initialized by deferring resolution until normal runtime init.
2020-03-05 13:35:41 -06:00
Thays Grazia 93e7ef2b0f [debugger] NRE when 2 threads try to call GetThreads at same time (#19122)
As analysed by @jstedfast and me the only way to get this exception with this callstack below is 2 threads call GetThreads at same time, so while one of them is filling the items in the array, the other one is already trying to use the array with null items.

```
System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.Debugging.Soft.SoftDebuggerSession.GetId (Mono.Debugger.Soft.ThreadMirror thread) [0x00000] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:3227
  at Mono.Debugging.Soft.SoftDebuggerSession.OnGetThreads (System.Int64 processId) [0x0002c] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:879
  at Mono.Debugging.Soft.SoftDebuggerSession.GetThread (Mono.Debugging.Client.ProcessInfo process, Mono.Debugger.Soft.ThreadMirror thread) [0x00008] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:902
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleBreakEventSet (Mono.Debugger.Soft.Event[] es, System.Boolean dequeuing) [0x00501] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:2038
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet (Mono.Debugger.Soft.EventSet es) [0x0005b] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:1687
  at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler () [0x0005d] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:1625

```
 PR on mono/debugger-libs -> https://github.com/mono/debugger-libs/pull/300

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1070384/
2020-03-05 13:22:34 -03:00
Sam Patel 4c348d6567 [llvm] Don't set the LLVM JIT TLS variable in AOT. (#19127)
Should fix https://github.com/mono/mono/issues/19115. This bug was
introduced in https://github.com/mono/mono/pull/18824, which
conditionally initalized an LLVM JIT-related TLS slot while preserving
unconditonal stores to that same slot.

The value stored in this TLS slot should only be used during JIT
compilation, so set/reset it in `mono_llvm_compile_method` instead of
during IR construction in `mono_llvm_emit_method`. No non-JIT code
should depend on the existence or presence of this TLS variable, so
remove `mono_llvm_jit_set_tls_cfg`.
2020-03-05 08:29:01 -05:00
Aleksey Kliger (λgeek) a374dbb6f1 [merp] Add a test for Mono.Runtime.SendExceptionToTelemetry() (#18781)
Contributes to https://github.com/mono/mono/issues/18078
2020-03-04 21:25:57 -05:00
Larry Ewing a497dc7c5d [wasm][debugger] Rework breakpointRequest handling across sessions (#19113)
Try to follow CDP ordering constraints by not responding Debugger.enable until
we've fired scriptParsed events for any already loaded assemblies.

Send Debugger.scriptParsed asynchronously as we load assemblies instead of
waiting for them all to load first and fix some of the sequence point processing
to speed up debugger initialization time.

Rework breakpoint request handling by always passing the request to the browser
then storing both the request and the resultant id for use in when any new scripts
are loaded.

Pass any previous breakpoint requests to the new execution context on page reload.
2020-03-04 18:39:15 -06:00
Ryan LuciaandRyan Lucia a5f8905afa [loader] Clean up locking around adding assemblies to domain/ALC (#18967)
This cleans up three components of assembly loading that could potentially cause races/crashes.

First, both `add_assemblies_to_domain` and `add_assembly_to_alc` now ignore resolved references on netcore. We were seeing a crash on CI related to an assertion in here that resulted from two threads using the same MonoImage simultaneously as one is being loaded in with LoadFile, and this should solve that. Fixes dotnet/runtime#2305

Second, we take both the domain and ALC loaded assemblies locks simultaneously around the assembly being added to both lists, ensuring they stay in sync.

Finally, MonoImage now takes the image lock when writing to references instead of using the global `assemblies_mutex` in assembly.c for all images. This potentially helps reduce contention. Work here is not complete, but for this PR it's good enough. See dotnet/runtime#32889

Co-authored-by: Ryan Lucia <[email protected]>
2020-03-04 17:09:08 -05:00
Stefan e1d3b7ba64 Minor formatting of the manuals (#19124) 2020-03-04 17:51:28 +01:00
Thays Grazia c40f1ba79f [dim] Class overriding interface method that was already override by another interface (#18962)
The problem was a parent class overriding an interface that was already override by another interface.
Refactor class-init.c
2020-03-04 12:48:25 -03:00
dotnet-maestro[bot] c1b392f02b Update dependencies from https://github.com/dotnet/arcade build 20200301.1 (#19093)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20151.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20151.1
2020-03-04 13:13:34 +01:00
Jay Krell 35cdbcb4a8 [cxx] Remove static initializers. (#19089)
In a current shipping Visual C++, 19.21.27702.2,
there is a bug involving const member data in structs, where for example:

static const struct a { // const on this line in either case
  const int b; // const on this line
} c = {1};

will have a static initializer, run usually reliably before main, but:

static const struct a { // const on this line in either case
  int b; // no const on this line
} c = {1};

will not.
The semantic difference is minuscule, so much so, that the first form
is relatively rare, and the bug shipped.

Just always use the second form.

The difference is that if you have a non-const a, b is still const, I guess.
If you have a const a, then no difference.

You can find these easily:

cd ...
for %a in (*.exe *.dll) do link /dump /disasm %a > %a.txt
findstr /c:"dynamic initializer" *.txt

Which could be automated and tested in CI.

This probably not an actual problem, but it is needlessly inefficient,
and potentially a problem. The timing/ordering of the initializers
is a bit not deterministic. You get writable data where you expect
read only.

It is in fact a compiler bug, fixed in later releases.
But it has been shipping for a while, I first noticed it over two years
ago, in code of mine that it caused to not work (a delayload implementation
which runs before main).
2020-03-04 12:54:13 +01:00
Aleksey Kliger (λgeek) 0bcc388ce8 [threads] Add a global "runtime startup is finished" flag (#18994)
This contributes to https://github.com/mono/mono/issues/18916
(to make coop locking not bother with state transitions if the runtime isn't
ready yet).
2020-03-03 18:29:04 -05:00
Steve Pfister c483eaf070 Changed Max and MinLengthAttribute validation (#19084)
It should now validate against ICollection or any other type that has a Count property for that matter.

We're still relying on the reference source implementation because corefx strips some types out.

Fixes https://github.com/mono/mono/issues/19022
2020-03-03 15:26:46 -05:00
monojenkinsandEgor Bogatov ede05b997b [Mono] Fix Sse2.ConvertScalarToVector128 and add signed overloads (#19108)
@vargaz noticed I used an incorrect opcode for ConvertScalarToVector128*
I will add a sort of fuzzy tests later (which use all kind of SRI APIs and compare results with CoreCLR) something like this: https://github.com/mono/mono/blob/master/netcore/tests/HwIntrinsics/Program.cs
Also, add signed version of ConvertScalarToVector128*.

Co-authored-by: Egor Bogatov <[email protected]>
2020-03-03 23:14:59 +03:00
Alexis Christoforides 0ec7957d7c [merp] Create a 'reason' breadcrumb for the crash dump process (#19072)
For example, the system name of a signal ('segv') or 'MANAGED_EXCEPTION' are typical arguments.
2020-03-03 11:47:19 -05:00
Johan Lorensson b5a9fe49e1 Fix Mono Tool MSVC Debug build. (#19075)
Changes done in object-offsets.h adding offsets for TARGET_AMD64 exposed
a build configuration error in the Mono Tool MSVC debug build due to
incorrectly setting both X86 and AMD64 defines causing compile errors
when including object-offset.h. Release configuration didn't have this
configuration error, meaning that CI builds wouldn't trigger build error.

Fix makes sure all MSVC build configurations for Mono Tools
(genmdesc, monodis, pedump) matches the build configuration for other
binaries and that debug build configuration is inline with release build
configuration.
2020-03-03 16:11:30 +01:00
Zoltan Varga 4622ad0635 [WIP] [aot] Add support for emitting the method address table as a table of normal pointers in the data segment. (#19086)
* [aot] Rename acfg->opts to acfg->jit_opts.

* [aot] Add support for emitting the method address table as a table of normal pointers in the data segment.
2020-03-03 07:43:11 -05:00
Zoltan Varga b91580bafa [amd64] Obtain the trampoline argument in the generic_trampoline in the AOT case without decoding the call instruction. (#19091)
* [amd64] Obtain the trampoline argument in the generic_trampoline in the AOT case without decoding the call instruction.

* [amd64] Unify the aot specific trampolines so they have the same size/layout, so its easier to compute the address before the call.
2020-03-02 20:16:53 -05:00
Ankit Jain 3aab3884f6 [master] Bump msbuild to track xplat-master (#19077) 2020-03-02 17:49:08 -05:00
monojenkinsandEgor Bogatov 0f0c284a41 [Mono] Implement missing Sse2 intrinsics (#19101)
For now we only implement intrinsics used by corlib internally to optimize code.

Fixes https://github.com/dotnet/runtime/issues/32510 crash.

`ConvertScalarToVector128UInt32/64` is expanded into LLVM's `insertelement`
`ConvertToUInt32/64` is expanded into LLVM's `extractelement`

Co-authored-by: Egor Bogatov <[email protected]>
2020-03-03 01:09:46 +03:00
monojenkinsandRyan Lucia 0e38adf329 Use GArray instead of GList when getting custom attributes from an image (#19083)
Xamarin.Forms calls this _constantly_ during startup, to the point where the malloc calls were actually showing up in the profile. This should help with that, and gives us some ms back during startup.

There are also a bunch of calls that return empty arrays, which in theory could be created in managed for a perf boost. However, it seems the Xamarin.Android team has mostly gotten rid of those calls and that optimization would complicate the code and require changes to our managed CustomAttribute implemented for both legacy and netcore, so I've opted to not check it in for now. If the empty calls continue to show up down the line, I can dig the code back up from my local branch and PR it separately.

If this is producing huge arrays and malloc continues to show up in the profile, consider https://github.com/dotnet/runtime/issues/32972. Even without that, this is a substantial improvement.

Co-authored-by: Ryan Lucia <[email protected]>
2020-03-02 16:46:09 -05:00
Zoltan Varga 89e8a484e1 [wasm] Allow SIMD only in netcore mode. (#19087) 2020-03-02 12:56:43 -05:00
monojenkinsandRyan Lucia f7e1a23dd8 [loader] Free some leaked strings in NativeLibrary resolution (#19085)
Oops.

Co-authored-by: Ryan Lucia <[email protected]>
2020-03-02 17:46:09 +01:00
monojenkinsandRyan Lucia 80ff8817d0 [threading] Switch domain assemblies lock from OS to Coop (#18918)
I don't think you can create a root domain without reaching the thread info attach call, so this should be safe to change outright.

Fixes dotnet/runtime#32177

We should complete https://github.com/mono/mono/issues/18915 and then convert over other locks as needed, but this fixes the immediate CI hang.

Co-authored-by: Ryan Lucia <[email protected]>
2020-03-02 17:45:57 +01:00
Zoltan Varga 89902e8d22 [wasm] Pass --exclude-feature deserialization to the linker. (#19031)
* [wasm] Pass --exclude-feature deserialization to the linker.

* Add a --linker-exclude-deserialization packager option.
2020-02-28 23:41:03 -05:00
Alexander Köplinger 1a6eb5a597 Update mono-extensions 2020-02-28 19:58:22 +01:00
Jay Krell ec9db26150 Remove non-functional spawn code.
Subject to configuration, spawn has three widely divergent behaviors:

succeed but do nothing
print and exit
do what it sounds like
Rather than mislead the callers, provide only option 3 and let the caller decide what to do otherwise.
2020-02-28 13:19:55 -05:00
Maxim Lipninandmonojenkins 68470ddfb0 [wasm] Use PNSE version of System.Net.NetworkInformation.NetworkInterface (#19074)
PNSE coverage of wasm bcl has shown that only three public members of `System.Net.NetworkInformation.NetworkInterface` class throw `PlatformNotSupportedException`.

Now all public members throw PNSE on WASM.

Relates to https://github.com/mono/mono/issues/18735


Co-authored-by: monojenkins <[email protected]>
2020-02-28 19:17:40 +01:00
Alexander Köplinger 716b73221e Update mono-extensions 2020-02-28 19:05:43 +01:00
Alexander Köplinger 00b19731c6 Bump mono-extensions 2020-02-28 15:25:03 +01:00
monojenkinsandRyan Lucia 8951940260 [loader] Remove unnecessary newline in loader mono_trace call (#19069)
Co-authored-by: Ryan Lucia <[email protected]>
2020-02-28 11:37:18 +01:00
Vlad Brezae 941a335ea0 [runtime] Use pointer size gchandles (#19039)
* [runtime] Use pointer size gchandles

This would enable in the future to use CoreCLR's GC with mono. This doesn't change the current embedding api, but, in the future, we will end up aligning with coreclr on an embedding api that uses pointer sized gchandles.

* [gc] Change format of gchandles to be netcore compatible

On netcore, the GCHandle class assumes the lowest bit to be usable, for perf improvements. Move the responsability to have this bit available down to the GC implementation, since for CoreCLR GC we shouldn't do any shifting above the gc interface.
2020-02-28 09:05:55 +02:00
Larry Ewing d11eeadb66 [wasm][debugger] use console.debug to signal runtime init (#19057)
* [wasm][debug] use console.trace instead to init runtime

Using a `debugger` breakpoint in Mono.mono_wasm_runtime_ready has
unfortunate side effects, this changes the logic to use console.trace
and checks the stackTrace when the event is arrives.

* add a console.trace stub to runtime-test.js

* Use console.debug with a magic number instead
2020-02-27 12:07:55 -06:00
Johan Lorensson 188ac1b0a7 Clean up libmono-dynamic.vcxproj dependency for netcore. (#19040) 2020-02-27 18:08:34 +01:00
Larry Ewing 76f5086687 [wasm][debugger] allow stepping out of c# (#19059) 2020-02-27 07:50:59 -06:00
Johan Lorensson d2e6bd2aff Detect build config mismatch for MSVC Windows LLVM build. (#19044)
If LLVM build is done using different build configuration, Mono build
will fail to static link LLVM libraries due to incompatibility between
release and debug C++ runtime library, generating a lot of linker errors
like this:

error LNK2038: mismatch detected for 'RuntimeLibrary':
value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug'
in mini-llvm-cpp.obj

error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL':
value '0' doesn't match value '2' in mini-llvm-cpp.obj

This is normally not a problem when doing local builds of LLVM but
when using an external provided build, like netcore Mono build,
this problem is more likely to occur.

This fix adds an additional check to make sure build configuration reported
by llvm-config.exe --build-mode matches current Mono build configuration
and if not give a more specific msbuild error:

error : LLVM build Configuration=Release doesn't match current Mono
build Configuration=Debug
2020-02-27 13:28:07 +01:00
Nikita Voronchev 4b42804803 [WinForms] Colorize PropertyGrid's Categories properly (#19045)
Assume, one have colorized `PropertyGrid propertyGrid` control:
```
propertyGrid.CategoryForeColor = Color.Red;
propertyGrid.LineColor = Color.Blue;
```

Before changes proposed by the current PR we get the following image:
![before](https://user-images.githubusercontent.com/12382656/75364102-3391fe80-58cc-11ea-9136-347bcd567731.png)
After:
![after](https://user-images.githubusercontent.com/12382656/75364115-3987df80-58cc-11ea-95d1-20691a4a8467.png)
(item labeled "_Child 2_" is selected by user)
2020-02-27 11:25:14 +01:00
imhameed 5e5b1ed425 [aot] Avoid mono_defaults when creating trampolines. (#19055)
Fixes https://github.com/mono/mono/issues/19009.

https://github.com/mono/mono/pull/18505 made PLT initialization occur at
image load time. When initializing the PLT for mscorlib,
`mono_defaults.corlib` is not yet initialized.

This change works around this by using `mscorlib_aot_module`--which is
initialized relatively early--instead of `mono_defaults.corlib`. PLT
initialization is also moved slightly later: it now happens after
`use_page_trampolines` has been initialized. The `USE_PAGE_TRAMPOLINES`
macro has also been changed to dereference `mscorlib_aot_module`.

This commit also removes an unused parameter from
`mono_aot_create_specific_trampoline`.
2020-02-27 08:56:59 +01:00
Larry Ewing 7f6a9bb783 [wasm][debugger] Always pass failed breakpoint requests to target (#19053)
* [wasm][debugger] Always pass failed breakpoint requests to target

Originally we had a simple way to detect that breakpoints were
meant for the runtime but that is no longer true.  Now if we
can't location a breakpoint we need to pass the request on to the
target so it can make an attempt.

* Fix test byUrl is a logical breakpoint and should not fail
2020-02-26 23:07:57 -06:00
Ankit Jain de54af770c [wasm][debugger] Show the typename for valuetypes (#19046)
- no details of the valuetype are accessible

Fixes #18232
2020-02-26 20:32:48 -06:00
Larry Ewing 9793a1e5be [wasm][debugger] clean up scriptid parsing (#19052) 2020-02-26 20:26:56 -06:00
Larry Ewing ac5240640c [wasm][debugger] Since System.Url normalizes the path sep also try to match on the doc.Url (#19051)
Match against the pdb document url as well as the Url we calculated in case the urls have been
processed incompatibly
2020-02-26 17:39:32 -06:00
Steve Sanderson 3b0e35d1bc Debug proxy updates (#19026)
Currently, the Mono WebAssembly debug proxy logic is treated as "shared source" with ASP.NET Core. Each time we update by copying the sources from this repo into the ASP.NET Core repo, we need to make some updates to avoid problems. The intention of this PR is to make the updates here at source, so we can simply copy the sources as-is and don't need to update them each time.

The changes are:

Making everything internal, since this is not intended as public API surface for ASP.NET Core developers. It's an internal implementation detail of the framework.
To retain convenience for the ProxyDriver and Mono test code, this PR also adds a simple public entrypoint called DebuggerProxy. This exposes nothing except the ability to connect a debugger proxy instance to a websocket. In the ASP.NET Core code, we'll simply omit this file since it's not needed, but even if we did get it in the future when the proxy feature is published as a package, it would still be fine since it doesn't expose any public API that would be expensive to support and maintain.
Replacing all the Console.WriteLine calls with use of ILogger from the standard Microsoft.Extensions.Logging package, as used by most .NET Core-based application frameworks including ASP.NET Core.
This allows external code to control what happens with log output, what severity levels are filtered in/out, etc. In ProxyDriver and Mono test code, I've configured it to behave just like before: it logs to console, and doesn't filter out anything.
This has the benefit that various bits of commented-out logging code no longer need to be commented out. Instead, when calling the logger.Log* methods, each call site can specify a severity level and then (for example) the filter level could be set to Debug so that all Trace items are filtered out by default.
2020-02-26 12:52:36 -06:00
Zoltan Varga 6c5a18ba50 [runtime] Remove MONO_LLVM_INTERNAL. (#19032) 2020-02-26 17:48:29 +01:00
Ankit Jain 546833b534 Merge pull request #19035 from radical/async-local-fixes
[wasm][debugger] Fixes to get async method locals
2020-02-26 11:18:28 -05:00
monojenkinsandJohan Lorensson 907d59798c Fix Mono netcore preload hook to work with Windows CoreRun.exe. (#19027)
Current hook compares TPA list file names using case sensitive compare. On Windows, the TPA list, when passed from CoreRun.exe makes all file paths lower case, meaning that our checks fails to find assemblies in TPA list.

Since CoreRun.exe is used for both CoreCLR and Mono, removing the tolower on file paths added to the TPA list in CoreRun.exe could be an option, but that might introduce regressions in CoreCLR, so this fix isolate the change to Mono's netcore preload hook.

Co-authored-by: Johan Lorensson <[email protected]>
2020-02-26 12:06:40 +01:00
Zoltan Varga 91e026de9d [wasm] Improve error handling in the packager. (#19037) 2020-02-25 23:56:18 -05:00
Katelyn Gadd 5c8da9e284 Add basic set of standalone benchmarks for wasm (#18977)
Adds a basic set of standalone benchmarks from multiple sources, along with simple infrastructure for running them in mono, netcore and node.js wasm. A couple of them also have original JS versions you can run from a JS shell.
2020-02-25 18:24:10 -08:00
monojenkinsandpi1024e 3cba804069 Braces around subobject of initialization warning fix (#18866)
When compiling for Mono, Apple's compiler gives a warning saying to put braces around the 0 as it is a subobject. To silence the compiler, I put braces around the 0. Simple fix.

Co-authored-by: pi1024e <[email protected]>
2020-02-25 16:42:42 -08:00
Jay Krell 79e6ce6423 Change macro CLOSE_PIPE to function mono_close_pipe. (#19030)
Extracted from https://github.com/mono/mono/pull/19025
2020-02-25 19:54:38 +01:00
Jay Krell 1bd3b7a614 Fix warnings: GPid vs. pid_t function signature mixup in glib test code. (#19028)
Extracted from https://github.com/mono/mono/pull/19025
2020-02-25 19:46:10 +01:00
Ankit Jain 5c0b1e1c83 [wasm][debugger] Fix getting async method locals, and this
- async local field names don't start with `<`, surface those
- `this` for the actual async method is in a field named like
`<>4__this`, surface it as the `this` object
2020-02-25 13:36:38 -05:00
Ankit Jain f6bef135d5 [wasm][debugger][tests] Update tests to track test api changes 2020-02-25 11:38:37 -05:00
Ankit Jain c2f8fd8bc7 [wasm][debugger][tests] Ensure to always check location when sending
.. commands.
2020-02-25 10:24:50 -05:00
Ankit Jain 5f85de2b56 [wasm][debugger][tests] extract method to set breakpoints 2020-02-25 10:23:39 -05:00
716718a4bc Bump linker. (#19006)
* Bump linker.

* Bump linker tools framework version

* [csproj] Update project files

Co-authored-by: Marek Safar <[email protected]>
Co-authored-by: monojenkins <[email protected]>
2020-02-25 12:48:18 +01:00
Matthew Baird 6b3a7986ef Ensure ListView ItemCheck event can update the checked state (#18926) (#18937)
Fixes #18926
2020-02-25 10:19:01 +01:00
Vlad Brezae 49deb4bcea [interp] Enable more interp tests (#19012) 2020-02-25 09:12:01 +02:00
Zoltan Varga 8da9361ab2 [llvm] Remove loaded llvm support, the startup perf penalty doesn't seem to exist any more. (#18868)
* [llvm] Remove loaded llvm support, the startup perf penalty doesn't seem to exist any more.

* Fix the windows build.

* Remove more mini-llvm-loaded.c references.

* Remove more --enable-loadedllvm references.

* Make --enable-loadedllvm the same as --enable-llvm.

* Fix run-jenkins.sh.

* Address review comments.
2020-02-24 20:35:00 -05:00
Larry Ewing ed012b6e89 [wasm][debugger] revert DotNetUrl changes (#19021) 2020-02-24 18:31:52 -06:00
Jay Krell 9fa3eb26e1 [interp] Reorder InterpMethod to reduce padding (#18982)
for alignment. Sizes goes from 192 to 184.
2020-02-25 01:30:26 +01:00
Jay Krell bb40a1a2d9 Whittle away at warnings: (#18874)
Return address of local (deliberate).
 Pointer cast to different size.
 Function parameter and declaration badly mismatch (pid_t vs. void*).
 Unused locals.
 Top level volatile is ignored.
 Negative shift undefined.
 Call to undeclared function (getpid).

Some are fixed, some are disabled temporarily.
2020-02-24 18:41:06 -05:00
Larry Ewing fafa41f448 Use AsLocation when creating location (#19016) 2020-02-24 14:55:48 -06:00
monojenkinsandpi1024e 655dd296bf Fix compilation warning for converting negative integer constant to unsigned. (#19013)
When compiling, Visual Studio gives two compiler warnings in the sysmath.c file about FPILOGB0/-2147483648 being converted into an unsigned integer.

The standard library math.h states that FPILOGB0 be INT_MIN, so I replaced -2147483648 with the INT_MIN macro so the behavior is much more clear as well as stifling the compiler warnings.

Changes tested manually and automatically.

Co-authored-by: pi1024e <[email protected]>
2020-02-24 13:51:14 -05:00
Ankit Jain 27c5660659 [wasm][debugger] Don't mark the runtime ready before clearing the (#19015)
.. breakpoints. Chrome tries set the breakpoints from previous sessions
when the debugger starts up. And we set that in mono, if the runtime is
ready.

But in `MonoProxy.RuntimeReady`, we mark the runtime ready *before*
clearing the breakpoints. So, we end up setting the breakpoints, as
asked by chrome debugger, but then subsequently clearing them!

This manifests as previously set breakpoints in managed code not getting
hit, but if we reset the breakpoint manually then it gets hit.
2020-02-24 13:50:10 -05:00
Ankit Jain ace2e34aae Merge pull request #19003 from radical/improve-locals-access
[wasm][debugger] Improve accessing locals
2020-02-24 13:49:45 -05:00
Alexis Christoforides 1dffbd0200 [merp] Produce hashes for unmanaged thread stacks also (#18943)
Before, this was only done for managed stacks.

Addresses https://github.com/mono/mono/issues/18941
2020-02-24 13:02:17 -05:00
Alexis Christoforides 981da38038 [merp] Increase buffer size for state dump (#18798)
Addresses https://github.com/mono/mono/issues/18796
2020-02-24 10:21:34 -05:00
Ankit Jain 881dfd770f [master] Bump msbuild to track xplat-master (#18987) 2020-02-24 15:53:08 +01:00
dotnet-maestro[bot] 9f2297bcfd Update dependencies from https://github.com/dotnet/arcade build 20200223.1 (#19011)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20123.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20123.1
2020-02-24 15:50:09 +01:00
Jay Krell 9fb0820ca5 [interp] Use alloca for InterpFrame. (#19007)
This is like https://github.com/mono/mono/pull/19002 but next_free is initialized upon allocation instead of `pop_frame` which is a slight optimization.
2020-02-24 10:30:46 +01:00
Jay Krell ae1c7c010c [interp] Decruft PowerPC. (#18981) 2020-02-24 09:12:56 +01:00
monojenkins e4cf488054 [bcl] Update BCL Linked Size 2020-02-24 08:24:19 +01:00
Jay Krell 5941141433 [interp] Remove some unused paths in newobj and cleanup a little. (#18998) 2020-02-23 15:15:14 +02:00
Jay Krell e9886db7e4 [interp] Pop leave and calli_nat frames. (#19000) 2020-02-23 15:11:14 +02:00
Ankit Jain 9049967106 [wasm][debugger] mono_wasm_get_var_info - don't repeatedly walk the
.. stack, instead find the target frame, and read in one go.
2020-02-22 18:07:06 -05:00
Ankit Jain 01e089bc46 [wasm][debugger] Fix nested class names for this 2020-02-22 17:58:37 -05:00
Ankit Jain 547e4180df [wasm][debugger] Fix issue in getting locals for previous frames
`mono_wasm_get_var_info` didn't correctly reset the `data.cur_frame`
required for `mono_walk_stack_with_ctx`, as the stack is walked
repeatedly to get the variables.
2020-02-22 17:49:56 -05:00
Zoltan Varga cc8a5b5513 [corlib] Link out more SR/SRE types (#18770)
* [corlib] Invoke TypeBuilderInstantiation.MakeGenericType through a delegate created in the TypeBuilder ctor to break a linker dependency between RuntimeType and TypeBuilderInstantiation.

* [corlib] Update linker descriptor.

* UnmanagedMarshal is not used from native code at all.
* AssemblyName is not used from native code at all.
2020-02-22 17:34:00 -05:00
monojenkins 008a10c43a [bcl] Update BCL Linked Size 2020-02-22 22:48:39 +01:00
Thays Grazia a8d34b2a03 [wasm][debugger] Enable embedded ppdb on wasm (#18966)
* Enabling PPDB on Wasm.
2020-02-22 00:35:59 -06:00
Ankit Jain d02bbe4c32 [wasm][debugger] Handle exceptions from JS
- correctly mark `Result` with the error
2020-02-21 19:43:11 -05:00
Ankit Jain cbc722ddaf [wasm][debugger] SetException on all the inspector waiters for uncaught exceptions 2020-02-21 19:43:07 -05:00
Fan Yang 041fbe0900 Revert linker change of 5a65a97 (#18991)
This is needed because  the required='false' field in
```
<type fullname="System.Reflection.Emit.TypeBuilder" required='false' preserve="fields" feature="sre">
			<method name="SetCharSet" feature="sre" />
			<!-- reflection.c mono_reflection_call_is_assignable_to () -->
			<method name="IsAssignableTo" feature="sre" />
```
Fails to preserve the IsAssignableTo method.
2020-02-22 01:27:09 +01:00
Aleksey Kliger (λgeek) 7707eda633 [metadata] Mark mono_signature_get_return_type external only (#18990)
Also mark mono_signature_get_params external only.

Runtime should use mono_signature_get_return_type_internal
and mono_signature_get_params_internal
2020-02-21 17:35:55 -05:00
Larry Ewing dce53cc9f3 [wasm][debugger] Store more per session state and force some event ordering (#18747)
* [wasm][debugger] Store more per session state and force some event ordering

Register a DebugStore and ExecutionContext per session and force some commands
to block on source loading so that scripts are loaded before attempting to use
them. This should populate the sources in vscode-js-debug properly.
2020-02-21 15:06:45 -06:00
monojenkinsandNathan Ricci 840ba017ef Added some parenthesis and a cast to control order of operations. (#18972)
This fixes https://github.com/mono/mono/issues/17140; intermittent incorrect results from GetTotalBytesAllocated for current thread. uint64_t and a pointer difference are not the same type/width on all architectures, so incorrect results can happen with out the parenthesis.

Co-authored-by: Nathan Ricci <[email protected]>
2020-02-21 14:17:39 -05:00
monojenkinsandNathan Ricci ac7a77f245 Correct values for HighMemoryLoadThresholdBytes, MemoryLoadBytes. (#18913)
Correct values fort HighMemoryLoadThresholdBytes, MemoryLoadBytes. I looked in the code for CoreCLR and spoke with Maoni Stephens and Jan Kotas about the values used in CoreCLR, so I am confident they are all correct now.

HighMemoryThresholdBytes is a system wide memory usage threshold at which CoreCLR changes its compaction strategy. There is no direct correspondance to anything in mono-sgen. But since it used by software caches to determine when memory in the system is "nearly" exhauste, mono-sgent will use .9 * total physical memory as an acceptable value.

Co-authored-by: Nathan Ricci <[email protected]>
2020-02-21 19:36:20 +01:00
Larry Ewing a3e03430ea [wasm][tests] clean up a couple of the Contains assertions 2020-02-21 10:52:41 -06:00
Aleksey Kliger (λgeek) ed017481e8 [monodis] Escape names that start with a digit (#18759)
Code like this:

```
using System;
class Program
{
    static byte[] bla = new byte[] {1,2,3,4,5};
    static void Main()
    {
    }
}
```

Compiles to a private field declaration for the array with a compiler generated
name, that name should be quoted if it starts with a digit.  For example:

```
	IL_0007:  ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=5' '<PrivateImplementationDetails>'::'74F81FE167D99B4CB41D6D0CCDA82278CAEE9F3E2F25D5E5A3936FF3DCEC60D0'
```

Fixes https://github.com/mono/mono/issues/18750
2020-02-21 11:43:27 -05:00
Cody RussellandAlexander Köplinger 7a3c321b42 Bump bockbuild for Pango nil check fix. (#18936)
https://github.com/mono/bockbuild/pull/153

Co-authored-by: Alexander Köplinger <[email protected]>
2020-02-21 17:24:43 +01:00
monojenkinsandBernhard Urban-Forster 802d57a741 [mono/metadata] add definitions for ENCLog/ENCMap (#18976)
Co-authored-by: Bernhard Urban-Forster <[email protected]>
2020-02-21 14:42:33 +01:00
Jay Krell f4d5c11610 [interp] Cleanup: Replace retval-> with result. and retval with &result. (#18951) 2020-02-21 11:24:38 +01:00
Jay Krell 3e3499e89a [interp] Allow historical inlining due tO: (#18948)
1. This wasn't generally conserving the important stack.
2. Larger mechanisms are in place now.

Granted, tuning out rare paths could still be valuable.
2020-02-21 10:43:40 +02:00
Jay Krell 40187209f8 [interp] Non-recursive newobj. (#18931)
A few weird here, esp. for string, but CI passes.
Acknowledged but skipped for now, a request to also refactor the opcode -- it doesn't seem like much throwaway work to go in either order, even if the code is dead (which I don't know).

Also amend recent nonrecursive PR to simulate stack +2 instead of +1.
2020-02-20 18:19:27 -05:00
Ankit Jain 91b125af92 [wasm] Improve locals visualization (#18919)
* [wasm] Improve locals visualization in the debugger

- improves handling of generic types, null objects, delegates
- improves getting the name for nested types, arrays, generic types

top todos from this:
- Remove arity in "foo`2<int, int>" from the type name
- Convert nested type names from `foo/bar` to `foo.bar`.

* [wasm] Fix scoping for `mono_wasm_add_null_var`

- which caused runtime uncaught exceptions

* [wasm] Fix possible lost exception in GetScopeProperties

- An exception, eg., because of an invalid scope id just ends up
uncaught instead of showing up as a failed Result.

* [wasm] Address review feedback

- Replace `stringify_type` with `mono_type_full_name` which does exactly
the same thing!

* [wasm][debugger] Fixup nested class, and generic type names

```
	// Fix up generic names like Foo`2<int, string> to Foo<int, string>
	// and nested class names like Foo/Bar to Foo.Bar
```
2020-02-20 14:23:02 -05:00
sharkcz 74f90c824b Add struct offset definitions to s390x (#18958)
* [mini-s390x] standardize on using MONO_STRUCT_OFFSET

* [mono-s390x] add struct offset definitions to s390x

Add s390x specific struct offset definitions to object-offsets.h and
update the array member accesses in mini-s390x.c.

Related: https://github.com/mono/mono/commit/79135c6ea57b516addf187a08cb01826bb0197c6
Fixes: https://github.com/mono/mono/issues/18930
2020-02-20 15:05:26 +01:00
Thays Grazia dd5926cc79 [debugger] Enable reading embedded ppdb (#18895)
To fix the issue of enabling embedded pdb everywhere the problem was that when the roslyn tests are compiling sources it creates embedded pdb with source file "", and before enable reading the embedded pdb we don't read this information, and now we read and our StackTrace file written in our corlib doesn't expect a source file "", it's okay if it's NULL but not "".
I could fix in corlib or in mono, I prefer to fix on mono because I don't know if there is any other place that doesn't expect source file "".
2020-02-20 09:59:40 -03:00
Egor Bogatov e441aa4d21 Remove TestEnvVarSwitchForInnerHttpHandler test as it should be in XA/LinkerTests.cs instead (#18952)
The test will be moved to XA's `src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs` 

It only works if 
```xml
<AndroidHttpClientHandlerType>System.Net.Http.MonoWebRequestHandler, System.Net.Http</AndroidHttpClientHandlerType>
```
is set in `Xamarin.Android.Bcl-Tests.csproj` and we don't want it (other tests expect SocketsHttpHandler to be default one). As an alternative we can add it to the `Xamarin.Android.Bcl-Tests.csproj`'s Linker exceptions but `/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs` is a better place for it.
2020-02-20 11:10:58 +01:00
Jay Krell 90c66725d3 Remove LOCK_DECLARE and LOCK_INIT -- unused and incorrect comments (not idempotent). (#18945) 2020-02-20 10:51:29 +01:00
monojenkinsandBernhard Urban-Forster 1d92b01cf4 [metadata] use descriptive constants for method table columns (#18944)
Co-authored-by: Bernhard Urban-Forster <[email protected]>
2020-02-20 09:30:38 +01:00
Jay Krell a03dee09f9 [interp] inline newobj. (#18903)
The real goal is to make it not recursive.
This is just a step along the way.
Note that the actual not-recursive change has *not* yet been developed,
so this *might* amount to nothing useful.
2020-02-19 23:32:15 +01:00
Vlad Brezae 5d87716ea4 [sgen] Disable managed allocator when using nursery-canaries (#18932)
The managed allocator included in a full aot image does not support canaries, leading to inconsistent object layout.

Fixes https://github.com/mono/mono/issues/18925
2020-02-20 00:10:49 +02:00
Vlad Brezae 47687bdb47 [interp] Fix incorrect propagation of indirect local (#18924)
We never don't track the value of locals who have their address taken in a method, since their value can change without the pass detecting it, leading to propagation of incorrect values. We failed to check for this when doing a stloc.np optimization.

Fixes System.Reflection.Metadata.Tests.ImmutableByteArrayInteropTest.DangerousCreateFromUnderlyingArray

Enable more interp tests, which don't seem to fail on my machine.
2020-02-20 00:09:16 +02:00
monojenkinsandRyan Lucia 7d38e12a1e [loader] Add check to mono_domain_ensure_entry_assembly for AOT (#18938)
Fixes a crash with AOT because domain->setup is NULL here

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-19 22:48:50 +01:00
Zoltan Varga 5fe94fd99f [wasm] Avoid spilling refs to the stack in gsharedvt wrappers, those functions don't need safepoints. (#18820) 2020-02-19 14:30:08 -05:00
Mitchell Hwang 30c1012ed5 [bcl] Default XmlSerializer stream serialize to UTF8 Encoding (#18836)
* [mcs] Default XmlSerializer stream serialize to UTF8 Encoding

* [bcl] Add XmlSerialize Test to preserve UTF chars in stream
2020-02-19 14:11:07 -05:00
monojenkinsandRyan Lucia 45cb6fbba6 [loader] Parse in more netcore hosting properties (#18850)
This includes some other minor cleanup to the netcore hosting functions.

Setting `assemblies_path` with `APP_PATHS` despite it also being set by `MONO_PATH` doesn't scare me too much because:
1) Anyone using `MONO_PATH` is probably not going through the hosting API and is using `mono-sgen` directly
2) The default host doesn't set `APP_PATHS` (and we've worked fine without it being set at all up until now
3) This is a temporary measure; we will have to refactor our preload hook when we want to properly support the other loader properties anyway

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-19 14:10:33 -05:00
Zoltan Varga b4337dd4e8 [llvm] Remove the disable-self-init debug option, it doesn't work any more. (#18929) 2020-02-19 11:43:20 -05:00
Egor Bogatov 6ef5dd4523 Move HttpClientHandlerTests.Android.cs to nunit (#18883) 2020-02-19 16:34:37 +03:00
Alexander Köplinger 885226b1f0 [netcore] Disable ARM64 CI runs (#18922)
They were moved over to dotnet/runtime: https://github.com/dotnet/runtime/pull/32303
2020-02-19 02:36:38 +01:00
Jay Krell d1603aaca1 Remove some #if __cplusplus wrt inlining. (#18891)
The code is fine, and we should put it back at some point,
but I want things to be clearer regarding https://github.com/mono/mono/issues/18827.

i.e. That this does not cause it.
I don't know what does cause it, granted.
Maybe a preexisting race condition/deadlock, I don't know.

Repro is run a loop like:
```
type \s\1.cmd
for /l %%a in (1 1 999) do echo %%a && C:\s\mono2\msvc\build\sgen\x64\bin\Release\mono-sgen.exe \s\mono2\mono\tests\bug-10127.exe
```
2020-02-19 01:26:46 +01:00
Jay Krell 6d0895ad3b Make MONO_API_DATA clearer. (#18897)
Make MONO_API_DATA clearer, its old form -- MONO_API extern.
extern "C" { } should be added around it not within it, for clarity.
I've always found extern "C" without braces unclear, esp. for data.

i.e.

```
 extern "C" {
1   extern void function(); // redundant but clear
                            // same as void function();
2   extern int data; // not redundant, and clear
}
```

vs.
```
3   extern "C" void function(); // I guess clear.
4   extern "C" int data; // unclear -- is it extern or extern "C" or both?
```

This PR in particular turns 4 into 2.
2 is clearly a declaration, not a definition.
4 is unclear as to if it is a declaration or definition.

I was looking into https://github.com/mono/mono/issues/18827.

This does not actually change anything but makes things clearer.

This is similar/related in spirit to https://github.com/mono/mono/pull/18891.
It should not make a difference.
In this case, `#if __cplusplus` remains, but the meaning of it is clearer.
It becomes *only* about the common `extern "C" { }` and not even the less clear `extern "C"`.
2020-02-19 01:20:07 +01:00
Jay Krell 90f4013483 [interp] Make newobj_vt[st]_fast non-recursive. (#18902)
* [interp] Make newobj_vt_fast non-recursive.

* PR feedback: Attempt to provide similer primitive increase_max_stack_height
that is not so roundabout as move_stack (n) + move_stack (-n).

* [interp] Make newobj_vtst_fast not recursive.

This is builds upon https://github.com/mono/mono/pull/18875
and is easiest reviewed after it is merged.

Or, perhaps, this replaces it.

* comment-smithing
2020-02-19 01:17:14 +01:00
Alexis Christoforides 39ea4f4bbd [mono] Remove SIGTRAP handler, as it interferes with debugging (#18851)
* [mono] Remove SIGTRAP handler, as it interferes with debugging

See https://github.com/mono/mono/pull/18243#issuecomment-586013427

* Fix lack of cleanup for SIGSYS
2020-02-18 16:33:44 -05:00
Aleksey Kliger (λgeek) 972896b2f1 [merp] Capture Environment.FailFast message in crash report (#18863)
* [merp] Capture Environment.FailFast message in crash report

* [test] merp-crash-test refactor crasher data; add optional validator

Switch from a Tuple<T1,T2> to a struct for the crash items.  Add a third
optional validator field which is an action to run on the json blob that we get
back.

Not updating existing tests to do any json validation, yet.

* [test] Add new MERP crash test for Environment.FailFast

Check that the resulting json blob includes the failfast message.
2020-02-18 15:59:14 -05:00
Vlad Brezae 4b96fefa7a [interp] Unwrap RuntimeWrappedException if needed, when throwing non exception objects (#18905)
Enable the entire System.Linq.Expressions suite with interpreter
2020-02-18 19:59:18 +01:00
Marius Ungureanu 104c201053 Bump bockbuild to bring in Gtk# regression fix (#18909)
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1055130
2020-02-18 19:46:24 +01:00
Alexander Köplinger e25d05be8d [netcore] Disable a flaky test on interpreter (#18904)
See https://github.com/mono/mono/issues/18695, it's most likely fixed in dotnet/runtime already but we can't easily get updated binaries into mono/mono.
2020-02-18 15:40:01 +01:00
Jay Krell 4649b5784f Remove #if __cplusplus from MagicTypeInfo. (#18898)
This wastes about 24 static const bytes which I think is ok.
6 bytes per struct, plus 2 padding, and there are 3 of them.

I was looking into https://github.com/mono/mono/issues/18827
and wanting to rule out #if __cplusplus.
2020-02-18 10:53:17 +01:00
Zoltan Varga 7038b1a426 [wasm] Implement generation of empty assemblies in wasm-tuner. (#18880)
The linker can completely link away some assemblies, but the rest of the ninja
build still requires them. Previously they were generated by running csc, but
thats too slow, so generate them using Cecil from wasm-tuner.
2020-02-18 02:33:45 -05:00
Jay Krell 15d61562ca Make non-recursive mutexes SRWLOCK instead of CRITICAL_SECTION. (#18847) 2020-02-17 22:34:44 +01:00
Jay Krell 1288a22890 [interp] Consolidate non-recursive call sites. (#18825)
Consolidate native_stack_addr as a result (resolving a FIXME).
 Builds on:
  https://github.com/mono/mono/pull/18857
  https://github.com/mono/mono/pull/18858
  https://github.com/mono/mono/pull/18869
2020-02-17 17:02:24 +01:00
Jay Krell 38256821ed Fix THREADS_SUSPEND_DEBUG to compile (id vs. mono_thread_info_get_tid). (#18871) 2020-02-17 15:59:48 +01:00
dotnet-maestro[bot] 14ae61555b Update dependencies from https://github.com/dotnet/arcade build 20200216.1 (#18887)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20116.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20116.1
2020-02-17 15:55:48 +01:00
imhameed 78fcd4b9f4 [llvm] Disable X86 call frame size optimization. (#18645)
* [llvm] Disable X86 call frame size optimization.

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

For calls that require parameters passed in stack memory,
X86CallFrameOptimization can sometimes replace a sequence of movs to
prologue-reserved stack memory with a sequence of pushes and a compensating sub
rsp after the call. LLVM accumulates an OpAdjustCfaOffset MCCFIInstruction for
each push and and records the ephemeral parameter space consumed by the call
using an OpGnuArgsSize MCCFIInstruction (i.e. DW_CFA_GNU_args_size).

MonoException doesn't support encoding OpGnuArgsSize MCCFIInstructions, and
attempting to encode this instruction can cause unpredictable behavior, due to
our use of llvm_unreachable with assertions disabled [1]. Moreover, even if
MonoException happens to emit valid call frame instructions despite the UB
induced by llvm_unreachable, Mono's exception handler will restore the stack
pointer to the value it contained at the time right before the protected call
instruction was made, without compensating for any ephemeral parameter space.

The stack pointer could be fixed before the jump to the EH handler by
supporting DW_CFA_GNU_args_size or by executing call frame instructions for the
EH handler's frame all the way to the end of the protected instruction address
range--which will include a sub rsp with an appropriate immediate--to determine
an appropriate delta. But it's easier to just disable this optimization. We
already disable it for AOT [2]. It's sometimes disabled by LLVM on Darwin [3].

Also, this commit adds a test (which is a nearly verbatim copy of laszk's
reproduction sample in #17285) for EH failures caused by the interaction of our
EH code and X86CallFrameOptimization.

See also [4], [5], and [6].

[1] https://github.com/dotnet/llvm-project/blob/adeaa08e7bbc9aba5d67cb16c2b348be12deb000/llvm/lib/CodeGen/AsmPrinter/MonoException.cpp#L209-L210
[2] https://github.com/mono/mono/blob/1317cf06da06682419f8f4b0c9810ad5d5d3ac3a/mono/mini/aot-compiler.c#L9872-L9875
[3] https://github.com/dotnet/llvm-project/blob/adeaa08e7bbc9aba5d67cb16c2b348be12deb000/llvm/lib/Target/X86/X86CallFrameOptimization.cpp#L146-L152
[4] https://bugs.llvm.org/show_bug.cgi?id=24792
[5] https://reviews.llvm.org/D13132
[6] http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151005/304074.html

* Address feedback: add an explanatory comment.
2020-02-17 15:41:50 +01:00
Alexander Köplinger e9981608c4 Bump linker submodule (#18884)
Contains fix for -out argument.
2020-02-17 14:54:44 +01:00
Zoltan Varga 3e1f029eb8 [wasm] Make cil-strip quiet. (#18881) 2020-02-17 14:22:39 +01:00
Bernhard Urban-Forster f6dfce1aba [cross] check against correct alignment value (#18712)
It's essentially dead code in any of our configurations.

`MONO_ALIGN_gint8` is define here:
https://github.com/mono/mono/blob/ab2321c1dc1bf0293dadd7e52436b2bd87f2b7c3/mono/metadata/abi-details.h#L26-L35

And the correct value is set here:
https://github.com/mono/mono/blob/ab2321c1dc1bf0293dadd7e52436b2bd87f2b7c3/mono/metadata/abi.c#L71-L75
2020-02-17 14:22:10 +01:00
Zoltan Varga 79ab49333e [jit] Run static cctors for inlined methods, the cctor might not have ran in AOT mode. (#18706)
* [jit] Run static cctors for inlined methods, the cctor might not have ran in AOT mode.

* Emit the class init code later since it contains a branch.

* Emit the class init in the first code bblock.
2020-02-17 08:21:49 -05:00
Bernhard Urban-Forster 79135c6ea5 [abi-details] add explaining comment for macro magic (#18713)
* [abi-details] add explaining comment for macro magic

I think the fallback was added because "let's get it back to work quickly", back in the dark times without CI: https://github.com/mono/mono/commit/b655fb35c61fd3422003de01eed8e634d46b4186

* add constant version. to be used when offset is needed for static array sizes

* missing offset for windows

* windows define fix
2020-02-17 14:21:13 +01:00
Jay Krell 9a147baef1 Remove unnecessary ifdef before undef. (#18877)
* Remove unnecessary ifdef before undef.

* PR feedback: Remove educational comment.
2020-02-17 14:01:34 +01:00
Jay Krell 9adb352348 Remove duplicated Windows header content. (#18846) 2020-02-17 13:48:53 +01:00
Jay Krell 9a6b9c8a2a Fix/quash some warnings. (#18873)
mini\mini.c(1253,59): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3100,43): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3273,49): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3281,49): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3480,51): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3490,49): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3626,48): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3664,48): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3722,48): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3944,47): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini-runtime.c(549,64): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\method-to-ir.c(11838,2): warning C4065:  switch statement contains 'default' but no 'case ' labels
metadata\sre.c(2286,11): warning C4309:  '=': truncation of constant value
metadata\sre.c(2179,11): warning C4309:  '=': truncation of constant value
metadata\sre.c(2204,11): warning C4309:  '=': truncation of constant value
metadata\sre.c(2232,11): warning C4309:  '=': truncation of constant value
mini\method-to-ir.c(11838,2): warning C4065:  switch statement contains 'default' but no 'case
mini\type-checking.c(167,3): warning C4334:  '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
2020-02-17 12:48:56 +01:00
Jay Krell e8601e7b12 Remove unnecesssary include. (#18872)
Less to build if you edit the file.
2020-02-17 12:47:20 +01:00
Jay Krell 68c9084466 [interp] Use method_entry at interp entry instead of duplicating the code. (#18869)
tracing was a mix of:
 - sometimes ifdef out, sometimes not; make it always ifdefed
 - sometimes int, sometimes gint, sometimes gboolean; make it always int

Much of this PR will end up deleted when the multiple nonrecursive calls are
consolidated, but two will remain -- entry and call: label.

https://github.com/mono/mono/pull/18825 is where this is going but it was deemed
too large and requested to be split up. This is part of it.
2020-02-17 12:46:22 +01:00
Jay Krell 2d0ddf0abd [interp] Work toward consolidating multiple nonrecursive call sites to just one. (#18858)
https://github.com/mono/mono/pull/18825 was deemed too large so this breaks
it down into smaller pieces.
To consolidate the multiple nonrecursive call sites requires they share the smae
retval variable. Go ahead and share them all.
2020-02-17 12:43:34 +01:00
Jay Krell d98b7bf9f9 [interp] Fix incorrect comment -- stackval has no size. (#18876) 2020-02-17 12:42:08 +01:00
monojenkinsandEgor Bogatov 79bb3e2031 [mono] Fix msvc mono build and add CopyMonoRuntimeFilesFromArtifactsToDestination target (#18797)
Fixes
```
fatal error C1083: Cannot open include file: '../../support/libm/complex.c': No such file or directory
```
when `mono-netcore.sln` is opened in vs2019

Also, add `CopyMonoRuntimeFilesFromArtifactsToDestination` target to mono.proj to be able to copy mono runtime bits to any folder (needed for the performance team, cc @fanyang-mono)

Co-authored-by: Egor Bogatov <[email protected]>
2020-02-17 12:02:18 +01:00
Jay Krell fed64a7019 [interp] Step toward consolidatation of non-recursive call sites. (#18857)
https://github.com/mono/mono/pull/18825 was too large.
This starts by replacing imethod with cmethod which is a necessary
part of the consolidation of multiple non-recursive call sites to just one.
2020-02-17 09:12:52 +01:00
Zoltan Varga 56f664f2d3 [llvmonly] Allow more direct calls. (#18819)
* [runtime] Add a few m_method_is_... inline functions.

* [llvmonly] Allow direct calls to tls accessors, its not a problem in llvmonly mode.

* [llvmonly] Allow direct calls to icalls/pinvokes/generic instances in the same module.

* Fix the loaded llvm build.
2020-02-15 01:52:28 -05:00
Zoltan Varga 12c13fdf37 [llvm] Remove unused llvm.mono.load/store intrinsics. (#18853) 2020-02-15 00:57:02 -05:00
Zoltan Varga e3ad74614a [llvmonly] Avoid adding the aot init wrappers to the method table, its not needed. (#18848) 2020-02-14 20:33:01 -05:00
imhameed 013e3c07e3 [llvm] Fix LLVM JIT when used with multiple AppDomains. (#18824)
We currently reuse LLVM's command line parsing system to configure and
enable passes. When using the default code generator pass configuration,
the `ImplicitNullChecks` and `X86CallFrameOptimization` passes can only
be enabled or disabled via the command line argument parser: the
`cl::opt`s controlling these (and many other) passes are private to
their translation units, and `TargetPassConfig`/`X86PassConfig` read
from these `cl::opt`s with no other means to override these values.

Unfortunately, some LLVM command line options have restrictions on the
number of times they may be set, and running the LLVM command line
argument parser more than once can fail, because the 'number of
occurrences' counter is stored in each global `cl::opt`. This causes
several tests to fail--one such test is unhandled-exception-7.cs.

This change:
- removes the lazy LLVM JIT initialization logic and instead
  runs this initialization once during `mini_init`,

- moves some stray JIT-only code from mini-llvm.c to llvm-jit.cpp,

- wraps the declarations in domain-internals.h with a
  `G_BEGIN_DECLS`/`G_END_DECLS` pair, so that they avoid name
  mangling when included in C++ source, and

- removes `exception_cb` and `emitted_cb`: neither were actually used
  by live code.
2020-02-14 17:29:45 -08:00
Vlad Brezae c9ba14796a [interp] Fix filter clauses (#18809)
When executing a filter we create a new interp frame, that is a duplicate of the original frame that contains the filter. Once the execution of the filter is finished, we were copying the stack contents back to the base frame. The problem with this is that when the filter is run, the stack is not completely unwinded, meaning that later we can still run a finally block in a frame called by the base frame. This finally block can access the stack arguments, which would reside on the stack of base frame. This means that we must not override the stack of the base frame, only the locals.

Fixes some tests from System.Linq.Expressions suite.
2020-02-14 14:38:25 -08:00
Zoltan Varga 948d7e3b3e [llvmonly] Emit stubs for methods which failed compilation. (#18802)
Emit a stub for methods which failed llvm compilation. Currently the stub will
throw a MissingMethodException, later it can fall back to the interpreter etc.
This is required for cross-assembly direct calls, since the caller doesn't
know that the callee has failed llvm compilation leading to missing
symbols during linking.
2020-02-14 10:59:41 -08:00
dotnet-maestro[bot] 5b775170f2 Update dependencies from https://github.com/dotnet/arcade build 20200214.1 (#18856)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20114.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20114.1
2020-02-14 18:21:46 +01:00
monojenkinsandLevi Broderick 2448e5685f Fix broken MSDN blogs links (#18852)
Fixes MSDN blogs links throughout our docs and source code comments that were broken during the great MSDN migration of 2019.

Note: I am changing the contents of the _davbr Blog Archives_ folder by fixing the broken links. If we need to keep these files exactly as they were when they were copied from the blog, I can revert.

Co-authored-by: Levi Broderick <[email protected]>
2020-02-14 18:15:42 +01:00
Egor Bogatov b5df4be189 Make MonoWebRequestHandler linker friendly (#18832)
Create it using reflection so it will be always linked out. However if it's set via `XA_HTTP_CLIENT_HANDLER_TYPE` linker will preserve it in a special substep: https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PreserveHttpAndroidClientHandler.cs#L72-L80

I had to make its ctor **public** because Linker instantiate it via `Activator.CreateInstance(string)` ([here](https://github.com/xamarin/xamarin-android/blob/60363ef45cd6994a322adac1b73d4271b0658c1e/src/Mono.Android/Android.Runtime/AndroidEnvironment.cs#L369)). But the whole type remains internal so it's not a real API change.

Fixes issue from https://github.com/mono/mono/pull/18818#issuecomment-585611647
2020-02-14 13:04:46 +01:00
Fan YangandAlexander Köplinger 549a38cd4d Bump linker submodule (#18844)
* Bump linker submodule

* Use -o instead of -out for linker output

The arguments changed in linker.

Co-authored-by: Alexander Köplinger <[email protected]>
2020-02-14 12:20:19 +01:00
Bernhard Urban-Forster 26a5d63384 [sdks] add anroid-interpreter-{arm64-v8a,armeabi-v7a,x86,x86_64} targets (#18814)
The Xamarin.Android team prefers that we ship two different `libmonosgen-2.0.so` for each target, e.g. for arm64 we will have with this PR:

* `./sdks/out/android-arm64-v8a-release/lib/libmonosgen-2.0.so`
* `./sdks/out/android-interpreter-arm64-v8a-release/lib/libmonosgen-2.0.so`

As the names indicate one has the interpreter enabled.

This is contrary to what we do for Xamarin.iOS. There, `--enable-minimal=interpreter` has the side-effect that the build will produce a `libmono-ee-interp.dylib` that can be linked next to `libmonosgen-2.0.dylib`. We _could_ do the same for Android, but that would require us to

* Add `--disable-visibility-hidden` to the Android Mono runtime builds. There are concerns however that this will slow down `dlopen (libmonosgen-2.0.so)` on the Xamarin.Android side.
* Do some changes to the interpreter infrastructure, because `--disable-minimal=interpreter` is designed to be used with a cross compiler in mind. For example, we would need a different solution for this: https://github.com/mono/mono/blob/d7e6fcbda82639fd5afe106b0e7a65a2a72a4f63/mono/mini/tramp-arm64.c#L631-L634
2020-02-14 08:26:58 +01:00
Thays Grazia fa0af37014 Removing PPDB. 2020-02-13 22:39:27 -06:00
Thays Grazia 2d0337ee31 Enabling PPDB on Wasm. 2020-02-13 22:39:27 -06:00
Zoltan Varga 2146f1f418 [runtime] Disable assertion messages for g_assertf as well if DISABLE_ASSERT_MESSAGES is used. (#18774) 2020-02-13 13:20:21 -08:00
monojenkinsandRyan Lucia b89e6208b3 [mini] Move netcore hosting functionality into separate file (#18799)
Made minor fixes to the preload hook in the process.

The runtime will still crash if you don't specify the TPA paths and include corlib in that list, but it will at least hit an assert that makes clear it can't find corlib instead of attempting to dereference a null pointer in the preload hook.

The monovm header functions are exported for testing purposes, but the file is intentionally not made public as of now.

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-13 15:36:46 -05:00
Zoltan VargaandBernhard Urban-Forster 362cb3084f [wasm] Avoid compiling release configuration with -s ASSERTIONS=1 in AOT mode, it generates a lot of extra code. (#18703)
* [wasm] Avoid compiling release configuration with -s ASSERTIONS=1 in AOT mode, it generates a lot of extra code.

* Update sdks/wasm/packager.cs

Co-Authored-By: Bernhard Urban-Forster <[email protected]>

Co-authored-by: Bernhard Urban-Forster <[email protected]>
2020-02-13 10:25:05 -08:00
Alexander Köplinger c03b6244e0 [tests] Disable bug-10127.exe runtime test on Windows x64 (#18828)
It hangs: https://github.com/mono/mono/issues/18827
2020-02-13 13:50:00 +01:00
Vlad Brezae e8f392412b [interp] Always init locals (#18811)
Storing uninitialized locals in a managed object shouldn't crash the runtime, so they should be zeroed. This doesn't seem to regress performance on wasm since the initlocals flag is always set, currently. We should be able to remove it most of the time, once we add some multi basic block support to the cprop phase. This will enable us to further reduce call overhead.

Fixes https://github.com/mono/mono/issues/18527
2020-02-13 13:00:33 +01:00
Vlad Brezae 0db68c3f27 [interp] Add missing conversion opcodes from r4 (#18813)
Fixes tests from System.Linq.Expressions suite
2020-02-13 12:58:28 +01:00
Zoltan Varga 3129d4ca8b [runtime] Add --enable-minimal=processes,config options to disable support for processes and .config files. (#18822) 2020-02-13 12:55:02 +01:00
Vincent Povirk a645a2d3c7 [System.Drawing] Release the Graphics HDC on Dispose. (#18801)
Libgdiplus will fail when attempting to delete a Graphics object
that has an unreleased HDC. This allows Dispose to succeed in
that case.

This more closely resembles the behavior of corefx.
2020-02-13 10:40:07 +01:00
Jay Krell 19bc9a8dd3 [interp][wasm] Make newobj_fast not recursive, cleanup, fix EXCEPTION_CHECKPOINT. (#18734)
* [interp[wasm] Make newobj_fast not recursive.
This contributes to https://github.com/mono/mono/issues/18646,
and against master might even fix it.
Though much recursion remains in the interpreter/transform.

* [interp] Cleanup redundant code and child_frame vs. frame.
Only the recursive paths need child_frame separate from frame.

Callers of method_entry tended to duplicate parts of it.
Notice it is marked MONO_ALWAYS_INLINE.

And if that isn't right, it should be split into fast and slow forms,
i.e. regarding frame->imethod->transformed.

* Need to EXCEPTION_CHECKPOINT more often -- when transform occurs but does not raise an exception.

* Preserve prior faster paths.

* Making call_vararg added the following to all calls:
  storing is_void in a larger scoped local
  save is_void
  restore is_void
  check is_void, along with preexisting check of retval == null

Because retval must be set even for void call_varargs,
because the arglist is found from it.

This removes the check of retval == null, it should be redundant with is_void.

* A little cleaner -- unlikely is in method_entry.

* Comma to make comment easier to read.
2020-02-13 00:13:34 -08:00
monojenkinsandJo Shields e901d4fe1a Enable Mono ARM & ARM64 Linux builds (#18810)
Traditionally, Mono is build with native compilers (i.e. "build for this architecture" running in an ARM or ARM64 chroot on an ARM64 server), but to align with CoreCLR, let's go the cross-compile way.

This enables cross-compiler support, by passing a whole bunch of extra info to `./configure`, some of which is set in the common YAML (like the `--sysroot` value)

Co-authored-by: Jo Shields <[email protected]>
2020-02-13 01:15:38 -05:00
Zoltan Varga 0a4c3069be [wasm] Update WASM-REQUESTS.md. (#18816) 2020-02-12 18:04:49 -08:00
Zoltan Varga c76bbb23f9 Revert "[wasm] Pass direct-pinvoke to the AOT compiler. (#18775)" (#18807)
This reverts commit eb85a108a3.
2020-02-12 16:21:51 -08:00
Zoltan Varga 3776b416ad [llvm] Remove a wasm limitation which no longer exists. (#18803) 2020-02-12 16:19:21 -08:00
monojenkinsandRyan Lucia cd46f5c77c [WIP][threading] Switch to a native implementation of LowLevelLifoSemaphore (#18559)
This change is motivated on two main fronts. The first is maintainability - the current managed implementation is difficult to understand and I worry diagnosing any potential issues would be a massive time sink. The second is performance - the current implementation appears to suffer from significant lock contention when running the TechEmpower plaintext benchmark. My hope is that the simpler, cleaner native implementation here will avoid both problems, but I don't want to merge it until we have benchmarking data. However, even if the numbers are similar, I still think it's worth merging just from a maintainability perspective.

The native LifoSemaphore implementation has only ever been tested on posix-like platforms, so Windows behavior is unknown. Currently the Windows implementation of LowLevelLifoSemaphore is very different, so unless we have need for the LifoSemaphore elsewhere in the runtime this isn't a concern.

Many thanks to @filipnavara for the initial implementation.

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-12 17:14:30 -05:00
Jo Shields d7e6fcbda8 Fix native mkbundle (#18739)
* Use clearer Bash conditionals, since we force Bash anyway

* Add libmono-native.so to bundle

* Add logic to add a etc/mono/config without $mono_libdir to bundle

Mostly resolves: #16991
2020-02-12 15:57:54 -05:00
Zoltan Varga 3cbc14f6ff [wasm] Remove chakra and xs from the jsvu update list. (#18804)
Chakra is no longer getting updated and we don't use XS.
2020-02-12 10:05:06 -08:00
Zoltan Varga a50f0b1197 [wasm] Switch to the lts version of node. (#18805)
* [wasm] Switch to the lts version of node.

* Fix a typo.
2020-02-12 10:02:55 -08:00
Ankit Jain 8437ecf9d1 [master] Bump msbuild to track xplat-master (#18790)
* [master] Bump msbuild to track xplat-master

* Bump roslyn to 3.5.0-beta3-20111-03 .

* Update nuget.exe to match xbuild

- the closest version available right now, to `5.5.0-rtm.6422` is
`5.5.0-preview2`, so using that for now.
2020-02-12 17:10:31 +01:00
Egor Bogatov 76e577c00f Allow users to switch to MonoWebRequestHandler on Android via UI (#18764)
* Bring back old HttpHandler for Android
2020-02-12 16:25:46 +03:00
Zoltan Varga e2c0b5ef27 [runtime] Call mono_stack_mark_record_size () only in a checked build, its slow, and the __FUNCTION__ argument creates a C string for every function name. (#18773) 2020-02-12 10:43:35 +01:00
monojenkinsandRyan Lucia 07dc4b88e7 [utils] Add unused attribute to fix warning in checked-build.c (#18800)
At least on my machine, this is the only warning we have when building netcore in the default configuration.

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-11 22:57:15 -08:00
Zoltan Varga 1c7295cfdf [jit] Add an #ifdef around MONO_CPU_WASM_SIMD. (#18771) 2020-02-11 22:56:34 -08:00
monojenkinsandEgor Bogatov fc75795ed2 [mono] Implement Sse2.AddSaturate using LLVM (#18793)
Mono currently supports a limited subset of **Sse1**-**Sse42** intrinsics used only by CoreLib internally. So once a new API is used to optimize things there we also have to implement it in Mono. So it recently happened in https://github.com/dotnet/runtime/pull/32036 (`Sse2.AddSaturate` was used for the first time).

So this PR implements it for mono (with all Sse2 overloads) using named LLVM intrinsics. It turns out it's different between LLVM6 (we currently based on) and LLVM9 (we plan to migrate to soon).

for `Vector128<byte>` overload it emits
```llvm
%result = call <8 x i16> @llvm.x86.sse2.paddus.b(<16 x i8> %left, <16 x i8> %right)
```
which is then emitted as `vpaddusw`

Co-authored-by: Egor Bogatov <[email protected]>
2020-02-12 00:55:25 +01:00
Zoltan Varga eb85a108a3 [wasm] Pass direct-pinvoke to the AOT compiler. (#18775) 2020-02-11 12:08:49 -08:00
Zoltan Varga b260b327fe [runtime] Simplify access to runtime TLS variables when DISABLE_THREADS is defined, they become simple globals. (#18772) 2020-02-11 11:49:24 -08:00
Alexander Köplinger e8527db725 [mini] Wrap check for debug info enabled in ENABLE_NETCORE in all places (#18789)
See if this fixes the weird bug-10127.exe test failure that only occurs on Windows C++ builds.
2020-02-11 16:50:14 +01:00
Alexander Köplinger 071b7259d5 Move offsets-tool into mono/tools (#18783)
This allows us to consume it in the dotnet/runtime build.
2020-02-11 12:18:45 +01:00
Bernhard Urban-Forster 742c414bde [interp] reclaim stack fragments when not used. (#18777)
* [interp] reclaim stack fragments when not used.

When a requested frame size doesn't fit in an already allocated stack fragment, we instead allocate another, larger fragment.
When doing this we missed to free the existing stack fragment, and in combination with a second problem (`current->next` not being cleared when unused) it can accumulate to a lot of unused stack fragments and in worst-case to OOM, as it happened on Linux corlib xunit tests.

Thanks to Jay for tracking it down.

* be cautious for GC

* add barrier
2020-02-11 10:59:49 +01:00
Bernhard Urban-Forster 4cd05a7be4 [cross] support arm-linux-gnueabihf cross compiling with netcore (#18714)
* [cross] support arm-linux-gnueabihf cross compiling with netcore

Some notes on usage:

```console
$ sudo apt install g{++,cc}-gnu-linux-gnueabihf python3-pip

$ ./autogen.sh --disable-boehm --target=arm-linux-gnueabihf \
    --with-cross-offsets=arm-linux-gnueabihf-cross-offsets.h \
    --with-core=only \
    CFLAGS="-O0 -ggdb3 -fno-omit-frame-pointer" \
    CXXFLAGS="-O0 -ggdb3 -fno-omit-frame-pointer"

$ make -C tools/offsets-tool-py/

$ python3 tools/offsets-tool-py/offsets-tool.py \
    --targetdir=/home/lewurm/work/mono \
    --abi=arm-linux-gnueabihf \
    --monodir=/home/lewurm/work/mono \
    --outfile=arm-linux-gnueabihf-cross-offsets.h \
    --libclang=/usr/lib/x86_64-linux-gnu/libclang-7.so.1 \
    --sysroot=/usr/arm-linux-gnueabihf \
    --netcore
```

* better include path guessing
2020-02-11 09:49:21 +01:00
Jay Krell b0c434280d Add volatile for cross thread communication. (#18760) 2020-02-10 21:54:41 -05:00
Alexis Christoforides 72fe53a2ee [MacSDK] Get more verbose output from fc-cache operation (#18782) 2020-02-10 21:53:00 -05:00
dotnet-maestro[bot] 900e77c868 [master] Update dependencies from dotnet/arcade (#18674)
* Update dependencies from https://github.com/dotnet/arcade build 20200201.2

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20101.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20101.2

* Update dependencies from https://github.com/dotnet/arcade build 20200209.1

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20109.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20109.1
2020-02-10 17:03:10 +01:00
Jay Krell 8082e87c4e [cxx] Fix C++ build -- int vs. enum. (#18727) 2020-02-09 11:26:52 +01:00
monojenkinsandRyan Lucia 1635c21e59 [loader] Set domain->entry_assembly earlier in startup (#18720)
When locating AppContext.BaseDirectory on netcore, if APP_CONTEXT_BASE_DIRECTORY is not set we call into the runtime for a fallback location, which checks domain->entry_assembly. On legacy this is fine because we set that property in `prepare_thread_to_exec_main`, but on netcore the new managed assembly loading algorithm will call into managed and check the property before that function is run, which will result in AppContext.BaseDirectory returning an empty string. The solution is to set entry_assembly a bit earlier in initialization. This is the appropriate location because it's what embedding API users will call to run an assembly.

In the process, I got rid of some code that would bypass the usual lookup algorithm unnecessarily.

Fixes dotnet/runtime#31800

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-07 17:18:15 +01:00
Alexis Christoforides 96e64ad4e6 [MacSDK] Keep logged post-install script output from previous installs (#18441)
This is helpful for issues such as https://devdiv.visualstudio.com/DevDiv/_workitems/edit/596552 OC, where the user is asked to both provide these logs for debugging, and also reinstall the SDK to resolve the issue
2020-02-07 11:15:48 -05:00
Alex Soto 0c200c5125 [iOS] Replace removed dsymutil -t switch with -num-threads (#18741)
Apple removed `-t` switch from dsymutil in favor of `-num-threads`
2020-02-07 11:13:31 +01:00
Alexis Christoforides d9e090e867 [merp] Add an exception type for managed exceptions (#18685)
Addresses https://github.com/mono/mono/issues/18681
2020-02-06 23:33:27 -05:00
Alexis Christoforides 081498393a [merp] Add tests for crashing via POSIX signal (#18532) 2020-02-06 23:30:11 -05:00
Alexander Köplinger a40e1ae681 Skip WebAssembly build in sdks archive build on non-master branches
WebAssembly doesn't use our usual release branches yet.
2020-02-06 22:36:38 +01:00
monojenkinsandSteve Pfister 88c44e26f6 [mono] Enable debugging for netcore configurations by default. (#18686)
What this means is:

1. --debug is no longer needed since the default is TRUE
2. --debug=ignore is a new switch to go back to the old mono default

Fixes https://github.com/dotnet/runtime/issues/31662

Co-authored-by: Steve Pfister <[email protected]>
2020-02-06 22:19:04 +01:00
Manuel de la Pena b2ad5f34e1 [NUnitLite] Bump nunitlite submodule. (#18731)
Update the nunitlite submodule to pick up some fixes in the NUnit v3
outputwriter that are needed by xamarin-macios.
2020-02-06 15:58:38 +01:00
mdh1418 7936510ec3 [corlib] Silence undocumented exceptions in ReadXdgUserDir (#18684) 2020-02-06 08:49:28 -05:00
Johan Lorensson 6fe343db8c Reduce number of mono header files copied into SDK include folder. (#18702) 2020-02-06 09:11:55 +01:00
Larry Ewing 4cb6ca5599 [wasm][debugger] Use System.Text.Json in the driver 2020-02-05 20:37:46 -06:00
Larry Ewing 8ce81f5113 [wasm][debugger] Let chrome pick an open port by default 2020-02-05 20:37:46 -06:00
Larry Ewing dd151fea35 [wasm][debugger] Silence some logging and extract the null case 2020-02-05 20:37:46 -06:00
Larry Ewing 32826eb418 [wasm][debugger] Make command formatting slightly more sane and reduce c&p code 2020-02-05 20:37:46 -06:00
campersau a2d1aec5d2 [wasm] Close WebSocket on Dispose (#18628) 2020-02-05 18:58:05 -06:00
Alexis Christoforides 31c12db374 [runtime] Improve handling crashing signals (#18243)
The default handlers for SIGTRAP, SIGSYS on macOS and Linux crash the process, so we now have Mono report this.

This patch also changes how the name of the signal is acquired for passing on to the crash reporting functions, allowing code reuse on crashing signals.
2020-02-05 19:04:57 -05:00
Jay Krell 0e49716ff8 [interp] Remove recursion from call_vararg. (#18697)
[interp] Make call_vararg non-recursive.

[interp] Remove recursion from call_vararg.

This contributes to https://github.com/mono/mono/issues/18646 but is not enough to fix it. The interpreter still recurses a lot.
2020-02-05 17:45:53 -05:00
Johan Lorensson b8369e630c Stack corruption running full AOT interpreter using ValueTuple. (#18710)
Calling a method compiled using full AOT from interpreter can lead to
stack corruption if signature include a ValueTuple without fields on
compilers where MONO_ZERO_LEN_ARRAY is not 0 (msvc, clang). This is due
to doing memset on memory allocated using MONO_SIZEOF_GENERIC_INST but
then memset using sizeof (MonoGenericInst). Fix makes sure we allocate
and memset the same size of memory since otherwise it will lead to an
overwrite of allocated memory when type_argc is 0.
2020-02-05 17:35:13 -05:00
Zoltan Varga 64eacfa900 [wasm] Pass the binding assemblies to the linker normally using -d framework_dir instead of explicitly. The latter makes the linker not link them. (#18704) 2020-02-05 11:04:49 -05:00
Zoltan Varga 2c8371c221 [wasm] Rename aot-dummy to aot-instances. (#18692) 2020-02-05 11:04:31 -05:00
monojenkins ab2321c1dc [bcl] Update BCL Linked Size 2020-02-05 08:18:03 +01:00
Zoltan Varga e9830fac8d [jit] Avoid calling mono_aot_direct_icalls_enabled_for_method () in non-aot mode, it might be a stub if aot is disabled. (#18707) 2020-02-05 00:00:27 -05:00
Alexander Köplinger 8027746aea Remove netcore/corerun/Makefile from mono-output.m4
It was removed from DIST_SUBDIRS with https://github.com/mono/mono/commit/2017e493a970a79aa32df2f05e5f1fd877cb3fdc
2020-02-04 23:36:51 +01:00
Bernhard Urban-Forster 71ad5a0771 [mini] iltests.exe depends on TestDriver.dll (#18638) 2020-02-04 23:28:37 +01:00
Matt Sylvia 2f74ab393f Update deprecated query parameter to header (#18705)
Use of `access_token` is now deprecated, switching to HTTP header

```
Please use the Authorization HTTP header instead, as using the `access_token` query parameter is deprecated.
```
2020-02-04 22:57:46 +01:00
Jay Krell b5fb8dbe6a [interp]Factor out common code. (#18672) 2020-02-04 19:53:48 +01:00
Alexander Köplinger 44fe895ab0 Treat 2020-02 as a valid release branch name too
This should give us breathing room until 2100-02 :)
2020-02-04 19:28:24 +01:00
monojenkinsandEgor Bogatov 2017e493a9 Add RunSample target to mono.proj (#18635)
1) Delete `src/mono/netcore/corerun/` folder, we can build/use coreclr's corerun (it has `--clr-path`)
2) Add `RunSample` to build & run HelloWorld with mono runtime.

Co-authored-by: Egor Bogatov <[email protected]>
2020-02-04 19:15:56 +01:00
Zoltan Varga a592b4b871 [wasm] Add linker substitutions for fields. (#18700) 2020-02-04 12:41:31 -05:00
Alexander Köplinger 303122e94a Bump bockbuild 2020-02-04 17:41:44 +01:00
Alexander Köplinger 088692ff3a Bump xsp to get correct version number 2020-02-04 17:41:44 +01:00
Jo Shields 8d00b7cd8b Bump version to 6.13 (#18699) 2020-02-04 17:41:01 +01:00
Jay Krell cdb7944e7b Add --profiling-funcs to release wasm build. (#18663)
[wasm] Put function names in call stacks.

Add --profiling-funcs to release wasm build.
This is a weaker for of -g2 or -g3 or -g4 or --profiling.
It sounds like the weakest form that preserves names.
Documentation is around here: https://emscripten.org/docs/tools_reference/emcc.html#emcc-g1

Now when reproducing for example https://github.com/mono/mono/issues/18646, you get:
```
 e.stack

<?>.wasm-function[generate_code]@[wasm code]
<?>.wasm-function[interp_inline_method]@[wasm code]
<?>.wasm-function[interp_transform_call]@[wasm code]
<?>.wasm-function[generate_code]@[wasm code]
<?>.wasm-function[interp_inline_method]@[wasm code]
<?>.wasm-function[interp_transform_call]@[wasm code]
<?>.wasm-function[generate_code]@[wasm code]
<?>.wasm-function[interp_inline_method]@[wasm code]
<?>.wasm-function[generate_code]@[wasm code]
<?>.wasm-function[generate]@[wasm code]
<?>.wasm-function[mono_interp_transform_method]@[wasm code]
<?>.wasm-function[do_transform_method]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_jit_runtime_invoke]@[wasm code]
<?>.wasm-function[do_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_try_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_class_init_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_jit_runtime_invoke]@[wasm code]
<?>.wasm-function[do_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_try_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_class_init_full]@[wasm code]
<?>.wasm-function[mono_interp_transform_method]@[wasm code]
<?>.wasm-function[do_transform_method]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_jit_runtime_invoke]@[wasm code]
<?>.wasm-function[do_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_invoke_checked]@[wasm code]
<?>.wasm-function[mono_runtime_try_invoke_array]@[wasm code]
<?>.wasm-function[ves_icall_InternalInvoke]@[wasm code]
<?>.wasm-function[ves_icall_InternalInvoke_raw]@[wasm code]
<?>.wasm-function[do_icall]@[wasm code]
<?>.wasm-function[do_icall_wrapper]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_jit_runtime_invoke]@[wasm code]
<?>.wasm-function[do_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_try_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_wasm_invoke_method]@[wasm code]
wasm-stub@[wasm code]
Db@[native code]
http://192.168.0.20:8000/_framework/wasm/dotnet.js:1:189579
call_method@http://192.168.0.20:8000/_framework/wasm/dotnet.js:1:153837
http://192.168.0.20:8000/_framework/wasm/dotnet.js:1:156177
callEntryPoint@http://192.168.0.20:8000/_framework/blazor.webassembly.js:1:37229
http://192.168.0.20:8000/_framework/blazor.webassembly.js:1:33889
http://192.168.0.20:8000/_framework/blazor.webassembly.js:1:32396
i@http://192.168.0.20:8000/_framework/blazor.webassembly.js:1:31247
promiseReactionJob@[native code]
```
2020-02-04 11:36:22 -05:00
Jay Krell edb18739cb [interp] Remove goto related to code_type being unknown | interp | compiled. (#18678)
[interp] Remove goto for code_type unknown | interp | compiled.

[interp] Remove goto for code_type unknown | interp | compiled.

The goto kinda implies a loop, but it is really just handling one case
before the other, but the source misorders the checks, perhaps for perf,
which maybe, can be done equivalently with G_UNLIKELY, and also remove
some possible extra memory reads.
2020-02-04 09:15:58 -05:00
Jay Krell f85a820677 When the interpreter does recurse, use a different function (#18664)
[interp][wasm]Use per-call recursive functions in interpreter to aid debugging.

 When the interpreter does recurse, use a different function
for each call site, so you can tell from a WebAssembly stack
which case it is. i.e. with function names but no line numbers.

With this, we can see that call_varargs contributes to the problem
here: https://github.com/mono/mono/issues/18646

Also, do not inline the interpreter, it probably/hopefully never was.
2020-02-04 05:56:00 -05:00
monojenkinsandZoltan Varga 1a81bef2bd [runtime] Fix the --enable-minimal=aot build. (#18688)
Fixes https://github.com/mono/mono/issues/18675.

Co-authored-by: Zoltan Varga <[email protected]>
2020-02-04 09:51:42 +01:00
Zoltan Vargaandmonojenkins 08f4ef6d0c Bump linker. (#18691)
* Bump linker.

* [csproj] Update project files

Co-authored-by: monojenkins <[email protected]>
2020-02-04 09:26:09 +01:00
Jay Krell 8c0f6db26f [interp]Fix the type of clause_args. (#18671)
[interp]Fix the type of clause_args.
2020-02-04 00:25:57 -05:00
Jérôme Laban f3d2cc2176 [Wasm] Update to emscripten 1.39.7 (#18687) 2020-02-03 22:23:47 -05:00
monojenkinsandZoltan Varga 7deefe779f [aot] Avoid inflating gparams with byreflike types during generic sharing. (#18680)
Fixes https://github.com/mono/mono/issues/18676.

Co-authored-by: Zoltan Varga <[email protected]>
2020-02-03 21:35:20 -05:00
Zoltan Varga 62a57c687c [wasm] Set the 'top-runtime-invoke-unhandled' option so unhandled exceptions calls AppDomain.UnhandledException. (#18642) 2020-02-03 18:42:49 -05:00
d44a5d3a0b [mini] Add method-triggered printing for runtime stats (#18621)
* [mini] Add optional method name to --stats (#18387)

* Implement parsing for optional method name to --stats command line argument.

* Implement parsing for optional method name to --stats command line argument.
Co-authored-by: Kyle Markland <[email protected]>
Co-authored-by: Rene Garcia <[email protected]>

* Respond to PR feedback.

* Refactored away helper functions.

* Refactored counter setup into separate function. Moved stats optional method into its own condition.
Co-authored-by: Kyle Markland <[email protected]>
Co-authored-by: Rene Garcia <[email protected]>

* Renamed mono_setup_counters->mono_enable_counters. Restore whitespace to 0a51d89c42
Co-authored-by: Kyle Markland <[email protected]>
Co-authored-by: Rene Garcia <[email protected]>

* [mini] Print header for stats. (#18442)

* Add an enum for dumping stats at points in time. Print header before dumping stats in mini_cleanup.

* Make print_stats_header private.

* Remove unused variable.

* Refactored print_stats_header to better accomodate optional methods for stats

* Change printf calls to g_printf in response to feedback.

* Undo changes in response to @CoffeeFlux 's feedback. Add g_printf calls to mini_cleanup

* Avoid always printing stats at shutdown.

* Condition on `mono_stats` instead of `mono_jit_stats`.

* [mini] Global JIT Stats Printing (#18483)

* Make print_jit_stats global to enable interp and JIT-triggered stat dumps.

* Rename some functions for consistency.

* Add a comment to clarify the necessary locking in different contexts.

* Rename mono_print_jit_stats to mono_runtime_print_stats and make it more generic.

* Rename runtime_cleanup_stats back to jit_stats_cleanup.

* Fix a line that was indented with spaces.

* [mini] parse fully qualified method name using mono_method_desc_new (#18499)

* Make print_jit_stats global to enable interp and JIT-triggered stat dumps.

* Rename some functions for consistency.

* Add a comment to clarify the necessary locking in different contexts.

* Use MonoMethodDesc struct and associated helpers to parse from command
line args. Remove unused stats_method_name and setter function.

Squashed commit of the following:

commit de7410696dab10723c76f545076522daa17e85d1
Author: Rene Garcia <[email protected]>
Date:   Thu Jan 16 23:01:23 2020 -0500

    Utilize new stats printing function.

commit 1e5038adfec06c670dbaced771a8ff9344502d17
Author: Rene Garcia <[email protected]>
Date:   Thu Jan 16 22:37:53 2020 -0500

    Remove unused stats_method_name and setter function. Use mono_method_desc_full_match instead of mono_method_desc_match.

commit 04f86c66c139e064bc35738f955f960232eb6cbb
Author: Rene Garcia <[email protected]>
Date:   Thu Jan 16 18:11:37 2020 -0500

    Modify mono_method_desc_match to actually match namespace and class. Add global MonoMethodDesc, and parse it from command line args. Leave TODO print statement in mono_jit_compile_method_inner.

* Move mono_method_desc to mini-runtime header. Fix whitespace.

* Cherry pick @KyleMarkland 's changes, and resolve merge conflicts.

* Fix leak. Give better error message when parsing empty method name.

* Move freeing of mono_stats_method_desc.

Co-authored-by: KyleMarkland <[email protected]>

* Add a conditional to transform.c to enable stat dumping from the interpreter. (#18540)

* [mini] Use g_printerr instead of g_printf before exiting (#18574)

* Rename g_printf -> g_print

* Use g_printerr on errors instead of g_printf.

* Pass NULL to mono_counters_dump. Revert g_printf to g_print.

* Update manpage

* Feedback

Co-authored-by: rgarc <[email protected]>
Co-authored-by: KyleMarkland <[email protected]>
2020-02-03 16:05:06 -05:00
Vlad Brezae 01b2e15c06 [tests] Reenable enum equals test on interpreter (#18673)
Fixed by https://github.com/mono/mono/commit/9ea350ed3c963c77f0f4f77ec590cc3c84773424
2020-02-03 07:54:10 -08:00
Ryan Lucia 0f47ea5d80 [build] Check for Python 3 in configure.ac (#18625)
I fear this causing packaging problems, but as-is we require Python 3 for most of our Python files but don't actually check for that in configure. We should be consistent about this. Some projects (notably wasm) also use the Python version detected here, so bumping this will also bump the version used in those cases (a good thing, since there are some known bugs when using the scripts with Python 2).
2020-02-03 08:45:49 -05:00
monojenkinsandVlad Brezae 9ea350ed3c [interp] Fix enum constrained calls on netcore (#18659)
We were failing to dereference a managed pointer to the enum, due to incorrect checks, when doing a constrained call.

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

Co-authored-by: Vlad Brezae <[email protected]>
2020-02-03 03:08:15 -08:00
Phil Jaenke 20a641e4a0 Fix ppc64 build by fixing -mminimal-toc more correctly. (#18665)
The original fix back at #18554 did not work quite right, which was missed for lack of CI.
Reworked this check to instead test for `-mminimal-toc` on all powerpc hosts, and to only do the ELF version check on FreeBSD.

Fixes #18554 #18578 current CI build failures on AIX
2020-02-03 11:16:33 +01:00
Alex Thibodeau 050340ef1a Adjust mono_class_init_internal to no longer bypass cleanup when a failure is detected. (#18649)
This fixes: https://issuetracker.unity3d.com/issues/unity-physics-collisions-do-not-work-and-errors-are-thrown-when-entering-play-mode
2020-02-02 11:29:57 -05:00
imhameed 4bed68d073 [llvm] Enable jump threading with LLVM JIT. (#18655)
See https://github.com/mono/mono/issues/16243. This will allow elision
of redundant bounds checks. This pass is already used during AOT (as
part of opt -O2).
2020-02-02 01:18:31 -05:00
Fan Yang 3a93ebd6fe Abort cmov optimization, when one of the out blocks is try block (#18626) 2020-01-31 16:40:47 -05:00
mdh1418 9ea6b6a58a [wam] Rename other .stamp-build-debug-sample to debug_sample/dotnet.js (#18653) 2020-01-31 16:34:12 -05:00
Zoltan Varga 2a92593837 [wasm] Bump emscripten to 1.39.6. (#18641) 2020-01-31 13:18:11 -05:00
Zoltan Varga a475b84a3e [aot] Add support for making direct cross-assembly calls in llvm mode. (#18505)
* [aot] Handle '|' during symbol mangling.

* [aot] Clean up the construction of the linker command line.

* [aot] Pass -Wl,-install_name to the linker on osx, otherwise the shared object will be named based on the output file name i.e. <assembly>.dylib.tmp.

* [llvm] Pass the MonoAotFileInfo pointer to the init functions, not used yet.

* [jit] Add support for direct calls between methods in different AOT images in LLVM mode.

* Add a 'direct-extern-calls' AOT option.
* Initialize the PLT/GOT during method initialization,
  this normally happens in load_method () but that is
  not called when a method is directly called.
* Add self initialization support for JITted methods, they can be
  called directly since they are fallbacks if LLVM fails.

* Fix the build.

* Avoid calling BeginInvoke etc. directly, its implemented by the runtime.

* Unify some cases.

* Init PLT at image load time since directly called methods without initializers might make calls through it.

* Fix a startup problem.

* Make the mono_is_corlib_image () check for during startup.

* Check for is_inited in the init icall wrappers, since they might be called from JITted code which doesn't check it.

* Address review comments.
2020-01-31 11:41:49 -05:00
Zoltan Varga 4ef40a91ed [jit] Avoid generating wbarriers for vtype stores to the stack. (#18556)
The existing heuristic doesn't work with llvm.
2020-01-31 09:54:32 -05:00
Zoltan Varga a6707bfeb9 [wasm] Remove .stamp-build-debug-sample, use the output file instead. (#18644) 2020-01-31 01:21:21 -05:00
Zoltan Varga 745c8ff20b [wasm] Avoid overwriting emcc flags when SIMD is enabled. (#18643) 2020-01-31 01:13:17 -05:00
Johan Lorensson 1a2c433b7c Move generic_class_init out of line to assist branch prediction. (#18497)
When calling a generic class we need to make sure it has been inited.
This is done by calling generic_class_init. Since this call happens
frequently, but will only run once, it should be put out of line, assisting
branch predictor, preventing misspredictions (in all places but the first).

Currently this is not the case, since we will generate code like this:

0000000000000484: cmp         byte ptr [rcx+2Dh],0
0000000000000488: jne         000000000000048F
000000000000048A: call        p_3_plt_EmptyGame__jit_icall_mono_generic_class_init_llvm
000000000000048F: mov         rax,qword ptr [mono_aot_EmptyGame_llvm_got+0C8h]

Where we will always (except for first call) take the forward branch.

Instead we should mark the call to the method as out of line, at least
giving the code generator the information so it can move it out of line
and preventing a jmp, unless when it needs to init, the slow path. Doing
that will generate the following code:

0000000000000484: cmp         byte ptr [rcx+2Dh],0
0000000000000488: je          00000000000004C1
000000000000048A: mov         rax,qword ptr [mono_aot_EmptyGame_llvm_got+0C8h]
...
00000000000004C1: call        p_3_plt_EmptyGame__jit_icall_mono_generic_class_init_llvm
00000000000004C6: jmp         000000000000048A
2020-01-31 00:39:37 -05:00
monojenkinsandZoltan Varga 1317cf06da [aot] Fix some races if GOT entries are already set. (#18636)
decode_patch_info () would not decode patches if their corresponding GOT entry
was already set, causing half initialized MonoJumpInfo entries to be returned
to callers. Set the type of the MonoJumpInfo entry to MONO_PATCH_INFO_NONE
in these cases, and have the callers handle it.

Co-authored-by: Zoltan Varga <[email protected]>
2020-01-30 17:12:54 -05:00
monojenkinsandZoltan Varga 04c01efd49 [jit] Add a 'top-runtime-invoke-unhandled' option to treat exceptions which reach the top invoke frame as unhandled when embedding. (#18610)
This is not really a MONO_DEBUG option, but easier to implement it this way.

Co-authored-by: Zoltan Varga <[email protected]>
2020-01-30 15:59:30 -05:00
mdh1418 109a61227c [mono] Prevent direct MonoClass field access (#18634)
* [wasm] Add --enable-checked-build=private_types configure option to disable direct access of MonoClass fields.

* [mono] Indirectly access MonoClass fields
2020-01-30 15:57:55 -05:00
monojenkinsandZoltan Varga 4e90bb7e69 [wasm] Fix mono_vfree (). (#18632)
Co-authored-by: Zoltan Varga <[email protected]>
2020-01-30 13:28:51 -05:00
Steve Pfister e0fcb6093b [wasm][debugger] Cancel Existing Single Step Request When Creating New (#18608)
When stepping out of a c# breakpoint into the runtime (or JS... Not sure if that's accurate),
multiple single step requests can be created when the breakpoint is hit again.  In order to handle this scenario for wasm,
we just cancel the existing one.

NOTE: The debugger args addition seemed a better way to handle this than outright canceling in debugger-engine. If there
are implications to doing this, I can take it out.
2020-01-30 15:19:31 +01:00
Ryan Lucia e3624d356b [wasm] Finish renaming mono.js to dotnet.js (#18623)
This work mostly happened a while back, but this commit finishes the job.
2020-01-29 23:47:46 -05:00
Ryan Lucia cf5204021b [wasm] README updates (#18624)
Use -j with all example make invocations, mention Ninja dependency, mention raising ulimit, recommend py3 for running the server (when using py2, the port isn't properly released).
2020-01-29 23:47:28 -05:00
Larry Ewing b4cfcd5c5e Merge pull request #18602 from lewing/wasm-debug-inspect
[wasm][debugger] Initial support for proxying flat sessions
2020-01-29 17:05:43 -06:00
Alexander Köplinger 5e3e34220c [corlib] Split corlib xunit tests even more for iOS (#18619)
Follow-up to https://github.com/mono/mono/pull/18228 since two parts wasn't enough to fix the size issue on 32bits devices.
We now use three parts.

Fixes https://github.com/mono/mono/issues/18614
2020-01-29 21:28:06 +01:00
Aleksey Kliger (λgeek) 81f184c2ad [merp] MONO_DEBUG=no-gdb-stacktrace shouldn't disable MERP (#18567)
* [merp] MONO_DEBUG=no-gdb-stacktrace shouldn't disable MERP

Only prevent `gdb` or `lldb` from being invoked.

MERP is controlled by separate mechanisms --- configure flags for crash
reporting and an explicit opt-in icall.

The existing code collects crashed process data in-process, but it writes the
data out (using mono_merp_invoke) in the forked child process.  This is a bit
surprising, but in the interest of not disturbing the code too much, this PR
doesn't change that.  We should revisit `dump_native_stacktrace` again in the
future and rationalize these decisions.

Addresses https://github.com/mono/mono/issues/18565
2020-01-29 10:03:25 -05:00
Vlad Brezae 60b28b3b56 [interp] Fix virtual calls in mixed mode (#18526)
* [interp] Enable virtual calls to compiled code

If we have an aot-ed version of a method we should always go through it, because the IL for that method could be stripped.

* [interp] Disable jit call for wrappers

Some generic wrappers don't seem to work in mixed mode, probably due to the fact that the transition already reuses a gshared wrapper.
2020-01-29 00:01:58 -08:00
Larry Ewing c75a1364c5 [wasm][debugger] use PdbReaderProvider helper to try to load more pdb forms 2020-01-28 22:32:53 -06:00
Larry Ewing c6e9369de2 Merge remote-tracking branch 'upstream/master' into checkpoint 2020-01-28 22:17:07 -06:00
Larry Ewing edfe20ffc7 [wasm][debugger] start reworking logging logic 2020-01-28 18:53:36 -06:00
Larry Ewing 0fe46d8d35 [wasm] simplify EndOfMessage case 2020-01-28 18:53:36 -06:00
Larry Ewing a6ebd5cb38 Rename Ws* to something more reasonable 2020-01-28 18:53:27 -06:00
Egor Bogatov 883162e861 Use memmove in Buffer.MemoryCopy (#18547)
* Use memmove in Buffer.MemoryCopy

* add test case
2020-01-28 20:00:30 +01:00
Martin Baulig 7d2924adcb [wasm][debugger-proxy]: If we cannot load a PDB file, send a log entry. (#18601) 2020-01-28 12:31:50 -05:00
Nikita Voronchev e2b632e4a7 [WinForms] Incorrect Tree Nodes drawing at the OwnerDrawText mode (#18605)
Assume we have the following form `MyForm`:
```
using System;
using System.Drawing;
using System.Windows.Forms;

namespace test_TreeView
{
    public class MyForm : Form
    {
        TreeView treeView = new TreeView()

        public MyForm()
        {
            treeView.Nodes.Add("root node");
            treeView.Nodes[0].Nodes.Add("first child node");

            treeView.BackColor = Color.Gray;
            treeView.LineColor = Color.Yellow;

            treeView.DrawMode = TreeViewDrawMode.OwnerDrawText;
            treeView.DrawNode += treeView_DrawNode;

            Controls.Add(treeView);
        }

        private void treeView_DrawNode(object sender, DrawTreeNodeEventArgs e)
        {
            var brush = new SolidBrush(Color.FromArgb(100, 255, 0, 0));
            e.Graphics.FillRectangle(brush, e.Bounds);
        }
    }
}
```
The displayed result is
![image](https://user-images.githubusercontent.com/12382656/73263417-92872980-41e1-11ea-8f7c-7cecbb376b60.png)
One can see couple drawing issues:
* White rectangles under each `TreeNode`.
* The area of custom drawing (red rectangles) is shifted with respect to this white rectangles.

Current PR proposes the fix of this issues.
Co-authored-by: monojenkins <[email protected]>
2020-01-28 16:38:27 +01:00
Karl 1bfd317362 [Winforms] Form fixes (#18427)
* Fix Return handling. Ensure correct ClientSize.

When pressing Return / Enter, ensure any target button is both visible
and enabled.

In CreateHandle(), ensure the ClientSize is correct if set. If not,
update it to make it right. Suspend layout while changing it so that
child controls with anchors other than Top Left are not moved.

* Select active control. PerformLayout after updating for client size.

Select the active control with SendControlFocus to avoid upsetting what
is currently selected.

* Improve Form window decoration adjustment handling

Reverts the incorrect attempted fix contained in previous commits.

Basically, when a property is changed that affects window decorations,
ensure the client size stays the same.

* Use UpdateFormStyles on FormBorderStyle too.
2020-01-28 16:32:51 +01:00
Karl 2fdafcf3a4 Don't select ListBox item if SelectionMode == None (#18492)
When the user types a letter or digit, KeySearch looks for and selects
an item starting with that character. However, it should not if
SelectionMode is None.
2020-01-28 16:31:18 +01:00
Nikita Voronchevandmonojenkins c191dba87d [WinForms] Make ContextMenuStrip behavior closer to the reference one (#18598)
* [WinForms] Make `ContextMenuStrip` behavior closer to the reference one

* Bump API snapshot submodule

Co-authored-by: monojenkins <[email protected]>
2020-01-28 16:30:46 +01:00
Alexander Köplinger 726a9134c8 Merge pull request #18491 from PreferLinux/RTF+Textbox-work
I've implemented a heap of missing RTF and RichTextBox stuff, and also made some improvements or fixes to various aspects of it. I'm sorry this is so big...

To give an overview of the changes, here's a list:
- Removed the RTF Charcode / Charset handling that wasn't actually used, had a lot of missing functionality and was basically reimplementing character encoding handling, and replaced it with ensuring the correct character encoding is being used (changing when needed).
- Improved RTF handling of objects with object results (process the given object result). Sometimes pictures can be like this.
- Improved line wrapping and alignment
- Added or greatly improved support for:
  - paragraph spacing
  - line spacing
  - paragraph indents (left, right, hanging)
  - tabstops (left, centre, right, decimal)
  - text background colour (like highlighting)
  - superscript / subscript
  - character offset (vertical)
  - text visibility
- Significantly improved RichTextBox RTF generation
- Cache DPI, rather than doing `CreateGraphics()` every time it is needed
- A variety of other fixes and improvements, with a few I can think of relating to:
  - caret position
  - replacing text
  - invalidation and drawing
  - when tags are added or deleted
2020-01-28 16:26:36 +01:00
monojenkins b87c271b6f [csproj] Update project files 2020-01-28 15:26:03 +00:00
monojenkins e4d69eb248 Bump API snapshot submodule 2020-01-28 15:24:53 +00:00
Steve Pfister 4b4b297450 [wasm][debugger] Handle When BreakpointRequest Commands Come Out of Order
BreakpointRequest commands can come out of order and before the runtime is ready (RuntimeReady). A null check for the DebugStore was added to guard against this since these requests seem to be for JS breakpoints. These seem to be able to be safely ignored.

Fixes https://github.com/mono/mono/issues/18584
2020-01-28 09:57:40 -05:00
Cody Russell a19aaa31da Bump bockbuild for Pango patch (#18566)
Fixes bug #1048838, correct SF font not loading in VSMac
2020-01-28 13:11:04 +01:00
Larry Ewing 4b620fa84d [wasm][debugger] Make the file loading slightly more async 2020-01-27 19:14:38 -06:00
Larry Ewing e1ec438c44 [wasm][debugger] Track the sessionId with all events and commands 2020-01-27 19:14:30 -06:00
Ryan Lucia a5fe7852de [utils] Default to g_print in mono_counters_dump if the stream is NULL (#18582) 2020-01-27 13:24:53 -05:00
Ryan Lucia f41680e395 [eglib] Use the stdout handler with g_printf (#18581)
This ensures it works properly on Android.
2020-01-27 11:57:11 -05:00
Nikita Voronchev ef05316107 [WinForms] Display caret while click on ComboBox (#18523)
If one click on a `ComboBox` the caret does not appear. This is so because `document.PositionCaret` call hides the caret.
2020-01-27 17:00:33 +01:00
Steffen Kieß 1fd0748362 Fix UnixEncoding.GetBytes() for empty strings (#18520)
Current versions of the mono return a null pointer as address of the first
element for empty arrays, i.e.

    fixed (byte* ptr = new byte[0]) Console.WriteLine (ptr == null);

will print "true". This causes a problem in the UnixEncoding class where it
triggers a check for null pointers. Fix this by allowing null pointers when
the number of elements is zero.
2020-01-27 17:00:16 +01:00
dotnet-maestro[bot] 66ff74a1f3 Update dependencies from https://github.com/dotnet/arcade build 20200126.3 (#18597)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20076.3
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20076.3
2020-01-27 16:53:25 +01:00
felixdoerre 6358345667 Fix open port for X11 applications (#18583)
Whenever mono opens an X11 window, the application opens a tcp socket for controlling the (non-tcp)-connection to X11. This is bad practice, as a tcp socket is not needed.

This pull request cleans the logic, by replacing the tcp socket with a fifo. That way this loopback connection is not visible from outside the .NET application, and all logic surrounding it should remain unchanged.
2020-01-27 14:32:15 +01:00
Karl ba3b6a169b [Winforms] X11 Fix bounds change from within bounds-related events (#18513)
The real change here is, in `XplatUIX11.SetWindowPos()`, simply moving the `SendMessage` call to the end instead of earlier. The problem with it earlier is that any change in bounds from any of the bounds-related events (OnLocationChanged / OnMove, OnSizeChanged / OnResize, OnLayout, OnClientSizeChanged) will be overridden. When `SendMessage` is called, `UpdateBounds` is run, and that raises those events as relevant. After those events finish, `SetWindowPos` continues with setting the size of the window to the value originally specified – which is now potentially wrong. So send the message later on.

There is also no point that I can see in writing the values to `hwnd` twice, because as far as I can see the only one that can be changed is `hwnd.ClientRect` (set by `PerformNCCalc`).
2020-01-27 13:41:00 +01:00
Adrian 23b8f10cb8 Update locale tables - add Tatar CLDR files tt.xml and tt_RU.xml (Fixes #18524) (#18525)
Fixes #18524

The `tt.xml` and `tt_RU.xml` files were added in CLDR 34: http://cldr.unicode.org/index/downloads/cldr-34

Upgrading to v34 (or the latest v36) introduced a larger number of new cultures.  I went with the smallest change possible to have Tatar added.
2020-01-27 11:46:23 +01:00
Phil Jaenke 58b3ac9ad0 Fix for -mminimal-toc detection, enable BTLS on FreeBSD PowerPC (#18578)
Fixes #18554 by making autoconf actually check if `-mminimal-toc` works instead of assuming on powerpc. Tested with FreeBSD 12.x and 13.x on powerpc64 ELFv2.
While we are in here, also enable BTLS which has passed testing.
2020-01-27 11:20:54 +01:00
Vincent Povirk 21e2ebcb06 Allow passing IntPtr values with UnmanagedType.AsAny. (#18544)
This is used by the SplashScreen class of WindowsBase in .NET Core to pass a NULL pointer.
2020-01-27 11:18:55 +01:00
Pranav K c8516b2848 Remove unused variables (#18579)
These show up as build errors in Blazor when they're copied as sources. Seemed trivial enough to fix.
2020-01-27 11:17:44 +01:00
abrevet-dev ed88c509dd [WinForms] Fix #18506 ActiveTracker, do not propagate message to control when it is not enabled and visible. (#18541)
Fixes #18506
2020-01-27 11:07:58 +01:00
Ankit Jain a6a89a5ef4 [master] Bump msbuild to track xplat-master (#18575) 2020-01-27 11:00:26 +01:00
Jérôme Laban d23da5628e [Wasm] Fix threading support file in packager (#18593) 2020-01-26 22:42:52 -05:00
monojenkinsandZoltan Varga c9a97e5258 [runtime] Disable lldb backtrace display on osx, it hangs on attaching in lldb. (#18590)
Co-authored-by: Zoltan Varga <[email protected]>
2020-01-26 14:31:07 -05:00
Thays GraziaandAleksey Kliger f8c34dc56b [debugger] Access invalid memory address using PointerValue Command. (#18537)
* Validate the address that came from IDE using PointerValue. The IDE can send an invalid address and it was crashing mono.

Fixes #18191
Fixes #15612

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
2020-01-26 00:00:41 -03:00
Maher Jendoubi 4704c85c9d Fix typos (#18585)
* Contributing: fix typos

* fixed encoding and other typos

* fixed encoding and spotted other typos

* Update TransformationRules.cs
2020-01-25 19:55:22 +01:00
Zoltan Varga 9fc4cae875 [jit] Compute has_references correctly for gshared types whose constraint is a generic valuetype. (#18552)
Also emit write barriers correctly for these types.
2020-01-25 09:20:31 -05:00
Zoltan Varga 9e377af674 [wasm] Fix netcore build. (#18564)
* [wasm] Fix netcore build.

Add a DOTNET_REPO_DIR variable to Make.config which should point to the dotnet/runtime repo. Compile
the netcore runtime and corelib from this repo.

* Disable wasm+netcore on CI.
2020-01-25 06:29:58 -05:00
monojenkinsandZoltan Varga 653db97098 [runtime] Avoid loading ThreadAbortException class on netcore. (#18563)
Co-authored-by: Zoltan Varga <[email protected]>
2020-01-24 20:13:10 -05:00
Phil Jaenke 85b34350c6 Fix for failing compile-runtime-tests (#18569)
compile-runtime-tests is looking for python3, but $(env python3) will return error (no `/usr/local/bin/python3`); if this is the case, create a symlink from 3.6 or 3.7 to /usr/local/bin/python3 so it works. We already have this listed in `SHEBANG_FILES` for the port.
2020-01-24 18:16:44 -05:00
monojenkinsandZoltan Varga 0215d2e331 Initial CMAKE build system support. (#18561)
Co-authored-by: Zoltan Varga <[email protected]>
2020-01-24 17:00:49 -05:00
Radek Doulik 14570f14ac [aprofutil] Update the tool name 2020-01-24 10:04:02 +01:00
mdh1418 ae9335ac21 [mcs] Fix support for digit separators (#18539)
* [mcs] skip "_" when building number

* [mcs] Refactor digit separator feature report

* [mcs] Clean up digit separator code

* [mcs] Throw errors for invalid digit separator usage

* [mcs] Fix hex and bin usage of digit separator tests

* [mcs] Add digit separator usages that throw errors

* [mcs] Update il
2020-01-24 09:18:32 +01:00
Jay Krell 8d69965919 Remove "handles" from System.Threading.Semaphore. (#18512)
Actually, there were no handles.
This reduces MonoError.
2020-01-23 13:58:39 -05:00
monojenkinsandYoussef Victor 05da2da407 Fix typos (#18546)
Found more occurrences of the typos in dotnet/runtime#2061

The work done here is made by simple search & replace.

I'll point to replaces that needs attention in a review.

Co-authored-by: Youssef Victor <[email protected]>
2020-01-23 19:40:58 +01:00
Ankit Jain cc6e927d10 [bockbuild] preinstall: kill any running VBCSCompiler processes (#18488)
- roslyn's shared compiler server hashes it's pipename on the path to
the assembly.
- On macOS, this looks like `/Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/msbuild/Current/bin/Roslyn/VBCSCompiler.exe`
- When installing a new mono, with that same `x.y.z` version, this
process will effectively be out of sync with the new updated
mono/msbuild/roslyn
- This manifests as:

```
  Using shared compilation with compiler from directory: /Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/msbuild/Current/bin/Roslyn
  /Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/msbuild/Current/bin/Roslyn/Microsoft.CSharp.Core.targets(59,5): error : Roslyn compiler server reports different hash version than build task. [/Users/builder/azdo/_work/3/s/xamarin-android/build-tools/xaprepare/xaprepare/xaprepare.csproj]
```

- See https://github.com/xamarin/xamarin-android/pull/4108

- So, we kill any running roslyn shared compiler servers
2020-01-23 19:34:26 +01:00
Thays Grazia 6b475d5d00 [debugger] Native thread not executing managed code considered as terminated (#18501)
* If a thread was suspended and doesn't have any managed stack, it was considered as terminated, but it wasn't really terminated because it can execute managed code again, and stop in a breakpoint so if the execution arrives in debugger_agent_breakpoint_from_context we reset the flag terminated to FALSE.

* Adding terminated = FALSE in single_step_from_context.
2020-01-23 12:41:10 -03:00
Fan Yang 4d9832a399 Add disable_omit_fp support for LLVM (#18489)
Fixes #18417
2020-01-23 16:31:14 +01:00
Alexander Köplinger 0f1ac3e5bb Disable netcore mono builds that now live in dotnet/runtime (#18549) 2020-01-23 14:45:10 +01:00
Zoltan VargaandVlad Brezae 4586c4f091 [jit] Compute the instance size/alignment correctly for gshared types whose constraint is a generic valuetype. (#18496)
* [jit] Compute the instance size/alignment correctly for gshared types whose constraint is a generic valuetype.

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

* [jit] Simplify code

Fix some line damage

Co-authored-by: Vlad Brezae <[email protected]>
2020-01-23 07:57:36 -05:00
Bernhard Urban-Forster 082662cc8a [interp] context can be uninitialized for get_resume_state callback (#18533)
`jit_tls->interp_context` gets initialized lazily, that is, upon the first interpreter execution on a specific thread (e.g. via interp_runtime_invoke). However, with mixed mode the execution can purely happen in AOT code upon the first interaction with the managed debugger.

Stack trace:

```
  thread #1, name = 'tid_407', queue = 'com.apple.main-thread'
    frame #0: 0x0000000190aedc94 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000190a0f094 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 672
    frame #2: 0x000000010431318c reloadcontext.iOS`mono_os_cond_wait(cond=0x0000000104b9ba78, mutex=0x0000000104b9ba30) at mono-os-mutex.h:219:8
    frame #3: 0x0000000104312a68 reloadcontext.iOS`mono_coop_cond_wait(cond=0x0000000104b9ba78, mutex=0x0000000104b9ba30) at mono-coop-mutex.h:91:2
    frame #4: 0x0000000104312858 reloadcontext.iOS`suspend_current at debugger-agent.c:3021:4
    frame #5: 0x000000010431be18 reloadcontext.iOS`process_event(event=EVENT_KIND_BREAKPOINT, arg=0x0000000145d09ae8, il_offset=0, ctx=0x0000000149015c20, events=0x0000000000000000, suspend_policy=2) at debugger-agent.c:4058:3
    frame #6: 0x0000000104310cf4 reloadcontext.iOS`process_breakpoint_events(_evts=0x000000028351a680, method=0x0000000145d09ae8, ctx=0x0000000149015c20, il_offset=0) at debugger-agent.c:4722:3
    frame #7: 0x000000010432f1c8 reloadcontext.iOS`mono_de_process_breakpoint(void_tls=0x0000000149014e00, from_signal=0) at debugger-engine.c:1141:2
    frame #8: 0x000000010430f238 reloadcontext.iOS`debugger_agent_breakpoint_from_context(ctx=0x000000016f656790) at debugger-agent.c:4938:2
    frame #9: 0x00000001011b73a4 reloadcontext.iOS`sdb_breakpoint_trampoline + 148
    frame #10: 0x00000001008511b4 reloadcontext.iOS`reloadcontext_iOS_Application_Main_string__(args=0x000000010703a030) at Main.cs:14
    frame #11: 0x00000001010f9730 reloadcontext.iOS`wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 272
    frame #12: 0x00000001042fd8b8 reloadcontext.iOS`mono_jit_runtime_invoke(method=0x0000000145d09ae8, obj=0x0000000000000000, params=0x000000016f656f20, exc=0x0000000000000000, error=0x000000016f656ff8) at mini-runtime.c:3162:3
    frame #13: 0x0000000104411950 reloadcontext.iOS`do_runtime_invoke(method=0x0000000145d09ae8, obj=0x0000000000000000, params=0x000000016f656f20, exc=0x0000000000000000, error=0x000000016f656ff8) at object.c:3052:11
    frame #14: 0x000000010440c4dc reloadcontext.iOS`mono_runtime_invoke_checked(method=0x0000000145d09ae8, obj=0x0000000000000000, params=0x000000016f656f20, error=0x000000016f656ff8) at object.c:3220:9
    frame #15: 0x0000000104415ae0 reloadcontext.iOS`do_exec_main_checked(method=0x0000000145d09ae8, args=0x000000010703a030, error=0x000000016f656ff8) at object.c:5184:3
    frame #16: 0x00000001044144ac reloadcontext.iOS`mono_runtime_exec_main_checked(method=0x0000000145d09ae8, args=0x000000010703a030, error=0x000000016f656ff8) at object.c:5281:9
    frame #17: 0x0000000104414500 reloadcontext.iOS`mono_runtime_run_main_checked(method=0x0000000145d09ae8, argc=1, argv=0x000000016f6570d0, error=0x000000016f656ff8) at object.c:4734:9
    frame #18: 0x00000001042d3b54 reloadcontext.iOS`mono_jit_exec_internal(domain=0x0000000145f00130, assembly=0x0000000281ba2900, argc=1, argv=0x000000016f6570d0) at driver.c:1320:13
    frame #19: 0x00000001042d39a4 reloadcontext.iOS`mono_jit_exec(domain=0x0000000145f00130, assembly=0x0000000281ba2900, argc=1, argv=0x000000016f6570d0) at driver.c:1265:7
    frame #20: 0x0000000104597994 reloadcontext.iOS`::xamarin_main(argc=5, argv=0x000000016f657a80, launch_mode=XamarinLaunchModeApp) at monotouch-main.m:483:8
    frame #21: 0x00000001008510dc reloadcontext.iOS`main(argc=5, argv=0x000000016f657a80) at main.m:104:11
    frame #22: 0x0000000190af8360 libdyld.dylib`start + 4
[...]
* thread #5, name = 'Debugger agent', stop reason = signal SIGABRT
  * frame #0: 0x0000000190aedec4 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x0000000190a0d724 libsystem_pthread.dylib`pthread_kill$VARIANT$armv81 + 216
    frame #2: 0x000000019095d844 libsystem_c.dylib`abort + 100
    frame #3: 0x00000001045871b4 reloadcontext.iOS`log_callback(log_domain=0x0000000000000000, log_level="error", message="* Assertion at ../../../../../mono/mini/interp/interp.c:7176, condition `context' not met\n", fatal=4, user_data=0x0000000000000000) at runtime.m:1213:3
    frame #4: 0x0000000104544fc8 reloadcontext.iOS`eglib_log_adapter(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, message="* Assertion at ../../../../../mono/mini/interp/interp.c:7176, condition `context' not met\n", user_data=0x0000000000000000) at mono-logger.c:405:2
    frame #5: 0x000000010456093c reloadcontext.iOS`monoeg_g_logstr(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, msg="* Assertion at ../../../../../mono/mini/interp/interp.c:7176, condition `context' not met\n") at goutput.c:134:2
    frame #6: 0x0000000104560598 reloadcontext.iOS`monoeg_g_logv_nofree(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, format="* Assertion at %s:%d, condition `%s' not met\n", args="e\x12z\x04\x01") at goutput.c:149:2
    frame #7: 0x000000010456061c reloadcontext.iOS`monoeg_assertion_message(format="* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:184:22
    frame #8: 0x0000000104560674 reloadcontext.iOS`mono_assertion_message(file="../../../../../mono/mini/interp/interp.c", line=7176, condition="context") at goutput.c:203:2
    frame #9: 0x000000010459b570 reloadcontext.iOS`interp_get_resume_state(jit_tls=0x000000014900d000, has_resume_state=0x000000016fc7a9f4, interp_frame=0x000000016fc7a9e8, handler_ip=0x000000016fc7a9e0) at interp.c:7176:2
    frame #10: 0x0000000104319420 reloadcontext.iOS`compute_frame_info(thread=0x0000000104fe4130, tls=0x0000000149014e00, force_update=1) at debugger-agent.c:3422:3
    frame #11: 0x0000000104320d40 reloadcontext.iOS`thread_commands(command=1, p="", end="", buf=0x000000016fc7acf8) at debugger-agent.c:9048:3
    frame #12: 0x000000010431cca0 reloadcontext.iOS`debugger_thread(arg=0x0000000000000000) at debugger-agent.c:10132:10
    frame #13: 0x000000010447eb04 reloadcontext.iOS`start_wrapper_internal(start_info=0x0000000000000000, stack_ptr=0x000000016fc7b000) at threads.c:1232:3
    frame #14: 0x000000010447e788 reloadcontext.iOS`start_wrapper(data=0x000000028203ef40) at threads.c:1305:8
    frame #15: 0x0000000190a11d8c libsystem_pthread.dylib`_pthread_start + 15
[...]
```

Thanks to @drasticactions for helping me to reproduce.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1050615
2020-01-23 13:52:15 +01:00
dotnet-maestro[bot] 4321ba1e3b Update dependencies from https://github.com/dotnet/arcade build 20200118.1 (#18514)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20068.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20068.1
2020-01-23 10:34:41 +01:00
Alexander Köplinger a6f2903d58 configure.ac: remove AC_SEARCH_LIBS for libintl (#18531)
This causes an additional dependency of mono on libintl which we didn't have before.
Reported by a user on gitter, it's problematic on macOS since it makes the mono binary depend on the libintl we ship in the Mono .pkg.

It was introduced in Mono 6.6 by https://github.com/mono/mono/commit/18e0ebfe89be0a175d2f904b9bb1ec6816daa318
2020-01-23 00:29:56 +01:00
Alexander Köplinger b278d88a5f configure.ac: Don't look for X11 in netcore mode 2020-01-22 21:23:54 +01:00
Karl 3d168887a6 Store the current encoding code page, not encoding
The encoding itself could be null, while encoding_code_page
should always be valid.
2020-01-21 10:09:20 +13:00
Karl ff0605fe18 Use correct default encoding. 2020-01-21 10:04:57 +13:00
Karl d826bebd54 Calculate DPI before Recalculate. 2020-01-18 17:11:13 +13:00
Karl f39d652642 Fix NullReferenceException when parsing RTF.
charset_stack was never initialised.
2020-01-18 16:51:32 +13:00
Cody Russell c4aa327737 Bump bockbuild to get GTK NSPasteboardType change. (#18080) 2020-01-17 19:32:26 +01:00
Nikolay Sivov 0a96741f93 Compilation warnings fixes (#18495)
Compilation warnings fixes
2020-01-17 14:16:03 +01:00
Vlad Brezae 92bddddd7b [tests] Re-enable profiler test that used to fail (#18471)
It is not clear if it will fail again or not, but it is not reproducible.

Closes https://github.com/mono/mono/issues/8709
2020-01-17 13:10:59 +01:00
Bernhard Urban-Forster 73eeda130f [prof] remove wrong cast for format string (#18477)
[prof] remove wrong cast for format string

Fixes this warning:
```
  CC       mprof-report.o
mprof-report.c:408:62: warning: format specifies type 'char *' but the argument has type 'guint64' (aka 'unsigned long long') [-Wformat]
                        snprintf (format, sizeof (format), "%s : %%" PRIu64 "\n", (guint64)key_format);
                                                            ~~                    ^~~~~~~~~~~~~~~~~~~
                                                            %llu
/Applications/Xcode112.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:57:62: note: expanded from macro
      'snprintf'
  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                             ^~~~~~~~~~~
```

mistake in refactoring commit https://github.com/mono/mono/commit/07402062541fa9555bef99dbaac84cfb587926cd#diff-c825627ea9ddb3fa753fa3617eaec7c8R408
2020-01-17 11:05:50 +01:00
Aleksey Kliger (λgeek) 1f0e147cdd [netcore] Mark InitializeCurrentThread NoInlining (#18493)
Follow-up for https://github.com/mono/mono/pull/18480

We might want to replace calls to this with an intrinsic
2020-01-17 10:43:05 +01:00
monojenkins ed6a63bb25 [bcl] Update BCL Linked Size 2020-01-17 10:01:30 +01:00
Bernhard Urban-Forster b4c506c304 [runtime] fix warnings on linux (gcc 8.3.0) (#18479)
* [aot] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
aot-compiler.c: In function ‘emit_trampolines’:
aot-compiler.c:7675:28: warning: ‘_e’ directive writing 2 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
    sprintf (end_symbol, "%s_e", symbol);
                            ^~
aot-compiler.c:7675:4: note: ‘sprintf’ output between 3 and 258 bytes into a destination of size 256
    sprintf (end_symbol, "%s_e", symbol);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At top level:
aot-compiler.c:753:1: warning: ‘link_shared_library’ defined but not used [-Wunused-function]
 link_shared_library (MonoAotCompile *acfg)
 ^~~~~~~~~~~~~~~~~~~
aot-compiler.c:558:1: warning: ‘mangle_symbol_alloc’ defined but not used [-Wunused-function]
 mangle_symbol_alloc (const char * symbol)
 ^~~~~~~~~~~~~~~~~~~
aot-compiler.c:535:1: warning: ‘mangle_symbol’ defined but not used [-Wunused-function]
 mangle_symbol (const char * symbol, char * mangled_symbol, gsize length)
 ^~~~~~~~~~~~~~~~~~~
```

* [amd64] fix warnings on linux (gcc 8.3.0)

Fixes this warning:
```
tramp-amd64.c: In function ‘mono_arch_create_generic_trampoline’:
tramp-amd64.c:242:65: warning: variable ‘ex_offset’ set but not used [-Wunused-but-set-variable]
  int i, lmf_offset, offset, res_offset, arg_offset, rax_offset, ex_offset, tramp_offset, ctx_offset, saved_regs_offset;
                                                                 ^~~~~~~~~
```

* [lldb] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
lldb.c:243:1: warning: ‘buffer_add_buffer’ defined but not used [-Wunused-function]
 buffer_add_buffer (Buffer *buf, Buffer *data)
 ^~~~~~~~~~~~~~~~~
lldb.c:215:1: warning: ‘buffer_add_id’ defined but not used [-Wunused-function]
 buffer_add_id (Buffer *buf, int id)
 ^~~~~~~~~~~~~
lldb.c:208:1: warning: ‘buffer_add_long’ defined but not used [-Wunused-function]
 buffer_add_long (Buffer *buf, guint64 l)
 ^~~~~~~~~~~~~~~
lldb.c:188:1: warning: ‘buffer_add_short’ defined but not used [-Wunused-function]
 buffer_add_short (Buffer *buf, guint32 val)
 ^~~~~~~~~~~~~~~~

```

* [interp] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
interp/interp.c:3425:1: warning: ‘g_error_xsx’ defined but not used [-Wunused-function]
 g_error_xsx (const char *format, int x1, const char *s, int x2)
 ^~~~~~~~~~~
  CC       interp/libmono_ee_interp_la-mintops.lo
  CC       interp/libmono_ee_interp_la-transform.lo
  CCLD     libmono-ee-interp.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       libmono_dbg_la-debugger-agent.lo
  CC       libmono_dbg_la-debugger-state-machine.lo
  CC       libmono_dbg_la-debugger-engine.lo
  CCLD     libmono-dbg.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     mono-sgen
  AR       libmain.a
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       interp/libmaintest_a-whitebox.o
In file included from interp/whitebox.c:3:
interp/transform.h:163:12: warning: ‘stack_type’ defined but not used [-Wunused-variable]
 static int stack_type [] = {
            ^~~~~~~~~~
interp/transform.h:155:20: warning: ‘stack_type_string’ defined but not used [-Wunused-variable]
 static const char *stack_type_string [] = { "I4", "I8", "R4", "R8", "O ", "VT", "MP", "F " };
                    ^~~~~~~~~~~~~~~~~

```

* [thread state] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
  CC       libmonoutils_la-mono-threads-state-machine.lo
mono-threads-state-machine.c:33:1: warning: ‘get_thread_no_safepoints’ defined but not used [-Wunused-function]
 get_thread_no_safepoints (int thread_state)
 ^~~~~~~~~~~~~~~~~~~~~~~~
mono-threads-state-machine.c:26:1: warning: ‘get_thread_suspend_count’ defined but not used [-Wunused-function]
 get_thread_suspend_count (int thread_state)
 ^~~~~~~~~~~~~~~~~~~~~~~~
```

* [domain] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
appdomain.c:2415:1: warning: ‘get_app_context_base_directory’ defined but not used [-Wunused-function]
 get_app_context_base_directory (MonoError *error)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       libmonoruntimesgen_la-assembly-load-context.lo
  CC       libmonoruntimesgen_la-domain.lo
domain.c:135:1: warning: ‘mono_domain_alcs_lock’ declared ‘static’ but never defined [-Wunused-function]
 mono_domain_alcs_lock (MonoDomain *domain);
 ^~~~~~~~~~~~~~~~~~~~~
domain.c:138:1: warning: ‘mono_domain_alcs_unlock’ declared ‘static’ but never defined [-Wunused-function]
 mono_domain_alcs_unlock (MonoDomain *domain);
 ^~~~~~~~~~~~~~~~~~~~~~~
domain.c:2129:1: warning: ‘mono_alc_free’ defined but not used [-Wunused-function]
 mono_alc_free (MonoAssemblyLoadContext *alc)
 ^~~~~~~~~~~~~
domain.c:2108:1: warning: ‘mono_domain_create_default_alc’ defined but not used [-Wunused-function]
 mono_domain_create_default_alc (MonoDomain *domain)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
domain.c:2084:1: warning: ‘create_alc’ defined but not used [-Wunused-function]
 create_alc (MonoDomain *domain, gboolean is_default)
 ^~~~~~~~~~

```

* [native library] fix warnings on linux (gcc 8.3.0)

Fixes this warning:
```
  CC       libmonoruntimesgen_la-native-library.lo
native-library.c:295:1: warning: ‘mono_loader_register_module_locking’ defined but not used [-Wunused-function]
 mono_loader_register_module_locking (const char *name, MonoDl *module)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

* [sample] fix warnings on linux (gcc 8.3.0)

Fixes this warning:
```
  CC       libtestlib_la-test-mono-embed.lo
In file included from test-mono-embed.c:7:
../../samples/embed/teste.c:20:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 gimme () {
 ^~~~~

```

* fix for checked builds
2020-01-17 09:36:32 +01:00
Aleksey Kliger (λgeek) c1498b8d4c [runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread (#18480)
* [runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread

This function (and its call to mono_handle_new) was showing up in the
flamegraph for some async-heavy benchmarks
2020-01-16 21:57:54 -05:00
Aleksey Kliger (λgeek) 2ba25542e3 [interp] Add missing files to tarball (#18482) 2020-01-16 19:27:23 -05:00
Thays Grazia e2d8f5ee91 Revert "On android sometimes there is no valid_info but the ctx is valid and the debug can continue. (#18463)" (#18490)
This reverts commit 61894d4a07.
2020-01-16 17:23:58 -05:00
Alexander Köplinger e4552f54fb Bump xsp to fix issues with removed Mono.Security APIs (#18478)
See https://github.com/mono/xsp/pull/88
2020-01-16 21:49:21 +01:00
Thays Grazia 61894d4a07 On android sometimes there is no valid_info but the ctx is valid and the debug can continue. (#18463)
Fixes #18106
2020-01-16 17:34:22 -03:00
Alexander Köplinger bafdd7865f Bump corefx to disable two tests. (#18464)
HashTableTests.Ctor_Int_Int_GenerateNewPrime and BitConverterTests.ToString_ByteArrayTooLong_Throws allocate a lot of memory and this causes issues on Windows i386 and other platforms.
2020-01-15 23:52:44 +01:00
Bernhard Urban-Forster bdde94b8e2 [arm] account for signed bit when calculating offset to PLT entry (#18454)
[arm] account for signed bit when calculating offset to PLT entry

See `bl` documentation (make sure you look at the thumb2 one):
<img width="1003" alt="Screenshot 2020-01-14 at 22 43 33" src="https://user-images.githubusercontent.com/75403/72385601-2bb53b00-3720-11ea-9858-d73bc2d02a7e.png">


Fixes https://github.com/mono/mono/issues/18247
2020-01-15 18:35:53 +01:00
Aleksey Kliger (λgeek) e7e81a47c9 [loader] ReflectionOnlyLoad(byte[]) should not apply binding redirects (#18457)
* [loader] ReflectionOnlyLoad(byte[]) should not apply binding redirects

Match .NET Framework behavior.

Addresses https://github.com/mono/mono/issues/18388

* [tests] ReflectionOnlyLoad(byte[]) should not apply binding redirects

Regression test for https://github.com/mono/mono/issues/18388
2020-01-15 10:47:27 +01:00
Maher Jendoubi f4567e83dd Contributing: fixing some typos (#18453) 2020-01-14 22:30:06 +01:00
Jay Krell 6eea4a18f0 Reduce some stack use and cleanup. (#17809) 2020-01-14 22:17:00 +01:00
Vlad Brezae fef06df537 [utils] Make sure we include WRAP_ATOMIC_INTRINSIC if needed
Currently, this doesn't impact any targets, but do it for consistency.

Fixes https://github.com/mono/mono/issues/10651
2020-01-14 22:03:48 +01:00
Vlad Brezae 7fb011aa5a [utils] Include missing define of MONO_GNUC_VERSION
We were adding the WRAP_ATOMIC_INTRINSIC all the time on arm64, due to missing MONO_GNUC_VERSION.
2020-01-14 22:03:48 +01:00
Jay Krell 0740206254 Fix many printf warnings (#16484)
* Do not `printf` `long long` or `unsigned long long`.

*Do* printf `gint64` or `guint64`.

Do not printf %ll.
Do not printf %z.

 gint64 ==  int64_t, which could be long, or long long, or maybe other
guint64 == uint64_t, ditto

For printing gint64/guint64, use PRId64, PRIx64, etc.
For printing gsize/gssize, use `G_GSIZE_FORMAT` (seems like excess `G`).

%z definitely would warn for every single use, with Mingw.

And %ll might also, since on 64bit platforms, gint64 tends to be
long, not long long, and would merit %l not %ll.
(No matter that %ll is merited on 32bit, and the behavior
would then be correct on both.).

If there becomes a system w/o PRId64 etc., and it is a 64bit system,
then we could use %l under a portable name.
Or %I64. This appears unlikely (unless reach is extended to older Windows runtime).

Note that PRIxPTR for gsize/intptr_t may be a good idea too.
2020-01-14 22:03:22 +01:00
Ryan Lucia 3b19228a66 [netcore] Implement Thread.GetCurrentProcessorId (#18450)
CoreCLR has a managed cache surrounding this, but for the moment the naive implementation will suffice. We can later move their managed cache to shared on top of this PR with minimal trouble.

We can't guarantee the id will be [0..CpuCount) for a variety of reasons, and a followup PR to the dotnet docs will clarify this. I've chosen not to intentionally add an offset, but no one should be relying on that behavior, and if someone thinks adding an offset would drive the point home the perf cost is irrelevant.
2020-01-14 22:01:13 +01:00
Bernhard Urban-Forster 05f2651a12 [interp] initial infrastructure for whitebox testing of optimization passes (#18268) 2020-01-14 21:59:48 +01:00
Vlad Brezae d9db79b4b2 [sgen] Fixes for max-heap-size option (#18446)
* [sgen] Don't subtract twice the nursery size from max_heap_size

We were subtracting the nursery size when initializing max_heap_size as well as adding it to the allocated_heap when allocating the nursery (alloc_nursery).

* [sgen] Trigger collection if failing to allocate los section

If the memory governor says we are exceeding the max_heap_size by allocating a los section (1MB) for a new los object, attempt to clear some space by triggering a major collection, before completely bailing out.
2020-01-14 11:42:14 -08:00
Jay Krell 5237696f65 [cxx] Make the externC of icalls configuration-dependent instead of always. (#17573)
There are pluses and minuses here:

 + Minimize externC.

 + Maximimze typesafe linkage.

 - Minimize configuration-sensitivity.

 - Maximize commonality across all configurations, so that
   success in one configuration maximally but not 100% implies
   success in others (which is why to avoid `#if` in general,
   to contribute toward compilation success).

 + Use higher level macros to explain reason.
   Even if ICALL_EXTERN_C was always externC (presently not),
   using it instead of plain G_EXTERN_C offers a builtin comment.
2020-01-14 19:28:54 +01:00
Egor Bogatov 08bb5660f6 Optimize typeof(T).IsValueType (#18307)
* Optimize Type.IsValueType

* Ignore gsharedvt types

* use mini_is_gsharedvt_variable_klass

* test

* fix build
2020-01-14 09:37:16 -06:00
Alexander Köplinger 55393c2c9b Add normalized .bat files after the .gitattributes EOL change 2020-01-14 15:52:06 +01:00
Jay Krell c32414966c Remove comment about unexplained C++/LLVM problem. (#18447)
The explanations/fixes were:
 Compile consistently as C++:
   https://github.com/mono/mono/commit/893486638cae8efc46323d6c2209fc99febcd05d

 Make inconsistent compilation safe since it was fragile:
   https://github.com/mono/mono/commit/b2817e6404d573e837e1d8c7e047135974a3b311
2020-01-14 14:20:15 +01:00
Jonathan Chambers 480bef7217 Add mono_gc_thread_detach callback. (#18408)
Add mono_gc_thread_detach callback for Boehm

Use under Boehm to detach without threads lock as Boehm will take it's own lock internally.

Note in `on_gc_notification` we take threads lock after Boehm already has it's own lock. For consistency and to prevent deadlocks always take lock ordering of Boehm then threads lock.
2020-01-14 12:56:09 +01:00
Jay Krell dc866c2aad [cxx] Fixes for all lanes to build as C++ but w/o configure.ac change. (#17452)
* [cxx] dlmalloc remove extern "C" and remove NO_MALLINFO.

* [cxx] Move CallInst bitfields to the end to minimize padding for alignment
and fix an unexplained LLVM problem.
2020-01-14 12:32:08 +01:00
Egor Bogatov f5e1bd3cdf Merge pull request #18293 from EgorBo/vt-gettype-boxing
Optimize boxing for var.GetType()
2020-01-14 14:04:21 +03:00
Zoltan Varga 71a1a84c19 [wasm] Pass --used-attrs-only true to the linker. (#18439) 2020-01-14 09:42:10 +01:00
Alexander Köplinger 53ade46065 [netcore] Fix build warning 2020-01-13 21:27:23 +01:00
Aleksey Kliger (λgeek) 6abab691ec [netcore] Require use of MonoClass getters in Debug builds (#18267)
1. Update `build.sh` to use `--enable-checked-build=private_types` which forces the use of getter methods to access `MonoClass` fields.
2. Fix up some places that were accessing MonoClass directly.
3. Get rid of a spurious comma operator usage from an earlier refactoring:
   ```c
      z = a, b, c;
   ```
   is the same as
   ```c
      z = a; b; c;
   ```
   which is the same as just `z = a;` if `b` and `c` have no side-effects.
2020-01-13 21:15:09 +01:00
Alexander Köplinger a5cc4cd9ec Write version.h for netcore and allow preview VS for msvc builds 2020-01-13 20:47:35 +01:00
Karl 8bd438f318 [Winforms] Calculate GroupBox preferred size the same way as Panel (#18429)
GroupBox's GetPreferredSize() is not great. I've simply copied the code from Panel, and used that. It uses LayoutEngine.GetPreferredSize(), which does things a lot better than the code this used.
2020-01-13 17:15:09 +01:00
Karl 4ee4d368c6 [Winforms] Always draw at least one line of a Label. (#18422)
Previously, if the Label wasn't quite high enough nothing would be drawn as the line didn't quite fit. It should draw the line anyway, clipped if necessary.
2020-01-13 17:12:36 +01:00
Karl 42956f554b [Winforms] Improve X11 keyboard handling. (#18428)
- Ignore key events with vkey == 0. They won't match a real key code so don't try. Besides, trying can cause segfaults on ChromeOS Linux mode.
- Check special-case keys (numpad) before looping to get them. No point leaving them for afterwards...
2020-01-13 17:12:10 +01:00
Karl 7a8242ed36 [Winforms] Don't have non-active controls focused (#18426)
- Make the state of Control.CanSelect depend on whether the control is visible and enabled.
- When setting Control.Visible to false, if this control is focused, move the focus to the next control.
2020-01-13 17:11:38 +01:00
Karl d7e84ac6d1 [Winforms] Implement correct Control.Region / ClipRegion support on X11 (#18421)
Fixes https://xamarin.github.io/bugzilla-archives/20/20233/bug.html

Previously, on Linux, setting Control.Region just set the clipping for painting, but didn't influence the visibility of other controls behind the one it was set on. This implements this correctly via X11 Shape extension.
2020-01-13 17:10:57 +01:00
Maxim Lipnin 87cfaf15ae [netcore] Make System.Diagnostics.TraceSourceTests.DefaultTraceListenerClassTests.EntryAssemblyName_Null_NotIncludedInTrace Pass (#18403)
* [netcore] Extract Assembly.GetEntryAssembly method to shared part
2020-01-13 17:06:55 +01:00
Johan Lorensson 407898621e Make sure .bat and .cmd files have crlf in wd. (#18437)
Looks like https://github.com/mono/mono/commit/c9dc20f59ebe7fbed2a439d69c2d03a2d4500577 broke Windows build for some scenarios using .bat files. Fix makes sure we convert .bat and .cmd files to use crlf in wd.
2020-01-13 15:01:41 +01:00
dotnet-maestro[bot] 49c5101200 Update dependencies from https://github.com/dotnet/arcade build 20200112.1 (#18438)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20062.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20062.1
2020-01-13 15:00:54 +01:00
Egor Bogatov 423192ed85 [netcore][llvm] Implement Sse1-4.2 subsets used by corlib (#18103)
* Implement SSE41 subset used by corlib

* Implement Sse2.MoveMask

* only works with llvm

* Implement Sse3 and Ssse3 subsets used by corlib

* Implement a few SSE1 methods

* Address feedback, also, implement Sse.Add/Subtract

* Fix build

* Implement Sse.Multiply, Sse.Store

* Implement Sse.CompareNotEquals

* Implement Sse.MoveScalar

* Finish SSE1 corlib subset

* Implement Sse.LoadVector128, Sse.Shuffle

* Sse.Shuffle cleanup

* Implement Sse2 APIs

* More of SSE2: LoadAlignedVector128, Compare*

* Implement Sse2.Unpack* and Sse2.StoreScalar

* Implement Sse2.PackUnsignedSaturate

* Implement Sse2.ShiftRightLogical

* Implement Sse2.Shuffle

* Implement Vector128<T>.Zero

* Fix CreateScalarUnsafe

* Implement Vector128.As*, Fix Vector128.CreateScalarUnsafe

* Fix failures

* Fix failures

* Fix Sse.MoveMask

* remove redundant null checks

* Fix AOT failures

* fix compilation warrning

* rename create_vector_mask_*

* Fix failures found via tests

* Index in Sse41.Insert has to be a constant

* add local tests for mono

* Update tests (cleanup)

* Code cleanup

* test

* fix typo

* Clean up

* Clean up

* Implement And, AndNot, Or, Xor, Divide for Sse1

* Cleanup

* Fix build

* limit emit_vector128 with LLVM

* enable IsSupported for corlib

* Fix build on wasm (if-defs issue)

* Don't intrinsify Vector256

* Address feedback
2020-01-13 13:51:51 +01:00
Karl e92fe19fa6 [Winforms] X11Keyboard LookupString fixes (#18423)
Two small fixes to X11 keyboard handling here:
- For Xutf8LookupString, use the actual buffer size rather than the starting buffer size. Using the previous fixed size made the buffer overflow handing code immediately after the change pointless.
- For XLookupString, handle similar to Xutf8LookupString, getting a byte array. The old was sometimes causing problems where input on the numeric keypad didn't enter text. I believe using a StringBuilder similar to how it was _should_ work, but for some reason I could not get it to work reliably. So I changed it to this, which seems to work well for me. The only question I have is whether it should be Encoding.ASCII like I used, Encoding.Default, or another specific encoding.
2020-01-13 12:19:36 +01:00
Zoltan Varga 4b718ca1f2 [jit] Fix an assertion in the Thread.VolatileRead () intrinsic. (#18430)
Fixes https://github.com/mono/mono/issues/18418.
2020-01-13 12:09:09 +01:00
Vlad Brezae a13f5ccbb6 [interp] Fix struct copying during pinvoke transitions (#18402)
If we are in pinvoke wrapper, we need to use the marshalled native size, not the managed size.
2020-01-13 12:05:25 +01:00
Zoltan Varga 09a7317e5a [wasm] Disable a test which OOMs. 2020-01-13 10:00:49 +01:00
Karl ff494e6065 Only calculate scrollbars once handle created 2020-01-13 17:54:00 +13:00
Karl b8f747e452 Significantly improve DPI caching.
Particularly, don't call CreateGraphics() in TextBoxBase's constructor.
2020-01-13 17:54:00 +13:00
Karl e9abb44242 Correct code style problems. 2020-01-13 17:54:00 +13:00
Karl c41ee8050e Improve font name and charset handling.
- Use alternative names as a fallback if present.

- Use the untagged name (\fname, name that doesn't
identify charset ) if present.

- Use font codepage or charset correctly to get the correct encoding.

Rip out the old nonfunctional RTF charset handling.
This was not used, and furthermore was fundamentally flawed.
I have replaced it by simply using the correct text Encoding, mentioned
above.
2020-01-13 17:54:00 +13:00
Karl 9b87a23ee6 Replace Document Height / Width Changed events with SizeChanged 2020-01-13 17:54:00 +13:00
Karl 150d5e209d Round font ascent / descent up in LineTag. 2020-01-13 17:54:00 +13:00
Karl 24c2e505a3 Fix updating to cover lines modified while suspended. 2020-01-13 17:54:00 +13:00
Karl e586084ae8 Rearrage slightly, fix kerning. 2020-01-13 17:54:00 +13:00
Karl 3d9e4fa7f4 Fix CharCount, CharIndexToLineTag, recalculate wrapped lines.
CharCount / length was inconsistent about counting line endings. Fixed
to include them all, as that was much easier than the other way.

When shortening a wrapped line, it is necessary to start the recalculate
at the previous line, in case the wrap point has changed.

In CharIndexToLineTag, if there is a line boundary at the specified
index, return the line starting at the index.

Fixed a few other things too.
2020-01-13 17:54:00 +13:00
Karl 11a89a53ab Recalculate after changing canvas. Fix scrolling. 2020-01-13 17:54:00 +13:00
Karl 0b6dd983dd Later RTF para overrides earlier. Emit \nosupersub.
RTF paragraph controls override earlier instructions, rather than
keeping the maximum.
Emit \nosupersub between superscript and subscript text. Missing it out
technically gives a superscript (or subscript) of the subscript (or
superscript), which is not what we want.
rather than keeping the maximum.
2020-01-13 17:54:00 +13:00
Karl df3b5a26b4 Improve indent and kerning handling. 2020-01-13 17:53:59 +13:00
Karl ca7352ad24 Add tabstop support. Use floats for spacings.
Floats are now used to preserve paragraph spacing and indents. The RTF
format uses twips (1/20") for these, which is usually less than 1px.
2020-01-13 17:53:33 +13:00
Karl b35c560df3 Lots of TextControl stuff, plus others.
* RTF.cs: Add support for JPEG and EMF pictures.
  Allow for attribute etc. groups inside the picture group.

* Line.cs: In InsertString, ensure that the tag passed in is currently
  in the line – not necessarily valid when the passed tag is the
  cursor, for instance.

* LineTag.cs: Only break tags for formatting when needed.

* TextControl.cs: Fix invalidating text that isn't left-aligned.
Fix caret stuff:
  Positioning after the line ending no longer happens
  Up and down when not left-aligned
  Tag used when moving left to start of line
  Page up / down
  Remove empty tags when navigating away from them
Change tag background draw location – I think it is a correction!
When inserting at a position without being given the tag, choose an
  empty tag at that position if one exists.
Change ReplaceSelection order back (corrected some formatting and
  similar stuff), and format the new text to match the tag.
Change IncrementLines to transverse the tree (using a new function)
  rather than repeatedly call GetLine.

* RichTextBox.cs: Don't streamline the line in case it removes tags we
  want to keep – we'll skip them ourselves instead.
Emit pictures.

* TextBoxBase.cs: Remove redundant check – a previous check means
  value != acutal_border_style, therefore at least one of them !=
  BorderStyle.Fixed3D, therefore the if condition was always true.
2020-01-13 16:42:44 +13:00
Karl 681b514e88 Use a float for the RTF font size to avoid rounding error when dividing by two to get the point size. 2020-01-13 16:42:44 +13:00
Karl dbf98ffc93 Add line spacing support. Move dpi to TextControl.
Line spacing seems to be working perfectly.
2020-01-13 16:42:44 +13:00
Karl f25ca77bfe Fix ReplaceSelection() again. Line spacing support. Fix drawing non-multiline selection.
It was inserting at the start, and then removing what had been inserted +/- whatever length as needed.
2020-01-13 16:42:44 +13:00
Karl e01e43025d Fix TextControl.ReplaceSelection to insert before removing so that setting SelectedText doesn't lose formatting. 2020-01-13 16:42:44 +13:00
Karl 1821cc8adf RichTextBox: Cache dpi
The dpi isn't likely to change during the lifetime of the object, so is relatively safe to cache.
Creating a Graphics object each time the dpi is wanted when reading RTF is also rather silly performance-wise.
Even worse, when generating RTF it can cause a recalc, which can mean that some lines <= end_line don't exist.
2020-01-13 16:42:44 +13:00
Karl be446f04f3 Three fixes in RichTextBox, one GenerateRTF, two ContentResized.
In GenerateRTF, check tag != null before trying to generate anything based on it. Not sure
why it hasn't been a problem before, but either way I was getting NullReferenceExceptions
because of it today.

Run ContentSizeChanged() when either width or height changes, irrespective of Multiline status.
This fixes various problems with stuff jumping around vertically.

Correct ContentSizeChanged to consider the left and right margins instead of the left margin twice.
Was probably a typo at an earlier stage, otherwise would have been a * 2.
2020-01-13 16:42:43 +13:00
Karl 42cecb6ed2 Fix line calculation for vertical positioning of tags.
* Line.cs: Fix handling of differing tag Ascents and CharOffsets in recalculateLine.

* TextControl.cs: Remove unneeded assignments.
2020-01-13 16:42:43 +13:00
Karl fee6509476 * Line.cs: Finished off indent support, also added tabstops.
* LineTag.cs: Added support for visibility. Corrected handling of tabs
  and added tabstop support.

* RichTextBox.cs: Added support for text visibility, indents,
  tabstops.

* TextControl.cs: Make invisible text work correctly. Fixed a bug with
  tag backcolor. Added support for indents.
2020-01-13 16:42:35 +13:00
Karl f98c1e0087 Fixed so that it sets measuredText to an empty rectange if not
measuring text.
2020-01-13 16:09:02 +13:00
Karl e4a5b4a720 * RichTextBox.cs: Align Justified as Left instead of as Center.
* TextControl.cs: Provide an output on PictureTag.Draw(... out
  Rectangle measuredText ...) if requested.
2020-01-13 16:08:29 +13:00
Karl cc91b61cea * RTF.cs: More work on ReadObjGroup
* RichTextBox.cs: Fixed up the insertion of pictures.
2020-01-13 16:06:41 +13:00
Karl aab3dca9fc All sorts of work, mostly on RichTextBox. 2020-01-13 16:03:11 +13:00
Zoltan Varga 73468eda91 Bump linker. (#18424) 2020-01-12 10:57:28 +01:00
Ankit Jain fc7b254953 [master] Bump msbuild to track xplat-master (#18432) 2020-01-12 10:56:21 +01:00
monojenkins ee3da3821b [bcl] Update BCL Linked Size 2020-01-11 08:58:48 +01:00
Martin Baulig a702e4ff02 [Sockets]: Always reset internal SAEA completion when reattempting connection in MultipleConnectAsync. (#18389)
This should fix #18030.
2020-01-10 19:01:36 +01:00
Zoltan Varga 3563bd90dc Revert "[wasm] Pass --used-attrs-only true to the linker. (#18401)" (#18415)
This reverts commit 6f4fe05209.
2020-01-10 16:49:43 +01:00
Ankit Jain 9666bcfae7 [master] Bump msbuild to track xplat-master (#18412) 2020-01-10 12:45:01 +01:00
Vlad Brezae d33a100961 [interp] Add gc unsafe transition during pinvokes (#18399)
Native methods can be run in gc safe mode, meaning we can be in gc safe mode while setting/getting the arguments for a native transition. Call context computation requires us to be in unsafe mode.

Fixes https://github.com/mono/mono/issues/16969
2020-01-10 09:32:04 +02:00
Zoltan Varga 5a65a97c58 [corlib] Mark the SRE types with required=false so they can be linked out. (#18379)
Currently SRE types are still kept by the reference in RuntimeType::MakeTypeBuilderInstantiation ().
2020-01-10 04:22:45 +01:00
Larry Ewing 439091eddf [wasm] use updated node to run jsvu (#18386)
* [wasm] use updated node to run jsvu

* [wasm] make the browser tests use the node we've installed

* [wasm] Fix browser tests to reference dotnet.js
2020-01-09 22:42:03 +01:00
Zoltan Varga 6f4fe05209 [wasm] Pass --used-attrs-only true to the linker. (#18401) 2020-01-09 19:12:16 +01:00
Alexander Köplinger c9dc20f59e Fix line endings in .bat files
They need to be CRLF otherwise we'll get conflicts when moving into dotnet/runtime which has a .gitattributes setting forcing .bat to CRLF.
2020-01-09 18:06:53 +01:00
Ankit Jain 46f834fda7 [master] Bump msbuild to track xplat-master (#18391) 2020-01-09 17:45:05 +01:00
Maxim Lipnin f5aca4235e [netcore][xunit tests] Re-enable System.Diagnostics.Tests.ProcessTests.ProcessStart_UseShellExecute_ExecuteOrder (#18397)
#14903
2020-01-09 17:01:57 +01:00
monojenkins e55a1a4f62 [bcl] Update BCL Linked Size 2020-01-09 14:21:06 +01:00
Vlad Brezae 345550fb99 [interp] Throw overflow exception when converting NaN (#18384)
Fixes https://github.com/mono/mono/issues/18061
2020-01-09 12:08:15 +02:00
Bernhard Urban-Forster 207cf805e5 [memory barrier] use pagesize determined by helper (#18383)
[memory barrier] use pagesize determined by helper

`limits.h` doesn't always define `PAGESIZE` properly (e.g. iOS), so it would fall back to `0x1000` (4096) but it's really `0x4000` (16384) on iOS. We already have a helper in the runtime to determine the pagesize, so let's use that instead.


Fixes https://github.com/mono/mono/issues/18273
2020-01-09 10:46:03 +01:00
Marek Safarandmonojenkins 9cc751d618 [corlib] Switch to CharUnicodeInfo from corefx (#18305)
* [corlib] Switch to CharUnicodeInfo from corefx

* [csproj] Update project files

Co-authored-by: monojenkins <[email protected]>
2020-01-09 09:36:55 +01:00
Zoltan Varga 147c7972a8 [wasm] Reenable linker substitutions. (#18381) 2020-01-09 05:18:58 +01:00
Zoltan Varga 46fe5ad3f6 Bump linker. (#18380) 2020-01-09 05:18:17 +01:00
Martin Baulig ba7c00e4a9 Add workaround for #17710. (#18275) 2020-01-08 17:50:55 -05:00
Ryan Lucia 9fd95db929 [reflection] Fix check for Type.FullName to match CoreCLR (#18385)
Updated test to follow in dotnet/runtime
2020-01-08 17:02:25 -05:00
Ryan Lucia 1178ab3a1a [metadata] Propagate error in mono_runtime_try_invoke_array (#18382)
This was prompted by https://github.com/mono/mono/issues/18339, which seems to be failing to locate a native library and then hitting an assertion. We should propagate the error instead, so that if others run into something similar they can see what's actually going wrong instead of just getting a runtime crash.
2020-01-08 15:57:16 -05:00
Egor Bogatov ee5850a2b5 Update FieldInfoTest.cs 2020-01-08 23:21:41 +03:00
dotnet-maestro[bot] 5dbc923cb3 [master] Update dependencies from dotnet/arcade (#18206)
* Update dependencies from https://github.com/dotnet/arcade build 20191215.1

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19615.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19615.1

* Update dependencies from https://github.com/dotnet/arcade build 20191222.1

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19622.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19622.1

* Update dependencies from https://github.com/dotnet/arcade build 20191229.1

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19629.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19629.1

* Update dependencies from https://github.com/dotnet/arcade build 20200105.1

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20055.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20055.1
2020-01-08 20:47:44 +01:00
Jay Krell e8d38961ee [Coop] Remove handles from Mono.Interop.ComInteropProxy. (#16993) 2020-01-08 13:34:11 -05:00
Alexander Köplinger ba505510f2 FreeBSD: fix provisioning script to force reinstall perl5 at the end
It didn't work otherwise.
2020-01-08 16:46:58 +01:00
Zoltan Varga 34dee0ea4e [runtime] Initialize field info before accessing it in ves_icall_System_RuntimeFieldHandle_SetValueDirect (). (#18378)
Fixes https://github.com/mono/mono/issues/18364.
2020-01-08 16:39:39 +01:00
Ankit Jain d31f6ac4da [master] Bump msbuild to track xplat-master (#18376) 2020-01-08 15:01:03 +01:00
Zoltan Varga e999846088 [jit] Implement fast TLS access in gshared methods. (#18377)
Fixes https://github.com/mono/mono/issues/18370.
2020-01-08 13:32:52 +01:00
Zoltan Varga d0a3fb1b1b [wasm] Rename binaries mono -> dotnet. (#18373) 2020-01-08 03:04:55 +01:00
Ankit Jain aa87d3db6d [master] Bump msbuild to track xplat-master (#18372) 2020-01-07 20:56:41 +01:00
Bernhard Urban-Forster 6481e8f7a3 [interp] run regression with all combinations of available optimizations (#17644)
[interp] run regression with all combinations of available optimizations

Like we do for the JIT.
2020-01-07 19:35:54 +01:00
Zoltan Varga 3d4cd57a52 [wasm] Pass --explicit-reflection to the linker only in aot mode. (#18367) 2020-01-07 18:50:22 +01:00
Phil Jaenke f3f11d1081 FreeBSD: Fix for perl5.26 / perl5-5.30 conflict (#18368)
The base image appears to have perl5.26 which conflicts with perl5-5.30, resulting in the /usr/local/bin/perl binary not being placed by perl5-5.30, which results in failed builds. The `perl5.26` appears to be part of the base image and has no packages actually dependent on it.
2020-01-07 18:14:55 +01:00
Calvin Buckley 524a8298d0 Force Python 3.x from env in shebang lines (#18285)
* Fix byte/string incompatiblity in Python 3
2020-01-07 17:28:06 +01:00
Zoltan Varga ec7f4c68f9 [netcore] Remap String ctors to the String:Ctor () methods. (#18357) 2020-01-07 17:12:34 +01:00
Ankit Jain 71070d34c8 [master] Bump msbuild to track xplat-master (#18297)
This enables parallel build support with msbuild!
2020-01-07 16:21:51 +01:00
Calvin Buckley b3ce5bfa88 More disambiguation of Python in makefiles (#18284) 2020-01-07 15:44:03 +01:00
Vlad Brezae 376c46bcf3 [sgen] Fix xref computation with tarjan bridge (#18239)
* [sgen] Include also derived classes as bridges

When using `MONO_GC_DEBUG=bridge=` debug option

* [sgen] Fix xref computation with tarjan bridge

Between C# and java (on android) there are objects that live on both worlds. This means that there exists a C# object with a corresponding java object. The relationship between them is strong, meaning if C# object is alive then java object must stay alive, and vice-versa. We keep java bridge objects always alive through a GCHandle (on the java gc). When doing a C# collection we select all bridge objects that appear to be dead on the C# side. These objects are candidates for collection, assuming the java side has nothing against it. Before triggering a collection on the java side (following the mono gc) we switch all the strong gchandles to the java objects to be weak (for these objects that are candidate to be collected) and we recreate the reference graph from the C# side to the java side (if C# Bridge1 can reference C# Bridge2 then, on the java side, we add a reference from Java Bridge1 to Java Bridge2; this is done by adding to an array of references inside Java Bridge1). In order to minimize the amount of work that needs to be done on the java side, we compute the minimal amount of references that need to be added, by computing the strongly connected components of the object graph.

An optimized way to construct the SCCs and the xrefs is by using the tarjan algorithm (https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm). Our algorithm is non recursive (scan_stack emulates the recursive order of traversal in a dfs algorithm, while loop_stack is the stack used by the algorithm). A color represents an SCC. We have some optimizations in place where we might merge colors if they don't contain bridges, since the client only cares about SCCs containing bridge objects and the links between them. color_merge_array is used to keep track of all neighbors of a node until we are creating the scc for that node. It is populated when scanning all the refs inside an object (compute_low). All the colors in the color_merge_array will be cross references with that scc.

Before this commit we were only clearing the color_merge_array when creating an SCC. This is problematic because we could end up with xrefs inside of an SCC that belong to another SCC. Consider the simple graph of nodes 0,1,2,3 where 0 <=> 2, 0->1, 2->3. Assume we start scanning with node 0. When creating the SCC for node 3 the followed path is 0 -> 2 -> 3, while the loop stack will contain (0,1,2,3). After creating SCC for node 3, we will finish scanning node 2 which would detect the xref to Bridge3, which would have been added to the color_merge_array. Because node 2 is not the root of the SCC it belongs to (its lowlink points towards node 0 which has a lower index), we are not creating an SCC with it, and the link to node 3 remains in color_merge_array. Because the next node from the scan_stack is node 1, which is also the root of the SCC that it belongs to, we will create an SCC for it and wrongly add the node 3 reference from color_merge_array to it. In order to fix this issue, we will always clear the color_merge_array once we finished scanning the xrefs for a node. If the node in question is not the root of an scc, then we will remember them as xrefs pointing out from this object. When we finally reach node 0 (which will be the root of the SCC containing nodes 0 and 2), we will then know that all xrefs for this color are the union of the xrefs of all objects belonging to this color (which represents the objects that we are popping from the loop_stack until we encounter the root node).

Even though this change adds required bookeeping for xrefs, I didn't notice any change in performance on the bridge tests that we have in mono/tests.

* [sgen] Some logging improvements in tarjan bridge

* [sgen] Disable optimization when comparing bridge outputs

When this optimization is enabled, the tarjan bridge will create more SCCs in order to reduce amount of xrefs in the graph. This would render the `bridge-compare-to` debug flag unusable with tarjan bridge.
2020-01-07 16:31:49 +02:00
Jay Krell 2129ac6c28 Set thread pool thread name just based on string pointer check. (#16637)
* Set thread pool thread name just based on string pointer check.

When the generation-based solution went in, there were not
yet constant thread names, so a pointer based approach could fail
due to reuse. We can do slightly simpler now.

* Remove the generation field which is no longer needed.
Remove the duplicated knowledge of how to set a constant and put
it behind a funny sounding but perhaps reasonable flag.
Revise corlib version.
2020-01-07 09:01:22 -05:00
EgorBo 322ba565b6 disable a test 2020-01-07 17:00:23 +03:00
Steve Pfisterandmonojenkins 0ccf503f0a Add SignedCms to the TypeForwards in the System.Security.Cryptography.Pkcs facade (#18325)
* Add SignedCms to the typeforwards in the System.Security.Cryptography.Pkcs facade

* Added additional missing types from System.Security.Cryptography.Pkcs.

* It would be nice if the files I added had namespaces ;-)

* Bump API snapshot submodule

* [csproj] Update project files

Co-authored-by: monojenkins <[email protected]>

Fixes https://github.com/mono/mono/issues/18323
2020-01-07 14:03:15 +01:00
EgorBo e6c0cdae0c Address Zoltan's feedback (enable for AOT) 2020-01-07 15:18:51 +03:00
EgorBo 1c5a295082 Merge branch 'master' of github.com:mono/mono into vt-gettype-boxing 2020-01-07 14:50:16 +03:00
Marek SafarandBernhard Urban-Forster adcd62248d [System.Private.CoreLib] Cleanup intrinsic tracking (#17884)
* [System.Private.CoreLib] Cleanup intrinsic tracking

1. Removed icalls where intrinsic version for the method exists

2. Add [Intrinsic] attribute to methods which have runtime intrinsic
   to make them easier to track and to tell linker not to analyze them

3. Use recursive syntax for any intrinsic which can be called via
   reflection to correctly apply the intrinsic when invoked.

```c#
public static bool IsSupported { get => IsSupported; }
```

When one calls X86.IsSupported, the call gets replaced by an
intrinsics. When one calls it with an Invoke, the body of IsSupported
gets replaced by intrinsics. It's just a hack to get Invoke support for free.

* [interp] implement System.Type::op_Equality

* Undo changes which are not yet supported by interpreter

* [interp] Implement System.Runtime.CompilerServices.RuntimeHelpers::OffsetToStringData

Co-authored-by: Bernhard Urban-Forster <[email protected]>
2020-01-07 11:17:06 +01:00
Zoltan Varga 487dacce79 [jit] Avoid passing a vtable argument to DIM methods when making calls out of gsharedvt methods. (#18334)
* [jit] Avoid passing a vtable argument to DIM methods when making calls out of gsharedvt methods.

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

* Fix compilation with mcs.
2020-01-07 02:57:10 +01:00
Jay Krell 6a8ca2252b Do not depend on gboolean to have multiple bits. (#17825) 2020-01-06 16:11:21 -05:00
Zoltan Varga 384db9e890 [netcore] Optimize RuntimeType::IsSZArray. (#18347) 2020-01-06 16:36:59 +01:00
Zoltan Varga 7236dadd32 [netcore] Mark SRE types with required=false so they are only retained when they are actually used. 2020-01-06 15:44:50 +01:00
Jo Shields 4c9e28b80a Don't run make install in boehm submodule (#17907)
Don't run `make install` in boehm submodule
2020-01-06 09:20:46 -05:00
Zoltan Varga 090e25ec2d [wasm] Rename the interp-sample targets to interp-hello. (#18342) 2020-01-06 07:40:40 +01:00
Zoltan Varga 47424e34ae Bump emscripten to 1.39.5. 2020-01-05 21:45:10 -06:00
monojenkins 59a1eade7c [csproj] Update project files 2020-01-05 13:43:39 +01:00
monojenkins 36e89d52d1 Bump API snapshot submodule 2020-01-05 13:43:39 +01:00
Zoltan Varga 3acab49ce7 Bump linker+cecil. 2020-01-05 13:43:39 +01:00
Aleksey Kliger (λgeek) 07fee8a91d [metadata] Size 0 Blob heap is ok when resolving assembly refs (#18313)
* [metadata] Size 0 Blob heap is ok when resolving assembly refs

Sometimes ILasm can produce images with a Blob heap of size 0.  In cases where
we're loading assembly references from such an image, the hash (which is
optional) can be at index = 0 and the Blob heap size is also 0.

Also: add the hash value to the output of `monodis --assemblyref`

* [metadata] Add a separate assertion for the index == size == 0 case

And a comment explaining how it is likely to be triggered.  If the assembly is
reasonable the caller of mono_metadata_blob_heap should be updated to use
mono_metadata_blob_heap_null_ok instead

* [bcl] Allow Mono's ILASM to produce a size 0 Blob heap

ECMA 335 II.24.2.4 says that the user string and blob heaps should have an
entry at index 0 consisting of the single byte 0.  However .NET Framework (and
.NET Core) ilasm will entirely omit the Blob heap (that is, create a blob heap
entry of size 0) if it is not needed.  This PR changes Mono's ILASM to emit the
initial byte on demand only if one of the MetaDataStream.Add() methods is
called. Otherwise we will also emit a stream of size 0.

This is needed to compile some test cases.

* [tests] Add regression test for loading assemblies with size 0 Blob heap

Depends on ILASM that can emit a size 0 Blob heap
2020-01-03 10:42:44 -05:00
Zoltan Varga 22afdb80e1 [netcore] Add some linker exclusions. 2020-01-03 13:11:39 +01:00
monojenkins 95101b19fc [bcl] Update BCL Linked Size 2020-01-03 09:22:27 +01:00
Larry Ewing 14a3add47f [wasm][debugger] put the testharness base url in one place 2020-01-02 19:28:18 -06:00
Larry Ewing 11bf192d1a [wasm][deubgger] clean up task usage and remove delay 2020-01-02 19:28:18 -06:00
Marek Safar c9036e7555 Cleanup a few dependencies to reduce wasm bcl size 2020-01-02 14:24:44 -06:00
Ryan Lucia 33ca3d33e1 [loader] Add assembly name matching on netcore to fix DefaultContext test (#18272)
* [loader] Rename assembly name check strictness flag

* [loader] Add predicate for assembly name matching on netcore

* [loader] Enable LoadInDefaultContext test

* Make mono_assembly_names_equal external, change flags in domain search

* Move ifdef inside mono_loader_get_strict_assembly_name_check

* Fix pedump

* No reason to make this external

* Feedback
2020-01-02 15:21:45 -05:00
Egor Bogatov 458d80002d Add !align 8 to all managed allocators (calls) (#18283) 2020-01-02 20:45:40 +01:00
Jérôme Laban 52674e238a [Wasm] Use Path.Combine in Packager (#18332)
Improves Windows compatibility
2020-01-02 20:38:41 +01:00
Ryan Lucia ff6294d231 [reflection] Convert internal GetCustomAttributes calls to Attribute[] (#18176)
* [reflection] Avoid creating object[] in GetCustomAttributesBase

* [reflection] Migrate Attribute type checking to CustomAttribute.cs
2020-01-02 11:58:15 -05:00
Ryan Lucia 675f1eb321 [eglib] Fix whitespace in memory.c (#18320) 2020-01-02 11:56:50 -05:00
Thays Grazia e20956305e The behaviour expected of filter exceptions is: (#18309)
-> throw in a async task with a try catch in the caller -> don't stop
-> throw in a new thread with a try catch in the caller -> stop
-> throw in the main thread without any try catch -> stop

Including a new test to test the fix of #17601.

Fixing #16588, create a while 1 to stops the program execution when an exception is thrown and no try catch is found and MONO_DEBUG=suspend-on-unhandled.

Fixes #17601
Fixes #16588
2020-01-02 11:26:14 -03:00
Jonathan Nagy 5470386775 Set inited flag _after_ TermInfoDriver initialisation completes (#18318)
Fixes #18317
2020-01-01 19:02:48 -05:00
Steve Pfister 6f24832646 Pull in DirectoryInfo Invalidate After Create Fix (#18310)
* Bump to mono/corefx@bff1d77
2019-12-30 21:05:14 -05:00
Martin Baulig 400fb9c2cb Socket.BeginMConnect() should not attempt connections on unsupported address families. (#18302)
Fixes #16513.
2019-12-30 13:08:03 -05:00
Aleksey Kliger (λgeek) 61eb2be2e1 [eglib] Don't define _FORTIFY_SOURCE on Cygwin builds (#18308)
See https://github.com/msys2/MINGW-packages/issues/5803

Without -lssp (or -fstack-protector), -D_FORTIFY_SOURCE=2 leads to linker
errors.
2019-12-30 09:54:57 -05:00
imhameed 9719635e58 Use byte-aligned LLVM loads and stores for unaligned mini IR loads and stores. (#18296)
Should fix https://github.com/mono/mono/issues/18221.
2019-12-26 14:34:02 -05:00
EgorBo 28cae98ef0 Optimize box(T)+GetType 2019-12-25 02:32:46 +03:00
Aleksey Kliger (λgeek) ffdffa54f2 [domain] Don't add NULL runtime to runtimes list (#18260)
Also when iterating over the runtimes, actually look at the current element,
not the first element.

Also mention the unsupported runtime version in the warning message when it is
passed to mono_init_internal.

Fixes https://github.com/mono/mono/issues/17916
2019-12-23 10:44:32 -05:00
Fan Yang a1a4bcc49d Fix llvm jit assertion (#18280)
* Fix assertion when Alignment is greater than 32
2019-12-23 08:38:36 -05:00
Fan Yang 7ffcaaf59a Add cast to ((align) - 1) for Alignment macros (#18255)
* Add cast to ((align) - 1) for Alignment macros

* Add test for Alignment macro change
2019-12-23 08:34:37 -05:00
Alexander Köplinger 720767a9ff Fix invalid assetManifestPlatform in pipeline-netcore-runtime.yml
Spaces are note valid there.
2019-12-23 12:24:53 +01:00
Larry Ewing 1587c49f5f [wasm][debugger] Clean up startup and improve comments
Properly await more of the async logic and add retries when we get
an empty response from the "json/list" endpoint.
2019-12-20 21:41:05 -06:00
Larry Ewing 14b736e942 [wasm] resolve the full path of pdbs so that ../ doesn't break inclusion 2019-12-20 21:41:05 -06:00
Larry Ewing 04b9e5cb8f [wasm][debugger] rename the debugger target to run-debugger-tests 2019-12-20 21:41:05 -06:00
Larry Ewing 1669812689 [wasm][debugger] get the debug harness working again 2019-12-20 21:41:05 -06:00
Maxim Lipnin b55d8f9700 [wasm][xunit tests] Avoid skipping test methods with ITraitAttribute custom attributes (#18223)
* [wasm][xunit tests] Avoid skipping test methods with ITraitAttribute custom attributes

* [wasm][xunit tests] Re-enable System.Tests.MathFTests.Round_Digits and System.Tests.MathFTests.Truncate

* [wasm][xunit tests] Exclude XLinqTests.TreeManipulationTests.IEnumerableOfXNodeRemoveWithEvents test method
2019-12-20 19:18:51 -06:00
Ryan Lucia 0f8aac3c62 [loader] Check AppContext.BaseDirectory on netcore in preload hook 2019-12-20 19:17:01 -06:00
Ryan Lucia 57b6c8775b [loader] Remove unnecessary newlines in tracing 2019-12-20 19:16:11 -06:00
Ryan Lucia 5c87445310 [netcore] Re-enable some BinaryFormatter tests (#18277) 2019-12-20 19:52:53 -05:00
Alexander Köplinger cfba7c550f [netcore] Update dotnet sdk version in global.json (#18264)
Should unbreak the publishing build of netcore-mono.
2019-12-20 17:26:09 +01:00
Larry Ewing 47bca852c1 [wasm] fix the wrapped function signatures to match current documentation 2019-12-20 09:38:18 -06:00
Larry Ewing 5db64e27e9 [wasm] fix the mono_clear_bps condition 2019-12-20 09:38:18 -06:00
Aleksey Kliger (λgeek) d6f3de3c4c [tests] Add test files to tarball (#18261)
Some test sources weren't included.

Fixes https://github.com/mono/mono/issues/18202
2019-12-20 11:11:26 +01:00
Alexander Köplinger 7fd24a40bb Bump corefx to get test fix 2019-12-20 00:37:55 +01:00
Larry Ewing 83a898d25b [wasm] Make sure we're comparing the same date (#18251) 2019-12-19 15:35:05 +01:00
Alexander Köplinger c8e19bec68 [System] Add additional hardening against race in MonoTlsStream (#18250)
See https://github.com/mono/mono/issues/15805#issuecomment-567131297
2019-12-19 02:25:06 +01:00
Bernhard Urban-Forster e7b98d3587 [interp] add guard that a local hasn't been modified for stlocfld fusion (#18129)
[interp] add guard that a local hasn't been modified for stlocfld fusion

Fixes https://github.com/mono/mono/issues/18120
2019-12-19 02:05:57 +01:00
Nikita Voronchev 0beb9611df [WinForms][UIA] Add new internal event to track form's owner change (#18117)
This PR is needed for https://github.com/mono/uia2atk/pull/8
2019-12-18 22:24:06 +01:00
Alexander Köplinger a74416d950 [corlib] Move a few more test cases to part2, turns out part1 was still too large
Follow up to 3891fe97.
2019-12-18 22:18:33 +01:00
Alexander Köplinger 3891fe97d2 [bcl] Split corlib and System.Core xunit test assemblies for monotouch profiles (#18228)
They cannot deal with large test assemblies so we need to split them.

We're doing this by introducing a new `#skip <PROFILE>` directive in the .sources format which defines where to split the assembly.
The logic is very simple: files up until the first `#skip` are common files which get included in each part, subsequent files are only in the respective part assembly.

Fixes https://github.com/mono/mono/issues/18213
2019-12-18 21:11:17 +01:00
Larry Ewing 2ff93e4c76 [wasm] Fix test case spelling (#18242) 2019-12-18 13:51:21 -06:00
Maxim Lipnin 56f397bef3 [wasm][xunit tests] Re-enable System.Tests.MathFTests.Round_Digits and System.Tests.MathFTests.Truncate (#18234) 2019-12-18 06:49:45 -06:00
Larry Ewing 60f081c077 [wasm] handle completed Tasks and exceptions when resolving Task prom… (#18215)
* [wasm] handle completed Tasks and exceptions when resolving Task promises

* Preserve the old void invoke behaviour
2019-12-17 22:47:23 -06:00
Larry Ewing f46d5fda1d [wasm][debugger] fix exception when we can't locate debug assembly (#18230) 2019-12-17 21:37:22 -06:00
Nathan Ricci ed7432d988 Change ICONST to I8CONST when propagating constants through sign extension. (#18222)
Change ICONST to I8CONST when propagating constants through sign extension.
2019-12-17 21:35:56 -05:00
Evgenii Stepanov 06673e723e Relax assert in mono_arch_build_imt_trampoline. (#18195)
This assert fails when the trampoline code size worst case is realized.

Observed on a Android device with HWASan [1] enabled, where heap
addresses have a non-zero tag in the most significant byte, and thus
require 4 instructions to materialize in emit_imm64.

[1] https://source.android.com/devices/tech/debug/hwasan
2019-12-17 01:18:53 +01:00
Maxim Lipnin df3837eb7d [wasm][xunit tests] Re-enable System.Buffers.Text.Tests.ParserTests (#18220) 2019-12-17 01:18:34 +01:00
Zoltan Varga aa9227f7c8 [llvm] Generate correct LLVM IR for OP_XEQUAL. (#18217) 2019-12-17 00:52:02 +01:00
Zoltan Varga 970d695718 [wasm] Disable linker substitutions for now, it generates invalid IL when running make build-aot-hello-netcore. (#18218) 2019-12-17 00:10:04 +01:00
Zoltan Varga 6bf2c17f34 [wasm] Pass --deterministic to the linker in msbuild. (#18214) 2019-12-17 00:09:46 +01:00
Zoltan Varga 9f5e38229e [netcore] Add AssemblyLoadContext:OnAssemblyLoad() to linker descriptor. (#18219) 2019-12-17 00:09:24 +01:00
Jay Krell de359d4930 Remove handles/MonoError from some marshal icalls. (#18036)
Remove handles/MonoError from some marshal icall functions.

This does some small other things.
  In particular, if a function is not static for some platforms, make it not static for all.
  static historically was valuable, because of default linker semantics around visibility.
  I believe it is less important now, since visibility is default constrained.
  Also being consistent across platforms seems good.

Maybe split off a separate PR for that.
2019-12-16 23:06:11 +01:00
Ryan Lucia e19914fe69 [metadata] Check for GTDs in setup_generic_array_ifaces (#18101)
Judging by https://github.com/mono/mono/blob/4cefdcb7ce2d939ee78fb45d1b4913eb3bc064fd/mono/metadata/metadata.c#L3515 the cached_class is sometimes intentionally a GTD, which can get passed all the way down to setup_generic_array_ifaces and cause a crash.
2019-12-16 14:17:44 -05:00
Zoltan Varga ac1a12f997 [wasm] Regen wasm_m2n_invoke.g.h. (#18212) 2019-12-16 18:54:54 +01:00
Marek Safar 47199fede8 Revert "[wasm][ci] Deactivate linker on browser tests (#18152)"
This reverts commit 079acc2fb8.
2019-12-16 17:12:55 +01:00
Marek Safar f8266639ea Bump linker 2019-12-16 17:12:55 +01:00
Maxim Lipnin ba69304049 [wasm][xunit tests] Re-enable System.Tests.MathFTests (#18208) 2019-12-16 09:53:02 -06:00
Jérôme Laban 5562065e73 [Wasm] Enable dynamic runtime tests (#18098)
* [Wasm] Enable dynamic runtime tests

- Add dynamic runtime browser tests in CI
- Change `release-dynamic` to `dynamic-release` to align with other runtimes
- Add `-dynamic-runtime` flag for packager.exe
- Add debug configuration for dynamic runtime
- Fix invalid MAIN_MODULE=2 flag, which forces the emscripten linker to pass even on exported functions.
2019-12-16 07:28:26 -06:00
Calvin Buckley 84221f04b5 Fix locating Python interpreter when it isn't "python" (#18197)
Fix locating Python interpreter when it isn't "python"

The "python" interpreter is specified by PEP-394. In it, an OS
can decide not to ship a "python" executable, and instead only
ship python2/3, providing some ambiguity for scripts that are
version-neutral, like the one Mono uses.

This uses an automake macro to locate a suitable Python, and
changes the makefile to use the located Python, whatever it may be.
2019-12-16 11:06:00 +01:00
Zoltan Varga 61a103f371 [wasm] Set the main thread, some EH code depends on it. (#18203) 2019-12-16 08:41:43 +01:00
Marek Safar afcafb6c5e [monolinker] Fix path to wasm references 2019-12-15 17:05:37 +01:00
Maxim Lipnin c454cb92eb [wasm][xunit] Re-enable System.MemoryTests and System.SpanTests tests (#18179) 2019-12-14 14:59:48 +01:00
Jay Krell e76fb5dbf9 Add full compiler barriers to any fence that lacked a compiler barrier. (#18177)
A compiler barrier generates no code.
It "only" inhibits certain compiler optimizations, which I do not consider
particularly worrisome, as most code is "fully" optimized, and
compiler barriers are relatively rare.

It could be a concern in code paths that greatly benefit
from compiler optimizations and for which barriers greatly
inhibits the compiler.

I would further suggest, though it is not here, that any compiler
half barrier (read, write) be a compiler full barrier instead,
as they sound pretty cheap, so simplify.

Similar cannot be said about CPU barriers.
They do not always generate code, but when they do, it can cost.

This is follow-up from https://github.com/mono/mono/pull/17849#issuecomment-556273801
https://github.com/mono/mono/pull/17849#issuecomment-557661604.
2019-12-13 22:49:15 +01:00
Marek Safar 6dc5295ed0 [wasm] Improve virtualenv installation script 2019-12-13 22:37:08 +01:00
monojenkins b0e7a1e4f9 [bcl] Update BCL Linked Size 2019-12-13 22:24:52 +01:00
Marek Safar 15a8c2a7fa [wasm] Run linker tests with wasm substitution settings 2019-12-13 22:15:59 +01:00
Aleksey Kliger (λgeek) d0f27ce4fe [cominterop] Attach to runtime from IUnknown and IDispatch methods (#18175)
* [cominterop][test] Calling QueryInterface from an unattached thread asserts

If we pass a managed COM object to native code and the native code calls one of
the IUnknown methods, we assert because the thread is not attached but we want
to enter GC Unsafe mode.

* [cominterop] Attach to runtime from IUnkown and IDispatch methods

If the COM objects for a managed object is passed to a thread that hasn't
interacted with Mono before, we need to attach before doing GC thread state
transitions.

Addresses https://github.com/mono/mono/issues/18137

* [test] Call managed method through COM wrapper from unattached thread

This works, but I don't think we had a test previously.  Call a managed method
via a COM interface from a thread that is not attached to the runtime, to
ensure that it is attached.
2019-12-13 15:32:06 -05:00
Ankit Jain ea50ca48ba Bump msbuild to track xplat-master (#18183)
- bump roslyn to 3.5.0-beta1-19606-04, to match msbuild
- bump nuget.exe to 5.5.0.6319 (5.5.0-preview1), to match msbuild
2019-12-13 20:06:16 +01:00
Jay Krell 1310043953 Fix on-demand initialization race conditions [threads.c]. (#18166) 2019-12-13 19:57:33 +01:00
Jay Krell 2eca6a1e37 Fix on-demand initialization race conditions [marshal.c]. (#18169)
* Fix on-demand initialization race conditions [marshal.c].

* PR feedback: fix incorrect merge
2019-12-13 19:57:17 +01:00
Ryan Lucia 7bc25cef6d [netcore] Implement AppDomain.AssemblyLoad (#18143) 2019-12-13 11:36:08 -05:00
Jay Krell d2539babf4 Fix on-demand initialization race conditions [marshal-ilgen.c] (#18160)
* Fix on-demand initialization race conditions [marshal-ilgen.c]

* PR: Feedback more MONO_STATIC_POINTER_INIT instead of manual mono_atomic_store_seq.

* PR feedback: Narrow scope of from_oadate.

* One more MONO_STATIC_POINTER_INIT vs. mono_atomic_store_seq post-review.

* Repair whitespace.

* Alternate formating.
2019-12-13 17:30:08 +01:00
Jay Krell b637c1db67 Fix on-demand initialization race conditions [marshal-ilgen.c] (#18160)
* Fix on-demand initialization race conditions [marshal-ilgen.c]

* PR: Feedback more MONO_STATIC_POINTER_INIT instead of manual mono_atomic_store_seq.

* PR feedback: Narrow scope of from_oadate.

* One more MONO_STATIC_POINTER_INIT vs. mono_atomic_store_seq post-review.

* Repair whitespace.

* Alternate formating.
2019-12-13 17:29:30 +01:00
Alexander Köplinger 7e65a73d4d [sdks] Use Xcode 11.3 stable version for iOS/Mac SDKs
As requested by the xamarin-macios team.
2019-12-13 17:27:24 +01:00
Kenneth Pouncey 96fa4e8c6f [wasm][debug-proxy] Fix crash and send back failed message. (#18146)
* [wasm][debug-proxy] Fix crash and send back failed message.

* Remove debugging error message

* Remove debug Console.WriteLine
2019-12-13 10:22:55 -06:00
Jay Krell 57c6b81b96 Fix on-demand initialize race conditions [cominterop.c] (#18158) 2019-12-13 12:28:34 +01:00
Jay Krell 64ad646066 Fix on-demand initialize race conditions [custom-attrs.c] (#18159) 2019-12-13 12:27:39 +01:00
Steve Pfister 97bf0a1bcc Relax faultcode parsing for Soap11 message errors. (#18154)
* Relax faultcode parsing for Soap11 message errors.

The mono implementation was reading the faultcode content as an XmlQualifiedName, which applied the rule where you could not
start a name with a number. This caused interoperability problems with the .net framework because their parsing just looks
for <namespace>:<name>, where name can be any string.

Example:

<faultcode>s:1</faultcode>

On mono, a soap response that contains a fault code name of 1 will throw an error.  If you run the same code on the .net framework, it will not.

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

* [csproj] Update project files
2019-12-13 12:26:53 +01:00
Jay Krell 0dc19600d1 Fix on-demand initialization race conditions [object.c]. (#18163)
Fix on-demand initialization race conditions [object.c].

Extracted from https://github.com/mono/mono/pull/18150 which reviewer said was too big.
2019-12-13 09:25:56 +01:00
Zoltan Varga e391861c01 [wasm] Add linker substitutions. (#18149)
* [wasm] Add linker substitutions in netcore mode.

* Enable non-netcore mode as well.

* Disable conditionals which are not true in threaded mode for now.
2019-12-13 06:46:33 +01:00
Jay Krell 9cefdf59ad Fix on-demand initialization race conditions [sgen]. (#18170)
Fix on-demand initialization race conditions [sgen].

Extracted from https://github.com/mono/mono/pull/18150 which reviewer said was too big.
2019-12-13 04:55:58 +01:00
Jay Krell a93e4712ec Fix on-demand initialization race conditions [remoting.c]. (#18168)
Fix on-demand initialization race conditions [remoting.c].

Extracted from https://github.com/mono/mono/pull/18150 which reviewer said was too big.
2019-12-13 01:46:07 +01:00
Jay Krell 943a2760ec Fix on-demand initialization race conditions [native-library.c]. (#18162)
Fix on-demand initialization race conditions [native-library.c].

Extracted from https://github.com/mono/mono/pull/18150 which reviewer said was too big.
2019-12-13 01:26:07 +01:00
Jay Krell 1fe3d7eda6 Fix on-demand initialization race conditions [reflection.c]. (#18167)
Fix on-demand initialization race conditions [reflection.c].

Extracted from https://github.com/mono/mono/pull/18150 which reviewer said was too big.
2019-12-13 00:45:36 +01:00
Jay Krell 51bc81919f Fix on-demand initialization race conditions [mini] (#18161)
Fix on-demand initialization race conditions [mini].

Extracted from https://github.com/mono/mono/pull/18150 which reviewer said was too big.
2019-12-13 00:36:19 +01:00
Jay Krell 620d7cf84d Fix on-demand initialization race conditions [sre.c]. (#18164)
Fix on-demand initialization race conditions [sre.c].

Extracted from https://github.com/mono/mono/pull/18150 which reviewer said was too big.
2019-12-12 23:55:33 +01:00
Jay Krell f96ba075a1 Fix on-demand initialization race conditions [threadpool.c]. (#18165)
Fix on-demand initialization race conditions [threadpool.c].

Extracted from https://github.com/mono/mono/pull/18150 which reviewer said was too big.
2019-12-12 23:46:06 +01:00
Ryan Lucia 88dde8b763 [netcore] Implement AppDomain.TypeResolve (#18141) 2019-12-12 15:00:28 -05:00
Jay Krell a1e16d3273 Remove handles/MonoError from 12 easy socket icalls. (#18035)
Also put _icall back on ends so the search coincides between managed and native.
2019-12-12 13:32:14 -05:00
Maxim Lipnin 6d9c1359ec [wasm] Disable particular failing System.Net.Security.Tests tests rather than the whole namespace (#18151) 2019-12-12 13:07:44 -05:00
Ryan Lucia 7d88d4d502 [netcore] Enable AppDomainTests.AssemblyResolveInvalidAssemblyName (#18157)
I don't remember why this wasn't enabled originally, but it seems to be passing now. I probably accidentally fixed it back when I made changes to our assembly name parsing.
2019-12-12 12:27:51 -05:00
Zoltan Varga fb67916c0f [wasm] Change mono_wasm_runtime_invoke () to return the exception itself in the out argument instead of a boolean. (#18135) 2019-12-12 17:23:42 +01:00
Kenneth Pouncey 079acc2fb8 [wasm][ci] Deactivate linker on browser tests (#18152)
There are problems on the CI when using the linker building the Browser Tests.

https://github.com/mono/mono/commit/3142396c3c6a62f389420113129783bb156de399

PR https://github.com/mono/mono/pull/18128
2019-12-12 12:53:05 +01:00
Ryan Lucia 3ddcbda8b6 [netcore] Enable AppDomainTests.MonitoringIsEnabled (#18142) 2019-12-11 21:19:45 -05:00
Ryan Lucia acc8c0c696 [netcore] Remove MonoDomain.DoAssemblyResolve (#18139)
This is no longer called in netcore builds as of a while ago, so get rid of it and the corresponding linker exclusion.
2019-12-12 00:16:50 +01:00
Jay Krell 256eda8c7f Make Socket.Socket_icall static, as most icalls are, removing the first, unused parameter. (#18130)
Also partial undo recent and append _icall to end.
This is verbose, but maybe worthwhile to aid search.

This is extracted from https://github.com/mono/mono/pull/17978.
2019-12-11 14:40:27 -05:00
Ryan Lucia 0e05bda235 [utils] Correctly convert MONO_DL_LOCAL to RTLD_LOCAL (#18121)
On Linux, neither flag being specified will result in a default of RTLD_LOCAL. Unfortunately, on MacOS it's the opposite - the default is RTLD_GLOBAL. This means currently there is no way to set RTLD_LOCAL on Macs, so despite the potential for this to break someone it directly contradicts our documentation and needs to be changed.
2019-12-11 10:42:10 -05:00
Marek Safar 3142396c3c Bump linker (#18128)
* Bump linker

* [csproj] Update project files
2019-12-11 16:38:32 +01:00
Alexander Köplinger 8ae9708e87 [corlib] Rename internal LogLevel enum to avoid conflict with Android LogLevel (#18124)
After https://github.com/mono/mono/pull/18040 we now have InternalsVisibleTo for the Mono.Android assembly.
This exposed the internal LogLevel enum in BCLDebug which causes an issue when consumed in XA:

```
Java.Lang/Object.cs(119,18): error CS0104: 'LogLevel' is an ambiguous reference between 'Android.Runtime.LogLevel' and 'System.LogLevel'
```

To fix this we rename the internal enum in corlib since it's not really used.
2019-12-11 13:39:38 +01:00
Jay Krell 97dd6cf04c Sockets: Foo_internal to Foo_icall and ves_icall_Foo_internal to ves_icall_Foo. (#18017)
The first is to avoid requiring the signature matching in icall resolution.
The second is just to shorten names.
2019-12-11 10:40:00 +01:00
Maxim Lipnin 93c18d6fd1 [wasm] Re-enabling a test that was fixed by the corefx bump (#18108)
* [wasm] Clean up rsp-file

* Bump corefx
2019-12-11 10:39:35 +01:00
Kenneth Pouncey d6d74e819f [wasm][debugger] Prevent crash on disconnect of client (#18107) 2019-12-11 06:37:19 +01:00
Bernhard Urban-Forster a65b7af6d5 [interp] relop result is always int (#18114)
This can lead to problems on big endian.

```
result.i = (int) 1;
--> 0x0000_0001_XXXX_XXXX;

result.l = (long) 1;
--> 0x0000_0000_0000_0001;
```

On little endian it's always `0x0000_0000_0000_0001`, so it doesn't matter.
2019-12-10 22:06:48 +01:00
Ryan Lucia a778c46362 [utils] Make mono_dl_open default to RTLD_LOCAL on netcore (#17912)
* [utils] Make mono_dl_open default to RTLD_LOCAL

The exception is for fallback handlers added via the embedding API, in which case we convert the flags over to preserve legacy behavior

* Convert flags properly for embedding API use

* Changes

* Turn off -fvisibility=hidden temporarily

TESTING

* Undo some previous crimes, maybe fix failure

* Leave legacy mono unchanged, defaulting to RTLD_GLOBAL
2019-12-10 14:58:58 -05:00
Bernhard Urban-Forster ef422d9cb7 [interp] fix build when DEBUG_INTERP is enabled (#18112)
broke with c4136ebd94
2019-12-10 18:55:09 +01:00
Maxim Lipnin cd2e0e8f7a [wasm] Clean up rsp-file (#18113) 2019-12-10 18:08:52 +01:00
Bernhard Urban-Forster 80b1e103cb [debugger] skip suspend for unattached threads (#18105)
When the debugger tries to suspend all the VM threads, it can happen with cooperative-suspend that it tries to suspend a thread that has previously been attached, but then did a "light" detach (that only unsets the domain). With the domain set to `NULL`, looking up a JitInfo for a given `ip` will result into a crash, but it isn't even necessarily needed for the purpose of suspending a thread.

More details: Consider the following:
```
(lldb) c
error: Process is running.  Use 'process interrupt' to pause execution.
Process 12832 stopped
* thread #9, name = 'tid_a31f', queue = 'NSOperationQueue 0x8069b670 (QOS: UTILITY)', stop reason = breakpoint 1.1
    frame #0: 0x00222870 WatchWCSessionAppWatchOSExtension`debugger_interrupt_critical(info=0x81365400, user_data=0xb04dc718) at debugger-agent.c:2716:6
   2713         MonoDomain *domain = (MonoDomain *) mono_thread_info_get_suspend_state (info)->unwind_data [MONO_UNWIND_DATA_DOMAIN];
   2714         if (!domain) {
   2715                 /* not attached */
-> 2716                 ji = NULL;
   2717         } else {
   2718                 ji = mono_jit_info_table_find_internal ( domain, MONO_CONTEXT_GET_IP (&mono_thread_info_get_suspend_state (info)->ctx), TRUE, TRUE);
   2719         }
Target 0: (WatchWCSessionAppWatchOSExtension) stopped.
(lldb) bt
* thread #9, name = 'tid_a31f', queue = 'NSOperationQueue 0x8069b670 (QOS: UTILITY)', stop reason = breakpoint 1.1
  * frame #0: 0x00222870 WatchWCSessionAppWatchOSExtension`debugger_interrupt_critical(info=0x81365400, user_data=0xb04dc718) at debugger-agent.c:2716:6
    frame #1: 0x004e177b WatchWCSessionAppWatchOSExtension`mono_thread_info_safe_suspend_and_run(id=0xb0767000, interrupt_kernel=0, callback=(WatchWCSessionAppWatchOSExtension`debugger_interrupt_critical at debugger-agent.c:2708), user_data=0xb04dc718) at mono-threads.c:1358:19
    frame #2: 0x00222799 WatchWCSessionAppWatchOSExtension`notify_thread(key=0x03994508, value=0x81378c00, user_data=0x00000000) at debugger-agent.c:2747:2
    frame #3: 0x00355bd8 WatchWCSessionAppWatchOSExtension`mono_g_hash_table_foreach(hash=0x8007b4e0, func=(WatchWCSessionAppWatchOSExtension`notify_thread at debugger-agent.c:2733), user_data=0x00000000) at mono-hash.c:310:4
    frame #4: 0x0021e955 WatchWCSessionAppWatchOSExtension`suspend_vm at debugger-agent.c:2844:3
    frame #5: 0x00225ff0 WatchWCSessionAppWatchOSExtension`process_event(event=EVENT_KIND_THREAD_START, arg=0x039945d0, il_offset=0, ctx=0x00000000, events=0x805b28e0, suspend_policy=2) at debugger-agent.c:4012:3
    frame #6: 0x00227c7c WatchWCSessionAppWatchOSExtension`process_profiler_event(event=EVENT_KIND_THREAD_START, arg=0x039945d0) at debugger-agent.c:4072:2
    frame #7: 0x0021b174 WatchWCSessionAppWatchOSExtension`thread_startup(prof=0x00000000, tid=2957889536) at debugger-agent.c:4149:2
    frame #8: 0x0037912d WatchWCSessionAppWatchOSExtension`mono_profiler_raise_thread_started(tid=2957889536) at profiler-events.h:103:1
    frame #9: 0x003d53da WatchWCSessionAppWatchOSExtension`fire_attach_profiler_events(tid=0xb04dd000) at threads.c:1120:2
    frame #10: 0x003d4d83 WatchWCSessionAppWatchOSExtension`mono_thread_attach(domain=0x801750a0) at threads.c:1547:2
    frame #11: 0x003df1a1 WatchWCSessionAppWatchOSExtension`mono_threads_attach_coop_internal(domain=0x801750a0, cookie=0xb04dcc0c, stackdata=0xb04dcba8) at threads.c:6008:3
    frame #12: 0x003df287 WatchWCSessionAppWatchOSExtension`mono_threads_attach_coop(domain=0x00000000, dummy=0xb04dcc0c) at threads.c:6045:9
    frame #13: 0x005034b8 WatchWCSessionAppWatchOSExtension`::xamarin_switch_gchandle(self=0x80762c20, to_weak=false) at runtime.m:1805:2
    frame #14: 0x005065c1 WatchWCSessionAppWatchOSExtension`::xamarin_retain_trampoline(self=0x80762c20, sel="retain") at trampolines.m:693:2
    frame #15: 0x657ea520 libobjc.A.dylib`objc_retain + 64
    frame #16: 0x4b4d9caa WatchConnectivity`__66-[WCSession onqueue_handleDictionaryMessageRequest:withPairingID:]_block_invoke + 279
    frame #17: 0x453c7df7 Foundation`__NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    frame #18: 0x453c7cf4 Foundation`-[NSBlockOperation main] + 88
    frame #19: 0x453cacee Foundation`__NSOPERATION_IS_INVOKING_MAIN__ + 27
    frame #20: 0x453c6ebd Foundation`-[NSOperation start] + 835
    frame #21: 0x453cb606 Foundation`__NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 27
    frame #22: 0x453cb12e Foundation`__NSOQSchedule_f + 194
    frame #23: 0x453cb26e Foundation`____addOperations_block_invoke_4 + 20
    frame #24: 0x65de007b libdispatch.dylib`_dispatch_call_block_and_release + 15
    frame #25: 0x65de126f libdispatch.dylib`_dispatch_client_callout + 14
    frame #26: 0x65de3788 libdispatch.dylib`_dispatch_continuation_pop + 421
    frame #27: 0x65de2ee3 libdispatch.dylib`_dispatch_async_redirect_invoke + 818
    frame #28: 0x65df087d libdispatch.dylib`_dispatch_root_queue_drain + 354
    frame #29: 0x65df0ff3 libdispatch.dylib`_dispatch_worker_thread2 + 109
    frame #30: 0x66024fa0 libsystem_pthread.dylib`_pthread_wqthread + 208
    frame #31: 0x66024e44 libsystem_pthread.dylib`start_wqthread + 36
```

Going further, `info` is about this thread:
```
(lldb) p/x *(int *)(((char *) info->node.key) + 0xa0)
(int) $2 = 0x01243f93
(lldb) thread list
Process 12832 stopped
  thread #1: tid = 0x1243ee1, 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10, name = 'tid_303', queue = 'com.apple.main-thread'
  thread #2: tid = 0x1243ee6, 0x65f816e2 libsystem_kernel.dylib`__recvfrom + 10
  thread #3: tid = 0x1243ee7, 0x65f81aea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
  thread #4: tid = 0x1243ee9, 0x65f7e3d2 libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
  thread #5: tid = 0x1243eea, 0x65f816e2 libsystem_kernel.dylib`__recvfrom + 10, name = 'Debugger agent'
  thread #6: tid = 0x1243f1d, 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10, name = 'com.apple.uikit.eventfetch-thread'
  thread #8: tid = 0x1243f93, 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10, name = 'tid_6d0f', queue = 'NSOperationQueue 0x8069b300 (QOS: UTILITY)'
* thread #9: tid = 0x12443a9, 0x00222870 WatchWCSessionAppWatchOSExtension`debugger_interrupt_critical(info=0x81365400, user_data=0xb04dc718) at debugger-agent.c:2716:6, name = 'tid_a31f', queue = 'NSOperationQueue 0x8069b670 (QOS: UTILITY)', stop reason = breakpoint 1.1
  thread #10: tid = 0x1244581, 0x65f7fd32 libsystem_kernel.dylib`__workq_kernreturn + 10
(lldb) thread select 8
* thread #8, name = 'tid_6d0f', queue = 'NSOperationQueue 0x8069b300 (QOS: UTILITY)'
    frame #0: 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10
libsystem_kernel.dylib`mach_msg_trap:
->  0x65f7e396 <+10>: retl
    0x65f7e397 <+11>: nop

libsystem_kernel.dylib`mach_msg_overwrite_trap:
    0x65f7e398 <+0>:  movl   $0xffffffe0, %eax         ; imm = 0xFFFFFFE0
    0x65f7e39d <+5>:  calll  0x65f85f44                ; _sysenter_trap
(lldb) bt
* thread #8, name = 'tid_6d0f', queue = 'NSOperationQueue 0x8069b300 (QOS: UTILITY)'
  * frame #0: 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x65f7e8ff libsystem_kernel.dylib`mach_msg + 47
    frame #2: 0x66079679 libxpc.dylib`_xpc_send_serializer + 104
    frame #3: 0x660794da libxpc.dylib`_xpc_pipe_simpleroutine + 80
    frame #4: 0x66079852 libxpc.dylib`xpc_pipe_simpleroutine + 43
    frame #5: 0x66043a8f libsystem_trace.dylib`___os_activity_stream_reflect_block_invoke_2 + 30
    frame #6: 0x65de126f libdispatch.dylib`_dispatch_client_callout + 14
    frame #7: 0x65de3d71 libdispatch.dylib`_dispatch_block_invoke_direct + 257
    frame #8: 0x65de3c62 libdispatch.dylib`dispatch_block_perform + 112
    frame #9: 0x6604349a libsystem_trace.dylib`_os_activity_stream_reflect + 725
    frame #10: 0x6604ef19 libsystem_trace.dylib`_os_log_impl_stream + 468
    frame #11: 0x6604e44d libsystem_trace.dylib`_os_log_impl_flatten_and_send + 6410
    frame #12: 0x6604cb3b libsystem_trace.dylib`_os_log + 137
    frame #13: 0x6604f4aa libsystem_trace.dylib`_os_log_impl + 31
    frame #14: 0x4b4eb4e9 WatchConnectivity`WCSerializePayloadDictionary + 393
    frame #15: 0x4b4d7c4d WatchConnectivity`-[WCSession onqueue_sendResponseDictionary:identifier:] + 195
    frame #16: 0x4b4da435 WatchConnectivity`__66-[WCSession onqueue_handleDictionaryMessageRequest:withPairingID:]_block_invoke.411 + 35
    frame #17: 0x453c7df7 Foundation`__NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    frame #18: 0x453c7cf4 Foundation`-[NSBlockOperation main] + 88
    frame #19: 0x453cacee Foundation`__NSOPERATION_IS_INVOKING_MAIN__ + 27
    frame #20: 0x453c6ebd Foundation`-[NSOperation start] + 835
    frame #21: 0x453cb606 Foundation`__NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 27
    frame #22: 0x453cb12e Foundation`__NSOQSchedule_f + 194
    frame #23: 0x453cb067 Foundation`____addOperations_block_invoke_2 + 20
    frame #24: 0x65dedf49 libdispatch.dylib`_dispatch_block_async_invoke2 + 77
    frame #25: 0x65de4461 libdispatch.dylib`_dispatch_block_async_invoke_and_release + 17
    frame #26: 0x65de126f libdispatch.dylib`_dispatch_client_callout + 14
    frame #27: 0x65de3788 libdispatch.dylib`_dispatch_continuation_pop + 421
    frame #28: 0x65de2ee3 libdispatch.dylib`_dispatch_async_redirect_invoke + 818
    frame #29: 0x65df087d libdispatch.dylib`_dispatch_root_queue_drain + 354
    frame #30: 0x65df0ff3 libdispatch.dylib`_dispatch_worker_thread2 + 109
    frame #31: 0x66024fa0 libsystem_pthread.dylib`_pthread_wqthread + 208
    frame #32: 0x66024e44 libsystem_pthread.dylib`start_wqthread + 36
```
which is a thread in a "light" detach state (aka. coop detach), where we only unset the domain:
https://github.com/mono/mono/blob/4cefdcb7ce2d939ee78fb45d1b4913eb3bc064fd/mono/metadata/threads.c#L6084-L6111

Fixes https://github.com/mono/mono/issues/17926
2019-12-10 12:16:05 +01:00
Aleksey Kliger (λgeek) 7704bd1b92 [mini] Fix delegate trampoline virtual call via delgate Invoke (#18073)
* [mini] Fix delegate trampoline virtual call via delgate Invoke

If we need to jit the Invoke method of a delegate, we get tramp_info with a
NULL method.

Background: normally when we create a delegate around a virtual method,
handle_delegate_ctor will just create a virtual invoke trampoline with
mono_arch_get_delegate_virtual_invoke_impl which doesn't get here.  But if
we're asked to compile the delegate's Invoke method, then compile_special ()
will create a tramp_info with a null method, and return a delegate trampoline.

That's the case here - we had
  var del = SomeDelegate(obj.VirtualMethod);
  var invoke_method = del.GetType().GetMethod ("Invoke");
  invoke_method.Invoke (del, args);
or
  var del = SomeDelegate(obj.VirtualMethod);
  var another_del = OtherDelegate (del.Invoke);
  another_del (args);

in both cases, we end up in mono_delegate_trampoline with tramp_info->method ==
NULL.

in the second case the IL is like this:
   newobj instance void Derived::'.ctor'
   ldvirtftn instance void class Base::VirtualMethod()
   newobj instance void class SomeDelegate::'.ctor'(object, native int)

So delegate->target is a derived instance but delegate->method is some base
class method.

Addresses https://github.com/mono/mono/issues/17718

* [tests] Add tests for compiling delegate's Invoke method

Where the delegate calls a virtual method
2019-12-10 12:12:50 +01:00
Bernhard Urban-Forster fd44435a84 [debugger] remove unused thread suspend count (#18102) 2019-12-10 08:25:31 +01:00
Nikolay Sivov d1fc2ffa84 [support] Remove some dead code (#16674)
Both 'ptv' and 'tv' are unused since select() was replaced with poll() in 57b521e.
2019-12-10 00:21:00 +01:00
Steve Pfister 4cefdcb7ce Bump to mono/corefx@f3815a9 (#18090)
Picks up https://github.com/mono/corefx/pull/376
2019-12-09 21:29:40 +01:00
Jay Krell 5cbb1f4be8 [cxx] Fix mono-boehm to compile as C++. (#18086)
https://jenkins.mono-project.com/job/test-mono-pull-request-i386/32263/consoleText

```
      ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
boehm-gc.c: In function 'void mono_gc_base_init()':
boehm-gc.c:202:42: error: invalid conversion from
'void (*)(size_t) {aka void (*)(unsigned int)}' to
GC_on_heap_resize_proc {aka void (*)(long unsigned int)}' [-fpermissive]
  GC_set_on_heap_resize (on_gc_heap_resize);
                                          ^
In file included from ../../mono/utils/gc_wrapper.h:44:0,
                 from ../../mono/metadata/gc-internals.h:16,
                 from boehm-gc.c:16:
../../external/bdwgc/include/gc.h:132:21: note:
 initializing argument 1 of 'void GC_set_on_heap_resize(GC_on_heap_resize_proc)'
 GC_API void GC_CALL GC_set_on_heap_resize(GC_on_heap_resize_proc);
```
2019-12-09 18:59:10 +01:00
abrevet-dev 3d83c7429e [WinForms] No event should be triggered when calling ComboBox.Items.RemoteAt() (#18069)
* [WinForms] Fix wrong behavior when calling ComboBox.Items.RemoteAt() with index equals to SelectedIndex

* [WinForms] Fix #10643 No event should be triggered when calling ComboBox.Items.RemoteAt()

Fixes #10643
2019-12-09 15:51:28 +01:00
dotnet-maestro[bot] 612f2a8e88 Update dependencies from https://github.com/dotnet/arcade build 20191208.1 (#18089)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19608.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19608.1
2019-12-09 15:26:16 +01:00
Maxim Lipnin 17bba9e7dd [wasm] Clean up rsp-file (#18087) 2019-12-09 07:57:00 -06:00
Egor Bogatov 2befdcfa52 [netcore] Enable more tests for interpreter and llvm on CI (#17957)
* Enable more tests

* fix build?

* forward XUNIT_MONO_ENV_OPTIONS

* increase timeout

* ignore some tests for interpreter

* ignore more tests

* move interp specific issues to a separate rsp

* fix CI

* fix CI

* undo build.sh chmod

* revert chmod for xunit-summary-py

* improve xunit summary

* Ignore the whole System.Net.Tests namespace

* Ignore System.Text.Json

* disable the whole BinaryFormatterTests

* Disable System.Net.Http.Functional.Tests
2019-12-09 14:55:44 +01:00
Kenneth Pouncey 1462208991 [wasm][bcl][websockets] Add WebSocket support. (#18062)
Add the ability to initialize a `WebAssembly.Net.WebSockets::ClientWebSocket` from `System.Net.WebSockets.ClientWebSocket`.

`System.Net.WebSockets.ClientWebSocket` will delegate all calls to the WebAssembly ClientWebSocket.  

- Add support for marshaling `Uri` class correctly.  This was a cause of failures.
- Add bindings tests for `Uri` marhaling.
2019-12-09 13:32:17 +01:00
Jay Krell ed6b8024b0 fix warning: threadpool-worker-default.c: In function 'worker_try_create': 'now' may be used uninitialized (#18056)
https://jenkins.mono-project.com/job/build-source-tarball-mono-pullrequest/854/console
2019-12-09 08:17:54 +01:00
Jay Krell a6c4eafee8 Add some missing barriers when dealing with global caches (#18032)
* Add some missing barriers when dealing with global caches
accessed from multiple threads without locks.

This is based on earlier PR https://github.com/mono/mono/pull/17849.

Read-side barriers are removed.
  More analysis is needed to determine if they are needed (which pointer
  read vs. written).
Write-side barriers are compiler barrier + store-release instead of full barrier.

Note all candidates are converted to new form yet.

Cases that do motivate read-wide barriers are skipped.
e.g.
`mono_arch_start_dyn_call`
`get_agent_domain_info`
`init_jit_info_dbg_attrs`

* PR: Remove 'Try one more time..'
2019-12-08 15:30:48 +01:00
Sam Patel 74567a0a34 Update glib-remap.h to include g_module_address (#18076) 2019-12-07 07:11:59 +01:00
abrevet-dev 4be2a9a207 [WinForms] Handle menu for wheel button click (close the contextmenu) (#18049)
Fixes #18019
2019-12-06 18:41:47 +01:00
Ankit Jain d1db937e78 Bump msbuild to track xplat-master (#18050)
.. to get changes from https://github.com/mono/msbuild/pull/162 .

And bump roslyn to 3.4.0-beta4-19569-03 to match msbuild.
2019-12-06 16:55:44 +01:00
Aleksey Kliger (λgeek) 3dabeddfc6 [threads] Add back mono_threads_attach_tools_thread as a public API (#18048)
* [utils] Add back mono_threads_attach_tools_thread

In https://github.com/mono/mono/commit/a5da7b21f4b6dbc5eaa09c2addee91b84dc1dbd5
we got rid of "tools" threads internally to the runtime.

However since the API was previously marked with MONO_API it was an internal
API that some embedders depended on.

This PR adds back an (external-only) limited form of tools thread.

The runtime is aware of the Tools thread in that FOREACH_THREAD_* macros will
iterate over them, and the thread has a coop thread state machine. (That is,
mono_thread_info_current() and GC Safe and GC Unsafe transitions all work.)

However the thread is:
1. Not stopped by the GC
2. Is not interrupted by profiler sampling.
3. Does not have a "current domain"
4. (As a consequence of the above) cannot call managed methods or touch managed
objects.

Such threads are useful for low-level interaction with the runtime such as
querying metadata, the JIT state and other coordination.

mono_threads_attach_tools_thread should be called no more than once.  It should
not be called on a thread that is already attached with mono_thread_atach, and
vice versa.

Addresses https://github.com/mono/mono/issues/18011

* [threads] Make mono_threads_attach_tools_thread into a public API
2019-12-06 10:50:34 -05:00
Bernhard Urban-Forster 121928d29a [ppc32] delete leftover code from pre-monoctx area (#18072)
Also update assert which doesn't make sense since we have moved over to MonoContext

Some context: e7011c780f

Fixes: https://github.com/mono/mono/issues/18064
2019-12-06 11:35:11 +01:00
Jay Krell 12bc4717fd [cxx] Remove use of register keyword. (#18057)
[cxx] Remove use of register keyword.

https://jenkins.mono-project.com/job/test-mono-pull-request-wasm/19408/parsed_console/log_content.html

```
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/utils/mono-md5.c:259:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register guint32 a, b, c, d;
        ^~~~~~~~~
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/utils/mono-md5.c:259:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register guint32 a, b, c, d;
        ^~~~~~~~~
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/utils/mono-md5.c:259:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register guint32 a, b, c, d;
        ^~~~~~~~~
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/utils/mono-md5.c:259:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register guint32 a, b, c, d;
        ^~~~~~~~~
4 warnings generated.
```
2019-12-06 03:55:56 +01:00
Jay Krell a131e9bbb0 [cxx][netcore] Fix goto around init. (#18058)
https://jenkins.mono-project.com/job/test-mono-pull-request-wasm/19408/parsed_console/log_content.html
```
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/metadata/icall.c:882:1: error: jump to label 'exit' [-fpermissive]
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/metadata/icall.c:882:1: error: jump to label 'exit' [-fpermissive]
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/metadata/icall.c:882:1: error: jump to label 'exit' [-fpermissive]
```
2019-12-05 15:41:09 -06:00
Egor Bogatov 63f155ac46 Let user overwrite opt -Ox level (#18012) 2019-12-05 13:44:05 -06:00
Jay Krell b99ea70e43 Remove handles/MonoError from two socket icalls. (#17977)
Remove handles/MonoError from two socket icalls.

Ongoing removal of handles() icalls.
This is small, to pause and remove `mono_class_get_field_from_name_full` from w32socket.c.
2019-12-05 19:36:11 +01:00
Egor Bogatov 84839ab297 Merge pull request #18053 from EgorBo/fix-fneg-llvm
LLVM: use fneg instead of fsub for `-x`
2019-12-05 21:13:11 +03:00
Jay Krell ae9192f96f [netcore] Remove approx. 10 icalls. (#18018)
* [netcore] Remove ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni and _len icalls.
They are implemented in C#.
The C# is equivalent to the C, and could be used for classic runtime, except for the treatment of large/negative lengths.

* Remove a few more icalls.
Instead of ifdef and leaving them uncompiled when compiling netcore,
declare them and put asserts in them.
2019-12-05 13:10:29 -05:00
Alexander Köplinger 269d509e42 Remove DNS lookups of the local hostname in tests (#18059)
This allows us to workaround issues we currently have in the macOS bot network where DNS lookup of the hostname fails.
2019-12-05 18:08:26 +01:00
Zoltan Varga e67673fac8 [llvm] Avoid decomposing OP_STOREV_MEMBASE early for types which contains no references. (#18041) 2019-12-05 16:02:43 +01:00
Martin Baulig cc720b83aa [System.Net.Http]: Add workaround for mono/mono#17897. (#17992)
Use `(UriKind)300` (which is the same as setting `MONO_URI_DOTNETRELATIVEORABSOLUTE=true`)
when parsing Uri headers.
2019-12-05 14:36:07 +01:00
Jay Krell 5a5e092a53 Fix ifndef include guard in icall-decl.h. (#18055)
There was no clash so ok either way, but this is more like intended.
2019-12-05 10:19:24 +01:00
Egor Bogatov a3fbb64493 Convert to 0/1 in OP_XEQUAL (#18038) 2019-12-05 02:38:34 +01:00
abrevet-dev 186f9cd8c4 [WinForms] Fix wrong behavior of RadioButton auto-check (#18044)
Fixes #18020
2019-12-05 00:41:49 +01:00
Alexander Köplinger 4590bf6cac Bump bockbuild to get https://github.com/mono/bockbuild/pull/136 (#18043) 2019-12-05 00:33:08 +01:00
Alexander Köplinger f965e5d3e8 Fix formatting of README.netcore.md 2019-12-05 00:11:14 +01:00
EgorBo 55a3c10e72 remove some items from rsp 2019-12-05 02:09:11 +03:00
EgorBo 92047c453f use fneg instead of fsub 2019-12-05 02:03:24 +03:00
Bernhard Urban-Forster 9d58bc1d12 [amd64] align application stack pointer in signal handler (#18021)
* [amd64] align application stack pointer in signal handler

16byte stack pointer alignment is only required in certain places by the ABI, so the assumption that it holds all the time is wrong (though, it passed CI 😅). We have to setup the frame properly, i.e. we have to ensure the stack pointer is properly aligned. That's what we have done previously too.

Regression of https://github.com/mono/mono/pull/17922
Fixes https://github.com/mono/mono/issues/18006

* add ALIGN_DOWN_TO macro

* remove unnecessary ifndefs
2019-12-04 15:23:19 -06:00
Alexander Köplinger 59554712cc Update submodules before running external/bdwgc/autogen.sh (#18042)
Otherwise we'll run into issues because in configure.ac we update submodules _after_ we try to call external/bdwgc/configure (which won't be there if autogen.sh didn't run).
This would manifest itself as `*** No rule to make target 'all'.` in external/bdwgc when you build as there's no Makefile.
2019-12-04 22:16:21 +01:00
Jonathan Peppers 8511ae20f0 [corlib] add InternalsVisibleTo for Mono.Android (#18040)
* [corlib] add InternalsVisibleTo for Mono.Android

Context: https://github.com/xamarin/xamarin-android/pull/3991

In Xamarin.Android, we have a bit of System.Reflection usage on
startup:

https://github.com/xamarin/xamarin-android/blob/bbbe2ed36e6eeb7cce0905dcbfdaeaa30754070f/src/Mono.Android/Android.Runtime/UncaughtExceptionHandler.cs#L47-L67

These methods are in `mscorlib.dll` and `internal`. If we had
`[assembly: InternalsVisibleTo ("Mono.Android")]` we could avoid the
System.Reflection.

This is already done for `Xamarin.iOS`, `Xamarin.Mac`, etc. so
hopefully it's OK to add one more?

We could then, just call these methods directly:

* `System.Diagnostics.Debugger.Mono_UnhandledException`
* `AppDomain.CurrentDomain.DoUnhandledException`

The results are possibly a 100-250ms improvement to startup:

    Before:
    12-03 14:27:51.450  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s727ms
    12-03 14:27:57.310  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s723ms
    12-03 14:28:03.216  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s703ms
    12-03 14:28:09.054  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s679ms
    12-03 14:28:14.953  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s711ms
    After:
    12-04 09:13:18.248  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s608ms
    12-04 09:13:24.087  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s570ms
    12-04 09:13:29.997  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s566ms
    12-04 09:13:35.805  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s498ms
    12-04 09:13:41.670  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s475ms

This was the Xamarin.Forms integration project in xamarin-android.
Running a `Debug` build on a HAXM x86 emulator on Windows.

https://github.com/xamarin/xamarin-android/tree/master/tests/Xamarin.Forms-Performance-Integration

* Bump API snapshot submodule
2019-12-04 21:01:20 +01:00
Kenneth Pouncey 83cac0306c [wasm][build] Modify to use -s USE_ZLIB=1 instead of zlib support headers (#18031)
* [wasm] Modify to use -s USE_ZLIB=1 instead of zlib support headers

- This will remove the dependency on the mono zlib header files.
- Moves the zlibtest.cs to tests/src directory to help clean up the main directory.

* [wasm][packager] Remove the zlib headers from the zlib build

- use `-s USE_ZLIB=1` instead when building.
2019-12-04 20:11:43 +01:00
Alexander Köplinger 4e8ead7caf Remove mk/ folder (#18039)
The plan to put additional helpers into this directory didn't materialize and we can just inline the one thing we have in common.mk where needed.
2019-12-04 19:55:22 +01:00
Kenneth Pouncey 42c5ccc298 [wasm][reference] Update binary references to include wasm websocket assemblies. (#18029) 2019-12-04 11:52:19 +01:00
Jonathan Peppers b816189b94 [android] don't probe directories for .config files (#18024)
* [android] don't probe directories for .config files

In Xamarin.Android, on startup we see logging like this for every .NET
assembly:

    12-03 14:27:42.104 26842 26842 D Mono    : Prepared to set up assembly 'FormsViewGroup' (/storage/emulated/0/Android/data/Xamarin.Forms_Performance_Integration/files/.__override__/FormsViewGroup.dll)
    12-03 14:27:42.104 26842 26842 D Mono    : Assembly FormsViewGroup[0xebcee9c0] added to domain RootDomain, ref_count=1
    12-03 14:27:42.104 26842 26842 D Mono    : Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/Xamarin.Forms_Performance_Integration/files/.__override__/FormsViewGroup.dll'.
    12-03 14:27:42.104 26842 26842 D Mono    : Config attempting to parse: '/storage/emulated/0/Android/data/Xamarin.Forms_Performance_Integration/files/.__override__/FormsViewGroup.dll.config'.
    12-03 14:27:42.104 26842 26842 D Mono    : Config attempting to parse: '/Users/builder/jenkins/workspace/archive-mono/2019-10/android/release/sdks/out/android-x86-release/etc/mono/assemblies/FormsViewGroup/FormsViewGroup.config'.

In most cases, no `.dll.config` file exists and so it probes this
macOS-looking path:

    /Users/builder/jenkins/workspace/archive-mono/2019-10/android/release/sdks/out/android-x86-release/etc/mono/assemblies/FormsViewGroup/FormsViewGroup.config

It looks like this is happening because nothing in Xamarin.Android
calls `mono_set_dirs` or `mono_set_config_dir` and so it falls back to
using `MONO_CFG_DIR`. `MONO_CFG_DIR` is set to a path on the build
machine.

Even if Xamarin.Android *did* call `mono_set_config_dir`, the code
appends `mono/assemblies`:

    cfg = g_build_filename (cfg_dir, "mono", "assemblies", aname, cfg_name, (const char*)NULL);

So it doesn't seem useful to use this fallback at all, there would
never be a file found.

I wrapped the appropriate code in `#ifndef TARGET_ANDROID` blocks.

I was able to see a minor *maybe* ~20ms performance improvement on
startup:

    Before:
    12-03 14:27:48.494 26903 26903 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:601::443900
    12-03 14:27:54.356 26963 26963 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:587::495400
    12-03 14:28:00.263 27021 27021 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:586::147100
    12-03 14:28:06.135 27074 27074 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:593::639100
    12-03 14:28:11.988 27129 27129 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:571::194900
    After:
    12-03 14:46:50.590 27737 27737 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:503::918700
    12-03 14:46:56.517 27794 27794 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:570::533600
    12-03 14:47:02.368 27850 27850 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:537::435000
    12-03 14:47:08.289 27904 27904 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:587::830900
    12-03 14:47:14.130 27965 27965 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:555::593400

This was the Xamarin.Forms integration project in xamarin-android.
Running a `Debug` build on a HAXM x86 emulator on Windows.

https://github.com/xamarin/xamarin-android/tree/master/tests/Xamarin.Forms-Performance-Integration

* Add --enable-minimal=cfgdir_config

* This also defines `DISABLE_CFGDIR_CONFIG`
* Used this setting for android
2019-12-04 11:50:59 +01:00
abrevet-dev a79c4d11a4 [WinForms] Editing the DialogResult of the form in the button click event was ignored. (#18025)
Fixes #12022
2019-12-04 11:49:43 +01:00
Jérôme Laban 91d3d63858 Update to emscripten 1.39.4 (#18016)
Fixes for i64 returning values with dynamic runtime configuration.

See https://github.com/emscripten-core/emscripten/issues/9850
2019-12-04 09:11:22 +01:00
monojenkins 37ba834ee1 [bcl] Update BCL Linked Size 2019-12-04 08:29:56 +01:00
Aleksey Kliger (λgeek) 467d46f8ab [configure.ac] Build on FreeBSD/PowerPC64 (#18015)
Community contribution from https://github.com/mono/mono/issues/18009
from @igorzigorz
2019-12-03 19:56:30 -05:00
Egor Bogatov 85826e5c27 Merge pull request #18013 from EgorBo/intrin-string-memcpy
[netcore] Improve jitdiff tool
2019-12-04 02:19:32 +03:00
Maxim Lipnin e7ef2f3d5f [Wasm] Enable system nunit tests on ci (#17716)
* [wasm][nunit tests] Enable nunit tests for System on CI

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.Mail.SmtpClientTest tests

* Fix test suit name

* [wasm][nunit tests] Exclude MonoTests.System.Net.HttpListenerPrefixCollectionTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.HttpListenerTest nunit tests

* [wasm][nunit tests] Exclude MonoTests.System.Net.NetworkInformation.NetworkInterfaceTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.Sockets.UdpClientTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.ComponentModel.PropertyDescriptorCollectionTests nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Collections.Specialized.NameValueCollectionTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Collections.Concurrent.ConcurrentBagTests nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.ComponentModel.BackgroundWorkerTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.NetworkInformation.IPInterfacePropertiesTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.ComponentModel.EventDescriptorCollectionTests nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.ComponentModel.AsyncOperationManagerTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.HttpListenerRequestTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.ServicePointTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.Sockets.TcpListenerTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.WebClientTestAsync nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.WebProxyTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.WebRequestTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Security.Cryptography.X509Certificates.X509Certificate2CollectionTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Timers.TimerTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.HttpListenerTest.PropertiesWhenClosedSet3 test

* [wasm][nunit tests] Increase timeout for System nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Security.Cryptography.X509Certificates.X509Certificate2CollectionTest.Find_FindByIssuerName test

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.Mail.SmtpClientTest tests

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.HttpListenerPrefixCollectionTest nunit tests

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.HttpListenerTest nunit tests

* Increase CI timeout for System.Core nunit tests

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.Sockets.UdpClientTest nunit tests

* [wasm][nunit tests] Update NetworkInterface class to throw PNSE

* [wasm][nunit tests] Ignore failing MonoTests.System.ComponentModel.PropertyDescriptorCollectionTests nunit tests

* [wasm][nunit tests] Ignore failing MonoTests.System.Collections.Specialized.NameValueCollectionTest nunit tests

* [wasm][nunit tests] Adjust the use of Ignore attribute

* [wasm][nunit tests] Categorize failing MonoTests.System.Collections.Concurrent.ConcurrentBagTests nunit tests

* [wasm][nunit tests] Categorize failing MonoTests.System.ComponentModel.BackgroundWorkerTest nunit tests

* [wasm][nunit tests] Categorize failing MonoTests.System.Net.NetworkInformation.IPInterfacePropertiesTest nunit tests

* [wasm][nunit tests] Ignore failing MonoTests.System.Net.NetworkInformation.IPInterfacePropertiesTest nunit tests

* [wasm][nunit tests] Remove the category for passing MonoTests.System.Net.HttpListenerRequestTest nunit tests

* [wasm][nunit tests] Exclude failing part of MonoTests.System.Net.ServicePointTest.DnsRefreshTimeout test

* [wasm][nunit tests] Remove PNSE expectation in failing MonoTests.System.Net.Sockets.TcpListenerTest nunit tests.

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.WebProxyTest nunit tests due to libc issue

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.WebRequestTest.DefaultWebProxy test

* [wasm][nunit tests] Exclude failing MonoTests.System.Security.Cryptography.X509Certificates.X509Certificate2CollectionTest nunit tests due to compare info issue
2019-12-03 22:40:09 +01:00
abrevet-dev 174f2f6a70 [WinForms] SetRowSpan and SetColumnSpan does not trigger the good exception. (#18002)
According to .Net documentation:

Exceptions
ArgumentOutOfRangeException

value is less than 1.
2019-12-03 21:38:38 +01:00
EgorBo 5f58bb0959 Improve TryParseFunctionName in jitdiff 2019-12-03 18:13:48 +03:00
EgorBo ea0824cb22 Remove dead docs 2019-12-03 18:11:42 +03:00
Egor Bogatov 8150a38dae Don't throw NRE when len == 0 in Buffer.Memmove (#18004) 2019-12-03 15:21:41 +01:00
Steve Pfister a3c25e7b4f Added Obsolete to AppDomain.CreateDomain for monodroid. (#18000)
* Added Obsolete to AppDomain.CreateDomain for monodroid.  The intent is to be helpful for when .NET 5 comes along

* Changed AssemblyLoadContext link to a better doc

* Bump API snapshot submodule
2019-12-03 14:23:49 +01:00
Jo Shields a2f9fb77a3 Bump version to 6.11 (#17990) 2019-12-02 15:58:38 -05:00
Di Wu 0370372ce3 Fix raw security descriptor parsing (#17482)
Fix security identifier parsing error with the following SDDL:

```
O:S-1-5-21-1356517589-3987021482-2501375073-1001G:S-1-5-21-1356517589-3987021482-2501375073-513D:(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;S-1-5-21-1356517589-3987021482-2501375073-1001)
```
2019-12-02 20:03:49 +01:00
Jay Krell 72aa81e901 Remove handles/MonoError from Mono.RuntimeClassHandle. (#17805) 2019-12-02 19:18:03 +01:00
Bernhard Urban-Forster a9a0a1e5b9 [profiler] disable inlining when coverage profiler is used and fix allocation sizes (#17986)
* [profiler] let compiler decide about the size of an entry

* [profiler] disable inlining when coverage profiler is used
2019-12-02 19:04:13 +01:00
Vlad Brezae 640ffa7a62 [sgen] Don't trigger collections during allocation of thread objects (#17970)
Allocation of thread objects usese the mono_object_new_mature API. These objects are allocated before the thread is finished attaching to the runtime. This means that a collection can happen on an unattached thread as well as all its callbacks, which is a counter-intuitive behavior.

On android this is problematic because at the end of the SGen collection we need to call the java collection, which needs to have the thread attached. This could probably be fixed instead from the Xamarin.Android side, but this approach seems simpler and saner.

Fixes https://github.com/mono/mono/issues/17878
2019-12-02 12:54:21 -05:00
Jay Krell d7f5a5fdfe Remove handles/MonoError from Mono.Security.Cryptography.KeyPairPersistence icalls. (#17967) 2019-12-02 12:51:16 -05:00
dotnet-maestro[bot] 9bd1b2e065 Update dependencies from https://github.com/dotnet/arcade build 20191201.1 (#17985)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19601.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19601.1
2019-12-02 18:03:11 +01:00
abrevet-dev 1454b010ae [WinForms] the Text property was not set for every cell in the column when UseColumnTextForLinkValue is true (#17981)
* [WinForms] Fix #17980 Prevent from crashing when DataGridView  is null.

Reproducer:

DataGridViewLinkColumn links = new DataGridViewLinkColumn();
links.UseColumnTextForLinkValue = true;

* [WinForms] Fix #17980 The field useColumnTextForLinkValue of DataGridViewLinkCell was not cloned.

* [WinForms] Fix #17980 the Text property was not set for every cell in the column when UseColumnTextForLinkValue is true

Fixes #17980
2019-12-02 17:39:43 +01:00
abrevet-dev 865e955840 [WinForms] Fix #9726 imageLayout of DataGridViewImageCell was not cloned. (#17974)
Fixes #9726
2019-12-02 17:38:08 +01:00
Thays Grazia 3834be3d22 [DIM] Fix behavior when there is an override of a method in a generic interface. (#17963)
* Fix behavior when there is an override of a method in a generic interface.
Fixes #17869
2019-12-02 13:20:00 -03:00
Jay Krell 7356aedc77 Refactor Monitor to eliminate near identical duplicated code. (#17964)
The only difference in the copies, was that one had an infinite timeout
so implied TRUE result unless interrupted.

Where the other copy had a timeout and could return FALSE as a result.

They both used the same underlying, with timeout, so it wasn't really an optimization,
just duplicated code.

Also there is subtelty around having a return value or an out parameter.
That is carefully preserved.

Also, coop is fixed, by creating a frame only in a slow path.
Presumably creating a thread is quick and stateless enough such that this
is not too late.
2019-12-02 11:06:11 -05:00
Calvin Buckley 369806e3e6 Disable ConnectFailAsync test on AIX (#17975)
Hangs runtime; prevents CI from completing run. (Another test can
also hang the runtime, but is hard to reproduce and inconsistent
about that.)

This should be fixed eventually, but...
2019-12-02 10:34:07 +01:00
Zoltan Varga f13e6ba91a [wasm] Add beginnings of SIMD support in AOT mode. (#17971)
* [jit] Implement beginnings of SIMD support for WASM.

* [wasm] Add a DISABLE_WASM_NO_NETCORE Make.local conditional to disable non-netcore builds during development.

* [wasm] Add a --simd argument to the packager.

* Remove some duplicate defines.

* Fix an windows assertion.
2019-12-02 07:21:17 +01:00
campersau b0f0b14023 [wasm][bcl][http] Fix descriptive message for the PlatformNotSupportedException (#17919)
* Fix descriptive message for the `PlatformNotSupportedException`

* Add more descriptive message to the `Properties` `PlatformNotSupportedException`
2019-12-02 05:20:15 +01:00
EgorBo d33ce1c3ec enable only for netcore 2019-12-01 17:38:33 -06:00
EgorBo 376d3acb29 fix failing tests 2019-12-01 17:38:33 -06:00
EgorBo b77f757679 fix build 2019-12-01 17:38:33 -06:00
EgorBo 1b7c7e6075 Address feedback and fix C++ warnings 2019-12-01 17:38:33 -06:00
EgorBo e2241969f5 Optimize box(X) == null to false 2019-12-01 17:38:33 -06:00
Jay Krell fffeb23239 sockets: Remove piecemeal ifndef ENABLE_NETCORE since the file has it broadly. 2019-12-01 17:33:24 -06:00
Zoltan Varga ae4b678b94 [wasm] Avoid rebuilding corelib in build-wasm-bcl-netcore. (#17969) 2019-11-30 03:18:42 +01:00
Bernhard Urban-Forster 4d0feffa42 [interp] track valuetype stack for CEE_RET too (#17968)
[interp] track valuetype stack for CEE_RET too

Usually the stack depth is determined via basic block predecessors, but  that only works for forward branches.

Fixes https://github.com/mono/mono/issues/17924
2019-11-30 00:06:05 +01:00
Zoltan Varga 6c0bfdc3f3 [wasm] Add more netcore test suites. (#17965)
* [wasm] Handle more exceptions in the xunit runner.

* [wasm] Add more corefx test suites.

* Add more icall signatures.

* Add support for running the System.Compression test suites.
2019-11-29 18:17:40 +01:00
Zoltan Varga d1735a8356 Interpreter fixes. (#17966)
Interpreter fixes.
2019-11-29 16:26:05 +01:00
Ankit Jain c92a96ccb5 Bump msbuild to track xplat-master (#17950)
* Bump msbuild to track xplat-master

* Bump nuget.exe to 5.4.0
2019-11-29 12:01:06 +01:00
Egor Bogatov 9a18b6fd6f [netcore] Improve Jitdiff tool (#17960)
use `objdump` arguments to reduce verbosity (no raw bytes, etc) and make the dasm more diff-friendly.
On Linux all functions have a random prefix (address) - replace it with `0xD1FFAB1E` constant). On macOS it's fine by default.

Also, allow to generate diffs for a single assembly via `dump-asm-lib` rule.
2019-11-29 11:54:01 +01:00
Kenneth Pouncey 608c93643e [wasm][http] Fix race condition as a result of using TaskCompletionSource: RangeError: Maximum call stack size on Safari (#17946)
There is a race condition on Safari as a result of using TaskCompletionSource that causes a stack exceeded error being thrown during Blazor startup.

Safari throws the following error:

```
[Error] Unhandled Promise Rejection: RangeError: Maximum call stack size exceeded.
    step (blazor.webassembly.js:2530)
    fulfilled (blazor.webassembly.js:2500)
    promiseReactionJob

```

- Modify `WebAssemblyHttpMessageHandler.cs` to create the TaskCompletionSource to run continuations asynchronously.
   - `TaskCompletionSource<HttpResponseMessage>(TaskCreationOptions.RunContinuationsAsynchronously);`

- There is a second part to this on AspNetCore in `Renderer.cs` to process it's pending startup tasks to run continuations asynchronously to compliment the TaskCompetionSource of the Http response message.

The following link discusses the potential stack/race problem that can occur when using TaskCompletionSource:  https://devblogs.microsoft.com/premier-developer/the-danger-of-taskcompletionsourcet-class/
2019-11-29 07:14:19 +01:00
Zoltan Varga 59a9af6d7c Revert "Use range metadata (#17956)" (#17958)
This reverts commit fde058518d.
2019-11-28 21:52:01 +01:00
Egor Bogatov fde058518d Use range metadata (#17956) 2019-11-28 14:26:35 +01:00
Kenneth Pouncey d6dea097ca [wasm] Marshal null string correctly. (#17955) 2019-11-28 07:31:59 +01:00
Zoltan Varga 79db9b2a87 [interp] Make calli non recursive as well. (#17953) 2019-11-28 06:26:36 +01:00
EgorBo 6360ccbfe3 Add quick diff 2019-11-27 19:15:56 -06:00
EgorBo e333f13710 Add jit-diff tools 2019-11-27 19:15:56 -06:00
Ryan Lucia 9c1cae02ca Change signature, add cast 2019-11-27 19:13:30 -06:00
Ryan Lucia 0c3036abc7 [mini] Move bundled native library loading into the runtime 2019-11-27 19:13:30 -06:00
Jay Krell b2817e6404 [cxx] MonoJitICallId same between C and C++.
This is optional.
The real problem was -enable-cxx not actually compiling some files as C++.
This is still reasonable, to ward off the danger of that occuring again.
2019-11-27 19:12:32 -06:00
Jay Krell c3da0ad518 Update netcore. 2019-11-27 19:11:35 -06:00
Jay Krell 4a15e73429 Remove handles/MonoError from Mono.RuntimeMarshal and Mono.SafeStringMarshal. 2019-11-27 19:11:35 -06:00
Nikita Voronchev 7db2389846 [WinForms][UIA] Add to the PropertyGrid new internal event to track grid items expanded state update (#17731)
This PR is needed for the https://github.com/mono/uia2atk/pull/6 one.
2019-11-27 23:59:04 +01:00
abrevet-dev f135312b44 [WinForms] DrawToBitmap() did not draw children controls (#17676)
Fixes #13777
2019-11-27 23:38:04 +01:00
Sergey Podobry abc75476d7 [Mono.Security] Do not decode data beyond detected length in ASN1 parser (#17751)
If `byte[] data` has additional data at the end `Decode` will try to parse it and will generate incorrect tags or throw an exception. This fix makes `Decode` to use only `nLength` bytes from `byte[] data`.
2019-11-27 23:37:20 +01:00
Aleksey Kliger (λgeek) b6a351c330 [threadpool] Decrement max_working when worker times out (#17927)
[threadpool] Decrement max_working when worker times out

The corresponding code in CoreCLR:
https://github.com/dotnet/runtime/blob/bf88f146412d1e2d41779422337184a802f186c9/src/coreclr/src/vm/win32threadpool.cpp#L2156-L2164

The issue is that counter._.max_working is only ever changed by:
1. the monitor_thread when it detects starvation (increment by 1).
2. the hill climbing algorithm (increment or decrement).

Creating a periodic load of creating many workers at once followed by a minute
or more of quiescence increases the variable worker.counters._.max_working in
monitor_thread(). Once that counter matches worker.limit_worker_max,
monitor_thread() keeps looping without unparking or creating a thread, even
though the actual number of threads/workers is small. If the existing threads
are all waiting on work that needs a new thread, then a deadlock occurs.

With this change, when a parked worker times out, it will lower max_working to
the number of active (working + parked + starting) threads minus itself (but no
less than limit_worker_min). As a result, monitor_thread will only increment
max_working as long as none of the already running workers are timing out.

Attempt to address https://github.com/mono/mono/issues/17833

---

Also allow monitor_thread to start workers if there aren't enough active, even if the max worker limit has been reached.

Work around a pathological condition where the work_item_count is non-zero, and
the max_working limit has been reached, but the number of active threads is
still below the max.  In that case, unpark some workers and start some new
threads.

May address http://work.azdo.io/827206
2019-11-27 22:06:17 +01:00
Jay Krell 3e369ba8c9 Cleanup initialize_object_slots, remove unused GetHashCode (ghc) handling. (#17834)
Fix possible race conditions involving multiple writes to globals, by
removing one of the two globals involved in finalize.
2019-11-27 14:25:14 -05:00
abrevet-dev 6145a397d6 [WinForms] Refactor selected indexes in TabControl.Remove (#17608)
Fixes #12337
2019-11-27 19:55:00 +01:00
abrevet-dev 5944e72d72 [WinForms] Returns real installed input languages on Windows (#17653)
The method InstalledInputLanguages() always returned InvariantCulture. Now, installed input languages are detected properly on Windows.

Reproducer:

`Console.WriteLine(InputLanguage.CurrentInputLanguage.Culture.TwoLetterISOLanguageName.ToUpper());`

Related issue: #13552
2019-11-27 19:46:04 +01:00
abrevet-dev 41ba5846b3 [WinForms] DefaultCellStyle was not cloned deeply in DataGridViewRow.Clone() (#17755)
Fixes #16557
2019-11-27 19:41:15 +01:00
HebaruSan d62eed676e [WinForms] Fix X11 theming (#17888)
## Background

In Mono 5 and earlier, the active GTK or KDE theme would be sourced for system colors, allowing dark themes to be obeyed:

![image](https://user-images.githubusercontent.com/1559108/69486043-f3bf0500-0e0c-11ea-9b29-1654ba4e6d9a.png)

This allowed WinForms apps to blend in and look more like native apps.

## Problem

In Mono 6, this capability was lost (as noted in passing in #14325). WinForms apps now only look like this, regardless of the system color settings:

![image](https://user-images.githubusercontent.com/1559108/69486114-dccce280-0e0d-11ea-8107-fe1653b2d816.png)

This looks somewhat jarring and worse than previous Mono releases, for users with a dark system theme.

## Cause

During load of the system settings (in the static constructor of `X11DesktopColors`), `Theme.SetSystemColors` passes system color data to `System.Drawing.KnownColors.Update`, which populates them into `System.Drawing.KnownColors.ArgbValues`. In Mono 5 and earlier, this flowed through to the visible UI.

It seems that as of Mono 6, this table no longer affects the visible WinForms UI (although it is still being updated!). Instead, a same-but-different table in `System.Drawing.KnownColorTable` drives the system colors now. I was not able to identify the commit in which this change was made.

## Changes

Now `Theme.SetSystemColors` accesses `System.Drawing.KnownColorTable.s_colorTable` instead, and WinForms apps once again obey GTK and KDE themes:

![image](https://user-images.githubusercontent.com/1559108/69486043-f3bf0500-0e0c-11ea-9b29-1654ba4e6d9a.png)

Fixes KSP-CKAN/CKAN#2881.
2019-11-27 19:13:11 +01:00
RizvanKuliev a73e7b8af2 [WinForms] Fix Recalculate in ScrollableControl (#17163) 2019-11-27 19:09:19 +01:00
Alexander Köplinger 9954579c2a [sdks] Call mono_gc_init_finalizer_thread() on iOS device runtimes
These runtimes are configured with `--with-lazy-gc-thread-creation=yes` so they don't start a GC finalizer threads by themselves.
XI does this because they want to delay creating that thread for some time after startup.

We can just do it immediately, the important part is that it _does_ exist.
2019-11-27 18:36:02 +01:00
Alexander Köplinger c66c7814d0 [sdks] Add option to enable debug server for iOS test app
Include .pdb files in iOS test app if the DEBUG variable is set and wait for managed debugger to attach.
2019-11-27 18:36:02 +01:00
Alexander Köplinger 18ddc2e45d [sdks] Fix loading of assemblies in assembly_preload_hook()
We need to check whether the assembly name passed to us already contains .exe/.dll and append it otherwise.
Fixes loading of assemblies via the hook, we were falling back to the usual path resolving logic (which doesn't work in netcore mode).
2019-11-27 18:36:02 +01:00
Alexander Köplinger a0d79a4886 [sdks] Add netcore option for iOS SDK 2019-11-27 18:36:02 +01:00
Alexis Christoforides 167913524f [merp] Use timeline (and generate timeline breadcrumbs) for SendExceptionToTelemetry() (#17913)
Fixes https://github.com/mono/mono/issues/17790
2019-11-27 11:56:12 -05:00
Bernhard Urban-Forster 4c595069e7 [arm] if mtriple is provided, do not set -march (#17937)
[arm] if mtriple is provided, do not set -march

E.g. when passing `-march=arm -mtriple=armv7s-ios`, `-march` will win and thus ignore `armv7s`.

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

* Caused by 5e318afd2e
* Related with 4cd5068230
* Almost fixed by e431093f73

Hopefully we are done with it.
2019-11-27 17:36:03 +01:00
monojenkins 9dfeb545d5 [bcl] Update BCL Linked Size (#17322) 2019-11-27 13:43:31 +01:00
Bernhard Urban-Forster 690af29ad9 [amd64] do not stack allocate on the application stack for the transtion from alstack handling (#17922)
### Backstory
This test is failing in the interpreter (ONLY on Debian9/amd64. Not Ubuntu/amd64. Not macOS/amd64):
https://github.com/mono/mono/blob/0fed03ed63ed4ea742c4511d8edc3bc1c6f4044f/mcs/class/Mono.Debugger.Soft/Test/dtest.cs#L2484-L2499
Where the debuggee is just some unsafe code that tries to read from unmapped memory, thus causing a segfault.

So the test expects the runtime to send a CRASH event via the managed debugger interface. This happens very late in the crash handling machinery:
https://github.com/mono/mono/blob/0fed03ed63ed4ea742c4511d8edc3bc1c6f4044f/mono/mini/mini-posix.c#L1105

However, the runtime would never reach that, because it silently crashes when calling `backtrace`:
https://github.com/mono/mono/blob/0fed03ed63ed4ea742c4511d8edc3bc1c6f4044f/mono/mini/mini-posix.c#L939

At the point where the SIGSEGV happens, the native stack trace looks like this:
```
Thread 1 "mono-sgen" received signal SIGSEGV, Segmentation fault.
interp_exec_method_full (frame=0x555555c51f18, context=0x555555c38350, clause_args=clause_args@entry=0x0, error=0x555555c53f18, error@entry=0x7fffffffd8b0) at interp/interp.c:4463
4463                            sp[-1].data.i = *(gint32*)sp[-1].data.p;
(gdb) bt
%0  interp_exec_method_full (frame=0x555555c51f18, context=0x555555c38350, clause_args=clause_args@entry=0x0, error=0x555555c53f18, error@entry=0x7fffffffd8b0) at interp/interp.c:4463
%1  0x000055555569237a in interp_runtime_invoke (method=<optimized out>, obj=<optimized out>, params=<optimized out>, exc=0x0, error=0x7fffffffd8b0) at interp/interp.c:1900
%2  0x0000555555590745 in mono_jit_runtime_invoke (method=0x555555bfdc38, obj=<optimized out>, params=0x7fffffffd858, exc=0x0, error=0x7fffffffd8b0) at mini-runtime.c:3001
%3  0x0000555555778c4c in do_runtime_invoke (method=0x555555bfdc38, obj=<optimized out>, params=<optimized out>, exc=<optimized out>, error=0x7fffffffd8b0) at object.c:3052
%4  0x000055555577b7d0 in do_exec_main_checked (method=0x555555bfdc38, args=<optimized out>, error=0x7fffffffd8b0) at object.c:5184
%5  0x000055555559a2aa in mono_jit_exec_internal (argv=0x7fffffffdcb8, argc=1, assembly=0x0, domain=0x555555bf9d40) at driver.c:1320
%6  mono_jit_exec (domain=domain@entry=0x555555bf9d40, assembly=assembly@entry=0x555555c66ae0, argc=argc@entry=1, argv=argv@entry=0x7fffffffdcb8) at driver.c:1265
%7  0x000055555559b8e2 in main_thread_handler (user_data=<synthetic pointer>) at driver.c:1402
%8  mono_main (argc=<optimized out>, argv=<optimized out>) at driver.c:2622
%9  0x000055555558b757 in mono_main_with_options (argv=<optimized out>, argc=<optimized out>) at main.c:52
%10 main (argc=<optimized out>, argv=<optimized out>) at main.c:434
```
Stepping into the crash handling machinery, the picture looks a bit different:
```
Thread 1 "mono-sgen" hit Breakpoint 1, altstack_handle_and_restore (ctx=0x7fffffffd2d0, obj=0x0, flags=0) at exceptions-amd64.c:871
871     {
(gdb) bt
%0  altstack_handle_and_restore (ctx=0x7fffffffd2d0, obj=0x0, flags=0) at exceptions-amd64.c:871
%1  0x00005555556957de in interp_exec_method_full (frame=0x555555c53f08, context=0x555555c38350, clause_args=0x0, error=0x555555c53f18) at interp/interp.c:4461
%2  0x0000000000000000 in ?? ()
```
So it looks like we messed up in the transition from altstack back to the program stack.

 ### The fix

The problem is that `backtrace` consults the unwind information emitted at the point where SIGSEGV happens in `interp_exec_method_full ()`. However at that given program code, there is no function call that allocates space to pass arguments on the stack. Still, we massage the stack to do that in the signal handler, which does not add up with the emitted unwind information by the C compiler.

Note that without the fix, crashing in `backtrace` is the worst case. In other cases we might (1) get still a correct stack trace, or (2) we get a wrong stack trace, and `backtrace` will not crash. So this PR might improve the crash experience overall.

This also reverts commit cff400f3fae9775ac734f8a691339e59a272872c.
2019-11-27 12:20:47 +01:00
Zoltan Varga c4136ebd94 [interp] Non-recursive interpreter (#16461)
* Aling alloca_size to 8.

* Prevent some false pinning in the monitor-resurrection.cs test when using the non-recursive interpreter.

* [runtime] Add a mono_compiler_barrier () function.

* Add a MONO_GET_SP opcode to pass to enter/exit_gc_safe_region, ldloca might not return a native stack address with the interpreter.

* Add an interpreter/gc callback to mark the interpreter stack.

* Copy only an integer in ENDFILTER.

* Add a native_stack_addr field to InterpFrame so the EH code has something to compare against native stack addresses.

* Add a FrameStack structure to allow allocation of InterpFrame structures and stack data outside the native stack.

* Allocate InterpFrames/stack data from a frame stack instead of the native stack.

* Make some calls non-recursive.

* Remove an assert.

* Use non-recursive calls in CALLVIRT_FAST as well.

* Fix stack size allocation for vararg calls.

* Add some micro optimizations to the calling code.

* Add more micro optimizations.

* [dtest] disable Crash test on interpreter

* Add some implicit conversions to STSFLD to fix a corefx test failure.

* Disable the new test.
2019-11-26 04:31:32 +01:00
Zoltan Varga 5b4cd5ce50 WASM + Netcore. (#17915)
* [runtime] Throw an exception from Thread::StartInternal () if threads are disabled.

* Add more test suites and a corefx exclusions file.
2019-11-26 02:59:31 +01:00
Larry Ewing e917c95053 Add the reference assembly path for the Http implementation (#17908) 2019-11-25 19:21:38 -06:00
dotnet-maestro[bot] cd190481bd Update dependencies from https://github.com/dotnet/arcade build 20191124.1 (#17899)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19574.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19574.1
2019-11-25 21:22:41 +01:00
Alexander Köplinger e437330808 Remove mkinstalldirs invocation from two places (#17910)
These can be easily replaced so we don't need to mirror over the mkinstalldirs file to the new repo
2019-11-25 21:10:26 +01:00
Alexander Köplinger 8aa1cdfe17 [configure.ac] Don't run compiler server check in netcore mode (#17911)
We don't need it there.
2019-11-25 21:10:08 +01:00
Calvin Buckley 836f453906 Fix BinaryReader on BE (#17893)
Fix BinaryReader on BE

The ints passed into the int array ctor needed to be endian swapped.
Interestingly, the BinaryWriter implementation currently being used
(not refsrc AFAIK) does this on write just fine.

Fixes ReadDecimal test on AIX, and adds another test to ensure that
Write(decimal) can be read back by ReadDecimal in case.
2019-11-25 19:15:55 +01:00
Alexander Köplinger bdf4790fa0 Fix boehm on Windows i386 builds (#17901)
After https://github.com/mono/mono/pull/16832 was merged the run-msbuild.bat
script has an additional required parameter for specifying the GC.

However the script only passed the MONO_TARGET_GC property to msbuild
if the script had no additional parameters which doesn't make sense.

Always pass the parameter, this should fix the boehm build on Windows i386.
2019-11-25 18:58:42 +01:00
Larry Ewing b42845c567 Fix issue in debugger variable inspection (#17900) 2019-11-25 11:55:21 -06:00
Marek Habersack 10795da1c0 [WIP] Make debugger agent startup faster (#17898)
Mono SDB's debugger agent takes a `host:port` parameter to specify the host and
port on which to listen for debugger connection. `host` is passed, via
`mono_get_address_info`, to the `getaddrinfo(3)` standard library call which
does the job of translating the name to the IP address. However, there's no
special treatment for situations when `host` is already an IP address. In this
case `getaddrinfo` takes a lot of time to perform at least two DNS lookups (if
there's just a single DNS server configured) which will time out as the IP
address in `host` will not be resolved by any of the servers.

`getaddrinfo` takes a "hints" parameter where caller can specify some
information about the `host:port` pair to make the lookup faster/easier.
However, Mono doesn't specify the address family in the `hints` parameter, thus
forcing the slow path of DNS lookups on `getaddrinfo`.

This commit adds a new hint named `MONO_HINT_NUMERIC_HOST` (which maps to
`AI_NUMERICHOST` for `getaddrinfo`) which will allow, if set, `getaddrinfo` to
take a faster route in address discovery. Debugger agent will, in most cases,
get an IP address to instead of host name so we call `mono_get_address_info` up
to 3 times (IPv4, IPv6 and unspecified) in order to make the lookup faster.
2019-11-25 17:52:58 +01:00
Calvin Buckley f47b7bbf4f Fix flawed BufferTest on big-endian (#17894)
Fix flawed BufferTest on big-endian

Test ignored byte order when considering integer comparison. This
tests different cases for each endian, and explains why the byte
order is different.
2019-11-25 16:25:55 +01:00
Kenneth Pouncey 5d981c2679 [wasm] [bindings] Method invoke signature argument validation. (#17853)
* Implement validation for signature and argument count consistency.

- throw error `Parameter count mismatch.` when arguments and signature counts are not consistent.

* Fix tests that have Parameter count mismatch.

* Add browser binding tests for `Parameter count mismatch
2019-11-25 08:24:33 -06:00
Kenneth Pouncey e8d70c333f Add tests for Promise library.
- Right now only Bluebird promise library is tested right now.
- If more are needed later then we can add them.
2019-11-25 08:23:45 -06:00
Kenneth Pouncey 2f1e2f8132 Add a more reliable way of identifying a Promise to be marshaled.
- This is left as generic as possible for now.
2019-11-25 08:23:45 -06:00
Kenneth Pouncey 64e2864fef Add a more descriptive error in case of fetch response not returning back what it should.
- An example of this is when a Promise library is being used and the Promise can not be identified correctly.  Thus the internal error.
2019-11-25 08:23:45 -06:00
Vlad Brezae 1ef7a29836 [interp] Resolve tokens also from wrappers during optimization (#17880)
[interp] Resolve tokens also from wrappers during optimization

Remove some duplicated code.
2019-11-25 14:45:56 +01:00
Calvin Buckley 004fd06b96 [eglib] In AIX/generic POSIX, handle null addresses better (#17892)
Fixes crash in tests on AIX.

Matches b0d966bd7a
2019-11-25 02:52:54 -05:00
Calvin Buckley a3f4def8b6 Allow runtime to be built with C++ on AIX (#17672)
* Allow runtime to be built with C++ on AIX

Many AIX/PPC/BE specific codepaths didn't do casting properly,
since C++ is much stricter than C about pointer typing.

Also specify the C99 format macros early as possible, since
inttypes may get included before eglib gets a chance to set the
macros.

Also explicitly use -pthread, since not using it is the cause of
many libstdc++ crashes on AIX.

* Oops, should have been that define instead

* Suggested changes from Jay on style

* Remove unneeded cast
2019-11-24 17:08:19 -05:00
Alexander Köplinger 280e9d2423 Fix warnings in runtime build (#17887)
This makes at least the netcore-mono build in dotnet/runtime warning-free.
2019-11-24 00:16:20 +01:00
Alexander Köplinger 165e28ae97 [netcore] Disable libmonoruntime-support.la build on netcore (#17885)
It's used for the zlib compression helpers used by System.IO.Compression in the old Mono BCL.
On corefx this is handled differently so we don't need it there.

To avoid automake complaining about missing files we include the .c files directly instead of in the Makefile.
2019-11-23 10:06:40 +01:00
Alexander Köplinger 2ccd6122bd [netcore] Disable a test which fails on the interpreter
The test is wrong, will be fixed upstream.
2019-11-22 23:00:28 +01:00
Alexander Köplinger 81e305421d Fix run-msbuild.bat invocation in pipeline-netcore-runtime.yml 2019-11-22 22:48:53 +01:00
Alexander Köplinger 0d80372173 Make configure.ac and Makefile.am work without certain directories (#17871)
Those folders won't be present in the dotnet/runtime repository.

We need to factor out AC_OUTPUT into a separate file so we can continue
to share configure.ac but not the list of files in AC_OUTPUT since
autotools doesn't support variables there.
2019-11-22 22:48:11 +01:00
Zoltan Varga 93e46c687b [runtime] Treat calling a non-virtual method through an open delegate the same as the normal case instead of the OPEN_VIRTUAL case. (#17832)
* [runtime] Treat calling a non-virtual method through an open delegate the same as the normal case instead of the OPEN_VIRTUAL case.

* [amd64] Fix the return value mapping in gsharedvt calls, the return address might be in different registers in the caller and callee.

* [runtime] Always initialize del->method_ptr even if interp_method is set, JITted code makes calls through it in mixed mode.

* Add a test for open delegates and gsharedvt.

* Increase nrgctx trampoline count, its needed by dynamic-method-churn.exe in full-aot-interp mode.
2019-11-22 20:34:14 +01:00
Jonathan Chambers cc137237d8 Replace embedded libgc with Unity fork of recent Boehm (bdwgc) (#16832)
* Initial commit to migrate libgc to bdwgc.

* Fix submodule url

* Don't force Boehm as runtime wrapper. Was just for testing locally.

* Build bdwgc as single object file. Helps with performance.

* Bump bdwgc submodule.

* Attempt to fix windows MSVC based build.

* Remove any references to GC_INSIDE_DLL as we manually managed threads on Windows.

* Allow building boehm on Windows amd64.

* Allow building boehm with msvc.

* Bump bdwgc to fix line endings

* Use LF for sh, am, m4, and ac files in bdwgc

* Bump bdwgc & libatomic_ops with fix for cygwin

* Bump bdwgc to fix mono-boehm being generated as libtool wrapper script.

* Link the static boehm library.

* Revert "Link the static boehm library."

This reverts commit 1f90d81d08308a61c890743cd79d8f6bb791bc99.

* Use --export-all-symbols on cygwin/mingw to fix issues with boehm causing mono symbols not to be exported.

* Fix
2019-11-22 18:03:23 +01:00
Filip Navara 0fed03ed63 Fix InternalGetHashCode for boehm/null GC (#17859)
It was unintentionally shifting the address to left instead of right. It should be shift right to get rid of zeroes from the alignment.
2019-11-22 07:51:43 -05:00
Alexander Köplinger 5fedc42ccf Fix automake warning 2019-11-22 13:18:10 +01:00
Kenneth Pouncey 9e1d59b8cc Remove unused GetHttpMessageHandler from WebAssembly.Net.Http.
- Remove linker.xml from project
2019-11-22 13:12:17 +01:00
Zoltan Varga ecd67a91c4 [wasm] Add aot+netcore support. (#17798)
* [wasm] Compile corelib as 32 bit.

* [wasm] Add a netcore cross compiler.

* [wasm] Add netcore+aot support.

* [aot] Load the dedup module lazily instead of at startup.

The previous version didn't work on netcore because it couldn't resolve references to corlib etc.
since they were not yet registered in the root domain at the time of loading.

* Add more icall trampoline signatures.

* Add more netcore pinvokes.

* Fix the build.

* Add more icall trampoline signatures.

* Add an --embed-file option to the packager.

* Add more netcore pinvokes.

* [interp] Return FALSE for IsDynamicCodeCompiled.

* Add a netcore project and targets for running BenchmarkDotNet.

* Fix pinvoke tables.

* Add missing files.

* Fix make clean.

* Add a comment.

* Revert "Fix pinvoke tables."

This reverts commit 998065e77614b7e621d2873510aabc3930669ca9.

* Make xunit-runner into a dotnet project. Add a netcore version.
2019-11-22 12:42:55 +01:00
Egor Bogatov 6a5c44b15e [netcore] Run tests with Interpreter (#17862)
* Run tests with interp and llvm

* fix build

* Run tests with llvm

* Add a few tests to rsp for LLVM
2019-11-22 09:14:23 +01:00
Kenneth Pouncey 202cb6a648 Add more descriptive message to the PlatformNotSupportedException (#17864) 2019-11-22 08:40:30 +01:00
Jay Krell dadc3d3117 Remove handles/MonoError from Mono.RuntimeGPtrArrayHandle. (#17806) 2019-11-21 14:15:29 -05:00
Jo Shields 9e00330af3 Stop referencing files from Mono BCL in Netcore System.Private.CoreLib (#17866) 2019-11-21 19:48:00 +01:00
Bernhard Urban-Forster 058d157648 [interp] fix array_element_size intrinsic (#17857)
[interp] fix array_element_size intrinsic

`mono_class_array_element_size` gives us the size of the provided MonoClass if it would be an array element. But here we want the element size of a given array's MonoClass. That's what `mono_array_element_size` is returning.

This leads to all kind of weird crashes otherwise, specifically here:
https://github.com/mono/mono/blob/2c20649539ac16e069a65f2a750c793eb341e50f/netcore/System.Private.CoreLib/src/System/Array.Mono.cs#L64

Which is then used later to compute the size to memset in order to clear the content of an array. If it's larger than it should be, then this will cause memory corruption. For example this would crash eventually:

```csharp
using System;
using System.Collections.Generic;

namespace HelloWorld {
    class Program {
        static void Main(string[] args) {
            for (int j = 0; j < 0x1000; j++) {
                var d = new Dictionary<string, string> ();
                for (int i = 0; i < 197; i++)
                    d.Add (i + "", i + "foo");
                d.Clear ();
            }
        }
    }
}
```

Thanks to @EgorBo for reporting.
2019-11-21 11:56:03 +01:00
Alexander Köplinger b6e4ddd73c [metadata] Remove native threadpool from netcore build (#17856)
We use the managed threadpool there.
2019-11-21 10:01:39 +01:00
Egor Bogatov 2c20649539 [llvm] Recognize GEP (#17844)
* initial impl

* improve jit

* fix copy-paste

* disable for non-netcore

* clean up
2019-11-20 21:25:24 +01:00
Zoltan Varga 4961d411e7 [interp] Move the freeing of interp method info into a callback. (#17852)
[interp] Move the freeing of interp method info into a callback.
2019-11-20 19:56:09 +01:00
Egor Bogatov 27e6e812f1 enable gss on android (#17838) 2019-11-20 10:53:14 -05:00
Alexander Köplinger 0396037d31 [debugger-agent] Fix CMD_VM_ALL_THREADS returning wrong value due to unitialized variable (#17847)
`remove_gc_finalizing` wasn't initialized so its value is undefined.
The `count_thread_check_gc_finalizer()` function only sets it in some cases so we could end up with the variable having an undefined (and probably not 0) value.
This resulted in the returned thread count from the debuggee being wrong because we'd decrement `count` even though we shouldn't.

Regression from https://github.com/mono/mono/pull/15618
2019-11-20 08:28:58 +01:00
dotnet-maestro[bot] a6db160596 [master] Update dependencies from dotnet/arcade dotnet/core-setup dotnet/corefx (#17690)
* Update dependencies from https://github.com/dotnet/arcade build 20191102.1

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19552.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19552.1

* Update dependencies from https://github.com/dotnet/core-setup build 20191104.1

- Microsoft.NETCore.App - 5.0.0-alpha.1.19554.1

* Update dependencies from https://github.com/dotnet/corefx build 20191103.8

- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19553.8

* Update dependencies from https://github.com/dotnet/arcade build 20191108.11

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19558.11
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19558.11

* Update dependencies from https://github.com/dotnet/core-setup build 20191109.5

- Microsoft.NETCore.App - 5.0.0-alpha.1.19559.5

* Update dependencies from https://github.com/dotnet/corefx build 20191109.6

- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19559.6

* Update dependencies from https://github.com/dotnet/arcade build 20191117.2

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19567.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19567.2

* Update dependencies from https://github.com/dotnet/core-setup build 20191114.1

- Microsoft.NETCore.App - 5.0.0-alpha.1.19564.1

* Update dependencies from https://github.com/dotnet/corefx build 20191113.6

- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19563.6

* Use NETCoreApp version 5.0.0-alpha.1.19563.3

Later versions have an issue and the new dotnet/runtime assets aren't ready yet.

* Disable failing tests

* Fix merge error
2019-11-19 16:47:57 +01:00
Steve Pfister 0c3ffb9cc9 Fixes https://github.com/mono/mono/issues/15805 at least in terms of what may be making it crash. (#17270)
Adds a null check around the sslStream before trying to dispose.
2019-11-19 14:23:51 +01:00
Zoltan Varga b8fe43da3e [interp] Add some missing netcore intrinsics. (#17782) 2019-11-18 13:55:15 +01:00
Steve Pfister 0269f7b479 Bump corefx to pick up https://github.com/mono/corefx/pull/370 (#17758)
Backport of https://github.com/dotnet/corefx/pull/34560

Added HAVE_LCHFLAGS & HAVE_STAT_FLAGS to configure.
2019-11-18 12:13:16 +01:00
Filip Navara e2ccdac3f4 [llvm] Add support for LLVM JIT on ARM64 (#17827)
* [llvm] Add support for LLVM JIT on ARM64

* Fix tabs
2019-11-18 00:24:11 +01:00
Jérôme Laban 965efade84 Update emscripten to 1.39.3 (#17816)
Includes updates for https://github.com/emscripten-core/emscripten/issues/9562 and side modules.
2019-11-16 13:59:28 +01:00
Dotnet-GitSync-Bot 6785b27567 Mirror changes from mono/runtime (#17803)
It looks like the mirror didn't fully quiesce prior to snapping coreclr/corefx for the runtime consolidation.  As a result the libraries build is breaking.

Signed-off-by: dotnet-bot <[email protected]>
2019-11-16 11:27:32 +01:00
Nikolay Sivov 18dd48cad8 [mini] Fix NULL pointer crash in mono_decompose_vtype_opts(). (#17801)
* [mini] Fix NULL pointer crash in mono_decompose_vtype_opts().

All other call sites for mono_type_size() are already passing non-null pointer there.

* [mini] Rename variable dummy -> align.
2019-11-15 17:56:55 +01:00
Marcos Cobeña Morián 92dd4d3883 [Wasm] Forced filesystem creation (#17789)
* Forced filesystem creation

* [Wasm] Added new hello-io sample
- Goal is testing file preloading through System.IO
- Filesystem is now always forced to support later file preloading
- build-io-sample target showcases such

* Added --enable-fs flag to packager.exe

* Update packager.md
2019-11-15 15:24:50 +01:00
Jan Kotas 3ceecb8db0 Fix build breaks
Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
Carlos Sanchez Lopez d3fbf4a1d3 Fix NetStandard issue in System.IO.FileSystem.AccessControl in 5.0 (#42546)
Fix NetStandard issue in System.IO.FileSystem.AccessControl

We built the fix incorrectly so that it would only apply for netcoreapp3.0 but customer needs it on netstandard2.0 (desktop + core).  Customer impact is that they’ll see a PlatformNotSupported exception rather than the new API.

Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
Stephen Toub 00b0170bdc Fix StyleCop rule SA1129 ("Do not use default value type constructor") (#42531)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
Tanner Gooding c93801d458 Adding tests for the new apis to convert between S.Numerics and S.R.Intrinsic vectors (#27481)
* Updating Vector128.AsVector3 to have a functioning implementation

* Adding test template metadata covering the new methods for converting between S.Numerics and S.R.Intrinsics

* Regenerating the existing tests

* Generating the new Vector conversion tests

Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
Emmanuel AndréandStephen Toub 5645032fc6 Add span-based CopyTo and CopyToAsync methods (dotnet/coreclr#27639)
* Add span-based CopyTo and CopyToAsync methods

* Update according to feedback

* Add span-based CopyTo overrides for MemoryStream

* Improve span-based CopyTo arguments validation

To avoid code duplication

* Update according to second review

Stream API is changed

* Resolve InternalReadSpan/Memory inlining

* Refactor ValidateCopyToArgs

* Update according to third review

* Update after fourth review

* Override span CopyTo for UnmanagedMemoryStream

* Apply suggestions from code review

Co-Authored-By: Stephen Toub <[email protected]>

* Update after fifth review

* Add cross sync/async support for span-based CopyTo

* Call sync action directly in async context

* Rework cross sync/async support for span-based CopyTo

Co-Authored-By: Stephen Toub <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
John adcaf88db0 Fix Vector128 and Vector256 WithUpper documentation (dotnet/coreclr#27274)
* Update Vector128.cs

* Update Vector256.cs

* Update Vector128.cs

* Update Vector128.cs

* Update Vector256.cs

* Update Vector128.cs

* Update Vector256.cs

Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
Elinor Fung 1f2f9b929b Add tracing for handling of dependencies for Assembly.LoadFrom (#27833)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
Elinor Fung 3242b5f354 Add tracing for Resolving/AssemblyResolve event handler invocation (#27788)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
ts2do 35d94dc8ff Address bugs in BigInteger (dotnet/coreclr#27280)
* Method Add(ref BigInteger lhs, uint value, ref BigInteger result) would store most of the result blocks into lhs instead of result.
* Method ShiftLeft(ulong input, uint shift, ref BigInteger output) with a shift argument exceeding 32 would generally compute the higher blocks incorrectly.
* Multiply(ref BigInteger lhs, uint value, ref BigInteger result) would not set result._length in some cases.
* IsZero() would incorrectly return false for non-canonical zeros with _length > 0.

Fix:
* Inline Add(ref BigInteger, uint, ref BigInteger) into Add(uint).
* Inline ShiftLeft(ulong, uint, ref BigInteger) into Pow2.
* Inline ExtendBlock and ExtendBlocks into Pow2.
* Properly handle 0 in SetUInt32 and SetUInt64.

Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
Stephen Toub 2a108e958f Use Stream's BeginReadInternal from FileStream (dotnet/coreclr#27737)
FileStream has two modes, decided upon at construction time.  When it's created in non-async mode, the Read/WriteAsync methods end up queueing work items to invoke the synchronous Read/Write methods.  To do this, the base methods on Stream delegate to Begin/EndRead/Write (since they were around first) and then the resulting IAsyncResult is wrapped.  However, Stream has an optimization that checks to see whether the derived stream actually overrides Begin/EndXx, and if it doesn't, then it skips using those and goes straight to queueing a work item to Read/Write.  However, FileStream does override those, but when it delegates to the base implementation because it's in non-async mode (rather than because it's a type derived from FileStream), going through Begin/EndXx is just unnecessary overhead.  So, in the right circumstances, we can call to Stream's special helper instead.

Signed-off-by: dotnet-bot <[email protected]>
2019-11-15 13:29:04 +01:00
Zoltan Varga 25b7e6bd42 [runtime] Add MONO_EMPTY_SOURCE_FILE to a couple of files. (#17795)
* [runtime] Add MONO_EMPTY_SOURCE_FILE to a couple of files.

* Fix a typo.

* Revert unrelated changes.
2019-11-15 09:04:35 +01:00
Vsevolod Kukol 805c7f5436 [MacSDK] Bump xamarin-gtk-theme.py to latest revision from private bockbuild (#17785) 2019-11-14 09:27:33 +01:00
Jay Krell 19a44cd32b Remove handles from System.Diagnostics.Debugger. (#17713)
* Remove handles from System.Diagnostics.Debugger.
memset (&x, 0, sizeof (type)) to memset (&x, 0, sizeof (x)).

* Bump API snapshot submodule
2019-11-14 08:18:02 +01:00
Zoltan Varga 1d81534d27 [interp] Add some inline checks from the JIT. (#17784) 2019-11-13 22:34:01 +01:00
Zoltan Varga a0fcc29d5d [runtime] Fix some handle usage in native-library.c (#17781) 2019-11-13 18:12:09 +01:00
Jay Krell 73431403c7 Remove handles from ves_icall_System_Array_CanChangePrimitive. (#17708)
Remove handles from ves_icall_System_Array_CanChangePrimitive.
2019-11-13 17:55:52 +01:00
Thays Grazia dd18ec40dd [debugger] Assert when async debug a generic method (#17727)
* When we try to call a method to get the async_id to do an async debug and we are trying to do this in a generic method like this:

async Task<T> ExecuteAsync_Broken<T>()
 {
            await Task.Delay(2);
            return default;
  }

We need to inflate the generic type before call the method or we will get the error:  Could not execute the method because the containing type 'System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[T_REF]’, is not fully instantiated.

Fixes #17549
Fixes #17569
2019-11-13 16:29:33 +01:00
imhameed fe0f824db5 [llvm] Use explicit null checks with LLVM. (#16954)
* [llvm] Use explicit null checks with LLVM.

When the LLVM backend is used for a method, explicit null checks will
unconditionally be used at the mini IR level. We had previously used
implicit null checks at the mini IR level combined with llvm-volatile
loads and stores to avoid mis-optimization of the generated code.

During AOT compilation, LLVM's `ImplicitNullChecks` pass is enabled.
This conservatively elides these explicit null checks. This pass only
modifies branches tagged with `make.implicit` metadata.

Null check branches are now tagged with `make.implicit` metadata, with
three exceptions:

1. For platforms with backends that do not support zero page fault
handling, null check branches are not tagged with `make.implicit`.

2. This commit also adds a `MONO_DEBUG` option:
`llvm-disable-implicit-null-checks`. When it is enabled, null check
branches are not tagged with `make.implicit`.

3. This commit alters the behavior of the `explicit-null-checks`
`MONO_DEBUG` option. Enabling `explicit-null-checks` also implies
`llvm-disable-implicit-null-checks`, because this option is documented
(e.g. in https://www.mono-project.com/docs/debug+profile/debug/) to
completely disable signal/seh-based null checks.

* Add llvm-disable-implicit-null-checks to the MONO_DEBUG help string.

* Add llvm-disable-implicit-null-checks to mono.1.

* Don't tag null checks in EH regions with `make.implicit`.

This relocates the logic formerly used to guard individual LLVM-level
loads and stores with explicit null checks inside EH regions.

* Use atomic/volatile loads and stores for the terimation flag in thread-suspend-suspended.

LLVM was hoisting the load of and branch against `finished` out of
thread t1's loop, resulting in an infinite spin.

* Use ImplicitNullChecks with LLVM JIT.

* Suppress emission of the .llvm_faultmaps section.

Bump external/llvm to release_60
(7a8dc89adbe7e123220e070a527e096ee91e66d5).

* [ci] use LLVM built from repository
2019-11-13 01:35:44 +01:00
Zoltan Varga eaf895f2d0 [wasm] Change netcore support to use a prebuilt corefx runtime. (#17773)
* [wasm] Change netcore support to use a prebuilt corefx runtime.

* [wasm] Build and test netcore support on CI.

* [wasm] Disable netcore tests on CI for now.

* [wasm] Add an error check.

* [wasm] Add a linker exclusion.

* [wasm] Add netcore runtimes to the nupkg.
2019-11-13 01:30:09 +01:00
Filip Navara bd278dd00d Mirror changes from mono/corefx,coreclr (#17777)
* Rewrite the rest of the array non-generic fast paths in C# (#27703)

* Rewrite the rest of the array non-generic fast paths in C#

* Add missing resource string

* Use CorElementType and handle native ints to match the unmanaged implementation

* Avoid try pattern for Sort and Reverse

* Match the native implementation more closely

Signed-off-by: dotnet-bot <[email protected]>

* Rewrite Enum.CompareTo in C# (dotnet/coreclr#27792)

* Rewrite Enum.CompareTo in C#

* Handle floating point too for match the existing native implementation

Signed-off-by: dotnet-bot <[email protected]>

* Remove unused argument from GetRegionDisplayName (dotnet/coreclr#27806)

* Remove unused argument from GetRegionDisplayName

* Address race conditions in CultureData

While most of the race conditions in this file are benign, in these cases, a thread could end up returning an intermediate value due to multiple potential writes to the same field.

Signed-off-by: dotnet-bot <[email protected]>

* Fix StyleCop rule SA1129 ("Do not use default value type constructor") (#27716)

Will enable the rule in corefx once these changes have propagated.

Signed-off-by: dotnet-bot <[email protected]>

* Remove non-shared Enum.CompareTo/InternalCompareTo implementation, add new Array icalls used by shared code
2019-11-12 18:46:00 +01:00
Bernhard Urban-Forster 4728cec01f [llvm] use multiple cores to build llvm if ninja is not available (#17778) 2019-11-12 18:45:45 +01:00
Jo Shields 8bceb40878 Move zlib to its own directory, and re-enable subdir-objects
This has the following benefits:

* Clearer structure for mirroring
* Slight build time improvement on bundled zlib use (as it only builds once)
* Removes pages of subdir-objects spew from autogen
2019-11-12 09:31:08 +01:00
abrevet-dev 8683fa6db7 [WinForms] Fix #10559 In MaskedTextBox wrong Lines value when Mask setted (#17660)
[WinForms] Fix #10559 In MaskedTextBox wrong Lines value when Mask se…





<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-11-12 01:55:53 +01:00
abrevet-dev 2b4801d9f1 [WinForms]: Fix #17546 Fix TabPage position when enabling MultiLine (#17670)
[WinForms] Fix TabPage position when enabling MultiLine

Fixes #17546
2019-11-12 00:15:51 +01:00
abrevet-dev 61811075ca [WinForms]: Fix #16632 special values (-1 and -2) of ListView Column header Width was not handled when using List.View. (#17669) 2019-11-11 23:00:45 +01:00
abrevet-dev 9eb0bcae57 [WinForms] Fix #12249 scroll orientation was not defined in ScrollEventArgs (#17662)
* [WinForms] Fix #12249 scroll orientation was not defined in ScrollEventArgs of ScrollBar.cs

* [WinForms] Fix 12249 scroll orientation was not defined in ScrollEventArgs of DataGridView.cs
2019-11-11 22:59:53 +01:00
Jo Shields c256fc86b6 Delete some LLVM test cases from make dist (#17772)
Many of the tests from the llvm-project monorepo cause problems to `make dist`
2019-11-11 17:42:51 +01:00
Alexis Christoforides 722c6f7dd5 [netcore] Complete Monitor.LockContentionCount implementation (#17719)
* [netcore] Complete Monitor.LockContentionCount implementation

Fixes https://github.com/mono/mono/pull/16538
2019-11-11 13:03:03 +01:00
Jan Kotas 594bbbef25 Relax visibility
Signed-off-by: dotnet-bot <[email protected]>
2019-11-10 09:29:18 +01:00
Marek Safar d90030d273 Fixes build 2019-11-09 20:45:42 +01:00
Ryan Lucia 9664df7eb3 Move AssemblyLoadContext.GetResolvedUnmanagedDll to shared (#27775)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-09 20:45:42 +01:00
rob313663 e46f29313d Fixed typos in comments. (dotnet/coreclr#27789)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-09 20:45:42 +01:00
Joseph Musser 5bf661d7f9 StackTrace.GetFrames should return an array of non-nullable frames (#27787)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-09 09:37:25 +01:00
Levi Broderick ae02b6677b Improve Encoding.UTF8.GetString / GetChars performance for small inputs (#27268)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-09 08:13:11 +01:00
Alexander Köplinger f9b3b5276d Fix llvm path in CODEOWNERS file 2019-11-09 00:44:57 +01:00
Alexander Köplinger ed2d5f69e0 [netcore] Fix RuntimePropertyInfo.GetValue() in FullAOT scenarios (#17757)
It tried to use dynamic codegen which is not available in FullAOT.
We can use the `RuntimeFeature.IsDynamicCodeSupported` to check for this, added a JIT intrinsic which returns false in FullAOT.

Used a linker friendly way to check for TypeBuilder by adding an `internal virtual IsTypeBuilder` method in the `Type` class which returns false, and overwrote it in `TypeBuilder`.
2019-11-09 00:33:00 +01:00
Zoltan Varga 73b50890cc [wasm] Bump emscripten. (#17748)
* [wasm] Bump emscipten to 1.39.2.

* Disable some code in libtest.c which causes emscripten to fail.

* [wasm] Source emscripten env before make install as well.
2019-11-08 14:43:32 -05:00
Nathan Ricci 5b0a822afb Implement GC.GetGCMemoryInfo (#17607)
Implement the GC.GetGCMemoryInfo API.
2019-11-08 13:58:37 -05:00
Ryan Lucia d5b6cf33b3 [loader] Unmanaged library refactoring and NativeLibrary implementation (#17369) 2019-11-08 13:42:56 -05:00
Ryan Lucia 68d142912d [netcore] Run individual CoreCLR test suites (#17753)
This is implemented in a lazy way for convenience when manually testing until the tests are wired up to xunit
2019-11-08 13:14:06 -05:00
Alexis Christoforides 23f2baa71e [merp] Remove extraneous waitpid invocation (#17723)
The extraneous call basically guarantees that the call right after will fail. Fixes merp stating that its process has failed when it hasn't.
2019-11-08 11:40:04 -05:00
Jo Shields 3948a065af Merge pull request #17749 from directhex/dotnet-llvm-monorepo
[LLVM] Change llvm submodule to dotnet-org fork of official LLVM git repo
2019-11-08 10:42:20 -05:00
lateralusX fad91a1c1e Fix Windows LLVM build using new repository structure. 2019-11-08 09:21:30 -05:00
Dotnet-GitSync-Bot 759a8c1847 Mirror changes from mono/corefx,coreclr,corert (#17761)
* Add EventWaitHandle creation extension method that takes an ACL (#42213)

* Add EventWaitHandle creation extension method that takes an ACL

* Call OpenExisting, add basic unit tests, move MAX_PATH in csproj for all Windows platforms, ensure same exceptions are thrown in both netcore and netfx.

* Address suggestions: using for the created handle, simplify try finally, merge methods, remove an unnecessary Debug.Assert

* simplify using, reorganize PInvokes a bit, let VS format resx as it expects it, remove BOM from csproj

* Add more unit tests

* Save basic access rights in a constant, generate name randomly

* Use FullControl (EVENT_ALL_ACCESS); update unit tests to use EventWaitHandleRights

* Apply suggestion of creating an EWH, then replacing its SWH.

* Remove using causing chaos, add more unit tests, remove null string unit test.

* spacing

* Address comments

* Remove unnecessary checks/exceptions, update unit tests

* Fix netfx x86 ut failure - different exception for mode validation.

* Small documentation fix

* Remove documentation for exception thrown with null security

* more documentation fixes

* New file for unit tests

* Dispose and remove windows only attributes in tests

* suggestion to not use var

* Remove duplicate resx after merge

* Readd cs files lost during merge

* Remove resx modification since it was untouched for this PR

* Address test comments

Signed-off-by: dotnet-bot <[email protected]>

* Move NativeLibrary.Free null check to managed (dotnet/coreclr#27744)

Signed-off-by: dotnet-bot <[email protected]>

* Arm64: Add S.P.CoreLib instrinsics UnzipEven and UnzipOdd (#27731)

Signed-off-by: dotnet-bot <[email protected]>
2019-11-08 07:11:13 -05:00
Tamar Christina 771b5fb18d Arm64: Update S.P.CoreLib for ZipLow and ZipHigh (dotnet/coreclr#27730)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-08 11:01:17 +01:00
Carlos Sanchez Lopez 229d3cc097 Add Semaphore creation extension methods that take an ACL (#42377)
Approved API Proposal: #41662

Description
We don't currently have a way to create a Semaphore with a given ACL in .NET Core. We can modify the ACL, but it would be more secure to have the proper ACL on the object from the start.

Customer impact
Before this change, customers had to create a Semaphore, then set its ACLs. This presents a few problems:
- Potential security hole as semaphores can be accessed between creation and modification.
- Porting difficulties as there isn't a 1-1 API replacement
This change addresses those problems by adding a new extension method that allows creating a Semaphore and ensuring the provided ACLs are set during creation.

Signed-off-by: dotnet-bot <[email protected]>
2019-11-08 01:59:07 +01:00
Zoltan Varga c0a9d6bf76 [aot] Improve the aot mangler a bit, handle bool/char as a primitive type and avoid emitting a System prefix. (#17739) 2019-11-07 18:18:12 -05:00
Tanner Gooding 8637912a99 Updating NumberToFloatingPointBitsSlow to handle the remaining parsed fractional digits being zero. (#27688)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-07 23:39:21 +01:00
Jo Shields 4d579d00ff Bump LLVM submodule 2019-11-07 15:52:56 -05:00
Tamar Christina b924ffa5e0 Arm64: Add S.P.CoreLib for AddV. (dotnet/coreclr#27663)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-07 21:47:22 +01:00
Ryan Lucia 2c22d0de2e [netcore] Propagate ALCs through reflection functions (#16949)
* [reflection] Pass assembly load context through mono_reflection_get_type_with_rootimage

The entry points are mono_reflection_type_from_name_checked and
mono_reflection_get_type_checked which for now pass in an ambient ALC, but
should be updated to take an ALC argument.

Internally mono_reflection_get_type_with_rootimage is recursive through a half
dozen helper functions which all get an ALC argument too.

The principle place where the ALC is used is in
_mono_reflection_get_type_from_info which passes it to
mono_assembly_loaded_internal and to replace the call to mono_assembly_load by
a direct call to mono_assembly_request_byname with an explicit ALC set in the
request.

* Mark mono_assembly_load as external only

* Pass an alc through non-static reflection functions

* Fix usage in wasm debugger

* Relax assertions due to wasm
2019-11-07 15:02:23 -05:00
Marcos Cobeña Morián 8cc0402967 Enabled --preload-files without AOT (#17732) 2019-11-07 15:00:36 -05:00
Jo Shields fe69f5b699 Fix .gitmodules typo 2019-11-07 14:03:06 -05:00
Jo Shields c1c483cef8 LLVM changes for SDKs 2019-11-07 12:16:29 -05:00
Jo Shields d0d779b8d9 Update AzDo pipeine for new LLVM location 2019-11-07 12:09:58 -05:00
Alexander Köplinger 71b78536ad [sdks] Add xunit to iOS test runner and add results reporting (#17744)
- Allows the on-device runner to work with the xunit framework in preparation for netcore.

- Added a simple UI to show the test run progress

- Report the test result XML back to the host so we can process it on Jenkins/AzDO
2019-11-07 18:09:51 +01:00
Jo Shields b61263e994 [llvm] redirect from mono llvm-mirror fork to dotnet llvm-project fork 2019-11-07 12:03:29 -05:00
Jo Shields 9e6b57ce5a delete old llvm 2019-11-07 11:47:32 -05:00
Aleksey Kliger (λgeek) 2c56ac54c0 [profiler] Fix log profiling of native to managed wrappers (#17740)
* [profiler] Add test case for pinvokes and reverse pinvokes

* [profiler] Fix crash in native to managed wrappers

When we call back to managed from a pinvoke, we're in GC Safe mode and the
profiler instrumentation is inserted in the wrapper before it does the
transition to GC Unsafe.  So we need an extra transition before the profiler
calls its locking functions

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

* [coop] Mark internal GC Unsafe functions with MONO_PROFILER_API

Allow the profiler to transition to GC Unsafe mode

* [profiler] ptestrunner.pl fix profiler modules directory

we used to specify mono/mini/.libs but that's not where the profiler plugins live, they're in mono/profiler/.libs.   We probably picked up the profiler plugins from the system Mono install.
2019-11-07 11:42:52 -05:00
Thays Grazia 4bdacea237 [embed] Assert when call mono_runtime_object_init (#17589)
* Fix assert when calling externally call mono_runtime_object_init, mono_object_get_domain, mono_string_to_utf8
* Adding samples/embed as unit-test
2019-11-07 11:22:25 -03:00
Carlos Sanchez Lopez 3c84633c7c Add Mutex creation extension methods that take an ACL (#42281)
Approved API Proposal: #41662

Description
We don't currently have a way to create a Mutex with a given ACL in .NET Core. We can modify the ACL, but it would be more secure to have the proper ACL on the object from the start.

Customer impact
Before this change, customers had to create a Mutex, then set its ACLs. This presents a few problems:

Potential security hole as mutexes can be accessed between creation and modification.
Porting difficulties as there isn't a 1-1 API replacement
This change addresses those problems by adding a new extension method that allows creating a Mutex and ensuring the provided ACLs are set during creation.

Signed-off-by: dotnet-bot <[email protected]>
2019-11-07 12:27:50 +01:00
Elinor Fung 0886ddb3a0 Populate properties of AssemblyLoadStart/Stop events (dotnet/coreclr#27558)
* Populate properties of AssemblyLoadStart/Stop events
* Add tests for basic start/stop binder tracing events
* Add property for ALC of requesting assembly

Signed-off-by: dotnet-bot <[email protected]>
2019-11-07 09:54:23 +01:00
Jay Krell 7b4b5e72d9 Remove handles from ves_icall_System_Array_InternalCreate. (#17681)
Remove handles from ves_icall_System_Array_InternalCreate.

Also combine two allocas.
2019-11-07 07:36:07 +01:00
Zoltan Varga 0680073b87 [runtime] Fix locking in mono_get_seq_points (). (#17738)
Fixes https://github.com/mono/mono/issues/17737.
2019-11-06 19:50:59 -05:00
Johan Lorensson bda239f44c Switch away from Start-Process, Wait-Process in build.ps1. (#17730)
Running Start-Process, Wait-Process on msbuild.exe have showed a couple
of hangs in the build script. This is most likely due to msbuild.exe
spawned child processes (like compile servers) running longer than
spawned msbuild.exe process. Since there is no specific requirements
when spawning the process from build.ps1, switch to regular process
exec and LastExitCode.
2019-11-06 16:51:31 +01:00
Johan Lorensson 1a6c092019 Explicit update/init only LLVM BTLS repro on external MSVC build. (#17691)
Reduce the scope of git submodule update --init to only LLVM and/or BTLS
repositories when building external MSVC dependencies.
2019-11-06 16:51:14 +01:00
Marek Safar 965beadc1e [System.Private.CoreLib] Remove unused Array methods 2019-11-06 12:46:30 +01:00
Stephen Toub e506008ebb Add Span.Sort, and make Array.Sort span-based (dotnet/coreclr#27700)
* Add Span<T>.Sort

Shares existing Array-based implementation by changing that implementation to be span based.

* Additional work to enable span-based sorts

- Cleans up changes from the previous commit, e.g. corrects nullable annotations, removes TODOs, using GetRawSzArrayData instead of GetRawArrayData, etc.
- Passes spans around rather than spans+lo+hi.
- Deletes the native TrySZSort, preferring to use the managed implementation in all cases.

Signed-off-by: dotnet-bot <[email protected]>
2019-11-06 12:46:30 +01:00
Bernhard Urban-Forster 29ba75c154 Bump Corefx (#17694)
* Bump Corefx

New commits in mono/corefx:

* mono/corefx@c44efe7297 [mono] limit DegreeOfParallelism to 16 (#369)

Diff: https://github.com/mono/corefx/compare/6e65509a17da898933705899677c22eae437d68a..c44efe7297f8e11cab157c7e96b998dc936d53b7

* another bump
2019-11-06 07:36:17 +01:00
Jay Krell 1e8e357831 Handles reduction -- 4 MERP functions. (#17711)
Handles reduction -- 4 MERP functions.
2019-11-06 03:56:10 +01:00
Jay Krell aa506ca1bb error_init reduction. (#17712) 2019-11-05 16:38:40 -05:00
JesperTreetopandStephen Toub 104abd7fe7 Prevent DivideByZeroException in EventCounter.ToString() (#27581)
* Prevent DivideByZeroException in EventCounter.ToString()

Maybe it should print something other than 0. Maybe "Mean" should be excluded. But at least with this it doesn't divide by zero. Ternary operator in interpolated string is not super readable; didn't know if making the code more descriptive would have performance implications.

* Update src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventCounter.cs

Co-Authored-By: Stephen Toub <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-11-05 21:18:22 +01:00
Ryan Lucia f477bce548 [loader] Skip the full pinvoke resolution process for __Internal (#17701) 2019-11-05 14:35:00 -05:00
Tanner Gooding 3d4f44d85c Fixing the return type of the ArmBase.ReverseElementBits methods in the PlatformNotSupported file (#27672)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-05 20:20:17 +01:00
Bernhard Urban-Forster 93b97d5582 [mini] Fix Coverity CID 1455161 & 1455162 (#17615)
* [mini] Fix Coverity CID 1455161 & 1455162

> Null-checking "ji" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

* do not rely on assert to guard ji-nullness.  refactor a bit
2019-11-05 19:09:32 +01:00
Johan Lorensson 6f73c2dab8 Fix MSVC intellisense for LLVM sources. (#17706) 2019-11-05 13:16:32 +01:00
Johan Lorensson 44e6226c31 Fix correct accumulated time for parallelized jobs in SGEN. (#17518)
* Fix correct accumulated time for parallelized jobs in SGEN.

Current implementation incorrectly accumulate time for scan jobs for
the follow metrics when running parallel minor GC:

time_minor_scan_major_blocks,
time_minor_scan_los,
time_major_scan_mod_union_blocks,
time_major_scan_mod_union_los

Commit fix so updates are atomic making sure values are correct in cases
where parallel minor GC is used.

* Implement 64-bit atommic add fallback in SGEN.
2019-11-05 01:57:06 -05:00
Nikolay Sivov 95743afa80 [mono] Fix ProcessExit handler argument. (#17680)
Problem was spotted with mono tracing hitting ProcessExit handler,
and crashing on first argument.
2019-11-05 01:56:43 -05:00
Egor Bogatov fdc6495a54 [netcore] Intrinsify Buffer.IsPrimitiveTypeArray (#17438)
* Improve IsPrimitive intrinsic

* Implement it for interpreter

* clean up

* clean up
2019-11-05 01:50:37 -05:00
Zoltan Varga ebb4598096 [wasm] Build the tests with --no-native-strip. (#17698) 2019-11-04 17:46:52 -05:00
Vlad Brezae b3b9960ed1 [interp] Use GetType instrinsic also on net4x (#17654)
We didn't do this because it had some issues when GetType was invoked through reflection. This issue would also be present with jit but, because jit doesn't use direct wrappers, the GetType call can't be intrinsified in that scenario. See https://github.com/mono/mono/pull/5350 for the context of the issue.
2019-11-04 12:58:38 -05:00
Dotnet-GitSync-Bot db49be3cbb Update only S.P.CoreLib for ReverseElementBits (dotnet/coreclr#27582) (#17695)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-04 12:55:57 -05:00
Egor Bogatov cf8495e2f7 [netcore] Copy Array.Clear impl from CoreCLR (#17411)
* Address feedback

* fix build error

* Fix has_reference usage in object.c

* Fix fallback impl

* Rename to ArrayHasReferences

* Rename to ObjectHasReferences

* Rollback to ArrayHasReferences

* Rename to ObjectHasReference

* remove redundant is_array variable

* ObjectHasReferences can accept any object

* undo changes in Program.cs

* undo changes in Program.cs
2019-11-04 12:48:04 -05:00
Filip Navara 07fa0bd3b4 Intrinsify Activator.CreateInstance<T> for value types with no ctor (#17688)
* Intrinsify Activator.CreateInstance<T> for value types with no ctor

* Fix failed test, address feedback
2019-11-04 12:40:13 -05:00
Zoltan Varga 929a8a7fd8 [jit] Allow Unsafe.As<TFrom, TTo> on gsharedvt types. (#17692) 2019-11-04 18:14:59 +01:00
Bernhard Urban-Forster 237f210ea2 [interp] use mask instead of bool expression (#17683)
Discovered by Coverity:
```
>>>     CID 1455205:    (CONSTANT_EXPRESSION_RESULT)
>>>     The expression "flag && 2" is suspicious because it performs a
        Boolean operation on a constant other than 0 or 1.
```
2019-11-04 15:56:46 +01:00
Alexander Köplinger 49d5c4d14d [sdks] Use Xcode 11.2 stable version for iOS/Mac SDKs
As requested by the xamarin-macios team.
2019-11-04 15:27:42 +01:00
Tarek Mahmoud Sayed 6630bcc67f Fix Buggy code in TimeZoneInfo (dotnet/coreclr#27591)
Although couldn’t reach the corner case cause executing the buggy code, the fix here is done according to the similar code in TimeZoneInfo which show the intention of the change

https://github.com/dotnet/coreclr/blob/97c582975eed3260ef21e0bcc55c8c86d1e3bec8/src/System.Private.CoreLib/shared/System/TimeZoneInfo.cs#L1638
https://github.com/dotnet/coreclr/blob/97c582975eed3260ef21e0bcc55c8c86d1e3bec8/src/System.Private.CoreLib/shared/System/TimeZoneInfo.cs#L1568

Signed-off-by: dotnet-bot <[email protected]>
2019-11-04 09:59:54 +01:00
Jan Kotas f3e30a0ad0 Delete two more FCalls (dotnet/coreclr#27640)
Signed-off-by: dotnet-bot <[email protected]>
2019-11-04 08:57:17 +01:00
Jan Kotas deb3115b15 Use simple Array.Copy overload where possible (dotnet/coreclr#27641)
The simple Array.Copy overload does not come with a performance penalty anymore.

Signed-off-by: dotnet-bot <[email protected]>
2019-11-04 08:57:17 +01:00
Jan Kotas 6ecf9e87ba Consolidate *.Fast.cs (dotnet/coreclr#27644)
System.Memory OOB package that this split was originally done for does not exist anymore.

Signed-off-by: dotnet-bot <[email protected]>
2019-11-04 08:57:17 +01:00
Johan Lorensson c0e237b734 Mono NetCore Windows only build/test. (#17646)
Support for Windows Mono NetCore build/test wihtout any need for
cygwin/wsl/automake just MSBuild and MSVC. Windows build support mirror
technologies used by coreclr/aracade builds msbuild + powershell.

Windows only Mono NetCore build, makes a port of existing build.sh and
Makefile, implementing a build.ps1 and build.targets. So far full build
support + execution of corefx test suite is implemented. Other make file
rules can be added when needed.

MSVC build runtime seems to hits a couple of additional test failures
in corefx test suite that needs to be investigated further.

Building NetCore Mono on Windows can now be done without cygwin or wsl.
Build depends on regular VS install (or build tools), if xunit summary
is requested, python needs to be installed.
2019-11-04 08:55:36 +01:00
Egor Bogatov 137ffe8b7c [netcore] Improve Array.CreateInstance (#17673)
* Rewrite Array.CreateInstance

* Rewrite Array.CreateInstance

* Address feedback

* Convert the icall to NOHANDLES

* fix build errors, remove NOHANDLES

* Fix GC.KeepAlive usage

* Remove icall definition for GC.KeepAlive (it's no an icall)

* Fix failing tests (expect details in the AOORE)
2019-11-03 22:39:19 -05:00
Filip Navara 8131518bb1 [netcore] Improve default constructor lookup, (#17666)
* [netcore] Improve default constructor lookup, cache when no default constructor is found (common for struct)

* Address PR feedback
2019-11-03 18:28:32 +01:00
Levi Broderick 8700c04b02 Fix typo in Tuple.cs (dotnet/coreclr#27637)
Reported by https://github.com/dotnet/corefx/issues/42321

Signed-off-by: dotnet-bot <[email protected]>
2019-11-03 18:17:23 +01:00
Alexander Köplinger 4888c49c26 [netcore] Disable shared compilation for System.Private.CoreLib
There's a dotnet process hanging around which seems to lock the build when called from the SDKs Makefiles.
2019-11-03 15:43:40 +01:00
Alexander Köplinger 40c1cd3576 [netcore] Fix strong name key for System.Private.CoreLib
It's using the silverlight key: https://github.com/dotnet/coreclr/blob/34fe045a27e150bde7ee54e0d5f0df635922519d/src/System.Private.CoreLib/System.Private.CoreLib.csproj#L112
2019-11-03 15:43:40 +01:00
Alexander Köplinger d89b96a298 [netcore] Fix out of tree build for netcore/ folder 2019-11-03 15:43:40 +01:00
Jan Kotas ad385f98b3 Normalize trailing whitespaces (dotnet/coreclr#27626)
Normalize trailing whitespaces in frequently changing files (docs and sources)

Signed-off-by: dotnet-bot <[email protected]>
2019-11-02 16:51:03 +01:00
Bernhard Urban-Forster 62ee01b36b [interp] s/MONO_API_ERROR_INIT/error_init_reuse/g (#17650)
[interp] s/MONO_API_ERROR_INIT/error_init_reuse/g
2019-11-02 16:45:36 +01:00
Zoltan Varga 803c657b24 [jit] Call mono_class_setup_fields () before accessing field->offset. (#17667)
Fixes https://github.com/mono/mono/issues/17665.
2019-11-02 03:57:25 -04:00
Manuel de la Pena 36539ed67f [iOS] Match changes done in xamarin-macios in the SDK runtime. (#17664)
* [iOS] Match changes done in xamarin-maciosn in the SDK runtime.

* Address reviews.
2019-11-02 01:40:40 -04:00
Jay Krell 4b9dc08ac1 Move MonoError from managed wrappers to native wrappers. (#15894)
Move MonoError from managed wrappers to native wrappers.

Move MonoError from managed wrappers (ilgen) to native wrappers (C preprocessor).

Alternative to https://github.com/mono/mono/pull/15869.
Which says: Previously, we would emit a call to memset
since the struct is large (> 100 bytes). Only the error code
field needs to be initialized.
Which that PR and this PR both fix, in different ways.

In the past:
- This did not work due to a possible dependency on precise GC,
  interacting with what gets zeroed or not here.
  That is why I put it on the managed side.
  We'll see if that reproduces.
  (https://github.com/mono/mono/pull/11294/files#diff-efe0070415f3f0c0f24ed0221aa1962aR339
  external/coreclr/tests/src/CoreMangLib/cti/system/weakreference/weakreferenceisaliveb.exe.)

- Some indication that embedding API should expose MonoError
  and not set_pending_exception. This does not seem relevant
  presently, and the code seems better structured and
  more efficient this way. It can revisited if/when new public API
  is the dominant concern, or do it this way for these functions,
  and another way for actual public functions.
  (https://github.com/mono/mono/pull/11294#issuecomment-432443485)
2019-11-01 22:36:06 +01:00
Zoltan Varga e9d68e9485 [netcore] Cleanups. (#17661)
* [netcore] Remove the type_info field from RuntimeType, extend the TypeCache structure instead.

* [netcore] Remove some linker exclusions which are not needed.
2019-11-01 12:52:45 -04:00
Steve Pfister b9f185b74a Bump mono/corefx@6e65509 (#17631)
Pulls in PR https://github.com/mono/corefx/pull/368
2019-11-01 11:04:27 -04:00
Jo Shields 16d1a2e6f1 [System.Net.Http]: Bring HttpClient from CoreFX on monotouch and xammac. (#17628) 2019-11-01 10:26:08 -04:00
monojenkins a4790c892d [csproj] Update project files 2019-11-01 14:25:26 +00:00
monojenkins cc28706e58 Bump API snapshot submodule 2019-11-01 14:24:11 +00:00
Vlad Brezae 166fdf60b0 [interp] Handle remoting field access same as jit (#17641)
Doing this we avoid using slow ldrmfld in the common case of loading fields from instance methods, when we execute on the real object. We could do this also for strmfld but we need to track on the stack if the instance object is this, which is not worth the trouble.
2019-11-01 14:55:58 +02:00
Vlad Brezae 170d33c35b [interp] Optimize call path (#17623)
* [interp] Optimize void calls

By avoiding setting of retval

* [interp] Avoid computing param count for every call

* [interp] Remove wrong profiler check

From the times when interp had its own EH mechanism. We raise this event from mono_handle_exception_internal for interp.

* [interp] Remove profiling check code from method exit

We emit MINT_PROF_EXIT opcode when under profiler. Unify profiling enter/exit with tracing enter/exit since they are very similar.
2019-11-01 14:55:27 +02:00
Filip Navara 8aa3654de5 Lower min/max SSE operations on x64 (#17536)
Follow up on #17511.
2019-11-01 13:30:41 +01:00
Zoltan Varga dc8d55d446 [llvm] Fix a case where we treated the dreg of a store_membase instruction as a dreg, its actually the base reg. (#17648) 2019-11-01 03:43:42 -04:00
Steve Pfister 9566027142 Modify run-jenkins.sh to adapt wasm build for the OSX CI lane (#16785)
* Modify run-jenkins.sh to adapt wasm build for the OSX CI lane

* Round 2... Go

* Make ENABLE_WASM_DYNAMIC_RUNTIME conditional on non-OSX

* Add runtime-threads target

* Ignore 'multiple rules generate' on osx

* Fix typo

* Remove blank line

* Exclude CoreXml.Test.XLinq.FunctionalTests.EventsTests.EventsReplaceNodes.XElementReplaceNodes

* Revert "Ignore 'multiple rules generate' on osx"

This reverts commit 5010721bd710d6955aaee47aa7f49ad7845763fc.

* Check if OSX lane can follow general build flow
2019-11-01 01:44:50 -04:00
Stephen Toub 8b86349c2c Disable another static analysis rule (dotnet/corefx#42265)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-31 22:23:35 +01:00
Bernhard Urban-Forster 0be756d609 [threadpool] cache processor count (#17642)
On top of https://github.com/mono/corefx/pull/369 this improves the execution time of `System.Core-xunit` on Linux/ARM64 by 2x, so from:

```console
$ make -C mcs/class/System.Core run-xunit-test
[...]
=== TEST EXECUTION SUMMARY ===
   net_4_x_System.Core_xunit-test  Total: 48774, Errors: 0, Failed: 0, Skipped: 6, Time: 131.143s
```
to
```console
$ make -C mcs/class/System.Core run-xunit-test
[...]
=== TEST EXECUTION SUMMARY ===
   net_4_x_System.Core_xunit-test  Total: 48774, Errors: 0, Failed: 0, Skipped: 6, Time: 74.636s
```

This is only relevant for non-netcore. The CoreCLR folks just recently fixed something similar (thanks to Marek sharing this link): https://github.com/dotnet/coreclr/pull/27543
2019-10-31 22:08:14 +01:00
Vlad Brezae b484979aa9 [interp] Avoid emitting MINT_SAFEPOINT for every single call (#17625) 2019-10-31 16:49:16 +01:00
Jonathan Chambers 3648cb087b Avoid caching of System.dll image and types as they may be unloaded with appdomain. (#17602) 2019-10-31 10:13:01 -04:00
Zoltan Varga dff84a2464 [wasm] Fix xunit test ninja errors. (#17639)
* [wasm] Error out on duplicate assemblies in the packager.

* [wasm] Switch search path order to avoid duplicate references to assemblies.

* Copy all xunit binaries to test_lib_dir.

* Revert "Copy all xunit binaries to test_lib_dir."

This reverts commit b15b03c16b508c04dc6121196fddca0e6d949e2f.
2019-10-31 10:10:51 -04:00
Alexander Köplinger ca72deed17 Fix build 2019-10-31 14:36:53 +01:00
Ben Adams c9b7f767a8 Don't needlessly refresh proc count (dotnet/coreclr#27543)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-31 14:36:53 +01:00
Vlad Brezae 1d043a31e7 [interp] Fix interp logging (#17636)
* [interp] Don't print NOPs during cprop

They can become numerous and distracting.

* [interp] Fix mono_interp_print_code

Regressed after code_size was changed to byte count instead of short count.
2019-10-31 15:32:50 +02:00
abrevet-dev 6b3aa3a05b [WinForms] Change HotkeyPrefix default value in TabControlPainter.cs (#17579)
The default behavior on .NET Framework is _HotkeyPrefix.None_ when creating a _TabControl_ element (ampersands not escaped). 
If an user wants to override this behavior, he has to declare a _DrawItemEventHandler_ (with _DrawMode = OwnerDrawFixed_).

Fixes #16206
2019-10-31 13:48:12 +01:00
Stephen Toub a27aa7afd0 Update analyzer versions (dotnet/corefx#42249)
* Update analyzer packages to latest NuGet versions

* Fix new warnings

Signed-off-by: dotnet-bot <[email protected]>
2019-10-31 11:09:58 +01:00
Stephen Toub 6ae3360342 Clean up Uri.UnescapeDataString (dotnet/corefx#42225)
- Use string.IndexOf rather than an open-coded, unsafe loop.
- Avoid an unnecessary SequenceEquals at the end: we're only at this point if a `%` was found highlighting that something escaped was found.
- Use stack memory for smaller inputs if possible, to avoid unnecessary ArrayPool interaction
- Remove an unnecessary argument to a helper function.
- Fix ValueStringBuilder.Grow to only copy the contained data.

Signed-off-by: dotnet-bot <[email protected]>
2019-10-31 11:09:58 +01:00
Egor Chesakov a94dda5b5a Add BitwiseSelect (dotnet/coreclr#27430)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-31 08:51:46 +01:00
Zoltan Varga dc76a95aa9 [runtime] Add a --enable-minimal=threads configure option to disable threading support. Use it on wasm. (#17611) 2019-10-31 01:33:50 -04:00
Zoltan Varga 5811404e55 [eglib] Assert in g_strlcpy () if src/dest is NULL, instead of printing a warning. (#17507)
Related to https://github.com/mono/mono/issues/17283.
2019-10-30 16:07:44 -04:00
Martin Baulig 578e0df42f [System.Net.Http]: Bring HttpClient from CoreFX on monotouch and xammac. 2019-10-30 15:37:25 -04:00
Jo Shields 27921fbbd0 Rearrange System.Private.CoreLib for easier monorepo integration (#17517)
* [netcore] Move corlib around to match CoreCLR directory layout better

This is a prerequisite to making a sane migration of this whole
directory from mono.git to coreclr.git
2019-10-30 15:09:06 -04:00
Thays Grazia fffb1201bd [dim][regression] Explicit interface override (#17583)
* Precedence order:
-> Override interface method in class
-> Method in class
-> DIM
2019-10-30 14:47:15 -03:00
Egor Chesakov feca5e042d Add ComputeCrc32, ComputeCrc32C (dotnet/coreclr#27421)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-30 18:06:03 +01:00
Egor Chesakov 744d77ea7f Remove unsigned overloads of LeadingSignCount (dotnet/coreclr#27533)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-30 18:06:03 +01:00
Martin Baulig c6f71167a1 Bump CoreFX to pickup corefx PR #367 to fix #17133. (#17590) 2019-10-30 12:32:21 -04:00
Bernhard Urban-Forster 95cad24526 [interp] fix signature mismatch between jit<>interp for string constructor (#17595)
[interp] fix signature mismatch between jit<>interp for string constructor
2019-10-30 16:36:04 +01:00
Marek Safar e4c0b50dec [System.Private.CoreLib] Remove NativeRuntimeEventSource 2019-10-30 16:07:43 +01:00
Jan Kotas c9b88b45fe Move runtime specific methods out of the runtime partition
Signed-off-by: dotnet-bot <[email protected]>
2019-10-30 16:07:43 +01:00
Jay Krell 10ac2750e2 Inline TLS access. (#17119)
Inline TLS access.

This attempt differs from the previous in that the TLS accessor functions are presented to far less code, i.e. not to main.c, so their data references do not need to be resolved so much.

See https://github.com/mono/mono/commit/bffd4c6b99213a0b154d7efac9b0581df67775e8 etc.
2019-10-30 16:06:24 +01:00
Zoltan Varga 79f5e6c288 Remove some unused icalls. (#17612) 2019-10-30 10:08:50 -04:00
Filip Navara 3d397805d4 [netcore] Report errors on Windows CI (#17616)
* [netcore] Report errors on Windows CI

* Fix Windows build
2019-10-30 14:39:47 +01:00
Zoltan Varga 2823ac5d95 [wasm] Print a useful error message instead of a signature mismatch error on missing icalls. (#17600) 2019-10-30 00:04:15 -04:00
Dotnet-GitSync-Bot 3695d8704e Mirror changes from mono/coreclr,corefx (#17609)
* Revert removal of SuppressGCTransition from SystemNative_GetTimestamp() (#27473)

* Revert removal of SuppressGCTransition from SystemNative_GetTimestamp()

* Insert GC_POLL before statement with unmanaged call.

* JIT test for insertion of GCPoll

Signed-off-by: dotnet-bot <[email protected]>

* Add file creation method that takes an ACL (dotnet/corefx#42099)

Approved API Proposal: #41614
Related change for directory creation method that takes an ACL: #41834 -merged and ported to 3.1 Prev2

Description
We have extension methods in System.IO.FileSystem.AclExtensions that let the user get and set ACLs for existing files, but we do not have methods that create files with predefined ACLs.
.NET ACL (Access Control List) support is Windows specific. This change will reside inside the System.IO.FileSystem.AccessControl assembly.

Customer impact
Before this change, customers had to create a file or filestream, then set its ACLs. This presents a few problems:

Potential security hole as files can be accessed between creation and modification.
Porting difficulties as there isn't a 1-1 API replacement
Stability issues with background processes (file filters) can prevent modifying ACLs right after creation (typically surfaces as a security exception).
This change addresses those problems by adding a new extension method that allows creating a file and ensuring the provided ACLs are set during creation.
This change is expected to be backported to 3.1.

Signed-off-by: dotnet-bot <[email protected]>
2019-10-30 00:03:47 -04:00
Zoltan Varga 9adce0b632 [wasm] Fix build problems. (#17596)
* [runtime] Add a stub for MacOsIPInterfaceProperties::ParseRouteInfo icall on non-osx platforms to fix the wasm aot build.

* [wasm] Avoid generating invalid ninja build files if an assembly is specified on the command line and its also an implicit reference.

* Put back and ifdef.

* Fix the windows build.
2019-10-30 00:03:08 -04:00
Filip Navara d49d3efd5d Temporary build fix 2019-10-29 23:34:11 +01:00
Noah Falk 67ff64a381 Support large EventSource filter args (dotnet/coreclr#27500)
1. Fix NullReferenceException. When the filter args exceeded the
hard-coded size limit GetDataFromController would return data = null.
The code previously asserted that data was not null and triggered NRE
when it was. The fix correctly null checks the value instead of
asserting and uses an empty args dictionary in this case, the same as if
filter args had been empty to begin with.

2. ETW has always limited filter args to 1024 bytes but EventPipe has no
such restriction. When using DiagnosticSourceEventSource it can be
useful to specify a larger filter arg blob. I can't do anything about
ETW's restriction but there is no need for the runtime to force
EventPipe to be equally limited. The larger size also reduces the chance
that we need to hit the fallback path above causing filter args to be
ignored.

Signed-off-by: dotnet-bot <[email protected]>
2019-10-29 23:34:11 +01:00
Jan Kotas 8a03f60897 Cleanup (dotnet/coreclr#27502)
* Delete empty FireCustomerDebugProbe FCall

* Delete duplicate C++ compiler command line options

Signed-off-by: dotnet-bot <[email protected]>
2019-10-29 23:34:11 +01:00
Elinor Fung 17cef4c4f9 Basic infrastructure for binder tracing (dotnet/coreclr#27383)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-29 23:34:11 +01:00
Stephen Toub 249522036d Fix StreamReader to pass cancellation token into ReadBufferAsync (#27464)
ReadAsyncInternal is correctly passing its token into the two call sites where it delegates directly to the underlying stream, but in one place it calls through ReadBufferAsync, which is currently not defined to take a token.  Fix that, and pass the token through.

Signed-off-by: dotnet-bot <[email protected]>
2019-10-29 23:34:11 +01:00
Jan Kotas 447cb03399 Delete unnecessary abstraction from stubbed out SecurityElement (#27474)
The stubbed out SecurityElement implementation does not support extensibility that ISecurityElementFactory was designed for.

Signed-off-by: dotnet-bot <[email protected]>
2019-10-29 23:34:11 +01:00
Dan Moseley 9aeef958c6 Add path to not-absolute-path exception (dotnet/coreclr#27470)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-29 23:34:11 +01:00
Filip Navara db02ebc88b Fix building portable thread pool on Windows (dotnet/corert#7849)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-29 23:34:11 +01:00
Stephen Toub f26e73b49b Move PreserveDependencyAttribute to shared (dotnet/corefx#42174)
We need to use it in corelib, too.

Signed-off-by: dotnet-bot <[email protected]>
2019-10-29 23:34:11 +01:00
Bernhard Urban-Forster d274cfbacd [mini] Initial tiered compilation work (#17551)
[mini] Initial tiered compilation work

Enable it with `./autogen.sh --enable-experiment=tiered`.

Let's consider `Simple.cs`:
```csharp
using System.Runtime.CompilerServices;
using System;

public class Simple {
    public static void Main (string []args) {
        HotMethod ();
        Console.WriteLine ("cnt: " + cnt);
        HotMethod ();
        Console.WriteLine ("cnt: " + cnt);
    }

    static int cnt = 0;

    [MethodImplAttribute (MethodImplOptions.NoInlining)]
    public static void HotMethod () {
        for (int i = 0; i <= 1000; i++)
            cnt += i;
    }
}
```

```console
$ csc Simple.cs
$ MONO_LOG_LEVEL=debug MONO_LOG_MASK=tiered ./mono/mini/mono-sgen --trace=M:Simple:HotMethod --interp=-all Simple.exe
[0x10ec275c0: 0.00000 0] ENTER:i Simple:HotMethod ()()
Mono: tiered: queued Simple:HotMethod ()
[0x10ec275c0: 0.00010 0] LEAVE:i Simple:HotMethod ()(
Mono: tiered: patching 0x7fe855803224 with patch_kind=INTERP @ tier_level=0
Mono:   -> caller= Simple:Main (string[]) [{0x7fe85420df88} + 0x34 interp]  (0x7fe8558031f0 0x7fe855803258) [0x7fe85420c880 - Simple.exe]
Mono:   -> callee=Simple:HotMethod ()
Mono: tiered: patching 0x7fe8558031f2 with patch_kind=INTERP @ tier_level=0
Mono:   -> caller= Simple:Main (string[]) [{0x7fe85420df88} + 0x2 interp]  (0x7fe8558031f0 0x7fe855803258) [0x7fe85420c880 - Simple.exe]
Mono:   -> callee=Simple:HotMethod ()
cnt: 500500
[0x10ec275c0: 0.04093 0] ENTER:c Simple:HotMethod ()()
[0x10ec275c0: 0.04095 0] LEAVE:c Simple:HotMethod ()(
cnt: 1001000
```
Note the suffix after `ENTER:`
* `i` indicates it's executed by the interpreter
* `c` indicates it's a compiled method (JIT)

Another example:
```console
$ make -C mono/mini gshared.exe
$ ./mono/mini/mono-sgen --interp=-all --stats ./mono/mini/gshared.exe
Regression tests: 84 ran, 0 failed in Tests
[...]
Tiered statistics
Methods promoted                    : 68
```

It's a basic proof-of-concept for now. An incomplete list of future work items:

* Right now it only works for direct calls, need to expand it to virtual/interface calls.
* Calls of the JIT leading into the interpreter again can't be patched yet.
* Kind of related, no concept of versioning compiled methods does exist yet. The interpreter maintains its own table of "transformed" methods, however, when doing the transition from JIT->interpreter, the wrapper+interpmethod will end up in the JIT table. We need a way to have multiple JIT compilation results for the same MonoMethod exist.
* Investigate actual performance. We might have to optimize the interp<>JIT transition.
* Patching is racy. Need to make that atomic.
* All the FIXMEs in this PR



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-10-29 22:36:01 +01:00
Alexander Köplinger 1340095581 [acceptance-tests] Bump mono/roslyn to get build fix
See https://github.com/mono/roslyn/commit/6bfcd4e770609a38b8523e83ce1ec943162f30bb
2019-10-29 20:27:09 +01:00
Zoltan Varga b0d966bd7a [eglib] Handle dli.dli_sname being NULL in g_module_address (). (#17592)
Should fix the warnings/assertions in g_strlcpy ().
2019-10-29 09:21:23 -04:00
Aniruddha Shastri 7f91972ded Support platform-independent newlines in line wrapping in Mono… (#17431)
* Add newLine parameter to StringCoda methods

* Update Options.cs to handle both kinds of newlines

* Add test to OptionSetTest

* Directly handle \r\n instead of using the TextWriter.NewLine
2019-10-29 13:53:41 +01:00
dotnet-maestro[bot] cddf90dda4 [master] Update dependencies from dotnet/arcade dotnet/core-setup dotnet/corefx (#17577)
* Update dependencies from https://github.com/dotnet/arcade build 20191027.3

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19527.3
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19527.3

* Update dependencies from https://github.com/dotnet/core-setup build 20191027.2

- Microsoft.NETCore.App - 5.0.0-alpha1.19527.2

* Update dependencies from https://github.com/dotnet/corefx build 20191027.5

- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19527.5

* Update CoreFX.issues.rsp

GetGCMemoryInfo was moved to GCExtendedTests in https://github.com/dotnet/corefx/commit/d6dac9e6a7875862b91139334c8ec620f599cd4d.

GetTotalAllocatedBytes and GetAllocatedBytesForCurrentThread seem to pass now.
2019-10-29 12:51:33 +01:00
Zoltan Varga e4cc70f4b5 [runtime] Implement support for SuppressGCTransitionAttribute. (#17534)
Fixes https://github.com/mono/mono/issues/17367.
2019-10-28 10:59:52 -04:00
Johan Lorensson c5edcd1ed4 Additional and adjusted logging for parallel minor GC. (#17522)
* Additional and adjusted logging for parallel minor GC.

When running parallel minor GC we currently get incorrect timing
on several loggings and counters due to work being put on thread pool
and accumulated. This commit fix so that the logging is accurate
when running with and without parallelization. In parallel mode a new
logging is also added to show the accumulated split between major and los
remset scan jobs.

The counters time_minor_scan_remsets and time_minor_scan_roots are only
updated when not running parallel GC since they are not correct when
running parallel GC.

* Fix WASM build error.
2019-10-28 15:34:42 +01:00
Alexander Köplinger 450d474684 [netcore] Fix offsets generation when cross compiling
The offsets-tool.py uses some magic to map `typename` to `<underscore>typename` for looking up runtime types.
This caused issues on netcore because we aliased it to a different name.

To fix this let's keep the `_MonoInternalThread` name instead and just fix the one location where `_MonoThread` is used.
2019-10-28 13:57:17 +01:00
Alexander Köplinger fb7b075e49 [netcore] Don't load types in aot-compiler.c that don't exist in corefx
Fixes https://github.com/mono/mono/issues/16026
2019-10-28 13:57:17 +01:00
dotnet-maestro[bot] 6f04054541 Update dependencies from dotnet/corefx (dotnet/coreclr#27431)
* Update dependencies from https://github.com/dotnet/corefx build 20191024.13

- Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.13
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.13

* Update dependencies from https://github.com/dotnet/corefx build 20191024.14

- Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.14
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.14

* Update dependencies from https://github.com/dotnet/corefx build 20191025.6

- Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19525.6
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19525.6

* Workaround https://github.com/dotnet/coreclr/issues/27465

Signed-off-by: dotnet-bot <[email protected]>
2019-10-27 17:54:12 +01:00
Alexis Christoforides db568c6fe0 [merp] Introduce a new 'dump mode' that allows different signal behavior when dumping (#17537)
* dump_native_stacktrace should always register the sigterm handler.

Cherry picked from the https://github.com/mono/mono/pull/17310

* [merp] Introduce a new 'dump mode' that allows different signal behavior when dumping

The primary reason for this is gaining the ability to interpret SIGTERM properly as a crashing signal when outside of 'dump mode', and as a utility signal during the 'thread summarizer' dumping process.
2019-10-26 18:48:40 -04:00
Aleksey Kliger (λgeek) 0e3caf00df [runtime] Unbalanced GC Unsafe transitions before shutdown (#17566)
When embedders call mono_runtime_quit or mono_jit_cleanup, we need to do unbalanced transitions to GC Unsafe, because after mini_cleanup runs we don't have GC thread states anymore and MONO_EXIT_GC_UNSAFE will assert.

* [runtime] Do an unbalanced GC Unsafe transition in mono_jit_cleanup

After mini_cleanup, we don't have GC thread states anymore because all that
stuff was cleaned up, so MONO_EXIT_GC_UNSAFE would assert

* [runtime] Mark mono_runtime_quit external only.

Runtime should use mono_runtime_quit_internal.

After we call the quit_function (aka mini_cleanup) we don't have any GC thread
states anymore because all that stuff got cleaned up.  So MONO_EXIT_GC_UNSAFE
can't work.
2019-10-26 18:45:35 -04:00
Ben Adams 2da4e54a7f Avoid mod operator when fast alternative available (dotnet/coreclr#27299)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-26 19:07:15 +02:00
Jay Krell 5f3446bd12 [cxx][x86] int/ptr casts (#17570)
[cxx][x86] int/ptr casts
2019-10-26 18:26:15 +02:00
Dotnet-GitSync-Bot c5e3ca90de Mirror changes from mono/coreclr (#17571)
* Use ValueStringBuilder instead of StringBuidler{Cache} in multiple places

Signed-off-by: dotnet-bot <[email protected]>

* Avoid unnecessary allocations in Exception.ToString

Signed-off-by: dotnet-bot <[email protected]>
2019-10-26 07:48:46 -04:00
Dotnet-GitSync-Bot fec907397d Mirror changes from mono/coreclr,corert,corefx (#17565)
* Update Corelib to include Stopwatch (dotnet/coreclr#27417)

* Update Corelib to include Stopwatch

* Delete HighPerformanceCounter

Signed-off-by: dotnet-bot <[email protected]>

* Share completed Task between Task and AsyncTaskMethodBuilder (#27437)

Signed-off-by: dotnet-bot <[email protected]>
2019-10-25 21:23:46 -04:00
Caleb Cornett 1801bdad6a Add --preload-file packager option 2019-10-25 14:53:15 -05:00
Leonard 4ec9bd03e5 Fixes #17190: SerializationException on ListViewItemCount (#17195)
* Fix issue #17190: SerializationException on ListViewItemCount

ListViewGroup doesn't (always) have a serialized member "ListViewItemCount".

This patch accounts for that and also adds support for the "ItemsCount"
property that upstream [1] seems to use.

Also items should be initialized regardless of the count, otherwise we get a NPE.

[1] https://github.com/dotnet/winforms/blob/master/src/System.Windows.Forms/src/System/Windows/Forms/ListViewGroup.cs#L144
2019-10-25 19:30:08 +02:00
Kenneth Pouncey 1bd76c6069 Spacing 2019-10-25 12:19:54 -05:00
Kenneth Pouncey f1a3f3c58d Add CompileFunction to Runtime that returns a WebAssembly.Core.Function
- The code passed to `CompileFunction` is not a function definition. Instead it must create and return a function instance.
- Solves the problem of accessing `Node.js` functionality as defining a JavaScript function executes in the global space and does not get `Node.js` access.
- Returning a function instance allows the function to initialize and maintain encapsulated state.
2019-10-25 12:19:54 -05:00
Jay Krell 893486638c [cxx] Compile mini-llvm.c as C++ if configure -enable-cxx. (#17558)
[cxx] Compile mini-llvm.c as C++ if configure -enable-cxx.

This is presently catastrophic, because of `MonoJitICallId` varying between C and C++, and therefore the layout of `MonoCallInst`.

Related to:
https://github.com/mono/mono/pull/17557

https://github.com/mono/mono/pull/17445#issuecomment-546175352
2019-10-25 17:46:01 +02:00
Jay Krell 84d64d314b [jit][x86][cxx] int/ptr casts (#17382) 2019-10-25 11:34:50 -04:00
Aleksey Kliger (λgeek) d6ee245c94 [runtime] Make mono_thread_manage external only (#17554)
* [runtime] Make mono_thread_manage external only

runtime should use mono_thread_manage_internal
2019-10-25 11:28:18 -04:00
Vlad Brezae 768fefbad1 [interp] Optimize stelem (#17519)
* [interp] Optimize stelem instructions

* [intepr] Optimize stelem_ref and slowpath casts

mono_object_isinst_checked uses coop handles and is very slow. Attempt to use the straightforward mono_class_is_assignable_from_checked.

Makes stelem_ref 5x faster.
2019-10-25 16:25:08 +02:00
Egor Bogatov dc4a7f5ed7 [llvm] Use -place-safepoints in JIT mode too (#17116)
* always use -place-safepoints pass in JIT mode

* ignore loaded llvm

* remove gc.safepoint_poll after optimizations

* fix typo

* cleanup

* cleanup

* cleanup

* cleanup

* Do not emit safepoints on entry thus simple functions (without calls and loops) won't have them at all

* Undo  -spp-no-entry=true

* fix failing tests

* do not emit sp in Allocators
2019-10-25 16:10:57 +02:00
Kenneth Pouncey 6ac749ed20 [wasm][bcl] Fix System.Diagnostics.Trace.TraceError crash. (#17509)
* Fix `System.Diagnostics.Trace.TraceError` crash.

- WASM does not have access to the command line arguments through the browser so the length is 0 causing index out of range error.
- The zero index of the command line arguments is what decides the `AppName` so under WASM the AppName will be blanks.

* Address review comments

* Remove #ifdef for WASM only.

- Addresses review note.
- As per channel discussion some embedding scenarios might be the same.
2019-10-25 11:17:00 +02:00
Zoltan Varga 9d781eb78c [wasm] Propagate exit code from Main in the test runner. (#17559)
* [wasm] Propagate exit code from Main in the test runner.

* Disable some System tests as they currently fail.
2019-10-25 04:59:30 -04:00
Dotnet-GitSync-Bot 8800bfdf9c Fix build break (#17553)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-24 18:30:09 -04:00
Jay Krell 4ef7c566af [cxx] externC for some icalls, for wasm and ios. (#17444)
Maybe all JIT icalls?
2019-10-24 17:59:11 -04:00
Jay Krell fc390a5f24 Include signal.h unconditionally. (#17430)
Some of the includes already were unconditional, including both on Win32 and Unix.
It is part of ANSI C 89, albeit in a reduced form compared to typical Unix (no sigaction).

Remove configuration of MSG_NOSIGNAL which has no other uses.

Preserve configuration of signal.h temporarily due to other uses of ifdef HAVE_SIGNAL_H.
 i.e. LLVM?
2019-10-24 17:44:57 -04:00
Jay Krell ec81a868a1 [cxx][x86] int/ptr casts. (#17441)
* [cxx][x86] Another int/ptr cast.

* More casts. Notice these are under
`#if defined (MONO_ARCH_USE_SIGACTION) && !defined (MONO_CROSS_COMPILE)`
which would explain them not showing up.
2019-10-24 17:37:12 -04:00
Dotnet-GitSync-Bot aea7214eb4 Optimize GC.AllocateUninitializedArray and use it in StringBuilder (#27364) (#17550)
* use GC.AllocateUninitializedArray for allocating internal char buffers

* force inlining of AllocateUninitializedArray to have no perf hit on the small buffers hot path

* insrease the threshold from 256 to 2048 bytes

* use Unsafe.As instead of a cast

* remove the size precondition from AllocateNewArray method, the called AllocateSzArray is responsible for handling negative size

Signed-off-by: dotnet-bot <[email protected]>
2019-10-24 16:02:11 -04:00
dotnet-maestro[bot] a7287bdae5 [master] Update dependencies from dotnet/arcade dotnet/core-setup dotnet/corefx (#17458)
* Update dependencies from https://github.com/dotnet/arcade build 20191018.2

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19518.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19518.2

* Update dependencies from https://github.com/dotnet/core-setup build 20191021.2

- Microsoft.NETCore.App - 5.0.0-alpha1.19521.2

* Update dependencies from https://github.com/dotnet/corefx build 20191020.7

- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19520.7

* Update dependencies from https://github.com/dotnet/arcade build 20191023.3

- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19523.3
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19523.3

* Update dependencies from https://github.com/dotnet/core-setup build 20191023.10

- Microsoft.NETCore.App - 5.0.0-alpha1.19523.10

* Update dependencies from https://github.com/dotnet/corefx build 20191023.8

- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19523.8

* Disable a file system watcher test on mac

See https://github.com/mono/mono/issues/17547

* Reenable tests that were fixed
2019-10-24 21:06:46 +02:00
Bernhard Urban-Forster 25b53a642b [interp] fix code length for JitInfo (#17538)
* [interp] fix code length for JitInfo

* fix c++ build
2019-10-24 20:13:27 +02:00
Tanner Gooding 0595c0e6d7 Move down S.N.Vector APIs and expose new conversion support (#27401)
* Updating S.P.Corelib to start building Vector2/3/4 and supporting types

* Removing HAS_INTRINSICS usages from Matrix4x4

Signed-off-by: dotnet-bot <[email protected]>
2019-10-24 14:10:07 -04:00
Marek Safar 81a4a19f0a [netcore] Fix corerun build deps 2019-10-24 14:09:14 -04:00
Martin Baulig 1553889bc5 Cleaning up SslStream, MobileAuthenticatedStream and TaskToApm. (#17393)
### Overview

After the removal of the Legacy TLS Provider, we can make some cleanups and improvements to the `SslStream` class.  Since both the remaining providers use the internal `MobileAuthenticatedStream` and support Task-async code, we can get rid of some of the Begin/End async logic and the the underlying
`Stream` class handle it instead.

This also fixes a nasty issue with some of those task objects leaking unobserved exceptions.  The problem was that `SslStream.Dispose()` needs to clear out all resources, but in doing so also nulls out the `Impl` handle to the `MobileAuthenticatedStream` - so a subsequent `End*()` call will not reach it's corresponding `TaskToApm.End()` method.

There are also some cleanups in the internal APIs that were only ever used internally and not intended for public consumption.

### Mono.Security.dll

* `Mono.Security.Interface`: removed internal `ICertificateValidator2` interface.

* `Mono.Security.Interface.IMonoSslStream`: this internal interface is only used by the web-tests, which only use it as a way to get the `SslStream` instance, so all those `Begin/End` async methods are now gone.

* `Mono.Security.Interface.IMonoSslStream2`: removed another internal interface.

* `Mono.Security.Interface.MonoTlsProvider`: removed some `internal abstract` methods; these have been moved into a new `Mono.Net.Security.MobileTlsProvider` inside `System.dll`.

### System.dll

* `Mono.Net.Security.MobileTlsProvider`:
  New abstract internal base class, which received the aforementioned abstract internal methods.  The naming is such to make it consistent with the already existing `MobileTlsContext` and `MobileAuthenticatedStream`.

Since both `AppleTlsProvider` and `BtlsProvider` now have an abstract internal base class inside `System.dll`, they can use the `ChainValidationHelper` class directly and we can also avoid some `Mono.Security` dances like for instance that `MonoSslPolicyErrors` enum.

This will also help make the code easier to read and maintainer.
  
* `Mono.AppleTls.AppleTlsProvider` and `Mono.Btls.MonoBtlsProvider`: change base class into `MobileTlsProvider` and reflect above mentioned overload changes.

* `Mono.AppleTls.AppleCertificateHelper`: use `ChainValidationHelper` as well.

* `Mono.Net.Security.ChainValidationHelper`: only implement `ICertificateValidator`.
  The `ICertificateValidator` interface is still required because it is in use by the web-tests, but the previous `ICertificateValidator2` was an internal dance.

* `Mono.Net.Security.MobileAuthenticatedStream`: largely cleaned up this class.
  - we now implement the current slimmer version of `IMonoSslStream`.
  - moved all those overloads into `SslStream` that only fill in default values for some of their arguments and then call another overloaded version of their own.
  - removed lots of `Begin/End` methods that are not used anymore.

* `Mono.Net.Security.MonoTlsProviderFactory`: use `MobileTlsStream` everywhere.

* `Mono.Net.Security.MonoTlsStream`: cleanup `SslStream` creation logic; instead of going throw `provider.CreateSslStream()`, we can now use an internal constructor directly, thus avoiding the `IMonoSslStream` interface while also making the code a lot easier to read and understand.

* `System.Net.Mail.SmtpClient`: same here.

* `System.Net.HttpWebRequest`: use `MobileTlsProvider`.

* `System.Net.Security.SslStream`: largely cleaned up this class.
  - we now use `MobileAuthenticatedStream` directly instead of the `IMonoSslStream` interface and therefore could also get rid of `IMonoSslStream2`.
  - cleanup constructor logic to allow the internal constructor being used with a `MobileTlsProvider` instead of going through `provider.CreateSslStream()`.
  - all those overloads that are only filling in default values for some of their arguments before calling another overloaded version of their own now live here instead of in the `MobileAuthenticatedStream` class.  The reason is to simply that `MobileAuthenticatedStream` is already quite a complex and difficult class, and removing some of that complexity out of it will make it easier to understand.
  - handle the `TaskToApm.Begin()` / `TaskToApm.End()` here to ensure that we are not leaking any task objects with unobserved exceptions.
  - removed `BeginRead()` and `BeginWrite()` overloads to let the underlying `Stream` class handle these.


* Bump API snapshot submodule

* [csproj] Update project files
2019-10-24 19:42:54 +02:00
Calvin Buckley 638e2c6a86 Fix eglib on AIX/PASE (#17476)
* fix eglib on AIX/PASE

	* Work around access(2) syscall bug on PASE
	  On PASE, X_OK will always returns true. This is contrary to
	  how AIX behaves (though corresponds to documentation!). This
	  is probably because it's an upcall to the ILE version of
	  access, and that seemingly always returns true.

	* Always export the dummy function in the test suite
	  The AIX linker didn't export this properly, without using the
	  giant sledgehammer of -bexpall. Write an export file and use
	  it. This required some build system changes to expose an
	  AIX-only automake conditional.

	* Use a file that exists on PASE for tests
	  PASE doesn't use Unix-style DNS resolution, so /etc/hosts is
	  missing. Use /etc/magic, since that seems to be present.

	* Don't use /bin on AIX/PASE for tests
	  This is a symlink to /usr/bin, and it seems chdir/getcwd
	  follows links. Use /usr instead, that is unlikely to be a
	  symlink.

	* Make a note what directory we're in if we fail test_cwd

* Change manual executable access check change per Jay

* Change test on POSIXy platforms to always use root directory
2019-10-24 18:04:20 +02:00
Vlad Brezae b7ef736338 [interp] Add super instructions for field storing (#17525)
* [interp] Add also floating versions for stloc.np

* [interp] Add super instructions for stfld

When storing into a field of a local or an argument (ldloc/ldarg -> random instructions that end up pushing one value -> stfld). We add this instruction to the cprop pass because the instructions that are optimized together are not consecutive and we need the stack information to be able to access the instruction that loaded the argument / local and to make sure that the local wasn't dirtied. Alternatively we could make the super instruction pass stack aware, which we should probably do if more super instruction candidates turn out to require stack state information.

* [interp] Enable cprop for methods without locals

We do some optimizations here that don't apply to locals.

* [interp] Fix result stack type of CEE_CONV_OVF_I_UN
2019-10-24 18:05:04 +03:00
Vladimir Sadov 6fd07e4745 Moving StopWatch to src\Common\src\Corelib (dotnet/corefx#42072)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-24 16:54:28 +02:00
Egor Bogatov 7952e73780 Bump to mono/corefx@fb41040
Includes upstream corefx changes that makes NTLM auth work for more scenarios.
2019-10-24 10:04:24 -04:00
Bernhard Urban-Forster 861812252a [lldb] another fix for handling interp frames (#17535)
[lldb] another fix for handling interp frames

And improved error message in case it breaks again.
2019-10-24 14:07:22 +02:00
Dotnet-GitSync-Bot 2c8e0f68c1 Add AdvSimd (LeadingZeroCount, LeadingSignCount, PopCount) (#27382) (#17532)
* AdvSimd.LeadingSignCount

* AdvSimd.LeadingZeroCount

* AdvSimd.PopCount

Signed-off-by: dotnet-bot <[email protected]>
2019-10-24 07:16:49 -04:00
Zoltan Varga 951769b279 [netcore] Add a few more missing SSE intrinsics. (#17511)
* [netcore] Add a few more missing SSE intrinsics.

* Disable some intrinsics for non-llvm.
2019-10-24 06:57:13 -04:00
Johan Lorensson fe7654f745 Adjust restart world logging level to match start major/nursery logging. (#17520)
With this change we will get the following logging on level 1:

2019-10-22 15:46:59 Start nursery collection 38898 00000205A0000000-00000205A1000000, size: 16777216
2019-10-22 15:46:59 restarted (pause time: 2728 usec, max: 689233 usec)

showing the pause time and when runtime was restared, before this fix
we will only see the start log message on level 1.
2019-10-24 04:57:55 -04:00
Filip Navara 7a15b71873 [netcore] Managed ThreadPool implementation (#17387)
* Wire up the managed side of the portable thread pool

* Remove old native thread pool code

* Fix non-netcore build

* Fix Thread.IsThreadPoolThread

* Fix MSVC builds

* Code style fix

* Make the locking primitives uninterruptible

* Revert icall changes for non-netcore

* Implement Thread.ResetThreadPoolThread

* Compile out more thread pool code for netcore

* Remove ThreadPoolBoundHandle, it is shared now

* Address PR feedback on code style
2019-10-24 04:56:25 -04:00
Dotnet-GitSync-Bot 2dfd682ac9 Enable pooling for async ValueTask/ValueTask<T> methods (#26310) (#17531)
Today `async ValueTask/ValueTask<T>` methods use builders that special-case the synchronously completing case (to just return a `default(ValueTask)` or `new ValueTask<T>(result))` but defer to the equivalent of `async Task/Task<T>` for when the operation completes asynchronously. This, however, doesn't take advantage of the fact that value tasks can wrap arbitrary `IValueTaskSource/IValueTaskSource<T>` implementations.

This commit gives `AsyncValueTaskMethodBuilder` and `AsyncValueTaskMethodBuilder<T>` the ability to use pooled `IValueTaskSource/IValueTaskSource<T>` instances, such that calls to an `async ValueTask/ValueTask<T>` method incur 0 allocations (ammortized) as long as there's a cached object available.

Currently the pooling is behind a feature flag, requiring opt-in via the DOTNET_SYSTEM_THREADING_POOLASYNCVALUETASKS environment variable (setting it to "true" or "1").  This is done for a few reasons:
- There's a breaking change here, in that while we say/document that `ValueTask/ValueTask<T>`s are more limited in what they can be used for, nothing in the implementation actually stops a `ValueTask` that was wrapping a `Task` from being used as permissively as `Task`, e.g. if you were to `await` such a `ValueTask` multiple times, it would happen to work, even though we say "never do that". This change means that anyone who was relying on such undocumented behaviors will now be broken. I think this is a reasonable thing to do in a major release, but I also want feedback and a lot of runway on it.
- Policy around pooling. Pooling is always a difficult thing to tune. Right now I've chosen a policy that limits the number of pooled objects per state machine type to an arbitrary multiple of the processor count, and that tries to strike a balance between contention and garbage by using a spin lock and if there's any contention while trying to get or return a pooled object, the cache is ignored. We will need to think hard about what policy to use here. It's also possible it could be tuned per state machine, e.g. by having an attribute that's looked up via reflection when creating the cache for a state machine, but that'll add a lot of first-access overhead to any `async ValueTask/ValueTask<T>` method.  For now, it's tunable via the `DOTNET_SYSTEM_THREADING_POOLASYNCVALUETASKSLIMIT` environment variable, which may be set to the maximum number of pooled objects desired per state machine.
- Performance validation.  Preliminary numbers show that this accomplishes its goal, having on-par throughput with the current implementation but with significantly less allocation.  That needs to be validated at scale and across a variety of workloads.
- Diagnostics.  There are several diagnostics-related abilities available for `async Task/Task<T>` methods that are not included here when using `async ValueTask/ValueTask<T>` when pooling.  We need to evaluate these (e.g. tracing) and determine which pieces need to be enabled and which we're fine omitting.

Before shipping .NET 5, we could choose to flip the polarity of the switch (making it opt-out rather than opt-in), remove the fallback altogether and just have it be always on, or revert this change, all based on experimentation and data we receive between now and then.

Signed-off-by: dotnet-bot <[email protected]>
2019-10-24 03:09:50 -04:00
Kenneth Pouncey 1b5658d590 [wasm][sdk] Bump SDK version to 0.2.2 (#17516)
* [wasm][sdk] Bump SDK version to 2.2

* Update SDK version for browser tests
2019-10-24 07:37:28 +02:00
Dotnet-GitSync-Bot e5d88dbd04 Mirror changes from mono/coreclr,corefx,corert (#17526)
* Apply SuppressGCAttribute to some SPCL functions. (dotnet/coreclr#27369)

Apply SuppressGCAttribute to some SPCL functions.

Only insert GC_POLL in first morph call.

Signed-off-by: dotnet-bot <[email protected]>

* Remove unused methods (dotnet/coreclr#27370)

Signed-off-by: dotnet-bot <[email protected]>

* Move Matrix3x2/4x4, Plan, and Quaternion to the shared CoreLib partition (#42021)

Signed-off-by: dotnet-bot <[email protected]>

* Remove Socket.InnerSafeCloseSocket (dotnet/corefx#41888)

* Remove Socket.InnerSafeCloseSocket

* Move IsInvalid checks in SetHandle function

* PR feedback

* Remove unnecessary 'SocketPal.'

* Remove SafeSocketHandle.SetHandle

Signed-off-by: dotnet-bot <[email protected]>
2019-10-23 23:01:00 -04:00
Maxim Lipnin 43a938fefb [wasm][xunit tests] Exclude some System.Data tests (#17527) 2019-10-23 22:55:56 -04:00
Thays Grazia 8fda1738f7 [debugger] Changing how debugger handles exception when hybrid suspend is enabled (#17478)
* Removing all fixes to fix #15203 and #17083, and trying a new approach to fix this #17084, together.

The thing is when we are executing on hybrid suspend the caller is executed inside try catch in the runtime_invoke_ method that is generated. And this try catch should be ignored for the debugger exception, otherwise it's the last try catch in main thread, but should always be considered to generate the stack trace.

Fixes #17084

* This test check the case that we were missing. On preemptive this test always runs perfectly, on Hybrid, never run well until this PR.

* Changing how call unit test.
Changing variable name.
2019-10-23 17:56:58 -03:00
Jay Krell 4d7adf4d2a [cxx] Put extern "C" in MONO_LLVM_INTERNAL. (#17443) 2019-10-23 15:36:35 -04:00
Johan Lorensson df30c7228c Optimize LOS for better parallelization. (#17173)
Scanning LOS list as part of minor GC didn't parallelize well since
all scan jobs needed to walk the complete LOS list. This led to touching
a lot of memory walking the list, increasing minor GC pause times
when the number of items in the LOS list increased. As an example,
stressing LOS data structure using ~600 MB's of random sized byte arrays
caused minor GC pause times between ~20ms without parallelization and ~19ms
with parallelization. NOTE, the more work each job gets (more memory to scan)
we will get a better parallelization, but still a lot of room for improvement.

Changing from a normal linked list to a SgenArrayList makes it more effective
to parallelize the scan jobs and since the list is using sequential
memory, this will also reduce cache misses for each thread iterating LOS
objects. Tagging objects in SgenArrayList with reference information reduce
cache misses dramatically in cases where objects not including references
exists on the list, since scanning jobs can skip these items without any
need to touch object memory causing cache misses.

Same scenario running with fix gives us minor GC pause times, without
parallelization in ~7ms (down from 20~ms) and with parallelization,
< 5ms (down from 19ms). NOTE, the more work each job gets (more memory to scan)
we will get a better result using parallelization, so the delta will increase
between using and not using parallelization, this scenario primarily stress
the extreme case where most LOS objects doesn't have references.

In total, this optimization reduce minor GC pause time 4x, from ~19ms when
using parallelization down to < 5ms.
2019-10-23 14:58:04 -04:00
Zoltan Varga 31b475e25a [wasm] Avoid adding an extra arg to native-to-managed wrappers. (#17508)
[wasm] Avoid adding an extra arg to native-to-managed wrappers.

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




<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-10-23 17:06:18 +02:00
Jay Krell 8b8b8b5010 [coop] Fix big endian problem in MonoThradStateMachine and cleanup. (#17502) 2019-10-23 10:21:54 -04:00
Filip Navara e29f8e32b7 [netcore] Add Unsafe.SkipInit intrinsic 2019-10-23 09:26:09 -04:00
Tanner Gooding e73aa17e23 Adding SkipInit to Internal.Runtime.CompilerServices.Unsafe (#27377)
* Adding SkipInit to Internal.Runtime.CompilerServices.Unsafe

* Updating the runtime to handle Unsafe.SkipInit

* Updating Decimal.DecCalc to use Unsafe.SkipInit

* Removing 'workaround for CS0165' comments

Signed-off-by: dotnet-bot <[email protected]>
2019-10-23 09:26:09 -04:00
Marius Ungureanu bed1b39c6e Bump Bockbuild to pick-up gtk# binding change (#17486)
Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1005448
Which causes quite a few broken clipboard bugs and possible memory corruption

(cherry picked from commit 989333d6ae)
2019-10-23 14:36:46 +02:00
Kenneth Pouncey bc769e7376 [wasm] move jsvu repo back after fixes for v8 (#17514) 2019-10-23 13:34:36 +02:00
Kenneth Pouncey cdf8b839ae [wasm][binding] Add bindings for calling the entry point of an '.exe' (#17510)
- Add `mono_bind_assembly_entry_point`
- Add `mono_call_assembly_entry_point`
   - Module.mono_call_assembly_entry_point("WasmHttpStreamSync", []);

Example:

```
   Module.mono_call_assembly_entry_point("WasmHttpStreamSync", []);
```

```
   var main = Module.mono_bind_assembly_entry_point("WasmHttpStreamSync", []);
   main();
```
2019-10-23 12:43:16 +02:00
Vlad Brezae 479d2dff36 [interp] Add a new super instructions pass (#17489)
Together with a few very simple super instructions. We replace common instruction patterns to avoid indirection via interp stack, instruction dispatch overhead and to allow the compiler to generate better code for the instruction.
2019-10-23 11:57:07 +03:00
Vlad Brezae 4419dc919f [interp] Retry cprop pass if killing stloc (#17491)
When replacing a stloc with a pop, we should retry the pass, since it is very likely that we will be able to kill the instruction that pushed that value on the stack.
2019-10-23 10:39:27 +03:00
Jay Krell 92c08fab4d SetLastError slightly later, in case last error not preserved, and it is just as good. (#17483)
SetLastError slightly later, in case last error not preserved, and it is just as good.
2019-10-23 09:36:15 +02:00
Vlad Brezae 6159407846 [interp] Optimize ldelem instructions (#17494)
Remove the switch and have each instruction have its own code. Seems to improve speed on a benchmark that heavily uses ldelem by about 10-20%.
2019-10-23 10:23:49 +03:00
Zoltan Varga a2cd8b2495 [wasm] Enable threads again on CI, it seems to work again. (#17503) 2019-10-23 02:41:46 -04:00
Dotnet-GitSync-Bot b99a3e9514 Move Vector2/3/4 to the shared CoreLib partition (dotnet/corefx#42005) (#17505)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-23 00:36:20 -04:00
Filip Navara 1e60703a19 [netcore] Disable debugging code in lookup_intrins (#17464) 2019-10-23 00:01:51 -04:00
Aaron Robinson 11dca2a3b8 Add documentation for SuppressGCTransition (dotnet/coreclr#27368)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 21:30:52 -04:00
Zoltan Varga 745e5ba3c3 [wasm] Bump emscripten to 1.39.0. (#17484)
* [wasm] Bump emscripten to 1.39.0.

* [wasm] Fix threads build.
2019-10-22 20:09:07 -04:00
Larry Ewing d08713198f [wasm] fix package target 2019-10-22 18:19:19 -05:00
Larry Ewing 433d7c5004 [wasm] Bump DebugProxy to netstandard 2.1 / netcore 3.0.0 2019-10-22 18:19:19 -05:00
Larry Ewing 15d61d3f47 [wasm] work around jsvu / v8 changes 2019-10-22 15:50:18 -05:00
Tanner Gooding 69407517bc Adding back more arm intrinsics that existing before refactoring (#27153)
* Adding AdvSimd.And

* Adding AdvSimd.AndNot

* Adding AdvSimd.Or

* Adding AdvSimd.OrNot

* Adding AdvSimd.Xor

* Adding AdvSimd.Not

* Removing a trailing whitespace from AdvSimd.PlatformNotSupported.cs

* Adding AdvSimd.Subtract

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 14:48:34 -04:00
Filip Navara fdca1630dc Fix nullability error in portable thread pool (dotnet/coreclr#27366)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 14:48:34 -04:00
Jan Kotas b98911d4f8 Delete Uap quirks from CoreLib (dotnet/coreclr#27356)
This matches cleanup done in CoreFX.

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 14:48:34 -04:00
Adam Sitnik 0663433389 remove double bound check from StringBuilder.Append(char) (#27340)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 14:48:34 -04:00
Aleksey Kliger (λgeek) fb5b2c949d [reflection] mono_method_get_base_method on a GTD should use canonical ginst (#17475)
* [test] GetCustomAttributes on generic type definition

* [reflection] mono_method_get_base_method on a GTD should use canonical ginst

The issue is in how we pass along the generic instantiation.  So there are two
parts here: we start with a method on a GTD which has to decompose into the GTD
and it's instantiation with its own generic parameters, and then we go up to
its parent and grandparent inflating and decomposing the resulting
instantiation. The instantiations keep passing the last parameter as the number
of parameters shrinks so that the gparam index from the original type is now
out of bounds for the parent and grandparent.  If we mess up, we'll get a
BadImageFormatException from the runtime

Fixes https://github.com/mono/mono/issues/17278
2019-10-22 14:07:44 -04:00
Maxim Lipnin bc9b64b807 Get resource string 2019-10-22 12:13:38 -05:00
Aleksey Kliger (λgeek) ebb5846e0d [coop] Use bitfields for coop state machine state representation (#17298)
* [checked] Mask the thread state in GC thread state assertions

Because we have extra bits (like suspend count and the no_checkpoints bit) on
the thread state, we have to mask it to get the actual thread state enum value

* [coop] Use bitfields to represent coop thread state

Instead of using a 32-bit int, use bitfields and type-punning through a union
type.  We need to type pun because we need to access the entire state as a 32-bit int so that we can do atomic CAS.

* use atomic load of thread state in unwrap_thread_state.

Saw one stack trace on CI on the full coop lane where check_thread_state saw STATE_RUNNING
but with a positive suspend count.  Another thread was starting a GC a
the time.  Seems like we saw the state as runnning, but the suspend
count as if we were already in async_suspend_requested.

Thread 22 (Thread 0x7f43c03ff700 (LWP 39860)):
2019-10-22 12:14:05 -04:00
Marek Safar f34fd20fbf [System.Private.CoreLib] Remove unused methods 2019-10-22 11:28:22 -04:00
Filip Navara cf1a9e0033 Update Mono for changes in shared CoreLib partition 2019-10-22 09:46:29 -04:00
Jan Kotas 64c3405594 Cleanup memory copy helpers (dotnet/coreclr#27307)
- Merge RuntimeImports that has just a few FCalls into Buffer.
- Delete assembly implementation of memcpy for ARM. The implementation was outdated and it was used only on Windows ARM and only for fraction of memcpy callsites.
- Delete unnecessary PInvoke into SysStringLen. We have a managed equivalent on System.Runtime.InteropServices.Marshal.
- Delete large amount of redundant code between SecureString.Windows.cs and SecureString.Unix.cs, and switch SecureString to use Spans
- Fold null check into IsWin32Atom

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Jan Kotas d4a2f01064 Rewrite Buffer.BlockCopy in C# (dotnet/coreclr#27216)
* Rewrite Buffer.BlockCopy in C#

Fixes #27106

* Workaround to enable type check optimizations for BlockCopy only

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Tanner Gooding 8ea0426488 Improve codegen for IsNan (dotnet/coreclr#27272)
* Updating double.IsNaN and float.IsNaN to just `return x != x`

* Updating x86 codegen to optimize `x != x` for floating-point

* Changing the isnan optimization to only check the operand assigned registers

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Jan Kotas 113d855adb Delete ENABLE_WINRT define (dotnet/coreclr#27240)
.NET Native specific code not needed anymore

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Ben Adams d5b182c6d8 Improve Dictionary TryGetValue size/perfomance (dotnet/coreclr#27195)
* Dictionary avoid second bounds check in Get methods

* Add NullRef methods to Unsafe

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Levi Broderick 274db87e60 Fix DecoderNLS.Convert to out the correct value for 'completed' (#27210)
This is a complementary fix to https://github.com/dotnet/coreclr/issues/23020

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Del Myers 0e02fa55af Enable ETW/EventSource logging of task IDs for boxed state machines (#27115)
* Wrap MoveNext Action for TPL event tracing

Wraps the MoveNext action of the AsyncStateMachineBox in a
continuation wrapper when async causality tracing is on so that the
TPL event source can find the task that is associated with a
continuation. Does not wrap otherwise.

* Clarifying comment

* removing trailing whitespace

* code review feedback.

Makes AsyncMethodBuilderCore.TryFindContinuationTask check to
whether the target of a continuation is itself a task, as a fall-back
to checking to see if the continuation is a ContinuationWrapper

* Got rid of unnecessary null checks

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Levi Broderick 5fdea0b84b Update Utf8String to match latest prototype (dotnet/coreclr#27046)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Stephen Toub d34ba480f9 Use stackalloc expressions with builder ctors (dotnet/coreclr#27194)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Aaron Robinson 296b8d40cf Conditionally remove the GC transition from a P/Invoke (#26458)
* Provide mechanism to remove the GC transition from a P/Invoke.
  New Attribute: 'System.Runtime.InteropServices.SuppressGCTransitionAttribute'

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Jan Kotas cd2388fd6f Replace primitive Array fcalls with managed implementations (#27123)
Prep-work for #27106

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Filip Navara 858fc11900 Move portable thread pool to shared partition (dotnet/corert#7828)
* Move portable thread pool to shared partition

* Rename ClrThreadPool to PortableThreadPool

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Dan Moseley 565b81e26f Annotate System.Resources.ResourceWriter for nullable ref types (#41880)
* Annotate System.Resources.ResourceWriter for nullable ref types

* ref

* Mark common as nullable enable explicitly

* _resourceList

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Eriawan Kusumawardhono f731db32dd Replace tfm based constants with SDK ones (dotnet/corefx#41601)
* replace DefineConstants with SDK ones

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Zoltan Varga b96260e603 [jit] Avoid running mono_handle_native_crash () on the altstack, it can't produce a backtrace. AMD64 only for now. (#17466)
* [jit] Avoid running mono_handle_native_crash () on the altstack, it can't produce a backtrace. AMD64 only for now.

* Fix checks so stack overflows work again.
2019-10-22 06:31:23 -04:00
Larry Ewing 20752df324 [debugger][wasm] Check the length of the vars array. Fixes #17473 2019-10-21 18:45:57 -05:00
Vlad Brezae c1461e4a2d [interp] Replace loading of static readonly fields with LDC (#17420)
LDC is faster and also allows for constant propagation. Cleanup code a little bit.
2019-10-21 23:42:24 +03:00
Jay Krell fd82c6036e No type_traits on Android.
In file included from /Users/builder/jenkins/workspace/test-mono-pull-request-amd64-osx-products-sdks-android/mono/metadata/icall.c:42:
/Users/builder/jenkins/workspace/test-mono-pull-request-amd64-osx-products-sdks-android/mono/metadata/icall-internals.h:89:10: fatal error: 'type_traits' file not found
2019-10-21 11:15:16 -05:00
Kenneth Pouncey 7e522ef179 Modify the check for streaming to also check that the browser Response object exists. 2019-10-21 10:27:05 -05:00
Jay Krell 21d7d41bfe [cxx][debug-interp] Cast once from void* to non-void*. 2019-10-21 10:22:43 -05:00
Kenneth Pouncey 2cea0a89d1 Fix host object existence check.
- The checking for the existence of the object is incorrect: Missing parens around undefined.
- Modify error description returned back to managed code.
- Fix capitalization in global object check error.
2019-10-21 10:21:16 -05:00
Thays Grazia 0d357c1347 [tests] Replace __WATCHOS__ with MONOTOUCH_WATCH (#17459)
Fixes the conditional from mono/mono#17423, we don't define __WATCHOS__ in the Mono BCL builds. We use MONOTOUCH_WATCH instead.
2019-10-21 16:20:12 +02:00
Kenneth Pouncey f07e93da2f [wasm] Make sure message pump is working when executing via NODEJS (#17453)
- Tests if we are running in ENVIRONMENT_IS_NODE
   - run message pump if we are.

- This also fixes GC not running.

- Clean up some messages.
2019-10-21 14:29:18 +02:00
Kenneth Pouncey 3ff90ac0c2 Export mono_load_runtime_and_bcl so that is available in nodejs. (#17456) 2019-10-21 13:50:57 +02:00
Jay Krell 9f50bdb2d9 [Coop] Unconvert Microsoft.Win32.NativeMethods. (#16992)
* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_CloseProcess.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcess.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcessId.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess.

* [Coop] Unconvert ves_icall_Microsoft_Win32_NativeMethods_WaitForInputIdle.
2019-10-21 10:29:39 +02:00
Zoltan Varga 4b9226619c [interp] Small fixes. (#17442)
* [interp] Really abort in ves_real_abort ().

* [interp] Fix stack usage in TRACE_EXIT.

* [interp] Add a callback to free ThreadContext.

* Fix warnings.

* Remove an empty statement.

* Fix a double free.
2019-10-20 23:28:25 -04:00
Filip Navara 32ab6bcf00 [netcore] Implement Array.GetElementSize as intrinsic (#17437)
* [netcore] Implement Array.GetElementSize as intrinsic

* Remove unnecessary icall

* alloc_preg -> alloc_ireg

* Implement Array.GetElementSize as intrinsic in interpreter

* Address PR feedback
2019-10-20 18:39:39 -04:00
Filip Navara 67c8d0d812 [netcore] Remove unused code for Array.Unsafe[Mov/Load/Store] intrinsics 2019-10-20 12:44:52 +02:00
monojenkins 5fcd00669c [csproj] Update project files 2019-10-20 12:43:59 +02:00
monojenkins b19d9aa658 Bump API snapshot submodule 2019-10-20 12:43:59 +02:00
Zoltan Varga 1d44139d01 Bump cecil. 2019-10-20 12:43:59 +02:00
Filip Navara bc678a2c10 Use correct variable in mini_get_cpu_features (#17436)
* Use correct variable in mini_get_cpu_features

* Address PR feedback
2019-10-20 01:26:44 -04:00
Filip Navara 91f10aeee4 Remove dead code left out in #17341 (#17433) 2019-10-20 01:23:05 -04:00
Jay Krell 91413f78f3 [jit][x86][cxx] int/ptr casts in mini-x86.c (#17380) 2019-10-19 19:20:56 +02:00
Jay Krell 84f4e1dcbf Replace ICALL_DECL_EXPORT with ICALL_EXPORT. They are always the same, and it is only used once. (#17429)
Replace ICALL_DECL_EXPORT with ICALL_EXPORT. They are always the same and it is only used once.
2019-10-19 13:25:54 +02:00
Thays Grazia 105ead8707 Changing behavior of some tests in WatchOs
Needs this ifdefs because of this https://github.com/mono/mono/pull/17260. (#17423)
2019-10-18 21:23:44 -04:00
Aleksey Kliger (λgeek) d8ae32a9ee [bcl] Add null reference checks to Interlocked.Exchange<T> (#17400)
* [bcl] Add null reference checks to Interlocked.Exchange<T>

and Interlocked.CompareExchange<T>

This is to mimic the old behavior in unmanaged when the intrinsic cannot be
used.

The issue was detected via the coreclr acceptance test:
https://github.com/mono/coreclr/blob/mono/tests/src/baseservices/threading/interlocked/exchange/exchangetneg.il

* and netcore
2019-10-18 19:11:22 -04:00
Jay Krell a2992d634b [cxx] [wasm] int/ptr casts esp. m2n-gen. (#17379) 2019-10-19 00:03:00 +02:00
Martin Baulig fffad7e3a8 Remove the Legacy TLS Provider. (#17391)
* `MonoTlsProviderFactory` now treats "legacy" as an alias for "default".

* `Mono.Net.Security/LegacySslStream`: Removed.  This class also wasn't using the `MobileAuthenticatedStream` base class, thus preventing cleanups simplifications in that area.

* `Mono.Net.Security/LegacyTlsProvider`: Removed.

* `Mono.Security/Mono.Security.Protocol.Tls*`: Removed all the old legacy code.

* `Mono.Security.Interface.MonoTlsProviderFactory`: Bump internal version to 4.
2019-10-19 00:02:48 +02:00
imhameed 8836231459 Merge pull request #17279 from imhameed/bug-gh-16935-netcore-equalsall-codegen
Generate LLVM IR for OP_XEQUAL that is recognized by LLVM's vector pattern recognizers.
2019-10-18 12:47:41 -07:00
Alex Rønne Petersen d44e0e80d7 Some updates to make RISC-V buildable again. (#17408)
Some updates to make RISC-V buildable again.

Also some updates to the toolchain setup documentation.
2019-10-18 20:16:14 +02:00
Kenneth Pouncey a0c7d73d6f [sdks] add .gitignore python __pycache__ (#17414)
This will ignore the __pycache__ files generated after the tools offset build.
2019-10-18 18:08:57 +02:00
Vlad Brezae 37f628750a [profiler] Fix coverage profiler on macos (#17396)
If we have coverage profiling enabled for a method (mono_profiler_coverage_instrumentation_enabled, with coverage_filter callback), then we should be able to allocate a coverage info structure (mono_profiler_coverage_alloc). After https://github.com/mono/mono/commit/52429673dc617fd437518757c04c7448211075e9, coverage_filter was reporting wrapper methods as ok to profile, while mono_profiler_coverage_alloc was refusing to allocate the necessary structure, leading to crashes.
2019-10-18 16:31:47 +02:00
Jay Krell 958b9b2658 [interp][wasm] Remove more varargs to conserve stack. (#17388) 2019-10-18 10:39:05 +03:00
Egor Bogatov 4908d1f19a Enable GSS on Linux and Android (#17223) 2019-10-17 19:01:44 -04:00
Alexander Köplinger e5721bbb23 [corlib] Mark YieldAwaitable struct readonly (#17386)
* [corlib] Mark YieldAwaitable struct readonly

Make it consistent with .NET Standard/Core which makes future API Compat runs report one less difference.

* Bump API snapshot submodule
2019-10-17 16:01:22 +02:00
Vlad Brezae ec653e70bf [interp] Constant folding for integers (#17362)
* [interp] Move instructions together

For easy check if an instruction is unary or binary operation. We consider conversion instructions to be unary operators and compare instructions to be binary operators.

* [interp] Add stloc.np also for longs

* [interp] Add stats for total number of emitted instructions

Also make the killed_instructions counter actually track the total amount of killed instructions. It was not previously tracking instructions killed as part of addition of stloc.np / movloc.

* [interp] Improve logging during cprop

Make dumping instruction support also InterpInst's not just compacted instructions.

* [interp] Constant folding of common unary operators

* [interp] Constant fold binary operations

* [interp] Remove MINT_CONV_U8_I4 opcode

It is equivalent with MINT_CONV_I8_U4.
2019-10-17 14:23:12 +03:00
Jay Krell e8b6fcc945 [cxx] Int vs. enum, static for efficiency, cleanup, fix typo. (#17377)
[cxx] Int vs. enum, static for efficiency, cleanup, fix typo.
2019-10-17 12:25:18 +02:00
Jay Krell e97e1f994d [cxx][x86] int/ptr casts. (#17345) 2019-10-17 12:24:46 +02:00
Vlad Brezae ae0fbd366e [interp] Always intrinsify MemoryBarrier method
As we do it on jit.
2019-10-17 12:53:19 +03:00
Vlad Brezae 0102263645 [interp] Avoid using full barriers for volatile operations
This commit avoid unnecessary memory barriers on x86 and amd64.

Volatile writes have release semantics, volatile reads have acquire semantics. Organize the code a little bit to indicate this. On x86 and amd64 we don't require barrier for acquire and release semantics since they are provided by the arch, so we can skip them. Ideally we should have 3 memory barrier interp instructions for each type, but, currently, they would all seem to call mono_memory_barrier so it is useless at this point.
2019-10-17 12:53:19 +03:00
Johan Lorensson 4f8a82c9fd Upgrade build scripts to support VS2019. (#17269)
Changes will default Windows SDK version as well as Platform Toolset to
the default versions used in the targeted VS version. If the projects are
opened up in VS2015, it should default to Windows SDK 8.1 and v140, but if
the same projects are opened in VS2019, it will default to latest Windows SDK 10
and v142. This way the project files should adapt to used VS version, meaning
that we could still build them using VS2015 (what's currently used on CI) but also
using VS2017 and VS2019. There should not be a need to install any previous versions
of build tools, unless an older version is targeted. It is also possible to set
PlatformToolset when calling msbuild and that should adapt to corresponding default
Windows SDK version for targeted toolset version.

Commit makes many changes and adjustments, aligning all vcxproj files but changes
should not affect build output.
2019-10-17 08:55:50 +02:00
Jay Krell edafa021d3 Use functions instead of macros for is_in/is_out. (#17350)
Use functions instead of macros for is_in/is_out.
2019-10-17 06:46:03 +02:00
Aleksey Kliger (λgeek) b6388e271f [bcl] Remove CompareExchange_T (#17370)
In https://github.com/mono/mono/pull/17341 we change the caller of
CompareExchange_T<T>(ref T, ...) to call CompareExchange (ref object, ...), but
didn't delete the declaration.

It's already deleted in unmanaged and in the netcore version of this file.
2019-10-16 21:11:36 -04:00
Maxim Lipnin 02bc95a51a [wasm][xunit tests] Disable System.IO.Compression.Tests.BrotliEncoderTests (#17351)
Fixes https://github.com/mono/mono/issues/17053
2019-10-16 18:47:16 -04:00
dotnet-maestro[bot] 1dbad7cd88 [master] Update dependencies from dotnet/core-setup dotnet/corefx (#17355)
* Update dependencies from https://github.com/dotnet/core-setup build 20191015.17

- Microsoft.NETCore.App - 5.0.0-alpha1.19515.17

* Update dependencies from https://github.com/dotnet/corefx build 20191015.14

- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19515.14

* Reenable a test that was fixed
2019-10-16 23:12:15 +02:00
Jay Krell c0d50719ea [cxx][x86][amd64] Remove unused STORE_MEM_IMM. (#17347)
[cxx][x86][amd64] Remove unused STORE_MEM_IMM.

And there was an int/ptr cast error within.
2019-10-16 22:26:02 +02:00
Thays Grazia 3f9d501a78 Removing execution of network tests from WatchOs. (#17358) 2019-10-16 17:10:27 -03:00
Aleksey Kliger (λgeek) f017835ac1 [bcl][jit] implement Interlocked.Exchange<T> in terms of object (#17341)
* [bcl][jit] implement Interlocked.Exchange<T> in terms of object

Exchange<T> is supposed to be picked up as an intrinsic.  But if it isn't,
since T has a class constraint, call the `Exchange (ref object, ref object, ref
object)` overload instead.

This works around a limitation in the JIT:
https://github.com/mono/mono/blob/82a07273c22b996b08fa88ee2e6632d782ac2242/mono/mini/mini-trampolines.c#L704-L713

if we're in the common call trampoline, and the caller is generic method and
the callee is a generic method, if we're using generic sharing for the caller,
but there's no generic jit info for the callee, we will not patch the call
site.

In this case we had Exchange<T> calling Exchange_T<T>
where the callee is an icall (and evidently didn't have generic jit info).

So every time we called Exchange<T>, we would go through the trampoline when
trying to call Exchange_T<T> without patching the call site.

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

* Bump Mono

* Also drop CompareExchange_T<T>

* Sprinkle some Unsafe magic.

Mark the non-icall methods that we expect the JIT to treet as intrinsics with [Intrinsic]

* aot-runtime doesn't need Volatile.Read<T>/Write<T> code

Both of those methods are implemented as calls to the object overload of Volatile.Read/Write
2019-10-16 15:35:49 -04:00
Egor Bogatov 58b53299b7 remove GenericVectorTests from rsp (#17366) 2019-10-16 15:24:16 -04:00
Jay Krell de9ccfa63f [cxx][netcore] Goto around init. (#17348)
[cxx][netcore] Goto around init.
2019-10-16 20:56:09 +02:00
Jay Krell 7067524141 [cxx][x86] ifndef DISABLE_JIT around mono_arch_emit_prolog. (#17346) 2019-10-16 20:28:24 +02:00
Egor Bogatov c13f36bdfe fix netcore build with cygwin (#17361) 2019-10-16 14:20:48 -04:00
Egor Bogatov 886cd73784 [netcore] Implement System.IO.HasOverriddenBeginEndRead(Write)… (#17237)
* Implement HasOverriddenBeginEndRead and HasOverriddenBeginEndWrite

* fix typo

* clean up

* more clean up

* more clean up

* convert into intrinsics

* handle end* methods

* Update intrinsics.c

* make cache_System_IO_Stream_slots static

* fix race condition

* Rollback to icall

* Update icall.c

* Address feedback

* Address feedback
2019-10-16 20:16:51 +02:00
Marek Safar be6f43c80e [System] Add reflection dependency tracking
for built-in type converters
2019-10-16 20:05:03 +02:00
Alexander Köplinger cd6e574b87 [ci] Improve netcore build telemetry by running nupkg and tests through build.sh (#17349)
Follow-up to https://github.com/mono/mono/pull/17331.

We were running nuget pack and tests explicitly in the Azure Pipelines
config so we weren't capturing failure telemetry.
2019-10-16 18:52:13 +02:00
Cody Russell 37dc33a257 [GTK] Bump bockbuild for GtkViewport autoscrolling patch. (#17321) 2019-10-16 16:44:26 +02:00
Jay Krell a03027cab0 Replace mono_assembly_name_free use with mono_assembly_name_free_internal. (#16982)
Replace mono_assembly_name_free use with mono_assembly_name_free_internal.

Maybe just remove the GC mode change and remove the internal form.
We don't really equate malloc/free with GC/locks/hangs, though arguably we should. Arguably this change is right.
2019-10-16 14:25:55 +02:00
Vlad Brezae 0aabccef9b [interp] Add constant propagation of integers (#17326)
* [interp] Make StackValue more intuitive

Replace the opcode field with an enum which will represent what type of value is contained (STACK_VALUE_LOCAL, STACK_VALUE_I4 etc)

* [interp] Add the mint type to the local data

Makes the emitting code easier and we no longer compute the mint type for each local access, which is fairly expensive.

* [interp] Handle indirect locals saner during cprop

Instead of checking for the indirect flag when loading from a local, simply never store a StackValue into such a local since we can't use it. We use the same logic when not pushing on the stack values for such locals.

* [interp] Add constant folding for integers

We decode the values from LDC_I4 and LDC_I8 opcodes and track/propagate the values on the stack and in the locals using the existing infrastructure. When loading a local, we try to load using the known constant value instead, so we might get to kill that local.

* [interp] Similar to stloc.np we can optimize pop/push pairs

If the pushing instruction pushes the same value that was popped by the previous instruction, we can kill them both

* [tests] Remove issue that seems to have been fixed for a while
2019-10-16 13:56:14 +03:00
Jay Krell 7d3fc17e81 Fix C++ WebAssembly build. (#17302) 2019-10-16 10:12:41 +02:00
Filip Navara 0c02bb1207 Fix SafeHandle marshalling in ref/in/out parameters (#17330)
* Fix SafeHandle marshalling in ref/in/out parameters

* Reorder code to make it exception safe, update comments

* Revert the code reordering because it breaks the invariant that new handle returned from native code should always create new SafeHandle on the managed side

* Fix test_0_safehandle_ref test. The test was expecting incorrect behavior, verified on .NET Core 3 and .NET Framework 4.8.

* Address PR feedback

* Fix cut & paste error

* Fix build

* Really fix the test_0_safehandle_ref tests

* Add more tests for SafeHandle marshalling

* Add exclusion for broken CoreFX test
2019-10-16 01:43:42 -04:00
Zoltan Varga d4d93b9699 [wasm] Add a --native-lib option to the packager to allow linking additional native libraries. (#17344) 2019-10-16 01:31:03 -04:00
Kenneth Pouncey 2b4790a1f3 [wasm][tests] WASM Safari browser tests (#16816)
* Add support for tests via safari browser

* Run safari browser tests on CI for Mac lanes

* Update to fix syntax error using UNAME to `if [[ ${CI_TAGS} == *'osx-amd64'* ]];`

* Fix syntax error with `if`
2019-10-16 04:59:55 +02:00
Kenneth Pouncey 2ddcf8cf16 Set default StreamingEnabled property of the WasmHttpMessageHandler to be false. (#17328) 2019-10-16 04:39:06 +02:00
Zoltan Varga 27247739c6 [wasm] Bump emscripten. Remove generated python cache files. (#17340)
* [wasm] Bump emscripten to 1.38.48.

* Remove generated python cache files.
2019-10-15 21:57:52 -04:00
Zoltan Varga 08e8a7f2c3 [jit] Fix is_reference checks for intrinsics with byref parameters. (#17338)
Found by https://github.com/mono/mono/issues/17335.
2019-10-15 21:45:04 -04:00
Ryan Lucia 3fa5f6c66e [loader] Add an explicit define DISABLE_DLLMAP to control dllmap usage (#17315)
* [loader] Add an explicit define ENABLE_DLLMAP to control dllmap usage

* Update configure.ac

* Update configure.ac

* Add dllmap to enable-minimal

* Change to DISABLE_DLLMAP

* Grab some missing MonoDllMap uses
2019-10-15 19:40:24 -04:00
Bernhard Urban-Forster 73ae9dbc36 [bcl] add WriteLine(string) override to CStreamWriter needed due to corefx import (#17336)
In https://github.com/mono/mono/commit/fd424c5dd07b2dbbd4aafbf9165a42166d789438 we switched over to the `TextWriter.cs`/`StreamWriter.cs` implementation of corefx. One subtle difference is that an override for `WriteLine(string)` in `StreamWriter` was introduced:
https://github.com/mono/corefx/blob/8e3b279377d1f01d2d089f24548e33855bf6502e/src/Common/src/CoreLib/System/IO/StreamWriter.cs#L526-L531
Previously the definition in `TextWriter` was used, which would call the base case `Write(char[],int,int)`.  The new override however won't call the base implementation at all, but directly uses the `Span`-variant.

This is a problem for our `CStreamWriter` implementation, since `WriteLine(string)` won't end up in the special handling for `Write(char[],int,int)`, which accounts for terminal cursor changes.

This is the real fix for https://github.com/mono/mono/issues/16701

This also reverts commit 68f5613422. ("[TermInfoDriver] update top/left value on Console.{CursorTop,CursorLeft} access (#16745)")
While it kind of masked the issue, it also posed a performance issue on some terminals (e.g. GNOME Terminal).
2019-10-15 22:29:41 +02:00
Jo Shields dc0eea6fd1 Initial telemetry for netcore builds (#17331)
* Load VSTS telemetry helpers into build.sh script

* First cut adding some basic VSTS-compatible telemetry on failures

* Don't make `ci=true` the default, make it a build.sh flag
2019-10-15 22:21:21 +02:00
Alexander Köplinger 82a07273c2 [ci] Always initialize an AzDO variable
Otherwise the script will not replace the variable and we get confusing error messages like this:

```
[command]/bin/bash --noprofile --norc /home/builder/azdo/_work/_temp/ba0890e7-8c80-4245-b9dc-14253b0d399f.sh
/home/builder/azdo/_work/_temp/ba0890e7-8c80-4245-b9dc-14253b0d399f.sh: line 2: llvm: command not found
/home/builder/azdo/_work/_temp/ba0890e7-8c80-4245-b9dc-14253b0d399f.sh: line 2: [: =: unary operator expected
```
2019-10-15 19:44:03 +02:00
Alexander Köplinger 3b56247afd [ci] Only install android-specific brew packages when building for android 2019-10-15 13:59:34 +02:00
Steve Pfister 806f75fe4f Bumps corefx to mono/corefx@8e3b279 (#17307)
Resolves https://github.com/mono/mono/issues/17288 where RequestUri
in HttpRequestMessage did not allow file:// based Uri's the same
way its constructor did.
2019-10-15 11:06:24 +02:00
Ryan Lucia a2ef1274c3 Update codeowners
Get notifications for various files in metadata
2019-10-15 10:28:31 +02:00
dotnet-maestro[bot] 55e87320f0 Update dependencies from https://github.com/dotnet/corefx build 20191013.1
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19513.1
2019-10-15 09:50:26 +02:00
dotnet-maestro[bot] 61db5aafdd Update dependencies from https://github.com/dotnet/core-setup build 20191014.1
- Microsoft.NETCore.App - 5.0.0-alpha1.19514.1
2019-10-15 09:50:26 +02:00
dotnet-maestro[bot] 140750f543 Update dependencies from https://github.com/dotnet/arcade build 20191011.1
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19511.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19511.1
2019-10-15 09:50:26 +02:00
dotnet-maestro[bot] 5a6fb5abe7 Update dependencies from https://github.com/dotnet/corefx build 20191008.3
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19508.3
2019-10-15 09:50:26 +02:00
dotnet-maestro[bot] f068c89ca2 Update dependencies from https://github.com/dotnet/core-setup build 20191008.2
- Microsoft.NETCore.App - 5.0.0-alpha1.19508.2
2019-10-15 09:50:26 +02:00
Filip Navara ac1d05ad40 Update CoreFX.issues.rsp
See https://github.com/mono/mono/pull/17232#issuecomment-541973035.
2019-10-14 19:46:39 -05:00
Filip Navara a194de4cdf [netcore] Avoid suspending threads in Environment.Exit, it can hang process (#17318)
CoreCLR doesn't suspend threads on exit (https://github.com/dotnet/corefx/pull/41450#issuecomment-536755093, https://github.com/dotnet/coreclr/pull/1813).

Fixes #17317 
Fixes #15006
Fixes #15010
Fixes #15181

Unblocks #17232
2019-10-15 00:35:26 +02:00
Alexander Köplinger 1a21ad7dd0 [ci] Restore previous values for no Xcode in CI_TAGS
It is still used by the non-pipeline PR builds (we should unify this at some point).
2019-10-14 20:38:46 +02:00
Filip Navara 76068d8d61 Remove broken sin/cos optimization for x86 2019-10-14 12:21:15 -05:00
Filip Navara 05df3970c2 Remove broken sin/cos optimization for x64 2019-10-14 12:21:15 -05:00
Kenneth Pouncey 44e99c5eec [wasm] Continue loading app even when .pdb files are not found (#17266)
* This adds the ability to continue loading the application even though the .pdb files are not found.

When uploading an app built with mono-wasm the `.pdb` may not get committed so they will not exist when trying to load them.

- Add new boolean variable to MONO library support to control skipping these files on errors.
	- `mono_wasm_ignore_pdb_load_errors` default is true

- Modify the assembly file fetching routine `mono_load_runtime_and_bcl` within our MONO module.
	- Allows skipping the .pdb files if the `mono_wasm_ignore_pdb_load_errors` flag is true.
2019-10-14 12:10:43 -05:00
Fan Yang dcb522d181 [netcore] Update dotnet sdk version (#17312)
The previous one was broken.
2019-10-14 18:55:39 +02:00
Johan Lorensson 734b776884 Fix msvc build warning, empty source main-core.c. (#17305) 2019-10-14 18:55:07 +02:00
Alexander Köplinger 7de84059b9 [ci] Fix ios versions in Mono SDKs and fix typo 2019-10-14 18:54:25 +02:00
Ryan Lucia e7b199377c [loader] Locking and coop related cleanup; fix leak 2019-10-14 12:51:29 -04:00
Ryan Lucia bf3afd6cad [loader] Move PInvoke and DllMap code into separate source file 2019-10-14 12:51:29 -04:00
Ryan Lucia 80db55591a [netcore] Remove unused InternalLoadUnmanagedDllFromPath
As of https://github.com/dotnet/coreclr/pull/27090
2019-10-14 12:51:29 -04:00
Ryan Lucia 96050effa6 [netcore] Use a single NativeLibrary.cs for all platforms 2019-10-14 12:51:29 -04:00
Alexander Köplinger 850def2f3b [ci] Use Xcode11.1 for XI/XM Mono SDK builds (#17313)
As requested by the xamarin-macios team.
2019-10-14 18:38:06 +02:00
Marek Safar cae52aa4a6 [System.Net.Http] Clean up HttpMessageHandler setup (#17252)
* [System.Net.Http] Clean up HttpMessageHandler setup

to avoid reflection and not to be recursive

Superseded #15051 and #15922

* [csproj] Update project files
2019-10-14 17:19:22 +02:00
Dotnet-GitSync-Bot 4e81814709 Mirror changes from mono/coreclr (#17297)
* Enable fast-paths on Mono for Array (dotnet/coreclr#27144)

Signed-off-by: dotnet-bot <[email protected]>

* [CoreLib] Remove String fields moved to shared

* Stub Array Try* methods
2019-10-12 08:50:00 +02:00
Ryan Lucia 9832bbb0ac [loader] Fix gnu/lib-names.h define (#17294) 2019-10-11 20:49:24 -04:00
Jay Krell 33d62537d4 [runtime] Add portable cached array creation functions and replace gcc-specific impl. (#16855)
* Remove unused mono_class_get_field_from_name_cached.

* Replace gcc-specific:
  mono_array_class_get_cached
  mono_array_new_cached
  mono_array_new_cached_handle

with portable forms that are easy enough to use and general enough.

Before was "easier" because cache provided for you -- possibly multiple.
Before was more general because rank was a parameter -- and had to be a constant.
It was always 1.
2019-10-11 19:47:20 -04:00
Egor Bogatov 9cc5ea3862 Enable more hw intrinsics for AOT (#17160)
* Enable more hw intrinsics for AOT

* Address feedback

* does it fix the failure?

* fix loadedllvm

* Address feedback

* fix copy-paste

* forgot MONO_LLVM_INTERNAL
2019-10-11 15:09:08 -04:00
Aleksey Kliger (λgeek) 7f95f57c43 [sdks] Android runner: properly shutdown runtime for Mono.Debugger.Soft test app (#17261)
* [sdks] properly shutdown runtime for Mono.Debugger.Soft test app

mini_jit_cleanup will cause mono_runtime_try_shutdown to be called before
mono_runtime_quit which will set the shutting down flags in the runtime.

* [test] Re-enable disabled tests
2019-10-11 13:54:19 -04:00
Kyle White 481b3005c6 Update MERP event type to MonoAppCrash (#17131)
* Update parameters in MERP WerReportMetadata xml

To enable backend analysis, we need to update our parameters to match our back end event type, which is MonoAppCrash.

It doesn't make sense to me that the previous implementation constructed the XML here in Mono, but depended on the user (VSMac in this case) to add the "correct" event type.  The parameters in the XML, must match exactly what is expected for the given EventType, and so we should ensure they are always in-sync by defining them here.  Thus, I removed the usage of `eventType` in `mono_merp_enable` and hard coded the expected eventType.

* [merp] Don't pass eventType from managed

The eventType must me MONO_MERP_EVENT_TYPE_STR ("MonoAppCrash") - the backend
determines the format of the other fields based on the event type, so it
doesn't make sense to pass other values from managed since the runtime controls
the other fields.

For compatability Mono.Runtime.EnableMicrosoftTelemetry will still take a
string parameter (now called "unused" instead of "eventType_str") but it will
not pass it down to the internal call.

* Bump corlib version

* [merp] Revert paramerters in WerReportMetadata.xml

Still need event type to be `MonoAppCrash` but the parameters will be the same as before.
2019-10-11 11:15:21 -04:00
Alexander Köplinger d457346e06 [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
2019-10-11 09:34:28 +02:00
Tanner Gooding 5784d064e7 Refactoring the ARM intrinsics to match API review and share code with x86 (#25508)
* Rewriting the ARM64 HWIntrinsic JIT infrastructure to share with and mirror the x86 infrastructure where possible.

* Lowercasing the hwintrinsicarm64 and hwintrinsiclistarm64 files.

* Applying formatting patch.

* Fixing up some names in the PAL and VM that were missed.

* Adding support for AdvSimd.Add

* Ensure impSpecialIntrinsic returns nullptr for unsupported base types.

* Rewording various method headers and simplifying some code.

* Fixing getEmitter to GetEmitter

* Adding support for the ld1 instruction

* Applying formatting patch

* Clarifying a todo comment and removing a stray newline

* Fixing the Arm64 impSpecialIntrinsic to not assert for helper intrinsics

* Fixing some intrinsic signatures that were incorrect

* Adding the initial template files for generating Arm HWIntrinsic tests

* Generating the initial batch of Arm HWIntrinsic tests

* Replace gtRegNum with GetRegNum()

* Fixing the test template alignment checks for Arm

* Regenerating the Arm HWIntrinsic tests

* Fixing the namespace checked for Arm intrinsics

* Changing Base to ArmBase and fixing some Arm hwintrinsic metadata

* Fixing the arm emitter and lowering to not assert for hwintrinsics

* Fixing the arm intrinsics to not set the number of vector elements for SIMDScalar intrinsics

* Updating the AdvSimd.Abs tests to use negative input values

* Regenerating the arm hwintrinsic tests

* Fixing the arm hwintrinsic codegen to use the element size for simd scalar operations.

* Fixing the arm scalar intrinsic tests to check for 0 on upper bits

* Regenerating the ARM intrinsic tests

* Fixing AdvSimd.AbsScalar and AdvSimd.AddScalar to be recursive

* Marking AdvSimd.Arm64 and ArmBase.Arm64 as implemented

* Ensure that AdvSimd.Arm64.Abs is marked as variable size

Signed-off-by: dotnet-bot <[email protected]>
2019-10-11 08:14:11 +02:00
Imran Hameed 7c7d406fc0 Generate LLVM IR for OP_XEQUAL that is recognized by LLVM's vector pattern recognizers. 2019-10-10 16:05:34 -07:00
Jo Shields 5567c83049 Update Linker. This fixes a Xamarin.Android breakage (#17272) 2019-10-10 16:26:10 -04:00
Vlad Brezae 165c114aaa [interp] Kill more instructions (#17226)
* [interp] Replace STLOC to dead local with MINT_POP

* [interp] Optimize MINT_POP

It was only used for 0 and 1 values. The implementation for values larger than 1 was broken anyway.

* [interp] Remove unnecessary usage of MINT_POP1

When storing a static field from a CEE_STFLD instruction.

* [interp] Prevent optimizing away the stack, after a branch

We know the contents of the stack following a branch, so we could have optimized away some instructions preceding the branch. We shouldn't do this because the code we are branching to expects a certain stack size.

* [interp] Clear instructions which push unused values on stack

* [interp] Properly initialize stack when pushing local
2019-10-10 21:29:19 +02:00
monojenkins 3ef0544e7a [csproj] Update project files 2019-10-10 19:43:11 +02:00
Marek Safar 502115435d [System.Net.Http] Make HttpClientHandler on WatchOS always fallback
to platform handler. This simplifies HttpClientHandler in shared libraries
and the "default" socket handler would always throw PNSE anyway
2019-10-10 19:43:11 +02:00
Ryan Lucia 1b6bbfaf36 [eglib] Add newline for failure check prints (#17262) 2019-10-10 09:23:16 -04:00
Johan Lorensson 0db52289a3 Incorrect constrained virtual call in method using gsharedvt for reference type. (#17227)
* Incorrect constrained virtual call in method using gsharedvt for reference type.

For generic constrained virtual calls using reference type's, the
virtual call will be dispatched using instance vtable. When the same
virtual call is taking place in a gsharedvt method, mono_gsharedvt_constrained_call
gets called that will assist making the call, the problem is that it will
use the constrained class for reference types meaning that it will not call
the most derived implementation of the method. This difference in the behavior
compared to none gsharedvt versions of methods, gives inconsistent results.

One way this will reproduce is by using Dictionary<Type, EmptyStruct>. For
methods that will take both Type (reference type) and EmptyStruct (value type)
like Add, calling that through IDictionary (hiding details from compiler) will
use the gsharedvt version of the method. Internally that method will call
Type.GetHashCode (), and since Type really is a RuntimeType it overrides
GetHashCode. But since mono_gsharedvt_constrained_call will use the constrained
class instead of the instance class, the called method will be
Object.GetHashCode, that gives a different result. When later ContainsKey
is called using the same Type, it only takes a reference value, so not
using a gsharedvt version of the method, then the most derived version of
GetHashCode will be called, given a different hash, not finding item
in dictionary.

Fix is to make sure behavior in mono_gsharedvt_constrained_call match
behavior for regular constrained virtual calls when having a reference type.
This makes sure we always call the most derived version of the method.

Commit also adds a test for this specific scenario using a dictionary.

* Updated to a more low-level test.
2019-10-10 09:22:54 -04:00
Bernhard Urban-Forster 6ebf07f2cd [mini] trace snippet should restore return value (#17251)
* [mini] trace snippet should restore return value

This is a problem on architectures with a floating point stack (x86).

Without this PR and without `--trace` the managed-to-native wrapper for `Math.Ceiling` has a basic block like this at the end:

```
AFTER LOWER-VTYPE-OPTS  4: [IN:  BB6(5) BB3(1), OUT:  BB1(3) ]
 fmove R34 <- R16
 ldaddr R35 <- R10
 load_membase R37 <- [R35 + 0x0]
 store_membase_reg [R36] <- R37
 il_seq_point il: 0x2d
```

`R16` contains the return value. `ldaddr`/`load_membase`/`store_membase_reg` is the sequence for LMF popping.  `mono_spill_global_vars` does this with it:

```
 SPILL BLOCK 4:
 fmove R34 <- R16
         ff  34 16
        0  loadr8_membase R34 <- [%ebp + 0xffffffd4]
        1  nop
 ldaddr R35 <- R10
         ii  35 5
        1  add_imm R35 <- %ebp [-36] clobbers: 1
 load_membase R37 <- [R35 + 0x0]
         ii  37 35
        1  load_membase R37 <- [R35 + 0x0]
 store_membase_reg [R36] <- R37
          ii -1 37
        1  store_membase_reg [%edi] <- R37
 il_seq_point il: 0x2d
             -1
        1  il_seq_point il: 0x2d
```

The local register allocator takes care of the FP stack handling:

```
processing:     0  loadr8_membase %fr0 <- [%ebp + 0xffffffd4]
        [%fr0]
processing:     0  load_membase %eax <- [%ebp + 0xffffffdc]
        [%fr0]
processing:     0  store_membase_reg [%edi] <- %eax
        [%fr0]
processing:     0  il_seq_point il: 0x2d
        [%fr0]
```

At the end of the basic block we have one value left on the FP stack. That's good as we are in the `cfg->bb_exit` basic block, so this is ought to be the return value.

Let's enable `--trace=M:System.Math:Ceiling`. It will insert some code in order to copy arguments/return value to some datastructure that can then be printed by the trace code:

```
processing:     0  loadr8_membase %fr0 <- [%ebp + 0xffffffd4]
        [%fr0]
processing:     0  iconst %eax <- [11116832]
        [%fr0]
processing:     0  iconst %eax <- [52]
        [%fr0]
processing:     0  localloc_imm %eax <-
        [%fr0]
processing:     0  localloc_imm %ecx <-
        [%fr0]
processing:     0  store_membase_reg [%eax + 0x30] <- %ecx
        [%fr0]
processing:     0  x86_lea_membase %edx <- %ebp
        [%fr0]
processing:     0  store_membase_reg [%ecx] <- %edx
        [%fr0]
processing:     0  store_membase_imm [%eax + 0x28] <- [11116832]
        [%fr0]
processing:     0  storer8_membase_reg [%ebp + 0xffffffcc] <- %fr0
        []
processing:     0  x86_lea_membase %ecx <- %ebp
        []
processing:     0  store_membase_reg [%eax + 0x2c] <- %ecx
        []
processing:     0  store_membase_reg [%esp + 0x4] <- %eax
        []
processing:     0  store_membase_imm [%esp] <- [11116832]
        []
processing:     0  voidcall [mono_trace_leave_method] clobbers: c
        []
processing:     0  x86_lea_membase %eax <- %ebp
        []
processing:     0  load_membase %eax <- [%ebp + 0xffffffdc]
        []
processing:     0  store_membase_reg [%edi] <- %eax
        []
processing:     0  il_seq_point il: 0x2d
        []
```

At the very beginning we push some value on the FP stack, same as before. However the code inserted by the tracing code will pop that value. Now, when returning to the, it will pop again something from the FP stack, but alas it's gonna be garbage.

With this PR it looks like this:

```
processing:     0  loadr8_membase %fr0 <- [%ebp + 0xffffffd4]
        [%fr0]
processing:     0  iconst %eax <- [11116832]
        [%fr0]
processing:     0  iconst %eax <- [52]
        [%fr0]
processing:     0  localloc_imm %eax <-
        [%fr0]
processing:     0  localloc_imm %ecx <-
        [%fr0]
processing:     0  store_membase_reg [%eax + 0x30] <- %ecx
        [%fr0]
processing:     0  x86_lea_membase %edx <- %ebp
        [%fr0]
processing:     0  store_membase_reg [%ecx] <- %edx
        [%fr0]
processing:     0  store_membase_imm [%eax + 0x28] <- [11116832]
        [%fr0]
processing:     0  storer8_membase_reg [%ebp + 0xffffffcc] <- %fr0
        []
processing:     0  x86_lea_membase %ecx <- %ebp
        []
processing:     0  store_membase_reg [%eax + 0x2c] <- %ecx
        []
processing:     0  loadr8_membase %fr0 <- [%ebp + 0xffffffcc]
        [%fr0]
processing:     0  store_membase_reg [%esp + 0x4] <- %eax
        [%fr0]
processing:     0  store_membase_imm [%esp] <- [11116832]
        [%fr0]
processing:     0  voidcall [mono_trace_leave_method] clobbers: c
        [%fr0]
processing:     0  x86_lea_membase %eax <- %ebp
        [%fr0]
processing:     0  load_membase %eax <- [%ebp + 0xffffffdc]
        [%fr0]
processing:     0  store_membase_reg [%edi] <- %eax
        [%fr0]
processing:     0  il_seq_point il: 0x2d
        [%fr0]
```

Leaving us the return value on the FP stack before returning.

Fixes https://github.com/mono/mono/issues/16410
2019-10-10 11:21:23 +02:00
Jay Krell 8c5581a6f2 Fix g_assert_not_reached message regression. (#17263)
Fix g_assert_not_reached message regression.
2019-10-10 10:26:14 +02:00
Vlad Brezae d4fbbed106 [tests] Disable tests that crash on android sdks (#17255)
Running these tests makes the application crash, probably at shutdown. Even if the tests are reported as passing, check if disabling them fixes the suite timeout on android osx sdks.
2019-10-10 10:51:53 +03:00
Jay Krell 8718b75b7a Remove varargs from g_assert and g_assert_not_reachable. (#17254)
Remove varargs from g_assert and g_assert_not_reachable (save 200+ bytes per frame in wasm interp).

g_assertf unchanged.

I have a strong suspicion, this will save approximately 432 - sizeof (InterpFrame) bytes of stack
per function call in the WebAssembly interpreter.

It will not significantly benefit or hurt any other system.
Systems with disabled asserts will receive a small size improvement.

WebAssembly has no provision for varargs.
Emscripten emulates it.
It appears the emulation allocates room in the frame per outgoing varargs call.
No stack packing.
So each g_assert takes space.

Alternative would be to discourage or disable or remove asserts.
2019-10-09 22:56:06 +02:00
David Bueno 7df7ceb6d3 [System.Web] Now IsExpired property for FormsAuthenticationTicket compares two dates with same kind (UTC) to avoid unexpected results (#17162)
Fixes #17161
2019-10-09 20:50:46 +02:00
Steffen Kieß 30886f997f [Mono.Posix] Add support for memfd_create() and file sealing (#17225)
* [Mono.Posix] Add support for memfd_create() and file sealing

Add the linux syscall memfd_create() and add support for file sealing with
fcntl().

* Bump API snapshot submodule
2019-10-09 20:49:14 +02:00
Bernhard Urban-Forster 1cf081529e [mini] print inserted instruction in verbose logging (#17249)
[mini] print inserted instruction in verbose logging

before:
```
 fmove R11 <- R9
         ff  11 9
        1  nop
```

after:
```
 fmove R11 <- R9
         ff  11 9
        0  loadr8_membase R11 <- [%ebp + 0x8]
        1  nop
```
2019-10-09 20:16:04 +02:00
Filip Navara cbc8cc658b [mini] Fix check for FastAllocateString that used old name (#17219)
* Fix check for FastAllocateString that used old name

* Fix linker scripts

* Update the icall name for FastAllocateString to match managed name

* Update size check in managed allocator

* One more 64-bit target fix
2019-10-09 15:47:43 +02:00
Vlad Brezae 8e649c3545 [sgen] Fix invalid value passed to write barrier (#17236)
When doing memory copy dest is the destination address and src is the source address. If we are copying a single reference, we need to emit a write barrier and pass to the write barrier the value, not the pointer where the value is stored.
2019-10-09 14:37:41 +03:00
Alexander Köplinger 1e9ba3a026 Add drawing type converters to mobile profiles (#17238)
* 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:17:53 +02:00
Johan Lorensson 7fad4a12e2 Running --enable-msvc-only didn't find jay.vcxproj. (#17228) 2019-10-09 10:06:09 +02:00
Egor Bogatov 12ff246297 Optimize ToString() for byte, ushort, uint and ulong (dotnet/coreclr#27056)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-09 09:25:18 +02:00
Filip Navara 28b3446d9e [netcore] Fix NULL dereference when running LLVM JIT 2019-10-09 08:39:22 +02:00
Ryan Lucia 1cfb39203b Replace InternalLoadUnmanagedDllFromPath with NativeLibrary.Load (#27090)
Both just call into NDirect::LoadLibraryFromPath, and so this simplifies the code by removing a superfluous QCall

Signed-off-by: dotnet-bot <[email protected]>
2019-10-09 08:23:30 +02:00
Jay Krell cacf99b973 Revert mono_runtime_set_main_args in 44ff0597b8. (#17233)
It breaks Xamarin.Android.
2019-10-09 00:54:44 -04:00
Vlad Brezae 579e385b96 [interp] Small cleanups (#17229)
* [intepr] Add define for constant

* [interp] Pass separately pop_vt_sp argument

Cleans up the code a bit. There is no need to do fancy bit operations for such a slow opcode.
2019-10-09 00:08:44 +02:00
Filip Navara 63025d93fd [netcore] Port CoreCLR implementation of Exception.SetCurrentStackTrace (#17243)
* Port CoreCLR implementation of Exception.SetCurrentStackTrace

* Update SerializationRemoteStackTraceString

* Update Exception.cs
2019-10-08 23:45:17 +02:00
Alexander Köplinger 4ca42a933f [man] Update MONO_IOMAP docs as it no longer works with corefx System.IO (#17231)
Fixes https://github.com/mono/mono/issues/15845
2019-10-08 21:39:31 +02:00
Alexander Köplinger 209c4bae3e [netcore] Disable some SafeWaitHandle tests everywhere, not just Linux (#17230)
The tests are kinda bogus since they create a SafeWaitHandle from `new IntPtr(1)` which causes a crash during finalization when releasing that handle.

See https://github.com/mono/mono/issues/17224
2019-10-08 17:39:41 +02:00
dotnet-maestro[bot] 52c4d87633 Update dependencies from https://github.com/dotnet/arcade build 20191006.1 (#17214)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19506.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19506.1
2019-10-08 13:30:46 +02:00
Filip Navara e8ed2494ca Fix check in fix_libc_name to trigger only for libc, not or other names with same prefix (#17222)
See https://github.com/mono/mono/pull/17210#pullrequestreview-298663220
2019-10-08 13:06:38 +02:00
Alexander Köplinger faf100da27 [support] Make sure map-impl.h ends up in the tarball 2019-10-08 12:05:47 +02:00
Steffen Kieß 8bb7b8645a Clean up map.c /map.h (#16746)
* [Mono.Posix] Move Mono_Posix_{From,To}MremapFlags() to support/sys-mman.c

Since b522eab5ff Mono_Posix_FromMremapFlags()
and Mono_Posix_ToMremapFlags() contain manual changes for NetBSD. Move the
functions from support/map.c to support/sys-mman.c so that they won't be
overwritten when create-native-map is rerun.

* [Mono.Posix] Fix prototypes in support/stdio.c

In ed892ccf27 wrapper functions for several
stdio functions were added, but the prototypes in map.h were manually
written, not using create-native-map. This commit changes the prototypes so
that they match the output of create-native-map.

* [Mono.Posix] Undefine HAVE_STRUCT_SOCKADDR_IN6 in support/map.c on MSVC

In 22b6b95814 a manual change to support/map.c
was added to prevent Mono_Posix_FromSockaddrIn6() and
Mono_Posix_ToSockaddrIn6() from being built for windows even if
HAVE_STRUCT_SOCKADDR_IN6 is defined. Instead undefine it in a header file
to avoid manual changes to map.c.

With this commit map.c, map.h and NativeConvert.generated.cs contain no
manual changes anymore.
2019-10-08 12:04:45 +02:00
monojenkins ad2132e611 [bcl] Update BCL Linked Size 2019-10-08 10:23:41 +02:00
Ryan Lucia 3355d2dd81 [netcore] Add libc name transition 2019-10-08 10:22:18 +02:00
Alexis Christoforides 37c197f225 Remove unused variable 2019-10-07 21:04:47 -05:00
Alexis Christoforides 2ca93bd2f9 [merp] Print missing status marker file for stage 1 (setup) 2019-10-07 21:04:47 -05:00
Alexis Christoforides b18d52bf1c Zeroing is not necessary, snprintf() always null-terminates in this case 2019-10-07 21:04:47 -05:00
Vlad Brezae d9c9a53332 [interp] Rerun cprop pass if stloc.np intructions were eliminated
If we eliminate these instructions, it means we removed instructions that use the top of stack. Without them we might be able to optimize away that stack slot usage. If we retraverse the instruction stream, then we must handle movloc and stloc.np separately.
2019-10-07 19:35:57 -05:00
Vlad Brezae f2006f61dc [interp] Handle more cases for stloc.np optimization
We emit stloc.np if we have "stloc local; ldloc local". Bu we can also emit if we have "stloc loc1; ldloc loc2" and loc2 == loc1.
2019-10-07 19:35:57 -05:00
Vlad Brezae fc100ae043 [interp] Skip NOPs when checking previous instruction
When emitting stloc.np, which looks for stloc/ldloc pair.
2019-10-07 19:35:57 -05:00
Calvin Buckley 01dd63c440 dladdr shim for gmodule; try to enable crash reporter on AIX (#15808)
* Introduce new dladdr wrapper in glib, AIX reimpl, and convert usage

Provides a wrapper around dladdr that should be platform-neutral.

Also provided is a reimplementation for AIX, which should enable
that platform to get some previously dladdr-specific functions like
the crash reporter. It is somewhat flawed in that it only gets info
for symbols in .text, returns non-constant allocated strings, and
allocates heap memory for buffers.

Then convert usages (except a macOS specific one) of dladdr to the
new eglib function. It has a different signature, which should
simplify intent and reduce structiness. Also free memory on AIX due
to limitations of its reimplmenetation.

* Enable (and fix build of) crash reporter on AIX

So far crashes don't seem any different, but the code for it is
built.

* typo fix (guess this isn't compiled on aix)

* attempt to fix macOS and win32 builds

* Implement more of g_module_address on Win32

Implements the filename stuff. Untested; don't have Windows.

* Look for backtrace_symbols in an IBM compat library for i

Enables i to natively dump a stack trace. (AIX "works" too if you
copy the compat lib's code and hack it in - it probably needs to be
in EGlib.) Unfortunately, it's not perfect. The backchain from the
signal handler is empty on i, and AIX sometimes mangles the stack
frame in a way that severely confuses the backtrace code, causing
it to dereference invalid memory by interpreting instructions as a
pointer. (I have seen somewhat similar for the sigaltstack case,
where the native memory dump attempts to read something it should
not.) Perhaps mincore could be used, but that feels like a sloppy
workaround, especially in the "AIX making an invalid stack frame"
case.

* If the file isn't an archive, don't format its name like one

* Fix up search for backtrace_symbols to look in libexecinfo

FreeBSD ships it in base and Haiku has a package; likely others too.

* Win32 suffers in g_module_address as well

* That should habe been guarded with AIX due to limitations

Otherwise seems to free things that shouldn't be freed

* Casting for win32

* Fix up Win32 impl of module address

* Free HMODULE to lower reference count after using it

* Change dladdr based impl to always dup for impl consistency

Means freeing afterwards shouldn't be ifdefable.

* probably shouldn't strdup NULL

Likely why macOS has failures.

* Don't dup/return const strs, but copy to caller-provided buffers

...which can be on the stack. This makes it far less risky to use
in a crash reporter scenario, because malloc can be hosed then.

Also fix profiler up better to work with this new reality.
2019-10-08 00:19:28 +02:00
Zoltan Varga c7f8e5bdb7 [offsets-tool] Update the README. (#17212) 2019-10-07 22:37:09 +02:00
Jo Shields d28d72cb96 Bump version to 6.9 (#17207)
* Bump version to 6.9

* Add missing new linker source file

* [csproj] Update project files

* No monolinker on MCS mode, new linker version needs Roslyn
2019-10-07 22:36:13 +02:00
Ryan Lucia 1d18c27dbe Don't declare mono_get_module* on non-win32 2019-10-07 09:44:41 -05:00
Ryan Lucia ca5926fa3f Use eglib win32 helper functions without MAX_PATH limit 2019-10-07 09:44:41 -05:00
Ryan Lucia d12db16723 Escape type namespaces, document that we aren't escaping names for now 2019-10-07 09:43:47 -05:00
Ryan Lucia 8760cd446c Make the mono identifier escape function work like unescape and public 2019-10-07 09:43:47 -05:00
Ryan Lucia 7c2d2a551c Unescape type names in the managed parser 2019-10-07 09:43:47 -05:00
Ryan Lucia f37c3a649f Make TypeNameParser consistently use tabs
Is this worth the line damage? Unsure.
2019-10-07 09:43:47 -05:00
Ryan Lucia fa8fbbbc36 Partially revert "Remove redundant function call of EscapeTypeName to make (#16425)"
This partially reverts commit abe48e3fd4.
2019-10-07 09:43:47 -05:00
Jay Krell f0ff9f3860 Do not zero localalloc if not asked. (#16881)
Note that we will still touch the pages (mono_emit_stack_alloc).
2019-10-07 09:42:13 -05:00
Jay Krell 957e6fa4dd [Coop] Convert Get/SetGenericValueImpl. (#17034)
This is an alternative to https://github.com/mono/mono/pull/16994
and does *not* depend on
   https://github.com/mono/mono/pull/16987
or https://github.com/mono/mono/pull/17009
or similar.
2019-10-07 09:40:22 -05:00
Alexander Köplinger 495b08a3c7 Default --host in autogen.sh on cygwin when missing. (#17164) 2019-10-07 16:38:49 +02:00
Ryan Lucia 6f72363932 [IO] Remove read-only logic in mono_w32_get_disk_free_space (#17177)
This brings us in line with GetDiskFreeSpaceExW on Windows as well as .NET Core.
2019-10-07 09:38:23 -05:00
Junil Um 026d82fac3 Fixed a bug in mono-service.cs (#17095)
There is a bug in mono-service.cs file.

`setup.ApplicationBase = Environment.CurrentDirectory;`;

General `Environment.CurrentDirectory` does returns `Directory.GetCurrentDirectory()`.
And retuened value 'current path' without last character `/` but `AppDomain.CurrentDomain.BaseDirectory`;

It have a problem in my service application.

In my service application code,

```cs
using System;
using System.IO;

namespace BaseDirTest
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var baseDir = AppDomain.CurrentDomain.BaseDirectory;
            Console.WriteLine($"baseDir={baseDir}");
            Console.WriteLine($"Path.GetDirectoryName(baseDir)={Path.GetDirectoryName(baseDir)}");
        }
    }
}
```

When I launch `mono app.exe`,
```bash
baseDir=/workspace/test/mono-owin-test/ConsoleApplication1/BaseDirTest/bin/Debug/
Path.GetDirectoryName(baseDir)=/workspace/test/mono-owin-test/ConsoleApplication1/BaseDirTest/bin/Debug
```

But when I launch `mono-service --no-daemon app.exe`,
```bash
eDir=/workspace/test/mono-owin-test/ConsoleApplication1/mono-service-umc/bin/Debug
Path.GetDirectoryName(baseDir)=/workspace/test/mono-owin-test/ConsoleApplication1/mono-service-umc/bin
```

Because my service application can not founds plugin directory and scans it.
2019-10-07 16:28:40 +02:00
Bernhard Urban-Forster 6861610662 [lldb] use mono_method_full_name helper (#16934)
[lldb] use mono_method_full_name helper

Instead of:

```
(lldb) mbt 20
* thread #11
  * frame #0: 0x1bf28f28 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x1bf9caac libsystem_pthread.dylib`pthread_kill + 300
    frame #2: 0x1be66080 libsystem_c.dylib`abort + 140
    frame #3: 0x024bdfa0 monotouchtest`log_callback(log_domain=0x00000000, log_level="error", message="../../../../../mono/metadata/object.c:1905: Expected GC Unsafe mode but was in STATE_BLOCKING state", fatal=4, user_data=0x00000000) at runtime.m:1251:3
    frame #4: 0x02487f44 monotouchtest`monoeg_g_logv_nofree(log_domain=0x00000000, log_level=G_LOG_LEVEL_ERROR, format=<unavailable>, args=<unavailable>) at goutput.c:149:2 [opt]
    frame #5: 0x02487ee0 monotouchtest`monoeg_g_logv(log_domain=<unavailable>, log_level=<unavailable>, format=<unavailable>, args=<unavailable>) at goutput.c:156:10 [opt]
    frame #6: 0x02487f74 monotouchtest`monoeg_g_log(log_domain=<unavailable>, log_level=<unavailable>, format=<unavailable>) at goutput.c:165:2 [opt]
    frame #7: 0x024694c4 monotouchtest`assert_gc_unsafe_mode(file="../../../../../mono/metadata/object.c", lineno=1905) at checked-build.c:396:3 [opt]
    frame #8: 0x023d2f64 monotouchtest`mono_class_vtable_checked(domain=0x16d64800, klass=0x173c1b98, error=0x194b0ee8) at object.c:1905:2 [opt]
    frame #9: 0x024130a8 monotouchtest`get_current_thread_ptr_for_domain(domain=0x16d64800, thread=0x02db45d0) at threads.c:635:2 [opt]
    frame #10: 0x024119a8 monotouchtest`mono_thread_current at threads.c:2026:23 [opt]
    frame #11: 0x02416998 monotouchtest`mono_thread_interruption_checkpoint_request(bypass_abort_protection=0) at threads.c:5101:35 [opt]
    Messaging::void_objc_msgSendSuper @ 388435850 "calli.nat.fast" || frame #12: 0x024d5de8 monotouchtest`interp_exec_method_full(frame=0x194b11c0, context=<unavailable>, clause_args=<unavailable>, error=<unavailable>) at interp.c:3230:4 [opt]
    ObjCExceptionTest::InvokeManagedExceptionThrower @ 388435752 "vcall" || frame #13: 0x024d64dc monotouchtest`interp_exec_method_full(frame=0x194b1380, context=<unavailable>, clause_args=<unavailable>, error=<unavailable>) at interp.c:3400:4 [opt]
    ExceptionsTest::ManagedExceptionPassthrough @ 388502134 "vcallvirt.fast" || frame #14: 0x024d61c0 monotouchtest`interp_exec_method_full(frame=0x194b14e0, context=<unavailable>, clause_args=<unavailable>, error=<unavailable>) at interp.c:3325:4 [opt]
    Object::runtime_invoke_direct_void__this__ @ 388462550 "vcall" || frame #15: 0x024d64dc monotouchtest`interp_exec_method_full(frame=0x194b1598, context=<unavailable>, clause_args=<unavailable>, error=<unavailable>) at interp.c:3400:4 [opt]
    frame #16: 0x024d46ec monotouchtest`interp_runtime_invoke(method=<unavailable>, obj=0x0302c5f0, params=0x00000000, exc=0x194b166c, error=0x194b18c8) at interp.c:1766:2 [opt]
    frame #17: 0x0232b39c monotouchtest`mono_jit_runtime_invoke(method=0x174fda58, obj=<unavailable>, params=0x00000000, exc=<unavailable>, error=0x194b18c8) at mini-runtime.c:3170:12 [opt]
    frame #18: 0x023d5cc8 monotouchtest`do_runtime_invoke(method=0x174fda58, obj=0x0302c5f0, params=0x00000000, exc=0x00000000, error=0x194b18c8) at object.c:3017:11 [opt]
    frame #19: 0x023d26a0 monotouchtest`mono_runtime_invoke_checked(method=<unavailable>, obj=<unavailable>, params=<unavailable>, error=<unavailable>) at class-getters.h:24:1 [opt] [artificial]
```

It prints now:

```
(lldb) mbt 20
* thread #11
  * frame #0: 0x1bf28f28 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x1bf9caac libsystem_pthread.dylib`pthread_kill + 300
    frame #2: 0x1be66080 libsystem_c.dylib`abort + 140
    frame #3: 0x024bdfa0 monotouchtest`log_callback(log_domain=0x00000000, log_level="error", message="../../../../../mono/metadata/object.c:1905: Expected GC Unsafe mode but was in STATE_BLOCKING state", fatal=4, user_data=0x00000000) at runtime.m:1251:3
    frame #4: 0x02487f44 monotouchtest`monoeg_g_logv_nofree(log_domain=0x00000000, log_level=G_LOG_LEVEL_ERROR, format=<unavailable>, args=<unavailable>) at goutput.c:149:2 [opt]
    frame #5: 0x02487ee0 monotouchtest`monoeg_g_logv(log_domain=<unavailable>, log_level=<unavailable>, format=<unavailable>, args=<unavailable>) at goutput.c:156:10 [opt]
    frame #6: 0x02487f74 monotouchtest`monoeg_g_log(log_domain=<unavailable>, log_level=<unavailable>, format=<unavailable>) at goutput.c:165:2 [opt]
    frame #7: 0x024694c4 monotouchtest`assert_gc_unsafe_mode(file="../../../../../mono/metadata/object.c", lineno=1905) at checked-build.c:396:3 [opt]
    frame #8: 0x023d2f64 monotouchtest`mono_class_vtable_checked(domain=0x16d64800, klass=0x173c1b98, error=0x194b0ee8) at object.c:1905:2 [opt]
    frame #9: 0x024130a8 monotouchtest`get_current_thread_ptr_for_domain(domain=0x16d64800, thread=0x02db45d0) at threads.c:635:2 [opt]
    frame #10: 0x024119a8 monotouchtest`mono_thread_current at threads.c:2026:23 [opt]
    frame #11: 0x02416998 monotouchtest`mono_thread_interruption_checkpoint_request(bypass_abort_protection=0) at threads.c:5101:35 [opt]
    (wrapper managed-to-native) ApiDefinition.Messaging:void_objc_msgSendSuper (intptr,intptr) @ 388435850 "calli.nat.fast" || frame #12: 0x024d5de8 monotouchtest`interp_exec_method_full(frame=0x194b11c0, context=<unavailable>, clause_args=<unavailable>, error=<unavailable>) at interp.c:3230:4 [opt]
    Bindings.Test.ObjCExceptionTest:InvokeManagedExceptionThrower () @ 388435752 "vcall" || frame #13: 0x024d64dc monotouchtest`interp_exec_method_full(frame=0x194b1380, context=<unavailable>, clause_args=<unavailable>, error=<unavailable>) at interp.c:3400:4 [opt]
    MonoTouchFixtures.ObjCRuntime.ExceptionsTest:ManagedExceptionPassthrough () @ 388502134 "vcallvirt.fast" || frame #14: 0x024d61c0 monotouchtest`interp_exec_method_full(frame=0x194b14e0, context=<unavailable>, clause_args=<unavailable>, error=<unavailable>) at interp.c:3325:4 [opt]
    (wrapper runtime-invoke) object:runtime_invoke_direct_void__this__ (object,intptr,intptr,intptr) @ 388462550 "vcall" || frame #15: 0x024d64dc monotouchtest`interp_exec_method_full(frame=0x194b1598, context=<unavailable>, clause_args=<unavailable>, error=<unavailable>) at interp.c:3400:4 [opt]
    frame #16: 0x024d46ec monotouchtest`interp_runtime_invoke(method=<unavailable>, obj=0x0302c5f0, params=0x00000000, exc=0x194b166c, error=0x194b18c8) at interp.c:1766:2 [opt]
    frame #17: 0x0232b39c monotouchtest`mono_jit_runtime_invoke(method=0x174fda58, obj=<unavailable>, params=0x00000000, exc=<unavailable>, error=0x194b18c8) at mini-runtime.c:3170:12 [opt]
    frame #18: 0x023d5cc8 monotouchtest`do_runtime_invoke(method=0x174fda58, obj=0x0302c5f0, params=0x00000000, exc=0x00000000, error=0x194b18c8) at object.c:3017:11 [opt]
    frame #19: 0x023d26a0 monotouchtest`mono_runtime_invoke_checked(method=<unavailable>, obj=<unavailable>, params=<unavailable>, error=<unavailable>) at class-getters.h:24:1 [opt] [artificial]
```



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-10-07 16:16:13 +02:00
Thays Grazia 18fac0a241 [debugger][exception] Debugger breaks on handled exceptions (#17106)
* If there is a perform_wait_callback in the stack there will be another catch generated by the owner thread, so we don't need to throw, we can continue and find the next catch.
Fixes #17083

* Reverting unit test changed on commit 405d521.

* Fixing assert when calling mono_jit_info_get_method if it was a trampoline.
2019-10-07 08:22:06 -04:00
Egor Bogatov 35c6b7691f [netcore] Optimize Buffer.BlockCopy and Buffer.IsPrimitiveArray (#16692)
* Optimize Buffer.BlockCopy and IsPrimitiveArray (make them icalls)

* wrap with ENABLE_NETCORE

* fix formatting

* fix check for "is primitive"

* use m_class_is_primitive

* fix build errors

* fix typo

* fix failing test

* use mono_error_set_argument_out_of_range

* fix argument names for exceptions
2019-10-07 12:29:22 +02:00
Steve Pfister 2f6d69e2e6 Re-ordered the * IsValid check in SiteIdentityPermissions. We were throwing an IndexOutOfRangeException
Fixes https://github.com/mono/mono/issues/17017
2019-10-07 09:43:53 +02:00
Jan Kotas c6dcd3de56 More CompareInfo.IndexOf globalization fixes (dotnet/coreclr#27049)
Apply earlier CompareInfo.StartsWith fixes onto CompareInfo.IndexOf as well

Signed-off-by: dotnet-bot <[email protected]>
2019-10-07 09:41:24 +02:00
Zoltan Varga dea3a20b05 [wasm] Bump emscripten version. (#17179)
* [offfsets-tool] Embed a copy of the clang bindings, the version in PIP doesn't work with newer clang versions.

* [wasm] Bump emscripten version to 1.38.47.
2019-10-06 20:10:43 -04:00
Jay Krell f57af77e69 Optimize and extend System.Array intrinsic identification. (#17047)
* Optimize and extend System.Array intrinsic identification.
i.e. do the strcmp last.
Add GetRawArrayData.

* Use [Intrinsic] attribute instead of comment.
2019-10-06 10:27:42 +02:00
Zoltan Varga d2f543b4b1 [mixed] Add interp entry wrappers for devirtualized calls as well. (#17159)
* [mixed] Add interp entry wrappers for devirtualized calls as well.

* [aot] Generate code for string:memcpy/memset/bzero even in profile mode, they are called by the generated code.

* [aot] Treat string:memcpy as always AOTed in mono_aot_can_enter_interp () as well.

* [aot] Always aot string ctors as well, the JIT doesn't generate interp entry code for them.

* [wasm] Update print-table.py.
2019-10-05 20:51:52 -04:00
Aleksey Kliger (λgeek) cb52186661 [merp] Put thread into async context before running summarizer (#17194)
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
2019-10-05 13:01:56 -04:00
Alexander Köplinger 0600ea1256 Bump libgdiplus to 6.0.4 2019-10-05 17:36:40 +02:00
Aleksey Kliger (λgeek) 2f7fd4f03e [merp] exit_status is 0 if we ran the uploader successfully (#17185)
Not 1 (TRUE)
2019-10-05 09:59:05 -04:00
Marek Safar fce0e64de9 [System.Private.CoreLib] Fixes build 2019-10-05 14:09:54 +02:00
Stephen Toub 2c8d5f0a39 Add ExceptionDispatchInfo.SetCurrentStackTrace (dotnet/coreclr#27004)
* Add ExceptionDispatchInfo.SetCurrentStackTrace

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-10-05 14:09:54 +02:00
Stephen Toub d8c115d07a Fix stackalloc reuse bug in Environment.UserDomainName (#26994)
* Fix stackalloc reuse bug in Environment.UserDomainName

According to the comment, this code is never expected to be used (so it should either be deleted or the comment fixed), but in the meantime, if it were to be executed, things could go badly due to potentially passing the same buffer into LookupAccountNameW for two different arguments.

* Fix existing ValueStringBuilder usage to dispose the builder

Signed-off-by: dotnet-bot <[email protected]>
2019-10-05 14:09:54 +02:00
Stephen Toub 670738b55f Use const internally in corelib for Environment.NewLine (#27013)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-05 14:09:54 +02:00
Stephen Toub 1e3d017479 More corelib cleanup (dotnet/coreclr#26993)
* Make relevant types static (mostly Interop)

* Fix a few stray semicolons

* Remove unnecessary locals

Some can be removed entirely, some can be replaced by discards.

* Remove unnecessary usings

* Move Unix-specific helper method to TimeZoneInfo.Unix.cs

* Remove duplicated code

* Remove duplicative checks

* Remove [ThreadStatic] initialization

These are all the default values and wouldn't be necessary for any static, but inline initialization for [ThreadStatic]s is particularly unuseful (and in non-default cases problematic) because the fields are only set to these values on the initializing thread.

* Fix methods whose return value is never used

* Use string.IsNullOrEmpty

* Remove unnecessary field initialization

All ctors overwrite these values.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-10-05 14:09:54 +02:00
Boris Parfenenkov 8205424667 Improve TimeSpan precision (dotnet/coreclr#26992)
Change multiplying by (x * (1.0 / BigValue)) on (x / BigValue).

Fix #41380

Signed-off-by: dotnet-bot <[email protected]>
2019-10-05 14:09:54 +02:00
Larry Ewing b45d0a1084 [aprofutil] Add skip regexes to simplify expression of removal matching (#17146)
* [aprofutil] Add skip regexes to simplify expression of removal matching

* [aprofutil] arguments to skip and take by count for automatic profile testing
2019-10-04 22:23:24 +02:00
Maxim Lipnin 06effa7d7e [wasm] Enable CoreXml.Test.XLinq.LoadSaveAsyncTests.RoundtripSyncAsyncMatches_Stream test (#17183) 2019-10-04 12:42:45 -05:00
Ryan Lucia 05217395db [reflection] Only duplicate MonoMarshalSpec strings for custom types (#17175)
* [reflection] only duplicate MonoMarshalSpec strings for custom types

* Add test
2019-10-04 13:41:56 -04:00
Egor Bogatov 26754eecff [llvm] Propogate --enable-llvm-asserts to llvm/build.mk (#17149)
* fix Enable llvm asserts

* fix chmod
2019-10-04 10:27:01 -05:00
Vlad Brezae d1b3ee2e32 [interp] Improve copy propagation (#17154)
* [interp] Refactor tracking of stack/local values

Previously we had just an InterpInst* inside StackContentInfo, which was representing the instruction that pushed a certain local/value on the stack. This makes many things awkward, since an instruction is logically different from a value, that a local or a stack slot have. If we clear an instruction, it doesn't necessarily mean that the value that the instruction produced can't be stored on stack or in a local.

This commit creates a new structure StackValue, which holds the value.

* [interp] Generalize contents of StackValue

StackValue contains an opcode and some data to enable reconstruction of the value. For example instead of doing a LDLOC for a local, we can see if the local has a known value and use it instead (this could be a LDLOC from another local, whose value was propagated, or in the future a LDC). This will make more sense when we also start to track constant values.

Also decouple MOVLOC instructions from the cprop pass. They serve no purpose there. They are useful though when we do deadce, since we currently don't know how to kill instructions that change the stack.

* [interp] Handle dup opcode during copy propagation

* [interp] Avoid losing track of stack values for some opcodes

For some opcodes, that access stack values below the top of the stack, we were assuming they pop everything and then push the stack back, in order to prevent optimizing away instructions that pushed some of these values, since the original instruction expects those values to reside on the stack. We handle these instruction separately and keep track of the values of the stack, so we can further propagate the stack values, even though we currently can't optimize away those instructions.

* [interp] Propagate values for ctor arguments

* [interp] MINT_CASTCLASS no longer clobbers top of stack
2019-10-04 14:20:52 +03:00
Johan Lorensson 2aa7adb269 Always do copy_stack_data on entering GC safe/unsafe mode. (#17150) 2019-10-04 09:16:05 +02:00
Piotr Zierhoffer 4e8c496082 mkbundle: fix 17139 mono aot register module fix definitions (#17152)
* [mkbundle] Fix mono_aot_register_module declaration (#17139)

This change reflects the declaration introduced in jit.h in #15132.

* [mkbundle] Remove spurious function declaration (#17139)

The comment is clearly outdated after the introduction of #15132.
2019-10-04 08:46:58 +02:00
Aleksey Kliger (λgeek) ea2a460cf6 [merp] Don't overrun buffer in copy_summary_string_safe … (#17176)
* [merp] Don't overrun buffer in copy_summary_string_safe

MonoFrameSummary:str_destr is an array of MONO_MAX_SUMMARY_NAME_LEN bytes, not
MONO_MAX_SUMMARY_NAME_LEN + 1 bytes.

Fixes Coverity CID 1454563

* [merp] Use g_strlcpy for copy_summary_string_safe

Fixes Coverity CID 1454563

We would sometimes write to MonoSummaryFrame:str_descr which is
MONO_MAX_SUMMARY_NAME_LEN bytes long at index MONO_MAX_SUMMARY_NAME_LEN which
is one past the end of the array.

* nit: rename confusing parameter names

old names were confusing - we were copying from 'out' to 'in'.  Now we copy to
'dest' from 'src'
2019-10-04 01:17:49 -04:00
Vlad Brezae 8c1ef74bb1 [arm] Fix fetching of method addresses (#17099)
After https://github.com/mono/mono/commit/9ff3b0d65ee4, in an aot image we can emit addresses either as bl offset (which uses 4 bytes) or as ldr pc, =<label>; <addr> (which uses 8 bytes). Before this commit we were dereferencing an instruction pointer, in get_call_table_entry, assuming 8 bytes per entry. This could overflow and crash if we used in fact only 4 bytes per entry. Fix this by including the entry size in the aot image.

Fixes random crashes on arm CI on full-aotmixed suite.
2019-10-03 22:29:55 +03:00
Alexander Köplinger ea9dad7249 Bump ikvm to get https://github.com/mono/ikvm-fork/pull/13 (#17169) 2019-10-03 20:46:37 +02:00
dotnet-maestro[bot] 06c3637681 [master] Update dependencies from dotnet/corefx (#17166)
* Update dependencies from https://github.com/dotnet/corefx build 20191002.6

- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19502.6

* Reenable libgdiplus/System.Drawing.Common tests

* Update dependencies from https://github.com/dotnet/corefx build 20191002.7

- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19502.7
2019-10-03 20:45:29 +02:00
Bernhard Urban-Forster 40b6f1ad2b [sdks] .gitignore python virtualenv (#17168) 2019-10-03 20:34:15 +02:00
Alexander Köplinger 43ccc6c26b [netcore] Update .gitignore 2019-10-03 18:45:14 +02:00
Alexander Köplinger 5bf18642ff [netcore] Move ignored test to global ignore file instead of the Linux-specific
It affects all platform
2019-10-03 18:44:07 +02:00
Marek Safar 0ccfd7806c [System.Runtime.Serialization] Make reflection calls linker friendly (#17165)
* [System.Runtime.Serialization] Make reflection calls linker friendly

Fixes #12586

* [csproj] Update project files
2019-10-03 18:40:14 +02:00
Sam Patel 83a5343d12 Merge pull request #17105 from naricc/naricc/UnitializedArray-Comment
Add a comment explaining why GC.AllocateUninitializedArray is not an icall
2019-10-03 10:43:45 -04:00
lateralusX aaa383b3e1 Default --host in autogen.sh on cygwin when missing. 2019-10-03 12:25:30 +02:00
Johan Lorensson 55be8289ff Optional only build MSVC runtime using make file system on Windows. (#16915)
* Build MSVC only runtime using make file system.

Add a new option to only build MSVC version of mono runtime and native
tools, --enable-msvc-only. In the past, --enable-msvc build both
mingw as well as MSVC runtime, this commit adds an option to only build
MSVC version of runtime and native tools using make file system.

Commit updates all native make file making sure mingw/gcc builds are
not done if --enable-msvc-only has been used. It also makes sure we
build and use MSVC based tools as part of build and tests.

Result will be a build without any mingw/gcc artifacts, but where all
existing make files still works with the MSVC build artifacts.

This commits is also preparing to switch the .NETCore build over to use
MSVC build runtime in order to get LLVM support, something that is
currently only supported on Windows MSVC build.

* Add link to mono-sgen.exe and clean windows binaries.

* Fix failures in mono/tests test-aot on Windows.

* Add fullaot-mixed tests on Windows x64.

* Run msbuild in parallel.

* Default to x64 mingw host on cygwin build.
2019-10-03 11:21:36 +02:00
Nathan Ricci d0461a9d8d Spelling corrections. 2019-10-02 13:14:48 -04:00
Jo Shields d8040ba865 Fix missing corerun/ directory in make dist tarballs (#17126)
```
 configure.ac:6695: error: required file 'netcore/corerun/Makefile.in' not found
 Makefile.am:24: error: required directory ./netcore/corerun does not exist
```
2019-10-02 10:46:42 -04:00
Jay Krell 6fb01aa269 Some external_only/internal split, and inlining. (#17012)
mono_type_get_type
 mono_type_get_signature
 mono_type_is_byref
 mono_type_get_class
 mono_type_get_array_type
2019-10-02 12:59:45 +02:00
Jay Krell 8d84b6fd38 [jit amd64] Add const and remove x87. (#16700) 2019-10-02 11:51:59 +02:00
Vlad Brezae 0ce8c78e0c [mini] Use clr memory model by default (#17136)
* [mini] Use clr memory model by default

Otherwise we can have potential crashes in the bcl on arm targets, since a lot of code that assumes this memory model is now shared with mono.

Keep the old clr-memory-model option alive for now, to avoid potential build problems, if building older mono with newer mono.

* [build] Remove clr-memory-model option

It is default now

* [man] Add entry for weak-memory-model
2019-10-02 09:23:45 +02:00
Alexis Christoforides 10e9159eaa [merp] Include any managed methods in the 'unmanaged_frames' portion … (#17090)
* [merp] Include any managed methods in the 'unmanaged_frames' portion of the output also

This can help correlate the two lists when we have mixed managed & unmanaged stacks in our crash output.

* Wehn symbol/function address is not found, still output the IaP

* Don't set native_offset to ip, that's not what it means

* [merp] Bump protocol version

* Minor formatting fix

* Remove paths from assembly image names

* Remove unused var

* Refactor filling in managed info for stack frame

* Revert "Remove paths from assembly image names"

This reverts commit defe86b471f37e12fa66a104747cac932943dca1.
2019-10-02 01:11:35 -04:00
Kyle White 0004522028 [merp] Use macOS version not Darwin version in MERP reports (#17130)
* Use macOS version not Darwin version in MERP

Fixes #17004

* Update mono-merp.c

Ensure this is only for Mac

* Don't allocate in macos_version_string

Use a static buffer.

Also some formatting fixes.
2019-10-01 22:01:35 -04:00
Tanner Gooding c76b84e80c Fixing AdvSimd.Arm64 to have an internal constructor in the "supported" file. (#26953)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-01 19:22:28 +02:00
Maxim Lipnin 41a89af31d [wasm][xunit tests] Exclude some tests due to PNSE-implemented members. (#17137) 2019-10-01 10:13:46 -05:00
Vlad Brezae 5af0ad900c Update codeowners
Get notifications for profiler and exceptions.
2019-10-01 16:40:48 +02:00
Maxim Lipnin db2e8ea79f [wasm][xunit test] Exclude RemoteExecutorTests in bcl profile (#17120)
`System/RemoteExecutorTests.cs` tests are excluded in the mobile test profiles. It makes sense to do the same for wasm.

Fixes https://github.com/mono/mono/issues/17038.
2019-10-01 15:34:49 +02:00
Adam SitnikandJan Kotas 20ab9bf581 allow ASCII equality ordinal fast path for en-* cultures (#26905)
* allow ASCII equality ordinal fast path for en-* cultures

* dont use StartsWith in the initialization execution path

* Update src/System.Private.CoreLib/shared/System/Globalization/CompareInfo.Unix.cs

Co-Authored-By: Jan Kotas <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-10-01 11:36:07 +02:00
Vlad Brezae f9ca01e3a5 [sgen] Fix allocator spelling (#17111) 2019-10-01 12:09:54 +03:00
Marek Safar e5f218786d [netcore] Update coreclr tests package name 2019-10-01 10:57:02 +02:00
Santiago Fernandez Madero b74f7b936e Make ResolveEventArgs.Name not nullable (dotnet/corefx#41415)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-01 10:13:53 +02:00
Youssef Victor 4d6596359c Typo: retreive => retrieve (dotnet/coreclr#26915)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-01 10:13:53 +02:00
Egor Bogatov 5537a7c2ba Enable hw intrinsics in AOT mode (#17005)
* Introduce -mattr flag

* fix build on arm targets

* remove mono_memory_barrier

* Address feedback

* Address feedback

* cleanup

* fix crash

* fix "bmi" (it's not "bmi1")

* cleanup

* ignore System.Drawing.Tests.IconTests.CorrectColorDepthExtracted test

* fix build on arm

* fix build

* fix build
2019-09-30 21:28:55 -04:00
Maxim Lipnin e416137dfb [wasm][xunit tests] Other fix for "MissingMethodException: Default constructor not found" issue (#17122)
Fixes https://github.com/mono/mono/issues/17040
2019-09-30 15:21:32 -04:00
Ankit Jain 410cb28177 Bump msbuild to track xplat-master (#16975)
.. to pick up https://github.com/mono/msbuild/pull/142 and
https://github.com/mono/msbuild/pull/139 .
2019-09-30 21:11:09 +02:00
Vlad Brezae eb887a8c74 [sgen] Add stats for allocated gchandles (#17074) 2019-09-30 21:15:42 +03:00
dotnet-maestro[bot] 5818100a80 Update dependencies from https://github.com/dotnet/roslyn build 20190926.6 (#17103)
- Microsoft.Net.Compilers - 3.3.1-beta4-19476-06
2019-09-30 18:40:57 +02:00
Egor Bogatov 3768181879 Update NETStandard2.1 APIs (#17080)
Contributes to #17064

* Add System.Data.DataSetExtensions to mobile profiles
2019-09-30 16:07:02 +02:00
Alexander Köplinger 7f37f76b6d [netcore] Disable System.Drawing.Tests.IconTests.CorrectColorDepthExtracted test
It is broken on newer libgdiplus.
2019-09-30 15:32:18 +02:00
Marek Safar f88da6cc14 [netcore] Add target for running coreclr tests 2019-09-27 21:27:08 +02:00
Nathan Ricci bc63dc68f8 Updated comment in GC.cs about unitialized array. 2019-09-27 14:48:00 -04:00
Tanner Gooding bf5f6174ad Refactoring the ARM Hardware Intrinsics based on the latest design decisions. (#26895)
* Moving the Arm64 intrinsic files into the Arm folder.

* Refactoring the ARM Hardware Intrinsics based on the new design.

* Adding support for AdvSimd.Add

* Adding LoadVector64 and LoadVector128 APIs to Arm.AdvSimd

* Marking the LoadVector64 and LoadVector128 methods as unsafe

* Removing the ARM64 HWIntrinsic tests

* Renaming Arm.Base to Arm.ArmBase, as per the design

* Fixing Base.cs to ArmBase.cs in the shared projitems

* Fixing the doc comments for the AdvSimd.LoadVector methods

* Marking various IsSupported methods as new, now that they inherit from ArmBase

* Fixing a malformed doc comment that was missed

* Marking AdvSimd.Arm64 as [Intrinsic] and new

Signed-off-by: dotnet-bot <[email protected]>
2019-09-27 20:47:17 +02:00
Jo Shields 2072e4ce81 Special case in GetFullPath for UNC roots of \\.\ (#17066)
A valid path might be something like \\\\.\\pipe\\pipename (i.e. \\\\.\\ is a valid root). If we blindly strip all instances of `.\\` then we end up confusing our path cleaning algorithm. So permit a directory component of `.` in UNC path roots.

Closes: https://github.com/mono/mono/issues/16460
2019-09-27 13:35:18 -05:00
Zoltan Varga ac2ee5b8fc [wasm] Bump emscripten to 1.38.46. (#17094) 2019-09-27 13:34:02 -05:00
Maxim Lipnin 643bcbc3fc [wasm][xunit tests] Fix issue "System.MissingMethodException: Default constructor not found for type" (#17082)
Fixes https://github.com/mono/mono/issues/16879
2019-09-27 13:59:15 -04:00
Alexander Köplinger 1b9d8ec9eb Fix mono-extensions build (#17100)
It needed an update because https://github.com/mono/mono/commit/5b108b5726ec196f4b61d30f406919ce70211754 touched code the patch modified.
2019-09-27 16:45:57 +02:00
Vlad Brezae 194506d495 [mini] Expand clr-memory-model effect (#17093)
* [mini] Add memory barriers to more stores inside objects

We should now have membars for all stores of an object ref inside another object (for the stores done by the jit). Used by clr-memory-model debug option.

* [mini] Add memory barrier for storing objref in static fields

For clr-memory-model debug option.
2019-09-27 12:36:04 +03:00
dotnet-maestro[bot] ba093a07b7 Update dependencies from https://github.com/dotnet/arcade build 20190923.5
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19473.5
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19473.5
2019-09-27 10:32:57 +02:00
dotnet-maestro[bot] d5c49121b6 Update dependencies from https://github.com/dotnet/corefx build 20190926.2
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19476.2
2019-09-27 10:32:57 +02:00
dotnet-maestro[bot] e062ebf096 Update dependencies from https://github.com/dotnet/core-setup build 20190926.2
- Microsoft.NETCore.App - 5.0.0-alpha1.19476.2
2019-09-27 10:32:57 +02:00
Aleksey Kliger (λgeek) 1dc63ced73 [runtime] Respect runtime_version in mono_init_internal (#17085)
In 6d2c77fb33 we changed the representation of
the runtimes that we will probe from a NULL-terminated array to a linked list.
Unfortunately we made a typo, and in the case where the caller of
mono_init_internal provided a runtime_version, we still picked
DEFAULT_RUNTIME_VERSION instead of the given runtime_version.

This is an issue for embedders like XA that use the "mobile" runtime - all
their assemblies are compiled with the "mobile" version number (2.0.5.0) but
Mono running with the default runtime configuration will remap to 4.0.0.0.  As
a result, when there are references to 2.0.5.0 assemblies, the load requests
will be remapped to 4.0.0.0 which will never see the already loaded 2.0.5.0
assemblies, and we will fall back on the embedder's preload hook or filesystem
probing every single time.  This is a performance fail.
2019-09-26 17:30:37 -04:00
Alexander Köplinger bffd4c6b99 Revert "Inline TLS access. (#16882)" (#17092)
Reverts mono/mono#16882

This broke the Mono Android SDKs build in master though for some reason it doesn't show up in the PR build:

```
[2019-09-26T03:19:55.366Z] Undefined symbols for architecture x86_64:
[2019-09-26T03:19:55.366Z]   "_mono_tls_key_jit_tls", referenced from:
[2019-09-26T03:19:55.366Z]       _mono_tls_get_jit_tls in libmain_a-main-sgen.o
[2019-09-26T03:19:55.366Z]   "_mono_tls_key_lmf_addr", referenced from:
[2019-09-26T03:19:55.366Z]       _mono_tls_get_lmf_addr in libmain_a-main-sgen.o
[2019-09-26T03:19:55.366Z] ld: symbol(s) not found for architecture x86_64
[2019-09-26T03:19:55.366Z] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[2019-09-26T03:19:55.366Z] gmake[6]: *** [Makefile:1634: mono-sgen] Error 1
[2019-09-26T03:19:55.366Z] gmake[6]: Leaving directory '/Users/builder/jenkins/workspace/archive-mono/master/android/debug/sdks/builds/android-host-Darwin-debug/mono/mini'
```.
2019-09-26 23:10:51 +02:00
Vlad Brezae bada362454 [sgen] Report roots from togglerefs (#17063) 2019-09-26 22:38:59 +03:00
Marek Safar 8da9eebcc6 [netcore] Correctly send exit code to the caller 2019-09-26 20:59:50 +02:00
Jan 3132cbd98b Add loading the default Mono configuration file. (#16961)
Add loading the default Mono configuration file.

Add loading the default Mono configuration file in the examples of Mono Embedded.
Also include header in existing usage of `mono_config_parse`.

This fixes problems under Raspbian, when extending the sample with your own code. 

The `teste.c` is still not compiling, because the `mono_set_allocator_vtable` function is not up to date. But I was not able to find the documentation for this function.
2019-09-26 20:46:16 +02:00
Vlad Brezae 470e53f6b4 [sgen] Fix heavy binary protocol build (#17037)
[sgen] Fix heavy binary protocol build
2019-09-26 19:16:04 +02:00
imhameed 5e30301ff3 Merge pull request #17031 from EgorBo/bmi-mulx
[LLVM] Implement Bmi2.MultiplyNoFlags
2019-09-26 09:29:54 -07:00
Alexis Christoforides f52678864d [crashing] Remove Mono signal handlers when starting to handle a crash
Fixes https://github.com/mono/mono/issues/16803
2019-09-26 16:41:35 +02:00
Alexis Christoforides 4727b2475f [merp] Output native library module name when 'whitelist all' mode is enabled (#16899)
Partially fixes https://github.com/mono/mono/issues/16689
2019-09-26 09:30:01 -04:00
Vlad Brezae 4a17f5ca11 [Mono.Debugger.Soft] Fix VirtualMachine detaching (#17020)
* Revert "[Mono.Debugger.Soft] Properly close connections"

This reverts commit 2da7707373.

This was previously reverted because it was causing issues and it still does. It is a hack fix. We signal the connection for closing and next we send the dispose command over the network. This is obviously racy.

* [Mono.Debugger.Soft] Make sure receiving thread always closes

When we want to close the connection, setting the close flag is not enough, because a thread can be already stuck in a blocking receive, without getting to check the flag. We fix this by additionaly breaking the connection, by using socket.Shutdown.

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

* Bump API snapshot submodule
2019-09-26 14:40:42 +02:00
Johan Lorensson 9b094e660c BeginConnect complete to early when not using callback. (#17035)
* BeginConnect complete to early when not using callback.

The following commit, https://github.com/mono/mono/commit/068e8fe0424806753d7ab72a7b9bf0e54b58408b#diff-33b28a9dc0b8032650ed77213481a99f
changed the way we do DNS resolve in BeginConnect using host name. Instead
of doing a blocking DNS resolve, it switched to an async DNS resolve, followed
by an async connect. The returned IAsyncResult was just representing the
completion of the DNS resolve task and not the underlying connect. It
also turns out that part of doing EndConnect, we did some validation
of the used IAsyncResult making sure it was an instance of SocketAsyncResult,
meaning that if EndConnect was called on the returned IAsyncResult from
BeginConnect, EndConnect would throw and exception.

NOTE, this only happens if you use pattern like this:

var result = sock.BeginConnect (hostName, port, null, null);
result.AsyncWaitHandle.WaitOne (2000);
sock.EndConnect (result);

It did not happened if you used callbacks, since then EndConnect would
be called as part of callback and that IAsyncResult was of correct type,
or if you did a BeginConnect with an EndPoint or IPAddress[] since that
won't trigger the DNS resolve.

Fix is to make sure we hand out the SocketAsyncResult instance that will
be used in our internal connect calls from BeginConnect. We also make
sure, we chain the DNS resolve task together with a task doing the async
connect (using the same SocketAsyncResult instance). This will make sure
the IAsyncResult returned from BeginConnect is the same one as used in
internal connect call, so it will only complete when the connect call
completes.

* Adding test for BeginConnect using host name.

* Bump API snapshot submodule
2019-09-26 14:34:28 +02:00
monojenkins e5b7473a21 [sdks] Bump min iOS version to 7.0. (#17073)
Because that's the min iOS version in all current versions of Xamarin.iOS.
2019-09-26 14:20:32 +02:00
Bernhard Urban c81b6f5ca9 [interp] always require GC Unsafe mode in exception checkpoint (#17016)
[interp] always require GC Unsafe mode in exception checkpoint

Follow-up for https://github.com/mono/mono/pull/16955

/cc @BrzVlad
2019-09-26 10:45:56 +02:00
Ben Adams 65dc4c364a CollectionsMarshal.AsSpan allow null refs (dotnet/coreclr#26903)
Signed-off-by: dotnet-bot <[email protected]>
2019-09-26 10:10:42 +02:00
Levi Broderick 23fac785db Introduce Utf8Span, which is a span of UTF-8 text (dotnet/coreclr#26711)
Signed-off-by: dotnet-bot <[email protected]>
2019-09-26 10:10:42 +02:00
Vlad Brezae f5bb650f78 [debugger] Properly close debugger thread when connection hangs
When we detach from the debugger, we reset the state by starting a new debugger thread (why don't we just use the existing thread?). As per commit https://github.com/mono/mono/commit/540ef385faa230bc226c7a83bfabd0730520911e we should shut down the debugger thread when the connection drops. However, since that commit was acting as a Dispose command was sent instead, it would end up relentlessly spawning and closing new debugger threads up until the runtime is shut down. This commit makes sure we don't respawn once the connection hangs.
2019-09-26 09:53:36 +02:00
Egor Bogatov 4a72dadb34 LLVM: Add comments (string metadata) for calls (#16956)
* Add string metadata to all calls (comments)

* Update mini-llvm.c

* rename tramp_%d to full name too
2019-09-26 09:51:36 +02:00
Jan Kotas 519380d009 Fix CoreRT build break
Signed-off-by: dotnet-bot <[email protected]>
2019-09-26 08:59:20 +02:00
Bernhard Urban 1faf71f446 [offsets-tool] install clang python package into a virtualenv (#17013)
[offsets-tool] install clang python package into a virtualenv

So it doesn't mess with the Python installation of the user.

/cc @mandel-macaque
2019-09-26 08:55:33 +02:00
Thays Grazia 5b108b5726 [threading] embedded mono hangs (#16907)
* [threading] embedded mono hangs

When embedded mono is executing a C++ code, it didn't start to execute a C# code, we don't need to suspend the thread to run GC.
Fixes #16192
Fixes #14725

* Changing what was discussed with Aleksey during our 1on1

* Changing what was suggested by Aleksey

* Separating mono_init_version that is being used on tests from the embedded ones
2019-09-25 17:12:33 -03:00
Jay Krell ed0fa35dc2 [Coop] Unconvert ves_icall_Mono_TlsProviderFactory_IsBtlsSupported. (#16995) 2019-09-25 14:40:38 -04:00
Stephen Toub c256e409c9 More Corelib cleanup (dotnet/coreclr#26872)
* Remove unnecessary asserts

* Make several classes static

* Use is instead of as+null check

* Use T? instead of Nullable<T>

* more static classes

* Mark locals as const

* Merge declaration and initialization of some variables

* Remove unnecessary casts

* Remove unnecessary "unsafe"s

* Simplify several lambda expressions

* Remove redundant parentheses

* Remove redundant '== true'

* Remove redundant empty lines

* Simplify boolean comparison with '== false'

* Replace if-statement with return statement

* Use while for infinite loop

* Add static to all partial static class declarations

* Use ++/-- operator instead of assignment

* Use string.IsNullOrEmpty

* Use coalesce expression

* Simplify lazy initialization

* Use coalese expression

* Join string expressions

* Use regular string literal instead of verbatim string literal

* Optimize StringBuilder.Append calls

* Remove redundant assignment

* Remove unnecessary unsafe context

* Merge processor directives

* Use String.Equals instead of String.Compare

* Use Debug.Fail instead of Debug.Assert(false

* Remove Attribute suffix

* Use predefined type

* Use compound assignment

* Use while statement to create an infinite loop

* Remove redundant base ctor call

* Avoid using catch (Exception)

* Remove empty regions

* Span comparison to null

* Avoid unnecessary boxing of value type

* Expression is always equal to 'true'

* Remove unused method

* update coalesce assignment

* fix unsafe

* fix redundant parens

* Fix whitespace errors introduced

Signed-off-by: dotnet-bot <[email protected]>
2019-09-25 20:13:47 +02:00
Egor Bogatov 39ff579432 [netcore] Disable annoying SourceLink warrnings (#17055)
Currently netcore-build doesn't need submodules (except LLVM) so a task somewhere in arcade/microsoft.build.tasks.git always complain if those are not cloned.

Set EnableSourceControlManagerQueries=false to ignore the warnings.
2019-09-25 12:28:53 -04:00
Alexander Köplinger ea6ea67351 Bump bockbuild to get recent fixes (#17054)
- https://github.com/mono/bockbuild/pull/121
- https://github.com/mono/bockbuild/pull/122
2019-09-25 16:52:42 +02:00
EgorBo 2ceb062c9b revise all X86 intrinsics 2019-09-25 14:58:53 +03:00
Alexander Köplinger aeca4a6cc3 Update System.csproj 2019-09-25 12:32:42 +02:00
Jay Krell baa9adc06a Fix comment about mono_thread_interruption_request_flag. (#17036)
Fix https://github.com/mono/mono/pull/16906/files#r327660329.
2019-09-25 12:30:27 +02:00
Ben Adams e48a285cfd Add CollectionsMarshal (dotnet/coreclr#26867)
* Add CollectionsMarshal

* Feedback

* Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-09-25 09:55:20 +02:00
Levi Broderick e082719e3f Pack additional useful data into char's "Unicode categories" RVA static info (#26848)
Also improves the performance of char.IsWhiteSpace / char.IsUpper / char.IsLower

Signed-off-by: dotnet-bot <[email protected]>
2019-09-25 07:48:24 +02:00
EgorBo ba471607a3 Implement Bmi2.MultiplyNoFlags 2019-09-25 04:04:38 +03:00
Steve Pfister da02f1330f Enable additional wasm corefx xunit tests (#16860)
Add the other corefx xunit test assemblies to the build and adjust jenkins to run them on CI.
2019-09-24 17:27:50 -04:00
Egor Bogatov 37e46aa9ae LLVM: Intrinsify MathF.Round (#16840)
* improve MathF.Round

* prefer vroundss

* enable round only for jit
2019-09-24 20:53:23 +02:00
Bernhard Urban 153b5def01 [checked-build] update allowed thread states (#16971) 2019-09-24 14:53:10 -04:00
Marius Ungureanu 394d8d1f21 Add RenamedEvent* to FSW sources from CoreFX (#16755)
* 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

* Remove old RenamedEvent* files
2019-09-24 20:49:02 +02:00
Egor Bogatov 8f85967612 Add loop related optimizations to LLVM JIT (#16436)
* Add loop-related optimizations

* Update llvm-jit.cpp

* Update llvm-jit.cpp

* Update llvm-jit.cpp
2019-09-24 20:45:32 +02:00
Egor Bogatov ed622e9112 [netcore] Implement missing Bmi1/Bmi2 intrinsics (#16919)
* Finalize BMI1

* cleanup

* Update simd-intrinsics-netcore.c

* Update simd-intrinsics-netcore.c

* fix LLVM-AOT
2019-09-24 20:44:03 +02:00
Stephen Toub c4aa67cbd9 Change several internal/private instance methods to be static (#26835)
* Replace ToLower(CultureInfo.InvariantCulture) with ToLowerInvariant()

* Mark several members static

Signed-off-by: dotnet-bot <[email protected]>
2019-09-24 20:06:06 +02:00
Jan Kotas 639f30f99b Remove IsFastSort optimizations from String (dotnet/coreclr#26759)
* Remove IsFastSort optimizations from String
- Fix bugs in the Span-based globalization fast paths. Note that some of these bug fixes are going to affect performance of the globalization fast paths.
- Use Span-based globalization fast paths for strings
- Avoid static array allocation for HighCharTable

Fixes #26758

Signed-off-by: dotnet-bot <[email protected]>
2019-09-24 20:06:06 +02:00
Maxim Lipnin f91dcb9c10 Fix time zone issue when jumping into DST (#16430)
Addresses 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 added a set of tests for some time zones to verify jumping into DST in general.

Fixes https://github.com/mono/mono/issues/16395
2019-09-24 13:58:59 -04:00
Alexander Köplinger 0a3c9c451b [ci] Make ios/mac sdks archive URL more predictable
Requested by xamarin-macios team.
2019-09-24 15:26:32 +02:00
Bernhard UrbanandAleksey Kliger 749493d4b3 [threads] clear small_id_key TLS when unregistering a thread (#16973)
* [threads] clear small_id_key TLS when unregistering a thread

Fixes
```
* thread #12, name = 'tid_a507', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1be66144)
  * frame #0: 0x1be66144 libsystem_c.dylib`__abort + 184
    frame #1: 0x1be6608c libsystem_c.dylib`abort + 152
    frame #2: 0x003e1fa0 monotouchtest`log_callback(log_domain=0x00000000, log_level="error", message="* Assertion at ../../../../../mono/utils/hazard-pointer.c:158, condition `mono_bitset_test_fast (small_id_table, id)' not met\n", fatal=4, user_data=0x00000000) at runtime.m:1251:3
    frame #3: 0x003abf44 monotouchtest`monoeg_g_logv_nofree(log_domain=0x00000000, log_level=G_LOG_LEVEL_ERROR, format=<unavailable>, args=<unavailable>) at goutput.c:149:2 [opt]
    frame #4: 0x003abfb4 monotouchtest`monoeg_assertion_message(format=<unavailable>) at goutput.c:184:22 [opt]
    frame #5: 0x003904dc monotouchtest`mono_thread_small_id_free(id=<unavailable>) at hazard-pointer.c:0:2 [opt]
    frame #6: 0x003a0a74 monotouchtest`unregister_thread(arg=0x15c88400) at mono-threads.c:588:2 [opt]
    frame #7: 0x00336110 monotouchtest`mono_thread_detach_if_exiting at threads.c:1571:4 [opt]
    frame #8: 0x003e7a14 monotouchtest`::xamarin_release_trampoline(self=0x166452f0, sel="release") at trampolines.m:644:3
    frame #9: 0x001cdc40 monotouchtest`::-[__Xamarin_NSTimerActionDispatcher release](self=0x166452f0, _cmd="release") at registrar.m:83445:3
    frame #10: 0x1ce2ae68 Foundation`_timerRelease + 80
    frame #11: 0x1c31b56c CoreFoundation`CFRunLoopTimerInvalidate + 612
    frame #12: 0x1c31a554 CoreFoundation`__CFRunLoopTimerDeallocate + 32
    frame #13: 0x1c31dde4 CoreFoundation`_CFRelease + 220
    frame #14: 0x1c2be6e8 CoreFoundation`__CFArrayReleaseValues + 500
    frame #15: 0x1c2be4c4 CoreFoundation`CFArrayRemoveAllValues + 104
    frame #16: 0x1c31ff64 CoreFoundation`__CFSetApplyFunction_block_invoke + 24
    frame #17: 0x1c3b2e18 CoreFoundation`CFBasicHashApply + 116
    frame #18: 0x1c31ff10 CoreFoundation`CFSetApplyFunction + 160
    frame #19: 0x1c3152cc CoreFoundation`__CFRunLoopDeallocate + 204
    frame #20: 0x1c31dde4 CoreFoundation`_CFRelease + 220
    frame #21: 0x1c304a80 CoreFoundation`__CFTSDFinalize + 144
    frame #22: 0x1bfa324c libsystem_pthread.dylib`_pthread_tsd_cleanup + 644
    frame #23: 0x1bf9cc08 libsystem_pthread.dylib`_pthread_exit + 80
    frame #24: 0x1bf9af24 libsystem_pthread.dylib`pthread_exit + 36
    frame #25: 0x0039df84 monotouchtest`mono_threads_platform_exit(exit_code=<unavailable>) at mono-threads-posix.c:145:2 [opt]
    frame #26: 0x0033bb84 monotouchtest`start_wrapper(data=0x1609e1c0) at threads.c:1296:2 [opt]
    frame #27: 0x1bf9b914 libsystem_pthread.dylib`_pthread_body + 128
    frame #28: 0x1bf9b874 libsystem_pthread.dylib`_pthread_start + 44
    frame #29: 0x1bfa3b94 libsystem_pthread.dylib`thread_start + 4
```

* Update mono/utils/mono-threads.c

Co-Authored-By: Aleksey Kliger (λgeek) <[email protected]>
2019-09-24 13:07:19 +02:00
Maxim Lipnin 9988ebc7f2 [System.Xml] Fix deserialization issue (#16965)
[This ](https://github.com/mono/mono/pull/11194/files#diff-ae54d9565e735005686191de0f19ed50R431-R435)change in `XmlTypeMapElementInfo.GetElement`  introduced the logic for handling the case of derived types deserialization. 
For some cases (like https://github.com/mono/mono/issues/16918) it breaks existing functionality because it returns wrong element for given element name after searching withing derived types collection.

![image](https://user-images.githubusercontent.com/3258267/65416085-bedc0500-ddff-11e9-941c-f24045c64121.png)

Unfortunately, what I can do here is just reverting the related changes.

Fixes https://github.com/mono/mono/issues/16918
2019-09-24 11:35:15 +02:00
Thays Grazia 7e6d863686 [debugger] New way to filter exceptions to support VSWin features (#16825)
* Creating a new version of MOD_KIND_EXCEPTION_ONLY to support VsWin features, discussed with Joaquin Jares.
Because we don't have this functionality of get every other exception that is not specified, VsWin was getting every exception and filtering later. But this causes a slowness during the debugger because we stop all thread on each exception that we get, even if they are caught and we don't want to stop.

* Fixing other unit test because now we have 2 nested classes.
Fixing indentation.

* Creating a flag in the MOD_KIND_EXCEPTION_ONLY protocol event and not creating a new protocol event.

* Changing what was suggested by Zoltan.

* Coding style

* Bump API snapshot submodule
2019-09-23 18:16:59 -03:00
Alexander Köplinger 9b98db9ca9 Correctly check for HAVE_STAT_BIRTHTIME in configure.ac checks for System.Native (#16999)
The check was done incorrectly, the include files need to be separated by newlines otherwise we would get a false negative result.

config.log contained this:

```
conftest.c:279:23: warning: extra tokens at end of #include directive [-Wextra-tokens]
#include <sys/types.h>, #include <sys/stat.h>
                      ^
                      //
```

This means that when doing File.GetCreationTime() we'd fall back to returning the last modified time.

It regressed when we switched to System.IO.File to the CoreFX implementation i.e. System.Native in https://github.com/mono/mono/commit/8f5cef936491e8b20888bbf18d426482c890637c.

Fixes https://github.com/mono/mono/issues/16974
2019-09-23 22:44:59 +02:00
Alexis Christoforides bc43f32c9d [merp] Use function names even in 'private crashes' mode (#16897)
Partially fixes https://github.com/mono/mono/issues/16689
2019-09-23 15:49:53 -04:00
Steve Pfister 15e939d542 Restore Previous ExecutionContext Capture Behavior (#16945)
Restores previous ExecutionContext Capture behavior where we were copying a new SynchronizationContext as opposed to a reference to the existing one.

The old behavior caused SynchronizationContextAwaitTaskContinuations to not post to a SynchronizationContext.

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

Reverts a fix for https://github.com/mono/mono/issues/12421
2019-09-23 10:52:23 -04:00
Alexander Köplinger 8db7d198b2 [ci] Fix typo in sdks-archive.groovy 2019-09-23 15:53:57 +02:00
Alexander Köplinger 93c67f2a3c [ci] Fix typo in sdks-archive.groovy 2019-09-23 15:48:43 +02:00
Alexander Köplinger 70e266a3af [ci] Fix typo in sdks-archive.groovy 2019-09-23 15:45:02 +02:00
Alexander Köplinger 6ad929c317 [ci] Build iOS/Mac Mono sdks archive using Xcode 11
This was requested by the xamarin-macios team.
2019-09-23 15:42:36 +02:00
Jo Shields 1a8cc98160 Include Mono.WebBrowser.dll in mkbundle bundles (Closes: #7454) (#16972)
* Include Mono.WebBrowser.dll in mkbundle bundles (Closes: #7454)

Because System.Windows.Forms.dll includes an assemblyref on
Mono.WebBrowser.dll, bundles need to be able to include it
in order for WinForms to work (even if they don't actually
use a browser component)

Compare:

```
$ mkbundle hellowin.exe -o hellowin --cross mono-6.0.0-ubuntu-18.04-x64 --i18n all
From: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64
ERROR: Unable to load assembly `Mono.WebBrowser' referenced by `/home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Windows.Forms.dll'
```

to

```
$ mkbundle hellowin.exe -o hellowin --cross mono-6.0.0-ubuntu-18.04-x64 --i18n all
From: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64
Using runtime: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/bin/mono
     Assembly: /tmp/hellowin.exe
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Windows.Forms.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/mscorlib.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/Mono.Security.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Configuration.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Xml.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Security.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Core.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Numerics.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Drawing.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Runtime.Serialization.Formatters.Soap.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/Accessibility.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/Mono.WebBrowser.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/Mono.Posix.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Data.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.Transactions.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/System.EnterpriseServices.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/I18N.CJK.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/I18N.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/I18N.MidEast.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/I18N.Other.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/I18N.Rare.dll
     Assembly: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/lib/mono/4.5/I18N.West.dll
systemconfig: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/etc/mono/config
machineconfig: /home/directhex/.mono/targets/mono-6.0.0-ubuntu-18.04-x64/etc/mono/4.5/machine.config
Generated hellowin
```

For the test code:
```
using System;
using System.Drawing;
using System.Windows.Forms;

public class HelloWorld : Form
{
    static public void Main ()
    {
        Application.Run (new HelloWorld ());
    }

    public HelloWorld ()
    {
        Button b = new Button ();
        b.Text = "Click Me!";
        b.Click += new EventHandler (Button_Click);
        Controls.Add (b);
    }

    private void Button_Click (object sender, EventArgs e)
    {
        MessageBox.Show ("Button Clicked!");
    }
}
```

* Also add Novell.Directory.Ldap (consumed by System.DirectoryServices)
2019-09-23 09:24:05 -04:00
Jay Krell 7497e4933c [interp] Improve debuggability with enum. (#16721) 2019-09-23 11:10:23 +02:00
Thays Grazia 1a277c31a0 [debugger] Crash when debugging iOS application that throws (#16958)
* Doing the same fix from Android to IOS.
* On mini-exceptions.c check if there is no ji we can continue and generate the exception without checking wrapper_type.

Fixes #16824
2019-09-22 16:12:10 -03:00
EgorBo 6257369adc netcore: fix debug build 2019-09-22 09:09:35 +02:00
Jay Krell aca55a42aa Inline TLS access. (#16882)
The same functions are referenced by JIT and runtime.
The JIT uses cannot be inlined. The runtime can.
Since I could not get anything else to build and the change is simple and mechanical, now two sets of functions are provided, inline and extern. Extern just calls inline.
This PR appears to change all the uses, but it is only the JIT uses. The runtime ones just work and keep the old names.

We should also consider building desktop with LTO/LTCG, which would do all this automatically, smarter, more generally. A quick experiment shows it grows the runtime size, which is why I say desktop.
2019-09-21 18:35:19 +02:00
Jay Krell b20c690e3e Partially inline mono_method_signature_checked/internal. (#16927)
* Inline common fast paths of mono_method_signature_checked and mono_method_signature_internal.

* PR: Restore profilers to use mainstream functions.
2019-09-21 11:09:41 +02:00
Bernhard Urban 0f181a9dc4 [arm64_32] fix pointer size in CallInfo (#16970)
Note that in the output below `a`, `b`, etc. are NSObjects, so they are really passed as pointer.

Before:
```
* thread #1, name = 'tid_303', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x04f301d4 aWatchOSExtension`::xamarin_localized_string_format_9(format="hello%@%@%@%@%@%@%@%@%@", a=0, b=1, c=2, d=3, e=4, f=5, g=6, h=7, i=0x00000000) at nsstring-localization.m:81:9
   78   void *
   79   xamarin_localized_string_format_9 (NSString *format, id a, id b, id c, id d, id e, id f, id g, id h, id i)
   80   {
-> 81           return [NSString localizedStringWithFormat: format, a, b, c, d, e, f, g, h, i];
   82   }
   83
   84   }
(lldb) mbt 4
* thread #1
  * frame #0: 0x04f301d4 aWatchOSExtension`::xamarin_localized_string_format_9(format="hello%@%@%@%@%@%@%@%@%@", a=0, b=1, c=2, d=3, e=4, f=5, g=6, h=7, i=0x00000000) at nsstring-localization.m:81:9
    frame #1: 0x04d9984c aWatchOSExtension`interp_to_native_trampoline + 156
    frame #2: 0x04f41d5c aWatchOSExtension`ves_pinvoke_method(frame=0x05167af8, sig=0x1518afd0, addr=(aWatchOSExtension`::xamarin_localized_string_format_9(NSString *, id, id, id, id, id, id, id, id, id) at nsstring-localization.m:80), string_ctor=0, context=0x14550960, save_last_error=0) at interp.c:1411:2 [opt]
    NSString::xamarin_localized_string_format_9 @ 68 "calli.nat" || frame #3: 0x04f3bfa4 aWatchOSExtension`interp_exec_method_full(frame=0x05167d38, context=<unavailable>, clause_args=0x00000000, error=0x05168540) at interp.c:3290:5 [opt]
```

After:
```
* thread #1, name = 'tid_303', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x04c2c1e0 aWatchOSExtension`::xamarin_localized_string_format_9(format="hello%@%@%@%@%@%@%@%@%@", a=0, b=1, c=2, d=3, e=4, f=5, g=6, h=7, i=8) at nsstring-localization.m:81:9
   78   void *
   79   xamarin_localized_string_format_9 (NSString *format, id a, id b, id c, id d, id e, id f, id g, id h, id i)
   80   {
-> 81           return [NSString localizedStringWithFormat: format, a, b, c, d, e, f, g, h, i];
   82   }
   83
   84   }
```
2019-09-20 18:02:20 -04:00
Jay Krell 12d3dcecc6 [Coop] ves_icall_property_info_get_default_value. (#16614)
This includes resolving a somewhat deep problem involving
a void* that is usually to a int/float, but can be a MonoObject** or at least MonoString**.
An additional MonoStringHandleOut parameter is pass around to address this.
Perhaps it should be MonoObjectHandleOut for more generality.
2019-09-20 17:58:16 -04:00
Bernhard Urban e27159174a [interp] avoid exception checkpoint when in thread is in GC Safe state (#16955)
[interp] avoid exception checkpoint when in thread is in GC Safe state 

Usually the interpreter operates in GC Unsafe state. There is an exception however, and that is when it executes a `managed-to-native` wrapper in cooperative (or hybrid) suspend.

The wrapper does essentially:
1. enter GC Safe state via `mono_threads_enter_gc_safe_region_unbalanced`
2. call native function
3. exit GC state via `mono_threads_exit_gc_safe_region_unbalanced`

Usually upon return of a native function call, the interpreter would check for thread interruption and, if applicable, throw an exception.  That, however, would mess with the GC state as the interpreter operates in GC Safe state at this moment.

Note that ignoring thread interruption at that point shouldn't be a problem, because after 3. the `managed-to-native` wrapper will check for thread interruption anyway.

Contributes to https://github.com/mono/mono/issues/16819
2019-09-20 22:15:55 +02:00
Alexander Köplinger 6433ea9cce [ci] Add SymStore directory for netcore publishing stage
It's required by arcade in some channels.
2019-09-20 20:06:11 +02:00
Jay Krell 8b4c1ef828 Use ld -Bsymbolic when linking AOT. (#14511)
The runtime already does this itself.
2019-09-20 13:12:01 -04:00
Alexander Köplinger 6bc988b087 [netcore] Move to new arcade post build using yaml stages (#16966)
This is required by the newer arcade builds.
We can simplify our scripts since we no longer need the special publishwitharcade.proj.

Added copyright and license to the .nuspecs since the new arcade validation now
verifies this against a set of Microsoft policies.

We also need to make the .nupkg pre-release by appending the -preview suffix as stable versions are not permitted in non-stable feeds.
2019-09-20 17:27:15 +02:00
Aleksey Kliger (λgeek) 3757a7296c [System] Make FileSystemWatcher backend non-static (#16922)
* [System] Make FileSystemWatcher backend non-static

The FileSystemWatcher `watcher` field is the backend IFileWatcher that's
supposed to be used for the actual operations.

Each backend has a `bool GetInstance (out watcher)` method that returns a
singleton object, so each new instance of FileSystemWatcher gets the same
IFileWatcher instance.  (They will get different `watcher_handle` instances
which are used by some backends to uniquely identify this FileSystemWatcher).

However when the first FileSystemWatcher instance is `Dispose`d, it will set
`watcher = null` which will prevent the remaining instances from calling

    watcher?.StopDispatching (watcher_handle);
    watcher?.Dispose (watcher_handle);

which means that the backend won't properly cleanup resources for any other FSW
instances that have other `watcher_handle` values.

Addresses https://github.com/mono/mono/issues/16709
2019-09-20 11:21:30 -04:00
Rolf Bjarne Kvinge 95d17b16a8 [offsets-tool] Install clang into the user-specific python directory.
Because the system location isn't world writeable on Catalina.
2019-09-20 16:19:32 +02:00
monojenkins c8450814a2 [bcl] Update BCL Linked Size 2019-09-20 15:02:00 +02:00
Alexander Köplinger 74b9ca426a [ci] Remove more XCODE32_DIR usages (#16964)
Follow-up to https://github.com/mono/mono/pull/16936
2019-09-20 14:00:22 +02:00
Egor Bogatov 32321375ee Implement WriteCore and ReadCore in DeflateStream (#16951)
No idea why these were left unimplemented (probably were not used at that point).
Fixes #16950
2019-09-20 12:06:45 +02:00
Alexander Köplinger 857284b412 Add net_4.8.xml to EXTRA_DIST and bump binary-reference-assemblies again
The file was missed in https://github.com/mono/mono/pull/16912.
Also pull in another reference assemblies update.
2019-09-20 11:59:51 +02:00
Filip Navara 338170ecce Fix check for SafeHandle types 2019-09-20 11:44:25 +02:00
monojenkins 6d3f5732f0 [sdks] Remove the mac32 build. (#16952)
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-19 21:45:57 -05:00
Jay Krell d49d7b4716 [Coop] InterlockedCompare/Exchange (object/T) (#16873)
* [Coop] InterlockedExchange (object and T), InterlockedCompareExchange (object and T).

 - Usually intrinsified.
 - Always?
 - Avoid coop handles by manually always using ref to object.
 - For efficiency on input, and efficiency wrt MonoError.
 - For correctness on output (due to aliasing in the wrappers).
 - To probably avoid assertion failure in runtime around icall marshaling of generics.
 - Unclear on location.

* Balance parens in prints, so they are balanced in the code.

* Reduce local arrays from 16 to auto-sized 1.

* Update and reformat System.Threading.Interlocked signature recognition.

* Rename the generic again to "_T" (or "Generic"?) on the theory
that the aot-runtime.c signature check is too strict/incorrect,
but that if we loosen it, it is not clearly specific to the generic.

* Revise corlib version again.

* Bump API snapshot submodule
2019-09-19 22:36:18 -04:00
Zoltan Varga c730a2a2e3 [llvm] Handle recursive calls as a direct call. (#16944)
Fixes https://github.com/mono/mono/issues/16943.
2019-09-19 21:43:49 -04:00
Jay Krell d02c121f79 Inline mono_thread_interruption_request_flag. (#16906)
Note that the name mono_thread_interruption_request without trailing flag
was already taken.
2019-09-19 15:49:43 -05:00
Filip Navara 81b5819528 [netcore] Show line numbers when xunit tests fail (#16931) 2019-09-19 14:08:07 -04:00
Alexander Köplinger f6a080bb79 Add .NET 4.8 reference assemblies (#16912)
Brings in https://github.com/mono/reference-assemblies/pull/20
2019-09-19 14:06:41 -04:00
Egor Bogatov 5e5033f5e5 Fix StackOverflow in ApplicationTrustEnumerator
ApplicationTrustEnumerator used to call itself. The following snippet crashed with SO:

using System.Security.Policy;
public class Program {
        public static void Main (string[] args)
        {
            ApplicationTrustCollection col = ApplicationSecurityManager.UserApplicationTrusts;
            col.GetEnumerator ();
        }
}
2019-09-19 14:05:15 -04:00
Jay Krell 06a814e66f Balance parens in prints, so they are balanced in the code. (#16930) 2019-09-19 12:19:59 -04:00
Martin Baulig 1256d6c8cf Use NetworkStream from CoreFX. (#16889)
* Use `NetworkStream` from CoreFX.

This brings the `NetworkStream` class and related tests from CoreFX.

* `SocketAsyncEventArgs`: partially replace the following properties
  with the CoreFX version: `Buffer`, `BufferList`, `Offset`, `SetBuffer ()`
  as well as the internal `CopyBufferFrom ()`.

* `SocketAsyncResult`: change `Buffer` from `byte[]` to `Memory<byte>`.

* Add internal `Socket` overloads:
   - `Receive (Memory<byte> buffer, int, int, SocketFlags, out SocketError)`
   - `ReceiveFrom (Memory<byte>, int, int, SocketFlags, ref EndPoint, out SocketError)`
   - `SendTo (Memory<byte>, int, int, SocketFlags, EndPoint)`

* Implement async task overloads from CoreFX (`Socket.Tasks.cs`) to `Socket`:
   - `int Read(Span<byte>)`
   - `Task<int> ReadAsync(byte[], int, int, CancellationToken)`
   - `ValueTask<int> ReadAsync(Memory<byte>, CancellationToken)`
   - `int ReadByte()`
   - `void Write(ReadOnlySpan<byte>)`
   - `Task WriteAsync(byte[], int, int, CancellationToken)`
   - `ValueTask WriteAsync(ReadOnlyMemory<byte>, CancellationToken)`
   - `void WriteByte(byte)`

* remove internal unused `PooledStream` and `ConnectionPool` APIs.

* bring new tests from CoreFX:
  - `System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs`
  - `System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.netcoreapp.cs`

* corlib: add `System.IO.FileSystem` and `System.Net.Sockets` resources and update SR.

* Update Socket.cs

* [csproj] Update project files

* Bump API snapshot submodule
2019-09-19 14:46:29 +02:00
Maxim Lipnin 12949cf2e6 [wasm] Switch to PNSE version of FileSystemWatcher and exclude xunit tests (#16892)
Fixes https://github.com/mono/mono/issues/16876
2019-09-19 08:13:02 -04:00
Zoltan Varga a3d05c2f88 [ci] Precompile runtime tests on the mac-sdk lane before running them with llvm. (#16916) 2019-09-19 12:58:31 +02:00
Jay Krell 8d23dc71b6 Inline mono_object_unbox_internal and mono_object_get_data. (#16856) 2019-09-19 12:41:29 +02:00
Filip Navara 85056b086f Implement Marshal.SetLastWin32Error 2019-09-19 09:59:49 +02:00
Johan Lorensson ad997d3725 Fix build warnings in libmonoruntime. (#16802) 2019-09-19 08:45:44 +02:00
Johan Lorensson 077e76c470 Explicit disable hybrid suspend when cooperative suspend is enabled. (#16798)
hybrid suspend won't get disabled when using --enable-cooperative-suspend
triggering configure error:

Hybrid suspend and Cooperative suspend cannot be both enabled.

Fix explicit set hybrid suspend default behavior to no if cooperative
suspend has been configured.
2019-09-19 08:45:00 +02:00
Ryan Lucia 529a11cf5b Make case-insensitive class lookup work correctly with exported types (#16652)
* Make case-insensitive class lookup work correctly with exported types

* Search all matching namespaces

* Skip AOT cache for case-insensitive lookups
2019-09-18 17:18:30 -04:00
Egor Bogatov 9a4a624501 [netcore] Implement more System.Runtime.Intrinsics.X86.Bmi1/Bmi2 (#16891)
* Implement more BMI1/BMI2

* implement more bmi1 intrinsics

* Update simd-intrinsics-netcore.c
2019-09-18 15:08:35 -04:00
Alexander Köplinger 2cc7c410a7 [ci] Allow running only msbuild tests in "OSX Extended" runs
Needed for mono/msbuild CI so we can skip the lengthy runtime LLVM tests.
2019-09-18 17:35:57 +02:00
Neale Ferguson 86f7cef7f4 - Some more prep for SIMD on s390x (#16903)
- Use __builtin_bswapxx for s390x rather than inline assembler
- s390x ABI specifies that %f8-%f15 are protected between calls so avoid using or save/restore as required
- Save the "protected" FP registers in the context structure
2019-09-18 15:54:27 +02:00
Vlad Brezae b2739b5196 [mini] Add missing membars when initializing rgctx entries (#16904)
[mini] Add missing membars when initializing rgctx entries

Whenever we are publishing changes to the rgctx arrays, we are racing with rgctx_lazy_fetch_trampoline, so we need to make sure any pointers we set there must have their contents initialized.
2019-09-18 09:16:17 -04:00
Jay Krell 12c48df242 All existing safepoints appear to be mooted by pinned coop handles. (#16695)
Perhaps they are never needed then.
2019-09-17 23:39:09 +02:00
Александр Хухлаев f91b64d9ad [WinForms] fix #16626 ControlBox property didn`t hide Close button and icon when set to false (#16627) 2019-09-17 14:26:05 -07:00
Alexander Köplinger e1f5738371 [netcore] Fix compiler warnings (#16883)
This fixes the compiler warnings when building netcore-only on macOS.
2019-09-17 21:18:54 +02:00
monojenkins 2b98112ce1 Rename bundle identifier for the various Mono.frameworks we create for Xamarin.iOS. Fixes xamarin/xamarin-macios#7005. (#16902)
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:18:22 +02:00
Alexander Köplinger f99acb8fa6 [corlib] Fix building nunit-lite twice (#16894)
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`.
2019-09-17 20:25:52 +02:00
Vlad Brezae 906c71b8bf [interp] Fix stack size regression (#16887)
Partly revert https://github.com/mono/mono/commit/b18840e92cb5b1afef6c0e5df05cc026eb32efbf
2019-09-17 19:27:51 +03:00
Stephen Toub 569878fe14 Remove allocations from Dns.* (dotnet/corefx#41061)
This started as an effort to reduce the size of System.Net.NameResolution.dll when publishing a trimmed app.  It's not that big to begin with, but it's carrying around a copy of all of the IAsyncResult helper types, because the Get*Async methods are currently wrappers for the Begin/End* methods.

This PR inverts that, wrapping the Begin/End* methods instead around the Get*Async methods, using the same TaskToApm helper we use in other places in corefx for the same purpose.  This makes the Get*Async methods faster and lighterweight, but it does increase the number/amount of allocation in the Begin/End* APIs.  Since these are considered legacy, I normally would consider that a good trade, however we still use these Begin/End methods in a few places in System.Net.Sockets, and I didn't want to regress those use cases.

So, this also then trims some additional fat, which helps the Get*Async cases even further, and gets the Begin/End* to be even better than before the change.  This includes not allocating an IPHostEntry when we're just going to unwrap it and return its addresses, computing the exact IPAddress[] size we need rather than using a List<> to grow it and ToArray to create the actual array, avoiding creating the HostName if we don't need it, and avoiding an unnecessary SafeHandle allocation.

As part of this, I also noticed that we had some bugs in how some of our interop structures on Windows were defined.  In particular, fields that in the native types were size_t were defined as int rather than IntPtr in the managed code.  It appears we were saved by padding, but I fixed it regardless.

And as long as I was changing pretty much everything else, where I was touching code I also cleaned up some legacy style stuff.

Signed-off-by: dotnet-bot <[email protected]>
2019-09-17 16:13:18 +02:00
dotnet-maestro[bot] a195b746c6 Update dependencies from https://github.com/dotnet/roslyn build 20190912.11 (#16885)
- Microsoft.Net.Compilers - 3.3.1-beta4-19462-11
2019-09-17 13:18:45 +02:00
Johan Lorensson e4998f5fc4 Exclude AppleTypes from orbis System.dll. (#16814)
* Exclude AppleTypes from orbis System.dll.

* [csproj] Update project files
2019-09-17 13:03:16 +02:00
Jay Krell fb71d47543 [interp] Use +=, *= etc. Seems to generate identical code though. (#16848)
i.e. a = a op b is *not* double evaluating a.
2019-09-17 13:23:19 +03:00
Ryan Lucia 6252794ebe Temporarily disable embedded ppdb data decompression (#16868)
This addresses #16373. We will work on a proper fix, but this at least unblocks Roslyn CI
2019-09-17 11:23:05 +02:00
Bernhard Urban 578e1a9dda [arm64_32] make "Debug Mode" work on Watch series 4 with --interpreter (#16865)
[arm64_32] make "Debug Mode" work on Watch series 4 with --interpreter

Main objective for reviewers: This PR shouldn't change anything for `arm64`.

Context: "Debug Mode" on the Apple Watch allows execution of regular machine code and thus is pretty similar to FullAOT on iPhone, i.e. it doesn't require bitcode, but _still_ doesn't allow `signal(3)` so cooperative suspend is required.

Apple Watch Series 4 and onward use an ARM64 chip, but with a different ABI, also known as `arm64_32`. This PR changes the AOT compiler and related trampolines so that the AOT compiler can generate all necessary code to run the interpreter on this target.


Changes:

--------------------------------------

[arm64_32] set register size to 8 in cross compiler too 

-----------------------------------------

 [machine] update `target_mgreg_t` definition

`SIZEOF_REGISTER` is usually the same as `TARGET_SIZEOF_VOID_P`, except when `MONO_ARCH_ILP32 is defined.

`target_mgreg_t` should represent the width of the hardware register, that is, `SIZEOF_REGISTER`.

---------------------------------------------

[arm64_32] fix AOT image layout 

---------------------------------------------

 [arm64_32] make trampolines bitwidth aware

* replace pointer loads/stores with bitwidth-dependent macro
* reflect `specific` trampolines so that only two instructions are used for ILP32, since the related pair in the data page only needs 2 * 32bits too
* replace some `sizeof (target_mgreg_t)` with `TARGET_SIZEOF_VOID_P` (former is hardware register size, latter is pointer size)

---------------------------------------------
These regression tests are _not_ passing: https://github.com/mono/mono/issues/16864 Also some of monotouch-tests are crashing, see https://github.com/mono/mono/issues/16819

Here is a screenshot of a debug session in VSMac:
<img width="1321" alt="Screenshot 2019-09-16 at 19 13 22" src="https://user-images.githubusercontent.com/75403/64981326-1dfbc000-d8bc-11e9-9d16-48036f36b638.png">


Contributes to https://github.com/mono/mono/issues/10641
2019-09-17 05:15:19 -04:00
Nikolay Sivov 08521a1c43 [cominterop] Default to [in] parameter direction when not specified explicitly.
Treat [In, Out], [In] and unspecified as input arguments. Important change from
current behavior is to allow parameter without directional attributes.

Use case example is _MethodInfo.Invoke() method called from native client.
2019-09-17 11:06:17 +02:00
Jay Krell af185d2c1e [interp] Cleanup dispatch macros. (#16784)
- Factor out reptition into already existing macros.
 - Remove the default for computed goto which is dead.
   Computed goto has no notion of default. It is just
   an unchecked array access.

Extracted from https://github.com/mono/mono/pull/16721.
2019-09-17 10:55:45 +02:00
monojenkins 16ed5ec3aa [csproj] Update project files 2019-09-17 10:53:46 +02:00
Radek Doulik e7f3db9796 [android sdk] Add aprofutil tool 2019-09-17 10:53:46 +02:00
Zoltan Varga 1031c4650d [llvm] Use IntPtrType () for byref arguments instead of a pointer, the latter causes problems when pointer operations are used along with phi nodes. Fixes https://github.com/mono/mono/issues/16808. (#16874) 2019-09-17 03:53:52 -04:00
Vlad Brezae aaaa2bdd5e [interp] Optimize multidimensional array access (#16822)
* [interp] Pass rank instead to LDELEMA

It feels more intuitive and uses less computations.

* [interp] Avoid unnecessary type check

Loading element address of array requires type checks only if the elements of the array are references.

* [interp] Avoid using MINT_CALLRUN for Get intrinsic

It is very slow. Use ldelema/ldobj pair instead.

* [interp] Optimize MINT_LDELEMA

* [interp] Rename ldelema_fast to ldelema1

ldelema_fast was handling arrays with a single dimension. Rename it to better suggest this.

* [interp] Avoid using MINT_CALLRUN for Set intrinsic

* [interp] Remove some duplicated and confusing code

* [interp] Fix stack type of MINT_NEWARR result
2019-09-17 10:32:20 +03:00
Stephen Toub 87072b55c0 Update typo in comment in CultureInfo.cs
Signed-off-by: dotnet-bot <[email protected]>
2019-09-17 09:19:11 +02:00
Tarek Mahmoud Sayed 77473d11b7 Fix calendar instance inside the culture after cloning (#26721)
When creating a new culture, we’ll have the equality CultureInfo.DateTimeInfo.Calendar == CultureInfo.calendar be true. After cloning such culture, this equality would not be true. The fix here is to ensure if the equality is true before cloning then should be true after cloning.

Signed-off-by: dotnet-bot <[email protected]>
2019-09-17 09:19:11 +02:00
Zoltan Varga 38b2d4f4fe [wasm] Bump emscripten to 1.38.45. (#16871) 2019-09-16 23:37:30 -04:00
Johan Lorensson e8570d9500 Fix warnings in eglib gspawn.c on platforms lacking fork/execv. (#16801) 2019-09-16 17:18:59 -04:00
Filip Navara 17fe4757a3 [netcore] Make Environment calls thread-safe (#16852)
* [netcore] Make Environment calls thread-safe

* Address PR feedback

* Address PR feedback
2019-09-16 17:16:14 -04:00
Ryan Lucia a23da4b8b3 [debugger] remove extraneous ErrorCode declaration (#16862)
With the single point of exit, this means the main ErrorCode isn't being written to and uninitialized memory is returned.
2019-09-16 17:14:42 -04:00
Zoltan Varga 422d559ea4 [wasm] Initial netcore support. (#16718)
* [runtime] Fix configure support for netcore+out of tree builds. Add wasm support for generating netcore/config.make.

* [runtime] Add bundle support for the netcore assembly loader.

* [netcore] Add missing linker exclusion.

* [wasm] Add netcore builds, enabled by defining ENABLE_WASM_NETCORE in Make.config.

The targets are 'package-wasm-runtime-netcore' and 'package-wasm-bcl-netcore'.
The binaries are copied to out/wasm-runtime-netcore-<CONFIG> and out/wasm-bcl/netcore.

* [wasm] Add netcore support to the build system and packager.

* Fix the build.

* Fix the dynamic build.
2019-09-16 15:42:57 -04:00
Kenneth Pouncey e8b2b43f9b Bump sdk and bindings versions (#16809) 2019-09-16 09:34:41 -05:00
Kenneth Pouncey d435a85658 Bump Browser tests Karma version (#16810) 2019-09-16 09:31:44 -05:00
Nikolay Sivov 800e2cc4b4 [corlib] Improve reflection interface definitions (#16324)
* [corlib] Fix _Type interface definition.

* [corlib] Fix Type class attributes.

* [corlib] Fix _MethodInfo interface definition.

* [corlib] Fix MethodInfo class attributes.

* [corlib] Merge MethodInfo partial definitions.

* [corlib] Remove leftovers from testing.

* [corlib] Do not define new attributes for MOBILE build.

* Bump API snapshot submodule

* [corlib] Add explicit _MethodInfo.GetType() implementation.

* Bump API snapshot submodule

* [csproj] Update project files
2019-09-16 13:00:40 +02:00
Jay Krell 9f3effc177 Strike a size and conditional branch balance between (#16836)
https://github.com/mono/mono/pull/16835
and
 https://github.com/mono/mono/pull/16834

The main 4 call opcodes should have no conditionality here.
The non-virtuals no extra branch.
The other opcodes all have one condition and branch into common code.

Everything could be smaller or faster but not both.
2019-09-16 10:10:47 +03:00
Jay Krell 67fb575d11 [Coop] ParseRouteInfo, fix some leaks, cleanup. (#16815) 2019-09-16 00:10:12 -04:00
Johan Lorensson 7fa706a316 Fix infrequent hangs in test-runner. (#16793)
* Fix infrequent hangs in test-runner.

test-runner has been plagued with very infrequent hangs causing long
timeouts on CI. Turns out that there is a race in AsyncStreamReader
used by Process class for handling stdout/stderr when closing down
process. Since AsyncStreamReader::Dispose didn't make sure no pending
async read requests were still in flight before closing the stream
and underlying handle, it led to a race condition deadlocking the
complete process, hanging test-runner. A similar race has also been
observed but instead of causing a deadlock, it could also manifest as an
System.ObjectDisposedException when doing EndRead while another thread
is disposing the underlying stream. Hitting that race didn't deadlock
the process but failed to complete invoke of test-runner.

Fix is to better protect the async callback and the thread doing the
dispose call. In order to make sure we don't close underlying handle
while still having async reads in flight, fix also checks async result
for completion and if not completed when trying to dispose AsyncStreamReader
it will try to cancel outstanding pending IO and wait for completion
before closing the stream.

Since the issue has only been seen on Windows, the fix will try
to cancel pending IO and wait for completion before closing stream
on Windows. On other platforms, old behavior will be preserved, meaning
that the implementation will still be vunarable to race between pending
reads and close of stream, but since problem has not been observed on
other platforms and since there is no good way of cancel outstanding
blocking reads, old behavior is kept.

At some point in future we should look into replacing the implementation
of AsyncStreamReader and use cancelation tokens, but since we don't have
all corefx support around cancelation in Mono BCL, that currently won't
solve the issue, meaning that we need to bring in more classes. Since the
problem also occur in test-runner using the build BCL profile, even more
needs to be added to that profile in order to get similar support. But due
to the infrequency of the problem and that it has only been observed on
Windows, the isolated fix seems more reasonable.

* Build error fix.

* Review feedback.

* Fix type cast not working on linux builds.

* Adjust icall naming in icall-def.h.
2019-09-15 19:51:07 -05:00
Jay Krell 8da3616e7f [Coop] GetValueInternal. (#16811) 2019-09-15 19:50:25 -05:00
Johan Lorensson 9249d38079 Fix warnings in libmono. (#16813) 2019-09-15 19:49:53 -05:00
Zoltan Varga cdb04c042f [netcore] Change an ArrayList to a List<T>. (#16842)
* [netcore] Change an ArrayList to a List<T>.

* [netcore] Call the generic version of Array.IndexOf () in the ICollection wrappers. Update exclusions file.
2019-09-15 20:45:13 -04:00
Egor Bogatov 0438397b8a LLVM: Dump Module instead of Function in JIT mode (#16837)
Since each function has its own module (in JIT mode) it makes sense to dump the whole module for MONO_VERBOSE_METHOD instead of just LLVM::Function.
It adds metadata, attributes and global variables (so it will be possible to copy-paste it to godbolt)

Example

static int Test(int x)
{
    return x / 10;
}

Diff for Unoptimized IR: https://www.diffchecker.com/NrF413Ts
Diff for Optimized IR: https://www.diffchecker.com/jbEkeFFS

So now we can see global variables and metadata for each function (and can easily paste them to godbolt.org)

NOTE: optimized IR for this case contains "dead" variables (dump_module allowed us to see such), we probably need some Module-wide optimizations to strip dead code such as -globaldce

NOTE2: why do we emit exceptions in the first place for this case at all?
2019-09-15 20:43:10 -04:00
Jay Krell 304f3add20 [interp] Speed up passing this parameter. (#16846) 2019-09-15 22:26:41 +03:00
Dotnet-GitSync-Bot 189af5d0c2 Remove some boxing from tuples with >= 8 elements (dotnet/coreclr#26584) (#16844)
Take advantage of https://github.com/dotnet/coreclr/pull/14698 to avoid boxing the TRest argument and improve devirtualization.

Signed-off-by: dotnet-bot <[email protected]>
2019-09-15 12:48:15 -04:00
Calvin Buckley babe881bf2 Fix small sized argument output with tracing enabled (#16841)
This is a legacy of before the profiler was used for the trace
output; it would apparently get the raw stack pointer and try to
dereference things by recalculating the offset as needed (no for
little, yes for big). However, because the profiler returns the
actual fixed-up pointer, this recalculation isn't needed on BE,
but instead grabs garbage a bit ahead on the stack.

To fix, use what was the little endian case unconditionally.

Example before:

[1: 20.70598 14] ENTER: System.Globalization.CultureInfo:.ctor (int,bool,bool)(this:700000000408fb0[System.Globalization.CultureInfo platform.exe], 271824864, -32, -32, )

Example after:

[1: 1.93377 14] ENTER: System.Globalization.CultureInfo:.ctor (int,bool,bool)(this:700000000408fb0[System.Globalization.CultureInfo platform.exe], 127, 0, 1)
2019-09-15 11:50:32 -04:00
Jay Krell 9608debd7b [Coop] ves_icall_InternalExecute. (#16611) 2019-09-13 08:57:45 -05:00
Radek Doulik 131b3a9a92 [aot] Do not wrap tool_prefix path when calling strip (#16792)
[aot] Do not put quotes around wrapped path

Should fix: https://github.com/xamarin/xamarin-android/issues/3619

As it results in double quoting, which vanishes the effect and breaks
AOT for XA on Windows.

The actual error:

    [aot-compiler stdout] Stripping the binary: ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Stable\MSBuild\Xamarin\Android\ndk\arm-linux-androideabi-"strip" --strip-symbol=\$a --strip-symbol=\$d obj\Release\90\aot\armeabi-v7a\libaot-Xamarin.Android.Arch.Core.Common.dll.so.tmp
    [aot-compiler stderr] '""C:\Program' is not recognized as an internal or external command,
    [aot-compiler stderr] operable program or batch file.
    [aot-compiler stderr] AOT of image C:\Users\peter\source\repos\App9\App9\App9.Android\obj\Release\90\android\assets\Xamarin.Android.Support.CoordinaterLayout.dll failed.
2019-09-13 09:05:27 -04:00
Filip Navara 10e72a7ab6 Improve alias analysis for pointer sized variables (#16812) 2019-09-13 08:02:50 -05:00
Vlad Brezae 6908a1941b [interp] Propagate locals and kill dead ones afterwards (#16791)
* [interp] Add flag for locals that have their address taken

The previous handling of LDLOCA was broken because if the address was taken before the instructions that would be optimized we would miss any potential changes to the local value. Right now we just skip optimizing locals that have their address taken. This is achieved simply by not pushing LDLOC on the evaluation stack, for those locals.

* [interp] Add separate counters for optimized instructions

To provide more insight.

* [interp] Propagate locals

Whenever we generate a movloc we remember what local was copied. When loading a local we check if it's currently storing the value of another local, in which case we load the original local instead.

* [interp] Kill instructions that write to dead locals

We track the liveness of a local by counting how many times the local is loaded using ldloc. When such instructions are optimized, the ldloc counter is updated accordingly.

* [interp] Don't optimize code if under debugger
2019-09-13 10:35:44 +03:00
Jay Krell 735b2cd20c [interp] Replace frame_objref with a volatile store to local. (#16790)
* [interp] Replace frame_objref with volatile stores to non-volatile locals.
Non-volatiles subject to volatile read/write still get stack-packed.
Volatiles do not.

This will possibly conserve stack, unless MINT_NEWOBJ_FAST is critical path.
 It looks like it is -- enabling this for Linux/gcc/amd64 grows
  frame from 0x98 to 0xA8.

In either case, it is more efficient as the reads do not have to be volatile.
The value can be on the stack and in registers. The stack value will pin it.

* PR: Comments.

* PR: Rearrange comment for correctness, same length.
2019-09-12 21:39:02 -05:00
Maxim Lipnin fe19944155 [ci][wasm] Use only V8 step to run corlib tests, which can reduce build time 2019-09-12 19:32:01 -05:00
Vlad Brezae aa18379968 [interp] Add percentage to opcode count stats 2019-09-12 19:29:13 -05:00
Vlad Brezae 6d75b066ee [interp] Disable computed goto when debugging interp
It makes tracing and following the code more painful.
2019-09-12 19:29:13 -05:00
Vlad Brezae 54a7e61115 [interp] Fix COUNT_OPS
And make it print the sorted opcode counts when runtime is shutting down
2019-09-12 19:29:13 -05:00
Next Turn 9f93d5d15c Modernize Array constructor (dotnet/coreclr#26684)
Signed-off-by: dotnet-bot <[email protected]>
2019-09-12 19:27:58 -05:00
naricc bfe5e1efd3 Merge pull request #16388 from naricc/naricc/GetTotalAllocatedBytes
Naricc/get total allocated bytes
2019-09-12 18:12:26 -04:00
Jay Krell b2a1c6cd92 [Coop] Debugger single point of exit. (#16620)
* [Coop] Debugger single point of exit.
Extracted from https://github.com/mono/mono/pull/16614.

* Use a label per error for code size.
2019-09-12 17:57:02 -04:00
Sung Yoon Whang 3f26b9aa6c Improve the performance of Environment.WorkingSet in Windows (#26522)
* Use win32 api directly for workingset counter

* Fix build warnings

* Removing useless code

* more cleanup

* remove size annotation

* remove useless comment

* Move all the changes to Environment.WorkingSet and remove it from RuntimeEventSourceHelper

* removing useless usings

* Use kernel32.dll instead of psapi.dll

* Code review feedback

* Remove newline change

* More code review nits

Signed-off-by: dotnet-bot <[email protected]>
2019-09-12 13:27:35 -05:00
Jan Kotas 0055195d1c Change Vector<T> to use more compact code using S.R.CS.Unsafe (#26637)
S.R.CS.Unsafe is used in number of places in Vector<T> already. This change modifies more places to use it to make the code more compact.

Updated Vector.tt template to match while I was on it

Signed-off-by: dotnet-bot <[email protected]>
2019-09-12 13:27:35 -05:00
Marek Safar 43c5aa0dad Remove unused Memcpy methods from shared Buffer implementation (#26586)
Signed-off-by: dotnet-bot <[email protected]>
2019-09-12 13:27:35 -05:00
obligaron 1b48b44661 Improve logging for EventSource.WriteEvent parameter mismatch (#25533)
* improve logging for EventSource.WriteEvent

* Fix IndexOutOfRangeException in SerializeEventArgs when incorrect arguments got passed

* simplify arg-check; remove nullable-todo

* switch from Debugger.Log to ReportOutOfBandMessage

* Remove unused flush-Paramater from ReportOutOfBandMessage

* fix parameter type nullable-check for reference-types

* fix parameter type nullable-check for nullable-types

Signed-off-by: dotnet-bot <[email protected]>
2019-09-12 13:27:35 -05:00
Vlad Brezae 72405f68af [interp] Emit more stloc.np (#16796)
Use STLOC_NP_O also for MINT_TYPE_P. It has the same behavior.
2019-09-12 12:46:22 -05:00
Filip Navara 017f21c2c6 [mini] Fix couple of R4 constant folding checks (#16782)
* Fix couple of R4 constant folding checks

* Address feedback

* Split RMOVE and FMOVE
2019-09-12 12:37:52 -04:00
Jay Krell 9bb3912590 [interp] Remove unused parameters. (#16773) 2019-09-12 15:42:23 +03:00
Jay Krell c7df01524a [interp] Add assert in jmp that sp == stack at start. (#16788)
It makes it true sometimes, only if not calling alloca.
Throwing invalid IL if false might be preferred here.
2019-09-12 15:06:31 +03:00
Egor Bogatov 977a37844b [netcore] Add LLVM to nuget (#16524)
* nuspec for llvm

* Add llvm to matrix

* fix scripts/ci/pipeline-netcore-runtime.yml

* fix scripts/ci/pipeline-netcore-runtime.yml

* fix scripts/ci/pipeline-netcore-runtime.yml

* run tests with llvm

* add macOS lane

* disable llvm tests for now
2019-09-12 13:09:03 +02:00
Maxim Lipnin c241b25bb5 Avoid creating un-representable DateTime for transition point (#16753)
Fixes https://github.com/mono/mono/issues/16742
2019-09-12 05:11:22 -04:00
Steve Pfister 95cd0e74b1 Bump to mono/corefx@e79cf5b 2019-09-12 08:57:15 +02:00
EgorBo 1d324e617a Fix DynamicMethodToString.ToStringTest 2019-09-12 08:55:12 +02:00
EgorBo 313ce184be use full name for llvm ir and asm dumps 2019-09-12 08:55:12 +02:00
Jay Krell 2235e37470 [interp] Fix buffer overreads and overwrites found by valgrind. (#16726)
* [interp] Fix buffer overreads and overwrites found by valgrind.

* Attempt to deal with inlining correctly.

* PR: Dial back IR changes. Only IL relevant.

* PR: Dial back more -- only needed changes to .NET IL manipulation, not interpreter IR manipulation.

* PR: Remove one more line.
2019-09-11 19:35:05 -05:00
Zoltan Varga 6a1ac97dc7 [netcore] Create a separate version of threadpool.c for netcore with the domain support removed. (#16250)
* [netcore] Create a separate version of threadpool.c for netcore with the domain support removed.

* Fix the windows build.

* Fix the build.
2019-09-11 20:04:44 -04:00
Maxim Lipnin a67212d34c [wasm] update run-jenkins.sh (#16771)
* replaced set of run-*-mini targets with more common run-all-mini one;
* removed redundant run-v8-corlib (there is run-all-corlib)
2019-09-11 15:28:07 -04:00
Nathan Ricci 4acfcef038 White space, naming convetions. 2019-09-11 14:43:06 -04:00
Nathan Ricci b88d67d564 White space issues, typos. 2019-09-11 14:28:16 -04:00
Jay Krell f4c1358ed0 [interp] Reduce register pressure in endfinally.
Eventually this could contribute to stack savings. On its own, nothing.
The compiler apparently likes to create temporaries, like ip and ip - 1.
Which then have to survive functions calls, on the stack, if nonvolatile registers are exhausted.
This combats that and in a larger PR helped.
2019-09-11 11:19:44 -05:00
Steve Pfister 5ad1d62367 Use an init-tools script to install a local dotnet for wasm. (#16688)
Similar to what we use in netcore
2019-09-11 09:14:05 -04:00
Zoltan Varga feb0b4ab9a [wasm] Add a separate test for profiled aot. 2019-09-11 07:44:34 -05:00
Zoltan Varga 52d24a57d2 [aot] Emit interp entry code for methods which are not AOTed when using AOT profiling. Also emit most wrappers. 2019-09-11 07:44:34 -05:00
Radek Doulik 52aa2cd3e1 [aprofutil] Add -p and -f options (#16766)
-p PORT allows easier retrieval of AOT profile from the application
 running with aot profiler, using the socket connection on local PORT

-f instructs the tool to try setup adb port forwarding to/from Android
 device or emulator

Example usage, retrieve the AOT profile from Android:

    > mono aprofutil.exe -s -v -f -p 9998 -o my.aprof
    Calling 'adb forward tcp:9998 tcp:9998'...
    Reading from '127.0.0.1:9998'...
    Read total 94903 bytes...
    Summary:
    	Modules:          6
    	Types:          262
    	Methods:      1,162
    Going to write the profile to 'my.aprof'
2019-09-11 07:42:58 -05:00
Tarek Mahmoud Sayed f97ceb5c3e Fix Running .NET Core Under Windows App Compat Shim (dotnet/coreclr#26605)
* Fix Running .NET Core Under Winndows App Compat Shim

.NET Core uses Windows features called sort handles for perf reason to speed up the collation operations (e.g. string comparisons). When enabling Windows app compat shim (e.g. Windows 7 compatibility mode), the calls uses sort handles will fail which cause all collation operations to fail.
The fix here is to detect if the sort handles work before using it to ensure successful run.

* Address the feedback

* More feedback addressing

Signed-off-by: dotnet-bot <[email protected]>
2019-09-11 09:05:40 +02:00
Zoltan Varga 2e78f0c739 [wasm] Add missing aot-profile/runtime.js. (#16762)
* [wasm] Add missing aot-profile/runtime.js.

* [aot] Avoid writing out a zero AOTID in deterministic mode.

* [wasm] Add --aot-profile= option to packager.
2019-09-10 22:24:40 -04:00
Vlad Brezae f1a57de621 [docs] Improve sgen write barrier documentation (#16761) 2019-09-10 20:54:07 -05:00
Zoltan Varga a0ed95fc98 Enable the wasm targets even if ENABLE_WASM is not defined. (#16747) 2019-09-10 20:53:25 -05:00
Larry Ewing b26fd07ff9 [msbuild][roslyn] Bump msbuild and roslyn to pull in new versions (#16744) 2019-09-10 20:30:11 -05:00
Kenneth Pouncey 0847a6d218 [wasm] Dynamic Release RUNTIME configuration (#16749)
* Modify configuration flag `ENABLE_WASM_DYNAMIC_RUMTIME` to `ENABLE_WASM_DYNAMIC_RUNTIME`

* Modify configuration flag `ENABLE_WASM_DYNAMIC_RUMTIME` to `ENABLE_WASM_DYNAMIC_RUNTIME`

* Modify configuration flag `ENABLE_WASM_DYNAMIC_RUMTIME` to `ENABLE_WASM_DYNAMIC_RUNTIME`
2019-09-10 18:04:08 -05:00
Zoltan Varga 697ab15c12 [netcore] Disable more features. (#16748) 2019-09-10 15:36:29 -04:00
Larry Ewing 4790582812 [wasm] test cleanup (#15727)
* [wasm] stop excluding test_0_large_nullable_invoke on wasm

* [wasm] remove wasm exclusion from test_0_simple_double_casts

* Add category MultiThreaded to more of the concurrent collection tests

* Add more MultiThreaded annotations to HttpListener2Test

* Add category MultiThreaded to HttpWebRequestTest

* [wasm] flag more tests that are taking down the runtime

* [wasm] force sockets to throw PNSE in the ctor for now

* [wasm] enable corlib interpreter tests

* [wasm] Increase timeout for corlib tests

* try to fix wasm-cross-win-release-configure on macos
2019-09-10 13:08:58 -04:00
Maxim Lipnin e78ab0b1c0 [wasm] Fix several typos (#16760)
* [wasm] Fix several typos

* add a comment about an error in test class name

* Remove the comment about test class name because it could be passed on xunit command line
2019-09-10 12:36:13 -04:00
Bernhard Urban 68f5613422 [TermInfoDriver] update top/left value on Console.{CursorTop,CursorLeft} access (#16745)
It can be outdated due to writes to `stdout`.

Fixes https://github.com/mono/mono/issues/16701
2019-09-10 17:17:15 +02:00
Kenneth Pouncey eea1ab5994 Remove extraneous -s from EMCC_DEBUG_FLAGS (#16754) 2019-09-10 13:50:20 +02:00
Marek Safar 9894bfa6fa Update tests exclusion 2019-09-10 13:09:56 +02:00
Stephen Toub b434981755 Remove use of WeakReference from corelib (dotnet/coreclr#26597)
Only remaining use is the one place it shows up in public API, in GC.GetGeneration(WeakReference).

Signed-off-by: dotnet-bot <[email protected]>
2019-09-10 13:09:56 +02:00
Tyler Brinkley 05d4f301e9 Make StringComparer.Create throw ArgumentNullException (#26570)
* Make StringComparer.Create throw ArgumentNullException

Throws proper exception.

* Update CoreFX.issues.rsp

Signed-off-by: dotnet-bot <[email protected]>
2019-09-10 13:09:56 +02:00
Stephen Toub 5f9d09bc90 Remove remaining ToLower() use from corelib (dotnet/coreclr#26602)
Also happens to save a string allocation, but that's a drop in the bucket in this function.

Signed-off-by: dotnet-bot <[email protected]>
2019-09-10 13:09:56 +02:00
Stephen Toub 3c503413e0 Remove sub-array allocation from GetManifestResourceNamesList (#26601)
Also removes dependency on System.Range and RuntimeHelpers.GetSubArray in a simple console app such that they can be trimmed away.

Signed-off-by: dotnet-bot <[email protected]>
2019-09-10 13:09:56 +02:00
Marek Safar 96b7fead33 [netcore] Update System.Private.CoreLib public APIs 2019-09-10 12:11:31 +02:00
Bernhard Urban e40e24b4cd [aot] move method_addresses to data.rel.so section to avoid text relocations (#16729)
[aot] move method_addresses to data.rel.so section to avoid text relocations

Another revert of a revert! 🎉 

After some discussions with @grendello and @radekdoulik, we came up with this solution. It's a better attempt to fix https://github.com/mono/mono/issues/16369 as it (1) works within the restrictions of Android 10 and (2) still works for armv7 AOT. 


`.text` relocations aren't allowed in Android 10 (and this change shouldn't hurt on Linux).

AOT compilation:
```console
$ MONO_PATH=/Users/lewurm/Downloads/xamarin.android-oss-v10.0.99.136_Darwin-x86_64_pr_766265b9-Debug/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/ \
MONO_ENV_OPTIONS="" \
./sdks/out/android-cross-arm-release/bin/armv7-linux-android-mono-sgen \
--aot=keep-temps,outfile=here.dll.so,asmwriter,mtriple=armv7-linux-gnueabi,tool-prefix=/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-,ld-flags= \
~/Downloads/xamarin.android-oss-v10.0.99.136_Darwin-x86_64_pr_766265b9-Debug/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0/Mono.Android.dll

Mono Ahead of Time compiler - compiling assembly /Users/lewurm/Downloads/xamarin.android-oss-v10.0.99.136_Darwin-x86_64_pr_766265b9-Debug/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0/Mono.Android.dll
AOTID 7DDD05DA-37E0-813A-8C27-3E1634391BB3
Compiled: 144382/144382
Executing the native assembler: "/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ.o /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ
Executing the native linker: "/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld"  -shared -o here.dll.so.tmp  /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ.o
Stripping the binary: "/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d here.dll.so.tmp
Retained input file.
JIT time: 15031 ms, Generation time: 7374 ms, Assembly+Link time: 75130 ms.
```

Before:
```console
$ grep -C 6 'method_addresses:' /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ
        .align 3
jit_code_end:

        .byte 0,0,0,0
.text 1
        .align 3
method_addresses:
        .local method_addresses
        .type method_addresses,#function
ldr pc,=.Lm_0
.ltorg
ldr pc,=.Lm_1
.ltorg
$ arm-linux-androideabi-readelf -a here.dll.so | grep -i textrel
 0x00000016 (TEXTREL)                    0x0
 0x0000001e (FLAGS)                      TEXTREL
```

After switching to `.data.rel.so`:
```console
$ grep -C 6 'method_addresses:' /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_1YhAgn  # assembly file produced by AOT compiler
jit_code_end:

        .byte 0,0,0,0
.section ".data.rel.ro"
.subsection 0
        .align 3
method_addresses:
        .local method_addresses
        .type method_addresses,#object
ldr pc,=.Lm_0
.ltorg
ldr pc,=.Lm_1
.ltorg
$ arm-linux-androideabi-readelf -a here.dll.so | grep -i textrel
$ echo $?
1
```
2019-09-10 04:16:07 -04:00
Marek Safar e819930ea2 Disable failing tests 2019-09-10 10:03:42 +02:00
Stephen Toub cfc7988318 Replace HashHelpers.Combine with HashCode.Combine (dotnet/coreclr#26589)
* Replace HashHelpers.Combine with HashCode.Combine

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-09-10 10:03:42 +02:00
Jérôme Laban 11f75e5260 [Wasm] Restore release-dynamic configuration (#16655)
* [Wasm] Restore release-dynamic configuration

* Add conditional dynamic linking support, update documentation
2019-09-09 17:21:51 -04:00
Nathan Ricci f7dcc20bc6 Refactored where the varaibles for allocation count live. 2019-09-09 16:39:51 -04:00
Zoltan Varga f5d43ad341 Enable the wasm targets even if ENABLE_WASM is not defined. Update README. (#16743) 2019-09-09 16:37:05 -04:00
Thays Grazia 055818f344 Vtable [i] can be null so this should be check before use it. (#16733)
Fixes #16712
2019-09-09 17:07:34 -03:00
Maxim Lipnin ba2bb209ba [wasm] update build.sh (#16737) 2019-09-09 12:37:54 -05:00
Jay Krell 83f965eca5 [interp] Let compiler decide clear_resume_state inlining. (#16704)
Manual inlining shows no additional stack use any longer.
2019-09-09 12:31:37 -05:00
Zoltan Varga 798af66137 [llvm] Mark Vector128/Vector256 types as SIMD.
These are not currently supported, but marking them as simd helps llvm eliminate dead variables with these types, since
XZERO is easier to eliminate than VZERO.
2019-09-09 19:09:29 +02:00
dotnet-maestro[bot] e563d3c76c Update dependencies from https://github.com/dotnet/arcade build 20190906.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19456.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19456.2
2019-09-09 19:03:51 +02:00
Nikolay Sivov 8590a25b30 Default to SAFEARRAY(VARIANT) as CCW argument for object[]. (#16673)
* [cominterop] Add a helper to create default marshal spec for ccw arguments.

* [cominterop] Default to SAFEARRAY(VARIANT) as CCW argument for object[].

* [cominterop] Fix build with --enable-cxx.
2019-09-09 19:02:46 +02:00
Jay Krell 1f76ab9270 [interp] Embrace that ip is const guint16* and remove casts to that type, (#16708)
[interp] Embrace that ip is const guint16* and remove casts to that type.

or to gint16*. Or is there a reason for this style?

Maybe could change type but still want to cast for the deref?
2019-09-09 11:06:16 -04:00
Vlad Brezae b9dbd2ff91 [interp] Defer local offset allocation to compacted emit phase (#16714)
Before this commit, the only information associated with a local was just the offset at which it resides and instructions had this offset embedded from the start. This makes it awkward to have data structures indexed on the local, or have additional information per local, which we might care at some point (for example if it is multi basic block local, if the address of the local was taken etc). In addition to this, if we will want to remove some instructions that make some locals dead, it means that we will have to compact the whole locals space and update all the offsets referenced by all instructions. We solve all these problems by resolving (and allocating) the local offset at the latest time, while emitting the instruction in the compacted byte stream. At this point dead locals will remain dead, with no additional work needed to handle them.

For now, IL locals of the current method that we are compiling are immortal. We can address that later if needed.
2019-09-09 17:10:50 +03:00
Filip Navara 320f91129d [netcore] Tweak inlining heurestic for memcpy 2019-09-09 10:56:20 +02:00
David Karlaš 13391beeed Fix Xaml reader to parse escaped values correctly 2019-09-09 10:05:57 +02:00
Michal Strehovský d81ec88406 Mark unsafe intrinsics as reflection blocked
Keeping these reflection enabled pulls in quite a bit of junk (generic dictionaries, standalone method bodies, bookkeeping) that adds up to 1.5% of the size of Hello World...

Signed-off-by: dotnet-bot <[email protected]>
2019-09-09 09:24:01 +02:00
Filip Navara cf2c8575e1 [netcore][x64] Implement lowering of new SIMD OPs into SSE opcodes (#16672)
* [netcore][x64] Implement lowering of new SIMD OPs into SSE2 or SSE4.1 opcodes.

* Implement LZCNT/POPCNT in mini JIT

* Fix C++ build
2019-09-08 14:57:21 -05:00
Stephen Toub e15efa37b7 Fix race conditions in CultureInfo.GetCultureInfoHelper (#26567)
The implementation reads the current value of the static cache field and then later overwrites that field with the originally read value.  If ClearCachedData was called in the interim to clear the cached data, this will end up effectively undoing part of that clearing, as it'll end up restoring the previous cache. The fix is to write back the new reference only when we need to, which we could do when we detect it's null.

There's a secondary race condition this fixes as well.  When a name and an altname are used with CultureInfo.GetCurrentCulture(string, string), the implementation was publishig the newly created instance into the dictionary under the lock, but then after the lock was released, it was setting that TextInfo to be read-only.  That provides a window where another thread could see it as non-read-only and mutate it.  The fix is to ensure it's marked as read-only fully before it's published.

As I was doing this, it struck me that the implementation was overly complicated, trying to merge three different code paths for three different callers, presumably to share code, but most of the code ended up not being shared anyway, which just made the code harder to follow for little gain.  So, I split it back out into the three calling functions and removed the helper.

I also changed the locking mechanism.  It had been using a single shared lock to protect all state, but the purpose of the lock is really just to synchronize access to an individual dictionary, so we can just lock on the relevant dictionary.

Signed-off-by: dotnet-bot <[email protected]>
2019-09-08 11:22:09 +02:00
Jay Krell 8c77bcdfaf [interp] Fix debug build. (#16720) 2019-09-08 09:25:33 +03:00
Zoltan Varga d9aaed760f [sdks] Change the DISABLE_ conditionals to ENABLE_ to avoid building extra stuff. (#16719) 2019-09-07 17:30:48 -04:00
Jay Krell 5ba104cf39 [interp] Fix recent warnings I added. (#16722) 2019-09-07 15:30:47 -04:00
Jay Krell b18840e92c [interp] Assign sp once is enough in leave. (#16694)
Move vt_sp there too.
2019-09-06 20:48:15 -05:00
Dotnet-GitSync-Bot 381c187df9 Mirror changes from mono/coreclr (#16713)
* Remove stale SuppressMessage attributes (dotnet/coreclr#26501)

Signed-off-by: dotnet-bot <[email protected]>

* Use null coalescing assignment operator in more places

There's currently no auto-fix for this, so the fixes were done manually.

Signed-off-by: dotnet-bot <[email protected]>

* Fix IDE0026 (use expression-bodied members for indexers)

Signed-off-by: dotnet-bot <[email protected]>
2019-09-06 15:58:38 -04:00
Alexis Christoforides 18fb728c65 Remove accidentally committed debug line 2019-09-06 14:27:57 -04:00
imhameed b4886817ef [jit][llvm] Track variable nullness separately from array length ranges/index ranges in abcrem. (#16499)
* [jit][llvm] Track variable nullness separately from array length ranges/index ranges in abcrem.

"Nullness" is tracked via a separate field that is stored adjacent
variable/array value ranges; values may be "maybe-null" or "not-null";
the intersection of maybe-null and not-null yields not-null, the union of
maybe-null and not-null yields maybe-null. The existing graph traversal logic
is reused as much as possible, which makes the implementation of this
null value approximation slightly more complicated than it would be
otherwise.

Fixes https://github.com/mono/mono/issues/16310, which was caused by
the use of non-empty array length ranges as a way to encode non-null
values.

This also allows null check elision for zero-sized arrays.

* Fix C++ compatibility. Fix a typo in a comment.

* Add symmetric nullness relations.

* Make ldlen imply that the source register is not-null, similar to CHECK_THIS or any other null check.
2019-09-06 08:55:21 -04:00
Vlad Brezae e49be5b9ec [metadata] Fix leaks when handling a few attributes (#16675)
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-06 10:31:39 +03:00
Thays Grazia c23a8906f3 [debugger][android] It was not initialising seq_points on MonoCompile on Android, so when was compiling dynamic methods, seq_points wasn't created and we got the assert when try to single step. (#16691) 2019-09-05 22:16:50 -03:00
Vlad Brezae f0dabc6618 [interp] Kill InterpFrame.ex (#16666)
* [interp] Reduce unnecessary uses of frame->ex

* [interp] Remove ex from InterpFrame

We save stack space and move the exception where it belongs, in ThreadContext. It was confusing what frame->ex really meant, it was probably not used / initialized properly. We move it now to ThreadContext where it represents the current exception being thrown during EH (when we have a resume state set).
2019-09-05 23:10:13 +03:00
Filip Navara 673c8835fd [netcore] Bump CoreFX, core-setup dependencies (#16681)
* [netcore] Bump CoreFX, core-setup dependencies

* Update .deps.json hacks

* Update test exclusions
2019-09-05 20:03:47 +02:00
Jay Krell 7fc0f8842e [interp] Localize endfinally_ip to leave, and it cannot be null (barring (#16676)
[interp] Localize endfinally_ip to leave, and it cannot likely be null (unless offset carefully formed).
2019-09-05 13:46:12 -04:00
Jo Shields a67839540e Fix distclean (#16667)
* Disable `subdir-objects` mode in Automake

This forces creation of subdirectories' files (e.g. .deps/*.Plo) in the
parent directory listing the source file. This works around a situation
where two different files specify files in a different parent directory
(i.e. ../../support/adler32.c in mono/metadata/ and adler32.c in
support/) both emit files into the same place (support/.deps), causing
`make distclean` to try and delete support/.deps from two different
places, breaking distclean.

This unfortunately adds a pile of Automake warnings, during autogen.

The "correct" fix is to stop specifying zlib as a pile of flat .c files,
and instead put it in its own subdirectory, conditionally including
its .la files as required.

Partially fixes https://github.com/mono/mono/issues/16605

* Ship netcore/Makefile with an empty distclean rule

We need a netcore/ directory because we write to it during configure,
and we need a netcore/Makefile with a distclean rule, so top-level
recursive distclean doesn't fail. So specify both here.

Partially fixes https://github.com/mono/mono/issues/16605
2019-09-05 13:25:48 -04:00
Fan Yang abe48e3fd4 Remove redundant function call of EscapeTypeName to make (#16425)
* Remove redundant function call

* Remove commented out line of code
2019-09-05 18:12:57 +02:00
Maxim Lipnin f617a2692f [wasm] Add build.sh (#16682) 2019-09-05 11:10:05 -05:00
Jay Krell ee85b695c8 [interp] Remove unused parameter to ves_pinvoke_method. (#16677)
[interp] Remove unused parameter to ves_pinvoke_method.

It might actually cause stack pressure (but on its own, this PR does not save stack).
2019-09-05 11:30:59 -04:00
Zoltan Varga c3541c2738 [netcore] Fix the range checks for Vector.CopyTo(). (#16663)
* [netcore] Fix the range checks for Vector.CopyTo().

* [netcore] Fix Vector.get_Item () for u1/u2, the llvm type is a vector of i1/i2, so we need to zero extend.
2019-09-05 13:55:53 +02:00
Next Turn cb1a228a54 Remove unnecessary !s for [DoesNotReturn] (dotnet/coreclr#26512)
Signed-off-by: dotnet-bot <[email protected]>
2019-09-05 10:46:55 +02:00
Stephen Toub 0770a3d82b Fix StyleCop tuple warnings (dotnet/coreclr#26514)
A few PRs crossed such that PR validation passed but master is issuing lots of warnings-as-errors.

Signed-off-by: dotnet-bot <[email protected]>
2019-09-05 10:46:55 +02:00
Stephen Toub 1dc58da785 Remove readonly from GCHandle field on Gen2GcCallback (#26509)
GCHandle is mutable, and this type does call Free on the handle, but with it marked as readonly, the mutations performed by Free will be done on a copy rather than on the original.

Signed-off-by: dotnet-bot <[email protected]>
2019-09-05 10:46:55 +02:00
Stephen ToubandAdam Sitnik ff7dd88cfa Use expression-bodied members in more places (dotnet/coreclr#26500)
* Fix IDE0027 (use expression body for accessors)

* Fix IDE0023 / IDE0024 (use expression body for operators)

* Apply suggestions from code review

Co-Authored-By: Adam Sitnik <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-09-05 10:46:55 +02:00
Zoltan Varga db626fe9d3 [llvm] Use branch weight metadata in some cases. (#16668)
* [llvm] Add functions to create weighted branches.

* [llvm] Use weighted branches in GC_SAFE_POINT, some llvm passes doesn't seem to recognize llvm.expect so the LLVM JIT generates the slow inline.
2019-09-04 18:17:07 -04:00
Sam Patel c0a36b62af Update CodeOwners (#16662)
* Update CodeOwners

Add Imraan as code owner for LLVM related files

* Update CODEOWNERS
2019-09-04 19:32:11 +02:00
Jay KrellandLarry Ewing 1f21aae8cb Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing 9fc2ade131 Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing 4359ad66d0 Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing e25d2e5536 Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing 557645fea3 Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing b3f996d45d Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing 8232c85e4c Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing bd9ae10c7c Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing b071aa9192 more star placement
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing 46ea28c95b Move stars to sometimes but not always onventional and wierd location. C syntax experiment takes it toll for decades on.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing 90e2563523 Move stars to conventional but wierd place.
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing b8313d586a Update mono/eglib/gmodule-win32.c
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay KrellandLarry Ewing d0817ccdc6 Update mono/eglib/glib.h
Co-Authored-By: Larry Ewing <[email protected]>
2019-09-04 12:31:13 -05:00
Jay Krell a7357e8177 Remove unnecessary cast. 2019-09-04 12:31:13 -05:00
Jay Krell 595b66c0eb Allocate MAX_PATH to start, but it usually wastes memory.
Double later for clarity.
2019-09-04 12:31:13 -05:00
Jay Krell 8723e49b0e Fix C++? 2019-09-04 12:31:13 -05:00
Jay Krell fb6e2c75cd cleanup 2019-09-04 12:31:13 -05:00
Jay Krell da2471d001 Test invalid module. 2019-09-04 12:31:13 -05:00
Jay Krell 74f1312cd3 Skip psapi.dll and go right to the Windows 7 or newer versions in kernel32.dll. 2019-09-04 12:31:13 -05:00
Jay Krell 2db0c8c2d4 Remove cast. 2019-09-04 12:31:13 -05:00
Jay Krell 06f4f93aa5 comments 2019-09-04 12:31:13 -05:00
Jay Krell 3ca5b2687f Remove accident. 2019-09-04 12:31:13 -05:00
Jay Krell f8be8c6de7 MAX_PATH reduction. 2019-09-04 12:31:13 -05:00
Jay Krell a55da2a903 Tweak names and fix preexisting leak under low memory. 2019-09-04 10:31:22 -05:00
Jay Krell 14afe79a0a [Coop] GetStackTraces. 2019-09-04 10:31:22 -05:00
Egor Bogatov 30625b25df Implement more Math LLVM intrinsics (#16578)
* Implement more Math intrinsics

* Test on CI

* Update pipeline-netcore-runtime.yml

* undo "test on CI"
2019-09-04 09:54:52 -04:00
Jay Krell 350dd0e2de [Coop] ves_icall_System_IOSelector_Add 2019-09-04 08:36:42 -05:00
Stephen Toub 036ab58b42 Fix several recently added StyleCop tuple rules (dotnet/corefx#40794)
Signed-off-by: dotnet-bot <[email protected]>
2019-09-04 11:15:23 +02:00
Egor Bogatov 1558316cec Throw NRE if src or dst in Memmove are nulls (#16650) 2019-09-04 11:01:53 +02:00
Zoltan Varga 55ac86fe8b [netcore] Fix the exception thrown by the Vector<T>.CopyTo() intrinsic. (#16618)
Fixes https://github.com/mono/mono/issues/16616.
2019-09-04 10:57:39 +02:00
Dotnet-GitSync-Bot dcb90fa1c0 Mirror changes from mono/coreclr,corefx (#16654)
* Refactor BinaryReader.ReadChars using Span (dotnet/coreclr#26325)

Avoids unsafe code and makes the code simpler

Signed-off-by: dotnet-bot <[email protected]>

* Remove unnecessary parens from `return (true);` and `return (false);` (#26488)

Just a search and replace.

Signed-off-by: dotnet-bot <[email protected]>

* Avoid some unnecessary initialization in DateTimeParse (#26487)

Signed-off-by: dotnet-bot <[email protected]>

* Update analyzer versions (dotnet/corefx#40778)

In particular to pick up StyleCop fixes related to C# 8 and nullability.

Signed-off-by: dotnet-bot <[email protected]>
2019-09-04 00:20:35 -04:00
Jay Krell 82d4d8d81d Fix overly sensitive g_ascii_strncasecmp tests. 2019-09-03 22:46:10 -05:00
Jay Krell b66ec468da Add g_asciiz_equal_caseinsensitive, g_ascii_equal_caseinsensitive, g_asciiz_equal.
The default takes a length.
"z" means zero terminated, the usually slower not preferred.
2019-09-03 22:46:10 -05:00
Jay Krell 8c288f0666 Cleanup and augment string handling based on https://github.com/mono/mono/pull/15522.
1. When comparing strings, check pointer equality.
Faster when they match, slower when they do not.

2. Provide string lowercasing into a provided buffer, which can equal
the input, to avoid extra malloc/free.

3. define G_STRING_CONSTANT_AND_LENGTH(x) (x), G_N_ELEMENTS (x) - 1
e.g. strncmp (foo, G_STRING_CONSTANT_AND_LENGTH ("version"))
2019-09-03 22:46:10 -05:00
Zoltan Varga e1b568b529 [netcore] Enable Vector<T>.get_Item () intrinsics for floats/doubles. 2019-09-03 22:05:15 -05:00
Zoltan Varga 4107a15389 [netcore] Disable socket support to fix warnings. 2019-09-03 21:24:23 -05:00
Alexis Christoforides e50a7360e1 Debugging 2019-09-03 20:30:30 -05:00
Alexis Christoforides 4840f4161f [merp] Fix logic of 'is_managed' attribute 2019-09-03 20:30:30 -05:00
Alexis Christoforides 4a52bd6da0 Fix pointing to stack on string && some add tracing 2019-09-03 20:30:30 -05:00
Alexis Christoforides 8c0dc66d25 Guard writing to out_module 2019-09-03 20:30:30 -05:00
Alexis Christoforides 1b66666cc7 Update MONO_CORLIB_VERSION 2019-09-03 20:30:30 -05:00
Alexis Christoforides 001398e05b Remove problematic assert from SIGILL handler
mono_handle_native_crash() function can actually return if the native crash has triggered or has been trigerred by  more than one signal. So it is possible to reach the point of the assert
2019-09-03 20:30:30 -05:00
Alexis Christoforides 8d4c0f3553 Add stub of new function when crash reporting is disabled 2019-09-03 20:30:30 -05:00
Alexis Christoforides 4b02c3eb9d Set out_module, to avoid getting no useful information in the printout
It seems that without this, most/all entries in the unmanaged frames list are have no useful information.
2019-09-03 20:30:30 -05:00
Alexis Christoforides 40a8d88d8e [merp] Add API method that whitelists all native libraries
This is so that complex consumers such as Visual Studio for Mac can forego attempting to enumerate all loaded libraries, register them one at a time and potentially keep the list updated
2019-09-03 20:30:30 -05:00
Next Turn 0fc4d68d8e Use Span<T> in Encoding (dotnet/coreclr#25860)
Signed-off-by: dotnet-bot <[email protected]>
2019-09-03 19:42:55 -05:00
Zoltan Varga 83953ef83d [wasm] Disable threads tests as well. 2019-09-03 18:06:36 -05:00
Zoltan Varga aad5494258 [wasm] Avoid aligning the stack bounds, they are not page aligned on wasm. 2019-09-03 18:06:36 -05:00
Zoltan Varga ea512c1604 [wasm] Bump emscripten to 1.38.43. 2019-09-03 18:06:36 -05:00
Zoltan Varga 5f79b69e34 [wasm] Disable threads support, it doesn't work with 1.38.42. 2019-09-03 18:06:36 -05:00
Larry Ewing 68b7af0539 [wasm] update emscripten 2019-09-03 18:06:36 -05:00
Jay Krell 1780e1d1f8 [coop] CustomAttributeBuilder_GetBlob, etc. (#16579)
mono_reflection_get_custom_attrs_blob_checked
 ModuleBuilder_WriteToFile
 ModuleBuilder_build_metadata
2019-09-03 18:52:41 -04:00
Jay Krell 651eb7696e [Coop] ves_icall_InternalInvoke. (#16625)
* [Coop] ves_icall_InternalInvoke.

(Part taken from ves_icall_InternalExecute https://github.com/mono/mono/pull/16622.)

* error_init_reuse.

* Remove stars from types.
2019-09-03 17:18:21 -05:00
Thays Grazia 1046dd746f [debugger][android] Fixing single step inside Exception on Android (#16596)
* Fixing single step inside Exception on Android...
The method is null because on ss_create_init_args the IL is -1 when calling method Mono_UnhandledException_internal what I think it's expected, because of that I ignore the single step on android if there is no method. (debugger-engine.c)
After that the sequence point cannot be found because it's calling a method of class DynamicMethodNameCounter what I think it's expected, because of that I remove the assert on android. (debugger-agent.c)
Fixes #14772

* Changing comment to make it clear...
2019-09-03 16:28:37 -04:00
Egor Bogatov 625af20cef [netcore] Use CoreRT's Overlapped (#16106)
Made it Nullability friendly

Interop.MemFree  -> Marshal.FreeHGlobal
Interop.MemAlloc -> Marshal.AllocHGlobal

Fixes https://github.com/mono/mono/issues/15308
Fixes https://github.com/mono/mono/issues/15310

Also, copy ThreadPoolBoundHandle.PlatformNotSupported.cs
2019-09-03 16:22:04 -04:00
Jay Krell 37e49876b9 Fix non-netcore warning about add_assembly_to_alc. (#16622) 2019-09-03 16:09:24 -04:00
Filip Navara 4ae804bb33 [netcore] Add intrinsic implementation for Unsafe.InitBlockUnaligned 2019-09-03 18:40:06 +02:00
Vlad Brezae 930a5d7d44 [interp] Transform ldloc/stloc pairs to a movloc instruction (#16546)
* [interp] Add stack information for each instruction

For each instruction PopN indicates how many values from the top of the stack are used by the instruction. PushN signals how many values are pushed back. These are also used to prevent values from the stack being optimized out, since they might still be used by an instruction. VarPop and VarPush mean that the number is not constant, so we need to inspect the data fields of the instruction (typically for an imethod or csignature) to figure out the stack usage.

* [interp] Convert ldloc/stloc pairs to movloc

The movloc instruction operates directly on locals. This is faster due to avoiding dispatch and stack indirection. More important is that it makes it easy to do copy propagation of locals and it has no stack usage, which means that it could even be killed if the destination local is no longer referenced (as well as STLOC_NP). In the future we could reuse this mechanism of tracking the value of a stack slot to do constant propagation and kill even more instructions (we might need to have _IMM versions of opcodes for this to work).

* [interp] Enable disabling of interp optimization

* [interp] Add time tracking stat for cprop optimizations

* [interp] Move stloc.np transformations to the cprop pass

It makes more sense to do such transformations here and we also don't want transformations in the generate phase prevent us from detecting alternative transformations when running the full pass.

* [interp] Add counter for instructions that were optimized away

* [interp] Make it explicit that we are dealing with IR code

It can be confusing in verbose output.
2019-09-03 19:36:21 +03:00
Nikolay Sivov f8718c7a05 [cominterop] Maintain object domain around ccw wrapper calls. 2019-09-03 18:03:42 +02:00
Ryan Lucia 5377f9655d Remove MAX_PATH usage in w32process (#16553)
* Remove MAX_PATH usage in w32process

* Fixes

* Shrink buffer temporarily

* More fixes

* Reset buffer size to 260

* Fix length check and add notes

* Actually free things

* Add tracing and zero len at start

* Typo

* Fix another leak

* Simplify logic
2019-09-03 11:41:27 -04:00
Zoltan Varga 98a4d5ec1e [llvm] Implement more SIMD intrinsics on netcore. (#16449)
* [netcore] Add intrinsics for Vector128/Vector256.Count.

* [netcore] Implement Vector<T>.get_Item () as an intrinsic.
2019-09-03 08:31:16 -04:00
Egor Bogatov 416a31796e Improve Fast-Math mode for LLVM (#16599)
It turns out it's not enough to set global fast math parameters, it's also required to mark some instructions as "fast" (see https://llvm.org/docs/LangRef.html#fast-math-flags) like, for instance, clang does, see https://godbolt.org/z/U8TFST
E.g. all optimizations inside SimplifyLibCalls pass (it's a subpass of InstCombine) need it.
2019-09-03 08:19:03 -04:00
Egor Bogatov 5692180ea2 [netcore] Makefile clean up (#16630)
Remove ASP.NET sample (we currently have to download apsnet runtime everytime)
instead we can do:

dotnet new webapp

and do make patch-app APP_PATH=/path/to/myasp (works for any kind of apps/templates)
2019-09-03 07:55:22 -04:00
Bernhard Urban f23113afcd Relax assembly checking for 64 bit targets to allow running mixed-mode MSVC code. (#16330)
* [jit] Relax assembly checking for 64 bit targets to allow running mixed-mode MSVC code.

Fixes #37913

* STACK_PTR|I8 should be the same as I8|STACK_PTR tuple

* fix i4 to ptr conv on 64bit
2019-09-03 12:14:02 +02:00
Vlad Brezae f491af13f4 [interp] Remove varargs from InterpFrame and recompute it instead (#16598)
It is a waste of stack space.
2019-09-03 11:21:56 +03:00
Filip Navara b9b13f0fc1 Use CMP_GE/CMP_LE/CMP_GE_UN/CMP_LE_UN instead of manual decomposition 2019-09-03 09:43:17 +02:00
Filip Navara 03899588ba [netcore] Add intrinsics for Vector.GreaterThanOrEqual/LessThanOrEqual 2019-09-03 09:43:17 +02:00
Dotnet-GitSync-Bot a6b91f4295 Mirror changes from mono/coreclr (#16547)
* Move FormatTypeName to Type (dotnet/coreclr#25631)

Signed-off-by: dotnet-bot <[email protected]>

* Fix for mono
2019-09-02 16:02:59 -04:00
Egor Bogatov 73c8017b1f Merge pull request #16624 from filipnavara/hebrew
[corlib] Add hack for Hebrew calendar data
2019-09-02 20:43:08 +03:00
monojenkins eaa525ab41 [csproj] Update project files 2019-09-02 10:33:47 +00:00
Filip Navara 6ca4e84758 Fix month names for the Hebrew calendar 2019-09-02 11:19:24 +02:00
Filip Navara ca389a3cae [corlib] Add hack for Hebrew calendar data 2019-09-02 02:45:45 +02:00
Alexander Köplinger 07b7c7d824 [Coop] Monitor. (#16608)
* [Coop] Monitor.

* PR: Rename function; cleanup slightly.

* PR: And then rename the icall back.

* Rename parameter back.
2019-09-01 15:14:17 +02:00
Jay Krell b3e48bcf95 [Coop] Fully inline NULL_HANDLE (do not even access a global variable). (#16612) 2019-09-01 15:13:20 +02:00
Ryan Lucia c9a6dd351a [netcore] Add handle frame to loop body in GetTopLevelForwardedTypes (#16594)
* [netcore] Add handle frame to loop body in GetTopLevelForwardedTypes

* No early returns

* Move scope of cols

* Fix C++ builds, probably
2019-08-31 21:40:52 -04:00
Egor Bogatov 6327274b54 LLVM: Make Buffer.Memmove intrinsic (#16610)
* Add memmove intrinsic

* Fix typo

* Add -lower-expect
2019-08-31 19:42:44 -04:00
Jay Krell 24180e9106 Rename parameter back. 2019-08-31 10:35:14 -07:00
Jay Krell 5d9ca20646 PR: And then rename the icall back. 2019-08-31 10:34:32 -07:00
Jay Krell ea0db154b4 PR: Rename function; cleanup slightly. 2019-08-31 10:13:47 -07:00
Zoltan Varga fb26a68fd1 [aot] Avoid crashing with --aot=llvm is used in a runtime without llvm support. (#16577) 2019-08-31 09:03:45 -04:00
Jay Krell 91445e2286 [Coop] Monitor. 2019-08-31 05:22:45 -07:00
Jay Krell 9b193b9ec4 [coop] Allow SETUP_ICALL_FRAME (i.e. a loop) to reference calling frame w/o HANDLE_FUNCTION_ENTER or SETUP_ICALL_FUNCTION. (#16498)
This is based on my read of https://github.com/mono/mono/pull/16487.
2019-08-31 14:20:44 +02:00
Nikolay Sivov 2f5c8cba6e [corlib] Simplify file: protocol check in Assembly::Load(). (#16494)
Mirrors change made with 068660732f.
2019-08-31 08:19:41 -04:00
Vlad Brezae bf53a3a53b [interp] Fixes for il_offsets associated with instructions (#16587)
* [interp] Remove some some false is_bb_start markings

Having fewer basic blocks makes potential optimizations more effective.

* [interp] Persist variables in TransformData

Thate are not used by inlined code because we don't inline code that has multiple basic blocks or clauses.

* [interp] Enable emitting of MINT_NOP instruction

This instruction will be optimized away when compacting the instruction stream.

* [interp] Clear instructions insead of removing them

Makes everything easier.

* [interp] Fix some instructions size inconsistencies

* [interp] Add more is_bb_start markings

* [interp] Add nop instead of extending bb

We should always have an IR instruction associated with an IL offset, especially when that instruction is a bb_start since we will need to branch to it and resolve the IR instruction from the il_offset.

* [interp] Simplify resolving in offset

We should always have an in_offset associated with the il_offset we are branching to.

* [interp] Add correct il_offset for all instructions

Except for special prolog instructions that will have -1 as the offset. We don't make much use of il_offset for non bb_start instructions, but they might be useful for debugging.

* [interp] Fix il_offset of some conv opcodes
2019-08-31 13:37:06 +03:00
Jay Krell a768b15330 Follow convention -- "static inline" is only for .h files, "static" is for .c. (#15502)
inlining is up to the compiler to decide.
It is used in .h files for linkage/dedup, not to affect codegen.
2019-08-31 09:40:33 +02:00
Jay Krell cba94f28be [coop] InternalGetHashCode (#16583) 2019-08-31 09:38:12 +02:00
Aleksey Kliger (λgeek) 8bc27f6665 [runtime] Make eglib tests run on CI (#16187)
[runtime] Make eglib tests run on CI

Update mono/eglib SUBDIRS to build tests after eglib is built.

Add a check-local automake rule.

Add CI steps to run the eglib tests.
2019-08-31 02:06:25 -04:00
Jay Krell f735571f27 Cleanup x86_patch and amd64_patch. (#16474)
* Cleanup x86_patch and amd64_patch.

amd64_patch has two incorrect looking probably unused cases.
 g_assert(0) and fix them.
 call and jmp indirect (one case)
 move reg RIP relative

x86_patch is large-ish inline macro.
Presumably for sharing with amd64, not inlining.
Restructure as an inline function, called once.
Try to make the code a little clearer also, with same functionality and efficiency
 (modulo the optimized perf of "if i == 4" vs. "if i")
i.e. speak of instruction_size and offset_size, not pos and boolean size.

Add to x86_patch the ability to patch jmp/call indirect,
as amd64_patch has, but which was incorrect.
This would seem useful for a later change (using "thunks"
to patch nearby data instead of patching aligned instructions,
indirect call/jmp vs. direct).

amd64_patch largely delegates to x86_patch.
One case asserts and delegates.
Move the assert to the x86 side, where an optimizing
compiler should know to remove it for x86 anyway.

Change some assert to g_assert.

Remove some unnecessary casts.

Fix an assert (https://github.com/mono/mono/pull/16471).

* Change g_assert back to assert except where making larger changes
and less expansion.
2019-08-31 00:45:55 +03:00
Bernhard Urban 06e63b345f [mini] publish global patches after JitInfo has been added (#16589)
[mini] publish global patches after JitInfo has been added

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

Consider the following example:

```csharp
static void CommonCallTarget () { }

static void TailA () {
    tailcall CommonCallTarget ();
}

static void TailB () {
    tailcall CommonCallTarget ();
}
```

Since `TailA` and `TailB` are tailcalling into `CommonCallTarget`, the resolution at patch-time is a bit tricky, that is, since it's a jump-like instruction the patching machinery won't know where it was called from. That's why we maintain a global hashtable `jump_target_hash` where each jump-site is signed up to be patched. At patch-time we know the target method (in the example `CommonCallTarget`), but since we don't know where we are coming from, we will just apply all patches for that target.

This works since ages, so why did it crash on arm64 sometimes?
When the patching happens, we check if the displacement between jump-site and target fits into it (24bit). If not, which happens not very often, we have to allocate a _thunk_:
https://github.com/mono/mono/blob/36296ce291f8a7b19de3eccb7a32c7e4ed9df8f2/mono/mini/mini-arm64.c#L928-L942

So instead of jumping to the target directly, we'll branch to the thunk. This is a little trampoline that loads the full address of the target and then finally branches to it. This one will live close-by the jump-site, because during compilation we will reserve specifically for that scenario some space after the generated code. For this, however, we need the JitInfo of the jump-site. And that's where the origin of the race is. Let's say:

* Thread A compiles `TailA`, and then jumps into it. Thus one patch point is in the `jump_target_hash`.
* Now Thread B compiles `TailB`, registers the patch point but has _not_ yet registered its JitInfo.
* Then Thread A continues, does the tailcall into `CommonCallTarget`, enters the patching machinery, which sees two patches. Now assume when applying the patch for `TailB` the displacement is too large, thus it tries to allocate a thunk but can't find the relevant JitInfo for it that it needs to emit the thunk. So it crashes as reported in https://github.com/mono/mono/issues/14080

As far as I can tell this only affects ARM64, ARM and PPC.



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-08-30 16:46:10 -04:00
Steve Pfister dbce6ac447 Turned the compiler server off on Windows because Named Pipes aren't fully working (#16552)
* Turned the compiler server off on Windows because Named Pipes aren't fully working

* Added win32 to the CS is turned off message
2019-08-30 16:27:14 -04:00
Bernhard Urban 5eb67ac88a Revert "[android] add hardware specific workaround for Nexus9 in armv7 mode" (#14691)
Revert "[android] add hardware specific workaround for Nexus9 in armv7 mode"

This reverts commit ee90fc601e (also see https://github.com/mono/mono/pull/4878 ).

The device was released November 2014.  I think it's fair to assume it isn't widely used anymore.
2019-08-30 16:26:12 -04:00
Zoltan Varga 4997d83291 [netcore] Fix make patch-local-dotnet if .dotnet has more than one netcore install. (#16590) 2019-08-30 14:08:41 -04:00
Jay Krell 86c45ff645 [coop] mono_runtime_class_init_full (#16580) 2019-08-30 13:30:58 -04:00
Steffen Kieß 80b7813d54 [Mono.Posix] Add FcntlCommand.F_OFD_{GETLK,SETLK,SETLKW} (#16571)
Add F_OFD_GETLK, F_OFD_SETLK and F_OFD_SETLKW to FcntlCommand. These
commmands are similar to F_GETLK, F_SETLK and F_SETLKW but operate on a
per-open-file-description lock instead of a per-process lock and avoid the
problem that the locks are released when close(dup(fd)) is called. See
https://lwn.net/Articles/586904/ for more information.

This commit also reruns create-native-map but keeps manual changes from
ed892ccf27,
b522eab5ff and
22b6b95814.

In [create-native-map.diff.txt](https://github.com/mono/mono/files/3557077/create-native-map.diff.txt) you can see the difference between the commited `map.[ch]` and the one `create-native-map.exe` wants to create:
- Manually inserted changes for NetBSD (`MAYMOVE` is turned into a negated `FIXED`)
- `Mono_Posix_ToSockaddrIn6()` and friends get skipped for `HOST_WIN32` (not sure why, when `sockaddr_in6` exists then `Mono_Posix_ToSockaddrIn6()` should work)
- At the bottom of `map.h` some functions are reordered and the parameters change (`const char*` vs. `char*`)

Running create-native-map.exe also moved some O_NOATIME-related stuff (from 8b9033e4d2) to the correct position and added it to Mono_Posix_ToOpenFlags(), which I kept in the commit.
2019-08-30 19:13:33 +02:00
Nikolay Sivov c8707c6e84 [cominterop] Respect ComDefaultInterfaceAttribute when constructing ccw. (#16584) 2019-08-30 18:29:54 +02:00
Nikita Voronchev 94797b95d6 [WinForms] Fix UIA event on node insertions into a TreeView object (#16559)
The UIA event doesn't emited by means of insertion a new `TreeNode` to a `TreeNodeCollection` of the respective `TreeNode`.
2019-08-30 18:29:18 +02:00
Jay Krell 9db00e7495 [Coop] ves_icall_RuntimeFieldInfo_GetRawConstantValue. (#16582) 2019-08-30 10:53:40 -04:00
Bernhard Urban 07045604cf [configure] remove autodection of llvm-config in $PATH (#16569)
[configure] remove autodection of llvm-config in $PATH

Instead `./autogen.sh --with-llvm=<path>` should be used if a build from `external/llvm` is not preferred.

The old behavior was confusing when a `llvm-config` is on `$PATH`, which can be the case when you have LLVM packages installed on a Linux distribution. It picked that up when `./autogen.sh --enable-llvm` was used.

/cc @brianrob
2019-08-30 09:16:03 -04:00
Jay Krell 36296ce291 [interp] Compress interpreter opcode names in usual way, offsets vs. pointers. (#16350)
* [interp] Compress the interpreter opcode names in the usual way, by changing
from an array of pointers to an array of 16 bit offsets into one large "string".

* PR: Make mono_interp_opname a function.
2019-08-30 11:27:19 +03:00
Jay Krell 3db78e829c [coop] Convert System_Runtime_Remoting_Messaging_AsyncResult, etc. (#16566)
* [coop] Convert System_Runtime_Remoting_Messaging_AsyncResult_Invoke, etc.

* Remove mono_load_remote_field_checked from this PR.

* Pin ac->msg earlier (should not matter).

* Add missing barrier.

* Pin slightly earlier -- still should not matter.
2019-08-29 22:51:15 -05:00
Jay Krell cbb9c645eb [Coop] mono_runtime_class_init_full mostly single point of exit. 2019-08-29 22:00:46 -05:00
Zoltan Varga 796a575131 Bump ikvm to pick up caa8e7f54279a47422626005d228447f5d3670d5. (#16567)
* Bump ikvm to pick up caa8e7f54279a47422626005d228447f5d3670d5.

* [monodis] Add a missing cattr parent case.
2019-08-29 20:46:30 -04:00
Egor Bogatov c3ccb6e027 Make Math.Pow, Min and Max for doubles intrinsics (#16561)
* Add new Math intrinsics

* call EB.setTargetOptions only for fast-math

* Address feedback

* rename float opcodes

* Rename opcodes

* Update CoreFX.issues.rsp
2019-08-29 19:01:15 -04:00
Zoltan Varga 210b324347 [simd] Implement .ctor(T[]) and CopyTo () as intrinsics. (#16558) 2019-08-29 19:00:59 -04:00
Jay Krell 5390b796dd Cleanup trampoline size checks. (#15624)
Cleanup trampoline size checks.

- named `int` everywhere
- `assert` everywhere
- assert `<=` everywhere instead of `<`
- `const` almost everywhere
Names not consistent, following existing code (`size`, `buf_len`, `kMaxCode`.)

Only touching x86/amd64, granted.

Could be better -- make them two pass and avoid the presizing.
2019-08-29 16:16:14 -04:00
Alexander Köplinger 309cf1bcee Build pkg-config as 64bit only, libtiff as universal and remove gtk-quartz-engine.py (#16548)
See https://github.com/mono/bockbuild/pull/116
2019-08-29 20:24:14 +02:00
Ryan Lucia 3b57849541 [netcore] Implement AssemblyLoadContext.LoadUnmanagedDllFromPath (#16525)
* [netcore] Implement AssemblyLoadContext.LoadUnmanagedDllFromPath

* Fixes
2019-08-29 12:35:15 -04:00
Nikolay Sivov 421bd79f06 [cominterop] Implement native-to-managed safearray marshalling. (#16483)
* [cominterop] Implement native-to-managed safearray marshalling.

* [tests] Fix index variable type.

In attempt ot fix MSVC build failure (int* vs LONG* on Windows).

* [cominterop] Use proper statement block for newly added switch entry.

* [marshal] Conditionally compile in mono_cominterop_emit_marshal_safearray().

Hopefully should fix remaining build failures.

* [cominterop] Don't free user array argument
2019-08-29 08:19:08 -04:00
Jay Krell 52c1d4acfc [Coop] mono_load_remote_field_checked single point of exit. (#16526)
Extracted from earlier version of #16504.
Baby steps.
2019-08-29 11:00:44 +02:00
Egor Bogatov 2e9c5df855 LLVM: Add more Math intrinsics, introduce --cpu flag (#16309)
* Add Math Intrinsics, introduce --cpu flag

* cpu -> mcpu
2019-08-29 04:32:43 -04:00
Jay Krell 2f2d9541e5 [coop] Cleanup mono_reflection_get_custom_attrs_blob_checked. (#16535)
- single point of exit
 - local variable cheaper than strcmp
2019-08-29 04:23:20 -04:00
Jay Krell 07c6b1c9f1 Should fix many warnings: sgen-protocol-def.h adding unsigned long to a string does not append to the string (#16288) 2019-08-29 10:08:42 +03:00
Filip Navara e32fb11dbe [netcore] Add Monitor.LockContentionCount icall (#16538)
* Add Monitor.LockContentionCount icall

* Add NOHANDLES around the new icall
2019-08-28 20:35:07 -04:00
Marius Ungureanu 1d23ca14e1 Use the right FileSystemWatcher sources (#16539)
* 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-28 19:45:25 -04:00
Jay Krell 7ca965e09c Read only function pointers (MonoThreadInfoRuntimeCallbacks). (#16545)
Read only memory is preferred, for efficiency and security.

Even if it requires relocation first.

If the runtime is loaded in more than one process, physical pages can be shared (at least on Windows, where the kernel does the relocation).

If there is memory corruption, writes to here will sigsegv/accessviolate.

The older code also copied the pointers. For lifetime purposes that could be useful, but generally is not. i.e. they live with the code they point to.

Writable function pointers are also particularly targets for attackers.
There's been tons of defenses put around them through the years.
Read only ones are not vulnerable -- unless the attacker escalates and calls mprotect first.

When there is a JIT, arguably there is just tons of attack surface.
But there is also AOT.

Structs of function pointers are usually read only in the wider world.
2019-08-29 00:10:40 +02:00
Steve Pfister 7c4c30ec00 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.
2019-08-28 16:20:09 -04:00
Zoltan Varga c4695b8b44 Merge pull request #16323 from EgorBo/ffast-math
Fast Math mode
2019-08-28 16:16:18 -04:00
Jay Krell 056d5ca545 [interp] Fix remaining MonoError reuse. (#16533)
* [interp] Fix remaining MonoError reuse.

This finishes off:
 https://github.com/mono/mono/commit/38aebeae38704df53ef8f2991ff63e293a3ac4de

which is *ok*, but leaves alone the other approach:
 https://github.com/mono/mono/commit/4d9e6ae20e536394c9ff65c61238045db294c08e
 https://github.com/mono/mono/commit/b654aa1ca858666539a677e96d00f594fd81c630
 https://github.com/mono/mono/commit/fd4956fbf277ec56a13137e01b48efb98a5556f5

Several other options are possible.

* self and peer PR: No need to cleanup successful error.
2019-08-28 21:33:48 +02:00
Jay Krell ff73c84482 Portably pass a full pointer and not just an integer to terminate vararg pointer lists. (#15629)
i.e. because of define NULL 0.
Though I think at least Visual C++ special cases this and passes a full pointer to varargs.
2019-08-28 13:35:10 -04:00
Jay Krell a0ba2cbce5 [interp] Possible code size savings via goto instead of macros. (#16531)
[interp] Possible code size savings via goto instead of macros.

Possibly the compilers do this already.
2019-08-28 12:59:11 -04:00
Egor Bogatov ffc3081c3b Merge remote-tracking branch 'origin/master' into ffast-math 2019-08-28 19:01:34 +03:00
imhameed bd3cc61301 Merge pull request #16242 from lateralusX/lateralusX/windows-fix-local-valuetype-copy-llvm
OP_LLVM_OUTARG_VT doesn't always create temporary vt needed by some ABI's.
2019-08-28 08:23:43 -07:00
Bernhard Urban 71f0f0ff82 [mini] do not re-AOT whole BCL for fullaotcheck targets (#16536)
[mini] do not re-AOT whole BCL for fullaotcheck targets

And enable `llvmfullaotcheck` target on CI.

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

On my armv7/linux machine with a `--with-runtime-preset=fullaot_llvm` configured build, before this PR:
```console
$ time make -C mono/mini llvmfullaotcheck -j4
[...]
real    9m42.362s
user    23m2.000s
sys     0m18.480s
```
After:
```console
$ time make -C mono/mini llvmfullaotcheck -j4
[...]
real    3m1.984s
user    4m51.648s
sys     0m8.248s
```
2019-08-28 11:19:39 -04:00
Alexander Köplinger 2152f0a16d [netcore] Add missing 'prepare' dependency to run-tests-corefx 2019-08-28 16:17:31 +02:00
Phil Jaenke 1bee4e354c [corlib] Remove/Update deprecated TZs for #16415 in TimeZoneInfoTests (#16450)
This fixes #16415 

All timezones indicated as deprecated have been updated to the current IANA specification.
2019-08-28 16:08:20 +02:00
Zoltan Varga f562c7ef6a Merge pull request #16517 from vargaz/wasm-xunit4
[wasm] Enable xunit tests for corlib/System.Core.
2019-08-28 09:46:09 -04:00
Jay Krell c80a1eca63 Fix assert in x86_patch regarding second byte of Jcc instructions being 0x80-0x8F vs. 0x70-0x8F (6byte conditional branch with 32bit offset). (#16471) 2019-08-28 15:42:44 +02:00
Aleksey Kliger (λgeek) fc21168065 [merp] Initialize hang_watchdog_path earlier; be lax if it's missing (#16298)
* [merp] Initialize hang_watchdog_path earlier; be lax if it's missing

Initialize hang_watchdog_path earlier - not just when
ves_icall_Mono_Runtime_EnableCrashReportingLog is called.  That function is
only expected to be called by apps that explicitly want progress reports from
MERP when it's collecting a crash report.  But we want the mono-hang-watchdog
to execute for all mono crashes (when crash reporting isn't ifdef'd out).

Also if we try to exec mono-hang-watchdog and fail for some reason, print a
nice message and then exit.  We used to call g_assert_not_reached which would
kick off another MERP of the _forked child process_ which would then get
confused because it really can't run in the forked process at all.
2019-08-28 08:34:30 -04:00
Jay Krell 2ca04a9743 [interp] Outline box. (#16456)
With additional reasonable changes this should conserve stack.
A combined PR that demonstrates actual savings probably should/will be presented.
2019-08-28 13:51:23 +03:00
Jay Krell 56b83f489b [interp] Minor cleanup of stackval_from_data. Compiler can do it. (#16534)
I missed this earlier cleaning stackval_to_data.
2019-08-28 12:11:56 +02:00
Jay Krell c870df0aa7 [interp] Asserts pessimize clang. Removing saves 16 bytes on Linux/amd64/clang. (#16530)
Paired with https://github.com/mono/mono/pull/16456, saves 16 bytes on Linux/amd64/clang.
No change with gcc.
Contributes to https://github.com/mono/mono/issues/16172.
2019-08-28 12:10:30 +02:00
Eric Erhardt 39ddea3983 Don't validate empty TransitionTimes on deserialization. (#26405)
On Unix, TransitionTimes are not used, so they are left empty. When deserializing an empty TransitionTime, it is throwing an exception because those are not normally valid. Fix deserialization to not validate empty TransitionTimes.

Fix dotnet/corefx 40578

Signed-off-by: dotnet-bot <[email protected]>
2019-08-28 11:55:07 +02:00
Jay Krell c534511003 Remove dead Boehm code. (#15224)
* Remove dead Boehm code.

Unity looked similarly dead.

The key points making it dead were:

create_allocator:
  g_assert_not_reached() covering everything but local variables

mono_gc_get_managed_allocator:
  always returning NULL, killing a bunch of code
  after it

mono_gc_is_critical_method:
   looking at data that was never filled in

This should have no impact, not even on Boehm.
Boehm should continue working just the same.

It is nice because it is the few/only uses of CEE_MONO_TLS.
2019-08-28 10:56:08 +02:00
Jay Krell 0375acd7c8 [mini] Cleanup MONO_MMAP_32BIT. (#16469)
- It _presumably_ means nothing on 32bit ARM and 32bit MIPS (was there mono/mips64?).
 - Leaving only PowerPC32 and PowerPC64 (in this vicinity).
   - It presumably means nothing on PowerPC32.
   - Leaving PowerPC64 as the only user in this vicinity -- is it needed?
- Notice this is varyingly absent on x86, arm64, amd64, s390x.
  Subject of another PR maybe.

Perhaps this was to enable the debugger to be 32bit against a 64bit target
on a biarch system, so it could do a cross-process manipulation of these pages?
That makes some sense on Windows at least.
(32bit debugger cannot debug 64bit target as of Vista, but that is using the Win32
"hard" debugger API. Mono could do otherwise).

There remains amd64 mono-codeman.c define ARCH_MAP_FLAGS MONO_MMAP_32BIT left alone.
2019-08-28 10:54:00 +02:00
Zoltan Varga 162849f972 Merge pull request #16520 from vargaz/fix-llvm-2
[llvm] Fix ctlz intrinsics, they have 2 arguments.
2019-08-28 03:24:01 -04:00
Bernhard Urban d6fa5ff9c6 fix cast and signature for mono_rconv_u4 2019-08-27 20:35:42 -05:00
Bernhard Urban 460bfa9beb [amd64] use opcode emulation for fconv/rconv 2019-08-27 20:35:42 -05:00
Bernhard Urban 8e6b967391 [llvmaotcheck] require sse3 being available for regression tests 2019-08-27 20:35:42 -05:00
Bernhard Urban 5b20322a84 [arm] use opcode emulation for fconv/rconv 2019-08-27 20:35:42 -05:00
Bernhard Urban ba824cb921 [arm] account only 4 bytes on stack for single precision arguments
Fixes `test_0_arm64_small_stack_args` in gshared.cs when
* `test_0_arm64_small_stack_args` is compiled with LLVM
* `Foo3.Floats` is compiled with Mini
2019-08-27 20:35:42 -05:00
Bernhard Urban 475defca4d [arm64] use opcode emulation for fconv/rconv
LLVM eagerly optimizes constants such as NaN in a way that does not align with .NET behaviour. In the future we can change it so that we only do opcode emulation when LLVM is used.

Fixes https://github.com/mono/mono/issues/16411
2019-08-27 20:35:42 -05:00
Bernhard Urban d164550a61 [ci] add make -C mono/mini llvmaotcheck to FullAOT LLVM lanes 2019-08-27 20:35:42 -05:00
Jay Krell 645c01066c Cleanup arm64 SeqPointInfo. 2019-08-27 20:34:42 -05:00
Stephen Toub 55002c3e02 Fix pragma warning restore (dotnet/coreclr#26389)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-28 00:16:03 +02:00
Jay Krell f516e79dd9 Inline mono_string_length_internal and mono_string_chars_internal (#16374)
* Inline mono_string_length_internal and mono_string_chars_internal for everyone.

* Add MONO_REQ_GC_UNSAFE_MODE.
2019-08-27 17:39:18 -04:00
Zoltan Varga cb5470b40a Fix timeouts. 2019-08-27 17:37:59 -04:00
Tarek Mahmoud Sayed 9ad1f08077 Fix Abbreviated Genitive Month Names Parsing (dotnet/coreclr#26379)
* Fix Abbreviated Genitive Month Names Parsing

In 3.0 we have fixed the formatting to use the abbreviated genitive month names when having "d" format specifier followed by "MMM". This fix is good as original formatting specs required but we needed to support the parsing when we have such genitive names.

* Addressing the feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-08-27 22:56:08 +02:00
Filip Navara f4145ce108 Update version information in System.Private.CoreLib to mimic CoreCLR and make BenchmarkDotNet happy (#16515)
BenchmarkDotNet recently updated the algorithms for .NET version detection (https://github.com/dotnet/BenchmarkDotNet/pull/1230) which made it incompatible with the version presented by Mono.

This updates the value of [ProductName](https://github.com/dotnet/coreclr/blob/1f428dbc5554191dadd27511cd5cd181e4a60efb/Directory.Build.targets#L7) and [Version](https://github.com/dotnet/coreclr/blob/c9007e73286456434ba12744e778e87a89fc1d90/eng/Versions.props#L5) to match what CoreCLR is currently reporting and makes the [BDN detection code](https://github.com/dotnet/BenchmarkDotNet/blob/b6d0e0f1d80ed60aa157149a0dfb704a2da4ca41/src/BenchmarkDotNet/Environments/Runtimes/CoreRuntime.cs#L73-L81) happy.
2019-08-27 22:55:37 +02:00
Ryan Lucia f9f5fff40c [netcore] Change exception thrown for SetTypedReference (#16518)
This brings us in line with CoreCLR behavior.
2019-08-27 22:53:37 +02:00
Zoltan Varga 340289d4ae [llvm] Fix ctlz intrinsics, they have 2 arguments. 2019-08-27 16:34:27 -04:00
Zoltan Varga ab1e9be35e [llvm] Fix the mixing of LLVM modules in the llvm JIT, use ctx->lmodule instead of module->lmodule. 2019-08-27 16:31:18 -04:00
Zoltan Varga 44d33673a5 Fix the netcore build. (#16519) 2019-08-27 22:30:16 +02:00
Zoltan Varga 0c015aa815 [wasm] Enable xunit tests for corlib/System.Core. 2019-08-27 15:46:26 -04:00
Zoltan Varga 3108d43051 Merge pull request #16487 from vargaz/cattr-data-handles
[runtime] Convert mono_reflection_create_custom_attr_data_args () to use handles.
2019-08-27 15:22:30 -04:00
Zoltan Varga 79475574a6 [wasm] Add more xunit test exclusions. 2019-08-27 13:41:11 -05:00
Egor Bogatov e9dff75d2f use gunichar2 2019-08-27 20:21:39 +02:00
Alexander Köplinger f914d900f6 Remove AppContext.cs that was moved to shared 2019-08-27 20:21:39 +02:00
Egor Bogatov f97d699183 Move AppContext.CoreCLR.cs to shared, remove static ctor (#26045)
* Remove AppContext.CoreCLR.cs (move to shared)

Signed-off-by: dotnet-bot <[email protected]>
2019-08-27 20:21:39 +02:00
Steve Pfister 580defd967 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
2019-08-27 13:54:52 -04:00
Alexander Köplinger 8d422436f5 [acceptance-tests] Bump roslyn test repo to remove a problematic nuget feed 2019-08-27 19:48:08 +02:00
Vlad Brezae ccc4bf8536 [interp] Remove unnecessary recomputation (#16509)
Seems to have been added by mistake in https://github.com/mono/mono/pull/16317, which was meant just to remove the locals variable from InterpFrame.
2019-08-27 20:27:22 +03:00
Jay Krell 00c1ec421a [interp] Error handling refactor (optimize non-exception path) (helps clang save stack) (#16371)
While working on stack reduction, I believe I found that
the compiler could not tell how THROW_EX and/or NULL_CHECK terminate.

That is, essentially, the success paths preserve volatile registers.
They do not have to be spilled/filled.
This tweak should make it clearer to the compiler, optimized common paths, and not slow down uncommon paths.

This also cleans it up a little and reduces macro expansion, and then possibly should allow for reinlining what is now used only once.

Also add some const so it can be casted away less.

Believed to save 32 bytes of stack with Linux/amd64/clang, nothing for gcc.
And a nice cleanup.
2019-08-27 15:31:10 +02:00
Zoltan Varga fa1288794b Merge pull request #16493 from EgorBo/impl-lzcnt
Implement System.Runtime.Intrinsics.X86.Lzcnt
2019-08-27 06:51:03 -04:00
Johan Lorensson 70aba13173 Fix multiple SGEN_LOG to correctly scale elapsed time in usec. (#16485)
Several SGEN_LOG entries logged usec based on result returend from TV_ELAPSED.
On SGEN's implementation of TV_ELAPSED, the result is not scaled to usec
but returned as 100ns ticks. This was not handled correctly by SGEN_LOG,
but other measures, like profile counters and SGEN binary protocol handles
it correctly.

Fix will adjust the SGEN_LOG calls currently presenting usec to correctly
scale the result. Fix also adds one additional logging measuring total
amount of time spend scanning thread data.
2019-08-27 12:14:12 +02:00
Jay Krell bfe1b6182c [interp] Replace imethod with frame->imethod. (#16459)
This conserves stack on Linux/amd64/gcc.
2019-08-27 11:51:21 +02:00
Jay Krell 6cf8b6e738 CodeManager cleanup: (#16468)
- Chunks do not need flags, only codemanagers do.
 - Sort by size to minimize padding for alignment.
 - Booleans only need one bit.
 - Chunk is not spelled chunck.
 - Suggest foo accessors be named foo() and set_foo(), not get_foo() and set_foo().
   i.e. the more common "get" is implied.
- Allow free(0) w/o initialization.
2019-08-27 10:40:35 +02:00
Jay Krell 9f9e5f7803 [monodis] Combine adjacent identical cases. (#16501) 2019-08-27 10:36:59 +02:00
Zoltan Varga c7d785f329 Add SETUP_ICALL_FUNCTION. 2019-08-27 03:57:59 -04:00
Jay Krell 7ca15e5a42 mono_attach_load_agent: Fix leaks, alloc, copy. (#15950)
Extracted and slightly modified from https://github.com/mono/mono/pull/15868.
2019-08-27 09:46:35 +02:00
Stephen Toub a0307b1e34 Fix comment typo in ManualResetValueTaskSourceCore
Signed-off-by: dotnet-bot <[email protected]>
2019-08-27 01:24:57 +02:00
Vladimir Sadov 88ac3856eb Do not use AllocateUninitializedArray in private array pools. (#26338)
User may have extra expectations for the privatly owned array pools.
For example there could be an expectation that array never contains negative numbers (since user never puts them there). Uninitialized allocations can break such expectations.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-27 01:24:57 +02:00
Stephen Toub 82f618023f Disable SA1001 for LocaleData.Unix.cs
Signed-off-by: dotnet-bot <[email protected]>
2019-08-27 01:24:57 +02:00
Stephen Toub 39d62eb8c8 Separate Async*MethodBuilder types into their own files (#26364)
* Separate async method builder types into their own files

* Minor cleanup of AsyncTaskMethodBuilder types

* Split AsyncValueTaskMethodBuilder types into their own files

Signed-off-by: dotnet-bot <[email protected]>
2019-08-27 01:24:57 +02:00
Nikolay Sivov 515ec75154 [git] Set csharp diff pattern for *.cs sources. (#16495) 2019-08-27 01:24:30 +02:00
Jay Krell 67c97d30b4 Add missing const, particularly on functions "like" memcpy. (#16477)
But do not change the signatures of external functions.
2019-08-27 01:04:46 +02:00
Zoltan Varga 4f8c0b9b46 Merge pull request #16451 from vargaz/gc-handle-pin
[runtime] Make the local gc handles pin the object they point to by scanning the handle area conservatively.
2019-08-26 17:31:50 -04:00
Aleksey Kliger (λgeek) 78edafd6e2 [threadpool-io] Throw if backend won't be able to register a FD (#16396)
The poll+select i/o selector backend can't handle file descriptor ids greater
than FD_SETSIZE.  This can happen if too many files are open and we want to
wait on it.

Previously, mono would fail in the i/o selector thread by which point it was
too late to do anything.

With this change we will fail eagerly on the thread that calls IOSelector.Add
by throwing a NotSupportedException.

Addresses https://github.com/mono/mono/issues/15931
2019-08-26 17:13:45 -04:00
Zoltan Varga 65a71a2912 Fix review comments. 2019-08-26 14:17:09 -04:00
Egor Bogatov 044d1519bd Implement Lzcnt hw intrinsics 2019-08-26 21:08:53 +03:00
Egor Bogatov 85265d884c [netcore] Implement missing ThreadPool methods (for metrics) (#16076)
* Implement missing ThreadPool methods

* Address feedback

* ifdef for mono_threadpool_worker_get_completed_threads_count

* remove GetPendingUnmanagedWorkItemCount
2019-08-26 11:35:38 -04:00
Zoltan Varga a908b72037 [runtime] Convert mono_reflection_create_custom_attr_data_args () to use handles. 2019-08-26 11:17:15 -04:00
Johan Lorensson f9be7a67d3 Fix special case tramp assert in x86/amd64. (#16476)
https://github.com/mono/mono/pull/16408 temporary fixed a tramp issue on
x86 (also exist on amd64). This commit fixes the underlying issue and re-enable
the use of noreturn outside of netcore.

The problem hit by the use of OP_NOT_REACHED on x86/amd64 is due to a specific
case when the address to patch happens to fall at the start of a different
managed method. Since the use of OP_NOT_REACHED can end a method
with the call instruction on x86/amd64 in combination with how patch location
(using the return address from stack) is resolved, the implementation in
mono_arch_patch_callsite didn't take this case into account, reading incorrect
patch data, triggering assert oh x86. So, based on timing we could end up with
the following code:

025715B3 call 02570D98
025715B8 push ebp

since the patch target is 025715B8, but also the start of a completely different
method, method_start == origin_code. The fix is to detect this case on x86/amd64
(done on each arch since the way origin_code is detected is arch specific)
and then use a method_start of NULL, that is already a supported scenario.
2019-08-26 16:46:43 +02:00
monojenkins 80504b8c98 [bcl] Update BCL Linked Size (#16427) 2019-08-26 14:01:25 +02:00
Jan Kotas 501b9cc3dd Fix BinaryReader.ReadChars for fragmented Streams (dotnet/coreclr#26324)
BinaryReader.ReadChars incorrectly read more than necessary from the underlying Stream when multi-byte characters straddled the read chunks.

Fixes https://github.com/dotnet/corefx/issues/40455

Signed-off-by: dotnet-bot <[email protected]>
2019-08-26 13:56:53 +02:00
Next Turn 366f2750cd Remove unnecessary !s for [DoesNotReturn] (dotnet/coreclr#26350)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-26 13:56:53 +02:00
Stephen Toub 37c6d154ef Contribute to IDE0055 (fix formatting)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-26 13:56:53 +02:00
Stephen Toub 2f11eff09b Contribute to StyleCop SA1002 (semicolon spacing)
However, I'm not enabling the rule permanently, as it disagrees with VS IDE0055 about the spacing around semicolons at the end of empty while and for loops.

Because this also impacts `for (;;)` loops, I also searched and replaced those with `while (true)`, to standardize on that across the codebase.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-26 13:56:53 +02:00
Stephen Toub a86fb8c847 Fix StyleCop warning SA1001 (spaces around commas)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-26 13:56:53 +02:00
Alexander Köplinger 2f2771fcfa [utils] Don't use MAP_32BIT on Apple platforms, fixes crash with XCode 11 beta6 (#16441)
As of XCode 11 beta6 the MacOSX SDK defines the MAP_32BIT symbol:

```diff
--- /Applications/Xcode11-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/mman.h    2019-07-25 17:43:49.000000000 -0400
+++ /Applications/Xcode11-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/mman.h    2019-08-06 21:03:07.000000000 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2019 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  *
@@ -145,6 +145,10 @@
 #define MAP_RESILIENT_CODESIGN  0x2000 /* no code-signing failures */
 #define MAP_RESILIENT_MEDIA     0x4000 /* no backing-store failures */

+#if !defined(CONFIG_EMBEDDED)
+#define MAP_32BIT       0x8000          /* Return virtual addresses <4G only: Requires entitlement */
+#endif  /* !defined(CONFIG_EMBEDDED) */
+
 #endif  /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */

 /*
```

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.
2019-08-26 13:53:40 +02:00
Egor Bogatov 6aaec2fe9b Optimized LLVM IR (#16448)
LLVM JIT: dump IR after optimizations 

```csharp
[MethodImpl(MethodImplOptions.NoInlining)]
static int Test(int a, int b, int c) => a * b + a * c;
```
`MONO_VERBOSE_METHOD="Test"` now prints both unoptimized and optimized IR:
```llvm
*** Unoptimized LLVM IR for P:Test ***

; Function Attrs: noinline uwtable
define monocc i32 @"P:Test (int,int,int)"(i32 %arg_a, i32 %arg_b, i32 %arg_c) #0 {
BB0:
  br label %BB3

BB3:                                              ; preds = %BB0
  br label %BB2

BB2:                                              ; preds = %BB3
  %t22 = mul i32 %arg_a, %arg_b
  %t25 = mul i32 %arg_a, %arg_c
  %t27 = add i32 %t22, %t25
  br label %BB1

BB1:                                              ; preds = %BB2
  ret i32 %t27
}
***


*** Optimized LLVM IR for P:Test ***

; Function Attrs: noinline uwtable
define monocc i32 @"P:Test (int,int,int)"(i32 %arg_a, i32 %arg_b, i32 %arg_c) #0 {
BB0:
  %t251 = add i32 %arg_b, %arg_c
  %t27 = mul i32 %t251, %arg_a
  ret i32 %t27
}
***
```
2019-08-26 07:36:04 -04:00
Jay Krell 6671316e35 [interp] Cleanup stackval_to_data and stackval_to_data_addr. (#16458)
No functional change, except for debugging, look up a frame
for the prior value.
2019-08-26 10:26:07 +02:00
Bernhard Urban b6ca76c484 [android] remove text relocations in AOT/arm32 (#16432)
[android] remove text relocations in AOT/arm32

Remove support for "big assemblies" for AOT on Android running on ARM 32bit. This will remove relocations in `.text` which are not allowed in the upcoming Android Q release anymore.

_If_ a customer should run into this problem, the suggested workarounds are:
* Switch to ARM64, or
* Do not use AOT compilation.

Fixes https://github.com/mono/mono/issues/16369
2019-08-26 03:46:12 -04:00
Ryan Lucia 510f3c7d70 Detect additional invalid assembly names when parsing (#16446) 2019-08-25 23:13:39 -04:00
Jay Krell e95ef822a1 Add MONO_LLVM_INTERNAL to mono_jit_compile_method. (#16463) 2019-08-25 23:52:17 +02:00
Jay Krell 2224d6b55d [interp] Outline mono_interp_box_vt. (#16454)
Contributes to https://github.com/mono/mono/issues/16172.

Seen to reduce frame from 0xB8 to 0xA8 on Linux/amd64/gcc against master.
Possibly similar elsewhere.
(Possibly 8 added to a rounded 8.)

Add const, add braces, they might help compiler and/or programmer.
2019-08-25 19:11:02 +02:00
Zoltan Varga 7d43ffda1a [runtime] Make the local gc handles pin the object they point to by scanning
the handle area conservatively.
2019-08-24 15:46:33 -04:00
Jay Krell 9d1eec6bf8 [interp] Outline STRMFLD_VT. (#16355)
Without being entirely scientific about it, this case seems
to be one that uses more than typical locals and therefore
be on a sort of critical path to reduce frame size.

I have a change that reduces frame to 0x78 bytes (albeit
not yet working) and to achieve that, in this case I refetched
the locals after function calls.

This achieves similar but perhaps more elegantly.

If we rest at larger frame size then this case might not be
on the critical path.

https://github.com/mono/mono/issues/16172
2019-08-24 09:56:40 +02:00
Jay Krell 99e9d80642 [windows gc] Trim one syscall per thread in garbage collection. (#16003)
* Skip one syscall per thread in garbage collection.
Specifically do not query for guard pages.
There are better ways:
 1. Visual C++ specific, __try / __except, get the guard page exception,
    put back the guard page. This is a little slower (exception + two syscalls),
    but exceedinly rare. __try itself is cheap on x86, free on the rest.
    This was also not allowed on UWP. It will be. And is VirtualProtectFromApp.

 2. Record the TEB and get from it the maximum commited page and just use MAX, trivial.

The comments are also not completely clear as to what is going on here, but they were close.
Augment them.
2019-08-24 09:56:00 +02:00
Jay Krell ab6a09741d Remove dlmalloc from Win32. (#15773) 2019-08-24 09:52:30 +02:00
Alexander Köplinger 3a409e8a7f Pass --clr-memory-model in csc/vbc wrapper script (#16439)
Should help with random CSC crashes on ARM (we've been using it in the Mono build for a while).
2019-08-24 00:08:25 +02:00
Zoltan Varga ab9c58d76d Merge pull request #16414 from vargaz/llvm-gc-poll-wrapper
[llvm] Add a mono wrapper method for the gc poll cold cconv wrapper so the EH code can unwind through it.
2019-08-23 18:06:17 -04:00
Ryan Lucia 83cf007ae3 Return an empty string for assemblies loaded from stream (#16345)
* Return an empty string for assemblies loaded from memory

* Blind attempt to fix wasm
2019-08-23 15:58:10 -04:00
Ryan Lucia 7615ba3e45 [netcore] Use requesting assembly's context for InternalLoad calls 2019-08-23 15:30:04 -04:00
Ryan Lucia 0661bf0424 [netcore] Random loader cleanup 2019-08-23 15:30:04 -04:00
Nathan Ricci f6b2befe8d Removed trailing whitespace. 2019-08-23 13:57:01 -04:00
Nathan Ricci 707db63569 Added stub for boehm. 2019-08-23 13:45:23 -04:00
Nathan Ricci cdb77f1391 Fixed fomatting issues. 2019-08-23 13:42:34 -04:00
Tarek Mahmoud Sayed cb1f7c0677 Cleanup GregorianCalendarHelper leap month checks (dotnet/coreclr#26321)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-23 15:43:54 +02:00
Alexander Köplinger 278fd48274 Bump corefx to get https://github.com/mono/corefx/pull/336 2019-08-23 14:43:05 +02:00
Zoltan Varga f0cbb79b7f Merge pull request #16431 from kjpou1/wasm-maindir-cleanup
[wasm] Small cleanup of main wasm directory
2019-08-23 08:13:21 -04:00
Zoltan Varga 97d2d97615 [jit] Make mono_unwind_frame () ignore registers which are greater than NUM_DWARF_REGS.
These registers can be encountered in the unwind info for functions with a cold
cconv, like xmm0 on amd64. Since they are caller saved, they don't have to
be restored during EH.
2019-08-23 07:49:20 -04:00
Zoltan Varga fdd0d7f027 Merge pull request #16429 from vargaz/llvm-jit-module
[llvm] Don't pass a module argument to the code in llvm-jit.cpp, we create a new LLVM module for each method.
2019-08-23 06:40:09 -04:00
Zoltan Varga 81f736e774 Fix the bitcode build. 2019-08-23 06:28:40 -04:00
Zoltan Varga 4ed1c3335f [llvm] Add a cold wrapper and mono wrapper for gc poll for JITted code as well. 2019-08-23 05:34:52 -04:00
Kenneth Pouncey f5717d21bb Address review comments wasm/support to wasm/src 2019-08-23 11:11:57 +02:00
Zoltan Varga 0d603261a0 Fix the build. 2019-08-23 04:41:50 -04:00
Zoltan Varga f6b189ecab [llvm] Add a mono wrapper method for the gc poll cold cconv wrapper so the EH code can unwind through it. 2019-08-23 04:41:50 -04:00
Zoltan Varga 8ace375450 Merge pull request #16407 from vargaz/fix-llvm-simd
[llvm] Fix type issues in the llvm IR emitted for SIMD. Fix a warning.
2019-08-23 04:41:10 -04:00
Zoltan Varga 14a76b03c5 Merge pull request #16408 from vargaz/noreturn-methods
[jit] Special case the ThrowHelper methods only on netcore.
2019-08-23 04:40:28 -04:00
Egor Bogatov 47efe6bab0 Merge pull request #16412 from EgorBo/fix-ci4
[netcore] Fix CI, ignore failing tests
2019-08-23 11:17:31 +03:00
Kenneth Pouncey 8b338a9619 [wasm] Small cleanup of main wasm directory
- Move source support files for custom building the wasm runtimes to a new directory called `wasm/support`
- Modified `packager.exe` to build from this new subdir.
- Updated the README.md to document the change.
2019-08-23 09:59:31 +02:00
Zoltan Varga c357de87ec [llvm] Don't pass a module argument to the code in llvm-jit.cpp, we create a new LLVM module for each method. 2019-08-23 03:27:41 -04:00
Zoltan Varga c97bfe2167 Merge pull request #16379 from EgorBo/improve-dump
Improve MONO_VERBOSE_METHOD
2019-08-23 02:08:12 -04:00
Michal Strehovský 9bffb810ee Mark methods specially handled in JitInterface Intrinsic (#26209)
* Mark methods specially handled in JitInterface Intrinsic

For CPAOT compiler's sake.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-23 00:51:24 +02:00
coypoop f626f3e7aa If either sched_get_priority_{min,max} failed, don't try to set a priority (#15898)
netbsd and linux both require that if SCHED_OTHER is used, a fixed value is used for sched_param ([0 for linux](http://man7.org/linux/man-pages/man7/sched.7.html), -1 for netbsd)

the netbsd case can also be detected by the [POSIX-defined failure](https://pubs.opengroup.org/onlinepubs/007908799/xsh/sched_get_priority_min.html) return value for sched_get_priority_min, a return value of -1.
2019-08-23 00:46:08 +02:00
EgorBo 71dce6502a ignore FSW test 2019-08-23 01:12:47 +03:00
Martin Baulig 473d07a86c Fix issue in SafeHandle.DangerousReleaseInternal() that caused #16034. (#16244)
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.
2019-08-22 23:46:31 +02:00
Nathan Ricci 93ff9dab7b Removed start/stop the world gc api. 2019-08-22 16:50:58 -04:00
EgorBo 692f70cb67 ignore more tests 2019-08-22 23:08:44 +03:00
EgorBo 40cf68aa98 Disable the whole System.ComponentModel.Composition namespace 2019-08-22 21:47:45 +03:00
Stephen Toub f5a1fa4744 Fix IDE0034 (simplify default expression)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub f256a4525d Fix IDE0054 (use compound assignment)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub e2c7b4200a Fix (mostly) IDE0055 (formatting)
Lots of various spacing issues.  I say "mostly" because I explicitly undid some changes that added to rather than reduced inconsistency, e.g. region indents.  We can revisit that later.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub 9be0c2217c Fix StyleCop warning SA1114 (parameter list should follow declaration)
Fixed just be removing stale/unnecessary comments.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub d3817c9302 Fix StyleCop warning SA1006 (empty statements)
This is just running the rule and auto-fixing everything.  I undid changes that converted e.g. `while (...);` to `while (...) { }`.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub 35d8ca894b Fix StyleCop warning SA1005 (single line comment spacing)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub 55bc2fee8a Fix (mostly) StyleCop warning SA1003 (operator symbol spacing)
The "mostly" here is that I undid changes where it was forcing formatting around a `: this` or `: base` call for a ctor, in particular where it was moving one up from the next line to be at the end of the current line.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub e23c35f730 Fix StyleCop warning SA1024 (colon spacing)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub 26656df25e Fix StyleCop warning SA1015 (closing generic brace spacing)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub f3b0e98aae Fix StyleCop warning SA1013 (closing brace spacing)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub ac42e06fea Fix StyleCop warning SA1012 (opening brace spacing)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub 8c01fd5189 Fix StyleCop warning SA1008 (opening paren spacing)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub f83a8da0ce Fix StyleCop warning SA1002 (semicolon spacing)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub 46302d54aa Fix StyleCop warning SA1001 (commas followed by whitespace)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Nathan Ricci bfce92d9dd Added tracking for detached threads. 2019-08-22 14:14:39 -04:00
EgorBo 7678654781 fix macOS 2019-08-22 20:53:14 +03:00
Steve Pfister fbdad78101 Added a workaround for an issue with the compiler server on 32-bit linux. (#16405)
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-L59
2019-08-22 18:22:22 +02:00
EgorBo 779fda5103 update rsp 2019-08-22 19:02:53 +03:00
EgorBo f809fe55a8 ignore some tests 2019-08-22 18:52:52 +03:00
Stephen Toub 4dd0a137a4 Avoid race condition in DiagnosticCounter (dotnet/coreclr#26260)
* Avoid race condition in DiagnosticCounter

If while a DiagnosticCounter instance is being created the timer fires to process counters, the timer may end up evaluating a DiagnosticCounter whose constructor or derived types' constructor hasn't finished configuring the instance's state yet.

* Remove unnecessary #if

Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 16:59:43 +02:00
Nikolay Sivov 068660732f [corlib] Improve file:// url handling in AppDomainSetup. (#16161)
* [corlib] Improve file:// url handling in AppDomainSetup.

WiX 3 installer toolkit uses file:/// prefix when setting ApplicationBase for newly created domain.
Currently this leads to invalid path exception:

file:///C:\... -> /C:\... -> full path expansion with current workdir on different drive -> Y:\C:\...

Later it fails check for multiple ':' -> NotSupportedException ("The given path's format is not supported.").

This patch uses logic already present in AppDomain::Load().

* [Test] Add a test for file:/// application base.

* [Test] Fix test failure on Windows.

* [corlib] Simplify file: protocol check for AppDomainSetup.
2019-08-22 16:54:32 +02:00
Zoltan Varga 49f913ac8a [jit] Special case the ThrowHelper methods only on netcore. 2019-08-22 10:36:43 -04:00
Zoltan Varga f2f58e522b [llvm] Fix type issues in the llvm IR emitted for SIMD. Fix a warning. 2019-08-22 10:28:47 -04:00
Aleksey Kliger (λgeek) e74736a471 [android] mono_dl_open_file: use g_file_test only on absolute paths (#16387)
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 10:10:09 -04:00
Zoltan Varga f6b0c9b772 Merge pull request #16300 from EgorBo/llvm-fpm
Use basic LLVM optimizations (PassManager) in JIT mode
2019-08-22 09:07:02 -04:00
Jay Krell 5368fef5ee [interp] Replace endsp with preexisting child_frame.retval which appears equivalent. (#16378)
This should conserve stack. I didn't verify it.
child_frame being address-taken, compiler would struggle to remove it.
So we have the same value in two places.

https://github.com/mono/mono/issues/16172
2019-08-22 14:57:38 +02:00
Zoltan Varga 87a6364d58 Merge pull request #16390 from EgorBo/intptr-intrinsic
Make IntPtr.Zero intrinsic
2019-08-22 08:43:07 -04:00
Zoltan Varga 341cc0dd83 Merge pull request #16386 from vargaz/llvm-inline-limit
[llvm] Use a different inline limit (30) for llvm+aot.
2019-08-22 08:26:10 -04:00
Zoltan Varga 3f21a2c8f3 Merge pull request #16384 from vargaz/fix-16381
[llvm] Fix an assert.
2019-08-22 07:26:36 -04:00
Zoltan Varga 254d6d3758 Merge pull request #16389 from vargaz/fix-16380
[aot] Simplify a check to avoid calling into the assembly loading code while loading the aot image for corlib.
2019-08-22 05:36:17 -04:00
Zoltan Varga b7ca80ed58 Add comments. 2019-08-22 00:34:32 -04:00
Egor Bogatov 279676f43e Update llvm-jit.cpp 2019-08-22 01:46:10 +03:00
Egor Bogatov d02695ef47 cleanup 2019-08-22 01:43:56 +03:00
Egor Bogatov 1822f2faab Merge remote-tracking branch 'origin/master' into llvm-fpm 2019-08-22 00:47:40 +03:00
Nathan Ricci 6caa530970 Removed unneeded declarations. 2019-08-21 17:31:34 -04:00
Bernhard Urban 5c9be2dc2b [netcore] Use Release configuration for default System.Private.CoreLib build (#16391)
It seems the Configuration set inside of the System.Private.CoreLib.csproj is just completely ignored, making it default to "Debug".

Maybe because we're using Microsoft.NET.Sdk ?
2019-08-21 23:16:03 +02:00
Nathan Ricci b65443f324 Added stubs in null, boehm. 2019-08-21 16:55:51 -04:00
Nathan Ricci f913945e76 Implemented precise. 2019-08-21 16:27:02 -04:00
Nathan Ricci dc8aeba593 stopped the world for precise. 2019-08-21 16:05:29 -04:00
Nathan Ricci 56f44379d0 Took changes from miguel's branch. 2019-08-21 15:54:07 -04:00
Nathan Ricci 65360da5d9 Working on precise. 2019-08-21 15:51:45 -04:00
Egor Bogatov cb34178cd6 use EMIT_NEW_PCONST 2019-08-21 21:48:14 +03:00
Egor Bogatov d3ecd70ead Make IntPtr.Zero intrinsic 2019-08-21 21:23:19 +03:00
Zoltan Varga c4de19ef09 [aot] Simplify a check to avoid calling into the assembly loading code while loading the aot image for corlib.
Fixes https://github.com/mono/mono/issues/16380.
2019-08-21 14:15:25 -04:00
Nathan Ricci 0754f5ebe5 Fixed alphabitization error. 2019-08-21 13:59:50 -04:00
Nathan Ricci cfb4afff43 Got rid of some debug code. 2019-08-21 13:55:20 -04:00
Zoltan Varga 433b9a7f70 [llvm] Use a different inline limit (30) for llvm+aot. 2019-08-21 12:20:50 -04:00
Zoltan Varga 0e2da3c2ab [llvm] Fix an assert.
Fixes https://github.com/mono/mono/issues/16381.
2019-08-21 12:03:20 -04:00
Nathan Ricci 53939d0790 Implemeneted imprecise. 2019-08-21 11:20:27 -04:00
EgorBo 26d73b94f6 cleanup 2019-08-21 14:34:00 +03:00
EgorBo 467a561dcb Merge remote-tracking branch 'origin/master' into ffast-math
# Conflicts:
#	mono/mini/llvm-jit.cpp
#	scripts/ci/pipeline-netcore-runtime.yml
2019-08-21 14:30:07 +03:00
EgorBo ad713a70ef Merge remote-tracking branch 'origin/master' into llvm-fpm 2019-08-21 14:20:57 +03:00
Egor Bogatov 50b57fe926 Update mini.c 2019-08-21 14:07:59 +03:00
Egor Bogatov 6bb1e5ffc4 Update mini-llvm.c 2019-08-21 14:07:02 +03:00
Egor Bogatov e5acc9be7a undo change in mini.c 2019-08-21 14:04:57 +03:00
Egor Bogatov b0b3743f36 Improve MONO_VERBOSE_METHOD 2019-08-21 13:35:40 +03:00
Kenneth Pouncey 935d0a54e7 [wasm] Make sure message pump is working when run via webworker. (#16325)
- Tests if we are running in ENVIRONMENT_IS_WORKER
   - run message pump if we are.

- This also fixes gc not running.

issue: https://github.com/mono/mono/issues/16319
2019-08-21 06:24:06 +02:00
Zoltan Varga 977ccf7cb2 Merge pull request #16363 from vargaz/tp-thread-name
[runtime] Avoid resetting the tp thread name on every call to worker_callback ().
2019-08-20 23:14:44 -04:00
Zoltan Varga 285f33efe6 Merge pull request #16286 from vargaz/netcore-simd
[netcore] Add a netcore version of simd-intrinsics.c.
2019-08-20 23:11:27 -04:00
Nathan Ricci 37086aa1c4 Put things in correct order. 2019-08-20 18:28:35 -04:00
Nathan Ricci bf04a1946f Modified sample project. 2019-08-20 17:38:23 -04:00
Nathan Ricci fb7895dddf Added ical to netcore. 2019-08-20 17:37:58 -04:00
Alexander Köplinger 38c524cc2a Fix Windows build 2019-08-20 22:55:39 +02:00
Alexander Köplinger 55f2c4d6ad [profiler] Rename helper functions to have common prefix
Unfortunately https://github.com/mono/mono/pull/16335 didn't fix the new symbols showing up in the log profiler module.
The reason is that we actually pass `--disable-visibility-hidden` for iOS builds in https://github.com/mono/mono/blob/0b6d95e8ce7c882e2db9e89fa0dec850c687f65e/sdks/builds/ios.mk#L98.

Rename the helper functions instead to have a common prefix so they can be ignored in xamarin-macios tests.
2019-08-20 22:55:39 +02:00
Aleksey Kliger ed0063b4d5 [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
2019-08-20 16:13:41 -04:00
Aleksey Kliger c38044d74f [w32error] Add WSA_INVALID_PARAMETER and WSA_INVALID_HANDLE 2019-08-20 16:13:41 -04:00
Ryan Lucia fc5e3fa039 [netcore] Remove local copy of static alc resolve methods 2019-08-20 21:25:00 +02:00
Ryan Lucia 3b47d28e37 Move AssemblyLoadContext VM-invoked static resolve methods to shared (#26248)
Shared between CoreCLR and Mono. Mono began using a copy of these methods with https://github.com/mono/mono/pull/16256/

Signed-off-by: dotnet-bot <[email protected]>
2019-08-20 21:25:00 +02:00
Nathan Ricci c1d01679c5 Merge branch 'master' of github.com:naricc/mono into naricc/GetTotalAllocatedBytes 2019-08-20 15:22:18 -04:00
Alexander Köplinger a147402d07 [ci] FreeBSD: Make sure we have gmake in /usr/bin 2019-08-20 21:08:54 +02:00
Alexander Köplinger ac3aa7c1c7 Bump corefx to get https://github.com/mono/corefx/pull/332 2019-08-20 20:52:02 +02:00
Stephen Toub 5f38497e19 Remove unused usings from Corlib (dotnet/coreclr#26250)
* Fix IDE0065 (misplaced using)

* Fix IDE0005 (remove unnecessary usings)

Signed-off-by: dotnet-bot <[email protected]>
2019-08-20 19:45:30 +02:00
madmir 4dd016004b Re-enable xunit warning 1019 (dotnet/corefx#40415)
Make MemberData reference IEnumerable<object[]>

Signed-off-by: dotnet-bot <[email protected]>
2019-08-20 19:45:30 +02:00
Ryan Lucia 0b6d95e8ce [netcore] Remove unnecessary calls to mono_domain_get (#16336)
Should use mono_alc_domain where possible
2019-08-20 12:55:54 -04:00
Alexander Köplinger 5dc4a86d9d [netcore] Consolidate running tests between AzDO pipeline and Makefile (#16348)
* [netcore] Consolidate running tests between AzDO pipeline and Makefile

There was some unnecessary duplication between the two that we can remove.

* Add timeout to test execution
2019-08-20 17:59:55 +02:00
Zoltan Varga 8a413fad71 Fix the build. 2019-08-20 11:32:46 -04:00
Zoltan Varga b5cfeb3b5b [runtime] Avoid resetting the tp thread name on every call to worker_callback (). 2019-08-20 11:31:12 -04:00
Phil Jaenke b7dc4f0a46 Fix Jenkins build failure due to missing dependencies (#16362)
Jenkins builds are failing due to missing gettext; also realized that graphics unit tests will fail without some additional packages that will not be pulled in automatically.

Added:
`gettext-runtime gettext-tools cairo libdrm mesa-dri mesa-libs`
2019-08-20 16:19:36 +02:00
Jo Shields 3070ab6a96 Pass -fvisibility=hidden to profiler modules. (#16335)
* Pass -fvisibility=hidden to profiler modules.

This appears to not break the profilers:

```
directhex@breakfast:/tmp$ nm -g /tmp/ponyponyponypony/lib/libmono-profiler-log.so | grep close_socket_fd
directhex@breakfast:/tmp$
directhex@breakfast:/tmp$ /tmp/ponyponyponypony/bin/mono --profile=log:report bottle.exe
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 99 bottles of beer on the wall.

[..]

No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.

Mono log profiler data
	Profiler version: 3.0
	Data version: 17
	Arguments: log:report
	Architecture: x86-64
	Operating system: linux
	Mean timer overhead: 86 nanoseconds
	Program startup: Mon Aug 19 14:18:30 2019
	Program ID: 17715
	Server listening on: 41539

JIT summary
	Compiled methods: 753
	Generated code size: 228046
	JIT helpers: 0
	JIT helpers code size: 0

GC summary
	GC resizes: 0
	Max heap size: 0
	Object moves: 0

Metadata summary
	Loaded images: 3
	Loaded assemblies: 3

Exception summary
	Throws: 0
	Executed finally clauses: 3

Thread summary
	Thread: 0x7fcd968c9700, name: "Finalizer"
	Thread: 0x7fcd966c8700, name: "Profiler Sampler"
	Thread: 0x7fcd9b036780, name: "Main"
	Thread: 0x7fcd964c7700, name: "Profiler Helper"
	Thread: 0x7fcd954c5700, name: "Profiler Dumper"
	Thread: 0x7fcd95cc6700, name: "Profiler Writer"

Domain summary
	Domain: (nil), friendly name: "bottle.exe"

Context summary
	Context: (nil), domain: (nil)

Counters:
	Mono System:
		User Time                      : 70.000ms
		System Time                    : 0.000ms
		Total Time                     : 140.000ms
		Working Set                    : 22032384
		Private Bytes                  : 63455232
		Virtual Bytes                  : 449630208
		Page Faults                    : 3004
		CPU Load Average - 1min        : 1.870000
		CPU Load Average - 5min        : 2.670000
		CPU Load Average - 15min       : 2.900000
	Mono JIT:
		Methods from AOT               : 536
		Methods JITted using mono JIT  : 154
		Methods JITted using LLVM      : 0

```

* Add missing annotations and includes
2019-08-20 16:17:26 +02:00
Calvin Buckley b57d52ce77 Fix minizip compile on Haiku (#16301)
it doesn't have f*64 funcs, it seems
2019-08-20 16:00:24 +02:00
Jay Krell 169205813b [interp] Outline box_nullable. (#16356)
Without being entirely scientific about it, this case seems
to be one that uses more than typical locals and therefore
be on a sort of critical path to reduce frame size.

I have a change that reduces frame to 0x78 bytes (albeit
not yet working) and to achieve that, in this case I refetched
the locals after function calls.

This achieves similar but perhaps more elegantly.
If we rest at larger frame size then this case might not be on the critical path.

https://github.com/mono/mono/issues/16172.
2019-08-20 15:53:25 +02:00
Jan Kotas 1592d2a8fa Change missed by the mirror (dotnet/coreclr#26251)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-20 15:37:10 +02:00
Phil Jaenke 317e741c02 Many updates to freebsd.sh (#16342)
* Many updates to make it better

Too much to list by many measures. This makes sure appropriate kernel modules, file systems, build packages, supplemental packages, and directories are installed or created as appropriate. This also addresses a known failure condition in System.Security-xunit due to a missing directory resulting in ownership problems.

* Make corrections for Azure

I don't have an Azure to test with, so I missed that the script is calling with `-e` and that Azure uses a non-`GENERIC` kernel with procfs baked in (likely required for Azure drivers.)
2019-08-20 15:35:18 +02:00
Egor Bogatov c231a357a7 Merge branch 'master' into ffast-math 2019-08-20 14:19:06 +03:00
Jay Krell ea29349f77 [interp] Reduce register/stack pressure esp. around vtable initialization. (#16349)
Part of #16172 though not necessarily any gain from this change, at this time.
2019-08-20 13:03:12 +02:00
Alexander Köplinger b205f1bd9c [interp] Reduce register/stack pressure slightly, i.e. so that field does not have (#16339)
to be preserved across `mono_get_special_static_data ()` if non-volatile registers
are all otherwise allocated.
2019-08-20 12:04:30 +02:00
Jay Krell 33153ddd2d [interp] Relieve register/stack pressure around mono_thread_internal_current. (#16341)
Part of #16172 though not necessarily any gain from this change, at this time.
We might want to expose ifdef and inline mono_thread_internal_current also or instead.
2019-08-20 12:03:48 +02:00
Alexander Köplinger 5ebce09c51 Bump bockbuild to get gtksharp 2019-08-20 11:54:59 +02:00
Jay Krell bc2accfc7e Fix warnings. (#16287)
debug-mono-ppdb.c ppdb_compressed_size may be used uninitialized
   ppdb_size may be used uninitialized
 image.c iinfo set but not used
 icall.c klass set but not used
2019-08-20 11:47:38 +02:00
Egor Bogatov 8800f7c166 Update pipeline-netcore-runtime.yml 2019-08-20 12:14:23 +03:00
Egor Bogatov 4a5e2a3f79 Update pipeline-netcore-runtime.yml 2019-08-20 12:13:59 +03:00
Alexander Köplinger 9a5ae23f7e [netcore] Use Release configuration for CI builds (#16329)
* [netcore] Use Release configuration for CI builds

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

* [ci] Ensure the artifacts/logs/Release folder exists

Some arcade steps need the path to exist and we only create artifacts/logs/Debug right now,
because that folder is created by eng/common/tools.sh used by init-tools.sh defaulting to Debug.
2019-08-19 23:52:01 +02:00
Jay Krell 31aed632ba [interp] Inline MINT_NEWOBJ_VTST_FAST (#16314)
For purposes of stack savings, only MINT_NEWOBJ_VT_FAST w/o the "ST"
needed to be outlined, and inlining also the ST form increased
its stack use, w/o savings elsewhere.

That is, the recursive cases should generally not be outlined.
We were outlining two. We still outline one.

This is partially undoing my recent change, where I outlined both of these, but only one was justified.
2019-08-19 23:48:20 +02:00
Egor Bogatov feac6c0d04 temp: run tests on CI 2019-08-19 23:30:41 +03:00
Jay Krell 2313f1a884 [interp] Reduce register/stack pressure slightly, i.e. so that field does not have
to be preserved across `mono_get_special_static_data ()` if non-volatile registers
are all otherwise allocated.
2019-08-19 13:02:49 -07:00
Ryan Lucia 7c3dfbcbdf [netcore] Update ALC test exclusions (#16332) 2019-08-19 14:50:15 -04:00
Aleksey Kliger (λgeek) 2f0cbb5aa5 [coop] Add a handle frame in construct_culture (#16299)
Otherwise we see warnings like these:

```
ves_icall_System_Globalization_CultureInfo_internal_get_cultures_raw USED 680 handles
```
2019-08-19 11:01:09 -04:00
Alexander Köplinger 0ad1f5cca1 [ci] Add CI VM provisioning script for FreeBSD to the repo (#16326)
We'll download it from GitHub instead of storing it in Jenkins admin config.

Trial run with FreeBSD for moving all the other provisioning scripts to the repo too.
2019-08-19 14:44:00 +02:00
Martin Baulig a3c31b9ef7 Add missing Dispose() call on error in MonoTlsStream.CreateStream(). (#16233)
* Add missing `Dispose()` call on error in `MonoTlsStream.CreateStream()`.

* Remove the `finally` block to make it more easy to read.
2019-08-19 14:23:28 +02:00
Vincent Povirk 9f790cd5e2 eglib: Remove broken executable test on Windows. (#16295)
The strcmp is wrong, and it doesn't test anything meaningful anyway.

This flag is unused since #16156 was merged.
2019-08-19 13:09:14 +02:00
Jan Kotas a723047f68 Fix CoreRT build breaks
Signed-off-by: dotnet-bot <[email protected]>
2019-08-19 13:07:13 +02:00
Stephen Toub ad63045907 Remove useless GetLongPathNameW call (dotnet/coreclr#26210)
Immediately after calling this we're going to loop around and call it again at the beginning of the while loop.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-19 13:07:13 +02:00
Egor Bogatov 77a9c82523 Introduce ffast-math 2019-08-19 13:07:43 +03:00
Jay Krell 8886f71b2c [interp] Remove InterpFrame.locals, replace with reasonably efficient frame_locals macro.o (#16317)
Contributes to #16172.
2019-08-19 11:50:20 +02:00
Alexander Köplinger e754bb1c43 [interp] Put finally data back in locals instead of frame to save 16 bytes of stack. (#16307)
* Put finally data back in locals instead of frame to save 16 bytes of stack.

Partial undo of f8fd60b5c0.

* Add comments explaining goto main_loop vs. MINT_IN_DISPATCH.
2019-08-19 11:24:44 +02:00
Jay Krell 60cd1b3556 [interp] Outline ves_array_element_address to save 16 bytes of stack on Linux/amd64/clang. (#16304)
Contributes to #16172.
2019-08-19 11:24:10 +02:00
Alexander Köplinger 9001c4fa83 thread names: coop, constants, usually ignore-error. (#16272)
- Convert setting thread name to be coop-compatible.

- For constant thread names, just retain the constant, not a copy.
  This includes producing and using constant unicode thread names on Windows.

- Make setting a thread name often non-fatal, except where mandated by public API.

- From earlier PR: mono_free (mono-publib.c) would no longer be referenced and therefore
  no longer exported. That broke profilers and maybe other externals.
  Choices:
     1 Use it instead of g_free randomly sometimes.
     2 Call it randomly sometimes.
     3 include it in external-only.c or object.c
     4 Mark it external only (breaks profiler).
     5 Use a .def file or Unix equivalent.

     5 is best, 2 is done here, the advantages/disadvantages
     among most choices are subtle. 3 is probably better than 2
     but is slightly bigger change, to put off -- you'd stop
     compiling mono-publib.c and move it to include/extra_redist.

     The advantage of not-.def file is perhaps that it is exposed
     by the compiler, so maybe easy to port and work with.
     People are more comfortable with obscure C extensions than
     any linker options, and there are multiple linkers to contend
     with. Arguably there are fewer compilers.
2019-08-19 11:23:23 +02:00
Jay Krell cf0ce4f55a Reduce size of internal MonoErrors by 3 pointers, while trying to be compatible with old size.(#16218)
There is an incompatibility here.

If Mono hands off an InternalError and it is accessed
like an ExternalError, like memset(sizeof()), bad.

Hopefully nobody does that.

There is also compatability -- embedders can continue to embed MonoError
in their own data. Its size and hopefully alignment is unchanged.
2019-08-19 11:20:37 +02:00
Jay Krell 047c7d35fa [interp] Replace frame.args with frame.stack, the same except for type (#16316)
Contributes to #16172.
2019-08-19 11:19:10 +02:00
Vlad Brezae 975b543e92 [interp] Make sure we allocate stack for MINT_LD_DELEGATE_INVOKE_IMPL (#16224)
* [interp] Make sure we allocate stack for MINT_LD_DELEGATE_INVOKE_IMPL

This opcode is pushing a function pointer from the delegate, so it needs to have stack reserved.

* [interp] Fix overflow of stack space
2019-08-19 11:59:21 +03:00
Jay Krell cecea63691 warning: mono-threads-wasm.c no previous prototype for function mono_background_exec (#16289) 2019-08-19 05:22:06 +02:00
Stephen Toub 04909573e7 Undo use of Index/Range in files compiled into netfx-compat assemblies
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 22:12:06 +02:00
Stephen Toub 424af0fb98 Fix DecoderExceptionFallbackBuffer message (dotnet/coreclr#26211)
When the number of unknown bytes is exactly 20, the message includes a misleading " ..." at the end.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 22:12:06 +02:00
Jay Krell d1f47e7b48 [interp] Reduce register/stack pressure slightly. (#16303)
No savings on Linux/amd64/gcc/clang.
2019-08-18 17:36:33 +03:00
Zoltan Varga e1b57c371a Fix the build. 2019-08-18 08:48:15 -04:00
Zoltan Varga 4503b67a0b Implement a subset of Intel BMI1/BMI2 intrinsics used by corelib. 2019-08-18 06:08:31 -04:00
Zoltan Varga 7337a3e405 Add support for Bmi1 instrinsics. 2019-08-18 05:25:04 -04:00
Zoltan Varga 157bb9f4e3 Make simd-methods-netcore.h less verbose. 2019-08-18 05:23:15 -04:00
Zoltan Varga 121d9ca4a9 [jit] Don't mark ThrowForUnsupportedVectorBaseType<T> as do-not-return. Assert that do-not-return methods actually don't return. 2019-08-18 03:18:24 -04:00
Zoltan Varga 7e76abb4ca [llvm] Add support for 32 byte AVX types, not enabled yet. 2019-08-18 02:01:10 -04:00
Zoltan Varga 1a9f9fb927 [llvm] Compute cpu features lazily. 2019-08-18 01:57:14 -04:00
Zoltan Varga 3c6e8de0da [jit] Enable alias analysis dce even if there are no ldaddr instructions eliminated, they could have been eliminated earlier. Enable only for netcore for now. 2019-08-18 01:55:25 -04:00
Zoltan Varga c0e03ef28f [llvm] Fix support for 32 byte simd values. 2019-08-18 01:40:28 -04:00
Stephen Toub c48dd0608d Fix IDE0025 (use expression body for properties)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 2e9134f1a6 Fix IDE0056 (use index operator)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 08b942ab68 Fix IDE0057 (use range operator)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 9595189a0a Fix IDE0054 (use compound assignment)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub c8eb6972b5 Fix IDE0060 (unused parameter)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 64f4ba27f0 Fix IDE0059 (unnecessary assignment)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 71fcdf53e3 Fix IDE0029 (use coalesce expression)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 828f89360f Fix IDE0031 (use null propagation)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 8af19427ad Fix IDE0028 (collection initializers)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 20adb69c73 Fix IDE0008 (use explicit type instead of var)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 8dd17900cc Fix IDE0065 (using directives should be outside of a namespace)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub c0191b2575 Fix IDE0019/20 (Use pattern matching)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Kenneth Pouncey 02126de318 Add regression test for issue https://github.com/mono/mono/issues/12917
- IL Linker not working correctly with IQueryable extensions
2019-08-17 17:50:39 -05:00
Jay Krell 9a24e9a389 Add comments explaining goto main_loop vs. MINT_IN_DISPATCH. 2019-08-17 15:45:21 -07:00
Zoltan Varga 9df02d7a2d Fix the build. 2019-08-17 17:22:41 -04:00
Stephen Toub 2e618f0e63 Fix IDE0066 across corefx (dotnet/corefx#40288)
* Fix IDE0066 across corefx

"Fix all", but then manual tweaking to accommodate places the rule doesn't work quite right.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-08-17 23:07:24 +02:00
Zoltan Varga 44cfea466f Fix the build. 2019-08-17 12:26:35 -04:00
Zoltan Varga 7418248835 Add support for the System.Runtime.Intrinsics.X86.Popcnt intrinsics. 2019-08-17 12:25:59 -04:00
Zoltan Varga bfe4155083 [llvm] Add support for querying the cpu attributes from the LLVM jit. 2019-08-17 12:25:58 -04:00
Zoltan Varga b39abe5365 Fix the build. 2019-08-17 12:25:31 -04:00
Zoltan Varga 9eb687f2b9 Fix the windows build. 2019-08-17 12:25:31 -04:00
Zoltan Varga 98a02059e8 [jit] Add a netcore version of simd-intrinsics.c.
Differences from the old versions:
- Only Vector<T> from corelib is supported.
- Only LLVM is supported.
- It uses more general opcodes like XBINOP instead of having one opcode
  for every op+type combination which is not useful for LLVM.
2019-08-17 12:25:30 -04:00
Zoltan Varga 2c32eb1fa8 [jit] Optimize away box+unbox combinations which are common in corefx code. 2019-08-17 12:25:30 -04:00
Zoltan Varga 13fb0134a0 Merge pull request #16210 from EgorBo/opt-llvm-jit
Auto-detect current cpu in LLVM JIT
2019-08-17 12:22:07 -04:00
Jay Krell 3fb7834afb Put finally data back in locals instead of frame to save 16 bytes of stack.
Partial undo of f8fd60b5c0.
2019-08-17 00:05:50 -07:00
Jay Krell 0c6cb9fbc3 thread names: coop, constants, usually ignore-error.
- Convert setting thread name to be coop-compatible.

- For constant thread names, just retain the constant, not a copy.
  This includes producing and using constant unicode thread names on Windows.

- Make setting a thread name often non-fatal, except where mandated by public API.

- From earlier PR: mono_free (mono-publib.c) would no longer be referenced and therefore
  no longer exported. That broke profilers and maybe other externals.
  Choices:
     1 Use it instead of g_free randomly sometimes.
     2 Call it randomly sometimes.
     3 include it in external-only.c or object.c
     4 Mark it external only (breaks profiler).
     5 Use a .def file or Unix equivalent.

     5 is best, 2 is done here, the advantages/disadvantages
     among most choices are subtle. 3 is probably better than 2
     but is slightly bigger change, to put off -- you'd stop
     compiling mono-publib.c and move it to include/extra_redist.

     The advantage of not-.def file is perhaps that it is exposed
     by the compiler, so maybe easy to port and work with.
     People are more comfortable with obscure C extensions than
     any linker options, and there are multiple linkers to contend
     with. Arguably there are fewer compilers.
2019-08-16 15:24:30 -07:00
Egor Bogatov 6847508d2a Update llvm-jit.cpp 2019-08-17 00:25:19 +03:00
Jay Krell 16a81cf520 [Coop] Convert mono_attach_load_agent. (#15954)
Based on https://github.com/mono/mono/pull/15868.
Most cleanup and leak fixes moved and expanded to https://github.com/mono/mono/pull/15950.
2019-08-16 17:16:03 -04:00
Ryan Lucia 1e457cdd1e [netcore] Enable netcore resolution logic for mono_assembly_byname_lookup (#16256)
* Use netcore_load_reference in mono_assembly_request_byname

* Add ALC static Resolve event code from CoreCLR

* Wire up the AssemblyResolve event

* Enable newly passing test

* Set requesting assembly in InternalLoad

* Remove infinite recursion

* Only call netcore_load_reference from mono_assembly_request_byname

* Remove test completely
2019-08-16 16:54:47 -04:00
Nathan Ricci 325bbf541b Changes GC.cs 2019-08-16 11:48:35 -04:00
Nathan Ricci 029467271e Implemented imprecise version of get total bytes allocated. 2019-08-16 11:26:39 -04:00
Jay Krell e54f03168d Ignore NULL in mono_marshal_free_dynamic_wrappers and mono_free_method. (#14150) 2019-08-16 09:33:04 -04:00
Jay Krell 66afab5803 Fill in more MONO_PATCH_INFO_NONE support. (#13990) 2019-08-16 09:32:48 -04:00
Jay Krell f52bfb94d5 [interp] Localize c, i32, o as suggested. (#16268)
This saves 16 stack bytes for clang, gcc is unmoved probably figured it out on its own.
2019-08-16 09:32:07 -04:00
Jay Krell 4d9e6ae20e [interp] Fix more MonoError reuse (mono_object_new_checked). (#16263)
* [interp] Fix more MonoError reuse (mono_object_new_checked).

* Inline mono_interp_new/mono_object_new_checked now that we are in outlined mono_interp_newobj.
2019-08-16 16:26:49 +03:00
Steve Pfister da2c0159e9 [corlib] Fix sharing mode validation rules (#16247)
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 07:52:22 -04:00
Egor Bogatov 4dca4f6619 [netcore] Add patch-local-dotnet-aot-llvm rule (#16120)
* Add patch-local-dotnet-aot-llvm rule

* Update Makefile

* Add run-sample-local-dotnet-llvm
2019-08-16 12:43:08 +02:00
Jay Krell 0c637a73a9 intepreter: remove last element from various arrays (#16134)
add const
 combine lines for searchability
2019-08-16 11:37:20 +03:00
Jay Krell 35fc20b637 [interp] Fully outline enum_hasflag to save stack. (#16228)
Alternative to https://github.com/mono/mono/pull/16197.
If you are going outline, you sometimes might as well take it all with you
instead of bouncing back and forth for a partial inlining.
2019-08-16 10:13:22 +03:00
Zoltan Varga 5461fb78c7 Merge pull request #16261 from vargaz/tp-no-random
[runtime] Use a PRNG in the threadpool instead of the os random number generator.
2019-08-15 23:48:35 -04:00
Jo Shields b6c499631e Exclude Authenticode tests on Watch (#16278)
1002a4de2b added Authenticode cert support on non-WatchOS. The tests,
however, were not non-WatchOS-only. Fix this, so Watch doesn't try to
run Authenticode tests.
2019-08-15 22:07:18 -04:00
Zoltan Varga 764091677e Merge pull request #16257 from EgorBo/llvm-ptr
Align C# pointers with LLVM pointers for primitive types
2019-08-15 21:59:42 -04:00
Jay Krell 6c05cfab59 [mini] Cleanup alloca: call twice instead of once, and shrink allocation slightly. (#16158)
It is an actual function call at least on Windows.
2019-08-15 18:14:37 -04:00
Jay Krell b654aa1ca8 [interp] Fix more MonoError reuse. (#16262) 2019-08-16 00:06:50 +02:00
Jay Krell dfbf1a1bd3 [Coop] Convert emit_invoke_call. (#15964)
Removing calls to mono_string_new_checked.
Extracted from https://github.com/mono/mono/pull/15900.
2019-08-15 17:56:33 -04:00
Jay Krell 44ff0597b8 Wrap more external-only functions in GC mode transitions. (#15895)
mono_compile_method
mono_runtime_set_main_args
mono_runtime_run_main
mono_runtime_exec_managed_code
mono_load_remote_field
mono_load_remote_field_new
mono_store_remote_field
mono_store_remote_field_new
2019-08-15 17:48:18 -04:00
Zoltan Varga 870aec4aad Llvm optimizations (#16191)
* [jit] Disable inlining for ThrowHelper methods for non-netcore as well. Add an OP_NOT_REACHED after calls to these methods to let LLVM know they don't return.

* [llvm] Use the cold calling convention instead of the preserveall one, it has the same effect and its better supported.

* [llvm] Call the aot init function using the cold cconv.

* [llvm] Make the condition in the poll function unlikely.

* [llvm] Add a wrapper around the GC poll icall so it can be called with a cold calling convention.

* Move the noreturn check before the code which is shared with calli.
2019-08-15 21:46:00 +02:00
Stephen Toub 133bdb5fa2 Fix non-ASCII characters across corefx (dotnet/corefx#40318)
* Fix several non-visible characters in test files

* Replace Unicode surrogate pairs with escaped hex values

* Fix non-ASCII characters in most C# files

Signed-off-by: dotnet-bot <[email protected]>
2019-08-15 21:44:47 +02:00
Jo Shields 4ec4d7a3b3 Add missing FCONV_TO_U8 on ILP32 (WatchOS 5) (#16276) 2019-08-15 13:56:04 -04:00
Jay Krell 7b64f1cd00 Retain thread names as UTF8 instead of only UTF16. (#15945)
Windows can still have its Unicode thread names, since we have UTF16 initially, just don't retain it.

This does penalize ves_icall_System_Threading_Thread_GetName_internal (non-netcore only),
which has to convert back to UTF16 each time.

But seems like a net win overall.

There is also a little prep work here for constant thread names and some temporary measures as multiple changes head toward the same code.

Rename `mono_thread_set_name_internal` to `mono_thread_set_name`.
Close possible race conditions.

Extracted from https://github.com/mono/mono/pull/15859.
2019-08-15 19:37:34 +02:00
Jay Krell f35c755fea [interp] Outline newobj and newobj_vt. (#16267)
In this variation, the exception handling and resume are split between the main function and the helper function, and no address-taken occurs on ip/sp/vt_sp.

The order is a little tangled but convincing.
The helper function returns MonoException* or checks context->has_resume_state and then returns, and then the caller does the checks again.

Based on past analysis this will conserve stack, but that was not double checked here.
i.e. due to `&valuetype_this`, though it is conditional and the code could be split up into inline and outline.
2019-08-15 19:23:24 +02:00
Egor Bogatov 2f7a06d208 [netcore] Mark "Run Tests" step as failed if there are failures (#16230)
Currently "Run CoreFX tests" step is always green
2019-08-15 18:06:15 +02:00
Jo Shields dd6bd568a0 Fix failing OSX Android lane (#16274)
Linker order matters when using .a files, so zlib.a MUST come after
sgen.a if sgen.a was compiled with support for compressed ppdb
2019-08-15 10:37:04 -04:00
Vlad Brezae 6fc089bf8b [exceptions] Don't debug hang on ThreadAbortException (#16240)
It is pretty much useless.
2019-08-15 14:57:26 +03:00
Jay Krell 63e1828f7e Reduce redundant setting of thread name. (#16253)
Maintain a counter and only set if the counter has changed.
This cannot be fully thread safe, so is not.
Any thread can set any other thread name at any time.
You could be atomic to do better, and loop to do even better,
but the thread name could still be changed again right after the loop exists.

The previous code was also not reliable in this way, since again the name
could be changed right away.

#16248
2019-08-15 10:56:38 +02:00
Jay Krell 5ec452666a [interp] [wasm] p vs. o on newobj (#16264) 2019-08-15 10:42:11 +02:00
Jay Krell fd4956fbf2 [interp] Fix some, not all, of the error management. (#16232)
From #16190.
2019-08-15 10:41:49 +02:00
Jay Krell 7766f9b926 [interp] Short-circuit MINT_STELEM_REF on NULL. (#16229)
Presumably this is not a useful semantic change,
to skip those functions, given NULL.

(We will probably want to outline all of this also, later).
2019-08-15 10:39:45 +02:00
Jay Krell fc724e6cf0 [interp] Compute locals later to reduce register/stack pressure and conserve stack. (#16231)
i.e. do not def before a function call and use after, do both after.
2019-08-15 10:39:27 +02:00
Jay Krell dde3452690 [interp] Split leave into pieces, partially outlined, to conserve stack, (#16213)
but without changing how exception handling macros access labels and locals.

This saves 16 bytes of stack on Linux/amd64/gcc and likely similar everywhere,
as it takes an address-taken local out of interp_exec_method_full (stackval tmp_sp).

See
https://github.com/mono/mono/pull/16171
https://github.com/mono/mono/pull/16171/commits/a6a8f0d5ffa875da9cda63444e401c37810a690f for a
full outlining.
2019-08-15 10:39:03 +02:00
Nikolay Sivov 5b66d3d518 [cominterop] Fix copy-paste error in ComVisibleAttribute testing helper.
This type was introduced with 29a95bafd8.
2019-08-15 09:29:14 +02:00
Thays Grazia dcfec3966c Enable and document debug with sdb with netcore config. 2019-08-15 09:23:02 +02:00
Zoltan Varga 928aab1b84 [runtime] Use a PRNG in the threadpool instead of the os random number generator, its good enough, and its much faster. 2019-08-15 02:14:06 -04:00
Egor Bogatov 93eceec724 address feedback 2019-08-15 02:39:13 +03:00
Jay Krell 2463605f01 Remove ampersand from cfg->error per old agreement. (#16219) 2019-08-15 01:07:56 +02:00
Martin Baulig 934c4f4c87 X509CertificateImplBtls.PrivateKey should allow to actually set the key. (#16212)
The `X509CertificateImplBtls.PrivateKey` property setter was previously ignoring all values and always used `null`.  This should help with #16189.
2019-08-15 01:07:35 +02:00
Egor Bogatov ed4be03b79 handle primitive pointers in llvm 2019-08-15 01:38:58 +03:00
Vlad Brezae 4e793ad30c [interp] Fix icall signature (#16227) 2019-08-15 00:18:45 +03:00
Jo Shields f2d813c90d Fix linking of OS-provided zlib (#16177)
* Fix linking of OS-provided zlib

This is a reduced version of https://github.com/mono/mono/pull/16091
without the Z_PREFIX stuff

* Get rid of HAVE_ZLIB, be explicit about HAVE_SYS_ZLIB vs HAVE_STATIC_ZLIB

* Proposed fixes from Alex
2019-08-14 16:58:07 -04:00
Stephen Toub a103b78163 Delete dead _pauseTicks from TimerQueue (dotnet/coreclr#26160)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-14 21:19:04 +02:00
Jan Kotas e46b3efbd0 Undo readonly on _isLastFrameFromForeignExceptionStackTrace
This makes the field symmetric with other fields and fixes build break for CoreRT

Signed-off-by: dotnet-bot <[email protected]>
2019-08-14 21:19:04 +02:00
Aleksey Kliger (λgeek) ce92c4376f [metadata] Create strongly typed versions of mono_assembly_request_prepare (#16094)
* [metadata] Create strongly typed versions of mono_assembly_request_prepare

Addresses the family of issues similar to Coverity #1443346.

This came up as part of the Coverity review, and Coverity notices that this is
writting beyond the end of the structure.  While this is correct, this requires
that the idiom be properly followed - that is, that the structure being passed
is of the given size.

Replaced instead with a method that eliminates the room for error with methods
that will initialize the whole structure, and the actual size computation is
done inside the method with the proper type sizes.

While I used methods, I feel that this should use macros.
2019-08-14 15:07:26 -04:00
Aleksey Kliger (λgeek) a6b8494f0a (mono.1) Update the MONO_THREADS_SUSPEND description (#16236) 2019-08-14 19:23:36 +02:00
lateralusX 2d06126dc9 OP_LLVM_OUTARG_VT doesn't always create temporary vt needed by some ABI's.
LLVM lowering passes vt as reference to managed methods. On platforms where
the value type ABI is passing an address to the value type, either in register
or on stack (Windows x64) we must make sure we always use a temporary of
the value type or we will be breaking the value type semantics.

In JIT lowering of OP_OUTARG_VT we always make sure we use a temporary
in cases where argument storage is set to ArgValuetypeAddrInIReg/ArgValuetypeAddrOnStack.
On LLVM lowering this was currently not the case, but it still worked in many scenarios.
This was because IL load of arguments before doing a call did a
local copy and then we pass that byref. However, there are cases where this
copy could get optimized away and when that happens, we will change the
local value type in the caller’s frame, breaking the value type semantics.

Added test case in winx64structs hits such a scenario that will generate IL
breaking the value type semantics before the fix:

...
notail call monocc void @winx64_vector3Struct_Add_winx64_vector3Struct_winx64_vector3Struct
(i64 %49, %winx64_vector3Struct* %3, %winx64_vector3Struct* %16)
...
notail call monocc void @winx64_vector3Struct_Add_winx64_vector3Struct_winx64_vector3Struct
(i64 %64, %winx64_vector3Struct* %3, %winx64_vector3Struct* %15)
...

The two add calls will use the same reference (to a local value type in caller frame)
on both calls, this will break the value type semantics since they should both
be temporaries, like second argument is.

After the fix, the same code will be lowered into:

...
notail call monocc void @winx64_vector3Struct_Add_winx64_vector3Struct_winx64_vector3Struct
(i64 %55, %winx64_vector3Struct* %19, %winx64_vector3Struct* %18)
...
notail call monocc void @winx64_vector3Struct_Add_winx64_vector3Struct_winx64_vector3Struct
(i64 %72, %winx64_vector3Struct* %16, %winx64_vector3Struct* %15)
...

Each argument gets its own temporary that, according to the ABI, gets passed
by address down to function.

There will be situations where we could end up with two temporaries, one from
the load and one from the lowering of OP_LLVM_OUTARG_VT (same as we get on JIT),
this will however be detected by LLVM optimization pass, removing one of the copies.
2019-08-14 19:23:32 +02:00
Egor Bogatov abb43f9361 ignore stacktrace tests 2019-08-14 14:33:44 +02:00
Jay Krell d1c0974e46 [interp] Reduce frame size by partially outlining load remote field. (#16196)
Extracted from https://github.com/mono/mono/pull/16171.
Ultimately over 100 bytes can be saved.

Tactically not outlined or indirected:
 vt_sp change
 ip advancement
 error handling

 Also partially fixes the error reuse from https://github.com/mono/mono/pull/16190.
2019-08-14 12:34:54 +02:00
Jay Krell 60ac98ee29 Make small_id_mutex not recursive. (#15485)
(Later non-recursive Windows mutexes should be SRWLOCK and only statically initialized.)
2019-08-14 12:33:58 +02:00
Jay Krell 8c5d0a790e Use ERROR_DECL. (#16220) 2019-08-14 12:28:00 +02:00
Jay Krell 74b0d01e07 [interp] Remove address-taking of vt_sp. (#16215)
Theoretically could help reduce frame size but it has not been seen to.
2019-08-14 12:27:22 +02:00
Zoltan Varga 4c71a3e892 [wasm] Disable running xunit test suites on wasm, its not working reliably yet. (#16223) 2019-08-14 12:26:31 +02:00
Jay Krell 4c17442dc3 [interp] Outline mono_interp_calli_nat_dynamic_pinvoke to reduce stack. (#16201)
Now that we have that function, also change from malloc to alloca.

This is part of #16171 and ultimately over 100 bytes were saved.
2019-08-14 12:25:44 +02:00
Jay Krell 136205ab45 Completely replace mono_error_ok with is_ok and make first external_only. (#16217) 2019-08-14 12:24:50 +02:00
Jay Krell 12de10007c Skip degenerate qsort: num < 2, size == 0, base == 0 (#16016)
Fixes https://github.com/mono/mono/issues/15994

Some is redundant for some qsort implementations.
2019-08-14 12:22:40 +02:00
Jay Krell 6873d5370d Fix warning LNK4221 warning in assembly-load-context.obj (#16004)
LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2019-08-14 12:19:08 +02:00
Jay Krell 9123ac0197 [interp] Outline get_virtual_method_fast to save 16 bytes of stack. (#16198)
Ultimately over 100 bytes are savable in a few steps.
2019-08-14 12:17:23 +02:00
Jay Krell dbf13301c8 [interp] Outline set_resume_state to conserve stack in main interpreter loop (#16200)
This is not intuitive but I definitely saw it.
2019-08-14 12:17:01 +02:00
Marek Safar 9ee80c6d3b Bump linker 2019-08-14 10:17:54 +02:00
Stephen Toub 3803a00421 Fix StyleCop warnings for rules enabled in corefx
Signed-off-by: dotnet-bot <[email protected]>
2019-08-14 10:15:38 +02:00
Thays Grazia f812d90fa1 [debugger] Debugger tries to execute a single step when the thread is already terminated (#16208)
* Debugger tries to execute a single step when the thread is already terminated.

* Fixing how to get thread tls.
2019-08-13 22:47:28 -03:00
Stephen Toub 50d3fc69d8 Convert several static readonly byte[]s to ReadOnlySpan<byte> (#26138)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Stephen Toub 9e13a7e097 Fix IDE1005 (simplify delegate invocation)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Stephen Toub db4441bfe7 Fix IDE0062 (make local functions static)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Stephen Toub 15ea431db7 Contribute to IDE0060 (unused argument)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Stephen Toub d927c98e03 Contribute to IDE0059 (unnecessary assignment)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Stephen Toub d82bc555c9 Contribute to IDE0019 (use pattern matching) and IDE0066 (use switch expression)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Stephen Toub e19d95b6de Contribute to IDE0044 (make field readonly)
I used the auto-fix and then undid changes in areas where the fields were potentially mutated in native, e.g. I undid many of the changes in reflection.  We can revisit those individually later.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Stephen Toub 6c95cbadf9 Fix StyleCop warning SA1400 (missing access modifiers)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Stephen Toub 0814b9de4d Enable StyleCop rules 1205, 1411, 1026, and 1000 (dotnet/corefx#40254)
* Fix StyleCop warning SA1411 (attribute ctor shouldn't use unnecessary parens)

* Fix StyleCop warning SA1026 (new[] spacing)

* Fix StyleCop warning SA1000 (consistent spacing around if, for, switch, etc.)

* Fix StyleCop warning SA1205 (partial elements should declare an access modifier)

Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Egor Bogatov 6c51440538 auto-detect cpu in llvm jit 2019-08-13 22:24:54 +03:00
Aleksey Kliger (λgeek) 592de53a1f [runtime] Initialize thread suspend policy at startup, inline getter (#16149)
* [runtime] Initialize thread suspend policy at startup, inline getter

On some benchmarks we saw mono_threads_suspend_policy() using a lot of CPU
time.

Rather than doing an init-on-first-use, initialize the policy once upfront when
the JIT it starting up and make the getter method static inline.

* move mono_threads_suspend_policy_init into mono_thread_info_init

* [mini] Initialize suspend policy for `mono --version`

Need to initialize the suspend policy before printing its name.  Otherwise the
suspend policy is unset since no other runtime initialization is done for `--version`.
2019-08-13 15:16:05 -04:00
Alexander Köplinger ff77b427f4 [netcore] Cleanup System.Private.CoreLib.csproj (#16199)
- The eng/Versions.props was already imported by the arcade targets causing a double-import warning:

> warning MSB4011: "/Users/alexander/dev/mono/eng/Versions.props" cannot be imported again. It was already imported at "/Users/alexander/.nuget/packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19379.1/tools/DefaultVersions.props (17,3)". This is most likely a build authoring error. This subsequent import will be ignored.

- Remove BaseAddress and TRACE from the project file, this was done upstream at https://github.com/dotnet/coreclr/commit/bc430cdd2010bf7790854a60380d00c506c346a6

- Remove unecessary DebugSymbols/DebugType settings, we already set them in the global PropertyGroup
2019-08-13 16:41:03 +02:00
Aleksey Kliger (λgeek) 1f4ac5d767 [sre] Outline typebuilder_setup_fields loop body (#16184)
The loop body uses coop handles, so wrap it in HANDLE_FUNCTION_ENTER/HANDLE_FUNCTION_RETURN
2019-08-13 09:31:31 -04:00
Jay Krell ef199425a2 [interp] Replace mono_error_ok with is_ok. (#16193)
The locally unknown function, despite being small/fast, forces saving values in stack and nonvolatile registers
around calling it.
Both nonvolatile registers and stack are at a premium here, whereas usually stack is cheap.
The macro is just a read from offset 0 and checking for zero.
2019-08-13 15:30:28 +02:00
Alexander Köplinger b60aaea791 [pkg] Bump libgdiplus to 6.0.2 2019-08-13 12:12:22 +02:00
Egor Bogatov c36f0a126e [netcore] decimal should have alignment=8 (#15666)
* Fix System.Runtime.InteropServices tests

* Update marshal.c

* Update marshal.c

* Update marshal.c
2019-08-12 21:57:47 +02:00
Zoltan Varga 5bc4944bf0 Merge pull request #16151 from spouliot/ios-intr-enable-sre
[sdk] Enable the SRE runtime code inside iOS builds
2019-08-12 14:44:54 -04:00
Stephen Toub b25395bde3 Re-enable StyleCop warning SA1400 (elements should specify access) (#40240)
One of the more common things we "nit" in PRs.  Now the compiler will flag it for us.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-12 19:46:54 +02:00
Aaron Robinson 66f7436d6f Remove unnecessary error check for QueryUnbiasedInterruptTime call (#26120)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-12 19:46:54 +02:00
Stephen Toub 4f821c3e8d Enable FxCop and StyleCop analyzers (dotnet/coreclr#26100)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-12 19:46:54 +02:00
Aleksey Kliger (λgeek) ad64c781eb [interp] Fix stub_get_resume_state write to out parameter (#16145)
Addresses Coverity CID 1452245
2019-08-12 13:09:59 -04:00
Ryan Lucia cadd114f64 [netcore] Pass MONO_ASMCTX_LOADFROM on LoadFrom calls (#16075) 2019-08-12 11:46:12 -04:00
Ankit Jain c028454bef [msbuild] Bump to track xplat-master and update roslyn (#16155)
Prompted by mono/msbuild#126:

This includes:

- merge mono-2019-06
- SDK update to track dotnet release/3.0.100-preview8
- Roslyn updated to 3.3.0-beta2-19381-14
2019-08-12 17:03:13 +02:00
UnknownShadow200 69ebdd8b93 [WinForms] Fix NotifyIcon not showing in systray on 64bit linux (#16164)
https://bugzilla.xamarin.com/show_bug.cgi?id=14976

Credit goes to datnhanlz for noting that removing XChangeProperty(DisplayHandle, hwnd.whole_window, _XEMBED_INFO, _XEMBED_INFO, 32, PropertyMode.Replace, atoms, 2); would also fix the bug. 

Note that the type of Atom is actually unsigned long (see usr/include/X11/X.h), however the code used a C# int for the atoms. As such the code worked without a problem on 32 bit linux, but broke on 64 bit linux.

I switched to using IntPtr instead to make the code also work on 64-bit.
2019-08-12 16:09:08 +02:00
Aleksey Kliger (λgeek) dd3f6e0d31 [debugger] Cleanup MonoError on in isFixedSizeArray (#16146)
Cleanup MonoError on error paths.  Also change `return FALSE` to `return 0`.

Addresses Coverity CID 1452205
2019-08-12 09:50:58 -04:00
Nikolay Sivov 612e0644b6 [mono] Fix some compiler warnings (#16159)
* [mini] Remove unused variables.

* [mini] Remove unused function.

Single call site is conditionally compiled.

* [sgen] Remove unused variable.

* [utils] Fix misleading indentation warnings.
2019-08-12 12:42:59 +02:00
Nikolay Sivov f9052ed78e [System.Drawing] Use CoreFX implementation of BufferedGraphics on Windows (#16163)
The issue was made visible with .NET Core WinForms. Some controls draw text with DrawTextEx to intermediate Graphics based on Bitmap, that later it's moved back to main Graphics with DrawImage. This results in a lost of transparency component along the way, making antialiased glyph bitmaps draw and B/W. Corruption is visible with gray antialiasing, but is more severe in subpixel modes.

I verified that same happens with gdiplus on Windows, code from CoreFX works correctly.
2019-08-12 12:42:07 +02:00
Jay Krell c70b4cc3cc [remoting+interp] [remoting+debugger] Fix use of dangling local. (#16173) 2019-08-12 12:35:30 +02:00
Jay Krell 4e5544f02d [interp] Remove unnecessary loops, that optimizer might handle. (#16169) 2019-08-12 12:34:46 +02:00
Vincent Povirk 7413bb84ec [w32process-win32] Don't duplicate CreateProcess search logic. (#16156)
When given a null application name, CreateProcess already
searches the path and appends .exe in some cases. .NET's
Process class behaves in the same way (see
https://github.com/mono/mono/pull/16089#issuecomment-519984244).

The duplicated logic is unnecessary and broken in several ways.
Failures are ignored and the command line arguments are
executed. Relative paths are expected not to end in "exe".
Many corner cases work differently from .NET and CreateProcess.

This change makes it impossible for process_complete_path to fail,
so I removed the gboolean return and pulled out the output
parameter. Its caller wasn't handling the return value correctly
anyway.
2019-08-12 12:05:05 +02:00
Zoltan Varga 835282004c Merge pull request #16136 from EgorBo/fix-inlining
[netcore] Fix inlining
2019-08-11 22:32:01 -04:00
Zoltan Varga 7c511c9937 Merge pull request #16160 from vargaz/wasm-xunit-4
[wasm] Xunit testing work.
2019-08-10 22:56:05 -04:00
Alexander Köplinger ec73f9ba17 Bump corefx to fix build break 2019-08-10 23:45:11 +02:00
Zoltan Varga c6054d5aa1 [wasm] Run System.Core xunit tests on CI. 2019-08-10 15:18:26 -04:00
Zoltan Varga 95b705d8c1 [wasm] Add argument conversions to the xunit runner. 2019-08-10 15:18:26 -04:00
Alexander Köplinger 738b6988b5 Bump corefx to get https://github.com/mono/corefx/pull/327 2019-08-10 16:19:01 +02:00
Nikita Voronchev 000430002a [System.Drawing.Design] Allow context be a null in the ColorEditor.EditValue (#16141)
If one call `ColorEditor.EditValue(IServiceProvider, Object)` ([MSDN](https://docs.microsoft.com/ru-ru/dotnet/api/system.drawing.design.uitypeeditor.editvalue?view=netframework-4.8#System_Drawing_Design_UITypeEditor_EditValue_System_IServiceProvider_System_Object_)), then `context` is `null` and drop-down menu doesn't appear.
2019-08-10 16:01:37 +02:00
Sebastien Pouliot 360c1c44c7 [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).
2019-08-09 13:57:54 -04:00
Vlad Brezae b52830cf11 [interp] Fix overflow of execution stack (#16115)
We were not tracking max_stack_height for a few opcodes.
2019-08-09 20:28:30 +03:00
Zoltan Varga 54c07051a8 Merge pull request #16139 from steveisok/run-single-ios-sdk-test
Added the option to run a single test in the iOS SDK
2019-08-09 12:58:01 -04:00
Ryan Lucia a1bb37cd52 [netcore] Make mono_assembly_request_prepare take an ALC (#16061)
* Make mono_assembly_request_prepare take an ALC

* Typo

* Fix pedump

* Use default ALC

* Make v1 preload hook external-only

* Convert pedump and monodis

* fixup: use default ALC in netcore preload hook

trusted platform assemblies should be loaded into the default ALC
2019-08-09 11:44:50 -04:00
Alexander Köplinger 0970996f75 Bump eng/Versions.props again
Try to fix the netcore build.
2019-08-09 17:03:12 +02:00
Alexander Köplinger 75c21692a0 Add mono-hang-watchdog.in to tarball
Remove custom distdir target and use standard EXTRA_DIST to do so.
2019-08-09 16:48:16 +02:00
Stephen Toub 86a0ad2f88 Fix FxCop warning CA1823 (unused fields)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub f39ac1d32d Fix FxCop warning CA2229 (private deserialization ctor)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub 2d3a6ea2bb Fix FxCop warning CA1825 (Array.Empty)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub cce1583769 Fix StyleCop warning SA1620 (generic XML comment ordering)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub 15963fe836 Fix StyleCop warning SA1617 (void return XML comment)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub 4ce53c845b Fix StyleCop warning SA1113 (comma position for parameters)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub 442e9ad144 Fix StyleCop warning SA1206 (modifer ordering)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub 01fa50943f Fix StyleCop warning SA1121 (use built-in types)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub 9c3037fc59 Fix StyleCop warning SA1200 (cref prefixes)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub 1fcf7a1ab4 Fix StyleCop warnings SA1028 and SA1518 (trailing whitespace and blank lines)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub 441257339f Fix FxCop warning CA1018 (attributes should have AttributeUsage)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Alexander Köplinger 74338e0f2d Bump corefx to get https://github.com/mono/corefx/pull/323 2019-08-09 16:21:12 +02:00
Alexander Köplinger 09e7c4509c Update dependencies from corefx (#16137) 2019-08-09 15:19:16 +02:00
Steve Pfister 9e9697c978 Added the option to run a single test in the iOS SDK 2019-08-09 09:10:13 -04:00
Alexander Köplinger f15fe47075 [build] Remove ILDISASM variable from platform Makefiles
It was written by configure.ac to config.make and is unused anyway.
2019-08-09 12:53:14 +02:00
Alexander Köplinger 652f6c64b6 [build] Remove PLATFORM_CORLIB from platform Makefiles
Changing the corlib assembly name isn't supported anywhere else in the build.
2019-08-09 12:53:14 +02:00
Alexander Köplinger e80f3449da [build] Remove MBAS from the platform Makefiles
It no longer exists.
2019-08-09 12:53:14 +02:00
Alexander Köplinger 8697b31082 [build] Remove EXTERNAL_MCS setting in platform Makefiles
Setting an explicit mcs is no longer supported by the rest of the build scripts.
2019-08-09 12:53:14 +02:00
Alexander Köplinger d7174c9aa6 [build] Remove confusing commented out code 2019-08-09 12:53:14 +02:00
Alexander Köplinger ab1d61509d [build] Remove PLATFORM_MAKE_CORLIB_CMP
The corlib_cmp doesn't exist anymore.
2019-08-09 12:53:14 +02:00
Alexander Köplinger 3e77e01071 [build] Replace PLATFORM_ ifdefs with HOST_PLATFORM checks
Building Linux BCL assemblies from a macOS machine didn't work since we
were enabling some Apple features if the build machine was macOS.
2019-08-09 12:53:14 +02:00
Alexander Köplinger 175e345122 [tools] Add .gitignore for mono-hang-watchdog 2019-08-09 12:39:34 +02:00
Stephen Toub 67a89b3a6f Move CodeAnalysis.ruleset to shared (dotnet/corefx#40153)
So that the same settings can be applied to corelib.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 12:30:05 +02:00
Egor Bogatov a7e428d82f fix inlining 2019-08-09 12:55:50 +03:00
Egor Bogatov 7deb53514d Make System.Runtime.Intrinsics.X86.*.IsSupported intrinsic 2019-08-09 09:34:29 +02:00
Egor Bogatov 9442ed95d7 fix minor issues 2019-08-09 09:34:29 +02:00
Alexis Christoforides 2c4b60fe24 [merp] Use a separate program as the hang supervisor. (#15715)
* [merp] Use a separate program as the hang supervisor.

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

macOS does not like signals being sent from the forked supervisor process, possibly towards anywhere but definitely when sent to the parent process. The following message is currently spewed after the supervisor process attempting to send a SIGSEGV to a hanged Mono process:
"The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec()."

We follow that direction and introduce a new binary that, when available in the mono executable's binary directory, is used to abort the parent process for us.
2019-08-09 10:31:57 +03:00
Ryan Lucia 6a459c25d7 [netcore] Don't return REFERENCE_MISSING in netcore_load_reference 2019-08-09 09:23:10 +02:00
Jeffrey Zhao a49ecebd4e Catch InvalidCastException properly in Collection (dotnet/coreclr#25953)
The explicit implementations of IList.Add/Insert/Set methods catch
InvalidCastException for casting input argument to type T to throw
an ArgumentException. The issue here is they put the core collection
modification operation in the try block, which could be overridden
by sub-classes and produce an InvalidCastException from user logic,
even the argument passed to IList.Add/Insert/Set is valid.

To fix the issue, we just need to move the collection modification
outside the try block, and leave the casting in try block only. In
this way, we'll get an ArgumentException when the argument type is
invalid, but propagate the InvalidCastException thrown from user
code as it should be.

dotnet/corefx#39919

Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 09:22:28 +02:00
Zoltan Varga e71604d695 Merge pull request #16125 from vargaz/wasm-keep-config-cache
[wasm] Add a KEEP_CONFIG_CACHE option to Make.config to avoid deleting the autoconf cache file on make clean.
2019-08-09 03:20:03 -04:00
monojenkins 1369ebcfaf [bcl] Update BCL Linked Size 2019-08-09 09:19:32 +02:00
Alexander Köplinger fde0a5b628 [ci] Trigger PR builds for netcore only on master branch
The work is happening in master only for now.
2019-08-09 00:53:19 +02:00
Alexander Köplinger 6075417d88 Bump corefx so it points to correct branch 2019-08-09 00:14:18 +02:00
Alexander Köplinger ec35e14636 [tests] Fix accessing field of MarshalByRefObject in remoting1.cs (#16119)
We need to copy it to a local variable first.
This was exposed by a new Roslyn optimization for String.Concat (see https://github.com/dotnet/roslyn/issues/37830).
2019-08-09 00:07:41 +02:00
Stephen Toub da2c1cde97 Re-enable StyleCop warnings SA1028 and SA1518 (trailing whitespace and blank lines) (#40113)
Mechanical/automated change.  The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-08 23:44:46 +02:00
Alexis Christoforides 1127974861 [System] Guard against attempting to creating out-of-range spans in macOS FileSystemWatcher 2019-08-09 00:24:06 +03:00
Zoltan Varga adeef6c0fc [wasm] Add a KEEP_CONFIG_CACHE option to Make.config to avoid deleting the autoconf cache file on make clean. 2019-08-08 17:08:51 -04:00
Aleksey Kliger (λgeek) 36af44e3be [perfcounter] Define mono_perfcounter_foreach even if perfcounters are disabled. (#16100)
Fixes netcore build on win32
2019-08-08 14:06:21 -04:00
monojenkins 18917b885c [csproj] Update project files 2019-08-08 19:10:03 +02:00
Marek Safar 2ef50f54ee Bump corefx for #15259 fix 2019-08-08 19:10:03 +02:00
Adam Sitnik b15518dd5e make DateTime.UtcNow 5% faster to minimize the leap second performance impact (#26046)
* make few methods used by DateTime.UtcNow inlinable to minimize the leap second performance regression impact, related to #25728

* apply suggested micro-optimizations

Signed-off-by: dotnet-bot <[email protected]>
2019-08-08 18:55:19 +02:00
Jan Kotas 7c59cd14fe Cleanup ProjectN ifdefs (dotnet/corert#7675)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-08 18:55:19 +02:00
Alexander Köplinger dfa5a6ce4d [aprofutil] Install the tool correctly (#16112)
It needed a few tweaks to be usable when Mono is installed to the prefix.
2019-08-08 16:46:55 +02:00
Steve Pfister 64ea10fbcd Fixed RuntimeType.GetConstructorCandidates("") to return 0 elements. (#16054)
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.
2019-08-08 12:14:39 +02:00
Stephen Toub c189afd4f5 Delete PROJECTN ifdefs from Corelib (dotnet/coreclr#26058)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-08 10:10:47 +02:00
Sung Yoon Whang 240202cd90 Improve ArgumentNullExceptions on DiagnosticCounter.DisplayName/Unit (#26035)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-08 10:10:47 +02:00
monojenkins 53b9c88795 [bcl] Update BCL Linked Size 2019-08-08 10:09:17 +02:00
imhameed fc4d234ef6 [sdb][interp] Use the interpreter's resume state to compute the IL offset in compute_frame_info. (#15936)
[sdb][interp] Use the interpreter's resume state to compute the IL offset in compute_frame_info.

This recovers the relevant bits of the "resume state" from the interpreter and uses that to recalculate the `il_offset` for the top frame.

Fixes https://github.com/mono/mono/issues/15687.
2019-08-07 20:05:55 -04:00
imhameed 4462f10fb6 [llvm] Explicitly check for errors when calling LegacyIRCompileLayer::addModule. (#16082)
[llvm] Explicitly check for errors when calling LegacyIRCompileLayer::addModule.

LLVM built with LLVM_ENABLE_ASSERTIONS=On will crash if errors are not
explicitly consumed.
2019-08-07 15:15:55 -04:00
Ryan Lucia aece3efc99 Relax locking (#15986)
* Remove usage of loader lock

Originally added in https://github.com/mono/mono/commit/c4cbd3b700eea52c84c68c9450d80357b3be681d but no longer relevant

* Make get_agent_domain_info lock-free and relax loader lock

* Syntax errors

* Undo first commit, other than the commit message

* Fixes
2019-08-07 14:17:19 -04:00
Marek Safar b3344fa0b2 Bump linker (#16014)
* Bump linker

* Bump api-doc-tools and add NEW_CECIL define to mdoc

* Bump linker

* Bump API snapshot submodule

* [csproj] Update project files
2019-08-07 19:37:19 +02:00
Sylvain 4780486237 Memcpy instead of memcpy1 in System.Buffer.MemoryCopy (void*, void*, long, long). (#16056)
In the same way it is done in System.Buffer.MemoryCopy (void*, void*, ulong, ulong).

Correct what appears to be a typo in System.MemoryCopy with "long, long" size arguments.

Consequently, copy is not done byte per byte for the last int.MaxValue bytes when MemoryCopy is called with long argument (most common case). This should provide noticeable performance increase.
2019-08-07 18:36:47 +02:00
Radek Doulik 1f2b37ed37 [aotprof-tool] Initial import of AOT profiler tool (#15384)
* [aotprof-tool] Initial import

Imported https://github.com/radekdoulik/aotprofile-tool and updated it
to use Mono.Profiler.Log

* [aotprof-tool] Added man page

* [aotprof-tool] Use the shortened name in README.md
2019-08-07 18:24:51 +02:00
Ryan Lucia dcd5715161 [netcore] Re-enable IsAssignableFrom test
This was fixed a while back but never removed from the exclusions
2019-08-07 17:27:35 +02:00
Zoltan Varga d18daefdbc Merge pull request #16085 from kjpou1/wasm-sdk-v0.2.0
[wasm][sdk] Bump SDK Version 0.2.0
2019-08-07 11:17:12 -04:00
Jay Krell e8d28feb1e There is no need to zero static data, and it is racy (#15699)
if there are multiple threads calling (unlikely).
This zeroing was made moot by 470354fa81 January 2019.
2019-08-07 10:40:57 -04:00
Thays Grazia e690fb0240 Allow generating DIM bitcode (#16070) 2019-08-07 11:06:56 -03:00
Kenneth Pouncey 4767c581c7 Update sdk version for tests 2019-08-07 15:57:45 +02:00
Alexander Köplinger 521d4c8395 [utils] Move MAP_ANONYMOUS check after sys/mman.h import
The flag is defined in that header on OSX. Followup to 2abe569ede
2019-08-07 15:54:09 +02:00
Aleksey Kliger (λgeek) aea457cdb3 [w32socket] Translate ELOOP and ENAMETOOLONG (#16039)
Translate to WSAELOOP and WSAENAMETOOLONG, respectively.

See https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2

Addresses part of https://github.com/mono/mono/issues/16024
2019-08-07 09:42:39 -04:00
Nikolay Sivov 10c5e6407e [trace] Improve enter/leave output formatting (#16036)
* [trace] Use specific integer types for return value traces.

* [trace] Improve argument list formatting for ENTER lines.

Return value changes are especially visible for bools, where currently 4 bytes integers are printed.
2019-08-07 15:05:44 +02:00
Kenneth Pouncey b0611a5ee9 Bump SDK Version 0.2.0 2019-08-07 14:59:53 +02:00
Nikolay Sivov d34381f72e [win32] Fix some compilation warnings (#15956)
* [mini] Remove unused variable.

* [mini] Mark win32 exception handling functions static.

* [mini] Remove unused variable.

* [mini] Suppress unused function warning.

* [metadata] Fix unused function warning for Win32 build.
2019-08-07 14:45:19 +02:00
iamphi 2abe569ede Fix compilation on OSX 10.9 (#14411)
Found solution from: 
https://github.com/eclipse/omr/issues/902#issuecomment-288559044
2019-08-07 14:42:57 +02:00
Alex Thibodeau 24bbb94b6b Swap bytes for tcp port number because windows API gives us port in network order. (#16030)
Addresses the FIXME in Win32IPGlobalProperties.cs :: FillTcpTable

Fixed Unity issue: issuetracker.unity3d.com/issues/ipglobalproperties-dot-getactivetcpconnections-return-different-port-numbers-when-compared-to-cli-netstat-a-output
2019-08-07 14:30:07 +02:00
Zoltan Varga ba1c949a24 [runtime] Fix an autoconf warning. (#16078)
[runtime] Fix an autoconf warning.

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-08-07 06:06:00 -04:00
Vlad Brezae e702e8286f [interp] Fix DEBUG_INTERP build (#16057) 2019-08-07 12:47:41 +03:00
Marek Safar 25b84915e1 Remove code moved to shared partition 2019-08-07 09:48:03 +02:00
Stephen Toub c5027781de Remove some unused locals (dotnet/corefx#39956)
* Remove some unused locals

Trying out various analyzers, including one to flag unused locals.  There are more than this, but this is a first batch.  Some of these are just clean-up.  Others are saving unnecessary cost.  At least one appears to be a real functional bug.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-08-07 09:48:03 +02:00
Stephen Toub 824351f49c Fix CounterGroup to use built-in types
Signed-off-by: dotnet-bot <[email protected]>
2019-08-07 09:48:03 +02:00
Aleksey Kliger (λgeek) b2ab9198d3 Move AssemblyLoadContext VM-invoked resolve methods to shared (#25989)
Share between CoreCLR and Mono

Mono began using a copy of these methods with
https://github.com/mono/mono/pull/15946

Signed-off-by: dotnet-bot <[email protected]>
2019-08-07 09:48:03 +02:00
Tanner Gooding 0378116ffc Updating Math.Round and MathF.Round to be IEEE compliant so that the intrinsic and managed form are deterministic. (#25901)
* Updating Math.Round and MathF.Round to be IEEE compliant so that the intrinsic and managed form are deterministic.

* Fixing the Math.Round and MathF.Round handling for values greater than 0.5 and less than 1.0

* Applying formatting patch.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-07 09:48:03 +02:00
John SalemandNoah Falk a76f6fa9b5 Allow for interface implementations in EventSource.WriteEventVarArgs (#25844)
* Allow for interface implementations in EventSource.WriteEventVarArgs

* Also account null ref types and nullable types

* fix error in comment and simplify first part of boolean logic

* Update src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs

Co-Authored-By: Noah Falk <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-08-07 09:48:03 +02:00
Ryan Lucia 022fc4ea37 [netcore] Set flag for processor arch when parsing assembly names 2019-08-07 09:22:04 +02:00
Bernhard Urban fe0f311a84 [arm] respect I1 and I2 on gsharedvt out transition (#16000)
[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
2019-08-06 18:25:51 -04:00
Zoltan Varga add830f9cb Merge pull request #16071 from vargaz/wasm-xunit-3
[wasm] More xunit fixes.
2019-08-06 17:57:22 -04:00
Zoltan Varga 476af240d2 [wasm] Compile interp.c with -mllvm -join-liveintervals=false to fix compilation times. 2019-08-06 16:46:19 -05:00
Jay Krell 9bf703b031 [Coop] Convert mono_object_isinst_icall. (#15963) 2019-08-06 15:26:55 -04:00
Zoltan Varga 59a285a546 [wasm] More xunit fixes. 2019-08-06 15:24:32 -04:00
coypoop 5a4283d1b3 Update NetBSD support (#15938)
Based on the FreeBSD variation.
Needs some additional changes I'm still ironing out.
2019-08-06 20:32:38 +02:00
Ryan Lucia 64bf7ef9db [netcore] Update test exclusions to reflect ALC work (#16059) 2019-08-06 14:08:18 -04:00
Zoltan Varga 3c88e9f251 [netcore] Avoid calling load hooks during AOT.
Fixes https://github.com/mono/mono/issues/16046.
2019-08-06 19:40:23 +02:00
Zoltan Varga 662b72f913 Merge pull request #16058 from vargaz/wasm-requests-2
[wasm] Update WASM-REQUESTS.md.
2019-08-06 12:53:44 -04:00
Zoltan Varga dda05d0a09 [wasm] Update WASM-REQUESTS.md. 2019-08-06 10:48:42 -04:00
Egor Bogatov 0fbc5d8315 DeflateStream: check IsInvalid before disposing (#16048) 2019-08-06 14:53:24 +02:00
Ryan Lucia 85296ef1be [netcore] Make the load hook ALC-aware (#16012)
The meat of this PR is what the title suggests, and with this commit all the basic ALC functionality should be working properly. Probably worth checking if this makes any new tests pass.

Additionally, this PR includes a second commit that switches over the search hook to use loaded_assemblies from the ALCs. This may break some existing tests due to remaining unimplemented ALC behavior, notably the native loading mechanism needed for Openssl in some of the cryptography tests. My inclination is to include the commit regardless and just disable the failing tests so that any future ALC work can watch for regressions in the loader, but I would appreciate input from steveisok on how important those tests are. I've not disabled anything yet in order to see exactly what new failures are introduced.
2019-08-06 12:16:15 +02:00
Jay Krell 474092add6 UWP now allows LoadLibrary. (#16015) 2019-08-06 12:14:38 +02:00
Martin Baulig 1c13b30225 SocketAsyncEventArgs cleanups and preparations for the real thing. (#16001)
Cleaning up the `SocketAsyncEventArgs` class and preparing it for it's eventual
adaption from CoreFX.

There are a few instance fields and property accessors with `internal` visibility,
which the CoreFX version does not have.  Replaced these with accessor methods.

The `PolicyRestricted` property and it's related `SocketAsyncEventArgs (bool)`
constructor is not used anywhere and the CoreFX version has a constructor with the
same signature, but different semantics.

In the CoreFX version, `Complete ()` does not call `DoComplete (this)` - renamed it
into `Complete_internal ()` to avoid any ambiguities and help the transitioning.
2019-08-06 12:13:40 +02:00
Alexander Köplinger 7ab3811b93 Bump api-doc-tools to latest master (#16035)
* Bump api-doc-tools to latest master

Disable building mdoc.exe in mcs mode since it no longer builds because of new C# features.

* Fix mcs build by disabling more mdoc invocations

* Bump monodroid_tools to compile against v4.7 reference assemblies

mdoc needs ValueTuple which is not in v4.6.

* [csproj] Update project files
2019-08-06 10:40:24 +02:00
Zoltan Varga d57f3f55f0 Merge pull request #16043 from kjpou1/wasm-sdk-small-fix
[wasm][sdk] Fix misspelling and trailing comma
2019-08-06 02:29:20 -04:00
Kenneth Pouncey ca51e5b5cc Fix misspelling and trailing comma 2019-08-06 07:30:47 +02:00
Zoltan Varga 9b4bc613e4 Merge pull request #16006 from vargaz/as-gsharedvt
[jit] Avoid asserting on Unsafe.As<T> in gsharedvt methods.
2019-08-05 21:04:44 -04:00
Kenneth Pouncey 69aa5dcaa7 Fix indentation 2019-08-05 15:03:08 -05:00
Kenneth Pouncey 357a3aaec5 [wasm][sdk] Fix issue with WasmLinkAssemblies task wrongly using reference assemblies
The issue is that when executing the `WasmLinkAssemblies` task the reference assemblies are currently used as input to the linker step and output in the published application instead of the actual framework library file.

My findings so far on this is that the package references are resolved in the MSBuild [ResolvePackageAssets](https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageAssets.cs#L205.)

Those are then remapped from [here](https://github.com/dotnet/sdk/blob/ec9f5fc673f798dd6a89c7d11a4e62727837757c/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.PackageDependencyResolution.targets#L270) to the `RuntimeCopyLocalItems`.

What I did was pass the `RuntimeCopyLocalItems` to the `WasmLinkAssemblies` task and do a remap to the runtime versions.  This works against everything I have thrown at it so far.

Of course this could fail if the nuget has somehow set `copy to local` false maybe but I do not see anything in the code referenced above checking for that.
2019-08-05 15:03:08 -05:00
Jo Shields c8c52f7e9f Bump version to 6.7 (#16031)
* Bump version to 6.7
2019-08-05 15:31:47 -04:00
Alexander Köplinger 807e4b3d6f [ci] Disable 32bit llvm sdks build
It was removed in https://github.com/mono/mono/commit/a6e6c72c8fc3702db37e1572694a49902f63195f
2019-08-05 21:29:51 +02:00
Kenneth Pouncey ac80d041e6 [wasm][sdk] Decoupling the WebAssembly runtime debug and release versions. (#16028)
* Update templates

- Add PropertyGroups for Debug and Release to set the DebugSymbols and DebugType by default.

* Allow the selection of the WebAssembly runtime version Debug | Release

- Decouple the reliance on `_DebugSymbolsProduced` to decide which runtime version to publish.
- Add support for <MonoWasmRuntime>Debug | Release</MonoWasmRuntime>
- Add validation target of the property to Mono.WebAssembly.Build.targets.

* Indentation
2019-08-05 19:03:35 +02:00
Zoltan Varga 93a6bc3151 [netcore] ifdef out unused icalls/files. (#16009)
* [netcore] ifdef out unused icalls/files.

* Add MONO_EMPTY_SOURCE_FILE.
2019-08-05 17:13:40 +02:00
Egor Bogatov d1700fc93f Add finalizer to DeflateStream (#15879)
Fixes #15825
2019-08-05 13:20:29 +02:00
Zoltan Varga 17b35dc4fc Merge pull request #15640 from vargaz/wasm-xunit
Add beginnings of support for running xunit tests.
2019-08-04 17:05:59 -04:00
Zoltan Varga f239e4e68b [wasm] Add basic support for running xunit tests. 2019-08-04 15:59:36 -04:00
Zoltan Varga 60bfa99043 [jit] Avoid asserting on Unsafe.As<T> in gsharedvt methods.
Fixes https://github.com/mono/mono/issues/15992.
2019-08-03 15:06:58 -04:00
Stephen Toub f532f93ea6 Enable stylecop warnings 1205, 1212, and 1617 (dotnet/corefx#39941)
* Enable stylecop warning 1617 (void return value should not be documented)

* Enable stylecop warning 1212 (get/set accessor ordering)

* Enable stylecop warning 1205 (modifier ordering)

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Stephen Toub 3385433b60 Enable several StyleCopAnalyzers (dotnet/corefx#39921)
* Fix ordering of keywords in member signatures

* Add StyeCop.Analyzers

Most rules are disabled.  Many of them we'll want to leave disabled, however there are a handful it'll be good to enable over time.

* Use built-in type alias

* Fix straggling stylecop warnings in all configurations

* Replace tabs with spaces

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Stephen Toub 3fde98da3e Re-enable CA1823 (unused private fields) (dotnet/corefx#39899)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Sung Yoon Whang 66a7646232 Make counters use dedicated thread instead of timer (dotnet/coreclr#25864)
* Make a dedicated polling thread for EventCounters

* Cleanup

* remove debug prints

* nit

* Fix comment

* addressing issues from code review

* Fix an assertion from getting fired when we have multiple listeners

* Fix a test issue

* code review feedback

* Fix a potential deadlock

* Fix another deadlock

* Allow s_sleepDurationInMilliseconds to be reset to a larger value

* More issues fix

* Let thread wake up from sleep if needed

* Some suggestions for the counters fix.

The resulting behavior should be the same as what is there now (assuming I didn't mess anything up), these are all just code simplifications that hopefully make it easier to review and maintain going forward. In total I think this reduces the change size in CounterGroup.cs by ~30%.
- With the addition of the AutoResetEvent the ManualResetEvent is no longer needed, removed it.
- Removed the various if foo != null checks for the shared state, it is all initialized once when then thread is created and then assumed to be non-null elsewhere.
- Removed a 2nd lock acquisition inside OnTimer
- Replaced an if with Math.Min in PollForValues

* fix test

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
ts2do 5104fd4b2f Eliminate extra time zone conversions in DateTimeOffset (#25658)
* Eliminate extra time zone conversions in DateTimeOffset

Revised members dealing specifically with local time by removing delegation to DateTime methods to avoid an extra call to TimeZoneInfo to determine offset:
Now
FromFileTime(long)
ToLocalTime()

* Fix DateTimeOffset.ToLocalTime(bool)

* Consolidate conversion from UTC DateTime to Local DateTimeOffset

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Stephen Toub 6345e18108 Fix use of AddTo/RemoveFromActiveTasks in async methods (#25911)
When we rewrote the async methods implementation with AsyncStateMachineBox, we neglected to call AddToActiveTasks if the debugger is paying attention to tasks.  This hasn't mattered as the debugger's support for Tasks hasn't worked for other reasons in .NET Core, but there is now a renewed focus on it, and this is preventing some of that support from working.

This change is a minimal fix to ensure that we're adding the state machine box task when it's created and removing it when it completes.  Post-3.0, we should look at overhauling this, e.g. to clean up a lot of this logging and tracking that's done, to use a weak table in order to avoid keeping task objects alive artificially if they're dropped without completing by the developer code, etc.

This only affects when the debugger is attached, as the s_asyncDebuggingEnabled field is only ever set by the debugger.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Stephen Toub fa0c0bb2e2 Fix nullability annotations for static (dotnet/coreclr#25913)
The compiler is now analyzing statics.  Get compliant.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Egor Bogatov e08bddaa63 [netcore] Minor fixes around System.Reflection (#15905)
* Minor fixes

* Update HelloWorld.csproj
2019-08-03 20:49:38 +02:00
Ryan Lucia 848811e4b2 [netcore] Enable ALC loaded_assemblies (#15850)
* Typo

* Enable loaded_assemblies and lock

* Make mono_domain_assembly_open_internal ALC-aware

* Populate loaded_assemblies


Switch from prepend to append

* Some notes

* Exclude add_assembly_to_alc on non-netcore

* Cleanup appdomain.c

* Remove mono_alc_cleanup for now

* Update comment

* Disable using loaded_assemblies in the search hook

* Adjust alc cleanup
2019-08-03 20:47:38 +02:00
Peter Collins 920e03f732 [corlib] Ignore TimeZoneTest.TestCtors on Android GMT
TimeZone.CurrentTimeZone.DaylightName returns an empty value on Android
when the system timezone is set to GMT.
2019-08-03 20:35:27 +02:00
Zoltan Varga 9da563509e Remove error_init from native icall wrappers since managed does it. (#15943)
Preferable would be native only, i.e. for interpreter and for when
it is actually unused, but ok for now.

Between removing the managed and the native, managed is preserved
in case there uses of MonoError in C# other than icall wrappers.
Keep them safe.

But again ideally move it to native and remove the managed type,
pending debugging WebAssembly failure doing so.
2019-08-03 12:00:46 -04:00
Kenneth Pouncey a61d8ea767 [wasm][framework] Rework framework linker descriptions (#15952)
- Remove the fully preserved assembly references from `WebAssembly.Bindings` and `WebAssembly.Net.Http`

Close https://github.com/mono/mono/issues/15365
2019-08-03 12:00:19 -04:00
Jb Evain 283c0557d3 Fix usage of mono_debug_get_seq_points to avoid leaks (#15977) 2019-08-03 11:59:25 -04:00
imhameed 3ab93f97e6 [llvm] Add support for JIT + LLVM 9.0. (#15997)
* [llvm] Add support for llvm 9.0.

Works with this branch:
https://github.com/mono/llvm/tree/release_90

* Add support for JIT + LLVM 9.

* Don't assume that all memset targets will be aligned; fixes LLVM 6 on amd64.
2019-08-03 11:58:40 -04:00
Calvin Buckley e70ac8c6ae Enable MONO_ARCH_EMULATE_FCONV_TO_U4 on PPC (#15991)
Fixes regression related to floating point introduced in #15930.

This does mean we have to take a slower path instead of using the
PPC instruction, but it provides consistent results. Other CPUs
have to do this too, so it's not like PPC is impacted unfairly.
(i.e, NaN gives an inconsistent result, at least with POWER7 and
some amd64 CPUs tested)

Fixes #15990.
2019-08-02 19:00:02 -04:00
Jo Shields 9a7b6fd5ee Bump libgdiplus to new release (#15996) 2019-08-03 00:48:26 +02:00
Calvin Buckley 9ea07610ee Don't use clock_nanosleep on PASE (#15988)
* Don't use clock_nanosleep on PASE

PASE exports this AIX syscall so autoconf detects it, but using it
will trigger SIGILL (for unimplemented syscall), which emits a LIC
log entry type of 4700-000F.

* Change ifdef guard for clock_nanosleep in threads

It only used clock_nanosleep on Linux, but enable it for all except
PASE. Android used to be guarded against, but the reasoning was
unknown, so @akoeplinger requested to have that guard removed.
2019-08-02 23:04:50 +02:00
Aleksey Kliger (λgeek) 713df6a9c4 [netcore] Fix comments in ALC to use Mono terminology (#15998) 2019-08-02 16:31:06 -04:00
Martin Baulig 6818163383 Use MultipleConnectAsync from CoreFX. (#15972)
* Use `MultipleConnectAsync` from CoreFX.

* [csproj] Update project files
2019-08-02 15:10:03 -04:00
Alexander Köplinger 2f21664fc2 [ci] Remove the downloaded pr-files.txt 2019-08-02 21:07:06 +02:00
Zoltan Varga 0104cc6a8f [ci] Skip lanes on ppc/wasm changes. (#15995) 2019-08-02 20:56:11 +02:00
Aleksey Kliger (λgeek) 2f2f6c104b [netcore] Implement referenced assembly resolving and ALC.GetLoadContext (#15946)
* [netcore] Implement GetLoadContext

* [netcore] Implement ALC-aware referenced assembly resolution.

The process is described in
https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext?view=netcore-3.0#usage-in-the-runtime

We try four things until one of them returns a non-null assembly.

1. Check if the assembly is already loaded in the ALC of the requesting
assembly.
2. If the ALC is not the default ALC, invoke the Load override.
3. Try the default ALC (TPA - trusted platform assemblies) loading.
4. Invoke the Resolving event of the original ALC.

The implementation borrows some managed code from
https://github.com/dotnet/coreclr/blob/8ba2e15201361402acd0ae9710bd37d50785cdfa/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs#L84-L187

It would be nice if that code was shared between the runtimes.

* [runtime] Implement mono_assembly_name_culture_is_neutral

* [netcore] Add mono_alc_invoke_resolve_using_resolve_satellite

* [netcore] Use ResolveSatelliteAssembly for satellite assembly refs

* [netcore] Some AssemblyLoadContextTest tests now pass

System.Runtime.Loader.Tests.AssemblyLoadContextTest.PublicConstructor_Default
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetAssemblyNameTest_NullParameter
System.Runtime.Loader.Tests.AssemblyLoadContextTest.LoadFromAssemblyName_AssemblyNotFound
System.Runtime.Loader.Tests.AssemblyLoadContextTest.PublicConstructor_Theory (with isCollectible: False)
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetAssemblyNameTest_ValidAssembly
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetLoadContextTest_SystemPrivateCorelibAssembly
System.Runtime.Loader.Tests.AssemblyLoadContextTest.DefaultAssemblyLoadContext_Properties
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetAssemblyNameTest_AssemblyNotFound
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetLoadContextTest_ValidTrustedPlatformAssembly
2019-08-02 14:06:44 -04:00
Thays Grazia 0b8a0e09d3 [Debugger] Fixing test with mcs (#15985) 2019-08-02 18:48:42 +02:00
Alexander Köplinger 67aed94e2b [ci] Set apidiff/csprojdiff statuses even when we're skipping the build
They are required GitHub statuses so we need to set them.
2019-08-02 17:19:14 +02:00
Zoltan Varga 5bb4f1eea8 [ci] Skip jenkins lanes for PRs which only contain changes to the netcore/ subdir. (#15978) 2019-08-02 17:12:46 +02:00
Egor Bogatov d0aa0310ee [netcore] Use mono-netcore to run real world apps using dotnet run (#15942)
So currently we have two .NET Core:

1) `mono-repo/.dotnet` - we use it to bootstrap and build stuff (the SDK version is specified in `global.json`) - if you open `netcore/Makefile` it's referred there as `$(DOTNET)` variable.
2) `mono-repo/netcore/.dotnet` - it's just a runtime + CoreFX libs (it doesn't contain SDK stuff, templates, msbuild, etc) - we use it only to run tests because this runtime is synchronized with corefx tests in `eng/Versions.prop` file which is updated by a bot and `netcore/shared` sources for our System.Private.CoreLib also depend on that exact runtime version (the sources also updated by the bot).

This PR introduces a rule to copy mono bits to the `mono-repo/.dotnet` folder to be able to run real world apps (at your own risk) using mono-netcore (so when you run `mono-root/.dotnet/.dotnet run -c Release` for an app - even MSBuild will use mono runtime to build that app). However in theory we need exact SDK for the runtime version we have but I have no idea where and how to get one.

BTW, currently MSBuild crashes when it's powered by mono on `$(DOTNET) build` command for a hello world.
```
monoeg_assertion_message
mono_domain_assembly_preload
invoke_assembly_preload_hook
...
at <unknown> <0xffffffff>
at System.Reflection.RuntimeAssembly:GetExportedTypes <0x000a2>
at AssemblyInfoToLoadedTypes:ScanAssemblyForPublicTypes <0x0008e>
```
2019-08-02 17:06:37 +02:00
Egor Bogatov 40f28b2e63 Make System.Private.CoreLib.csproj VS friendly (#15965)
Now it's possible to open System.Private.CoreLib.csproj in an IDE and build (use Roslyn version from eng/Versions.props).
2019-08-02 10:05:22 -04:00
Thays Grazia 3a9df67a64 [debugger] Invoke method with fixed size array as an attribute of this (#15766)
Implement debugger invoke when the this has an attribute that is a fixed size array.

Fixes #15556
2019-08-02 15:47:25 +02:00
Vlad Brezae 4883b56c10 [interp] Remove unconditional branches to next instruction (#15939)
[interp] Remove unconditional branches to next instruction

These are very common, at least in debug builds. Optimize them away so it doesn't distort performance numbers.
2019-08-02 05:16:07 -04:00
Kenneth Pouncey 4ed2aadbdf [wasm][sdk] Support for Custom Linker Configuration (#15953)
- Provide extra definitions to the linker to ensure the type, methods and/or fields are not eliminated from your application.

* Use a <LinkDescription> item as follows:

```
  <ItemGroup>
    <LinkDescription Include="customlinker.xml" />
  </ItemGroup>
```

This will then be added to the `WasmLinkAssemblies` step.
2019-08-02 08:58:50 +02:00
Martin Baulig 455b051ce5 Fix compiler warnings in System.dll. (#15971)
* Merge the `System.Diagnostics/ProcessStartInfo.cs` part into the referencesource file to avoid CS0282.

* Remove duplicate `using`.

* Fix unreachable code warning that got introduced in my last PR.
2019-08-01 18:46:15 -04:00
Phil Jaenke fcfd3e54a5 Fix patch step in mdoc tests for non-Linux (#15974)
Non-Linux systems largely do not support `--binary`. Since the patch appears to be text anyway, it's probably safe to remove for all platforms.

With `patch -p0` , mdoc test now provides accurate pass/fail on FreeBSD.
2019-08-01 23:42:05 +02:00
Egor Bogatov 26f3df9881 [netcore] Minor fixes, fix GetTypeTests.GetType_EmptyString (#15933)
* Fixes https://github.com/mono/mono/issues/15023
 
* Fixes https://github.com/mono/mono/issues/15189 (were marked as "require large array
support" in dotnet/corefx by @filipnavara)

* Move InternalGetHashCode to RuntimeHelpers
2019-08-01 16:56:56 -04:00
Zoltan Varga 6f05192669 [netcore] Add a README. (#15934)
* [netcore] Add a README.
2019-08-01 16:27:40 -04:00
Jay Krell 75a99b7e84 Bump monolite version. (#15969)
It got out of sync for some reason.
2019-08-01 21:38:52 +02:00
Vlad Brezae 87ba12e13f [sgen] Fix check-nursery-pinned debug option (#15865)
* [sgen] Remove dead unpin_queue argument

* [sgen] Fix check-nursery-pinned debug option

And rename it to better reflect what is is doing now (which is to check that we don't leave any vtables tagged at the end of a collection). It used to also check that nursery objects are pinned, back when we were doing a nursery collection as part of the finishing pause of a concurrent collection.
2019-08-01 21:48:23 +03:00
Filip Navara 3c92cd8c94 [jit] Align float/double Nan/Inf to uint conversion behavior with CoreCLR/LLVM/Roslyn (#15930)
* [jit] Align float/double Nan/Inf to uint conversion behavior with CoreCLR/LLVM

* Fix float/double -> ulong conversion for edge cases

* Fix mono_fconv_u8 / mono_rconv_u8 to also return 0 for PositiveInfinity

* Enable support for platform specific implementations of OP_RCONV_U8/OP_FCONV_U8/OP_FCONV_U4

* Restore OP emulation on WASM target

* Update tests

* Disable failing tests for now

* Adjust tests

* Adjust tests

* Fix float -> uint conversion on WASM

* Make interpreter consistent with compiled code

* Blind attempt to fix WASM test leg

* Implement remaining conversions in LLVM

* Fix ARM32

* Workaround for Windows x64 FullAOT+LLVM

* Bump AOT version
2019-08-01 13:37:41 -04:00
Maxim Lipnin d72ca69693 Bump corefx (#15932)
This PR brings changes from mono/corefx#313.
Fixes #15887.
2019-08-01 18:36:29 +02:00
Filip Navara 98cb4aed20 [System.Drawing] Fix comparison in MeasureString_Wrapping_Dots test (#15958) 2019-08-01 17:09:38 +02:00
Jay Krell a7b74fc69c Support proper Windows kernel Unicode thread names. (#15919)
These do not require a debugger, can be retrieved, appear in ETW, etc.

Extracted from https://github.com/mono/mono/pull/15859.
2019-08-01 15:53:41 +02:00
Zoltan Varga 6a66472815 [wasm] Add normal GC support. (#15577)
* [llvm] Spill all ref variables to the stack on wasm, so GC stack scanning can scan all references.

* [runtime] Add an option to enable on-demand GC.
2019-08-01 15:50:28 +02:00
Vlad Brezae e3ca891235 [marshal] Free delegates with target that are passed to native code. (#15935)
* [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
2019-08-01 16:06:05 +03:00
Vlad Brezae ce398411a0 [mini] Ignore conv.r.un if top of stack is already float (#15818)
Fixes https://github.com/mono/mono/issues/15794
2019-08-01 15:21:50 +03:00
Martin Baulig e92ecdc9ce Fix Socket.ConnectAsync(SocketAsyncEventArgs) behavior. (#15947)
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.
2019-08-01 12:31:25 +02:00
monojenkins 0e6965f6ba [csproj] Update project files 2019-08-01 07:45:48 +03:00
Alexis Christoforides 4abc400244 [corlib] Allow copying/moving/replacing broken symlinks
Fixes https://github.com/mono/mono/issues/14971
2019-08-01 07:45:48 +03:00
Andy Gocke 863ab55d48 Add Roslyn maestro dependency (#15944)
* Add Roslyn maestro dependency

This should bring down the Microsoft.Net.Compilers package,
which contains the Roslyn binaries needed for mono packaging.

* Add Version to Versions.props as well
2019-08-01 02:04:04 +02:00
Jay Krell 180fcfe1fd Factor copy/pasted code into mono_gstring_append_thread_name. (#15920)
Extracted from https://github.com/mono/mono/pull/15859.
2019-08-01 01:25:31 +02:00
Jay Krell 3db9635bf5 Remove error_init from native icall wrappers since managed does it.
Preferable would be native only, i.e. for interpreter and for when
it is actually unused, but ok for now.

Between removing the managed and the native, managed is preserved
in case there uses of MonoError in C# other than icall wrappers.
Keep them safe.

But again ideally move it to native and remove the managed type,
pending debugging WebAssembly failure doing so.
2019-07-31 15:49:54 -07:00
Vlad Brezae 985a1c33f2 [tests] Bump sleep for pinvoke3 test (#15937)
On some operating systems, this test can take forever because the worker starves the other threads by holding the gc_lock. Bump sleeping so it doesn't rely on OS scheduling that much and guarantees other threads can progress in reasonable amount of time.
2019-08-01 00:24:06 +03:00
Alexander Köplinger cf0e2dd972 [zlib] Fix typo in readme and remove deleted file from msvc projects 2019-07-31 22:58:21 +02:00
Jay Krell 431bb95c71 Update zlib from 1.2.5 to 1.2.11. (#15480)
Circa 2010 to circa 2017.

Retrieved with apt-get source zlib on WSL Ubuntu 18.04.2 LTS.

This matches Debian or Ubuntu (they differ by one commit, and one of them restores a dummy function for compat).

---

* [minizip] Ensure we don't ever accidentally change calling convention

Make sure we always #define ZCALLBACK to empty so we don't change
the calling convention on windows by including a header which defines
'CALLBACK'. This will keep things as cdecl as required by the c#
pinvokes.

* Update zlib readme.

* Update zlib from 1.2.5 to 1.2.11.

* [zlib] Small fix for Visual C++.
see https://github.com/madler/zlib/pull/435/files#diff-0558e84b0c24a83ca790dcb05cd26212R1087
and https://github.com/madler/zlib/pull/435/files#diff-0558e84b0c24a83ca790dcb05cd26212R1104

* Add gzguts.h to Makefiles.

* Add .h files to Visual Studio project files just for GUI purposes.
2019-07-31 22:56:34 +02:00
Zoltan Varga 1d9a87e449 Fix the netcore build. (#15941) 2019-07-31 22:04:37 +02:00
turbo 8b9033e4d2 Add O_NOATIME to OpenFlags (#8993)
O_NOATIME (Linux > 2.6.8): Do not update the file last access time (st_atime in the inode) when the file is read(2). Programs that merely index the existence of a file (backup programs e.g.) can reduce disk load using this flag.
2019-07-31 21:24:53 +02:00
Zoltan Varga 60c277cb4e [runtime] Convert more icalls to use handles. (#15862)
* [runtime] Convert Volatile to use the same approach as the netcore version, get rid of most Volatile icalls.

* [runtime] Reduce the number of handles used by construct_culture ().

* [runtime] Convert some icalls to handles.

* Fix signature of FAMNextEvent.

* [aot] Avoid aoting the gsharedvt versions of Volatile:Read<T>/Write<T>.

* Bump API snapshot submodule

* Convert Marshal:UnsafeAddrOfPinnedArrayElement to use coop handles.
2019-07-31 14:08:50 -04:00
Aleksey Kliger (λgeek) 349a3d5eef [threads] Enter GC Unsafe before pumping HP queue in unregister_thread (#15890)
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
2019-07-31 13:30:30 -04:00
Jay Krell 499a02d6a1 Cleanup and resynchronize Thread/InternalThread fields. (#15910)
- Remove unused.
- Add missing that just happened to work.
- Synchronize size between netcore and regular. `#if` considered bad.

Extracted from https://github.com/mono/mono/pull/15859.
2019-07-31 18:30:50 +02:00
Jay Krell 9acd4c8004 mono_thread_set_name_internal change unreadable boolean parameters to enum flags. (#15921)
Extracted from https://github.com/mono/mono/pull/15859.
2019-07-31 18:30:28 +02:00
Zoltan Varga 6223e74688 [jit] Optimize the initialize of MonoError locals. (#15869)
Previously, we would emit a call to memset since the struct is large (> 100 bytes). Only the error code field needs to be initialized.
2019-07-31 14:26:24 +02:00
Calvin Buckley 1059b3e6f5 Update Haiku support (#15674)
* Build System.Native.

* Disable `pthread_mutexattr_setprotocol` use, since it returns EINVAL on Haiku.

* Disable the `strerror` cache on Haiku. On Haiku, errors begin at `0x8000_0000` like a Win32 HRESULT. This means the indexing would be on negative numbers, which is a no-no. There are a few alternative ways to keep it though: hashtable, tuple array, offset...

Unfortunately, doesn't build all the way through. Has a tendency to bomb out during building `build-unix`. Will investigate why.
2019-07-31 14:23:48 +02:00
coypoop f86d46d136 configure.ac: Use = as a test(1) operator. (#15876)
== is a bash extension
= is POSIX and equivalent
2019-07-31 14:22:26 +02:00
Zoltan Varga 4170bef2c3 [wasm] Small changes. (#15918)
* [wasm] Touch the dummy .exe files created during linking if they already exist.

* [wasm] Display longer stack traces on v8.

* [wasm] Add a --native-strip option to the packager, defaults to true.

* Add targets for separate interpreter test projects. Normalize main.exe command line arguments.
2019-07-31 14:20:40 +02:00
Jay Krell e0335d3570 Save 64 bytes from most Linux/amd64 interpreter frames. (#15926)
Probably same on all 64bit architectures. half on 32bit.

before:
```
0000000000003ce0 <interp_exec_method_full>:
    3ce0:	55                   	push   %rbp
    3ce1:	48 89 e5             	mov    %rsp,%rbp
    3ce4:	41 57                	push   %r15
    3ce6:	41 56                	push   %r14
    3ce8:	41 55                	push   %r13
    3cea:	41 54                	push   %r12
    3cec:	49 89 f4             	mov    %rsi,%r12
    3cef:	53                   	push   %rbx
    3cf0:	48 89 fb             	mov    %rdi,%rbx
    3cf3:	48 81 ec 78 01 00 00 	sub    $0x178,%rsp
```

after:
```
0000000000003ce0 <interp_exec_method_full>:
    3ce0:	55                   	push   %rbp
    3ce1:	48 89 e5             	mov    %rsp,%rbp
    3ce4:	41 57                	push   %r15
    3ce6:	41 56                	push   %r14
    3ce8:	41 55                	push   %r13
    3cea:	41 54                	push   %r12
    3cec:	49 89 f4             	mov    %rsi,%r12
    3cef:	53                   	push   %rbx
    3cf0:	48 89 fb             	mov    %rdi,%rbx
    3cf3:	48 81 ec 38 01 00 00 	sub    $0x138,%rsp
```

It was 0x158 recently.

Some frames will be larger, i.e. dynamic + pinvoke.

Classic technique:
 pointer instead of struct
 initialized to null
 alloca it when needed and not null

A more detailed analysis might enable better, such as making
the parameter optional, and/or having the callee default it to its
local storage.
2019-07-31 14:20:03 +02:00
Nikolay Sivov c8fd75734b Fix some compiler warnings for Win32/mingw64 build (#15903)
* [mono] Fix unused variable warning in mono_config_parse().

* [ligc] Fix strict prototype warning for Win32 build.

* Add some casts.
2019-07-31 14:18:53 +02:00
coypoop bed4c00e02 Remove unused libdl setting (#15884)
We test dlopen with no library and in libdl later, without the
use of this setting.

Got the hint since I'm building for a configuration which had it set wrong.
2019-07-31 14:17:34 +02:00
coypoop a65eec76be Remove unused declarations (#15907) 2019-07-31 14:16:37 +02:00
Zebediah Figura dc48d9e241 Always marshal a class as a COM interface if it has the InterfaceType attribute set. (#15671)
This fixes Game Maker Studio 2 Desktop under Wine.
2019-07-31 14:15:38 +02:00
Zebediah Figura b51c696081 [cominterop] Handle NULL pointers when marshalling native-to-managed return values. (#15906)
Fixes a bug running Rak24u with wine-mono: bugs.winehq.org/show_bug.cgi?id=47561
2019-07-31 14:14:39 +02:00
Jay Krell c37fc12ca5 Fix race condition and use less memory in mono_lookup_icall_symbol. (#14532)
It is racy because it is doing on-demand initialization, which is often racy.

The rewrite changes the result to be one pointer, atomically swapped, which implies a full barrier and data dependency, so no race.

It could also be fixed by copying and sorting an array of pairs, and one pointer to that.

However in order to save memory I instead use indirect data that is an array of uint16 pointing into the original data. That is a slight memory vs. time tradeoff.

Yes there is debugging code left, under #if, that I prefer to leave, both as evidence that I tested it, and to make it somewhat but ideally testable in future.

The code also was using an unnecessary somewhat risky but probably ok here way to compare pointers, that I fixed.

As well the result is marginally smaller and faster because it was inlining something like bubblesort, now reuses qsort.
2019-07-31 14:13:21 +02:00
Alexander Köplinger 471421023c [ci] Handle master build purging in a separate cleanup job 2019-07-31 13:32:06 +02:00
Jay Krell bd0c46a842 [Coop] Add TYPED_HANDLE_DECL. (#15909)
Extracted from #15900.
2019-07-31 12:35:59 +02:00
Bernhard Urban a6e6c72c8f [sdks] remove 32bit llvm (#15896)
[sdks] remove 32bit llvm

Also switches the MXE cross compilers for Android and WebAssembly to 64bit host.
2019-07-30 19:05:41 -04:00
Alexander Köplinger 2cfbadb0a6 [pkg] Don't keep per-commit master builds in CI
We only want the daily builds.
2019-07-31 00:34:38 +02:00
Filip Navara 60bb726eac Update CoreFX.issues.rsp (#15870)
Removed tests fixed by #13907.
Fixes #14945
Fixes #14946
Fixes #14948
2019-07-30 23:39:34 +02:00
Jay Krell ca8f155983 [Coop] Convert ves_icall_string_new_wrapper_impl. (#15901)
Static analysis prefers not even these short lived raw pointers.
Extracted from #15900.
2019-07-30 23:37:58 +02:00
Jay Krell 56082ab528 [Coop] Convert mono_string_from_byvalwstr_impl. (#15902)
Remove the raw pointer that static analysis will flag.
Extracted from #15900.
2019-07-30 23:37:09 +02:00
Zoltan Varga f8fd60b5c0 [interp] Simplify the main interpreter loop code to speed up compilation. (#15889)
* [interp] Simplify the control flow in the main loop to speed up compilation of interp.c.

Get rid of the handle_finally and main_loop labels.

* [interp] Move some rarely used locals to InterpFrame to speed up compilation and to increase the chance that the other locals end up in registers.

* Add macros for throwing exceptions to shorten the code a bit.

* Fix a previous change.
2019-07-30 16:02:27 -04:00
Larry Ewing eb68675461 Bump msbuild to xplat-master 2019-07-30 14:20:22 -05:00
Larry Ewing 11b6828420 Update nuget binary 2019-07-30 14:20:22 -05:00
Alexander Köplinger ce1653b08a [sdks] Don't keep per-commit master builds in CI
We only want the daily builds.
2019-07-30 21:14:02 +02:00
Alexander Köplinger ee636ee8d9 [sdks] Make sure python3-pip is installed for Linux Android builds 2019-07-30 20:46:11 +02:00
Alexander Köplinger 9f0d493eea [netcore] Replace dl-test-assets.py with msbuild download (#15883)
The python file was unreliable on macOS, let's see whether a simple msbuild replacement is better.

Also fixed dependencies on some of the Makefile targets so that they correctly detect when they need to run.
2019-07-30 19:27:42 +02:00
Jay Krell a8d8fb6cea Fix warnings. (#15768)
* boehm-gc.c:1923:14: warning: variable old_obj set but not used [-Wunused-but-set-variable]

* class-init.c:1720:1: warning: compare_by_interface_id defined but not used [-Wunused-function]

* class.c:1724:1: warning: compare_interface_ids defined but not used [-Wunused-function]

* icall.c:8190:13: warning: variable klass set but not used [-Wunused-but-set-variable]

* image.c:1063:20: warning: variable header set but not used [-Wunused-but-set-variable]

* metadata.c:2573:25: warning: right shift count >= width of type [-Wshift-count-overflow]

* sgen-dynarray.h:194:1: warning: dyn_array_int_is_copy defined but not used [-Wunused-function]

* sgen-mono.c:255:1: warning: emit_managed_allocater_noilgen defined but not used [-Wunused-function]
sgen-mono.c:238:1: warning: emit_nursery_check_noilgen defined but not used [-Wunused-function]

* sgen-tarjan-bridge.c:449:25: warning: right shift count >= width of type [-Wshift-count-overflow]

* threads.c:1451:11: warning: variable res set but not used [-Wunused-but-set-variable]

* w32process-unix-default.c:239:19: warning: variable min_dev set but not used [-Wunused-but-set-variable]
w32process-unix-default.c:239:10: warning: variable maj_dev set but not used [-Wunused-but-set-variable]

* w32process-unix.c:2107:25: warning: variable waitret set but not used [-Wunused-but-set-variable]

* aot-compiler.c:4180:1: warning: add_lazy_init_wrappers defined but not used [-Wunused-function]

* aot-compiler.c:7200:86: warning: format %lu expects argument of type long unsigned int, but argument 3 has type gsize {aka unsigned int} [-Wformat=]

* aot-compiler.c:10013:7: warning: unused variable index [-Wunused-variable]

* aot-compiler.c:10012:15: warning: variable method set but not used [-Wunused-but-set-variable]

* method-to-ir.c:4031:22: warning: variable tmpreg set but not used [-Wunused-but-set-variable]

* mini-runtime.c:2977:14: warning: variable invoke set but not used [-Wunused-but-set-variable]

* mono-rand.c:94:1: warning: mono_getentropy defined but not used [-Wunused-function]
2019-07-30 12:10:30 +02:00
Jay Krell f1958bacaa Remove mono_thread_get_name. (#15875)
Unused since https://github.com/mono/mono/commit/b5c0c831da328b8ab7b7283a38fa56baaa7ae380.
And not likely to come back.
2019-07-30 03:08:55 +02:00
Jay Krell 929e3135bb HANDLE_FUNCTION_RETURN_VAL must not use handles in current frame (#15873) 2019-07-30 01:39:44 +02:00
Calvin Buckley 95f8a68c56 ArgumentNullException when pointer is null for Marshal.AddRef/Release/QueryInterface (#15867)
Fixes #15853
2019-07-29 20:27:18 +02:00
dotnet-maestro[bot] a0aae297d9 Update dependencies from https://github.com/dotnet/arcade build 20190729.1 (#15881)
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19379.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19379.1
2019-07-29 20:24:40 +02:00
Jay Krell b5c0c831da Fix thread name leak in debugger. (#15858) 2019-07-29 11:31:14 +02:00
Jay Krell babcdbdcbd [Coop] Convert System.Buffer. (#15861)
And inline `mono_array_handle_length`.
And remove `inline` in .c files a little -- it only belongs in .h.
2019-07-29 11:30:16 +02:00
Zoltan Varga 967a79e5a1 [wasm] Fix the generation of emsdk_env.sh. (#15872) 2019-07-29 11:28:29 +02:00
Vlad Brezae 91b9ff3e53 [interp] Optimize ldelema (#15846)
Makes the opcode 2-3x time faster
2019-07-27 17:37:00 +03:00
Zoltan Varga 9f25324936 [WIP] [runtime] Convert WindowsIdentity.GetRoles () icall to coop. (#15849)
* [runtime] Convert WindowsIdentity.GetRoles () icall to coop.

* [runtime] Replace some Buffer icalls with Unsafe methods.

* Fix the windows build.
2019-07-27 02:27:24 -04:00
Alexander Köplinger 6a6a0f6213 [netcore] Disable new post-build.yml stage in AzDO pipeline 2019-07-27 02:54:50 +02:00
Alexander Köplinger 64be3113a3 [netcore] Add back _DotNetPublishToBlobFeed variable in AzDO pipeline 2019-07-27 02:41:41 +02:00
Alexander Köplinger e38468d0e4 [netcore] Fix condition in AzDO pipeline 2019-07-27 02:15:49 +02:00
Alexander Köplinger 4398a12286 [netcore] Fix name of empty.proj in AzDO pipeline 2019-07-27 02:07:31 +02:00
Alexander Köplinger a3fda4a3cb [netcore] Add back pushing to blob feed in AzDO pipeline 2019-07-27 02:01:20 +02:00
Alexander Köplinger 4ef62c8c46 [netcore] Set variables a bit differently 2019-07-27 00:56:25 +02:00
Alexander Köplinger 882208bbc6 [netcore] Explicitly set _PublishUsingPipelines variable to true
It shouldn't be needed when using the eng/common/templates/jobs/jobs.yml template but it is.
2019-07-27 00:34:38 +02:00
Alexander Köplinger e12a6bf5d8 [netcore] Only install Linux packages on hosted pool 2019-07-27 00:23:00 +02:00
Alexander Köplinger ae488c93e9 [netcore] Fix building of nupkg (#15855)
When https://github.com/mono/mono/commit/9010d2f290d28dc97ac276e0c0d32a2932b7550f was merged we stopped including mcs/build/config.make.
However, that file set the VERSION variable which wasn't migrated to the new netcore/config.make so the nuget package missed the version.

Additionally, System.Private.CoreLib sources were moved into the netcore folder and we now seemingly need to pass `-p:IsPackable=true` for dotnet pack to build the nuget package.
2019-07-27 00:17:31 +02:00
Alexander Köplinger dc16db91a1 [netcore] Enable nuget validation in post-build AzDO pipeline stage 2019-07-26 23:23:12 +02:00
Alexander Köplinger ccb53b88f4 [netcore] Switch back to old way of specifying poolname
Otherwise the AzDO test view contains `$(poolname)`
2019-07-26 23:18:59 +02:00
Alexander Köplinger 296d395535 [netcore] Use yaml stages in azure pipelines definition (#15838)
Arcade would like us to start using yaml stages.
2019-07-26 23:13:12 +02:00
Stephen Toub 216fad5177 Re-enable CA1802 (use consts instead of readonly statics) (#39782)
* Re-enable CA1802 (use consts instead of readonly statics)

I enabled it only for privates and internals, as we've previously violated this in public surface area, and as everything goes through API review moving forward, didn't seem worthwhile fighting it and adding suppressions in various places.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-07-26 20:08:24 +02:00
Nicholas Schell 51aa4b019a [Mono.Posix] Parameters for chown should be signed integers not unsigned (#15828)
Fixes https://github.com/mono/mono/issues/10748

The calls for chown, lchown, fchown, and fchownat (from `Mono.Unix.Native.Syscall`) are all declared with unsigned integers for the `owner` and `group` parameters. This is incorrect.

Directly from the manpage
`man 2 chown`
<pre><code>
...
       int chown(const char *pathname, uid_t owner, gid_t group);
       int fchown(int fd, uid_t owner, gid_t group);
       int lchown(const char *pathname, uid_t owner, gid_t group);

...

       int fchownat(int dirfd, const char *pathname,
                    uid_t owner, gid_t group, int flags);

...
...
       <b>If the owner or group is specified as -1</b>, then that ID is not changed.
...
</pre></code>

Emphasis added on the documentation explaining how the parameters can take the value -1, clearly not an unsigned integer. The `uid_t` struct is not an unsigned integer. I am assuming this was just an oversite on whoever re-wrote `Mono.Unix.Native.Syscall`.

The original calls from `Mono.Posix.Syscall` (now marked as Obsolete) all correctly use signed integers.
```
                [DllImport ("libc", SetLastError=true)]
                public static extern int chown (string path, int owner, int group);
                [DllImport ("libc", SetLastError=true)]
                public static extern int lchown (string path, int owner, int group);
```

Even the documentation directly from `mcs/class/Mono.Posix/Documentation/en/Mono.Unix.Native/Syscall.xml`
```
          <para>
            One of the owner or group id's
            may be left unchanged by specifying it as -1.
          </para>
```
2019-07-26 20:07:38 +02:00
Ryan Lucia 29428550c2 [netcore] Implement AssemblyLoadContext.GetLoadedAssemblies() (#15832)
* [netcore] Implement AssemblyLoadContext.GetLoadedAssemblies()

* No refonly on netcore

* Ifdef out AppDomain.GetAssemblies() on netcore

* Don't init the error

* Unnecessary ifdef
2019-07-26 18:23:43 +02:00
monojenkins 86fbf751fe [csproj] Update project files 2019-07-26 16:52:58 +02:00
Marek Safar 044982b390 [wasm] Remove assemblies we don't want to distribute 2019-07-26 16:52:58 +02:00
Bernhard Urban b4c5d68c28 [android] switch to python offset tool (#15834)
[android] switch to python offset tool

And drop C# tool.

Fixes https://github.com/mono/mono/issues/9621
2019-07-26 08:15:50 -04:00
Kenneth Pouncey ddb1f31c9e Fix http framework module that errors using SDK 2.1.801 (#15844)
- 2.1.801 seems to have a problem with:

```
						using (var uint8Buffer = Uint8Array.From(await request.Content.ReadAsByteArrayAsync ()))
```
2019-07-26 12:13:27 +02:00
Zoltan Varga 390353d48b [netcore] Add a missing make dependency. 2019-07-26 10:03:14 +02:00
unknown a809e479f3 Update dependencies from https://github.com/dotnet/core-setup build 20190725.9
- Microsoft.NETCore.App - 5.0.0-alpha1.19375.9
2019-07-26 09:10:04 +02:00
unknown 0bb362511c Update dependencies from https://github.com/dotnet/corefx build 20190725.11
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19375.11
2019-07-26 09:10:04 +02:00
dotnet-maestro[bot] 08bd3e5dc1 Update dependencies from https://github.com/dotnet/arcade build 20190725.3 (#15836)
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19375.3
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19375.3
2019-07-26 02:11:51 +02:00
Alexander Köplinger ad2405761b [sdks] Report xcode11 builds as a separate GitHub status 2019-07-25 23:47:24 +02:00
Alexander Köplinger 77ac509c0b [sdks] Add special build job for building with Xcode 11 2019-07-25 23:47:24 +02:00
Aleksey Kliger (λgeek) 04517d3a39 [metadata] Fields whose types are gparams with a reference type constraint aren't blittlable. (#15761)
* [metadata] Fields whose types are gparams with a reference type constraint
aren't blittlable.
Don't try to layout the field to find out if it's blittable.
For gshared gparams, follow the blittability of the constraint.

Fixes certain recursive examples.

```
using System;

namespace TestRecursiveType
{
    class Program
    {
        static void Main(string[] args)
        {
            SubClass subC = new SubClass();
            Console.WriteLine(subC.GetTest());
        }
    }

    public struct ValueTest<U>
    {
        // When U is instantiated with T, from BaseClass, we know it'll be a
	// reference field, so we know the instantiation ValueTest<T> won't
	// be blittable.
        public readonly U value;
    }

    public abstract class BaseClass<T> where T : BaseClass<T>
    {
        public ValueTest<T> valueTest = default(ValueTest<T>);
    }

    public class SubClass : BaseClass<SubClass>
    {
        private String test = "test";

        public string GetTest()
        {
            return test;
        }
    }
}
```

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

---

The failure is happening when we are doing mono_class_setup_fields ("BaseClass<T>") which needs to decide for each field whether it is blittable or not. So therefore we are trying to decide if ValueTest<T> (that is: the ValueTest<U> field inside BaseClass<T>) is blittable or not.

So we instantiate U with T.
Now to decide whether VaueTest<T> is blittable or not, we look at every field.
So then we look at T value.
To decide if T is blittable we first check if it's a reference type.

That check is currently inadequate for generic parameters - what the PR adds is the ability to see if theres a T : class constraint or a T : C constraint - where C is some class. As soon as we know that T's constraint will force it to be a reference type we can definitely say that T won't be blittable without having to initialize C, at all.

Previously, Mono would see that T is some kind of type for which it couldn't definitively decide that it's a reference type and it would call: mono_class_setup_fields (field_class) which would then try to setup the fields of the parent class BaseClass<T>. And that would hit the recursion check.
2019-07-25 17:31:48 -04:00
Aleksey Kliger (λgeek) 090dffb9a0 [tests] Return non-zero exit code from MERP crash test on failure (#15804)
If any of the stress tests fail, return a non-zero exit code from the
supervising process.

Fixes #15781
2019-07-25 17:20:12 +02:00
Jay Krell ee34e2b122 [jit] [x86] Cleanup "_body" and finish conversion to x86_byte. (#15628) 2019-07-25 09:18:20 -04:00
Alexander Köplinger 6a196d6de8 [ci] Disable boehm on FreeBSD
It seems to cause issues and we don't want to spend time on boehm-related problems.
2019-07-25 01:38:00 +02:00
Cassio de Vargas Oliveira 8f0e9887b0 [System.ServiceModel] Add PUT, DELETE and OPTIONS handling to HttpReplyChannel (#15746)
Fixes #15740.
2019-07-25 01:09:41 +02:00
Calvin Buckley 68849282b3 Add community-supported FreeBSD CI to README (#15821) 2019-07-25 01:04:06 +02:00
Jay Krell 8cc7226834 ld configure: Add another dash to export-dynamic. (#15717)
GNU ld accept single or double dash, means the same thing.
AIX ld warns on single dash, errors on double dash, in autoconf, and then errors on single dash later.
We want the double dash so autoconf rejects it on AIX.
2019-07-25 01:02:46 +02:00
Filip Navara 30ce79f3f9 [netcore] Update CoreFX.issues.rsp (#15816)
Remove exclusions fixed by #14967
2019-07-24 22:04:56 +02:00
Aleksey Kliger (λgeek) 784b350c40 [cxx][llvm] Fix C++ build (#15807)
* [cxx] Fix LLVMModuleFlags var initialization

* [cxx] Fix C++ errors in mini-llvm.c
2019-07-24 12:37:57 -04:00
Jay Krell 9e78ce94d5 Remove unneeded auto cast with codeman. (#15792)
The uses are all void* or casted.
2019-07-24 17:31:26 +02:00
Stephen Toub 23cbdeba1b Re-enable CA1825 (zero-length array allocations) (dotnet/corefx#39708)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 17:27:08 +02:00
Vlad Brezae 4f84f21cbc [sre] Don't throw random exception when runtime shuts down (#15798)
Added here https://github.com/mono/mono/commit/89d1455a80ef`
2019-07-24 18:17:09 +03:00
Alexander Köplinger 6dff5fc813 Remove traces of w32process-win32-internals.h which was deleted by previous commit 2019-07-24 16:52:37 +02:00
Jay Krell f68c52c089 [Coop] Convert System.Diagnostics.{FileVersionInfo,Process}. (#15789) 2019-07-24 16:50:39 +02:00
Alexander Köplinger 57a6ebbf1a [netcore] Run tests only on public builds (#15812) 2019-07-24 15:26:48 +02:00
Vlad Brezae 71630cce75 [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.
2019-07-24 14:31:51 +02:00
Steve Pfister 2238c9dc5f Bump mono/corefx@eb5ba09 (#15799) 2019-07-24 07:50:52 -04:00
Alexander Köplinger 5f1da4d454 [ci] Add extra CI_TAGS for freebsd 2019-07-24 12:33:08 +02:00
Filip Navara 24bffd544a Update CoreFX.issues.rsp 2019-07-24 11:02:42 +02:00
Egor Bogatov 122494330d [netcore] Allow different enums as return type in CreateDelega… (#15787)
* Relaxed check for return type in CreateDelegate

* fix build errors
2019-07-24 09:50:29 +02:00
Marek Safar 2a01e1b125 [netcore] Update roslyn dependency 2019-07-24 09:45:03 +02:00
Jan Kotas 047a961ecd Fix build break in TimerQueue.Portable.cs
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Sung Yoon Whang 3468ef668f Fix first value of counter payload being skewed (dotnet/coreclr#25739)
* Fix issue 25709

* rename

* Fix regression test

* cleanup

* Code review feedback

* set maxincrement to 3

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub f8d61819b8 Make all event types nullable (dotnet/coreclr#25752)
Late-breaking design change: all events should be declared with nullable delegate types.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub 4ec5b8de98 Remove now unnecessary !s / TODO-NULLABLE comments (dotnet/coreclr#25749)
* Remove !s and TODO-NULLABLE comments for [DoesNotReturn]

* Remove !s and TODO-NULLABLE comments for [NotNullIfNotNull]

* Remove !s and TODO-NULLABLE comments for writes via Interlocked.CompareExchange

* Remove !s and TODO-NULLABLE comments for Debug.Assert on fields

* Update/add several TODO-NULLABLE comments

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Santiago Fernandez Madero 0a683afa9a Fix nullability warnings from compiler update
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Jan Kotas 176d523060 Delete unnecessary method (dotnet/coreclr#25661)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub ef3cbe9c56 Disable debugger evaluation of ValueTask<T>.Result (dotnet/coreclr#25727)
If the debugger evaluates a `ValueTask<T>`'s `Result`, that counts as the "you should only consume a `ValueTask<T>`" once, and ends up breaking / hanging / throwing exceptions and other bad stuff while stepping through code in the debugger.

This commit addresses that in two ways:
1. Adds `[DebuggerBrowsable(Never)]` to `Result` to prevent it from showing up in debugger views.
2. Adds a NotifyOfCrossThreadDependency call to its ToString.  This prevents the debugger from using ToString to show an implicit representation of the instance, and it forces the developer explicitly trying to access ToString (e.g. in the watch window) to click a button acknowleding the impact.

(Post 3.0, we should consider removing the `ValueTask<T>.ToString()` override altogether.)

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Jan Kotas 927d8c322d Fix use of uninitialized variables in managed decimal implementation (#25674)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub c465ad1e80 Remove stale nullable !s and pragmas (dotnet/coreclr#25640)
Also update TODO-NULLABLE comments to be more specific where appropriate.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub 089743f733 Add AggressiveInlining to Single.GetHashCode (dotnet/coreclr#25633)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub 137c333cda Fix Timer argument exception parameter names (dotnet/coreclr#25617)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub 9d64e1ef74 Fix regression in Timers with long timeouts (dotnet/coreclr#25604)
* Fix regression in Timers with long timeouts

Early in .NET Core 3.0, we added an important optimization to significantly reduce lock contention and CPU overheads in situations where lots of timers were firing.  The optimization worked by splitting the set of timers into those expected to fire in the very near future and then everything else.  However, for really long timers (e.g. > 24 days), due to integer overflows we can accidentally put a long timer onto the short list and cause a timer that shouldn’t fire for days to instead fire in milliseconds.  This is not the first such bug we’ve had in Timer, and there is a fair amount of complicated casting (that we sometimes get wrong, obviously) in order to keep the tick count usage within the Int32 domain.  This PR addresses the problem (and hopefully others in the future) by switching over to using Int64.  We’re already paying to get 64-bit tick counts on both Windows and Unix, so this just removes truncation that was being performed, does a little more addition/comparison with 64-bit values instead of with 32-bit, and stores an Int64 instead of Int32 in each TimerQueueTimer.  On 64-bit, this has a 0 increase in memory consumption, as it simply ends up utilizing padding space that was previously in TimerQueueTimer.  On 32-bit, it increases memory allocation when creating a Timer by 4 bytes from 80 to 84 (still 3 allocations), but I believe it’s the right trade-off for reduced complexity and bug likelihood.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Alexander Köplinger 70c72891f2 [netcore] Update Version.Details.xml
The earlier PR didn't update this file which is used by arcade for tracking.
2019-07-24 08:39:35 +02:00
Aleksey Kliger (λgeek) 7467ce4369 [netcore] Implement AssemblyLoadContext.InternalLoad (#15753)
Fixes https://github.com/mono/mono/issues/14830
2019-07-23 19:09:27 -04:00
Filip Navara 1551fa7951 [netcore] Bump CoreFX version to 5.0.0 (#15795)
* Bump CoreLib version

* Workaround to get dotnet to find dependencies

* Compile CoreLib with nullablePublicOnly
2019-07-24 00:53:30 +02:00
Zoltan Varga 69d179cba2 Avoid creating handles in a loop. 2019-07-23 12:55:55 -05:00
Zoltan Varga 4d1a6358d0 [runtime] Convert AssemblyBuilder.basic_init to handles using a gc handle to pin the object. 2019-07-23 12:55:55 -05:00
Zoltan Varga 063c3ed7f9 [runtime] Mark a few icalls as NOHANDLES. 2019-07-23 12:55:55 -05:00
Zoltan Varga 7b384f710c [runtime] Convert Environment icalls to handles. 2019-07-23 12:55:55 -05:00
Zoltan Varga fe015de078 Fix the netcore build. 2019-07-23 12:55:55 -05:00
Zoltan Varga 5ca052fca2 [runtime] Convert ValueType icalls to handles. 2019-07-23 12:55:55 -05:00
Larry Ewing 84af927e7d [wasm] clean up the clean targets 2019-07-23 12:16:22 -04:00
Zoltan Varga a9404577e6 [runtime] Convert locale code to use handles. (#15774)
* [runtime] Convert locale code to use handles.

* Sort a list of defines.

* Remove a do-while.

* Fix c++-ism.

* Use mono_string_handle_to_utf8 (). Update comments.
2019-07-23 11:33:20 -04:00
Jo Shields ce6c02e903 Forcibly clean working directory on every AzDO build (#15801) 2019-07-23 11:05:18 -04:00
Aleksey Kliger (λgeek) 148891b515 [cxx][netcore] Fix C++ build (#15786)
assembly.c `exact_sn_match` uses bitwise-or on MonoAssemblyNameEqFlags
2019-07-23 11:42:51 +02:00
Zebediah Figura 1854e439e5 [corlib] Foward System.Type.GetTypeFromProgID() to the correct function (#15693)
Fixes a stack overflow when running Staxel under wine-mono.
2019-07-23 11:17:28 +02:00
Alexander Köplinger 3e7f130739 [ci] Make sure global variables are really global
Using "def" in groovy makes it local to the run() method.
2019-07-23 10:27:53 +02:00
Kenneth Pouncey d46fa9b1e3 Add target for the browser threads tests run 2019-07-22 20:07:34 -04:00
Kenneth Pouncey 7cd7f5f9e1 Add running the browser tests for threads. 2019-07-22 20:07:34 -04:00
Ryan Lucia beb5553398 [netcore] Make assembly name parsing and comparison case-insensitive (#15522)
* Re-enable test

* Parse assembly info case-insensitively

* Lowercase the parsed public key token

* Case-insensitive comparison of public key tokens

* Fix string copy
2019-07-22 17:23:26 +02:00
Jo Shields 548fe0e0c1 Fix build on Autoconf 2.63 (#15636)
* Fix build on Autoconf 2.63

This was broken in e7f9dbe73c, because
AS_VAR_APPEND does not exist until v2.63b (?!)

* Work around autoconf for Mac not being fit for purpose

The correct way to do this is with AC_DEFUN in a special m4 file

But this dies on Mac, because reasons.

See also https://github.com/jedisct1/libsodium/issues/217
2019-07-22 17:20:47 +02:00
Maxim Lipnin ffe5446a40 Fix ambiguous time at the end of DST period on Windows 2019-07-22 17:12:46 +02:00
Ryan Lucia 54f608d08d Miscellaneous loader-related fixes (#15765)
* Clarify contents of list

* Fix mono_assembly_get_alc

* Remove pointless ifdef

* Prepend to domain_assemblies

* Revert "Prepend to domain_assemblies"

This reverts commit dbe6e47b80470fa13d22d97d32721d18c4764597.

* Ditch another ifdef
2019-07-22 10:58:12 -04:00
Vlad Brezae 009b0dd4c3 [interp] Enable inlining of object constructors (#15665)
* [interp] Split code for obj / vt newobj instruction

* [interp] Enable inlining of object constructors

If the ctor was inlined, the newobj instruction receives a max ushort as the data item for the index, so it doesn't execute the ctor in this case. Also, when inlining, we need to push on the stack the allocated object, once as argument for the ctor and the second needs to remain on the stack as the result of the IL newobj instruction.
2019-07-22 17:03:26 +03:00
Ryan Lucia 3c2813deb7 Special-case arrays of interfaces/generic parameters in IsAssignableFrom (#15749)
* Formatting fix

* Special-case arrays of interfaces/generic parameters

* Make more generic, fix typo

* Consider class constraint and add more elucidating comment

* Fix for potential crash

* Add test

* Fix test
2019-07-22 09:56:48 -04:00
Alexander Köplinger f497893a84 Add more tests to tarball with EXTRA_DIST 2019-07-22 15:23:09 +02:00
Aleksey Kliger (λgeek) 4138f096f8 [netcore] Re-enable AssemblyGetForwardedTypesLoadFailure (#15763)
Was fixed by https://github.com/mono/mono/pull/15752
2019-07-22 12:52:17 +02:00
Kenneth Pouncey e42d338e8f Add threads support to the SDK runtime generation.
- To enable the build with threads set `<EnableMonoWasmThreads>true</EnableMonoWasmThreads>`
   - default is false.
2019-07-19 17:33:08 -04:00
Kenneth Pouncey 98d8612b6b Fix packaging of the SDK when the runtime for threads does not exist
Closes https://github.com/mono/mono/issues/15734
2019-07-19 17:33:08 -04:00
Kenneth Pouncey eddd299c72 Add Signing.props file to common directory to be referenced from a common place
- Add the `Signing.props` to the `Directory.Build.props`
2019-07-19 17:33:08 -04:00
Maxim Lipnin e8d7f7c004 [netcore] Make System.Linq.Expressions.Tests.BindTests.GlobalField Pass (#15658)
`Expression.Bind` should throw `ArgumentException` if called with `FieldInfo` for a global field. The exception is thrown from validation of the (null) `DeclaringType` (see https://github.com/dotnet/corefx/pull/15318).
Mono returns `"<Module>"` in this case and doesn't throw so the test fails. 

Fixes #14917 .
2019-07-19 23:21:22 +02:00
Alexander Köplinger d159a38c47 [ci] Clean working directory after build in package and sdks build 2019-07-19 22:59:06 +02:00
Alexander Köplinger 1ab23207b5 [ci] Don't use method which is not allowed in Groovy sandbox 2019-07-19 22:52:01 +02:00
Alexander Köplinger 0c39f1f537 [ci] Fix OSX package builds to only be timer-triggered on master 2019-07-19 22:47:05 +02:00
Alexander Köplinger 6407d27000 [packaging] Don't use dl.xamarin.com for gtksharp package anymore 2019-07-19 22:16:34 +02:00
Alexander Köplinger 7bcba4e9bc [ci] Remove -f option from genhtml during code coverage
It needs some cpan modules to be installed which is a pain on OSX.
2019-07-19 22:10:38 +02:00
Alexander Köplinger 4909cf320f [ci] Run OSX package builds on master only once per day 2019-07-19 21:10:20 +02:00
Jay Krell 3e432663cd Remove mono_arch_free_jit_tls_data. (#15662) 2019-07-19 14:40:54 -04:00
Alexander Köplinger 49ed255707 [sdks] Calculate sha1 of sdks archive and upload it
This was requested by the XA team.
2019-07-19 20:05:48 +02:00
Ryan Lucia d685b72cb2 [netcore] Implement Thread.CurrentOSThreadId (#15748)
* [netcore] Implement Thread.CurrentOSThreadId

* Add comment explaining differences with mono_native_thread_id_get

* Add haiku implementation

* Attempt to fix linux builds

* Add MonoError parameter to icall
2019-07-19 13:22:50 -04:00
Sebastien Lebreton ec3cb3eb4e Fix TypeMirror.CSharpName computation 2019-07-19 10:42:00 -04:00
Kenneth Pouncey b85c584c0f WebAssembly.Core.Array.Pop should return null if the WebAssembly.Core.Array is empty instead of error. 2019-07-19 10:32:07 -04:00
Alexander Köplinger 3ff64f1efb [metadata] Fix name of header file
The file added as part of d5b374bb51 was actually called loaded-images-internals.h
2019-07-19 15:56:12 +02:00
Alexander Köplinger 7784f20a26 [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.
2019-07-19 14:50:10 +02:00
Egor Bogatov 8b2141a741 [netcore] Fix CI failures (#15745) 2019-07-19 14:06:04 +02:00
Alexander Köplinger a543958765 [ci] Add python3-pip package to wasm sdks build 2019-07-19 13:49:07 +02:00
Bernhard Urban 3f7d33ce85 [ios] Switch to python offset tool (#15744)
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 https://github.com/xamarin/xamarin-macios/pull/6603#issuecomment-512803082

Contributes to https://github.com/mono/mono/issues/9621
2019-07-19 13:48:02 +02:00
Aleksey Kliger (λgeek) 944cc96cac [netcore] Pass ALC in second loader request in load_reference_by_aname_default_asmctx (#15752)
Fixes crash in System.Reflection.Tests netcore testsuite in
System.Reflection.Tests.AssemblyNetCoreAppTests.AssemblyGetForwardedTypesLoadFailure
2019-07-19 07:44:07 -04:00
Alexander Köplinger 6ab8aff5dd [sdks] Add z option to tar
It's required on linux.
2019-07-19 12:49:38 +02:00
Alexander Köplinger a02f3aaf4b [sdks] Add linker sources to Android linux archive 2019-07-19 11:32:38 +02:00
Alexander Köplinger 349da3387c [sdks] Add third party notices and licenses to sdks archives (#15741)
It takes all THIRD-PARTY-NOTICES.TXT and LICENSE files from the repo.
2019-07-19 11:07:39 +02:00
Vlad Brezae c449308f8b [glib] Use clock_nanosleep if available (#15443)
According to the manual, it is recommended to use clock_nanosleep instead of nanosleep when the sleep can be repeatedly interrupted by signals and resumed. The remaining sleep interval was greater than the original timespec.

Fixes random timeouts of finalizer-abort.exe
2019-07-19 10:21:21 +03:00
Aleksey Kliger (λgeek) a37ad98b47 [loader] Pass ALC to mono_domain_loaded_internal, and then to domain search hook (#15743)
* Add a temporary mono_domain_ambient_alc function

Just use this to mark places where we need to pass through an ALC

* [runtime] Mark mono_assembly_loaded_full external only.

Runtime should use mono_assembly_loaded_internal.

* [loader] Add mono_install_assembly_search_hook_v2

Use it to install mono_domain_assembly_search and
mono_domain_assembly_postload_search.

The principal difference is that we can pass an assembly load context to the
hook.  But also we cleanup the "requesting assembly" hack for
mono_domain_assembly_postload_search.

* [domain] Comments and mono_assembly_get_alc ()

* [debugger] Comment on suspicious loader lock
2019-07-19 00:01:56 -04:00
Larry Ewing 34be988e33 Merge pull request #15704 from lewing/bump-msbuild-nuget-5.2
Bump msbuild to track xplat-master
2019-07-18 20:45:02 -04:00
Andy Hanson 25e79664b9 Return HardLimitBytes from GCMemoryInfo.TotalAvailableMemoryBytes (#25437)
* Add property HardLimitBytes to GCMemoryInfo

This adds a new property HardLimitBytes.

Unlike TotalAvailableMemoryBytes,
this will reflect an explicitly set COMPLUS_GCHeapHardLimit.

It will also reflect the fraction of a container's size that we use,
where TotalAvailableMemoryBytes is the total container size.

Normally, though, it is equal to TotalAvailableMemoryBytes.

Fix #38821

* Remove HardLimitBytes; have TotalAvailableMemoryBytes take on its behavior

* Fix typos

* Separate total_physical_mem and heap_hard_limit
so we can compute highMemoryLoadThresholdBytes and memoryLoadBytes

* Do more work in gc.cpp instead of Gc.cs

* Consistently end names in "Bytes"

Signed-off-by: dotnet-bot <[email protected]>
2019-07-18 19:10:21 -04:00
Aleksey Kliger (λgeek) 3f55bfb5cc [mini] Runtime check if boxing is needed for DIM constrained calls (#15729)
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:46:55 -04:00
imhameed 561b400baa [interp] Use correctly-sized writes and reads in Unsafe.AddByteOffset and Unsafe.ByteOffset (#15677)
[interp] Use correctly-sized writes and reads in Unsafe.AddByteOffset and Unsafe.ByteOffset

The truncated store to the top of the stack in`MINT_INTRINS_UNSAFE_BYTE_OFFSET` could cause the upper bytes of the address used as the first argument to `ByteOffset` to linger, yielding inaccurate (and usually excessively large) offsets on systems where `sizeof(void *) > sizeof(guint32)`; this made
`System.Text.Unicode.Utf8Utility.GetPointerToFirstInvalidByte` return nonsense results.

The truncation in `MINT_INTRINS_UNSAFE_ADD_BYTE_OFFSET` hasn't, as far as I know, caused any test failures. But `AddByteOffset` takes an `IntPtr` as its second argument, not an `int`.

Fixes #14847.
2019-07-18 14:16:46 -04:00
Maxim Lipnin ab4eca1785 [netcore] Clean up rsp-file (#15700) 2019-07-18 18:34:10 +02:00
Egor Bogatov e6d2091a24 [netcore] Revise items in CoreFX.issues.rsp (#15664) 2019-07-18 18:33:38 +02:00
Aleksey Kliger (λgeek) d5b374bb51 [loader] Add MonoAssemblyLoadContext; stop sharing MonoImages on netcore (#15527)
Implement a couple of things:

1. Add a `MonoAssemblyLoadContext` opaque struct
2. On netcore Mono, use it to keep track of  which `MonoImage`s are loaded.  (Addresses part of #13891) 

In a bit more detail:

- Add a `MonoLoadedImages` struct to hold the hash tables that we use for checking if a `MonoImage` is already loaded
- Add an opaque `MonoAssemblyLoadContext` typedef
- (Framework Mono) Add a `get_global_loaded_images()` function to get the shared `MonoLoadedImages`
- (netcore Mono) Add a `MonoAssemblyLoadContext` struct that owns a `MonoLoadedImages` and add a `default_alc` member to `MonoDomain
- Pass a `MonoAssemblyLoadContext*` to most `MonoImage`-loading functions - on Framework Mono its usually NULL and we fall back to the global loaded images, on netcore Mono it's usually `domain->default_alc->loaded_images`
- (netcore Mono) Create a default Assembly Load Context when a `MonoDomain` is created
- Add a `MonoAssemblyLoadContext*` field to `MonoAssemblyLoadRequest` and pass an ALC in a few places.

---

Remaining work:

(netcore Mono) There are still places where a `MonoAssemblyLoadRequest` or a `MonoAssemblyOpenRequest` has a `NULL` ALC - those will need to be tracked down and fixed.

(netcore Mono) Eventually `MonoAssemblyLoadContext` should keep track of the loaded `MonoAssembly`s, not just images.  One goal on netcore Mono is to ifdef out `MonoDomain:domain_assemblies`.


---



* [loader] Add a MonoLoadedImages struct to own the MonoImage sharing

   Initially, there's just a single global set of loaded images.

   Once we have AssemblyLoadContext support, each ALC will have a separate set.

   NOTE:
     - Some of the existing Mono API is difficult to support with this design
       since it assumes each MonoImage is loaded at most once.

* [loader] Add a MonoAssemblyLoadContext member to MonoImage for netcore

* [loader] Unregister image from its owner when closing

* [loader] Pass MonoLoadedImages to register_image

* [domain] Add mono_domain_default_alc and mono_alc_get_loaded_images

* [loader] Add an AssemblyLoadContext argument to mono_image_loaded_internal

* [metadata] Add mono_image_get_alc ()

* [loader] Pass MonoAssemblyLoadContext to mono_image_open_from_data_internal

* [loader] Pass MonoAssemblyLoadContext to mono_image_open_from_module_handle

* [loaded] Pass MonoLoadedImages to mono_image_open_a_lot_parameterized

* [loader] Pass MonoAssemblyLoadContext to mono_image_open_a_lot

* [runtime] Mark mono_image_open_full external only

   Runtime should use mono_image_open_a_lot.

* [runtime] Mark mono_image_loaded_by_guid external only

   Also mark mono_image_loaded_by_guid_full external only

   Runtime will need some (as yet unwritten) mechanism that takes a MonoAssemblyLoadContext as an argument.

* [domain] Create a default ALC for each MonoDomain

* [netcore] Pass default ALC in mono_core_preload_hook

   If the assembly name matches a trusted platform assembly, open it in the default ALC of the root domain

* [mini] Open main assembly in default ALC in the root domain

* [netcore] Don't define get_global_loaded_images()

   Every assembly load request should come from an assembly load context.  Each ALC has a set of loaded images.  So we should never need a global list.

   With this PR, we no longer share MonoImages across distinct ALCs.  So in principle, each ALC can open the same assembly but resolve its references in different ways.

   Fixes part of https://github.com/mono/mono/issues/13891

* [runtime] Mark mono_pe_file_open external only

* [loader] Pass MonoAssemblyLoadContext to mono_image_open_raw  and mono_image_open_metadata_only

* [loader] Pass MonoAssemblyLoadContext to do_mono_image_open and set MonoImage:alc

* [loader] Add version 2 of assembly preload hook

   Pass MonoAssemblyLoadContext through the preload hook.  This is used in mono_assembly_request_byname_nosearch which, in turn, is called by load_reference_by_aname_default_asmctx which is used to resolve references from one assembly to another.

* [netcore] Pass native ALC ptr to AssemblyLoadContext.InternalLoadFile

* [netcore] Implement AssemblyLoadContext.InternalInitializeNativeALC

   also implement mono_domain_create_individual_alc ()

* [netcore] Pass ALC to System.Reflection.Assembly.InternalLoad

   Pass the domain default ALC to mono_assembly_load ()

   Also pass MonoAssemblyLoadContext to mono_assembly_load_full_gac_base_default ()

* [loader] Implement MONO_LOADED_IMAGES_ASSEMBLY properly

   Store the MonoLoadedImages for netmodules in the MonoImage for the main image of an assembly.  This is also used by SRE - the dummy module of the AssemblyBuilder has the loaded_images that contains the ModuleBuilders.

* [loader] Use global_loaded_images for netmodules with framework Mono

   The new stuff is only for ALC support in netcore

* [loader] Drop netmodule support in MonoAssemblyLoadContext

   netmodules are not supported in netcore

* [loader] Spin out image hashing out of image.c

   Move MonoLoadedImages support code to loaded-images.c loaded-images-global.c and loaded-images-netcore.c

Also spin out assembly-load-context.c for MonoAssemblyLoadContext functions

* Move ALC icall to assembly-load-context.c

* formatting fix

* [msvc] Add new files to .filters

* update comments

* [image] Change mono_loaded_images_remove_image to decrement the refcount

Decrement the refcount and remove the image from the loaded images hashes in
one place.  Change mono_loaded_images_remove_image to return TRUE if the rest
of image unloading should proceed or not.

* [loader] Drop unused argument to mono_alc_init
2019-07-17 17:35:15 -04:00
Jay Krell e2ce0a16a6 Fix leaks in mono_lookup_internal_call_full_with_flags, for lack of destructors. (#15659)
* Fix leaks in mono_lookup_internal_call_full_with_flags, for lack of C++ destructors.

* Initialize `sigstart` also.
2019-07-17 12:09:18 -07:00
Jay Krell b08aa71948 configure/makefile To support updating zlib to 1.2.11. (#15697) 2019-07-17 12:07:56 -07:00
Ryan Lucia 86e22c4a7f Print two bytes at a time in mono_pe_file_map conversion error (#15523)
* Print two bytes at a time

* Iterate over gunichar2
2019-07-17 11:49:30 -07:00
Alexander Köplinger c62473114a Add com.apple.security.cs.allow-unsigned-executable-memory exception to hardened runtime entitlements (#15721)
This avoids the issue from https://github.com/mono/mono/issues/13445 when hardened runtime is enabled.
2019-07-17 20:48:06 +02:00
Larry Ewing 36b9e006f3 Merge pull request #15713 from lewing/sdk-disable-gac
[ios][android] disable gac in ios and android sdk builds
2019-07-17 09:09:36 -04:00
Filip Navara 9af45e09db [netcore] Clear system last error before P/Invoke calls with SetLastError=true (#15703)
Fixes #15691
2019-07-17 14:44:50 +02:00
Alexander Köplinger 0509ceccb6 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.
2019-07-17 14:26:24 +02:00
Egor Bogatov 4febac951e [bcl] Sync recent NS2.1 changes (#15696)
1) Copied changes from corefx for System.Data (also https://github.com/mono/corefx/pull/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 https://github.com/mono/mono/issues/13412)
2019-07-17 13:08:29 +02:00
monojenkins b61a4368c0 [bcl] Update BCL Linked Size 2019-07-17 06:42:24 -04:00
Alexander Köplinger ba1c7da0b9 [bcl] Add Mono.Cecil.Mdb assembly to monodroid_tools profile (#15710)
* [bcl] Add Mono.Cecil.Mdb assembly to monodroid_tools profile

Requested by the XA team.

* [csproj] Update project files
2019-07-17 11:19:04 +02:00
Alexander Köplinger d732cef5fc [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.

(cherry picked from commit d410e07d8b)
2019-07-17 10:57:38 +02:00
Larry Ewing 3a075b0b1e [wasm] disable gac in wasm runtime (#15686)
* [wasm] disable gac in wasm runtime

* [wasm] disable gac wasm.mk not configure.ac
2019-07-17 04:56:42 +02:00
Zoltan Varga 553fee6f03 [runtime] Fix the error message for exceptions created from MonoError. (#15705)
Fixes https://github.com/mono/mono/issues/15692.
2019-07-16 21:09:39 -04:00
Alexander Köplinger 39472e06a3 [ci] Wait for signing outside of a node() block
We don't need to block the machine just for waiting on signing to finish.
2019-07-17 01:01:42 +02:00
Larry Ewing 6727d1a39b [ios][android] disable gac in ios and android sdk builds 2019-07-16 18:22:26 -04:00
Zoltan Varga 978653633b [interp] Make the code GC safe on wasm. (#15695)
* [interp] Pass the vtable to get_virtual_method () to reduce the number of objrefs being passed around.

* No longer a prototype.

* [interp] Make the code GC safe on wasm.

* Use frame->o only on WASM.
2019-07-16 17:49:33 -04:00
Jay Krell 43f1a26804 Fix use of freed memory. (#15660)
Fix use of freed memory.
Move the free later, on the assumption that the free itself doesn't use memory now freed before it.
Found with Valgrind.
2019-07-16 13:16:52 -07:00
Alexander Köplinger 7480830b36 [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.
2019-07-16 21:32:13 +02:00
Aleksey Kliger (λgeek) d8a679375d [netcore] Use the strict loader (#15668)
Mono historically was quite lax in how it resolved assembly references - it
would pick the first assembly with a matching simple name.  The "strict"
mode (available in framework Mono with `--assembly-loader=strict`) follows the
spec behavior: the version and public key token of the candidate assembly must
match what is requested.
2019-07-16 20:30:16 +02:00
Filip Navara d2f7851c92 [netcore] Ignore public key when matching assemblies (#15678)
Related to #15669
2019-07-16 11:05:26 -07:00
Larry Ewing ee2b1089ff Bump msbuild to track xplat-master 2019-07-16 10:43:54 -04:00
Alexander Köplinger 709ba3faa5 Revert "Update dependencies from dotnet/corefx"
This reverts commit 4e513f802a.

It broke a few netcore tests.
2019-07-16 16:31:50 +02:00
Alexander Köplinger cef723ca9c [sdks] Use Azul Zulu OpenJDK for Android Linux build, since Debian 10 has no Java 8 2019-07-15 23:25:26 +02:00
Alexis Christoforides 532605f533 [System] Keep events from firing from a disposed 'DefaultWatcher' FileSystemWatcher
Fixes https://github.com/mono/mono/issues/8747

Also try to stop other implementations from dispatching events past Dispose(), without guaranteeing it
2019-07-15 23:25:32 +03:00
Alexander Köplinger 4b6f49bb06 [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.
2019-07-15 21:36:04 +02:00
Larry Ewing 11ca09b3bb [wasm][size-diff] fix typo in wasm targets (#15676) 2019-07-15 20:25:33 +02:00
Alexander Köplinger 4e513f802a Update dependencies from dotnet/corefx 2019-07-15 17:52:29 +02:00
dotnet-maestro[bot] 157728ce0d [master] Update dependencies from dotnet/corefx (#15689)
* Update dependencies from https://github.com/dotnet/corefx build 20190714.1

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19364.1

* Update dependencies from https://github.com/dotnet/arcade build 20190703.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19353.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19353.1

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/corefx build 20190703.3

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19353.3

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08
2019-07-15 17:14:49 +02:00
Thays Grazia 73128453da [debugger] Don't list finalizer gc thread if it's not executing managed code (#15618)
* 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 it's not executing a managed code of the list that is returned when CMD_VM_ALL_THREADS is called.

Fix #13311
2019-07-15 11:58:04 -03:00
Alexander Köplinger d85fe2c391 [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:17:27 +02:00
Jay Krell ceb09980f5 Fix leak in create_runtime_invoke_info when mono_class_vtable_… (#15661) 2019-07-15 11:34:54 +02:00
Jay Krell 6cd6f65f69 Trim mono_mini_arch_lock, mono_mini_arch_unlock, mini_arch_mutex. (#15663) 2019-07-15 11:34:34 +02:00
Bernhard Urban 9a19bdb6e6 [llvm] avoid FP elimination on iOS/armv7 (#15617)
[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
2019-07-14 16:15:55 -04:00
Aleksey Kliger (λgeek) 70e9f8c501 Add configure flag to disable GAC support; disable GAC in netcore (#15681)
* [runtime] Add configure flag to disable GAC support

* [netcore] Disable GAC support
2019-07-13 11:36:37 -04:00
Larry Ewing 016a5253bb Merge pull request #10202 from Unity-Technologies/fix-dynamic-method-marshal-info
Don't try to access metadata for dynamic method added to non-dynamic …
2019-07-12 18:22:01 -05:00
Steve Pfister 611b94cb41 [ios] Nil Check to Ensure Local TimeZone Id is Set For TimeZon… (#15682)
In runtime.m added nil check in xamarin_timezone_get_local_name. Returns Local as the Id in the case of nil.
2019-07-12 20:56:45 +02:00
Alexander Köplinger e3d5b23ff9 [ci] Upload mac-entitlements.plist to azure when uploading .pkg
So it can be used by the codesigning job.
2019-07-12 19:46:50 +02:00
monojenkins 45c82cc647 [bcl] Update BCL Linked Size 2019-07-12 20:15:06 +03:00
Jo Shields 202dca075b 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
2019-07-12 15:29:00 +02:00
Alexander Köplinger 02829bb914 [ci] Add back accidentally removed check 2019-07-12 15:27:39 +02:00
Kenneth Pouncey f3aaade4c7 [wasm][sdk][tests] Use the SDK to build the browser tests (#15605)
# Fix the runtime paths evaluation.
- If running from a master build the runtime builds path is different from the nuget paths.
  - From a master build the runtime builds are found in `wasm\builds` now.

# Browser Tests modifications:
- Moved all sources to a sources directory `tests\browser\src\`.
- Create a solutions project that can be built by VSfMac or VS using the SDK
- Create separate projects for each TestSuite.
- Change makefile target for the browser tests to use `dotnet` to build instead of the `packager.exe`

# SDK modifications and fixes:

Fix sdk build to run `monolinker.exe` using `dotnet`
- Run `mono` as task tool if running from `dotnet` and not running under Windows instead of executing the `monolinker.exe` directly
- Clean up WasmLinkAssemblies code.
   - Add routine to determine if build was initiated from `dotnet` instead of msbuild.
   - Add common routine to find the correct monolinker.exe to execute depending on running local or nuget.

Without the previous fixes, `monolinker` step can fail with the following message when using `dotnet build`

```
.nuget/packages/mono.webassembly.build/0.1.0-preview1/build/netstandard2.0/Mono.WebAssembly.Build.targets(76,3): error MSB6006: "monolinker.exe" exited with code 8.
```

The faling msbuild target is:

```
      _MonoWasmLink:
         /Users/Jimmy/.nuget/packages/mono.webassembly.build/0.1.0-preview1/build/tools/monolinker.exe --verbose --exclude-feature
         ... the rest of the command is cut off from here to save space

```

With the fixes command above becomes the following which execute the `monolinker` with `mono`. :

```
      _MonoWasmLink:
         /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono /Users/Jimmy/.nuget/packages/mono.webassembly.build/0.1.0-preview1/build/tools/monolinker.exe --verbose --exclude-feature remoting --exclude-feature com

         ... the rest of the command is cut off from here to save space
```
2019-07-12 14:44:40 +02:00
Jay Krell 81ed8dfaff extern "C" reduction. (#15634) 2019-07-12 12:01:35 +02:00
Marek Habersack 461ceae59b Fix offsets tool for Android NDK r20
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-12 12:41:54 +03:00
Zoltan Varga 04034032f4 [jit] Fix the devirt of EqualityComparer<byte>. (#15644)
* [jit] Fix the devirt of EqualityComparer<byte>.

* Add a test.

* Fix the tests.
2019-07-12 01:24:52 -04:00
Steve Pfister 537fc4b60d [ios] Ensure Local TimeZone Id is Set For TimeZoneInfo.Local (#15667)
* 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.
2019-07-11 23:45:03 +02:00
Egor Bogatov 792bfbff91 [netcore] Do not inline ThrowHelpers, fix SkipFrames handling. (#15607)
1) Do not inline ThrowHelpers (e.g. `static void ThrowException() => throw new Exception();`)
2) `get_trace` incorrectly handles `skip` argument
3) fix broken ci (`dl-test-assets.py` is not python2 compatible any more)

Fixes https://github.com/mono/mono/issues/15182
Fixes https://github.com/mono/mono/issues/15188
2019-07-11 21:42:14 +02:00
Egor Bogatov 972cd65365 [netcore] Fix IsAssignableFrom (#15641)
Mono used to return `true` for these three cases (see System.Reflection.Tests.TypeTests.IsAssignableFrom tests):
```csharp
using System.Reflection;
using Xunit;

namespace ConsoleApp
{
    public static class Program
    {
        static void Main(string[] args)
        {
            Assert.False(typeof(TI_Interface1[]).GetTypeInfo().IsAssignableFrom(
                         typeof(TI_StructWithInterface[]).GetTypeInfo()));

            Assert.False(typeof(int?[]).GetTypeInfo().IsAssignableFrom(
                         typeof(int[]).GetTypeInfo()));

            Assert.False(typeof(int[]).GetTypeInfo().IsAssignableFrom(
                         typeof(int?[]).GetTypeInfo()));
            
        }
    }
    
    public interface TI_Interface1 { }
    public struct TI_StructWithInterface : TI_Interface1 { }
}
```
Fixes https://github.com/mono/mono/issues/10848
Fixes https://github.com/mono/mono/issues/15080

Unrelated  System.Reflection.MetadataLoadContext.Tests tests that don't fail anymore:
Close https://github.com/mono/mono/issues/15351
Close https://github.com/mono/mono/issues/15348
Close https://github.com/mono/mono/issues/15347
Close https://github.com/mono/mono/issues/15346
Close https://github.com/mono/mono/issues/15345
Close https://github.com/mono/mono/issues/15343
Close https://github.com/mono/mono/issues/15342
Close https://github.com/mono/mono/issues/15341
Close https://github.com/mono/mono/issues/15338
Close https://github.com/mono/mono/issues/15337
Close https://github.com/mono/mono/issues/15336
2019-07-11 21:41:11 +02:00
Zebediah Figura 2f1b50bfbf [metadata] Respect unmanaged calling conventions in function signatures. (#15363)
According to ECMA-335 § II.15.3, calling conventions other than "default" and
"vararg" describe unmanaged methods. Accordingly they should be treated as
pinvokes so that that their calling conventions are respected.
2019-07-11 14:38:03 -04:00
Micah N Gorrell 1002a4de2b [Mono.Security] Allow importing certificates from authenticode assemblies (#14210)
This change allows a number of games, such as DARK, to start successfully. The games use X509Certificate.CreateFromSignedFile() to load the certificate from their assemblies in order to verify them.

* Added support for creating an AuthenticodeDeformatter for an assembly
that has been loaded into memory

* Allow importing a certificate from an assembly signed with authenticode
when using BTLS

* Allow importing a certificate from an assembly signed with authenticode
when not using BTLS

* Added a test for loading certificates from assemblies signed with
authenticode
2019-07-11 19:09:33 +02:00
Calvin Buckley 41469ee55a Misc AIX/PASE tweaks (#15651)
* Partial enablement of alternate stack for AIX/i

It turns out much like macOS, AIX doesn't like to do mprotect/valloc
for the first thread's guard pages, so skip those. It seems mostly
fine except for one or two crashes causes it to grab the wrong IAR
and deadlock dumping memory. As such, leave the code and configure
script override to disable in place, just change the comment and
add support code.

* Use Qp2getifaddrs on PASE

Not sure if proper way to implement. Reuses getifaddrs code as much
as possible, since it's merely a name change based on the docs, due
to it being namespaced in case AIX gets it or something.

I'm not sure how many of these codepaths still work properly;
one had a questionable order of ifdef.

This will eventually prepare for CoreFX NetworkInterface, so test
it here.
2019-07-11 12:42:47 -04:00
Alexander Köplinger 37f5ef91bb Bump bockbuild to fix gtk build break 2019-07-11 17:29:33 +02:00
Alexander Köplinger 439ab4fb4c Bump bockbuild to get https://github.com/mono/bockbuild/pull/105 2019-07-11 16:08:01 +02:00
Jay Krell 2950bd39e1 Remove configure cruft -- Interlocked and GetProcessId. (#15633)
They are never checked and all relevant systems have all of them.
2019-07-11 13:39:11 +02:00
Jay Krell 7bdff9065b Cleanup mono_threads_platform_get_stack_bounds. (#15632)
Fix mingw warning unused function __readfsdword.
2019-07-11 13:35:57 +02:00
Steve Pfister 625be3d1fd Bump mono/corefx@17dd540 (#15654) 2019-07-11 13:30:01 +02:00
Steve Pfister 53a0a9eaf4 Add TypeForwards for FileSystemName & CryptographicOperations (#15652)
* 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-10 23:58:59 +02:00
Thays Grazia 4917c086b6 [debugger] Add intrinsic for creating a byte array (#15591)
Fixes #15268
2019-07-10 23:29:13 +02:00
Vlad Brezae 2f2a9bcc37 [interp] Add JitHelper intrins for enum comparison (#15635)
Fixes https://github.com/mono/mono/issues/15596
2019-07-10 20:42:50 +03:00
Ryan Lucia 370e76dfc8 [netcore] Don't default to mscorlib in Assembly.GetType (#15488)
* [netcore] Don't default to mscorlib in Assembly.GetType

* Add argument for whether or not to search mscorlib

* Reorder and rename search_mscorlib argument

* Use gboolean exclusively
2019-07-10 09:21:56 -07:00
Jay Krell 7a486d8f43 Remove quadratic behavior from g_strconcat. (#15630)
Prefer strlen + memcpy over strcat.
2019-07-10 12:06:51 -04:00
Jay Krell 58fc782d86 Fix warning: unused function get_address_from_sockaddr (#15631) 2019-07-10 10:36:46 +02:00
Jay Krell 77c269721e Provide g_strnlen to replace strnlen for portability to older systems. (#15626)
See https://github.com/mistydemeo/tigerbrew/issues/605.
See https://www.gnu.org/software/gnulib/manual/html_node/strnlen.html.
2019-07-09 23:43:12 -04:00
Kenneth Pouncey 8b8fd0a820 Create package of the templates
- Create a `Mono.WebAssembly.Templates.cproj`
- Moved the existing DotNet template to a new subfolder Templates\templates
- Add `dotnet pack` of the project to the Makefile.
2019-07-09 20:36:48 -05:00
Zoltan Varga 5fb57b4fbd [wasm] Bump emscripten to 1.38.38. (#15639) 2019-07-09 20:51:54 -04:00
Zoltan Varga cba874139d [interp] Avoid declaring MonoError's in interp_exec_method_full (), it increases the native stack frame size because the optimizer can't seem to figure out live ranges. (#15613)
* [interp] Avoid declaring MonoError's in interp_exec_method_full (), it increases the native stack frame size because the optimizer can't seem to figure out live ranges.

* Remove some unused fields from InterpFrame.
2019-07-09 15:16:46 -04:00
Thays Grazia d33747a6e3 [debugger] Update client thread frames after SetIP. (#15449)
* Fixes #13408

PR of draft https://github.com/mono/mono/pull/14667

* Disabling test on Interpreter.
2019-07-09 16:07:46 -03:00
Kenneth Pouncey a6983e4a37 Add threads option
```

  --threads (enable threads)
        type: bool  default: false

```
2019-07-09 13:26:24 -05:00
Kenneth Pouncey 742c98c5b4 Update 2019-07-09 13:26:24 -05:00
Kenneth Pouncey 46025dab20 Change formatting 2019-07-09 13:26:24 -05:00
Kenneth Pouncey 607027b544 Update docs
- Include threading
2019-07-09 13:26:24 -05:00
Martin Baulig cf609799f0 [System]: Allow reading fully buffered HttpWebResponse body… (#15220)
[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.
2019-07-09 19:26:42 +02:00
Zoltan Varga 2cefbc18df [jit] Add support for valuetype arguments to gsharedvt constrained calls. (#15610) 2019-07-09 11:40:06 -04:00
dotnet-maestro[bot] 6f24998e8b [master] Update dependencies from dotnet/corefx (#15608)
* Update dependencies from https://github.com/dotnet/corefx build 20190707.5

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19357.5

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/corefx build 20190703.6

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19353.6

* Update dependencies from https://github.com/dotnet/arcade build 20190703.19

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19353.19
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19353.19

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08
2019-07-09 14:12:26 +02:00
Egor Bogatov 9dc20c9b5f [netcore] Fix netcore CI lane (#15627) 2019-07-09 13:29:19 +02:00
Alexander Köplinger b2ba8e62ca 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
2019-07-09 11:45:00 +02:00
Zoltan Varga aeacedfd38 Remove support for llvm36, its not used anymore. (#15619)
* Remove support for llvm36, its not used anymore.

* [jit] Remove support for older llvm versions.
2019-07-09 11:44:17 +02:00
Jay Krell 5a0bc3cf81 [profiler] Fix printf bug -- char* vs. MonoString* (#15602)
Gcc warned.
2019-07-09 11:24:39 +02:00
Jay Krell 369f796d8d [jit] [x86] [amd64] Cleanup with x86_byte() (#15600) 2019-07-09 11:12:52 +02:00
Jay Krell 39b52e2da8 Access mini_debug_options directly within the runtime. (#15594)
We had some inconsistency around accessing mini_debug_options in the runtime (both directly as well as through the function, mini_get_debug_options). This PR makes the access consistent through the runtime.
2019-07-09 11:12:15 +02:00
Alexander Köplinger 9cec2b0da3 [ci] Remove check-seq-points step from CI runs
The test was disabled with https://github.com/mono/mono/pull/15623
2019-07-09 11:11:04 +02:00
Jay Krell 135eaa1758 Disable check-seq-points test. (#15623)
See https://github.com/mono/mono/pull/15599#issuecomment-509444313.
See https://github.com/mono/mono/pull/15567.

Alternative to https://github.com/mono/mono/pull/15599 and part https://github.com/mono/mono/pull/15567.
2019-07-09 11:09:29 +02:00
Jan Kotas 9335f2637e Cleanup IL linker heuristic usage (dotnet/coreclr#25547)
Prep-work for using mainstream IL linker

Signed-off-by: dotnet-bot <[email protected]>
2019-07-09 08:39:16 +03:00
Alexis Christoforides c6bf6370dd The regression is the accidental removal of RegisterReportingForNativeLib from the managed side, introduced by b919ac4#diff-939ea9baecd2e8b24260bcb33f531274 2019-07-09 01:34:44 +03:00
Jay Krell e4bc8790d3 runtime.h remove extern "C" and distribute normally instead of extra. (#15558) 2019-07-08 13:59:05 -04:00
Johan Lorensson 12c962835f Align native_handle open/close for MonoThreadInfo/MonoInternalThread on Windows. (#15482)
* Align native_handle open/close for MonoThreadInfo/MonoInternalThread on Windows.

* Drop assert on DuplicateHandle failure.

* Fix native thread handle gpointer conversion.
2019-07-08 13:50:17 -04:00
Alexander Köplinger 784449a077 [sdks] Fix android sdks job, take 2
It needs to work for both debug and release configs.
2019-07-08 19:34:32 +02:00
Jay Krell 63126b72f7 Remove some unused third party code. (#15475)
i.e. C++ helpers for Boehm GC.
2019-07-08 19:30:14 +02:00
Alexander Köplinger 305b2e76e6 [sdks] Fix android sdks job
It would try to execute the .stamp-android-loader-path target in unrelated configurations.
2019-07-08 18:04:23 +02:00
Thays Grazia ebebfe263b 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. (#15552)
Using ilasm from coreclr and running on mono it works, because of that I decided to fix on ilasm and not on runtime.

Fixes #13923
2019-07-08 10:22:19 -03:00
Zoltan Varga cb330378cf [runtime] Implement mono_verifier_class_is_valid_generic_instantiation () etc. even if the verifier is disabled. (#15564)
Fixes https://github.com/mono/mono/issues/15551.
2019-07-08 10:36:49 +02:00
Jay Krell f19bc96343 mono_native_tls_get_value that does not change LastError. (#15568) 2019-07-08 09:44:23 +02:00
Jay Krell 963ba77863 Inline GetLastError and SetLastError. (#15560) 2019-07-08 09:42:54 +02:00
Egor Bogatov 55cc1d6d8f [netcore] Throw ICE for Array.Copy(object[], enum[]) (#15585)
* test

* undo rsp changes

* Fix ICollection_NonGeneric_CopyTo_ArrayOfEnumType

* group all "requires precise gc" issues

* Add more gc precise tests (and a flaky one)
2019-07-07 09:11:03 -04:00
Ryan Lucia 851dfdb98a Convert dl-test-assets.py to Python 3 (#15524) 2019-07-06 17:34:30 -04:00
Jay Krell d540aee31f Cleanup zlib-helper.c allocations -- move integer overflow checks into calloc. (#15505) 2019-07-06 14:59:27 -04:00
Zoltan Varga de5dca2264 [jit] Add missing float conv.u8.ovf.un conversion. (#13907)
* [jit] Add missing float conv.u8.ovf.un conversion.

* Add support for the float64 bit version as well.

* Fix interpreter support.
2019-07-06 05:47:47 -04:00
Jay Krell 1cb8e04331 Distribute sgen-dynarray.h via source, not EXTRA_DIST. (#15559) 2019-07-05 18:05:13 +02:00
Jay Krell 2b7e2d2f34 Remove extra explicit dist. (#15557)
Automake sees through the conditionals.
2019-07-05 18:04:22 +02:00
Radek Doulik 0991905c8b [sdks] Use @loader_path for mono and libmonosgen (#15580)
* [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:38:19 +02:00
Bernhard Urban 5a5cbcc0a7 [sdks] sanity check for maximum number of open file descriptors (#15582)
Default for `ulimit -n ` seems to be 256, that isn't enough for the Android SDK build.
2019-07-05 17:19:08 +02:00
Alexander Köplinger 3ffe317138 [netcore] Only do CI builds on master
We don't care about the 2019-xx branches yet.
2019-07-05 17:15:12 +02:00
Alexander Köplinger bc269dc39e [netcore] Read NETCORETESTS_VERSION and NETCOREAPP_VERSION fro… (#15584)
* [netcore] Simplify CI build invocation

We now have build.sh as a one-stop entry to the build system.

* [netcore] Read NETCORETESTS_VERSION and NETCOREAPP_VERSION from eng/Versions.props

The Versions.props is auto-updated by Arcade so we automatically get new versions.
2019-07-05 17:03:49 +02:00
dotnet-maestro[bot] 3b3829e33c [master] Update dependencies from dotnet/arcade (#15550)
* Update dependencies from https://github.com/dotnet/arcade build 20190703.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19353.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19353.1

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/corefx build 20190703.3

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19353.3

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08
2019-07-05 17:03:09 +02:00
Egor Bogatov 3a7afab91c [netcore] CI work, add rsp for Windows (#15549) 2019-07-05 17:02:44 +02:00
Jay Krell e7f9dbe73c Link with -z now or -bind_at_load. (#14562)
Advantages:
 Dynamic linker gets out of the way of random function calls,
 in terms of timing, in terms of locking, and in term of success,
 and possibly in terms of security (readonly function pointers).
 If you successfully load, then you can make function calls with impunity,
 without regard as to if they are in the same .so as the caller, well,
 assuming they are to a leaf like libc, or to something itself built with -z now.

 The "success" is significant, as otherwise loaded LLVM has unresolved symbols lurking, depending on which code paths you send it down.

Disadvantage: Slower startup.

Mixed:
 Platform consistency, since this is how Windows behaves usually (unless you say link /delayload)

This will combine well with an upcoming revision of https://github.com/mono/mono/pull/14524.

Difficult alternative: Force the binding along sensitive paths by calling their callees earlier.
Typical alternative: Ignore the matter.

Android: It is believed this switch produces a warning, which is ignored, there is no affect, and it is unclear if the behavior is actually "now" or "lazy". Logs could be checked and a test run, but neither.
2019-07-05 15:54:16 +02:00
Jay Krell 4cf527f6d9 Readonly codemanager callbacks. (#15538) 2019-07-05 15:46:10 +02:00
Jay Krell 28ec3644ef Make thread locals just always extern. (#15563)
Making them static for C is not worth the ifdef.
2019-07-05 15:38:15 +02:00
Jay Krell b84b85688b Win32 zlib support. (#15509)
Fixes https://github.com/mono/mono/issues/15503

Always statically link on Windows (msvc and mingw).
This is a somewhat old zlib, and will be updated shortly (https://github.com/mono/mono/pull/15480)

Note that zlib is not valid C++, so always compile as C.
2019-07-05 14:38:56 +02:00
Steve Pfister 063985e04d Bump mono/corefx@9354dfd (#15545) 2019-07-05 14:35:14 +02:00
Bernhard Urban 808592925b [android] switch cross compilers host from 32bit to 64bit (#15553)
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
2019-07-05 13:58:38 +02:00
Johan Lorensson b1b61d7cb7 Interpreter reads last error to late after pinvoke. (#15571)
* Interpreter reads last error to late after pinvoke.

This could lead to clobbered last error since interpreter loop needs to
run two additional IL instructions in order to read out the value. This works
on JIT since the lowering saving the last error will happen right after
pinvoke.

This fix makes sure interpreter will get needed information to read out
last error right after pinvoke (if requested).

It adds a new IL prefix issued in managed->native wrapper that will tell
codegen (and interpreter) that upcoming calli instruction needs to save
last error, meaning that it could be done right after issuing the call,
no need to run any additional IL instructions to do that work, closing
the gap between the return of pinvoke call and save of last error.

Should fix, https://github.com/mono/mono/issues/15541.

* Optimize emit_get_last_error.
2019-07-05 10:30:17 +02:00
Kenneth Pouncey a90b735cf8 Update ,gitignore (#15561)
- emsdk_env.sh
- builds/threads
2019-07-05 07:29:52 +02:00
Kenneth Pouncey d8f2ebe384 Add a package.json to the tests/runtime directory. (#15573)
- Installs the required packages to run
- Modify make target `run-threads-sample` to use npm to install and run the test.
- There are two targets in the package.json file one for `test` and another 'start`
2019-07-05 05:43:50 +02:00
Larry Ewing 6530ba9861 [wasm] Add BlazingPizza.Client to size tesets 2019-07-04 19:48:34 -05:00
Jan Kotas a288cb1aae Delete some dead code (dotnet/coreclr#25546)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-04 19:18:35 +03:00
Jay Krell 5637cbd42d Do not compile metadata support/compress.c. (#15535) 2019-07-04 16:05:17 +02:00
Maxim Lipnin e0da61d691 [netcore] Make System.Reflection.Tests.TypeTests.GetEnumUnderlyingType Pass (#15510)
* [netcore] Make System.Reflection.Tests.TypeTests.GetEnumUnderlyingType Pass

* Remove recursive name parsing in case of "+" character; remove if condition for nested names
2019-07-04 09:10:18 -04:00
Alexander Köplinger 16750e4fd9 [netcore] Trigger Azure Pipelines builds only for master and release branches
Also batch changes so the system waits until a build is completed,
then queues another build of all changes that have not yet been built.
2019-07-04 09:16:56 +02:00
Larry Ewing 03d5525757 [wasm] allow overriding the build command invocation 2019-07-03 23:37:58 -05:00
Kenneth Pouncey 1a08a840c2 Fix the directory paths after threads commit
- Add threads build directories to the Runtime package.
2019-07-03 17:24:52 -05:00
Jay Krell 167709be8c Make sure TLS (thread local storage) is always TLS and not FLS (fiber local storage).
The Windows SDKs are inconsistent (and clearly documented as so), and the JIT assumes TLS.
2019-07-03 15:45:47 -05:00
Thays Grazia fb49d2d631 [debugger][wasm] Display content of "this" (#15528)
* Implementing watch of variable "this"
Fixes #15446

* Fixing indentation.
2019-07-03 12:15:18 -03:00
Vlad Brezae 6136d51ae9 [interp] Simplify MINT_NEWOBJ_ARRAY 2019-07-03 09:08:20 -05:00
Vlad Brezae aa7b713715 [interp] Make newarr lockfree
Before this commit, we were creating the array class from the element class during run time, also taking a lock in the meantime. This makes array allocation 2x faster. (on multithread much faster)
2019-07-03 09:08:20 -05:00
Johan Lorensson e30184752b Abort async suspend request on failure doing preemptive suspend. (#15486)
When a preemptive suspend fails, state machine will get into an invalid
state and the thread is in an unknown state (running/self-suspended). In case of
failure in mono_threads_suspend_begin_async_suspend, a new method should be
called, mono_threads_transition_abort_async_suspend making sure state machine
reflects correct thread state as well as reporting correct result to initial
caller of mono_threads_suspend_begin_async_suspend.
2019-07-03 13:08:05 +02:00
Jay Krell 08feb423c1 HAVE_DL_LOADER is never used so remove it. (#15500) 2019-07-03 11:01:59 +02:00
Jay Krell 33b4d2695e AC_DEFINE instead of AC_SUBST MONO_DL_NEED_USCORE. (#15499)
i.e. so it can be used in C instead of make.
i.e. so it can actually work.

The lone use is here:
```
C:\s\mono2\mono\utils\mono-dl.c(271):#if MONO_DL_NEED_USCORE
```
2019-07-03 11:01:19 +02:00
Jay Krell 177ae36c7a Do not compile unused support/uncompr.c. (#15516) 2019-07-03 10:59:38 +02:00
Egor Bogatov 57f362207c [netcore] Clean up CoreFX.issues.rsp (#15526) 2019-07-03 10:58:50 +02:00
Zoltan Varga c533ad99ce [wasm] Ongoing work. (#15504)
* [wasm] Avoid AOTing mscorlib if the input file haven't changed.

* [wasm] Store the wasm builds in a builds/ subdir.

* [wasm] Add a run-chrome- target to run test suites under chrome using a puppeteer script.

* [wasm] Link with -O0 in debug mode.

* [wasm] Add a runtime-threads make target.

* [wasm] Compile driver.o etc. with -Oz. Make the build-native -> packager.exe dependency order only.

* [wasm] Run the threads sample using chrome.

* Bump emscripten to 1.38.37.

* Fix the build.

* Fix the tests.

* Fix the tests.
2019-07-03 08:48:51 +02:00
Rich Lander 8fe4109ead Add entry for GCC (#15473) 2019-07-02 17:57:38 +02:00
Michal Strehovský 29e1d630b4 Use Array.MaxArrayLength in ArrayList (dotnet/coreclr#25530)
Now that `ArrayList` is in CoreLib, we don't need the copy.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-02 17:26:31 +02:00
Jay Krell 4b074e842b Correct MONO_DL_NEED_USCORE for C++, and memcpy is faster than strcpy. (#15498) 2019-07-02 11:09:32 -04:00
Alexander Köplinger e843b52098 [netcore] Add DARC subscriptions for Microsoft.NETCore.App 2019-07-02 15:11:32 +02:00
Johan Lorensson 5fee1d3eea Add support for TLS callbacks on Windows. (#15423)
* Add support for TLS callbacks on Windows.

Mono runtime depends on DllMain to be called by OS in order to correctly
detach threads from the runtime. If this doesn't happen,
threads from native thread pools (not owned by runtime) and attached
using native->managed callback, won't detach resulting in attached
threads no longer running. Since threads are still attached
to runtime, next GC will try to suspend the thread and that will fail
and that in turn will put the state machine in an incorrect state,
bringing down the runtime at next GC (when the thread state is revisited).

This problem is currently handled by DllMain, but since DllMain only exist
in DLL's, statically link Mono runtime will get us into the above scenario.

This commit add support to hook up a TLS callback using the same mechanism
used by MSVC linker and c-runtime (also available under MINGW). The
callback will be included in a section/segment of an object file and included
in final image (DLL or EXE) by linker and called by OS loader, solving the
problem with static linked Mono runtime not being able to detach terminating
threads.

The commit keeps current DllMain method when building a DLL but
includes a mechanism making sure we only use one of the callback techniques
at runtime, if both have been included in final image. This will simplify the build
of libmini since we can always build the object including the callback, regardless
how the library will be consumed.
2019-07-02 14:06:57 +02:00
Alexander Köplinger b62878973d [netcore] Add DARC subscriptions for Microsoft.Private.CoreFx.NETCoreApp
It contains the corefx test assets.
2019-07-02 13:56:09 +02:00
Bernhard Urban 6f7da4ce49 [stats] distinguish between mini and LLVM AOT method (#15483)
[stats] distinguish between mini and LLVM AOT method

Also print the stats on shutdown when configured with `--with-core=only`
2019-07-02 04:55:50 -04:00
Zoltan Varga adbb7df7ce [netcore] Remove some unused SRE icalls. (#15484) 2019-07-02 04:27:48 -04:00
Jay Krell d956cf687c Fix const warning. (#15478) 2019-07-02 09:08:05 +02:00
Jay Krell caecad895a Make codeman not public (#15415)
Seems a bit obscure to be public, the header is not public.
2019-07-02 09:07:18 +02:00
Zoltan Varga 4473e761c5 Fix make package. 2019-07-01 22:15:21 -05:00
Zoltan Varga 5767de0213 Fix some targets. 2019-07-01 22:15:21 -05:00
Zoltan Varga 708d1948e4 Make a local copy of emsdk_env.sh for the interpreter builds. 2019-07-01 22:15:21 -05:00
Zoltan Varga 6304c094db Make a local copy of emsdk_env.sh during the ninja build. 2019-07-01 22:15:21 -05:00
Zoltan Varga e84e9e786d Avoid calling emsdk_env.sh, it calls emsdk update_env which is racy. 2019-07-01 22:15:21 -05:00
Zoltan VargaandLarry Ewing aacd83ad39 Fix formatting.
Co-Authored-By: Larry Ewing <[email protected]>
2019-07-01 22:15:21 -05:00
Zoltan VargaandLarry Ewing f01cb9c9d2 Fix formatting
Co-Authored-By: Larry Ewing <[email protected]>
2019-07-01 22:15:21 -05:00
Zoltan Varga beea086ec9 Enable threads builds on CI. 2019-07-01 22:15:21 -05:00
Zoltan Varga 3970c6112a Add back some stubs for the non-threads build. 2019-07-01 22:15:21 -05:00
Zoltan Varga 648bef053e Set Module.mainScriptUrlOrBlob so workers can load it. 2019-07-01 22:15:21 -05:00
Zoltan Varga 16ed192da3 Add missing file. 2019-07-01 22:15:21 -05:00
Zoltan Varga b40a624898 [wasm] Add threads support to the packager. 2019-07-01 22:15:21 -05:00
Zoltan Varga 7c3adaf873 [wasm] Implement pthreads support in the runtime. 2019-07-01 22:15:21 -05:00
Zoltan Varga e21bed53a0 [wasm] Allow overwriting EMSCRIPTEN_SDK_DIR. Add a runtime build with threads support if ENABLE_WASM_THREADS is defined in Make.config. 2019-07-01 22:15:21 -05:00
Zoltan Varga 7fa884b721 [wasm] Add a threads sample. 2019-07-01 22:15:21 -05:00
Zoltan Varga bc787a8a01 [runtime] Disable a a AC_TRY_RUN when cross-compiling. 2019-07-01 22:15:21 -05:00
Zoltan Varga 20a8edacb8 [wasm] Add a make define for wasm runtime builds. 2019-07-01 22:15:21 -05:00
Steve Pfister d39c84d45f [netcore] Remove IsByRef check on Reflection.Emit.DynamicMethod
Fixes https://github.com/mono/mono/issues/15324

Removed check on the return type being by ref.
2019-07-01 21:12:06 -04:00
Martin Baulig 3508cd8026 [System.Net.Http]: Delete broken Send_Transfer_Encoding_Custom() test. (#15470)
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:27:42 +02:00
Johan Lorensson 51a11b68c5 Disable zlib on mingw Windows build to avoid dependency on zlib (#15493)
#4484 broke Windows mingw build due to new dependency, zlib1.dll not available in PATH on build bots. Disabling for now until we know how this should be handled (and also fixed for MSVC build runtime).
2019-07-02 01:15:37 +02:00
Alexander Köplinger 1a1e921efe Bump bockbuild to bring in fix for mono/mono#14957 2019-07-02 00:30:58 +02:00
Marek Safar 71d1b10c3e [netcore] Bump Roslyn 2019-07-01 23:01:13 +02:00
Michal Strehovský 68872c4a60 Use AssemblyLoadContext from shared partition (dotnet/corert#7570)
We were missing methods that got added for 3.0. The only LoadContext that works is the default one though.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Stephen Toub d0d2096fc7 Fix ActivityTracker ES_BUILD_STANDALONE build
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Koundinya Veluri 306e8c3cd6 Fix an assertion failure in the thread pool's QueueUserWorkItemCallbackBase (#25482)
Fixes https://github.com/dotnet/coreclr/issues/25242
- The issue could be that there is no memory barrier (or in the wrong place) on the thread reading the value, and an old value could be cached and read

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Santiago Fernandez Madero 4dfd7437a7 React to new compiler nullability warnings
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Jan Kotas c88c0dd873 Fix typo & make the code leaner (dotnet/coreclr#25442)
Enum.HasFlag generates bigger IL and depends on complex JIT optimization for a good code.
The classic bit check is strongly preferred accross CoreCLR and CoreFX.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Stephen Toub 45e5bb8ec0 Tweak nullable attribute per API review (dotnet/coreclr#25443)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Levi Broderick 83a9ee16fb Fix EncoderNLS / DecoderNLS regression in reporting error index (#25397)
Also fixes incorrect asserts in the Encoding type

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Ben Adams aeb8b0fa8f Don't show AggressiveInlining items in exception stacks (#25408)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Tanner Gooding c754857c0e Reverting the ShouldRoundUp logic to not change for custom numeric format strings. (#25400)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Jan Kotas 674f8876cc Delete DeserializationBlockedException (dotnet/coreclr#25393)
Contributes to dotnet/corefx#36723

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Stephen Toub 1543276813 React to compiler respecting nullable attributes on properties
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Tarek Mahmoud Sayed 0890f588e9 Map C Locale to Invariant (dotnet/coreclr#25373)
ICU map the C locale to en-US_POSIX which has a non desired collation behavior as it doesn't support case insensitive comparison.
This change is to force mapping C locale to Invariant instead.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Jan Kotas cc779bd7e3 Fix StackChange value for OpCodes.Stelem (dotnet/coreclr#25382)
Fixes dotnet/corefx#37955

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Santiago Fernandez Madero 4da8b52e28 Address last round of nullable feedback - S.Resources.ResourceManager, System.Reflection.Emit and ILGeneration (#25318)
* Address nullable feedback for System.Resources.ResourceManager

* Address nullable feedback for System.Reflection.Emit.ILGeneration

* Address nullable feedback for System.Reflection.Emit

* PR Feedback and clean-up redundant casts

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Tanner Gooding c471996c8b Updating Dragon4 to ensure the number buffer always provides a significant digit if one exists. (#25096)
* Updating Dragon4 to ensure the number buffer always provides a significant digit if one exists.

* Changing System.Number.RoundNumber to not round up floating-point numbers.

* Re-enabling the RealFormatterTestsBase CoreFX tests

* Updating Number.RoundNumber to take a isCorrectlyRounded parameter and to use IEEE compliant rounding for floating-point numbers.

* Change SinglePrecisionCustomFormat to 7, ensuring it matches the value used in netcoreapp2.1

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Ganbarukamo41 52814eb6bb Make Vector*.ToString() Culture invariant (dotnet/coreclr#25343)
* Remove IFormattable
* Hardcode characters
* Add tests

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Egor Bogatov d20fe8ec37 [netcore] Fix Array.Copy* tests. Bump NETCORETESTS_VERSION ver… (#15428)
* Fix Array.Copy* tests

* simplify code

* Add comments

* Address feedback

* Update CoreFX.issues.rsp

* Fix SRE tests

* Add comment

* bump versions again
2019-07-01 20:20:25 +02:00
Maxim Lipnin 15668a6292 Bump corefx (#15463)
This PR will bring mono/corefx#303
2019-07-01 19:01:23 +02:00
Miguel de Icaza de18c594f0 [metadata] Rename, null-initialize, and properly free *args variables (#13855) 2019-07-01 12:11:02 -04:00
Rich Lander 241d2d1809 Create THIRD-PARTY-NOTICES.TXT
Use: https://github.com/mono/mono/blob/6a9950c5d22a1d748a2163ce6bdbc7fa6ffd8e77/mcs/tools/sqlmetal/src/DbLinq/Test/Providers/ReadTest_Complex.cs#L571
2019-07-01 17:16:51 +02:00
dotnet-maestro[bot] 36b0c02463 [master] Update dependencies from dotnet/arcade (#15477)
* Update dependencies from https://github.com/dotnet/arcade build 20190630.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19330.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19330.1
2019-07-01 17:10:47 +02:00
Michal Strehovský 75dfa5c298 Remove AggressiveOptimization flag from System.Text (dotnet/coreclr#25356)
Based on conversation with Levi, I don't think this flag is needed.

The flag currently controls two things:
* Disqualifies the method from precompilation
* Disables Tier-0 JIT for the method

Removing the attribute allows us to precompile some of the methods (not all, because of `Vector<T>`). It measurably helps improve startup time because many of the attributed methods are complex and take a while to compile.

Once tier-1 JIT kicks in, the generated code should be identical to what we were getting before.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 17:07:00 +02:00
Jay Krell 8c20d5c67a Remove unused AMD64 JIT CALLCONV_IS_STDCALL. (#15416) 2019-07-01 09:53:01 +02:00
Larry Ewing df74f5227f [wasm][debugger] remove args parsing hack 2019-06-30 12:25:40 -05:00
Larry Ewing 3b337e31c3 [wasm] use the router for all requests 2019-06-30 12:25:40 -05:00
Larry Ewing 18b031870e [wasm] remove TabMapper and just filter values key by key
proxy the version response through our logic so that we match
the actual protocol versions. Refactor the mapping logic so we
just rewrite specific keys that we understand and pass the rest
along.
2019-06-30 12:25:40 -05:00
Larry Ewing f293fd7174 [wasm] make the host url a uri 2019-06-30 12:25:40 -05:00
Larry Ewing 9455030364 [wasm] use options directly in other places 2019-06-30 12:25:40 -05:00
Larry Ewing 0065b50c93 [wasm] Start reworking the server logic for the Proxy and Debugger
Split some of the configuration logic out into options so that
we can start moving away from a fixed configuration.
2019-06-30 12:25:40 -05:00
Larry Ewing d7cfc6994a [wasm] make extract_conn_url return null on unexpected data
We want to avoid throwing inside ErrorDataReceived on unexpected
input because tends to hang the process in a bad state.  Instead
we return null from extract_conn_url and let the normal cleanup
process happen.
2019-06-30 12:25:10 -05:00
Rich Lander 40ebd4e815 Add entry for Silicon Graphics and HP
For https://github.com/mono/mono/blob/d58dfa185af1d48fb93efdef1d046762f214f0a7/libgc/include/gc_allocator.h
2019-06-29 20:54:42 +02:00
lateralusX be77d03c22 Fix 32-bit build error when using C++ compiler. 2019-06-29 13:48:34 -05:00
Katelyn Gadd c239906a01 Disable compiler server on darwin. Add force-enable option for compiler server. (#15450) 2019-06-28 18:24:09 -04:00
Filip Navara c788634b54 Add tests 2019-06-28 14:56:47 -05:00
Filip Navara cbe365b659 Fix marshalling bugs for StringBuilder parameters 2019-06-28 14:56:47 -05:00
Jo Shields 4421ebc1f2 Correct env vars used for Android directory override (#15469)
This fixes https://github.com/mono/mono/pull/15453

The issue is the env var names differ vs. Xamarin.Android
2019-06-28 15:29:37 -04:00
Jo Shields 714da9f5be Use /mnt/scratch for Android SDK, to match https://github.com/… (#15453) 2019-06-28 19:20:41 +02:00
Maxim Lipnin efa0a0bb3a Fix time zone transition out of DST (#15401)
When a datetime appears in range of [end_of_DST_period - Daylight_delta; end_of_DST_period] it's not DST and should return base offset.

Fixes #9664.
2019-06-28 19:04:21 +02:00
Kenneth Pouncey dfb9cdd072 Fix generation of wrong version. 2019-06-28 10:55:35 -05:00
Ryan Lucia c879bc4691 [netcore] Fix Assembly.GetForwardedTypes() (#15452)
* [netcore] Make GetForwardedTypes return nested types

* [netcore] Throw proper error in GetTopLevelForwardedTypes

* Remove unnecessary function

* Formatting

* Re-enable relevant tests

* Switch to REFERENCE_MISSING

* Use local error
2019-06-28 11:54:27 -04:00
dotnet-maestro 9bf0809439 Update dependencies from https://github.com/dotnet/arcade build 20190627.39
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19327.39
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19327.39
2019-06-28 17:27:39 +02:00
dotnet-maestro 5da074c43d Update dependencies from https://github.com/dotnet/arcade build 20190626.44
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19326.44
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19326.44
2019-06-28 17:27:39 +02:00
Zoltan Varga 112297ef5c [runtime] Implement support for embedded ppdb, when the ppdb blob is compressed and embedded into the pe image. 2019-06-28 15:19:43 +02:00
Jay Krell 19681ad2d4 Fix year+ old MIPS compile break. (#15459)
Fixes https://github.com/mono/mono/issues/15441
2019-06-28 11:28:05 +02:00
Alexander Köplinger 4e022f7f07 Replace two more MONO_DEBUG=clr-memory-model env vars with commandline switches
Follow up to https://github.com/mono/mono/pull/15447
2019-06-28 10:19:16 +02:00
Kenneth Pouncey 6b5113220c Simplify the file generation and remove the Encoding="Unicode" option 2019-06-28 01:01:58 -05:00
Kenneth Pouncey c692828f49 Add a target to set the version of the Templates's sdk version in the global.json.
- The `_WriteDotNetTemplateVersion` is called from the sdk build.

```
"Mono.WebAssembly.Sdk": "0.1.0-preview1"
```
2019-06-28 01:01:58 -05:00
Kenneth Pouncey 4c1cf2c148 Trying BeforeTargets="_GenerateRestoreProjectSpec" 2019-06-28 01:01:58 -05:00
Kenneth Pouncey 7e2433d9f4 Modify _CreatePackagesDir
- Another try
2019-06-28 01:01:58 -05:00
Kenneth Pouncey 1a2f43d4cb Address review comments separate versions for each sdk package
- Update to use only the SDK package version.
2019-06-28 01:01:58 -05:00
Kenneth Pouncey 6e6580beba Rename target to prefix it with an underscore to indicate that users should not call it directly. 2019-06-28 01:01:58 -05:00
Kenneth Pouncey 99e64a970f Add target to create packages directory if it does not exist. 2019-06-28 01:01:58 -05:00
Kenneth Pouncey 5ca42e24fb Remove the WebAssembly.Net.Http.xml file that was inadvertently commited 2019-06-28 01:01:58 -05:00
Kenneth Pouncey c9db6a08f1 Add versioning to the sdk and framework project files.
- Add a central versioning file `common\Versions`
- Modify projects to use the central version file
- Auto generate a versions file for the SDK versions so that they can be updated automatically.
2019-06-28 01:01:58 -05:00
Zoltan Varga a29cbc429d [netcore] Avoid calling mono_runtime_install_appctx_properties () in aot mode. (#15448) 2019-06-27 23:16:47 -04:00
Thays Grazia c011456f3f [dim] Emit error when calling abstract methods (#15433)
* Emitting bad image exception when a non virtual call is calling an abstract method.

* Fixing side-effect.
Implementing the same thing on interpreter.
Adding unit test.
2019-06-27 22:02:39 -03:00
Zoltan Varga 064d367ede Pass the --clr-memory-model flag on the command line instead of MONO_DEBUG so its not inherited by child processes. (#15447) 2019-06-27 20:44:39 -04:00
lateralusX c5ef80bf86 FIx id formatting to align with rest of code. 2019-06-27 14:59:59 -05:00
lateralusX 56d38ca430 Fix incorrect thread state on suspend thread failure.
According to documentation of mono_threads_suspend_begin_async_suspend:

"If begin suspend fails the thread must be left uninterrupted and resumed."

Current implementation on Windows didn't resume thread in case GetThreadContext
fails, leaving a thread in suspended state on failure.

Fix is to resume thread if GetThreadContext fails.
2019-06-27 14:59:59 -05:00
lateralusX 973f430d45 Fix use THREAD_SUSPEND_DEBUG macros on Windows.
Several errors in current implementation, both compile time errors as
well as warnings.
2019-06-27 14:59:59 -05:00
dotnet-maestro 6ae04f597d Update dependencies from https://github.com/dotnet/arcade build 20190626.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19326.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19326.2
2019-06-27 14:21:36 +02:00
Steve Pfister 814d20db91 [netcore] Review and document netcore test failures that are skipped (#15359)
* Went through the majority of corefx tests that were being skipped in CoreFX.issues.rsp.

For each failure, a github issue was logged and if possible, a more expanded
failure reason was specified.

Part of the https://github.com/mono/mono/issues/14787 epic work

* Cleaned up header that no longer had tests in it

* Pesky -method still around.  It'll ignore now
2019-06-27 14:14:02 +02:00
Ryan Lucia 8e4d1eb06f Disable flaky test HttpClientTest.CancelRequestViaProxy 2019-06-26 21:01:58 -05:00
Ryan Lucia 19bb89805a CreateNLSocket and CloseNLSocket should return gpointer (#15408)
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-26 15:41:11 -04:00
Steve Pfister 452fa3b50c Update CODEOWNERS (#15429) 2019-06-26 15:14:07 -04:00
Johan Lorensson b70694828d Fix unused-function warning in main.c. (#15424) 2019-06-26 19:16:11 +02:00
Aleksey Kliger (λgeek) 927c608184 [sdks] dynamically link libmonosgen to mono-sgen for monodroid host builds (#15410)
* [configure] Cosmetic AC_MSG_WARN fix

* [runtime] Mark mono_file_map_error as MONO_API, always

Fixed the `--with-static_mono=no` build on non-Win32

* [sdks] dynamically link libmonosgen to mono-sgen for monodroid host builds
2019-06-26 11:10:03 -04:00
Jay Krell cad60fce03 Remove mono_tls_get_tls_getter. 2019-06-26 07:14:30 -05:00
Jay Krell 8d6feabf0d Replace MONO_PATCH_INFO_GET_TLS_TRAMP with MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL. 2019-06-26 07:14:30 -05:00
Vlad Brezae 6359520633 [sgen] Fix crashes in sgen due to xdomain refs
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-26 07:13:07 -05:00
Martin Baulig c56b37e00d [test-helpers]: Don't use named Mutexes on mobile. 2019-06-26 07:11:08 -05:00
Vlad Brezae aa05d4f43c [interp] Reduce computation under calc_section mutex
Calc_section mutex is meant to be a lower level mutex used only for synchronization on InterpMethod contents. Before this commit we were taking the loader mutex which was leading to deadlocks.
2019-06-26 07:10:37 -05:00
Larry Ewing f185358d96 [wasm] update the debugger instructions 2019-06-26 07:10:00 -05:00
dotnet-maestro d99c1e631b Update dependencies from https://github.com/dotnet/arcade build 20190624.24
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19324.24
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19324.24
2019-06-26 11:57:51 +02:00
Egor Bogatov 78b9c66501 Add xunit-summary.py (#15373) 2019-06-26 11:49:24 +02:00
Alexander Köplinger 6307f0156c [profiler] Add helper.h to tarball 2019-06-26 10:41:38 +02:00
Ryan Lucia a2a28b94c1 [netcore] Fix build.sh (#15380)
* [netcore] Revert changes to build.sh

It appears to have accidentally been changed in #15215, and the script no longer works correctly as a result, so revert

* Strip call to make
2019-06-25 23:58:41 -04:00
Larry Ewing 73dd9ac01e [wasm] make packager.exe depend on release/ and debug/ because it may use either 2019-06-25 21:44:06 -05:00
Alexis Christoforides 43f504a43e Bump bockbuild for fix to https://github.com/mono/mono/issues/14957 2019-06-25 20:59:50 -05:00
Larry Ewing 191854ded8 Merge branch 'master' into fix-dynamic-method-marshal-info 2019-06-25 20:18:14 -05:00
Zoltan Varga dc321b06a2 [aot] Save the number of locals into the aot debug info so the method header doesn't have to be decoded when its loaded. 2019-06-25 20:03:35 -05:00
Kenneth Pouncey 4699ff275d Add signing of the framework assemblies to the projects using the Open key. (#15303) 2019-06-25 17:45:13 -05:00
Thays Grazia 2bdf49cae1 [debugger][wasm] Local vars (#15385)
* Fixing side effect of #15357.

* Fixing side effect of #15357.
2019-06-25 17:36:26 -05:00
Alexander Köplinger 41767754d5 [System] Fix monotouch_watch xunit tests build
Forgot to exclude one more file.
2019-06-25 22:21:26 +02:00
Jay Krell 1c09e4de62 Fix tarball build and refresh monolite due to memory model change (#15370)
* Revise monolite due to memory model change.

* Fix tarball builds wrt netcore/config.make.

* Remove System.Private.CoreLib from mcs/class/Makefile, it was moved to netcore/

* Bump min_mono_version in basic-profile-check

The new MONO_DEBUG=clr-memory-model runtime option isn't available in earlier Mono versions.
2019-06-25 22:14:41 +02:00
Jay Krell 3e270ffe20 [threads] Define interlocked_mutex as non-recursive and on 32bit platforms only (#15393) 2019-06-25 14:56:37 -04:00
Radek Doulik 3efc0959fe [profiler] Add helper.c to static sources where needed (#15400)
This should fix broken `OS X x64 iOS SDK` build.
2019-06-25 20:04:16 +02:00
Alexander Köplinger bc1d080ba9 Exclude a few tests on monotouch_watch/xammac (#15397)
* [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:01:17 +02:00
Zoltan Varga ba242226f4 [wasm] Bump emscripten to 1.38.36. 2019-06-25 11:43:12 -05:00
Johan Lorensson 5ca92bdbe8 Add cooperative suspend aware threads for hybrid suspend. (#15204)
* Add cooperative suspend aware threads for hybrid suspend.

When running in hybrid suspend and having threads in blocking mode, GC Safe
mode, threads will still be preemptive suspended. This is done to make sure
compatibility is kept with embedders since current embedding API is not coop
aware. If, however the external attached threads promise to follow the coop
rules for a thread in Safe mode, it could still be possible to have them
running, making sure they won't be preempted when running STW. Unlocking this
possibility could have large performance wins if embedding threads runs a lot
of native code on threads attached to runtime.

This commit adds support for a new pair of API's where an external thread can
mark itself as cooperative suspend aware. Doing that guarantees the runtime
that it will follow all rules as dictated by cooperative suspend when a thread
is in safe mode. The change only goes one way since this is a lifetime commitment
for a thread. Once’s set, thread will be kept running when in safe mode.
2019-06-25 17:40:39 +02:00
Kevin Pilch d36d2dd02d Remove a stale comment (#15378)
Pushing https://github.com/aspnet/AspNetCore/pull/10561 upstream, to fix
AzDO Bug #890301 (https://dev.azure.com/devdiv/DevDiv/_workitems/edit/890301/)
2019-06-25 17:25:34 +02:00
Zoltan Varga 9ace0a3b9c [runtime] Refactor mono-debug.c. (#15381)
* [debug] Refactor the code in mono-debug.c.

Store the domain->debug info table mapping in MonoDomain to avoid a hashtable lookup.
Rename MonoDebugDataTable to DebugDomainInfo to better reflect its meaning.

* Remove some mono_ prefixes from static functions, along with the full/internal prefixes.
2019-06-25 09:35:21 -04:00
Alexander Köplinger b2ac112d37 [bcl] Move MONO_DEBUG env variable after Q_MCS
Otherwise we'd get "/bin/sh: @echo: command not found" errors.
2019-06-25 14:38:37 +02:00
Radek Doulik 858b2b8405 [aot profiler] Listen for commands on given port (#14936)
* [aot profiler] Listen for commands on given port

Extended the aot profiler so, that it can receive commands over the network.

Added new option `port=PORT`, which enables command server and specifies
the port the server should listen at.

We have 2 commands so far.

    save ... save the profile data to socket and close it
    quit ... quit the profiler. it also saves the profile to the file
             in case the output option was specified.

It makes the aot profiling much easier to use on Android as we don't need to
save the profile to a file on the device. That means we don't need to set
`<application android:debuggable="true"/>` flag, which changes the Android
app behavior and thus influence the profile itself. It is also convenient way
for IDEs to retrieve the aot profiles.

Example use for Xamarin.Android. Save and receive the profile data:

	adb shell setprop debug.mono.profile aot:verbose,port=9999
	adb forward tcp:9999 tcp:9999
	nc -v 127.0.0.1 9999 > profile.aotprof
	found 0 associations
	found 1 connections:
	     1:	flags=82<CONNECTED,PREFERRED>
		outif lo0
		src 127.0.0.1 port 50398
		dst 127.0.0.1 port 9999
		rank info not available
		TCP aux info available

	Connection to 127.0.0.1 port 9999 [tcp/distinct] succeeded!
	save

Check what we received:

	aotprofile-tool -sd profile.aotprof
	Modules:
		132475FF-85AA-430D-913C-7642CBD8587E mscorlib
		F7BDCAB5-83D3-4A0A-A33D-BBE94284667D Mono.Android
		22897151-27C9-4064-B001-8A04F5847812 System
		AA3FC224-D486-4304-A8C9-EBF316556B26 Java.Interop
		00D98403-051B-4168-A391-F3F601637CBD System.Core
		FD06519A-C321-426C-BDD8-C97777452057 xat_latests_and_greatest_vsmac_8._1
		9ECB003E-D449-438B-BE35-58810DCBC917 Xamarin.Android.Support.v7.AppCompat
		11659962-EFAC-400D-9F8D-AF925B26AE41 Xamarin.Android.Support.Fragment
		48C436F7-611D-470D-9949-AC13FFDCF613 Xamarin.Essentials
		2792D10D-7E13-46E6-BB4A-933C25635F48 Xamarin.Android.Support.Design
	Summary:
		Modules:         10
		Types:          221
		Methods:        932

* Try to fix WIN32 compilation

* Add helper.c to mono-profiler-log.vcxproj

* Add helper.c to mono-profiler-log.vcxproj.filters as well
2019-06-25 12:17:45 +02:00
Johan Lorensson f8fbbcf280 Increase max size of localloc and localloc_imm on amd64. (#15374)
We hit the following assert when doing full AOT of some assemblies:

wrong maximal instruction length of instruction localloc (expected 96, got 99)
Assertion: should not be reached at mono\mono\mini\mini-amd64.c:6801

Turns out that that size could be hit when a couple of things happens as part
of lowering OP_LOCALLOC and OP_LOCALLOC_IMM:

sreg1 is not RAX, RCX or RDI
dreg is not RAX, RCX or RDI
cfg->param_area is bigger than 127

Fix is to increase max size of the instruction, from 96 -> 120 (same as x86).
2019-06-25 10:46:33 +02:00
Johan Lorensson b181dbc50d Add support for Windows x64 Full AOT + LLVM + Interpreter on CI. (#15276) 2019-06-25 08:20:25 +02:00
Nikita Voronchev c30a10bc3e [System.Windows.Forms] Fix crash of DataGridView in case of assigning a custom Column Header (#15135) 2019-06-24 21:51:47 -04:00
Johan Lorensson b2124dab01 Add missing CI test script when running full AOT interpreter on Windows. (#15281) 2019-06-24 17:00:01 -04:00
Marek Safar 7066c05c39 [System.Private.CoreLib] Add new shared string resource 2019-06-24 21:12:12 +02:00
Andrii Siriak 0abee2baf5 Switch from IndexOf(string) to Contains(string) for better readability and performance (#38757)
* Fix performance IndexOf(string) -> Contains(string)

* Make comparison ordinal

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Stephen Toub eeb377842e Force secondary await continuations to run asynchronously (#25280)
* Force secondary await continuations to run asynchronously

For performance reasons, await continuations have been invoked synchronously, meaning they're invoked as part of the antecedent task's completion (as long as that task allows it, as long as there's sufficient stack space, etc.)  This generally works out well in the case where there's a single await continuation, which is far and away the common case.  However, it can cause problems in situations where there are multiple await continuations, as those continuations will end up being serialized, which can lead to slowdowns and deadlocks in niche situations.  To address that, this commit backs off a bit.  The first await continuation is still invoked synchronously, but subsequent await continuations are invoked asynchronously, such that they are not blocked by a previously registered await continuation.

* Fix nits

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Marco Rossignoli 3af0d87397 MemoryExtensions ToUpper / ToLower throws for overlapping buffer (#25327)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Roman Marusyk 96481aedf0 Change exception throwing in Path.GetRelativePath (dotnet/coreclr#25047)
* Fix Path.GetRelativePath throws ArgumentNullException when relativeTo is empty string

* Fix ArgumentException for relativeTo

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Herman Eldering a555a5b5b3 ArgumentException: use system-supplied message if message is null (#25115)
Enable using a system-supplied message while also providing an argument/parameter name by passing in a null message. Made to match the behavior of FileNotFoundException.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Santiago Fernandez Madero 9ac62ea31a Address nullable feedback for System.Diagnostics.Tracing and StackTrace (#25303)
* Address nullable feedback for System.Diagnostics.Tracing and StackTrace

* Disable corefx tests that need to be updated

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Stephen Toub 7d4ce9cd8c Remove several unnecessary string allocations (dotnet/coreclr#25305)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Stephen Toub 366c80aed8 Reduce string allocation in DiagnosticCounter.GetMetadataString (#25219)
When the _metadata dictionary contains a single key/value pair, the method ends up allocating an unnecessary StringBuilder, char[] beneath it, and input string.

When the _metadata dictionary contains more key/value pairs, the method ends up allocating an unnecessary string per key/value pair.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Zoltan Varga 1150d4a3e9 [netcore] Disable more runtime functionality. (#15369) 2019-06-24 14:47:00 -04:00
Alexander Köplinger 80db1ef59f [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:54 +02:00
dotnet-maestro 683db00b2a Update dependencies from https://github.com/dotnet/arcade build 20190623.4
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19323.4
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19323.4
2019-06-24 17:25:34 +02:00
Thays Grazia 057f51d833 [wasm][debugger] Adding support to debug local vars in async methods (#15357)
- Improving performance calling only once mono_wasm_get_var_info.
- Adding support to debug local vars in async methods. They are special in the way that local variables can be lifted to generated class fields.
2019-06-24 10:34:42 -03:00
Johan Lorensson de90561fbd Fix race related to final event signaling in RegisteredWaitHandle. (#15280)
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-24 10:56:21 +02:00
Bernhard Urban 7d5daa2f77 [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:45 +02:00
dotnet-maestro d027cbbc06 Update dependencies from https://github.com/dotnet/arcade build 20190622.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19322.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19322.2
2019-06-24 09:12:13 +02:00
dotnet-maestro 33a4a35826 Update dependencies from https://github.com/dotnet/arcade build 20190621.75
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19321.75
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19321.75
2019-06-24 09:12:13 +02:00
Zoltan Varga bbfce00878 [netcore] Remove unused icalls. 2019-06-23 10:05:22 +02:00
Zebediah Figura 9f49cc85af [mini] Support tracing pointer return values. (#15356) 2019-06-22 12:57:49 -04:00
Zoltan Varga c3161826e3 [aot] Fix a deadlock in init_plt () by calling create_trampoline () outside the lock. (#15332)
Fixes https://github.com/mono/mono/issues/15330.
2019-06-21 23:35:57 -04:00
Zoltan Varga f42fcc0459 [sdks] Avoid building everything on make all. (#15296)
* [sdks] Avoid building everything on make all.

* Add a dummy all target.
2019-06-21 23:35:42 -04:00
Vlad Brezae 0cf363c4db [arm64] Add location of this and rgctx arg
Used to fetch the value from async suspend stack frame, during exception handling.
2019-06-21 15:47:44 -05:00
Vlad Brezae a7a884e19e [arm] Add location of this and rgctx arg
Used to fetch the value from async suspend stack frame, during exception handling.
2019-06-21 15:47:44 -05:00
Vlad Brezae e1e26b87b5 [amd64] Fix location saving for *this*
With static methods we were saving location for irrelevant argument.
2019-06-21 15:47:44 -05:00
Jay Krell ab16b39a65 Remove three seemingly unused functions:
mono_aot_init_gshared_method_this
  mono_aot_init_gshared_method_mrgctx
  mono_aot_init_gshared_method_vtable

Update comments that refer to them, to refer to the renames.
 mini_llvm_init instead of mono_aot_init.

See 80bc0069e4 and 04d65f2986.

I'm here because I broke something nearby in a work-in-progress PR
and the existance of these functions made me look into them.
2019-06-21 15:46:24 -05:00
Ankit Jain 81f529689c Bump msbuild to track xplat-master (#15295)
* Bump msbuild to track xplat-master

* [msbuild] Bump to track xplat-master

.. which effectively enables use of the shared compiler.
2019-06-21 21:36:43 +02:00
Filip Navara 42eb919d52 Add basic implementation of Environment.FailFast (#15279)
* Add basic implementation of Environment.FailFast

* Add comment about __failfast on Windows 8+

* Re-add some test exclusions and clarify the comment around them

* Update icall.c
2019-06-21 18:52:12 +02:00
Aleksey Kliger (λgeek) 71ceefccf6 [api] Add a mono/metadata/profiler-legacy.h header (#15098)
* [api] Add mono/metadata/profiler-legacy.h header

Add a header with the legacy Mono profiler API.  New code should use the API
from mono/metadata/profiler.h.

* [profiler] Mark the legacy profiler API with MONO_DEPRECATED

* [runtime] Don't install the profiler-legacy.h header

Make the decision later whether these should be in the set of public API headers
2019-06-21 18:47:26 +02:00
monojenkins 3d48d85472 [ci] One more workaround for Git 2.22.0 (#15326)
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:38 -04:00
dotnet-maestro c6b8e90230 Update dependencies from https://github.com/dotnet/arcade build 20190620.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19320.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19320.1
2019-06-21 16:26:01 +02:00
monojenkins 304899de1b [bcl] Update BCL Linked Size 2019-06-21 13:56:27 +02:00
Egor Bogatov 9eb1f19909 Update Makefile 2019-06-21 13:55:33 +02:00
EgorBo 44cba4e442 fix build-test-corefx command 2019-06-21 13:55:33 +02:00
Kenneth Pouncey b32b5ceba2 Make sure that bindings are initialized in mono_wasm_new. (#15274)
- Fixes `this.mono_string_get_utf8 is not a function`.
2019-06-21 13:38:50 +02:00
Dmitry Kalyanov 480f636808 TransactionScope now actually uses IsolationLevel that was specified in TransactionOptions
Previously, using TransactionScope would always produce transactions
that use serializable isolation level even when user specified another
level (like ReadCommited).

fixes #13945
2019-06-21 11:27:59 +02:00
Stephen Toub a8b1b2ed20 Fix visibility on Exception.InnerExceptionPrefix (dotnet/coreclr#25278)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-21 08:34:24 +02:00
Santiago Fernandez Madero 93fdf6489c Address nullable feedback for S.T.Overlapped, S.Memory, S.R.InteropServices (#25214)
* Address nullable feedback for System.Threading.Overlapped

* Address nullable feedback for System.Memory

* Address nullable for System.Runtime.InteropServices

* Update xml comments and make CultureInfo nullable to match String.ToLower/Upper feedback

* PR feedback: revert accepting null comparer in BinarySearch

* Disable test that needs to be updated in corefx

Signed-off-by: dotnet-bot <[email protected]>
2019-06-21 08:34:24 +02:00
Dan Moseley 5dee50f30c Exception format cleanup subset (dotnet/coreclr#25185)
* Change ArgumentException message to one line

* Disable 2 tests

* Remove duplication in AggregateException.ToString()

* Inner exceptions on new lines

* Caps letter

* Typo

Signed-off-by: dotnet-bot <[email protected]>
2019-06-21 08:34:24 +02:00
lateralusX ad90ebd3ab Make copy_stack_data support configurable.
By default when called through macros like MONO_ENTER_GC_UNSAFE
code will always dump current registers into stack space on hybrid/coop.
The registers will be scanned but only when hitting a GC and when running
in GC unsafe, that will only happen when we block in the enter or hit a safe
point at a later point in time. There are currently a couple of frequent
scenarios where we go into GC safe when thread won't be suspended and in
that case the copy of the registers will only reflect the state when
entering GC unsafe.

Commits add option to enable/disable copy_stack_data support in configure step:
--enable-copy-stack-data, --disable-copy-stack-data.

copy_stack_data is enabled by default on all platforms except desktop platforms
macos, linux and windows (both 32/64-bit), since these platforms already support
full context as well as capabilities to scan the stack of a running thread.
2019-06-20 23:34:56 -05:00
Larry Ewing 7af0e36db3 Merge pull request #15293 from lewing/wasm-clean
[wasm] Add some missing directories to the clean target
2019-06-20 22:21:08 -05:00
Larry Ewing efa06b3ecd Merge pull request #15291 from lewing/doublecheck-290
[wasm] Add an explicit test for https://github.com/dotnet/try/issues/290
2019-06-20 20:46:39 -05:00
Aleksey Kliger (λgeek) 18ce655751 [loader] remap only System.Threading.Tasks.Dataflow older than 4.0.0.0 (#15266)
[loader] remap only System.Threading.Tasks.Dataflow older than 4.0.0.0

Allow through requests for newer versions unchanged.
2019-06-20 19:25:43 -04:00
Thays Grazia 405d521149 [debugger] Debugger doesn't break on unhandled exceptions (#15234)
* 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-20 18:48:13 -04:00
Larry Ewing b20ef4cc36 [wasm] Add some missing directories to the clean target 2019-06-20 14:28:20 -05:00
Vlad Brezae b4e43abbcc [jit] Make alias analysis properly handle alias cloberring (#15255)
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 21:35:18 +03:00
Larry Ewing 653a12ad3c Add an explicit test for https://github.com/dotnet/try/issues/290 2019-06-20 13:25:29 -05:00
dotnet-maestro 6023f36749 Update dependencies from https://github.com/dotnet/arcade build 20190619.25
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19319.25
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19319.25
2019-06-20 18:29:47 +02:00
Vlad Brezae 1120e82312 [jit] Add debug option for using clr memory model (#15019)
* [jit] Move value storing in a new write barrier emitting method

Brings together ref storing and the write barrier generation.

* [jit] Add debug option to attempt using the CLR memory model

Which prevents reordering of stores. Part of the way this is done on CoreCLR is by adding memory barriers to the write barrier, so we attempt a similar behavior.

This is not a complete implementation.

* [build] Add memory model flag to csc when building the bcl

This should prevent random crashes during the build

* [build] Add memory model flag to compiler server

* [build] Add memory model flag to test building
2019-06-20 19:18:26 +03:00
Jay Krell fb6ce0df91 [Coop] Establish handle frame in reflection_setup_internal_class. (#15248)
It is called in a loop by ves_icall_TypeBuilder_create_runtime_class.
See https://github.com/mono/mono/issues/15247.
2019-06-20 11:00:36 -04:00
Jay Krell 2104d1d957 Write to the same union member that is later read. (#15269)
It should not matter in this case, but it is the usual practise,
and not strictly valid otherwise.
2019-06-20 10:57:04 -04:00
Jay Krell e24f1ed945 [interp] Optimize CEE_MONO_TLS due their being only one live producer. (#15245)
There is a dead producer in Boehm. (see https://github.com/mono/mono/pull/15241)
This combined with https://github.com/mono/mono/pull/15226
will leave no remaining uses of mono_tls_get_tls_getter.

If there were really multiple values of the enum, consider
doing the switch in transform instead of interp.
2019-06-20 16:39:20 +03:00
Radek Doulik 688d7f0938 [Mono.Profiler.Aot] Add profile writer
It writes the profile data to given stream. It comes from
https://github.com/radekdoulik/aotprofile-tool
2019-06-20 14:13:34 +02:00
Egor Bogatov 5a21eb4288 Fix arcade stuff 2019-06-20 14:07:13 +02:00
Johan Lorensson fb35615c56 Interpreter PR builds run to many test suites. (#15251)
Fix makes sure we don't run full test suite on PR builds or when targeting
arm architectures or Windows.
2019-06-20 13:30:47 +02:00
monojenkins 3b53959f1e [csproj] Update project files 2019-06-20 12:04:07 +02:00
Marek Safar 7373266eb5 Bump linker & cecil 2019-06-20 12:04:07 +02:00
Johan Lorensson dfb46dad7d Add Windows x64 Full AOT Interpreter support on CI. (#15127)
Add support to run full interpreter test suite on CI for Windows x64 Full AOT.
Since Windows x64 Full AOT uses a different full AOT profile WinAOT a separate
testing profile was setup for the interpreter testing. NOTE, this profile is
pure for testing, inline with the other testing profiles. It is also reusing
most of its sources from other sources files (mainly WinAOT) to reduce maintenance
of the profile.

Commit also includes some smaller adjustments needed in order to get full
pass rate for Windows x64 Full AOT + Interpreter on CI.
2019-06-20 09:23:39 +02:00
Aleksey Kliger b2a860c949 [coop] Mark a few functions with MONO_PROFILER_API 2019-06-20 00:22:01 +02:00
Aleksey Kliger cf3bb20575 [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-20 00:22:01 +02:00
Aleksey Kliger ee74ee90b3 [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-20 00:22:01 +02:00
Jay Krell 09869a9c8b Fix compiler warnings. (#15196)
* Fix compiler warnings.
 unused variable: save_sigint
 unused variable: mono_environ
 uprototyed function: mono_marshal_xdomain_copy_value

* add static
2019-06-19 18:18:31 -04:00
Jay Krell 6e1cc91d8d Remove unused MONO_PATCH_INFO_SET_TLS_TRAMP, corresponding unused JIT icalls, etc. (#15201) 2019-06-19 16:25:34 -04:00
Marek Safar a4ef5c3590 Update CODEOWNERS 2019-06-19 20:39:03 +02:00
dotnet-maestro 7390b78b2d Update dependencies from https://github.com/dotnet/arcade build 20190619.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19319.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19319.1
2019-06-19 19:10:45 +02:00
Ryan Lucia 2a82614f98 Correctly set ReflectionType with inherited generic methods (#15233)
* Correctly set ReflectionType with inherited generic methods

* Allow ValueType

* Re-enable relevant test

* Switch to mono_class_from_mono_type_internal
2019-06-19 13:08:39 -04:00
Johan Lorensson 7ac0287a7b Increase timeout for interpreter fullaotmixed regression. (#15225)
On Windows (partly due to slow shell execution) this test take longer to
complete than current given timeout.
2019-06-19 17:45:10 +02:00
Zoltan Varga 7341c9f636 [jit] Avoid calling mini_jit_info_table_find () in mini_add_method_trampoline () unless needed. (#15239) 2019-06-19 10:52:27 -04:00
Filip Navara c1068f9db5 [netcore] Update the checks for ByRef return type in reflection invocation (#14967)
* Update the checks for ByRef return type in reflection invocation to also check for IsByRefLike types. This was missed as part of #13901 and noted in the description.

Fixes #14959, #14960, #14961, #14963

* Modify the reflection checks for IsByRef/IsByRefLike to check for same conditions as CoreCLR

* Handle reflection invocation with ref void return type

* Update test-ref-07 to have Main method that is valid to invoke through reflection (as the test runner does)

* Update expected IL
2019-06-19 08:51:43 +02:00
Zoltan Varga 611ba9a018 [interp] Implement tracing of return values. Improve printing of arrays. (#15217) 2019-06-18 23:03:13 -04:00
Alexis Christoforides 7c4300aa7f [filewatcher] Fall back to default if a new instance cannot be created 2019-06-19 05:26:57 +03:00
Alexis Christoforides cc6a2d4606 Improve robustness of post-install script (#15213)
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 02:21:38 +03:00
Bernhard Urban e3f8596156 [arm] fix some more host/target pointer size issues (#15223)
[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-18 17:45:59 -04:00
Bernhard Urban fe7027935b [mini] fix OP_SEQ_POINT of other backends regarding target pointer size (#15222)
See https://github.com/mono/mono/pull/15205#issuecomment-502925368

Theoretically fixes cross compilation on a 32bit host to a 64bit target.
2019-06-19 00:06:54 +03:00
monojenkins 95259f9947 Bump API snapshot submodule 2019-06-18 20:53:25 +02:00
Steve Pfister 2d94e79f5b Bump mono/corefx to fix https://github.com/mono/mono/issues/14864 2019-06-18 20:53:25 +02:00
Ryan Lucia 7a1605cb07 [netcore] Don't default to an empty array for a null publicKey 2019-06-18 19:44:51 +02:00
dotnet-maestro d3d499f34e Update dependencies from https://github.com/dotnet/arcade build 20190618.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19318.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19318.2
2019-06-18 19:35:04 +02:00
Ryan Lucia 6c5bbbd757 [eglib] Don't escape chars in argv parsing enclosed in single quotes (#15047)
Fixes #14724

This may need to be reverted if customers are relying on the existing behavior, but we can cross that bridge when we come to it.

The larger issue of incompatibility with .NET Core should be addressed later.
2019-06-18 13:30:31 -04:00
Marek Safar 3428cec003 Mirror changes from mono/corefx,corert,coreclr (#15221)
Mirror changes from mono/corefx,corert,coreclr
2019-06-18 12:44:36 +02:00
Marek Safar 7052e60600 [netcore] Excluded tests update 2019-06-18 11:25:51 +02:00
Marek Safar d44da802a9 [System.Private.CoreLib] Merge fixes 2019-06-18 11:10:59 +02:00
Marek Safar e29f79e68e Merge remote-tracking branch 'upstream/master' into mirror-merge-10235436 2019-06-18 10:54:06 +02:00
Marek Safar 3d311876d2 [netcore] Reflect shared partition changes 2019-06-18 10:52:05 +02:00
Marek Safar 879c8501c9 [System.Private.CoreLib] Align on CA naming for easier sharing 2019-06-18 10:10:16 +02:00
naricc ac2894920a Implement GC.GetAllocatedBytes (#14779) 2019-06-18 09:08:21 +02:00
Bernhard Urban d5a35798c6 [arm] use target_mgreg_t instead of plain pointer type in sdb breakpoint (#15205)
[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

Diff before (left old cross32, right new cross32 running on amd64 host _before_ this fix):
<img width="1257" alt="Screenshot 2019-06-17 at 14 09 51" src="https://user-images.githubusercontent.com/75403/59603413-a9bd4f00-9109-11e9-8f18-aa7b4ca5817f.png">

/cc @mandel-macaque
2019-06-18 02:46:00 -04:00
Jay Krell fc74334e20 Allocate MonoJumpInfo instead of MonoAotCompile. 2019-06-17 23:41:26 -05:00
Kenneth Pouncey 67b4d55d91 Simplify header item fetch using the Headers entries iterator.
- Use the Headers `entries{}` iterator object.
- This replaces the `foreach` delegate call where the object returned in the delegate was being disposed of too early.
- The foreach delegate takes three objects name, value, other.  The `other` being disposed was causing a problem when calling back into the delegate later.
- Removes the lamda expression called by the delegate without the worry of a memory leak if the finally is removed.
2019-06-17 21:56:47 -05:00
Kenneth Pouncey f7bba7172e Add tests to the IssuesTestSuite to catch regressions
- See issue https://github.com/mono/mono/issues/14940
2019-06-17 21:56:47 -05:00
Kenneth Pouncey 8f864e4d92 Fix problem with fetch response header iteration prematurely disposing of the header object.
- Use the iterator of the headers object do iteration over the fetch response headers.
2019-06-17 21:56:47 -05:00
Jay Krell a97408ac1e Revert "threads.c:6403:6: warning: 'current_idx' may be used uninitialized in this function [-Wmaybe-uninitialized]"
This reverts commit bf2f1abe01978102c22d76b4a10996e8d8b50b0f.

The logic is not clear as to if there is a bug, so leave the warning.
There are two uses of the possibly uninitialized variable.
One is guarded and not a bug.
The other is not clear, and don't want to blindly use 0.
2019-06-17 21:53:08 -05:00
Jay Krell af2c235f31 PR: Restore nearby unusual formatting. 2019-06-17 21:53:08 -05:00
Jay Krell 9c70b53cc3 intrinsics.c: In function 'mini_emit_inst_for_method':
intrinsics.c:1580:11: warning: 'result' may be used uninitialized in this function [-Wmaybe-uninitialized]
     *dest = result;
     ~~~~~~^~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 6e19637797 debugger-engine.c: In function 'set_bp_in_method':
debugger-engine.c:354:11: warning: variable 'code' set but not used [-Wunused-but-set-variable]
  gpointer code;
           ^~~~
2019-06-17 21:53:08 -05:00
Jay Krell 496cb4cfce tramp-arm64-gsharedvt.c: In function 'mono_arch_get_gsharedvt_trampoline':
tramp-arm64-gsharedvt.c:217:54: warning: variable 'callee_stack_area_offset' set but not used [-Wunused-but-set-variable]
  int caller_reg_area_offset, callee_reg_area_offset, callee_stack_area_offset;
                                                      ^~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 179b5e85cf mini-arm64-gsharedvt.c: In function 'mono_arch_get_gsharedvt_call_info':
mini-arm64-gsharedvt.c:142:29: warning: variable 'gsig' set but not used [-Wunused-but-set-variable]
  MonoMethodSignature *sig, *gsig;
                             ^~~~
2019-06-17 21:53:08 -05:00
Jay Krell b504d7e6d8 interp/mintops.c: In function 'mono_interp_dis_mintop':
interp/mintops.c:87:37: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'long int' [-Wformat=]
   g_string_append_printf (str, " %lld", (gint64)READ64 (ip + 1));
2019-06-17 21:53:08 -05:00
Jay Krell 452209414e In file included from object.c:40:0:
object.c: In function 'mono_class_proxy_vtable':
../../mono/metadata/profiler-private.h:191:4: warning: 'pvt' may be used uninitialized in this function [-Wmaybe-uninitialized]
    mono_profiler_raise_ ## name args; \
    ^~~~~~~~~~~~~~~~~~~~
object.c:2338:19: note: 'pvt' was declared here
  MonoVTable *vt, *pvt;
                   ^~~
2019-06-17 21:53:08 -05:00
Jay Krell bdb20ebd80 w32file-unix.c: In function 'mono_w32file_get_file_size':
w32file-unix.c:4994:19: warning: 'length_hi' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return length | ((gint64)length_hi << 32);
                   ^~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 457d0f02c5 interp/interp.c: In function 'interp_entry.constprop':
interp/interp.c:1847:3: warning: 'orig_domain' may be used uninitialized in this function [-Wmaybe-uninitialized]
   mono_threads_detach_coop (orig_domain, &attach_cookie);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 3357a1a611 image.c:1351:20: warning: variable 'header' set but not used [-Wunused-but-set-variable]
MonoDotNetHeader *header;
                    ^~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 00570db6a4 exception.c:747:1: warning: 'mono_new_exception_argument_out_of_range' defined but not used [-Wunused-function]
mono_new_exception_argument_out_of_range (const char *arg, MonoError *error)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell bc5d1a48d8 os-event-unix.c: In function 'mono_os_event_wait_multiple':
os-event-unix.c:195:12: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
    elapsed = mono_msec_ticks () - start;
    ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 96129ba873 In file included from ../../mono/eglib/glib.h:45:0,
from os-event.h:9,
                 from os-event-unix.c:11:
../../mono/eglib/eglib-remap.h:146:25: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define g_ptr_array_add monoeg_g_ptr_array_add
                         ^~~~~~~~~~~~~~~~~~~~~~
os-event-unix.c:121:19: note: 'data' was declared here
  OSEventWaitData *data;
                   ^~~~
2019-06-17 21:53:08 -05:00
Jay Krell faadb64774 marshal.c: In function 'mono_marshal_get_runtime_invoke_full':
marshal.c:2662:8: warning: 'sig_cache' may be used uninitialized in this function [-Wmaybe-uninitialized]
    res = (MonoMethod *)g_hash_table_lookup (sig_cache, sig_key);
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 64c321293b sgen-mono.c:260:1: warning: 'install_noilgen' defined but not used [-Wunused-function]
install_noilgen (void)
2019-06-17 21:53:08 -05:00
Jay Krell 0b5b42f6c7 In file included from sgen-new-bridge.c:31:0:
sgen-dynarray.h:331:1: warning: 'dyn_array_ptr_set_all' defined but not used [-Wunused-function]
 dyn_array_ptr_set_all (DynPtrArray *dst, DynPtrArray *src)
 ^~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell e94887a18c threads.c:6403:6: warning: 'current_idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (i == current_idx)
      ^
threads.c:6549:6: note: 'current_idx' was declared here
  int current_idx;
      ^~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 67680a2e81 sgen-dynarray.h:248:1: warning: 'dyn_array_ptr_set' defined but not used [-Wunused-function]
dyn_array_ptr_set (DynPtrArray *da, int x, void *ptr)
 ^~~~~~~~~~~~~~~~~

sgen-dynarray.h:202:1: warning: 'dyn_array_ptr_init' defined but not used [-Wunused-function]
 dyn_array_ptr_init (DynPtrArray *da)
 ^~~~~~~~~~~~~~~~~~

sgen-dynarray.h:194:1: warning: 'dyn_array_int_is_copy' defined but not used [-Wunused-function]
 dyn_array_int_is_copy (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~~~~

sgen-dynarray.h:188:1: warning: 'dyn_array_int_copy' defined but not used [-Wunused-function]
 dyn_array_int_copy (DynIntArray *dst, DynIntArray *src)
 ^~~~~~~~~~~~~~~~~~

sgen-dynarray.h:182:1: warning: 'dyn_array_int_ensure_independent' defined but not used [-Wunused-function]
 dyn_array_int_ensure_independent (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sgen-dynarray.h:168:1: warning: 'dyn_array_int_get' defined but not used [-Wunused-function]
dyn_array_int_get (DynIntArray *da, int x)
 ^~~~~~~~~~~~~~~~~

sgen-dynarray.h:161:1: warning: 'dyn_array_int_add' defined but not used [-Wunused-function]
 dyn_array_int_add (DynIntArray *da, int x)
 ^~~~~~~~~~~~~~~~~

sgen-dynarray.h:147:1: warning: 'dyn_array_int_size' defined but not used [-Wunused-function]
 dyn_array_int_size (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~
sgen-dynarray.h:141:1: warning: 'dyn_array_int_uninit' defined but not used [-Wunused-function]
 dyn_array_int_uninit (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~~~
sgen-dynarray.h:135:1: warning: 'dyn_array_int_init' defined but not used [-Wunused-function]
 dyn_array_int_init (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell ae357bebbd In file included from sre.c:30:0:
../../mono/metadata/reflection-cache.h:43:1: warning: 'free_reflected_entry' defined but not used [-Wunused-function]
 free_reflected_entry (ReflectedEntry *entry)
 ^~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell cc60fe04d0 sre.c:2067:1: warning: 'is_sr_mono_field' defined but not used [-Wunused-function]
is_sr_mono_field (MonoClass *klass)
 ^~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 54366ee658 w32handle.c: In function 'mono_w32handle_wait_multiple':
w32handle.c:1146:13: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
     elapsed = mono_msec_ticks () - start;
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell f2f5c45d9d custom-attrs.c:269:1: warning: 'load_cattr_type_object' defined but not used [-Wunused-function]
load_cattr_type_object (MonoImage *image, MonoType *t, gboolean header, const char *p, const char *boundp, const char **end, MonoError *error, guint32 *slen)
 ^~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 267a75f365 sre-save.c:114:1: warning: 'swap_with_size' defined but not used [-Wunused-function]
swap_with_size (char *dest, const char* val, int len, int nelem) {
2019-06-17 21:53:08 -05:00
Jay Krell 404a03b87e mono-mmap.c: In function 'mono_file_map_error':
mono-mmap.c:401:82: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 5 has type 'guint64 {aka long unsigned int}' [-Wformat=]
    *error_message = g_strdup_printf ("%s failed file:%s length:0x%zX offset:0x%lluX error:%s(0x%X)\n",
2019-06-17 21:53:08 -05:00
Jay Krell a37f71a4ea threadpool.c: In function 'mono_threadpool_remove_domain_jobs':
threadpool.c:571:91: warning: 'end' may be used uninitialized in this function [-Wmaybe-uninitialized]
    res = mono_coop_cond_timedwait (&tpdomain->cleanup_cond, &threadpool.domains_lock, end - now);
2019-06-17 21:53:08 -05:00
Sung Yoon Whang e734fca321 make DiagnosticCounter and its children lock 'this' instead of an arbitrary String (#25173)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:13 +00:00
Ben Adams 0ca0d1dfd9 IndexOfAny(values.Length == 0) == -1 (dotnet/coreclr#25075)
* IndexOfAny(values.Length == 0) == -1

* Skip tests

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:12 +00:00
Adam Sitnik b58c351daf don't use var
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:10 +00:00
Adam SitnikandJan Kotas 62f597ea23 Apply suggestions from code review
Co-Authored-By: Jan Kotas <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:09 +00:00
Adam Sitnik 2597806f5f set the charset to Ansi
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:08 +00:00
Adam Sitnik a22d66c98c simplify the code
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:07 +00:00
Adam Sitnik 0dcea57a81 lock the dictionary
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:07 +00:00
Adam Sitnik fd52429be9 move the sort key logic to a dedicated helper type to avoid static field initialization order issues
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:06 +00:00
Adam Sitnik 3a45ebfa72 introduce cache for sort handles to prevent from memory leak in certain scenarios
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:05 +00:00
Adam Sitnik d7506847fe use IntPtr instead of CriticalHandle to avoid resurrection issues. It's ok to never free the handle
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:05 +00:00
Adam Sitnik ba42c41536 seal the CriticalSortHandle class
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:04 +00:00
Adam Sitnik 67e2d3ff62 change SafeSortHandle to be CriticalSortHandle to avoid expensive ref counting
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:03 +00:00
Marek Safar 3e3925ff93 Move parts of RuntimeType to shared partition (dotnet/coreclr#25176)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:02 +00:00
Sung Yoon Whang b723b841c0 Make DisplayUnits string.Empty by default instead of null (#25104)
* Make DisplayUnits string.Empty by default instead of null

* PR feedback on DisplayName and setter validation

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:01 +00:00
Tarek Mahmoud Sayed 321b02ce2c Fix French Decimal number parsing (dotnet/coreclr#25154)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:01 +00:00
Jan Kotas 18a4099fbd Optimize Activator.CreateInstance (dotnet/coreclr#25145)
* Optimize Activator.CreateInstance
- Short-circuit Activator.CreateInstance<T>() for value types without default constructor
- Cache default constructor delegate on RuntimeType instead of fixed-size singleton cache

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:00 +00:00
Stephen Toub 4a29e94abb Update Corelib to adapt to compiler nullability updates
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:36:59 +00:00
Viktor Hofer ee64a8364f Delete dead uapaot code (dotnet/corefx#38330)
* Delete dead uapaot code

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:36:58 +00:00
Egor Bogatov c04dc84a9f fix RuntimeType.cs 2019-06-17 21:14:06 +02:00
Bernhard Urban 1e5ca1479c [watch] consistent naming for watchOS min version (#15202)
[watch] consistent naming for watchOS min version

See https://github.com/xamarin/xamarin-macios/pull/6307
2019-06-17 13:26:09 -04:00
Jay Krell 7d824dc2ae Fix race conditions in mono_lazy_initialize,
which is meant to be all about handling race conditions.

1. Less severe:
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.

2. Change `status` to `*lazy_init` to fix severe race condition.
2019-06-17 15:31:35 +02:00
dotnet-maestro 6bd68bc2a4 Update dependencies from https://github.com/dotnet/arcade build 20190615.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19315.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19315.2
2019-06-17 15:30:58 +02:00
Jay Krell 8966528c21 Replace MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR with MONO_PATCH_INFO_JIT_ICALL_ADDR. (#15053)
* Replace MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR with MONO_PATCH_INFO_JIT_ICALL_ADDR.

* PR: Abstract the TrampolineType / jit_icall_id translation.
2019-06-17 01:25:53 -04:00
Vlad Brezae fd089b6e4d [interp] Prefer interp_in wrappers over trampolines (#14684)
[interp] Prefer interp_in wrappers over trampolines
2019-06-15 17:25:06 -04:00
Katelyn Gadd 59a0d1e70f Add the compiler server log to the gitignore 2019-06-15 16:16:12 -05:00
dotnet-maestro 7269db058e Update dependencies from https://github.com/dotnet/arcade build 20190614.27
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19314.27
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19314.27
2019-06-15 16:08:10 +02:00
Aleksey Kliger 8a0495ea3b [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:05 +02:00
Marek Safar b5b58d67cf [System.Private.CoreLib] Extract RuntimeType for easier refactoring 2019-06-15 09:28:47 +02:00
Egor Bogatov 26f0222284 [netcore] Fix CI build script (#15130) 2019-06-15 09:27:15 +02:00
Jay Krell eafcbfd6ed Read only interp callbacks, option 4, without ordering sensitivity. 2019-06-14 18:51:56 -05:00
Jay Krell 1fe336691e Cleanup AIX code a little. 2019-06-14 18:43:36 -05:00
Aleksey Kliger (λgeek) 94725cb85e [llvm] bump to mono/llvm@2bd2f1db18 (#15049)
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-14 16:17:07 -04:00
Marek Safar ef4c8bbbb0 [netcore] Arcade does not yet have CLSCompliant support, revert to manual settings 2019-06-14 22:00:40 +02:00
Thays Grazia a81cc67327 Implementing reabstraction of default interface methods. (#14790)
Implementing reabstraction of default interface methods.
Fix #14495
2019-06-14 16:15:38 -03:00
Marek Safar 49dc99be58 [netcore] Add more Arcade magic for signing 2019-06-14 21:10:20 +02:00
Alexander Kyte 877a2b6548 [metadata] Move problematic image out-param usage (#15131) 2019-06-14 14:38:09 -04:00
dotnet-maestro 377030eaab Update dependencies from https://github.com/dotnet/arcade build 20190613.18
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19313.18
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19313.18
2019-06-14 18:41:59 +02:00
Aleksey Kliger (λgeek) 0e0f1b9be0 [mini] Move some MONO_API functions to public header (#15105)
* [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-14 11:33:11 -04:00
Johan Lorensson b33c379057 Enable aotcheck and test-aot CI tests on Windows x64. (#15062) 2019-06-14 15:56:24 +02:00
Egor Bogatov 4212270b23 Fix csproj 2019-06-14 13:16:46 +02:00
Johan Lorensson a382edc9e1 Deadlock in loader when using bundling. (#15061)
We can hit the following deadlock when loading assemblies (using reflection)
together with bundling:

One thread calls mono_assembly_open_from_bundle, that will take assemblies lock
and then try to load assembly. If this race with a different load of the
same assemblies, one will lose, and that method will call mono_image_close that
in turn will call unload hook (mono_class_unregister_image_generic_subclasses)
that will take loader lock.

If we at the same time have a different thread that calls mono_class_create_from_typedef
, it will take loader lock and then it might end up calling mono_assembly_load_reference
that will take assemblies lock, but since that thread takes the locks
in different order compare to first thread, they could deadlock.

Looking into the use of assemblies lock in mono_assembly_open_from_bundle it
uses a static variable, bundles, that is not protected in other scenarios
and only set by mono_register_bundled_assemblies, normally called during
boot. The method called in the loop mono_image_open_from_data_internal is called
at several places without locks (and looks internal using image lock), so that
doesn't need to be protected. The rest is local data access and the only thing the
lock could do is serialize the whole loop between threads (but that shouldn't be needed).

Fix will remove the locking and also eliminating the incorrect lock order
causing the deadlock.
2019-06-14 11:20:28 +02:00
Marek Safar 9010d2f290 [netcore] Clean up netcore build 2019-06-14 11:03:35 +02:00
Ben Adams 12b737d980 Intrinsicify SpanHelpers.IndexOf(char) (dotnet/coreclr#22505)
* Helpers to support Intrinsics in SpanHelpers.Char

* Intrinsicify SpanHelpers.IndexOf(char)

* Feedback

* fix

* Fix assert

* Improve comment warning

* fix

* fix

* Fix

* Fix

Signed-off-by: dotnet-bot <[email protected]>
2019-06-14 09:37:52 +02:00
Jay Krell 467fd6516b Fix S390x compile since #14870 and a warning. (#15056) 2019-06-14 00:37:06 -05:00
Larry Ewing 56e27ca309 [wasm] fix most cases of numeric debugging for wasm
Fix the signededness of numeric types and use double
for the display of everthing since we are stuck with that
on the js side.
2019-06-13 22:25:23 -05:00
imhameed e6e9d5f6eb Don't create a cycle when translating IL break to IR. (#14980)
Don't create a cycle when translating IL `break` to IR.

`mono_emit_jit_icall` adds the instruction it generates to the current
basic block, and the redundant use of `MONO_ADD_INS` on an instruction
that has already been added to a BB will create a cycle in the `prev`
link chain.

Fixes #9706.
2019-06-13 13:56:07 -04:00
Jo Shields 1e0890f61f Ensure start-compiler-server.sh is in tarballs (#15071) 2019-06-13 13:10:38 -04:00
Jo Shields 7c99f6f249 [netcore] Add native ARM64 build to --with-core=only matrix (#14536)
* [netcore] Add native ARM64 build to `--with-core=only` matrix
2019-06-13 13:06:56 -04:00
dotnet-maestro 8affbbe98d Update dependencies from https://github.com/dotnet/arcade build 20190612.21
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19312.21
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19312.21
2019-06-13 17:32:22 +02:00
Ryan Lucia 20d83c24d6 Propagate error in mono_unicode_to_external (#14879)
* Add internal version of mono_unicode_to_external to propagate error

* Migrate things to _error version where sensible

* Remove redundant goto

* Print input string when conversion fails

* Remove todos

* Switch everything to MonoError

* Naming: err -> error

* Actually print out *filename correctly
2019-06-13 17:03:34 +02:00
Kenneth Pouncey e795253dc7 Fix generated warning of driver.c (#15036)
The following warning is generated when building master for interpreter as well as during AOT build of driver.c

```
driver.c:346:31: warning: initializing 'const MonoBundledAssembly **' with an expression of type 'MonoBundledAssembly **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
                const MonoBundledAssembly **bundle_array = g_new0 (MonoBundledAssembly*, assembly_count + 1);
                                            ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2019-06-13 15:15:30 +02:00
Marek Safar ffe5166a9b [System.Private.CoreLib] Add licence headers 2019-06-13 09:45:50 +02:00
Marek Safar f2c74837d2 [netcore] Bump roslyn version 2019-06-13 09:44:12 +02:00
Stephen Toub 5eedd4f813 Fix nullable annotations on Binder.ReorderArgumentArray
Signed-off-by: dotnet-bot <[email protected]>
2019-06-13 09:44:12 +02:00
Stephen Toub 001844340a Remove defunct !s and update some TODO-NULLABLE comments
Signed-off-by: dotnet-bot <[email protected]>
2019-06-13 09:44:12 +02:00
dotnet-maestro[bot] 8eec14a2f1 Update dependencies from dotnet/arcade (dotnet/corefx#38474)
* Update dependencies from https://github.com/dotnet/arcade build 20190611.2

- Microsoft.DotNet.XUnitExtensions - 2.4.1-beta.19311.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.19311.2
- Microsoft.DotNet.VersionTools.Tasks - 1.0.0-beta.19311.2
- Microsoft.DotNet.ApiCompat - 1.0.0-beta.19311.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Configuration - 1.0.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19311.2
- Microsoft.DotNet.CodeAnalysis - 1.0.0-beta.19311.2
- Microsoft.DotNet.CoreFxTesting - 1.0.0-beta.19311.2
- Microsoft.DotNet.GenAPI - 1.0.0-beta.19311.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19311.2
- Microsoft.DotNet.RemoteExecutor - 1.0.0-beta.19311.2
- Microsoft.DotNet.GenFacades - 1.0.0-beta.19311.2

* Update `where T : object` constraint to be `where T : notnull`

* Update several TODO-NULLABLE comments

Signed-off-by: dotnet-bot <[email protected]>
2019-06-13 09:44:12 +02:00
Alexander Kyte 4ba594ad25 [crash] Print native module name when crash privacy disabled (#14986)
This makes it so that disabling crash privacy ensures we get the full native symbols printed regardless of allow and deny lists.

Before: https://gist.github.com/alexanderkyte/2b1f38a880c61ea15aa4c851e44af578

After: https://gist.github.com/alexanderkyte/ce80788a51761d91890d812874fa2da2
2019-06-13 10:07:10 +03:00
Marek Safar ad3150a5c5 Convert PermissionSet NIE to PlatformNotSupportedException (#25114)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-13 08:49:27 +02:00
Alexis Christoforides 167564efc6 Another speculative fix for 'pkg-config' sometimes getting built as a 32-bit package regardless of arch configuration (#14955)
Mono issue: https://github.com/mono/mono/issues/13804

The hypothesis is that at reconfigure using the configure cache file, the lack of explicit setting of the host somehow breaks the build process.
2019-06-13 06:34:03 +03:00
Zoltan Varga f87af4bfef [wasm] Simplify AOT profiling initialization. (#15038)
Current steps:
- Call MONO.mono_wasm_init_aot_profiler (null) before calling MONO.mono_load_runtime_and_bcl ().
- Call WebAssembly.Runtime.StopProfile () from the c# code to stop profiling.
- The profile data will be in Module.aot_profile_data.
2019-06-12 18:07:24 -04:00
Kenneth Pouncey 7eadeb3747 Add DataView test cases to BindingsTestSuite. 2019-06-12 16:40:46 -05:00
Kenneth Pouncey 98092c280b Add a private routine UnBoxValue to fix cast exceptions. 2019-06-12 16:40:46 -05:00
Kenneth Pouncey ce1d92568c [wasm][bindings] Add binding support for DataView 2019-06-12 16:40:46 -05:00
Jo Shields 607bd23f2e Install bc as a Linux prerequisite (#15046)
Our run-step logic uses `bc` to calculate step times, so `bc` is
needed to avoid ugly things on the console like:
```
../scripts/ci/./run-step.sh: line 59: echo: write error: Broken pipe
```
2019-06-12 15:45:22 -04:00
Jo Shields 698aed3946 Increase timeout on --core=only CI to 90 minutes, for ARM's benefit (#15044) 2019-06-12 15:27:00 -04:00
dotnet-maestro cf87874290 Update dependencies from https://github.com/dotnet/arcade build 20190611.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19311.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19311.2
2019-06-12 19:00:44 +02:00
Stephen Toub 6a2f0d94d1 Add missing TraceOperationCreation log event in GetStateMachineBox (#25097)
This was removed accidentally as part of overhauling the async infrastructure in 2.1. VS depends on it for some task tracking logic.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-12 18:59:56 +02:00
monojenkins 4471332fd9 Bump API snapshot submodule 2019-06-12 18:57:17 +02:00
Zoltan Varga 918d7b0aaa [corlib] Add missing Unsafe.Unbox () method.
Fixes https://github.com/mono/mono/issues/14871.
2019-06-12 18:57:17 +02:00
Egor Bogatov 3a0191194b [netcore] Enable CoreFX tests on CI for Linux (#15015)
* Enable CoreFX tests on CI for Linux

* implement NativeLibrary.Unix.cs

* add missing libc

* add few -nonamespace

* more flaky tests
2019-06-12 18:55:44 +02:00
Larry Ewing bd7cb7e4d4 Enable the compiler server by default 2019-06-12 10:58:25 -05:00
Marek Safar 225890a180 [System.Private.CoreLib] Clean up few not implemented exceptions 2019-06-12 15:35:29 +02:00
Zoltan Varga a9949782d6 [runtime] Fix gshared support for BeginInvoke ()/EndInvoke () wrappers. (#14985)
Fixes https://github.com/mono/mono/issues/14972.
2019-06-12 09:18:14 -04:00
Vlad Brezae 9c265ace06 [jit] Fix interface cast (#14978)
* [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-12 15:42:46 +03:00
Marius Ungureanu 669629330f Plug leak of ppdb_filename
mono_image_open_metadata_only and its callees all dupe the filename string, so free the string after mono_image_open_metadata_only is done with it:

```
      1 (128 bytes) ROOT LEAK: 0x7fb07f086c80 [128]  length: 105  "/Users/therzok/Work/md/md-addins/external-addins/MonoDevelop.MonoDroid/build/Xamarin.Installer.Common.pdb"
```
2019-06-12 14:22:24 +02:00
Maxim Lipnin 578b91eb07 Fix some warning related to nullability of reference types 2019-06-12 14:20:09 +02:00
Aleksey Kliger cd8b760220 [runtime] Switch to GC Unsafe for all GC external API functions
Fixes https://github.com/mono/mono/issues/14975
2019-06-12 14:11:01 +02:00
Martin Baulig a44db72a1c [System.Net.Http]: Add hack to the legacy HttpClient to pass down Timeout property. #12577. (#14970)
* [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-12 09:42:20 +02:00
Koundinya Veluri 2c7c7398bb Track timer count and add Timer.ActiveCount (dotnet/coreclr#25061)
* Track timer count and add Timer.Count

Part of https://github.com/dotnet/corefx/issues/38422

* Use lock to prevent tearing

* Add assert

* Rename Count to ActiveCount

* Fix build

Signed-off-by: dotnet-bot <[email protected]>
2019-06-12 09:41:15 +02:00
Egor Bogatov 56398813ae [netcore] Run CoreFX tests on CI (macOS) (#14849) 2019-06-12 09:40:15 +02:00
Zoltan Varga dd0f7eb2e1 [corlib] Preserve System.RuntimeType. 2019-06-12 08:50:06 +02:00
Aleksey Kliger bf61c7c973 [.github] Update CODEOWNERS 2019-06-12 08:46:16 +02:00
Zoltan Varga bcd14601c2 [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:05 +02:00
Stephen Toub d2e9be7d08 Update IEquatable/IComparable<T> for nullability (dotnet/coreclr#25053)
We need to revise our use of nullable for `IComparable<T>` and `IEquatable<T>`:
- For reference types that implement `IComparable<T>`, the implementation should use `IComparable<T?>`, e.g. `String : IComparable<String?>`, so that the type can be used in methods with a `where T : IComparable<T>` constraint: `IComparable<T>`'s contravariance then allows both `T` and `T?` to work as generic type arguments.
- For reference types that implement `IEquatable<T>`, we can't take advantage of such contravariance, as by design `IEquatable<T>` is invariant (it would be a breaking change to make it contravariant, and even if it wasn't doing so is of questionable design given that equality and inheritance don't mix well).  Given the current language design, we have little option but to explicitly make any reference type implementations of `IEquatable<T>` be oblivious, and also make all `where T : IEquatable<T>` constraints be oblivious.  Otherwise, regardless nullable annotations, a developer will get a warning for using either or both of `T`/`T?` with any given method employing such a constraint.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-11 20:10:51 +02:00
Acid Chicken (硫酸鶏) c31180acc5 Fix Japan's new era fallback isn't reflected in Mono (#14896)
* 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-11 19:16:56 +02:00
Maryam Ariyan 9c542c174d Make Debug.Print(string) behavior consistent with .NET Framework (#25036)
*     Debug.Print should call Debug.WriteLine
    - to behave similar to .NET Framework

* temporarily disable tests
- Waiting for coreclr/fx changes to propagate

Signed-off-by: dotnet-bot <[email protected]>
2019-06-11 18:56:15 +02:00
Zoltan Varga 23ab664623 Revert some changes which don't have proper dependencies. 2019-06-11 11:51:10 -05:00
Zoltan Varga 1f289c9e44 Add a rule to create /aot-in. 2019-06-11 11:51:10 -05:00
Zoltan Varga 16c1682494 Make the creation of the dummy assemblies deterministic. 2019-06-11 11:51:10 -05:00
Zoltan Varga 23573b5348 [wasm] Avoid rebuilding the wasm files for the aot images if the aot image hasn't changed. 2019-06-11 11:51:10 -05:00
Zoltan Varga 0af5b236f9 [wasm] Make the cross compiler emit a depfile, not used yet. 2019-06-11 11:51:10 -05:00
Zoltan Varga 6b5779a956 [wasm] Fix dependencies for mscorlib. 2019-06-11 11:51:10 -05:00
Zoltan Varga d010cf5048 [aot] Avoid recompiling the dedup image if it hadn't changed. 2019-06-11 11:51:10 -05:00
Zoltan Varga d22e537c4e [wasm] Make the linker output deterministic. Avoid AOTing mscorlib if it havent' changed. 2019-06-11 11:51:10 -05:00
Zoltan Varga 8326c11779 [wasm] Compile the dedup image to wasm as well. Fix the dependencies of the dedup image. Fix a typo. 2019-06-11 11:51:10 -05:00
Alexander Kyte e4d3752684 [llvm] Fix disabling direct calls and inlining (#14880)
* [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 12:30:04 -04:00
dotnet-maestro 22887567e1 Update dependencies from https://github.com/dotnet/arcade build 20190610.24
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19310.24
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19310.24
2019-06-11 17:17:07 +02:00
Aleksey Kliger (λgeek) 5440491ae8 [install] Include .exe extension when symlinking the mono binary (#14958)
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 09:42:24 -04:00
Johan Lorensson 3a193b7ae5 Merge pull request #14811 from lateralusX/lateralusX/fix-lmf-with-ctx-windows-msvc
Fix interpreter failure in install_eh_callback.exe under Windows x64 MSVC.
2019-06-11 13:22:18 +02:00
Jay Krell c398e19d35 Remove JIT icall hashing by address. (#14870)
* Work toward removing JIT icall hashing by address.

* Remove JIT icall hashing by address.

* Cleanup amd64 emit_call use.

* Move MonoJumpInfoTarget to among types, not functions.
If mini.h includes mini-runtime.h, then can move it nearer MonoJumpInfo.
Or if returned by out parameter (pointer) instead of struct by value.
Or pair of out parameters instead of struct.

* Closer to historical semantics, at least to avoid assertion failure, will try to refine in a later PR.

* Remove new comments about partial barriers, I think the comments are wrong and the code is correct (except that lock/unlock probably need to be full barriers, if they are not.)

* PR: Don't worry about size of MonoCallInst.jit_icall_id. Let it be 32 or 64 bits instead of 9.
2019-06-11 07:40:39 +03:00
dotnet-maestro 3dd5240c72 Update dependencies from https://github.com/dotnet/arcade build 20190609.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19309.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19309.1
2019-06-10 17:34:18 +02:00
dotnet-maestro 3ec86e017f Update dependencies from https://github.com/dotnet/arcade build 20190608.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19308.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19308.1
2019-06-10 13:36:50 +02:00
Marek Safar 7f2d519b0d [System.Private.CoreLib] Update public APIs 2019-06-09 13:01:50 +02:00
Zoltan Varga 23a928826c [wasm] Prototype for collecting aot profile data. (#14865)
* [runtime] Add some options to the aot profiler:
- write-at-method=<METHOD> Write the data when <METHOD> is compiled.
- send-to-method=<METHOD> Call <METHOD> with the collected data.

* [wasm] Fix profiler support in the packager.

* [wasm] Add prototype for generating aot profile data.

* Fix indentation.
2019-06-08 23:16:18 -04:00
dotnet-maestro bcf03bc442 Update dependencies from https://github.com/dotnet/arcade build 20190607.62
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19307.62
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19307.62
2019-06-08 22:51:37 +02:00
dotnet-maestro 4469cdaffc Update dependencies from https://github.com/dotnet/arcade build 20190606.12
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19306.12
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19306.12
2019-06-08 22:51:37 +02:00
Michal Strehovský b2768ac469 Move Marshal class to S.P.CoreLib (dotnet/corert#7502)
After this change, CoreRT only uses S.P.Interop to host the interop hashtable readers. Those can't move to CoreLib because they call into the type loader.

I didn't touch ProjectN's version of Marshal and I left the `PInvokeMarshal` class in place to help with that. I guess we'll need to make a call at some point on what to do with S.P.Interop since without MCG the code in it is kind of useless.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-08 22:50:24 +02:00
Jay Krell 440764a82e g_new/g_new0 in wasm/driver.c (#14890) 2019-06-08 13:38:20 -04:00
Jay Krell 63f17d2f55 Cleanup amd64 emit_call / emit_call_body -- last parameter always FALSE. (#14897)
And it is reasonable to expect that to remain the case, as C compilers
do not generate code as would occur with the last parameter = TRUE.

They allocate the room for their maximum outgoing parameters at function entry,
and keep a constant stack, except for functions that call _alloca,
and this code risks but not necessarily breaks ABI compliance.

In particular, the rsp adjustment either needs unwind codes, or needs
to only occur in a function with a frame pointer other than RSP.

And the uwind codes for adding to RSP are very tricky to impossible.
Normally you only ever subtract from RSP. There is an unwind code for that.
But there isn't really for add.
You might be able to simulate it with chained unwind, making these
regions look kinda like end of function.
But this is all most unlikely.
2019-06-08 13:38:00 -04:00
monojenkins 609878dcb5 [bcl] Update BCL Linked Size 2019-06-08 09:35:38 +02:00
Steve MacLean 11761ebd7f Fix AppDomain issues (dotnet/coreclr#25019)
Populate AppDomain.CurrentDomain when invoking events
Make AppDomain method implemented in AssemblyLoadContext internal

Signed-off-by: dotnet-bot <[email protected]>
2019-06-08 09:34:45 +02:00
Carlos Sanchez Lopez 132969ee3e Fix issue in NamedPipeServerStream.GetImpersonationUserName() (#37676)
Fix for issue where NamedPipeServerStream.GetImpersonationUserName() throws unexpected InvalidationOperationException("The operation completed successfully") when impersonation is not allowed, when in fact it should simply return an empty string.

The fix will call GetNamedPipeHandleStateW once. If it fails, it will try to load sspicli.dll if it was not loaded, and will reattempt the call to GetNamedPipeHandleStateW.

This fix is only for Win32: UAP does not allow calling LoadLibraryEx, and Windows Nano says denies access to GetNamedPipeHandleStateW even after attempting to load sspicli.dll.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-08 08:52:42 +02:00
Zoltan Varga 16532397c3 [wasm] Switch to the LLVM wasm backend. (#14734)
* [wasm] Switch to the llvm wasm backend.

* [wasm] Packager changes for the wasm backend.

* -s EMULATED_FUNCTION_POINTERS=1 no longer needed.
* Run wasm-strip on the final binary.
* Run opt during AOT.
* Disable the dynamic build for now, it doesn't seem to work with the wasm backend.

* [wasm] Use STACK_MAX instead of STACK_BASE for the bottom limit of the stack.

* [aot] Handle llvmopts= in llvmonly mode as well.

* [wasm] Disable an assertion which is no longer true with the wasm backend.

* [wasm] Disable computed gotos in the interpreter, the wasm backend doesn't support it.

Fix llvm target layout so its compatible with clang compiled code.

* [wasm] Pass llvm-path to the cross compiler.

* [wasm] Fix some problems with the dynamic build, still doesn't work. Fix packaging.

* [wasm] Pass -s DISABLE_EXCEPTION_CATCHING=0 to the runtime build, otherwise catch clauses are not generated in llvm-runtime.cpp.

* [aot] Allow llvmopts= argument multiple times.

* Bump emscripten version to 1.38.34.

* [wasm] Add https://github.com/emscripten-core/emscripten/pull/8457 as a patch.

* [wasm] Compile the aot .bc files to .o in a separate step using emcc, this will help with incremental compilation later.

* [wasm] Source emsdk_set_env.sh instead of emsdk_env.sh the latter calls emsdk construct_env to construct emsdk_set_env.sh which is racy.
2019-06-08 00:46:56 -04:00
Jerome Laban f5cfc67c8e [Wasm] Fix memory override in mono_wasm_add_assembly 2019-06-07 22:00:31 -05:00
Jeremy Kuhne 4102c7fd90 Fix redist
Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 23:17:51 +02:00
Santiago Fernandez Madero 355d611e94 Address nullable feedback for System.Runtime and System.Runtime.Extensions (#25017)
* Address last nullable feedback from System.Runtime

* Address nullable feedback for System.Runtime.Extensions

* PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 23:17:51 +02:00
Stephen Toub 3f1bca5a34 Add [NotNull] to syncLock parameter of EnsureInitialized (#25012)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 23:17:51 +02:00
Sung Yoon Whang cf93ce4fce Add DisplayUnits property to DiagnosticCounter (dotnet/coreclr#24981)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 23:17:51 +02:00
Ankit Jain 46108fd7de Bump msbuild to track xplat-master (#14814)
Picks up changes in msbuild after:
	[mono] Update SDKs to track cli branch `release/2.1.8xx`

(https://github.com/mono/msbuild/pull/110)
2019-06-07 21:54:03 +02:00
Alexander Kyte d54a6544b3 [crash] Move /proc/self/maps crash collection to created JSON blob (#14704)
* [runtime] Don't print /proc/self/maps on Android

* [runtime] Add proc mapping to crash JSON output

* [runtime] Zero initialize locals in threading macros

* [crash] Filter out illegal characters from process_maps

* [crash] Prevent concurrent reads from /proc/self/maps

* [crash] Clean up memset in g_async_safe_fgets

* [crash] Remove stack staging array in async_safe_fgets

* Revert "[crash] Prevent concurrent reads from /proc/self/maps"

This reverts commit f65166559ad24ad65c530f7abbc096e4d4634878.
2019-06-07 15:18:57 -04:00
Calvin Buckley 18e0ebfe89 AIX/PASE integration improvements (#14652)
* Allow using SysV-style sonames on AIX/PASE

This uses a far saner naming convention with libtool, and is
consistent with the official PASE RPM repository. However, some
loader changes are required to make it "just work" and workaround
some real dumb behaviour on AIX's part.

Note that while Mono works when built without the different soname
tweak, it won't when installed, because the convention is strange
and the libtool .la archives won't be installed. It's recommended
as such that installation of Mono keeps the libtool files or just
uses SVR4 sonames like the rest of the world, even if they're made
strange like AIX.

* Specify a specific version of unixODBC, make an include

A workaround against PASE RPMs of unixODBC not including the just
"libodbc.so" except in the development version. If a platform needs
a specific version (the macOS reference not changed in the DllMap)
then it can be specified in the configure script.

AIX doesn't need a special name because both AIX Toolbox and Perzl
include non-archive libraries in /opt/freeware/lib - unexpected.

* Don't try to use shm_open on PASE due to it not being implemented

All this will do is cause a coredump if running the script on PASE,
and write an entry to the SLIC diagnostic logs. This test could be
re-enabled if i 7.4 supports it properly.

* fix ODBC include

* Check for what library to use for libintl when dlopenning on AIX

These checks are for the benefit of the DllMap. The construct used
is kinda hacky, IMHO, but it resolves the concerns of hardcoding.
In the event that this doesn't work (it does for me), it falls back
to what the IBM RPMs seem to use for linking gettext et al.

Not sure of the utility for other platforms, since they usually
use sane soname conventions and the one-liner here depends heavily
on an AIX developer tool and its output format.

The use of cut/awk should work with the stock AIX utils, no GNU
necessarily needed.
2019-06-07 20:02:43 +02:00
Martin Baulig 96125c693c Bump CoreFX to pickup https://github.com/mono/corefx/pull/298. (#14851) 2019-06-07 13:14:21 -04:00
Martin Baulig ac908dd334 Implement RSACertificateExtensions.CopyWithPrivateKey(). #14152. (#14860)
* 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`).

* Do the same thing in HttpListener.
2019-06-07 13:13:48 -04:00
Aleksey Kliger (λgeek) 277bbdaada [runtime] Make cross-appdomain wrappers throw NIE for methods with ref struct args (#14863)
* [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:06:32 +02:00
Ryan Lucia 65608fe3f4 Remove exclusions for resolved issue 2019-06-07 09:31:43 +02:00
Tanner Gooding e0471729b0 Marking Vector128<T>.Count and Vector256<T>.Count as [Intrinsic] (#24991)
* Marking Vector128<T>.Count and Vector256<T>.Count as [Intrinsic]

* Fixing NI_Vector128_Count and NI_Vector256_Count to use clsHnd when getting the simdSize and baseType

* Applying the formatting patch.

* Changing some comments to just be "vector element count".

* Fixing impBaseIntrinsic to set the baseType so Vector128_Count and Vector256_Count don't return nullptr

Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 07:10:14 +02:00
Zoltan Varga bd1ad0089f Switch Hashtables to Dictionary in the encoding classes so Hashtable can be linked out. (#14774) 2019-06-06 23:03:22 -04:00
Bernhard Urban 03c6855d05 [ios] switch cross32/crosswatch to be executed on x86_64 and use newer LLVM (#14852)
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:00 +02:00
Ryan Lucia a5a26a2f92 Add logic to object array typecheck to handle arrays of unmanaged pointers (#14733)
Fixes #14555 

The NULL check alone is not enough, because interfaces are also parented to NULL for some reason, and so I've moved `class_kind` out from the bitfield section to make it accessible from IR. The beginning of the struct is going to be padded to 32 bits anyway at the least, so this move should save space if anything.

Our type checking overall is not very robust, and in particular the supertype comparison doesn't work well for anything that isn't an object, so it's possible there are some other weird corner cases. As far as I can tell looking through the array of objects stuff though, we should have reasonable coverage with the existing tests + the stuff I added.
2019-06-06 15:38:57 -04:00
Ryan Lucia 6d2c77fb33 Switch supported runtimes storage from an array to a list (#14777)
Fixes #12141 

Switched to a list because in theory any number of tags can be present. Old behavior was to put them into an array of size 3 and zero the byte following them, which was causing the crash with more than two tags. There's no null check for the default runtime because that should never happen, and the list is reversed to preserve the order from the XML. Changing the signature of `get_runtimes_from_exe` should be fine because it's static and only called in the one place.
2019-06-06 15:02:57 -04:00
Jan Kotas 4d5807110f Delete unnecessary security transparency attributes (dotnet/coreclr#25007)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 20:57:11 +02:00
Bernhard Urban 812357ec51 [mach] cast objc_msgSend{,Super} usages (#14836)
Fixes #14792
2019-06-06 20:14:59 +02:00
Martin Baulig 88c05a8910 Bump CoreFX to pickup https://github.com/mono/corefx/pull/298. 2019-06-06 13:45:29 -04:00
Bernhard Urban e8367ce3d7 [llvm] emit call to mini_llvmonly_throw_nullref_exception without exceptions in mind (#14840)
Fixes https://github.com/mono/mono/issues/14243
2019-06-06 19:24:20 +02:00
Alexander Kyte 364a8423e3 [runtime] Gracefully skip AOTing problematic assemblies (#14232) 2019-06-06 12:07:31 -04:00
Egor Bogatov b861cacd48 [netcore] Improve netcore/build.sh script (#14835)
* Improve netcore/build.sh

* bump corefx tests version

* ignore StringTests failures

* Ignore more tests for xtestall

* Implement Environment.TickCount64

* cleanup

* Add two debug-* rules
2019-06-06 17:43:57 +02:00
dotnet-maestro 636e06334f Update dependencies from https://github.com/dotnet/arcade build 20190605.13
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19305.13
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19305.13
2019-06-06 17:28:03 +02:00
Thays Grazia 2da7707373 [Mono.Debugger.Soft] Properly close connections
This PR fixes #7377
2019-06-06 11:12:47 -03:00
dotnet-maestro 2e4b6b34ac Update dependencies from https://github.com/dotnet/arcade build 20190604.23
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19304.23
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19304.23
2019-06-06 13:47:26 +02:00
dotnet-maestro f02d09f7f6 Update dependencies from https://github.com/dotnet/arcade build 20190604.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19304.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19304.1
2019-06-06 13:47:26 +02:00
Martin Baulig 3998dc01c9 Make CalendarData more linker friendly.
See https://github.com/mono/corefx/pull/298 for a description of the
technique that we're using here to make it more linker friendly.
2019-06-06 13:40:53 +02:00
Alexander Köplinger 51202617a1 [sdks] Use 7z format for the android/ios/mac archives (#14837)
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:24:56 +02:00
Santiago Fernandez Madero 504a1a30fa More PR Feedback
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:32:52 +02:00
Santiago Fernandez Madero 420a9da24a PR Feedback
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:32:52 +02:00
Santiago Fernandez Madero eab7775571 PR Feedback
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:32:52 +02:00
Santiago Fernandez Madero c2796feb97 Fix some nullable annotations from API Review
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:32:52 +02:00
Santiago Fernandez Madero a8fd49434f Remove stale Task async extension methods from TaskExtensions (#24958)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:07:27 +02:00
Santiago Fernandez Madero 992eacfac9 Remove Collection<T> range APIs (dotnet/coreclr#24938)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:07:27 +02:00
Jay Krell 515234a128 [thread] Print function name when asserting MonoThreadInfo is non-NULL (#13814)
https://github.com/mono/mono/issues/13813.
2019-06-06 10:40:39 +03:00
monojenkins bf78c04740 [bcl] Update BCL Linked Size 2019-06-06 09:31:40 +02:00
Kenneth Pouncey 0562fde077 [wasm][bcl] Use zlib for DeflateStream on WASM profile (#14308)
* [wasm][bcl] Use zlib for DeflateStream on WASM profile

- Add `-s USE-ZLIB=1` flag for the emscripten build of `mono.js`
- Add new `zlib-helper` module build that is included in the `mono` wasm build.
- This adds roughly 300 kb to the size.

* Add zlib calls to `icall` for `WASM` profile

* Address comments use `TARGET_WASM` instead of `HOST_WASM`

* Hack around JS exception: RuntimeError: indirect call signature mismatch

- Instead of using the function pointer from DeflateStream (Marshal.GetFunctionPointerForDelegate) obtain the callback functions from the object itself.

* Update error messages and add exception parameter to `mono_runtime_invoke`.

* Add `mono/support` zlib include sources files to make `package` target.

* Add `zlib-helper` build to packager.

- Note: Right now only supports zlib build from mono tree build.
- Add `zlibtest.cs` scenario to compress and uncompress using DeflateStream and GZip.
- Add test to make file to build and run aot version of ziplibtest.

* Add copy of zlib header support files to `package-wasm-runtime`

- The support library is not built for wasm but the zlib include files are needed to build support during wasm build.
- See mono.js build and the use of the `-s USE_ZLIB=1` flag.
- The include files will be used in packager.exe to build zlib support for wasm.

* Use the zlib includes from support to build the zlib support.

* Setup base tests for testing System.IO.Compression integration

* Formatting

* Add more ziparchive tests

* Formatting and indentation

* Add more Zip tests

* Add more tests.

- Add more tests for ZipArchive.
- Add tests for Deflate - small, large and very large strings.
- Add tests for GZipStream - small, large and very large strings.

* Fix merge of EMCC_FLAGS

* Add new option to packager to enable the use of zlib

-   --enable-zlib (enable the use of zlib for System.IO.Compression support)
        type: bool  default: false

- update packager doc

* Address review comments

- Change `enable-zlib` to `zlib`
2019-06-06 05:07:56 +02:00
Martin Baulig 2b3a23c511 Bump CoreFX to pickup the fix for #14214. (#14821)
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-05 22:14:14 -04:00
Egor Bogatov 181a602ace Fix build on macOS 10.15 Catalina + xcode 11 (#14820)
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:39:04 +02:00
Vlad Brezae e548a7d231 [interp] Inline more methods (#14755)
* [interp] Add support for inlining methods with locals

For each local in the inlined method we allocate a new local in the parent method.

* [interp] Enable inlining of methods using ldarga opcode

* [interp] Don't inline methods that do localloc

Inlining localloc in a loop leads to stack overflows. JIT has same behavior.
2019-06-05 22:05:30 +02:00
Alexander Köplinger a83f700546 [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 21:14:53 +02:00
Egor Bogatov c5ed9bfc0d Reflect recent NS2.1 changes (#14679)
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
2019-06-05 20:44:46 +02:00
Jerome Laban f7042d48a5 Enforce C++ exception support for the release-dynamic configuration 2019-06-05 11:19:21 -05:00
imhameed 993d484285 [jit] Treat ternary operations as non-constant during constant evaluation and propagation (#14782)
* Treat ternary operations as non-constant... (#13873)

...during constant evaluation and propagation.

* Move ternary SSA cfold test from basic.cs to objects.cs.
2019-06-05 17:42:18 +02:00
Brendan Zagaeski 888a8d44f6 [arm64] Correct exception filter stack frame size (#14757)
* [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

Additional background information
=================================

The original lucky, "good" behavior worked as follows 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 just 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/

* reduce frame size
2019-06-05 17:38:06 +02:00
lateralusX ae84befc0f Fix interpreter failure in install_eh_callback.exe under Windows MSVC.
INTERP_PUSH_LMF_WITH_CTX_BODY is not fully supported under Windows MSVC
since that compiler doesn't support taking address from a label, needed
by current implementation to correctly resume after unwinding exceptions
happening in native frames as tested by install_eh_callback.exe.

This fix add support to restore to a known location and use a flag
indicating if we have been resumed to the location or just passing by
for the first time. If we resume it will transfer control to specified label.
This will mimic the behavior of taking the address of a label and use that
address as the restore point and works like how setjmp/longjmp work.

I also considered switching to setjmp/longjmp but that would have had a bigger
impact on all platforms and needed changes into the resume context
machinery as well.

While doing the implementation I also found an interesting issue with
MONO_CONTEXT_GET_CURRENT under Windows x64. On most other platforms it is
implemented as inline assembler, but on MSVC x64 inline assembler is not
supported so it is implemented as a function. Problem with that is how IP
was resolved, since it won't be resolved to the last instruction in the
expanded macro, but to the IP within the mono_context_get_current. This has
not had any visible effects in the past since it will just do the ret and get
back to the call site, but when this was used in INTERP_PUSH_LMF_WITH_CTX_BODY
it caused some issues. This was fixed to make sure rsp and rip reflect location
in caller frame and not within mono_context_get_current, similar to how
it works on all platforms with inline assembler support.
2019-06-05 17:32:02 +02:00
Kenneth Pouncey 7a74dd65ff [wasm][sdk] Clean the managed directory files on /t:Clean build target (#14756)
* Clean the `managed` directory files on `/t:Clean` build target

* Modify the `CleanManaged` target to `_CleanManagedOutputDir`.

- Address comments by Mikayla.
2019-06-05 15:53:35 +02:00
Bijan Tabatabai a3de0304a1 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-06-05 13:08:59 +02:00
Johan Lorensson 644bfc93d4 Merge pull request #14760 from lateralusX/lateralusX/increase-windows-main-thread-stack-size
Increase main thread stack size on Windows.
2019-06-05 12:26:50 +02:00
Egor Bogatov d3101fbaeb [netcore] Download and use local .NET Core SDK (#14696)
* Download and use local .NET Core SDK

* depend on 'all' rule in nupkg

* fix build error

* Windows support

* use InitializeToolset function

* ouput full path of dotnet in init-tools.sh

* remove init-tools

* Add init-tools.ps1 (Windows)

* fix / issue on cygwin

* address Jo's feedback

* add powershell to PATH for make nupkg

* add netcore/build.sh

* handle pack and test commands

* Update tools.ps1

* Update tools.ps1
2019-06-05 11:52:00 +02:00
Youssef1313 9e5c2c1e52 Being consistent (dotnet/coreclr#24927)
Being consistent using all if statement with curly braces.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Adam Sitnik 9fb74fb894 follow the ICU User Guide recommendation to optimize the perf of InvariantCultureIgnoreCase on Linux (#24889)
* follow the ICU User Guide recommendation to optimize the perf of InvariantCultureIgnoreCase on Linux:

1. try to guess the max size and call ucol_getSortKey just once
2. if the buffer is not big enough, call the method again providing the actual sort key length

* handle 0 case

* handle integer overflow

* shorten the time the buffers are pinned

* use the cheapest pinning

* code review fixes: don't use variable length stackalloc, don't copy text from docs (licensing) + don't try to go with the fast path when it would require allocating more managed memory for big strings

* simplify the condition

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Stephen Toub 5e1dd8d78d Remove unnecessary Shared<T> class from Task (dotnet/coreclr#24931)
It's just StrongBox<T>.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Stephen Toub b4aa38f0c2 Adjust several where T : class? constraints (dotnet/coreclr#24894)
* Adjust several `where T : class?` constraints

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Michal Strehovsky 76526cf1c9 Work around ProjectN compiler bug
[tfs-changeset: 1738641]

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Aleksey Kliger be92baf12d [runtime] Autoconf check for pthread_mutexattr_setprotocol
Android doesn't always declare that function.
2019-06-05 09:55:34 +02:00
Johan Lorensson a76fc055cf Merge pull request #14694 from lateralusX/lateralusX/fix-llvm-build-path-msvc
Fix LLVM build break on Windows MSVC.
2019-06-04 11:16:49 +02:00
lateralusX 29a2383333 Increase main thread stack size on Windows.
On Windows default thread stack size has been 1MB for a long time
(both 32/64-bit). When starting to use interpreter some of the tests
include deep recursions that will hit stackoverflow on Windows
(ackermann.exe as one example). This commit adjust the default reserved
stack size to 8MB for debug builds and 1.5MB (same as coreclr), for main
thread only. All other threads will still default to 1MB stack size
(both debug/release).
2019-06-04 09:37:39 +02:00
Tanner Gooding 4b81fcbcd7 Removing the TestAllOnes, TestAllZeros, and TestMixOnesZeros methods from the Sse41 class (#24886)
* Removing the TestAllOnes, TestAllZeros, and TestMixOnesZeros methods from the Sse41 class

* Removing JIT support for the SSE41_TestAllOnes, SSE41_TestAllZeros, and SSE41_TestMixOnesZeros intrinsics

* Removing tests for the Sse41.TestAllOnes, Sse41.TestAllZeros, and Sse41.TestMixOnesZeros methods

Signed-off-by: dotnet-bot <[email protected]>
2019-06-04 09:20:29 +02:00
Rich Lander 697c1402ea Update license to match directory 2019-06-04 09:06:40 +02:00
Rich Lander f0ef7aa4df Update license to match directory 2019-06-04 09:06:40 +02:00
Johan Lorensson 0fa59f11ea Merge pull request #14766 from lateralusX/lateralusX/fix-win-32-createprocess-error
Change in process_complete_path exposed uninitialized variable error.
2019-06-04 08:49:02 +02:00
monojenkins deb0227a78 Bump roslyn to release 3.1.0 (#14778) 2019-06-03 22:41:42 +02:00
Alexander Köplinger 098de8b1ee [ci] Remove spaces in pipeline-netcore-runtime.yml
According to docs "names must contain only basic Latin alphabet letters (A-Z, a-z), numbers, and underscores (_)"
2019-06-03 19:56:37 +02:00
lateralusX 85bdaee7a5 Change in process_complete_path exposed uninitialized variable error.
https://github.com/mono/mono/commit/5d088cf0de7f3e50e3547dba361af4401e938dd4
exposed a problem with an uninitialized variable, only exposed on some
build configurations, 32-bit Windows release builds.
2019-06-03 16:04:32 +02:00
dotnet-maestro 369777b246 Update dependencies from https://github.com/dotnet/arcade build 20190602.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19302.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19302.2
2019-06-03 15:26:33 +02:00
monojenkins 283261cd1c [csproj] Update project files 2019-06-03 14:36:00 +02:00
Marek Safar eb99fdeb1a Update API 2019-06-03 14:36:00 +02:00
Marek Safar c84dc2ec55 [Mono.Profiler.Log] Add profiled data reader APIs 2019-06-03 14:36:00 +02:00
Katelyn Gadd 888c8b4621 Basic CI test coverage verifying that we can compile msbuild (#14242)
This adds a basic CI pass that attempts to compile the latest revision of msbuild and verifies that it produced an MSBuild.dll.
2019-06-03 12:03:36 +02:00
Rich Lander cab30bcecc Update TPN with Mono entry (#14744)
* Update TPN with Mono entry

* Update THIRD-PARTY-NOTICES.TXT

Add additional notice for Mono

* Update THIRD-PARTY-NOTICES.TXT

Update the Novell MIT-specific license

* Update THIRD-PARTY-NOTICES.TXT

Group various patterns of Mono license together
2019-06-03 09:05:18 +02:00
Jay Krell 018940f1bc Remove W32_UPDATE_LAST_ERROR_RESTORE_POINT that is not used and does not make sense to me, as to when it would be useful, having preserved LastError around many code paths through the years. 2019-06-03 09:04:16 +02:00
Jay Krell c5a628e86f Do not change Win32 lasterror in the first MONO_EXIT_GC_SAFE. 2019-06-03 09:04:16 +02:00
Aleksey Kliger a7578081e1 [sdks] Bump Android NDK, build tools and platform tools versions
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 09:02:07 +02:00
Rich Lander 7c6efec792 Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/new/master/mcs/class/System.Data/Test
2019-06-03 08:57:09 +02:00
Rich Lander 474f20c5ea Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/tree/61559965a188d03456d6f7840a0cdabdf35c2400/mcs/tools/sqlsharp
2019-06-03 08:56:48 +02:00
Marek Safar 33136e3601 Merge pull request #14754 from Dotnet-GitSync-Bot/mirror-merge-10213317
Mirror changes from mono/coreclr
2019-06-03 08:47:04 +02:00
dotnet-maestro 0cab992234 Update dependencies from https://github.com/dotnet/arcade build 20190601.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19301.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19301.2
2019-06-03 08:45:59 +02:00
Dan Moseley 0e1b88b8ed Improve fatal err msg (dotnet/coreclr#24390)
* Improve fatal err msg

* Match SO format

* a

* Remove dead define

* More adjustments to ex msg

* And PAL

* Remove special case for SOE

* Remove excess Debug.Assert newline

* Remove excess newline

* typo

* New format

* Remove DebugProvider redundancy

* Adjustments

* Remove preceding newline

* Make other SOE and OOM consistent

* Tidy up assertion msg

* Fix missing newline after inner exception divider

* CR when no inner exception

* ToString never CR terminated

* disable corefx tests temporarily

Signed-off-by: dotnet-bot <[email protected]>
2019-06-02 13:57:10 +00:00
Rich Lander e27cda23e0 Update THIRD-PARTY-NOTICES.TXT
Add usage link
2019-06-01 20:41:40 +02:00
Rich Lander 015560df3d Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/0f9bb15622b649db81974057f66669674ea47923/mcs/class/I18N/tools/cvt.sh
2019-06-01 20:41:40 +02:00
Rich Lander 72dfea91df Update THIRD-PARTY-NOTICES.TXT
Add entry for https://github.com/mono/mono/blob/a34c9c79c07156797499b6ed2ce43c5897263b57/mono/benchmark/logic.cs
2019-06-01 20:40:57 +02:00
dotnet-maestro 860cb934ec Update dependencies from https://github.com/dotnet/arcade build 20190531.5
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19281.5
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19281.5
2019-06-01 20:40:09 +02:00
Zoltan Varga 7e0585fa35 [wasm] Add document with wasm feature requests. 2019-06-01 10:42:46 -05:00
Zoltan Varga b0d2edff27 [arm64] Set a llvm target layout. Assert in llvm if the target layout is not set, the defaults used by 'opt' are not correct. (#14714)
* [arm64] Set a llvm target layout. Assert in llvm if the target layout is not set, the defaults used by 'opt' are not correct.

* Add a llvm target layout for amd64.
2019-06-01 01:33:57 -04:00
Stephen Toub 7294bbc140 Fix FileStream.FlushAsync() to behave like Flush() (dotnet/coreclr#24902)
Flush() behaves like Flush(false) and writes out any buffered data but doesn't P/Invoke to FlushFileBuffers/FSync to flush the OS buffers.

But whereas FlushAsync() is supposed to just be an async equivalent of Flush(), it's actually behaving like Flush(true).  This makes FlushAsync() inconsistent and much more expensive.  (This is separate from FlushAsync not actually being async, which is an impactful problem to be solved separately.)

This changes FlushAsync to behave like Flush()/Flush(false) rather than Flush(true).  If someone wants the FlushFileBuffers/FSync behavior, they can call Flush(true).

Signed-off-by: dotnet-bot <[email protected]>
2019-06-01 07:11:46 +02:00
Alexis Christoforides 7300066faa [MacSDK] Properly handle PATHs with spaces during package post-install (#14735) 2019-05-31 20:49:10 -07:00
Kenneth Pouncey df402845f2 [wasm][bindings] Add support for marshaling DateTime and DateTimeOffset (#14722)
* Add support for marshalling DateTime and DateTimeOffset

* Add type checking to Runtime.GetDateValue

- Update to use clr ToUnixTimeMillisecons and FromUnixTimeMilliseonds to replace manual calculations.
- Moved magic numbers to managed side to address comments left by Katelyn and Jay.
2019-06-01 05:11:59 +02:00
Ryan Lucia 43aeac9e1e Propagate error in mono_file_map_error on posix (#14710) 2019-05-31 17:19:32 -04:00
Ryan Lucia 5d088cf0de [coop] Add GC safe transitions around blocking OS API calls (#14612)
If this was not possible due to them being called during runtime initialization, a short comment was left noting the specific reason why.

Fixes #14377

This includes a couple other random fixes I noticed on the way, most notably replacing SEE_MASK_FLAG_DDEWAIT with SEE_MASK_FLAG_NOASYNC as the former is deprecated.
2019-05-31 14:39:22 -04:00
Jo Shields 0f4ac3f13e Bump version to 6.5.0 (#14728) 2019-05-31 12:59:57 -04:00
Aleksey Kliger 8004791be8 [metadata] Mark mono_type_is_generic_parameter as a MONO_API
Used by the MONO_CLASS_IS_INTERFACE macro.

Fixes https://github.com/mono/mono/issues/14005
2019-05-31 12:07:58 +02:00
Vlad Brezae caa4a753ca [marshal] Fix race between delegate marshaling and finalization
When passing a delegate to native code, we pass the delegate_trampoline which can be used to invoke the delegate from native code and we store this mapping (delegate_trampoline->delegate) in a hashtable so we can get a delegate for the delegate_trampoline, when marshalling the opposite way. If we are trying to marshal a ftnptr (for managed code) to a delegate and we don't find this mapping we can crash. This could happen if the finalization for some other delegate that uses the same ftnptr removes this entry from the table. We solve this by never freeing these entries. The first delegate-ftnptr pair will always be alive. This is easier, faster and potentially uses less memory than tracking in the hashtable every pair. There should be a small and limited set of methods marshalled to native.

Fixes https://github.com/mono/mono/issues/13231
2019-05-31 12:05:37 +02:00
Katelyn Gadd 8d858b20c5 Add CI test coverage for compiler server (#14145)
* Add a warning to the gensources Makefile so it's not confusing when it fails to compile in non-build profiles

* Add CI test script that verifies the compiler server functions

* Fix bugs

* Add compiler server tag to jenkins script

* Add +x

* Rename compiler server test tag
2019-05-31 12:03:31 +02:00
Steve Pfister d607506055 Merge pull request #14325 from HebaruSan/fix/listviewgroup-forecolor
Fix light on light ListViewGroup headers on dark theme
2019-05-30 22:05:37 -04:00
Ryan Lucia c6eaeeed85 Batch of runtime warning fixes on Darwin (#14713) 2019-05-30 16:35:47 -04:00
Aleksey Kliger 615698f44e [monodroid] Exclude System.IO.Tests.File_Copy_str_str CoreFX testsuite
The test case CopyFileWithData_MemberData with input of size 1024 * 1024 * 10
causes the Xamarin.Android.Bcl_Tests to crash for some reason.  Temporarily
exclude this entire set of tests from running.

Also disable System.IO.Tests.FileInfo_CopyTo_str because it derives from the
above test class.
2019-05-30 19:33:32 +02:00
Stephen Toub eda4361b05 Handle nullable attributes on platforms that lack them
Signed-off-by: dotnet-bot <[email protected]>
2019-05-30 19:25:27 +02:00
Martin Baulig 19358243ed [corlib]: Move sre dependency into their own method in System.RuntimeType. (#14698)
* [corlib]: Move sre dependency into their own method in `System.RuntimeType`.

Move call to `TypeBuilderInstantiation.MakeGenericType` into a new
`System.RuntimeType.MakeTypeBuilderInstantiation` method to allow the
linker to remove it.

Requires linker PR https://github.com/mono/linker/pull/590.

* Bump linker.

* Bump cecil as well.

* Fix the build.

* Really fix the build.

* Bump API snapshot submodule

* [csproj] Update project files
2019-05-30 18:19:55 +02:00
dotnet-maestro b04d31702e Update dependencies from https://github.com/dotnet/arcade build 20190529.5
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19279.5
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19279.5
2019-05-30 18:02:38 +02:00
Jo Shields 4eda5f50eb [netcore] Fix duplicate publishing of metapackage (#14708) 2019-05-30 09:59:33 -04:00
Jay Krell e2d6361771 Remove JIT icall hashing by name and AOT JIT icall hashing. (#14644) 2019-05-30 12:39:55 +02:00
Jo Shields 2a5e8f0c37 [netcore] Add a metapackage for all supported runtimes 2019-05-30 09:21:05 +02:00
Jay Krell 815cb9da1a mono_mempool_alloc0: Don't give up the rest of the chunk (#14671)
when the allocation does not fit, i.e. when it is >= MONO_MEMPOOL_PREFER_INDIVIDUAL_ALLOCATION_SIZE.

Or at least make the code clearer and smaller.

"fixes" https://github.com/mono/mono/issues/14669.
2019-05-29 19:11:46 -04:00
Blightbuster 778fd0e2d3 Fix spelling in wasm sample docs (#14570) 2019-05-30 00:26:12 +02:00
dotnet-maestro a6bb97472c Update dependencies from https://github.com/dotnet/arcade build 20190528.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19278.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19278.1
2019-05-29 23:11:29 +02:00
Marek Safar 30a2eeb982 [System.Private.CoreLib] Reflect shared partition changes 2019-05-29 22:14:22 +02:00
Jan Kotas e920807341 Fix superfluous delegate allocations in Unix WaitSubsystem (#7454)
Fixes #7452

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
Stephen Toub ae89c386b4 Change StreamReader.ReadBufferAsync to return ValueTask<int> (#24810)
It's a private helper that's always directly awaited.  No need to allocate a task each time it's called and data is synchronously available.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
Vladimir Sadov 76dee58018 Using AllocateUninitializedArray in array pool (dotnet/coreclr#24504)
* Just use `new T[]` when elements are not pointer-free

* reduce zeroing out when not necessary.

* use AllocateUninitializedArray in ArrayPool

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
Marek Safar 3285e0519e Move parts of WeakReference to shared partition (dotnet/coreclr#24800)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
Jan Kotas 41522e6fdb Cleanup unnecessary code in exception formatting (dotnet/coreclr#24797)
* Cleanup unnecessary code in exception formatting

* Delete fNeedFileInfo argument for GetStackTrace

Fixes #8694

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
Rich Lander 83a9d92110 Update THIRD-PARTY-NOTICES.TXT 2019-05-29 18:47:07 +02:00
Rich Lander d97a62a14e Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/7a1a832f6577ffb12d4d302d2868a5b1aaa5ec65/packaging/MacSDK/packaging/resources/postinstall#L96
2019-05-29 18:47:07 +02:00
Aleksey Kliger (λgeek) addc474eb0 [ci] Add Android Windows (Release) archive job to the pipeline (#14699) 2019-05-29 17:52:42 +02:00
Alexander Köplinger f46191114b [bcl] Add nunit exclude categories for monotouch/monodroid profiles (#14695)
We didn't set all the categories that the products used in our profiles.

Now that the products can consume the exclude categories from mono we
need to unify the values.

Removed ValueAdd since it's not used anymore and combined MacNotWorking
into NotOnMac.
2019-05-29 16:58:55 +02:00
Alexander Köplinger 4fcbbd8fb7 [System] Fix MultiCastOptionTest on WatchOS
With https://github.com/mono/mono/commit/cf69b4725976e51416bfdff22f3e1834006af00a it started doing DNS lookups for localhost and we don't have sockets on the watch.
2019-05-29 16:44:58 +02:00
lateralusX 0a6b13f83a Fix LLVM build break on Windows MSVC.
https://github.com/mono/mono/pull/14607 broke LLVM build on Windows MSVC.
This is just a quick fix falling back to old behavior on Windows MSVC. Since
all LLVM tools will be available in the same folder as mono runtime binary
there is no specific need to point out other build folders hosting LLVM tooling.
2019-05-29 12:09:59 +02:00
Egor Bogatov 472465d6ba bump roslyn 2019-05-29 10:25:18 +02:00
Rich Lander ea3e3dd114 Update THIRD-PARTY-NOTICES.TXT 2019-05-29 10:20:21 +02:00
Rich Lander 51d58cf80c Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/23e6f6f4b58d72800f4e27fa29a6b58806ff475f/mono/mini/bench.cs#L65
2019-05-29 10:20:21 +02:00
Rich Lander 1cea554b69 Update THIRD-PARTY-NOTICES.TXT 2019-05-29 10:20:01 +02:00
Rich Lander 1b038ee743 Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/tree/master/mcs/class/I18N/CJK/Test
2019-05-29 10:20:01 +02:00
Rich Lander 9cfe096cac Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/29ee4e15806848ff5131c4bdd23ded786f5bc186/mono/benchmark/zipmark.cs
2019-05-29 10:19:41 +02:00
Marek Safar 088cbe3b04 [System.Private.CoreLib] Remove unused members and further cleanups 2019-05-29 09:44:58 +02:00
Marek Safar c03cc8361f [System.Private.CoreLib] Reflect shared partition changes 2019-05-29 09:43:57 +02:00
Marco Rossignoli 3d7a409154 Expose Path.TrimEndingDirectorySeparator (dotnet/coreclr#20805)
* expose TrimEndingDirectorySeparator

* address PR feedback

* updates

* address PR feedback

* fix comment

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 09:43:57 +02:00
Egor Bogatov 9a11bd94a3 Move some CustomAttribute related types to shared (dotnet/coreclr#23651)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 09:43:57 +02:00
Vlad Brezae 04f4db7b87 [interp] Make --interp= not override last set execution mode (#14683)
It makes sense to pass --interp (--interp=-inline) while having another execution mode previously set up (like --full-aot-interp).

Cleanup code a little bit by killing mono_enable_interp which doesn't do much.
2019-05-29 10:02:23 +03:00
Katelyn Gadd add2a211b3 Infrastructure support / fixes for making compiler server the default (#14279)
* Fix enabling the compiler server using autogen, and force it off if mcs is being used

* autogen updates

* Formatting fixes

* Fix vbcs getting turned on if unspecified even if mcs was selected

* Dynamically evaluate ENABLE_COMPILER_SERVER each time we compile instead of evaluating it once at some arbitrary point during makefile evaluation

* More detailed comment based on testing

* Handle the /shared option in genproj so it doesn't fail

* Raise basic profile check requirement to 6.2 and hopefully assert that named pipes work

* Default compiler server to off for now.
2019-05-28 23:54:44 -07:00
Alexander Köplinger edd6c013b0 [sdks] Only package android-sources on macOS
rsync might not be installed on other platforms and we only need android-sources in one sdks archive.
2019-05-29 00:30:22 +02:00
Alexander Köplinger a2f66ddca1 [sdks] Don't package android-sources on Windows
We don't need it there.
2019-05-28 19:50:00 +02:00
Alexander Köplinger 4b1e9da414 [sdks] Add linker sources to android sdks archive (#14686)
(cherry picked from commit c96878fb16)
2019-05-28 18:57:46 +02:00
Alexander Köplinger 07c58ee2ed [bcl] Write newline-separated nunit/xunit excludes file for sdks archive (#14681)
During XI integration we noticed that just using the verbatim commandline
-exclude or -notrait is not ideal since XI uses the nunit/xunit APIs to
pass that information and not the command line parser.

Instead we now write the exclude categories/traits as a newline-separated file.
2019-05-28 18:49:26 +02:00
Stephen Toub a67c6a2b52 Add and apply nullable attributes (dotnet/coreclr#24679)
* Add and apply nullable attributes

* Adapt to API review decisions

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-28 18:14:19 +02:00
Vlad Brezae 5cbe938847 [interp] Share more wrappers for different interp in signatures (#14596)
[interp] Share more wrappers for different interp in signatures

The passed arguments are already considered to be gpointer in interp_entry and the real value is obtained using stackval_from_data. For types that are passed by value in a register the wrappers will be identical and we can share them.

This commit reduces the size used by interp_in wrappers (in fullaot-interp) by half. These wrappers still take a fair amount of size, which comes mainly from signatures including value types, which aren't shared.
2019-05-28 11:46:49 -04:00
Alexander Köplinger 20fcb62cbc Bump corefx to fix monodroid profile build on Windows 2019-05-28 15:35:17 +02:00
Aleksey Kliger (λgeek) 83f17b4cf9 [sdks] Build static binaries for Android SDK and LLVM with MXE (#14283)
We used to use the static MXE toolchain, but after switching to Homebrew, we
have to explicitly pass flags to build binaries that don't depend on the
MinGW32 GCC support libraries (libstdc++-6.dll, libwinpthread-1.dll and others)
when building the LLVM and Mono binaries.

The simplest approach is just to pass CMAKE_EXE_LINKER_FLAGS=-static to cmake
and LDFLAGS=-all-static to libtool.  The rest of the changes are just to make
it easier to do that by adding a configure flag and updating the SDKs
infrastructure.

We will also need an LLVM bump to actually build a new llvm archive with the
new build flags; until then, building Mono will provision an old build of LLVM
with the old build flags that still depends on libstdc++-6.dll.

---

An alternative approach instead of passing -all-static and -static would be to
probe for the assorted -static-libXYZ flags to GCC at configure time.  (For the
LLVM build we would need to hardcode them as that build doesn't go through
autoconf).  Right now Mono doesn't have any other DLL dependencies (other than
the core windows DLLs), so -all-static works just as well and is simpler.
2019-05-28 08:56:51 -04:00
Sebastien Pouliot 9fb44af2fe [mscorlib] Ensure monotouch[_runtime] API are identical (#14665)
* [mscorlib] Ensure monotouch[_runtime] API are identical

Ensure the API surface for `mscorlib.Core.dll` is identical between the
`monotouch` and `monotouch_runtime` (used for REPL and the interpreter).

This ensure code compiled against one will be fine when building against
the other (e.g. avoiding linker errors).

In practice this means:

1. Expose the API needed for `System.Reflection.Emit` in XI

	- throwing `PlatformNotSupportedException` **by default**; or
	- calling the mono runtime when the interpreter is enabled;

2. Do not expose additional, not supported, API (e.g. COM related)

	- `monotouch_runtime` configuration was built without `FULL_AOT_RUNTIME`
	  and that brings some other stuff that is not AOT related

Follow up to #14606

Existing diff

Removed methods:

```csharp
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access);
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, System.Collections.Generic.IEnumerable<Reflection.Emit.CustomAttributeBuilder> assemblyAttributes);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.Policy.Evidence evidence);
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir);
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, System.Collections.Generic.IEnumerable<Reflection.Emit.CustomAttributeBuilder> assemblyAttributes, Security.SecurityContextSource securityContextSource);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, bool isSynchronized, System.Collections.Generic.IEnumerable<Reflection.Emit.CustomAttributeBuilder> assemblyAttributes);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions, bool isSynchronized);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions, bool isSynchronized, System.Collections.Generic.IEnumerable<Reflection.Emit.CustomAttributeBuilder> assemblyAttributes);
```

Removed methods:

```csharp
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.Policy.Evidence evidence);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions, bool isSynchronized);
```

Added constructor:

```csharp
public AssemblyBuilder ();
```

Removed properties:

```csharp
public override string CodeBase { get; }
public override System.Reflection.MethodInfo EntryPoint { get; }
public override string EscapedCodeBase { get; }
public override System.Security.Policy.Evidence Evidence { get; }
public override string FullName { get; }
public override bool GlobalAssemblyCache { get; }
public override string ImageRuntimeVersion { get; }
public override bool IsDynamic { get; }
public override string Location { get; }
public override System.Reflection.Module ManifestModule { get; }
public override bool ReflectionOnly { get; }
```

Removed methods:

```csharp
public void AddResourceFile (string name, string fileName);
public void AddResourceFile (string name, string fileName, System.Reflection.ResourceAttributes attribute);
public ModuleBuilder DefineDynamicModule (string name, bool emitSymbolInfo);
public ModuleBuilder DefineDynamicModule (string name, string fileName);
public ModuleBuilder DefineDynamicModule (string name, string fileName, bool emitSymbolInfo);
public System.Resources.IResourceWriter DefineResource (string name, string description, string fileName);
public System.Resources.IResourceWriter DefineResource (string name, string description, string fileName, System.Reflection.ResourceAttributes attribute);
public void DefineUnmanagedResource (byte[] resource);
public void DefineUnmanagedResource (string resourceFileName);
public void DefineVersionInfoResource ();
public void DefineVersionInfoResource (string product, string productVersion, string company, string copyright, string trademark);
public override bool Equals (object obj);
public override object[] GetCustomAttributes (bool inherit);
public override object[] GetCustomAttributes (System.Type attributeType, bool inherit);
public override System.Type[] GetExportedTypes ();
public override System.IO.FileStream GetFile (string name);
public override System.IO.FileStream[] GetFiles (bool getResourceModules);
public override int GetHashCode ();
public override System.Reflection.Module[] GetLoadedModules (bool getResourceModules);
public override System.Reflection.ManifestResourceInfo GetManifestResourceInfo (string resourceName);
public override string[] GetManifestResourceNames ();
public override System.IO.Stream GetManifestResourceStream (string name);
public override System.IO.Stream GetManifestResourceStream (System.Type type, string name);
public override System.Reflection.Module GetModule (string name);
public override System.Reflection.Module[] GetModules (bool getResourceModules);
public override System.Reflection.AssemblyName GetName (bool copiedName);
public override System.Reflection.AssemblyName[] GetReferencedAssemblies ();
public override System.Reflection.Assembly GetSatelliteAssembly (System.Globalization.CultureInfo culture);
public override System.Reflection.Assembly GetSatelliteAssembly (System.Globalization.CultureInfo culture, System.Version version);
public override System.Type GetType (string name, bool throwOnError, bool ignoreCase);
public override bool IsDefined (System.Type attributeType, bool inherit);
public void Save (string assemblyFileName);
public void Save (string assemblyFileName, System.Reflection.PortableExecutableKinds portableExecutableKind, System.Reflection.ImageFileMachine imageFileMachine);
public void SetEntryPoint (System.Reflection.MethodInfo entryMethod, PEFileKinds fileKind);
public override string ToString ();
```

Added constructor:

```csharp
public ConstructorBuilder ();
```

Removed properties:

```csharp
public override System.Reflection.CallingConventions CallingConvention { get; }
public override System.Reflection.Module Module { get; }

[Obsolete]
public System.Type ReturnType { get; }
```

Removed methods:

```csharp
public void AddDeclarativeSecurity (System.Security.Permissions.SecurityAction action, System.Security.PermissionSet pset);
public void SetSymCustomAttribute (string name, byte[] data);
public override string ToString ();
```

Removed property:

```csharp
public override System.Reflection.Module Module { get; }
```

Added property:

```csharp
public override System.Reflection.MethodImplAttributes MethodImplementationFlags { get; }
```

Removed methods:

```csharp
public override System.Delegate CreateDelegate (System.Type delegateType);
public override System.Delegate CreateDelegate (System.Type delegateType, object target);
public override string ToString ();
```

Added properties:

```csharp
public override bool IsByRefLike { get; }
public override bool IsSZArray { get; }
public override bool IsVariableBoundArray { get; }
```

Removed method:

```csharp
public override bool IsAssignableFrom (System.Reflection.TypeInfo typeInfo);
```

Added constructor:

```csharp
public EventBuilder ();
```

Removed properties:

```csharp
public override int MetadataToken { get; }
public override System.Reflection.Module Module { get; }
```

Removed method:

```csharp
[Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
public void SetMarshal (UnmanagedMarshal unmanagedMarshal);
```

Added properties:

```csharp
public override bool IsByRefLike { get; }
public override bool IsConstructedGenericType { get; }
public override bool IsSZArray { get; }
public override bool IsTypeDefinition { get; }
public override bool IsVariableBoundArray { get; }
```

Removed methods:

```csharp
public override System.Type[] GetGenericParameterConstraints ();
public override bool IsAssignableFrom (System.Reflection.TypeInfo typeInfo);
public override bool IsInstanceOfType (object o);
```

Modified properties:

```diff
-public virtual int ILOffset { get; }
+public int ILOffset { get; }
```

Removed method:

```csharp
public virtual void MarkSequencePoint (System.Diagnostics.SymbolStore.ISymbolDocumentWriter document, int startLine, int startColumn, int endLine, int endColumn);
```

Added property:

```csharp
public override bool IsConstructedGenericMethod { get; }
```

Removed methods:

```csharp
public void AddDeclarativeSecurity (System.Security.Permissions.SecurityAction action, System.Security.PermissionSet pset);

[Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
public void SetMarshal (UnmanagedMarshal unmanagedMarshal);
public void SetSymCustomAttribute (string name, byte[] data);
```

Removed properties:

```csharp
public override int MetadataToken { get; }
public override System.Guid ModuleVersionId { get; }
public override string ScopeName { get; }
```

Removed methods:

```csharp
public System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocument (string url, System.Guid language, System.Guid languageVendor, System.Guid documentType);
public void DefineManifestResource (string name, System.IO.Stream stream, System.Reflection.ResourceAttributes attribute);
public System.Resources.IResourceWriter DefineResource (string name, string description);
public System.Resources.IResourceWriter DefineResource (string name, string description, System.Reflection.ResourceAttributes attribute);
public void DefineUnmanagedResource (byte[] resource);
public void DefineUnmanagedResource (string resourceFileName);
public override object[] GetCustomAttributes (bool inherit);
public override object[] GetCustomAttributes (System.Type attributeType, bool inherit);
public override System.Reflection.FieldInfo GetField (string name, System.Reflection.BindingFlags bindingAttr);
public override System.Reflection.FieldInfo[] GetFields (System.Reflection.BindingFlags bindingFlags);
protected override System.Reflection.MethodInfo GetMethodImpl (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers);
public override System.Reflection.MethodInfo[] GetMethods (System.Reflection.BindingFlags bindingFlags);
public System.Diagnostics.SymbolStore.ISymbolWriter GetSymWriter ();
public override System.Type GetType (string className);
public override System.Type GetType (string className, bool ignoreCase);
public override System.Type GetType (string className, bool throwOnError, bool ignoreCase);
public override System.Type[] GetTypes ();
public override bool IsDefined (System.Type attributeType, bool inherit);
public override bool IsResource ();
public override System.Reflection.FieldInfo ResolveField (int metadataToken, System.Type[] genericTypeArguments, System.Type[] genericMethodArguments);
public override System.Reflection.MemberInfo ResolveMember (int metadataToken, System.Type[] genericTypeArguments, System.Type[] genericMethodArguments);
public override System.Reflection.MethodBase ResolveMethod (int metadataToken, System.Type[] genericTypeArguments, System.Type[] genericMethodArguments);
public override byte[] ResolveSignature (int metadataToken);
public override string ResolveString (int metadataToken);
public override System.Type ResolveType (int metadataToken, System.Type[] genericTypeArguments, System.Type[] genericMethodArguments);
public void SetSymCustomAttribute (string name, byte[] data);
```

Modified properties:

```diff
-public virtual int Attributes { get; }
+public int Attributes { get; }
-public virtual string Name { get; }
+public string Name { get; }
-public virtual int Position { get; }
+public int Position { get; }
```

Removed method:

```csharp
[Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
public virtual void SetMarshal (UnmanagedMarshal unmanagedMarshal);
```

Removed interface:

```csharp
System.Runtime.InteropServices._SignatureHelper
```

Removed methods:

```csharp
public override bool Equals (object obj);
public override int GetHashCode ();
public override string ToString ();
```

Removed property:

```csharp
public override bool ContainsGenericParameters { get; }
```

Added properties:

```csharp
public override bool IsByRefLike { get; }
public override bool IsSZArray { get; }
public override bool IsSecurityCritical { get; }
public override bool IsSecuritySafeCritical { get; }
public override bool IsSecurityTransparent { get; }
public override bool IsVariableBoundArray { get; }
```

Removed methods:

```csharp
public void AddDeclarativeSecurity (System.Security.Permissions.SecurityAction action, System.Security.PermissionSet pset);
public override bool IsAssignableFrom (System.Reflection.TypeInfo typeInfo);
protected override bool IsValueTypeImpl ();
```

Removed methods:

```csharp
public static object GetActiveObject (string progID);
public static IntPtr GetComInterfaceForObjectInContext (object o, System.Type t);
public static int GetComSlotForMethodInfo (System.Reflection.MemberInfo m);
public static int GetEndComSlot (System.Type t);
public static IntPtr GetExceptionPointers ();
public static IntPtr GetIDispatchForObjectInContext (object o);
public static IntPtr GetITypeInfoForType (System.Type t);
public static IntPtr GetIUnknownForObjectInContext (object o);

[Obsolete ("This method has been deprecated")]
public static IntPtr GetManagedThunkForUnmanagedMethodPtr (IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature);
public static System.Reflection.MemberInfo GetMethodInfoForComSlot (System.Type t, int slot, ref ComMemberType memberType);

[Obsolete ("This method has been deprecated")]
public static System.Threading.Thread GetThreadFromFiberCookie (int cookie);
public static System.Type GetTypeForITypeInfo (IntPtr piTypeInfo);

[Obsolete]
public static string GetTypeInfoName (UCOMITypeInfo pTI);
public static System.Guid GetTypeLibGuid (ComTypes.ITypeLib typelib);

[Obsolete]
public static System.Guid GetTypeLibGuid (UCOMITypeLib pTLB);
public static System.Guid GetTypeLibGuidForAssembly (System.Reflection.Assembly asm);
public static int GetTypeLibLcid (ComTypes.ITypeLib typelib);

[Obsolete]
public static int GetTypeLibLcid (UCOMITypeLib pTLB);
public static string GetTypeLibName (ComTypes.ITypeLib typelib);

[Obsolete]
public static string GetTypeLibName (UCOMITypeLib pTLB);
public static void GetTypeLibVersionForAssembly (System.Reflection.Assembly inputAssembly, out int majorVersion, out int minorVersion);

[Obsolete ("This method has been deprecated")]
public static IntPtr GetUnmanagedThunkForManagedMethodPtr (IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature);
public static bool IsTypeVisibleFromCom (System.Type t);
public static int NumParamBytes (System.Reflection.MethodInfo m);

[Obsolete]
public static void ReleaseThreadCache ();
```

* [csproj] Update project files

* Bump API snapshot submodule
2019-05-28 14:39:38 +02:00
Kenneth Pouncey ad03563fb4 [wasm][ci] Enable ChakraCore tests (#14653)
- Chakra 1.11.9 release is now out which fixes https://github.com/microsoft/ChakraCore/issues/6037

Closes https://github.com/mono/mono/issues/13195
2019-05-28 10:29:29 +02:00
Dan Moseley da3e52793a Call derived ToString on inner exceptions (dotnet/coreclr#24793)
* Remove special Appx path and METHOD__EXCEPTION__TO_STRING

* Remove Exception.ToString(bool, bool)

* Remove Exception.InternalToString and callers

* Cache message

Signed-off-by: dotnet-bot <[email protected]>
2019-05-28 09:18:17 +02:00
Alexander Köplinger 7ca8e89ce7 [sdks] Explicitly set version of the mac/ios/watchos/tvos platform SDKs (#14663)
Otherwise the Xcode linker tries to guess the version from the path,
and since we use Xcode101.app it'd use sdk=101 as the version which is wrong.

By explicitly specifying e.g. `$(XCODE_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
as the sysroot it correctly guesses sdk=12.1 instead.

See also https://github.com/xamarin/xamarin-macios/commit/834c0a9fd7062c0c25011721fd7d524b8a60b41e
2019-05-28 01:38:38 +02:00
Johan Lorensson 8d0ad4c816 Reduce stack size used by interpreter frame on Windows MSVC. (#14659)
Reduce stack size used by interpreter frame on Windows MSVC.

Interpreter frame was 1248 bytes in size under Windows MSVC. This was almost double the size of other platforms ~670 bytes. After investigating different constructs in interpreter switch statement in interp_exec_method_full, it turns out that local declared errors couldn't be reused over different case statements and added ~100 bytes each. Switching local declared errors to shared one, reduce the stack size down to ~670 bytes under Windows MSVC.
2019-05-27 17:55:52 -04:00
Jay Krell 07c5ecdf7b Introduce g_static_assert. (#14651)
ifdef __cplusplus
define g_static_assert(x) static_assert (x, "")
else
define g_static_assert(x) g_assert (x)
endif

It is, granted, C++11, not C++98, and some C variations.
2019-05-27 15:33:46 -04:00
Jay Krell 15eb9f7ba1 warning: 'emit_load' defined but not used [-Wunused-function] (#14646)
Rename emit_load_general to emit_load
2019-05-27 20:18:57 +02:00
Calvin Buckley 19e0a80ad1 Bump CoreFX and make necessary changes (#14660)
I myself am bumping for ODBC fixes. This includes a change to SslProtocols to include the Tls13 entry required by the CoreFX changes. (It doesn't wire it up to anything, including BTLS.)

* Fix CollectionTest.UnusableSyncLockTest test

The test checked whether the SyncRoot is of type object, but the corefx implementation switched to returning `this`.

* Bump API snapshot submodule
2019-05-27 19:30:19 +02:00
Marek Safar 00c43ce6e8 [System.Private.CoreLib] Resolve APIs mismatches 2019-05-27 17:32:26 +02:00
Johan Lorensson 164c257bb9 Merge pull request #14628 from lateralusX/lateralusX/interpreter-windows-x64-mini-regression-support
Fix interpreter mini regression test on Windows x64.
2019-05-27 17:00:06 +02:00
Stephen Toub 0eb9e611d2 Stop nulling out lock object in SemaphoreSlim (dotnet/coreclr#24776)
SemaphoreSlim.Dispose nulls out its lock object, and that's then used as an indication in other methods whether they should throw ObjectDisposedException.  But nulling out an object used for synchronization in other methods is a bad practice, and while SemaphoreSlim.Dispose is not thread-safe to be used concurrently with other usage of the instance, it's still confusing when such usage leads to NullReferenceExceptions due to trying to lock on a null lock object.  This change just changes the lock to be readonly, always set, and then whether the instance has been disposed is just a value set on that object (such that it's no larger than it used to be).

Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Jan Kotas 278e11d840 Fix nulable annotations build break (dotnet/coreclr#24768)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Santiago Fernandez Madero 6ce793487c Fix nullable annotation in String.Join
Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Santiago Fernandez Madero 3837ea0c64 Fix Guid.TryParse nullabel annotation
Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Santiago Fernandez Madero d4eb0c4a9f Fix nullable annotation in Array.SetValue
Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Marek Safar 0f4dd6bc49 Bump roslyn dependency 2019-05-27 15:55:54 +02:00
dotnet-maestro-bot 538ecf31ef Update BuildTools, CoreClr to preview4-04022-01, preview6-27721-71, respectively (master) (#24369)
* Update BuildTools, CoreClr to preview4-04022-01, preview6-27721-71, respectively

* Use `Nullable=enable` rather than `NullableContextOptions=enable`

* Resolving new nullability warnings

* PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 15:55:54 +02:00
Alexander Köplinger 1d4dab41a9 Add missing new files to Makefile.am, fix tarball build (#14656)
They were added in https://github.com/mono/mono/pull/14427
2019-05-27 15:21:26 +02:00
Rich Lander 5f87cb724f Create THIRD-PARTY-NOTICES.TXT
TPN for language files @ https://github.com/mono/mono/new/4fd4f46ca31141774d8dcd3b72d2171d32a49f67/mcs/class/I18N/West/Test
2019-05-27 09:31:14 +02:00
Alexander Köplinger 989ea49239 [System] Fix monotouch_runtime repl assemblies
They were missing some exclude files that caused unnecessary p/invokes to be retained.

Fixes https://github.com/mono/mono/issues/13526
2019-05-27 09:28:00 +02:00
lateralusX 1fc0ed9664 Review feedback. 2019-05-27 09:26:25 +02:00
Conrad Meyer e2a21cbac3 [System.Net.NetworkInformation] Fork FreeBSD from MacOs (#14619)
* [System.Net.NetworkInformation] Fork FreeBSD from MacOs

They are related, but not identical.  In particular, MacOS AF_INET6 is wrong
on FreeBSD and breaks IPv6 networking on FreeBSD.  Establish an inheritence
relationship with overrides for now; it's possible more differences will be
needed in the future.

This change is released under the MIT license.

* [csproj] Update project files
2019-05-27 09:21:07 +02:00
dotnet-maestro a12749adb6 Update dependencies from https://github.com/dotnet/arcade build 20190524.6
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19274.6
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19274.6
2019-05-27 09:18:18 +02:00
dotnet-maestro 3f7f652c76 Update dependencies from https://github.com/dotnet/arcade build 20190523.11
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19273.11
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19273.11
2019-05-27 09:18:18 +02:00
Jay Krell 393d7ef616 Widen MonoJumpInfo union to pointer-sized so mono_add_patch_info can just use target field blindly. (#14642)
just use target field blindly.
2019-05-26 18:30:18 +02:00
Jay Krell 489c40a548 Remove MONO_PATCH_INFO_METHOD_REL. (#14643)
It is not used, and it had a larger than pointer field
where a pointer was required, at least for 32bit hosted cross builds.
2019-05-25 10:30:53 -04:00
Zoltan Varga 7c837f58bc [jit] Also allow System.Runtime.CompilerServices.Unsafe intrinsics from the System.Runtime.CompilerServices assembly, not just corlib. (#14618)
* [jit] Also allow System.Runtime.CompilerServices.Unsafe intrinsics from the System.Runtime.CompilerServices assembly, not just corlib.

* [jit] Fix Unsafe.RefIsAddressLessThan()/RefIsAddressGreaterThan().
2019-05-25 10:30:04 -04:00
Alexander Kyte 9cb89c9ea9 [build] Provide in-tree llvm to mono correctly (#14607) 2019-05-25 01:10:21 -07:00
Ryan Lucia 96b1fd837d [coop] Transition various public APIs into an external/internal form to avoid unnecessary GC-unsafe calls (#14427)
Relevant issue: #14376

There are potentially more functions this can apply to, but this covers the ones listed in the issue and an extra one I found in the process.

Functions were either broken off into an external-only and internal version, or such a pair already existed and the internal version was moved from the source file to a separate `-internals` header, similarly to in 3c74df5667.

This gets slightly complicated with `mono_domain_set` and `mono_domain_set_internal`, both of which are currently public (thanks to 4beada2892) and have different signatures. Additionally, the latter does not actually include the gc-unsafe transition despite being public. 
I've opted to introduce `mono_domain_set_fast` as the 'internal' version of `mono_domain_set`, to add the proper gc-unsafe transition to `mono_domain_set_internal`, and then to migrate internal usage to `mono_domain_set_internal_with_options`. As part of that I've marked `mono_domain_set_internal` as external only, which is unfortunate naming-wise but I believe the best option here without introducing API breakage.
2019-05-24 19:09:00 -04:00
Alexander Kyte ea4ff9ba80 [llvm] Use CoreCLR GC interop configuration (#14598)
[llvm] Use CoreCLR GC interop configuration

Since they're identical right now, we can use the coreclr configuration
to make our IR more easily analyzed by tools built around LLVM.

```
class CoreCLRGC : public GCStrategy {
public:
  CoreCLRGC() {
    UseStatepoints = true;
    // These options are all gc.root specific, we specify them so that the
    // gc.root lowering code doesn't run.
    InitRoots = false;
    NeededSafePoints = 0;
    UsesMetadata = false;
    CustomRoots = false;
  }

  Optional<bool> isGCManagedPointer(const Type *Ty) const override {
    // Method is only valid on pointer typed values.
    const PointerType *PT = cast<PointerType>(Ty);
    // We pick addrspace(1) as our GC managed heap.
    return (1 == PT->getAddressSpace());
  }
};

/// A GCStrategy for the Mono Runtime.
class MonoGC : public GCStrategy {
public:
  MonoGC() {
    UseStatepoints = true;
    // These options are all gc.root specific, we specify them so that the
    // gc.root lowering code doesn't run.
    InitRoots = false;
    NeededSafePoints = 0;
    UsesMetadata = false;
    CustomRoots = false;
  }
};
```

Source: https://github.com/mono/llvm/blob/64c0343537016c153894dc60316bd7b316b812c8/lib/CodeGen/BuiltinGCs.cpp#L105-L137
2019-05-24 16:55:50 -04:00
Jay Krell f93d42dbf5 Cleanup: load_function_full -- avoid a string alloc/copy and cast. (#14625)
Cleanup: load_function_full -- avoid a string alloc/copy and cast.
2019-05-24 16:36:00 -04:00
Ryan Lucia 76c45bc2cb Fix build warning for orig_method (#14603)
Variable is only used here: https://github.com/mono/mono/blob/82a993124888d470d1057eae9546e5be76524dad/mono/mini/mini-trampolines.c#L743
2019-05-24 21:34:23 +02:00
Zoltan Varga 3ff4282abe [llvm] Remove JIT support for older llvm versions. (#14605) 2019-05-24 14:56:01 -04:00
musikhin b1c3216f89 Fix SqliteMembershipProvider initialization bug, issue #14234 (#14479)
On the stage of the initialization of the SqliteMembershipProvider the existed code always produced an error "Failed to map path '/'" in case if the ASP.NET application is placed not at the root path. Detailed step by step description of the problem is provided in the issue description.

The bug was that was implemented the call of the function with wrong parameters list. So the fix was in changing the function call. The same function call is also used in SqlMembershipProvider.cs.

Fixes #14234
2019-05-24 20:44:08 +02:00
Aleksey Kliger (λgeek) 94adfce735 [merp] Don't leak g_getenv return value (#14602)
[merp] Don't leak g_getenv return value

Coverity said:
```
     CID 1445100:  Resource leaks  (RESOURCE_LEAK)
     Failing to save or free storage allocated by "monoeg_g_getenv("MONO_CRASH_NOFILE")" leaks it.
```
2019-05-24 13:55:53 -04:00
Vlad Brezae 3d331568e1 [interp] Fix warning with coverity (#14613)
[interp] Fix warning with coverity
2019-05-24 13:36:10 -04:00
Alexander Kyte fb2233b337 [merp] Add assertions against initing dumper from signal handler (#13851) 2019-05-24 12:17:38 -04:00
lateralusX a895be83f6 Fix interpreter mini regression test on Windows x64.
First set of fixes to get the following tests working under interpreter
on Windows x64:

* mono/mini richeck
* mono/mini mixedcheck
* mono/mini fullaotmixedcheck
* mono/tests winx64structs.exe

Fixes are primarily related to Windows x64 ABI support in interpreter. Fixes
also makes sure our interpreter trampolines get unwind info making it possible
to debug through the trampolines on Windows x64.

Several fixes related to value types was needed, also fixed support for return
value types not fitting into registers, current implementation didn't return
passed in value type address in return register as mandated by both
System V and Win x64 ABI's.

Identified and fixed memory leak on every pinvoke from interpreter that needs stack.
Since Windows x64 ABI always use 32 bytes of stack allocated by caller, the
memory leak was hit on every pinvoke call.
2019-05-24 15:53:02 +02:00
Alexander Köplinger 82a9931248 [sdks] Fix min OSX version of runtime files in Mac SDK (#14615)
It was using an unescaped makefile variable in the template, i.e. ended up empty which meant the build just took the host version as the min version.

Fixed the variable and also moved it to CFLAGS/CXXFLAGS instead of CPPFLAGS to be consistent with ios.mk
2019-05-24 14:10:47 +02:00
Lee Culver ef9d54d151 Throw ObjectDisposedException instead of crashing when Cairo.Context handle == IntPtr.Zero (#14323)
* Throw ObjectDisposedException instead of crashing when Cairo.Context.handle == IntPtr.Zero

We are seeing instances where VS for Mac is crashing with a SIGSEGV when
calling into certain Cairo.Context functions.  Looking at the code, it's clear
that it's possible to have Context.handle == IntPtr.Zero after disposing the
object.

From research, it looks like passing a nullptr to raw cairo functions can
result in a SIGSEGV:
    https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/93807

This change adds check to see if Conext.handle == IntPtr.Zero in Context
painting, font, and path methods.  This will turn uncatchable SIGSEGVs
into ObjectDisposedException.

* Update Context.cs

* Ensure SetTarget results in a valid handle
2019-05-24 12:22:51 +02:00
Rich Lander 8f6a7b34ee Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/435f968102d0820ca65d63e1e741e4130b4d1303/support/ios/net/route.h
2019-05-24 12:08:47 +02:00
Jay Krell 0c7ed830ac [loaded LLVM] Add several missing MONO_LLVM_INTERNAL (#14589)
* [llvm] Remove unused default_mono_llvm_unhandled_exception.
It references mono_gchandle_get_target_internal which is not marked MONO_LLVM_INTERNAL
so attempts to run it will fail.

This is caught by linking wit -z now (https://github.com/mono/mono/pull/14562).

* [loaded LLVM] mono_debug_get_seq_points and mono_class_enum_basetype_internak MONO_LLVM_INTERNAL

* Mark mono_debug_method_lookup_location MONO_LLVM_INTERNAL.
Found by linking with -z now (https://github.com/mono/mono/pull/14562)
which we should probably do for this and other reasons.

* #include mono-compiler.h for MONO_LLVM_INTERNAL.

* [loaded LLVM] Mark mini_is_gsharedvt_variable_signature as MONO_LLVM_INTERNAL.
Found by https://github.com/mono/mono/pull/14562.

* Mark mono_print_ins MONO_LLVM_INTERNAL.

* mono_rgctx_info_type_to_str MONO_LLVM_INTERNAL

* [loaded LLVM] mono_compile_create_var MONO_LLVM_INTERNAL

* ifdef around use of MONO_LLVM_INTERNAL and hope

* remove include mono-compiler.h from public header to internal header

* MONO_API_NO_EXTERN_C mono_debug_method_lookup_location() instead of mono_debug_method_lookup_location() MONO_LLVM_INTERNAL to workaround possible lack of MONO_LLVM_INTERNAL.
2019-05-24 02:58:26 -07:00
Jay Krell 0d22880940 Make function pointers readonly. (#14470) 2019-05-24 02:58:03 -07:00
Santiago Fernandez Madero e1d628c18d Make AppDomain.GetThreadPrincipal() internal (dotnet/coreclr#24747)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-24 10:00:05 +02:00
Jan Kotas f670f46497 Delete FEATURE_TESTHOOK (dotnet/coreclr#24746)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-24 10:00:05 +02:00
David Wrighton 30fb72969e Fewer ilstubs in corelib from reflection apis (dotnet/coreclr#24708)
Rework use of marshalling for RuntimeTypeHandle, RuntimeModule, RuntimeAssembly, and IRuntimeMethodInfo as used by QCalls
- Remove special QCall only used marshallers for RuntimeAssembly, RuntimeModule and IRuntimeMethodInfo
- Following the pattern of ObjectHandleOnStack, implement QCall handle types for RuntimeAssembly/Module/TypeHandle. Use these in all QCalls that once passed the types directly.
- For uses of IRuntimeMethodInfo, follow the existing RuntimeMethodHandleInternal pattern

Also perform some replacement of bool marshalling with use of Interop.BOOL, and a few cases of using pointers instead of byref arguments.

Fix delivers a relatively small win on startup, and small throughput gains around reflection as IL stubs are no longer necessary for many functions in reflection that once needed them.

Reduces methods jitted on powershell startup from 422 to 399, (About 5%) but performance win is only about 5ms on ~400ms as the methods removed are simple.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-24 10:00:05 +02:00
Jan Kotas 50fac54741 Fix CoreRT build breaks
Signed-off-by: dotnet-bot <[email protected]>
2019-05-24 08:33:58 +02:00
Sebastien Pouliot 9ca1619d63 [System.Core] Ensure monotouch[_runtime] API are identical (#14606)
* [System.Core] Ensure monotouch[_runtime] API are identical

Ensure the API surface for `System.Core.dll` is identical between the
`monotouch` and `monotouch_runtime` (used for REPL and the interpreter).

This ensure code compiled against one will be fine when building against
the other (e.g. avoiding linker errors).

Removed methods:

```csharp
public void CompileToMethod (System.Reflection.Emit.MethodBuilder method);
public void CompileToMethod (System.Reflection.Emit.MethodBuilder method, System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator);
```

Removed methods:

```csharp
[Obsolete ("do not use this method")]
public static IRuntimeVariables MergeRuntimeVariables (IRuntimeVariables first, IRuntimeVariables second, int[] indexes);

[Obsolete ("do not use this method")]
public static System.Linq.Expressions.Expression Quote (System.Linq.Expressions.Expression expression, object hoistedLocals, object[] locals);
```

* [csproj] Update project files

* Bump API snapshot submodule
2019-05-24 01:44:24 +02:00
Alexander Köplinger f5f3c6aabe [tests] Add xunit.execution.dotnet.dll to tests directory (#14595)
So it gets included in the sdks archive
2019-05-23 20:17:41 +02:00
Bernhard Urban b564c26cb5 [interp] set correct stack type on op_Implicit/op_Explicit intrinsics for native types (#14575)
[interp] set correct stack type on op_Implicit/op_Explicit intrinsics for native types

Needs some additional conversions which happen to be included by accident previously.

This fixes those warnings on amd64:
```
Test run:
image=/Users/lewurm/work/mono-dim-call/mono/mini/builtin-types.exe
BuiltinTests.test_0_nuint_fieldload: Store local stack type mismatch 0 1
BuiltinTests.test_0_much_casting: Store local stack type mismatch 0 1
Results: total tests: 84, all pass
Elapsed time: 0.026546 secs (0.026546, 0.000000)
```

and those warnings on armv7:
```
Test run: image=/mono/mono/mini/builtin-types.exe
BuiltinTests.test_0_nint_inc: 0011 arith type mismatch add.i4 0 1
BuiltinTests.test_0_nint_dec: 0011 arith type mismatch sub.i4 0 1
BuiltinTests.test_0_nint_implicit_decimal: 0034 arith type mismatch
add.i4 0 1
BuiltinTests.test_0_nuint_inc: 0011 arith type mismatch add.i4 0 1
BuiltinTests.test_0_nuint_dec: 0011 arith type mismatch sub.i4 0 1
BuiltinTests.test_0_nuint_implicit_decimal: 0034 arith type mismatch
add.i4 0 1
Results: total tests: 84, all pass
Elapsed time: 0.039214 secs (0.039214, 0.000000)
```
2019-05-23 12:56:16 -04:00
monojenkins 72eb2ee84a [Android] Fix runtime loading of DSOs for 64-bit processes (#14577)
[Android] Fix runtime loading of DSOs for 64-bit processes

Context: https://github.com/xamarin/xamarin-android/issues/2780

On Android the executable for the application is going to be
`/system/bin/app_process{32,64}` depending on the application's architecture.
However, libraries for the different architectures live in different
subdirectories of `/system`: `lib` for 32-bit apps and `lib64` for 64-bit ones.
Thus appending `/lib` below will fail to load the DSO for a 64-bit app, even if
it exists there, because it will have a different architecture. The quickest fix
is to use `lib64` explicitly for 64-bit Android apps.



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->


Backport of #13281.

/cc @lambdageek @grendello
2019-05-23 10:56:37 -04:00
Bernhard Urban fa3b4812d7 [netcore] add some intrinsics for interpreter (#14547)
[netcore] add some intrinsics for interpreter

```console
$ MONO_ENV_OPTIONS='--interp' make -C netcore xtest-System.Runtime.Tests
Microsoft.DotNet.XUnitConsoleRunner v2.5.0 (64-bit .NET Core 3.0.0-preview5-27620-01)
  Discovering: System.Runtime.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Runtime.Tests (found 5266 of 5402 test cases)
  Starting:    System.Runtime.Tests (parallel test collections = on, max threads = 16)
[...]
  Finished:    System.Runtime.Tests
=== TEST EXECUTION SUMMARY ===
   System.Runtime.Tests  Total: 32485, Errors: 0, Failed: 23, Skipped: 2, Time: 126.432s
```
See failures here: https://gist.github.com/lewurm/c8372b0c7ba6a78cf8b7b7b8c7090820
2019-05-23 10:00:49 -04:00
dotnet-maestro 75de80a482 Update dependencies from https://github.com/dotnet/arcade build 20190522.13
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19272.13
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19272.13
2019-05-23 15:56:23 +02:00
Alexander Köplinger 9606a8f180 [bcl] Remove usages of mono-project.com/go-mono.com/google.com in tests (#14586)
Use example.com and example.org instead.

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

Note that not all of the things I replaced make an actual network request but I thought it'd be nice to be consistent.
2019-05-23 14:12:14 +02:00
Johan Lorensson d96fa3ab31 Merge pull request #14549 from lateralusX/lateralusX/add-coop-config-windows
Add ability to use cooperative suspend in configure step.
2019-05-23 09:21:43 +02:00
Jay Krell 8804dbac27 Fix decoding of WRAPPER_SUBTYPE_ICALL_WRAPPER and WRAPPER_SUBTYPE_INTERP_LMF. (#14546) 2019-05-23 01:43:19 -04:00
Jay Krell 37d6df9d67 Fix warning: (#14529)
aot-compiler.c: In function 'arch_init':
aot-compiler.c:1092:11: warning: unused variable 'has_custom_args' [-Wunused-variable]
  gboolean has_custom_args = !!acfg->aot_opts.llvm_llc;
2019-05-23 01:43:05 -04:00
Stephen Toub e1021fc68b Fix Path.Join argument nullable annotation (dotnet/coreclr#24719)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-23 07:18:33 +02:00
Marek Safar eb936495b3 Commit 29810a78e5b93d8da9fb921d096226d249fc75a5 added unconditional dependency on GetCpuUtilization (#24715)
Update projitems file inclusion

Signed-off-by: dotnet-bot <[email protected]>
2019-05-23 07:18:33 +02:00
Marius UngureanuandMartin Baulig fe74f62140 Plug leak of CustomAttribute initializer name (#14544)
* Plug leak of CustomAttribute initializer name

All the CustomAttribute initializer names (fields, property) except the last were leaked. Ensure all names are freed.

Fixes #14543

* Apply suggestions from code review

Co-Authored-By: Martin Baulig <[email protected]>
2019-05-22 22:59:20 -04:00
Larry Ewing 84bc4bfb8b Merge pull request #14552 from lewurm/interp-dimcall-fix
[interp] add missing enum check on constrained callvirt
2019-05-22 20:30:01 -05:00
Jay Krell ee1868e82f Close two race conditions. (#14510) 2019-05-23 01:47:29 +02:00
Alexander Köplinger 2c76de1ee1 [tests] Add Xunit.NetCore.Extensions.dll to tests directory (#14571)
So it gets included in the sdks archive
2019-05-22 19:48:07 +02:00
Bernhard Urban 574d87ca9f [driver] add --version=number (#14538)
* [driver] add --version-number

Useful for third parties consuming the version number of mono.

* s/--version-number/--version=number/g

* add man page entry
2019-05-22 18:49:38 +02:00
Marek Safar e2cc6fc40d [System.Private.CoreLib] Workaround for broken shared project file exclusion 2019-05-22 16:17:50 +02:00
dotnet-maestro 3ba95bba6a Update dependencies from https://github.com/dotnet/arcade build 20190521.7
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19271.7
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19271.7
2019-05-22 16:02:29 +02:00
Jay Krell 5334e32de9 More information to PowerPC assertion failure. (#14569) 2019-05-22 14:27:40 +02:00
Jay Krell d583190ce7 Add more information to a stackless faulting community line. (#14566) 2019-05-22 13:17:53 +02:00
Jay Krell 74faf39971 [PowerPC] Fix compile error. (#14564) 2019-05-22 13:15:27 +02:00
Marek Safar 6751700b20 [System.Private.Corelib] More nullable types tweaks 2019-05-22 12:47:11 +02:00
Egor Bogatov 64fe6a054c [netcore] Add Microsoft.Private.CoreFx.OOB package to corefx-restore.csproj (#14559)
* Add Microsoft.Private.CoreFx.OOB package

* Add GC.GetTotalAllocatedBytes stub

* Add missing icalls

* Add more tests to ignore

* Update GC.cs

* Add more tests to ignore

* Update Monitor.cs
2019-05-22 12:32:05 +02:00
Egor Bogatov 36193f5378 [netcore] Set System.Private.Corlib AssemblyVersion to 4.0.0.0 (#14556)
* clean up

* cleanup

* bump assembly version
2019-05-22 09:37:17 +02:00
Stephen Toub f5c8b3f7e9 Implement AppDomain.Monitoring*MemorySize (dotnet/coreclr#24610)
* Implement AppDomain.MonitoringTotalAllocatedMemorySize

* Change precise:true back to precise:false in GetTotalAllocatedBytes

Signed-off-by: dotnet-bot <[email protected]>
2019-05-22 09:33:36 +02:00
Mike Marynowski fdc9a1e7cc Modified format logic so that braces are not allowed in custom format specifiers (#23062)
* Modified format logic so that braces are not allowed in custom format specifiers.

* Disabled failing test temporarily and fixed code style issue.

PR needed to pass test: https://github.com/dotnet/corefx/pull/35820

* Slight changes to logic to better align the diff.

* Fixed counting error.

* Fix nullable

* Move exclusion near related test

* Add skip to new issue file

* Delete CoreFX.issues.json

Signed-off-by: dotnet-bot <[email protected]>
2019-05-22 09:33:36 +02:00
Egor Bogatov 7f03824327 [netcore] Fix PointerTests (#14557)
* Fix PointerTests

* Update CoreFX.issues.rsp
2019-05-22 08:24:40 +02:00
Stephen Toub 8ef0c136eb Reduce overhead of SemaphoreSlim.WaitAsync (dotnet/coreclr#24687)
This affects the case where SemaphoreSlim.WaitAsync is invoked, the operation completes asynchronously because there's no count available in the semaphore, and where a timeout and/or a cancellation token is passed to WaitAsync.  In that case, we need to wait for the underlying wait task to complete, for cancellation to be requested, or for the timeout to elapse.

There's currently one code path that handles this.  This change improves that slightly by avoiding a defensive array copy.  However, we can do much better when we get a cancelable token but no timeout, in which case we can avoid operations like Task.Delay, can register with the original cancellation token rather than a new one (which means we avoid forcing a new CancellationTokenSource's lazily-allocated partitions into existence), etc.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-22 08:23:06 +02:00
monojenkins 80963d3a8b [bcl] Update BCL Linked Size 2019-05-22 08:17:59 +02:00
Zoltan Varga e9fbb4210c [jit] Fix signed/unsigned comparisons in JitHelpers.EnumCompareTo () intrinsic. (#14553)
Fixes https://github.com/mono/mono/issues/14551.
2019-05-21 20:17:50 -04:00
Jay Krell f0cf94a5d1 MONO_PATCH_INFO_JIT_ICALL cleanup (#14545)
The most important point of the "temporary" aspect, esp. given
the complete conversion, is renaming MONO_PATCH_INFO_JIT_ICALL to MONO_PATCH_INFO_JIT_ICALL_ID.
Any accidental or merged MONO_PATCH_INFO_JIT_ICALL will fail to compile.
2019-05-21 17:04:02 -04:00
Alexander Kyte eaaf77189d [crash] Don't waitpid() if fork() fails (#14539) 2019-05-21 16:20:30 -04:00
Alexander Kyte 8c4c9a06cd [crash] Handle OOM/blocked allocation during crash dumper (#14540)
* [crash] Remove typo from crash sub-header

* [crash] Use error path that returns nonzero status
2019-05-21 16:20:15 -04:00
Tarek Mahmoud Sayed 107ff9732d Enhance the Missing Resources Exception Message (dotnet/coreclr#24645)
* Enhance the Missing Resources Exception Message

* Address the feedback

* Fix Nullable declaration

Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 18:22:05 +02:00
dotnet-maestro c02c4a8b53 Update dependencies from https://github.com/dotnet/arcade build 20190520.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19270.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19270.2
2019-05-21 17:08:48 +02:00
Bernhard Urban 539e3f8546 [interp] add missing enum check on constrained callvirt
This detail got lost when the code was duplicated here: https://github.com/mono/mono/pull/13154/files#diff-f115ce23fba6528256a47e2b7e8b0a19R1611

Fixes `mono/tests/dim-constrainedcall.il` on the interpreter. This PR will enable it: https://github.com/mono/mono/pull/14166
2019-05-21 16:31:11 +02:00
Jay Krell c1d01670d3 Initial icall-def.h / icall-def-netcore.h split. (#14489)
* Copy icall-def.h to icall-def-core.h.

* Manually preprocess icall-def.h vs. icall-def-core.h.
The only common part in this construction is the JIT icalls at the end.
There much overlap, now duplicated.

* Remove JIT icalls fro icall-def-core.h.

* Merge icall-def-core.h with master.

* Merge icall-def.h with master.

* Rename icall-def-core.h to icall-def-netcore.h.

* Remove more unused icalls
2019-05-21 14:50:09 +02:00
Andrew Arnott 13992b7f50 Avoid boxing in TextWriter.Write(StringBuilder) (dotnet/coreclr#24664)
Fixes #24663 by calling `Write(ReadOnlySpan<char>)` instead of `Write(object)` with a boxed `Memory<char>`.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Santiago Fernandez Madero 0d1ed39f45 Add IsVariableBoundArray to TypeDelegator (dotnet/coreclr#24637)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Tanner Gooding ad9de49bdb Fixing the Dragon4 algorithm to correctly handle when the first significant digit is after the cutoff (#24484)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Tarek Mahmoud Sayed 6986880de5 Ensure using single Utc object in TimeZoneInfo (dotnet/coreclr#24614)
Currently if calling GetSystemTimeZones, will return a list which in include Utc object created from the enumeration.  But when calling FindSystemTimeZoneById("UTC") will return the cached Utc object which is different than the one returned from the enumeration. This in general could be not a problem but it is better to ensure returned the same object from both APIs. The reason is in our internal code, we use some reference equality for the perf reason. Ensure the usage of Utc object will make it more reliable.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Anirudh Agnihotry 07de377517 Correcting documentation for span and memory slice (dotnet/coreclr#24612)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Levi Broderick 335c1206e9 Fix parameter names in ToUtf16 (dotnet/coreclr#24617)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
lateralusX 70b26c9bc3 Add ability to use cooperative suspend in configure step.
Needed in order to setup CI lanes using --enable-cooperative-suspend.
2019-05-21 13:48:29 +02:00
Tarek Mahmoud Sayed 14de5cabbe Fix Handling time patterns with quotes (dotnet/coreclr#24589)
We encountered some cultures have a time patterns with single quotes which we should handle keeping the parts between quotes as fixed text inside the pattern and not treat it as any of the time specifiers

Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 13:47:07 +02:00
monojenkins 98880bd6a5 [csproj] Update project files 2019-05-21 12:33:55 +02:00
Martin Baulig 1eb9161ca6 Removing some remoting and multi-appdomain APIs on wasm and the AOT test profiles.
Build / profile changes:
------------------------

* `build/profiles/testing_aot_common.make`: define `DISABLE_REMOTING = yes` and
  `NO_MULTIPLE_APPDOMAINS = yes`.

* `mcs/class/corlib/Makefile`: check `DISABLE_REMOTING` when setting
  `REFERENCE_SOURCES_FLAGS` (and don't define `FEATURE_REMOTING`, `MONO_COM`
   and `FEATURE_COMINTEROP`).

* added new `testing_aot_common_corlib.dll.exclude.sources`.  Several types in
  the `System.Runtime.Remoting.Messaging` namespace are used by the runtime in
  non-remoting scenarios, so those need to be preserved.
  For all other remoting namespaces, we only need a few stripped down stub versions
  of the some of the types; those have been added to a new `legacy` directory, so
  we can wildcard-exclude all the files here.

* added new `testing_aot_common_corlib.dll.sources`; this currently only contains
  `legacy/*.cs` to list above mentioned stub versions.

* added new `testing_aot_common_corlib_test.dll.exclude.sources` as a common test
  excludes file.

API Changes (conditional to `DISABLE_REMOTING`):
------------------------------------------------

* `mcs/class/corlib/legacy/`: add stub-versions for some of the remoting-related
  classes that are used by the runtime (so we can't completely remove those types):

  - `System.MarshalByRefObject`.
  - `System.Runtime.Remoting.IRemotingTypeInfo`.
  - `System.Runtime.Remoting.ObjectHandle`.
  - `System.Runtime.Remoting.RemotingServices`.
  - `System.Runtime.Remoting.Activation.ActivationServices`.
  - `System.Runtime.Remoting.Contexts.Context`.
  - `System.Runtime.Remoting.Messaging.ILogicalThreadAffinative`.
  - `System.Runtime.Remoting.Messaging.LogicalCallContext`.
  - `System.Runtime.Remoting.Proxies.TransparentProxy`.
  - `System.Runtime.Remoting.Proxies.RealProxy`.

  some of these have fields that need to be preserved; these are marked with
  appropriate `#region` pragmas.

All changes below are conditional to `DISABLE_REMOTING`.

* `System.Runtime.Remoting.Messaging.AsyncResult`: this class is used by some of
  the async code, so we can't completely remove it.  However, we can remove the
  `MonoMethodMessage call_message` field when `DISABLE_REMOTING`.

* `System.Runtime.Remoting.Messaging.MonoMethodMessage`: this class is also used
  by some runtime code and thus needs to be preserved. However, when `DISABLE_REMOTING`
  is defined, then we make some changes to it:
  - remove all iterfaces (`IMethodCallMessage`, `IMethodReturnMessage`, and `IInternalMessage`).
  - `Properties` throws `PlatformNotSupportedException`.

* `System.Runtime.InteropServices.Marshal`: disable some COM-related code.

* `System.Threading.Thread`: remove `CurrentContext` property.

* `System.Threading.ExecutionContext`: adjust conditional logic; don't define
  `FEATURE_REMOTING` if `DISABLE_REMOTING`.

* `System.Activator`: add `DISABLE_REMOTING` to the existing
   `#if FEATURE_REMOTING || MOBILE_LEGACY` conditional in this class.

* `System.AppDomain`: since we only have one domain, `DefaultDomain` will always
   return the root domain; comment out the call to `RemotingServices.GetDomainProxy`
   as well as some internal methods.

* `System.__ComObject`: stub out on `DISABLE_REMOTING` as well as `!FULL_AOT_RUNTIME`.

* `System.Runtime.Serialization.Formatters.Binary.BinaryFormatter`: adjust `IFormatter`
  versus `IRemotingFormatter` interface logic to use the former when `DISABLE_REMOTING`.

* `System.Runtime.Serialization.Formatters.Binary.BinaryObjectReader`: adjust existing
  `#if FEATURE_REMOTING || MOBILE_LEGACY` conditional to add `DISABLE_REMOTING` to it.

* `System.Diagnostics.CorrelationManager`: comment out some `CallContext.LogicalGetData()`
  and `CallContext.LogicalSetData`.

* `System.Diagnostics.TraceEventCache`: likewise.

Test changes:
-------------

* `mono/tests/Makefile.am`: conditionally disable some remoting tests.

* `corlib/Test/System.Runtime.Serialization/SerializationTest.cs`: conditionally
   disable all tests requiring remoting.

* `corlib/Test/System/ActivatorTest.cs`: same; trying to preserve as much as possible
  in this test.

* added some `DISABLE_REMOTING` and `DISABLE_SECURITY` conditionals to some of the tests.
2019-05-21 12:33:55 +02:00
Alexander Köplinger aee4cdd248 Bump gtk-sharp in bockbuild (#14537)
Brings in https://github.com/mono/gtk-sharp/pull/273.
2019-05-21 11:35:40 +02:00
Jay Krell c03814f8dc Replace string/hash-based MONO_PATCH_INFO_JIT_ICALL with enum-based MONO_PATCH_INFO_JIT_ICALL_ID. (#14512)
* Replace string/hash-based MONO_PATCH_INFO_JIT_ICALL with enum-based MONO_PATCH_INFO_JIT_ICALL_ID.

* Reconvert mono-llvm.c after merge with master.
2019-05-21 00:16:36 -04:00
Marius Ungureanu 57a3b24f75 Fix leak in mono_parse_options (#14533)
Fix leak in mono_parse_options

When MONO_ENV_OPTIONS is null, we would leak the array and buffer



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-05-20 18:25:55 -04:00
dotnet-maestro 52171b21a4 Update dependencies from https://github.com/dotnet/arcade build 20190520.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19270.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19270.1
2019-05-20 16:37:31 +02:00
dotnet-maestro 9e8717d885 Update dependencies from https://github.com/dotnet/arcade build 20190518.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19268.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19268.2
2019-05-20 16:37:31 +02:00
Zoltan Varga ccb505b6ec [llvm] Fix patching of calls from LLVM JITted code. (#14520)
* [runtime] Fix mono_icall_get_wrapper_full () to always compile the wrapper even if a trampoline was created previously.

* [jit] Add a mini_patch_llvm_jit_callees () function to patch callsite variables for LLVM JIT.

* [llvm] Patch LLVM JIT callees in trampolines as well. Patching after a method is compiled is not enough, since new callsites can be created after a method has been compiled.

* [llvm] Cleanup calls from JITted code. Compile referenced jit icall wrappers immediately, since the calls will not be patched.

* Add a missing MONO_LLVM_INTERNAL.
2019-05-20 10:22:26 -04:00
Bernhard Urban c2118341c6 [arm] one more attempt to fix slotsize issue on llvmonly (#14444)
* [arm] one more attempt to fix slotsize issue on llvmonly

Regression of https://github.com/mono/mono/pull/12992 & https://github.com/mono/mono/pull/14362

In the end, the actual fix boils down to:
```patch
--- a/mono/mini/mini-arm.c
+++ b/mono/mini/mini-arm.c
@@ -2374,7 +2374,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
                                lainfo->nslots = ALIGN_TO (ainfo->struct_size, 8) / 8;
                                lainfo->esize = 8;
                        } else {
-                               lainfo->nslots = ainfo->struct_size / sizeof (target_mgreg_t);
+                               lainfo->nslots = ALIGN_TO (ainfo->struct_size, sizeof (target_mgreg_t)) / sizeof (target_mgreg_t);
                                lainfo->esize = 4;
                        }
                        break;
```

Tested on `xamarin-macios/arm64_32-v3` branch:
* mscorlib
* mini
* dont link
* monotouch tests
* and a modified version of https://github.com/mono/mono/issues/8486#issuecomment-414365860 (added larger structs too)

with each device, Watch Series 3 (`armv7k`) and Watch Series 4 (`arm64_32`).

I hope that is the last iteration on this.

* remove arm64_32_abi
2019-05-20 03:09:35 -07:00
Jay Krell 1ecffe9554 Work toward JIT icall hash removal. (#14508)
i.e. when CEE_MONO_JIT_ICALL_ADDR takes enum instead of func.
2019-05-19 14:15:07 -07:00
dotnet-maestro d667baf94b Update dependencies from https://github.com/dotnet/arcade build 20190517.7
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19267.7
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19267.7
2019-05-18 22:18:21 -07:00
Egor Bogatov 616e06225a [netcore] Merge all *.rsp files into CoreFX.issues.rsp (#14513)
* merge rsp files into CoreFX.issues.rsp

* Update CoreFX.issues.rsp

* Update CoreFX.issues.rsp

* clean up

* Update CoreFX.issues.rsp

* download OS specific tests

* Update Makefile

* Add comments for build-local-corefx-test-% rule
2019-05-18 22:15:31 -07:00
Egor Bogatov bd7ec72362 [netcore] Fix Math.ILogB corner cases (#14500)
* Fix ILogb corner cases

* remove redundant tabs

* Add RSP for S.R.Extensions

* remove autotools magic

* add more comments
2019-05-18 20:59:38 -07:00
Egor Bogatov 29938ada1f [netcore] Respect attributes defined on parameters in Delegates (#14468)
* Respect attributes defined on Delegates

* remove 'var's

* Unwrap System.Reflection.Tests.PointerTests.*
2019-05-18 20:58:20 -07:00
Jay Krell 7601045796 Make mono_jit_icall_info MONO_LLVM_INTERNAL. (#14525) 2019-05-18 20:38:46 -07:00
Jay Krell 24c0f17b1c Add missing dependency on $(srcdir)/genmdesc.py. (#14515) 2019-05-18 14:18:46 -07:00
Larry Ewing 73baf1b291 Merge pull request #14490 from vargaz/bump-emsdk
[wasm] Bump emscripten to 1.38.31.
2019-05-18 13:31:55 -07:00
Bernhard Urban 45a1c98df8 [interp] disable inlining for built-in types (#14501)
[interp] disable inlining for built-in types

Fixes https://github.com/mono/mono/issues/14246
2019-05-18 14:45:57 -04:00
Jay Krell 3142f7d54d Reduce JIT icall hash use. (#14507)
* Reduce JIT icall hash use.

* PR: Rename mono_jit_icall_info_at to mono_find_jit_icall_info.

* Use enum instead of int, and update comment to reality (the assert is arguably leniently off by one.)

* Cast integer to enum for C++.

* More int vs. enum, and use two variables, and const.

* Undo a little fishing for CI failure.
2019-05-18 07:05:57 -07:00
Larry Ewing 63b16ae32f Merge pull request #14488 from jeromelaban/dev/jela/wasm-dlopen
[Wasm] Expand support for dynamic linking
2019-05-17 13:11:31 -07:00
Zoltan Varga 1972a3a95d [wasm] Emit more precise signatures for icalls. (#14494)
[wasm] Emit more precise signatures for icalls.
2019-05-17 13:46:01 -04:00
Johan Lorensson 42bc7daeb8 Merge pull request #14498 from lateralusX/lateralusX/fix-llvm-build-error
Fix Windows Mono LLVM build error on nightly master build.
2019-05-17 09:26:37 -07:00
Jo Shields 6a81662247 [netcore] Fixes for Arcade on private mirror (#14509)
* [netcore] Use bash explicitly for Arcade things

* [netcore] Work around https://github.com/dotnet/cli/issues/10014

* [netcore] Try forcing powershell Arcade on Windows
2019-05-16 22:31:23 -07:00
Zoltan Varga ab90b1f15b [wasm] Avoid sharing C icall functions between icalls, in wasm to avoid calling them with incorrect signatures. (#14493) 2019-05-17 00:53:55 -04:00
Alexander Köplinger 24275c9717 Add missing DARC files 2019-05-16 17:50:36 -07:00
Jo Shields 2b35b6bab4 [netcore] Build/upload Windows runtime nupkg (#14506)
* [netcore] Switch build properties from /p: to -p: due to MSYS2/dotnet bug

* [netcore] Switch from nuget pack to dotnet pack

* [netcore] Add Windows x64 build
2019-05-16 17:36:31 -07:00
Alexander Köplinger 871e6f5846 Manual DARC update from build '20190516.4' 2019-05-16 17:03:15 -07:00
Alexander Köplinger 6d404e4ede [netcore] Update dotnet feed url 2019-05-16 16:05:47 -07:00
Jérôme Laban 527abcd115 Update the driver to support MONO_TYPE_I
Add tests to validate boxing/unboxing
2019-05-16 13:54:12 -04:00
Alexis Christoforides 7082845114 [monodroid] Introduce 'win32 host' BCL build (#14424)
* [monodroid] Introduce 'win32 host' BCL build

* [sdks] Add _bcl_$(1)_BUILD_FLAGS variable to BclTemplate build step

Allows Android SDK on Windows to pass PROFILE_PLATFORM=win32

* [sdks] Pass _bcl_$(1)_BUILD_FLAGS when building the tests, too

* Copy test source exclusion files from the general monodroid profile

Apparently we don't fall back to the general exclusion sources for tests if the platorm-specific exclusion file does not exist.

* Also add win32 copies of the nunit exclude files:

files=$(find . -name "monodroid*_test*exclude.sources")
for file in $files
do
    name=$(basename $file)
    pushd $(dirname $file)
    cp $name win32_$name
    git add win32_$name
    popd
done

* [csproj] Update project files
2019-05-16 09:23:13 -07:00
Jérôme Laban 230f593eb6 Add missing extra exported method to allow Module.addFunction 2019-05-16 10:49:43 -04:00
Jay Krell da6cb6c685 Work towards removing JIT icall hashing. (#14474)
* Work towards removing JIT icall hashing.

* PR: Use enums instead of pointers.

* Fix int/enum mismatch.
2019-05-16 10:12:34 -04:00
Levi Broderick 88944be25c Make Label and OpCode readonly and IEquatable (dotnet/coreclr#24360)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-16 00:20:25 -07:00
lateralusX 142d1a9ca0 Fix Windows Mono LLVM build error on nightly master build. 2019-05-16 02:47:57 +02:00
Zoltan Varga 6a38d99535 [wasm] Bump emscripten to 1.38.31. 2019-05-15 16:46:05 -07:00
Filip Navara ad698c9878 [netcore] Exclude some unused icalls (#14475)
* [netcore] Exclude unused native locale icalls

* Fix builds with mono_feature_disable_sockets, currently not enabled by configure script

* [netcore] Don't compile in System.IO icall in netcore profile
2019-05-15 18:29:01 -04:00
Jérôme Laban 7a1e382925 Adjust spaces 2019-05-15 15:49:09 -04:00
Jérôme Laban 52557848ba Force import all libraries in dynamic mode, addFunction support 2019-05-15 15:03:37 -04:00
Jérôme Laban a1db6e83ed [Wasm] Add binding support for IntPtr 2019-05-15 15:03:37 -04:00
Jay Krell ebd0cdad5e Make genmdesc output better typed and more readable. (#14477)
* Make genmdesc output better typed and more readable -- almost hand-maintainable
but no clear route to actually hand-maintainable.

* Replace != with < and undo debug code.
2019-05-15 13:16:25 -04:00
Jérôme Laban 4d023b6bf8 [Wasm] Force libstdcxx to be included in the main module in release-dynamic 2019-05-14 22:28:34 -04:00
Jay Krell 495a93305b Add two asserts to mono_emit_jit_icall. (#14459) 2019-05-13 23:22:26 -07:00
Tanner Gooding f34d562641 Fixing S.P.Corelib to not double include files and ensure that S.N.V is marked #nullable enable (#24526)
* Changing EnableDefaultCompileItems=false to EnableDefaultItems=false

* Taking the VS auto-fixes for the solution and corelib csproj

* Removing the duplicated T4 file includes in the main csproj

* Regenerating the included T4 templates

* Fixing S.P.Corelib to properly list available platforms/configurations

* Add a comment on the T4 template service

Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Sung Yoon Whang be552ca506 Fix EventCounter disable logic (dotnet/coreclr#24519)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Andrew Au 5c401e1572 Remove obsolete comments
Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Stephen Toub 061d44d72e Tweak a few nullable annotations (dotnet/coreclr#24494)
- Assembly.ToString() won't return null
- Several attributes have the intent that their arguments are non-nullable, even though they don't check and throw; the annotations should match the intent in such cases.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Stephen Toub 0130eaecb8 Fix netstandard build for nullable annotations
Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Stephen Toub 1f36289bab Fix netfx build with nullable annotations
Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Alexander Kyte 4b111f373e [merp] Add an env var to disable all mono_crash files (#14407) 2019-05-13 09:36:43 -04:00
Zoltan Varga 008a0fb04a [corlib] Avoid preserving all fields of AppDomain. Don't preserve fields of Marshal, the runtime doesn't need them. 2019-05-12 22:49:14 -07:00
Alexander Köplinger ca5e8f207b [sdks] Lipo arm64_32 binaries for watchOS 2019-05-12 17:46:49 -07:00
Zoltan Varga c09128d8ff [corlib] Preserve AppDomain::DoTypeBuilderResolve () using a PreserveDependency attribute. (#14462) 2019-05-12 20:08:12 -04:00
Angelo Compagnucci f29eae3e35 configure: check for c++ availability (#14461)
Since commit d8af775, c++ compiler is required to compile.
This patch checks if the c++ compiler is available as soon as possible
and returns an error in case it is not found.

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

Signed-off-by: Angelo Compagnucci <[email protected]>
2019-05-12 15:43:00 -07:00
Alexander Köplinger db2f0ab3a5 [sdks] Use -pathmap CSC option for iOS/Mac
This allows the products to install the sources at a known location.
2019-05-12 10:23:46 -07:00
Jay Krell a1c476c04d Convert rest of JIT icall registration to static info. (#14455)
* Convert rest of JIT icall registration to static storage.

* PR: Expand macros manually (they can actually emcompass more, not less, another time).
2019-05-11 18:42:04 -07:00
Egor Bogatov 1049f06668 hide props 2019-05-11 09:53:48 +02:00
Marek Safar 73b82f02af Merge pull request #14458 from monojenkins/bclsizediff
[bcl] Update BCL Linked Size
2019-05-11 09:41:33 +02:00
Marek Safar 547ba43104 [System.Private.CoreLib] nullable warnings fixes 2019-05-11 09:40:04 +02:00
Johan Lorensson 072883b7fa Bump boringssl to include fix for Windows path's in lookup dirs. (#14435) 2019-05-11 02:20:00 -04:00
monojenkins f0d6e855ef [bcl] Update BCL Linked Size 2019-05-11 03:26:26 +00:00
Aleksey Kliger (λgeek) f4b86bbb41 [sdks] Build Android SDK on Windows (#14402)
Modify the sdks/builds/ infrastructure to support compiling the Android SDK on Windows.

The initial goal of this commit is to build only the monodroid BCL on Windows.  Compilation of the host and cross-compiler mono binaries is future work.

There's one kind of hacky bit in here.  Had to make sure that scripts/ci/run-jenkins.sh does _not_ set MONO_EXECUTABLE.  Normally windows builds use the msvc in-tree compiled mono binary to build the BCL.  In the case of the SDKs, we don't build that msvc binary, and we just use the usual (cygwin) mono to build the BCL.

* [sdks] allow building on cygwin

* [sdks] Start adding stub templates to llvm.mk

* [sdks] provision-android stubs for win32

* [sdks] Pass cygwin host triple to calls to configure on win32

* [sdks] Add runtime stub templates

* [sdks] Add android stub templates for win32

This is enough to get configure-android to work on cygwin x86_64

* [sdks] On win32, the HostMxe build is the host buildwe want the x86_64-w64-mingw32 toolchain, not the cygwin toolchain

* [sdks] For android on cygwin depend on the mingw64-{x86_64,i686}-zlib

* [sdks] Add android SDK build artifacts to .gitignore

* [sdks] Add AndroidCrossMXETemplate stub to android.mk for Windows builds

* [sdks] Fixup comments in android.mk

* [sdks] use UNAME=Windows for Cygwin and WSL

Don't assume Cygwin is the build platform for Windows Android SDK builds.

Keep using UNAME for coarse platform descriptions.
Switch to HOST_ARCH_MINGW32 instead of CYGWIN_BUILD_MACHINE for variable holding
the machine part of the host triplet for Windows.

* [sdks] Dummy provision-mxe target for windows

* [ci] Don't provision-android on Windows

It doesn't work yet.

* [sdks] temporarily turn off android-host-mxe-Win64-release

Needs mingw64-x86_64-zlib on all the CI builds bots.

* FIXME: hack - don't set MONO_EXECUTABLE to the msvc mono for Android SDK build

* [sdks] drop LLVMProvisionTemplateStub
2019-05-10 19:14:50 -04:00
Bernhard Urban 1d90dcfd35 [arm64] set MONO_ARCH_HAVE_UNWIND_BACKTRACE for watch4 (#14440)
[arm64] set MONO_ARCH_HAVE_UNWIND_BACKTRACE for watch4

Fixes a couple of mscorlib test failures, failing with
> Stack walks are not supported on this platform
2019-05-10 14:05:54 -04:00
Alexis Christoforides aedaf15f27 Revert "[System] Add FSEvent FileSystemWatcher to 'monotouch' BCL pro… (#14316)
* Revert "[System] Add FSEvent FileSystemWatcher to 'monotouch' BCL profile"

This reverts commit 46fc5352f3dfe0027e684a0f61e71130fccd559f.

While iOS FileSystemWatcher works, we now find that it is using unofficially-available  symbols and cannot publish apps using those.

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

* [csproj] Update project files
2019-05-10 12:50:03 -04:00
Jay Krell 04252ff724 Remove some malloc from JIT icall registration. (#14431)
Disallow duplicate JIT icall registration (by name, address, or new static info storage).
2019-05-10 08:36:29 -04:00
Johan Lorensson 991c7b6a61 Merge pull request #14425 from lateralusX/lateralusX/fix-profiler-on-windows
Add log profiler support to Mono MSVC build.
2019-05-10 12:50:28 +02:00
Egor Bogatov d06a42d56c TextInfo.ChangeCase should not use CultureInfo.CurrentCulture (#14105)
* Fix TextView

* Update CultureInfoTest.cs
2019-05-10 11:04:52 +02:00
Marek Safar affb833a6d Clean up local nullable enable 2019-05-10 10:51:17 +02:00
dotnet-bot ef5530ca28 fixing server error and syncing the repos 2019-05-10 10:51:17 +02:00
Stephen Toub b31b703b89 Turn on nullability for all of Corelib (dotnet/coreclr#24497)
* Enable nullable at the project level

* Remove `#nullable enable` from individual files

Removes `#nullable enable` from almost all .cs files in System.Private.CoreLib. I left it only in the ~30 files (out of ~1480 that had it) that are mirrored to corefx, that are built into projects by corefx that don't yet set NullableContextOptions at the project level, and that use nullable annotations; otherwise, they'd break the corefx build.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-10 10:51:17 +02:00
Johan Lorensson 5f41fb86be Merge pull request #14332 from lateralusX/lateralusX/add-llvm-windows-msvc-build-packaging-support
Add LLVM Windows MSVC build/packaging/archive/download support.
2019-05-10 10:33:43 +02:00
Filip Navara 643b2ebfc6 [netcore] Enable MSVC builds of Mono w/ ENABLE_NETCORE (#14418)
* Enable MSVC builds of Mono w/ ENABLE_NETCORE

* Fix non-netcore build

* Move the ENABLE_NETCORE definition to config.h where it belongs

* Replace .def with linker #pragmas

* TARGET_WIN32 -> HOST_WIN32 && HOST_X86

* Pick up MONO_ENABLE_NETCORE from cygconfig.h

* Make `./configure --with-core=only` MSVC builds working

* Include netcore sources unconditionally, move the condition into the .c file

* Fix MSVC C++ netcore build on Win32
2019-05-10 10:26:44 +02:00
Martin Baulig 0e5e464cff Add a few DISABLE_SECURITY conditionals. (#14300)
* Add a few `DISABLE_SECURITY` conditionals.

* [csproj] Update project files

* Fix tests.
2019-05-10 10:17:00 +02:00
Ryan Lucia 0c70519707 Fix minor build warning (#14426)
Fix minor build warning
2019-05-10 04:06:00 -04:00
Zoltan Varga 29fb43eb09 [corlib] Change the RuntimeModule.GetGuid and RuntimeAssembly.GetAotId icalls to return a byte array. (#14393)
* [corlib] Change the RuntimeModule.GetGuid and RuntimeAssembly.GetAotId icalls to return a byte array instead of a string, so it doesn't have to be parsed by the Guid ctor. Also allocate the arrays in the c# code and pass them to the icalls.
2019-05-09 20:34:55 -04:00
Jay Krell 77ab9ee0b8 Do not allocate handles in ReleaseMutex. (#14403)
* Do not allocate handles in ReleaseMutex.
Take advantage of thread/internal_thread maturity/pinning.

There are arguments for and against this.

It is arguably better to use handles everywhere.
But it is dubious to require an allocation to release a lock.
Releasing a lock should be infallible.
And surviving low memory shouldn't be a lost cause, imho..

This diff could also be viewed as an opportunistic cycle/size optimization
and be placed under ifdef -- ifdef THREAD_ALWAYS_PINNED orsuch.

This is an alternative to https://github.com/mono/mono/pull/14397.

* PR: Move comments.
2019-05-09 20:54:56 +02:00
lateralusX 2a703e72ff Add log profiler support to Mono MSVC build.
Several fixes to the log profiler in order to work on Windows.

* Add new dynamic library project to build log profiler on Windows MSVC.
* Fix dependecy between log profiler and Mono.
* Rewrite command pipe logic on Windows since it's not supported to select
  on both sockets and pipes.
* Several additional socket fixes needed for log profiler to work on Windows.
2019-05-09 18:33:00 +02:00
Egor Bogatov 735489b10b [netcore] Fix HideDetectionHappensBeforeBindingFlagChecks (#14336)
* Hide public property in Base if there is a private in Derived

* Update excludes-System.Runtime.Tests.rsp

* Update RuntimePropertyInfo.cs
2019-05-09 18:27:24 +02:00
Bernhard Urban a093cbddba [metadata] use handle stack in mono_runtime_object_init_handle (#14399)
Fixes this crash on watchOS with llvmonly:
```
(lldb) bt 35
* thread %1, name = 'tid_303', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x4d55545c)
  * frame %0: 0x01ab81de mscorlibtests`sgen_vtable_get_descriptor(vtable=0x4d555458) at sgen-client-mono.h:29:33
    frame %1: 0x01a9e278 mscorlibtests`major_copy_or_mark_object_canonical at sgen-marksweep-drain-gray-stack.h:158:10
    frame %2: 0x01a9debc mscorlibtests`major_copy_or_mark_object_canonical(ptr=0x182f260c, queue=0x01dd4894) at sgen-marksweep.c:1363
    frame %3: 0x019d31f2 mscorlibtests`mono_handle_stack_scan(stack=0x17e200b0, func=(mscorlibtests`major_copy_or_mark_object_canonical + 1 at sgen-marksweep.c:1362), gc_data=0x01dd4894, precise=1, check=1) at handle.c:340:5
    frame %4: 0x01a45680 mscorlibtests`sgen_client_scan_thread_data(start_nursery=0x00000000, end_nursery=0xffffffff, precise=1, ctx=ScanCopyContext @ 0x01dd4580) at sgen-mono.c:2254:5
    frame %5: 0x01a93e80 mscorlibtests`job_scan_thread_data(worker_data_untyped=0x00000000, job=0x0511c004) at sgen-gc.c:1416:2
    frame %6: 0x01adef0a mscorlibtests`sgen_workers_enqueue_job(generation=1, job=0x0511c004, enqueue=0) at sgen-workers.c:184:3
    frame %7: 0x01a9334a mscorlibtests`enqueue_scan_from_roots_jobs(gc_thread_gray_queue=0x01dd4894, heap_start=0x00000000, heap_end="", ops=0x01c6aaac, enqueue=0) at sgen-gc.c:1661:2
    frame %8: 0x01a94d16 mscorlibtests`major_copy_or_mark_from_roots(gc_thread_gray_queue=0x01dd4894, old_next_pin_slot=0x01dd4864, mode=COPY_OR_MARK_FROM_ROOTS_SERIAL, object_ops_nopar=0x01c6aaac, object_ops_par=0x00000000) at sgen-gc.c:2070:2
    frame %9: 0x01a95658 mscorlibtests`major_start_collection(gc_thread_gray_queue=0x01dd4894, reason="LOS overflow", concurrent=0, old_next_pin_slot=0x01dd4864) at sgen-gc.c:2189:2
    frame %10: 0x01a92ccc mscorlibtests`major_do_collection(reason="LOS overflow", is_overflow=0, forced=1) at sgen-gc.c:2362:2
    frame %11: 0x01a8e9ce mscorlibtests`sgen_perform_collection_inner(requested_size=21616, generation_to_collect=1, reason="LOS overflow", forced_serial=1, stw=1) at sgen-gc.c:2563:14
    frame %12: 0x01a8e76c mscorlibtests`sgen_perform_collection(requested_size=21616, generation_to_collect=1, reason="LOS overflow", forced_serial=1, stw=1) at sgen-gc.c:2640:2
    frame %13: 0x01a8e73e mscorlibtests`sgen_ensure_free_space(size=21616, generation=1) at sgen-gc.c:2514:2
    frame %14: 0x01a99184 mscorlibtests`sgen_los_alloc_large_inner(vtable=0x185749d0, size=21616) at sgen-los.c:380:2
    frame %15: 0x01a81c0a mscorlibtests`sgen_alloc_obj_nolock(vtable=0x185749d0, size=21616) at sgen-alloc.c:172:16
    frame %16: 0x01a44940 mscorlibtests`mono_gc_alloc_vector(vtable=0x185749d0, size=21616, max_length=900) at sgen-mono.c:1317:20
    frame %17: 0x00a5b408 mscorlibtests`aot_wrapper_icall_mono_gc_alloc_vector + 102
    frame %18: 0x00a56818 mscorlibtests`mscorlib_wrapper_alloc_object_AllocVector_intptr_intptr + 324
    frame %19: 0x01092b26 mscorlibtests`mscorlibtests1_MonoTests_System_DecimalTest2__ctor + 7286
    frame %20: 0x00a78912 mscorlibtests`aot_wrapper_gsharedvt_out_sig_pinvoke_void_this_ + 28
    frame %21: 0x00a4a4d2 mscorlibtests`mscorlib_wrapper_runtime_invoke_object_runtime_invoke_sig_void_intptr_intptr_object_intptr_intptr_intptr + 312
```

The hint here was that the crash happened in `mono_handle_stack_scan ()` and inspecting the handle stack there. After enabling `MONO_HANDLE_TRACK_OWNER` and `MONO_HANDLE_TRACK_SP` in `handle.h`, I got this:
```
warning: Handle 0x17886a0c (object = 0x16e73fd0) (allocated from "../../../../../mono/metadata/object.c:3182") is leaking.

    frame %1: 0x019833ba mscorlibtests`mono_handle_new(obj=0x01f194a0, info=0x17882600, owner="../../../../../mono/metadata/gc.c:1337") at handle.c:183:2
    frame %2: 0x019823c0 mscorlibtests`mono_gc_alloc_handle_string(vtable=0x17888760, size=24, len=5) at gc.c:1337:9
    frame %3: 0x019de896 mscorlibtests`mono_string_new_size_handle(domain=0x16e73fd0, len=5, error=0x01dc804c) at object.c:6643:6
    frame %4: 0x019d6fc4 mscorlibtests`mono_string_new_size_checked(domain=0x16e73fd0, length=5, error=0x01dc804c) at object.c:6655:2
    frame %5: 0x019de64e mscorlibtests`mono_string_new_utf16_checked(domain=0x16e73fd0, text=0x1842ab10, len=5, error=0x01dc804c) at object.c:6536:6
    frame %6: 0x019debc2 mscorlibtests`mono_string_new_checked(domain=0x16e73fd0, text="ar-SA", error=0x01dc804c) at object.c:6778:7
    frame %7: 0x019b06a8 mscorlibtests`construct_culture(this_obj=0x01f19428, ci=0x01b2d878, error=0x01dc804c) at locales.c:357:2
    frame %8: 0x019b0e3a mscorlibtests`ves_icall_System_Globalization_CultureInfo_internal_get_cultures(neutral='\0', specific='\x01', installed='\0') at locales.c:714:9
    frame %9: 0x007061f0 mscorlibtests`aot_wrapper___System_dot_Globalization_System_dot_Globalization_dot_CultureInfo__internal_get_cultures_pinvoke_cl2a_System_2eGlobalization_2eCultureInfo_5b_5d__cl4_bool_cl4_bool_cl4_bool_cl2a_System_2eGlobalization_2eCultureInfo_5b_5d__cl4_bool_cl4_bool_cl4_bool_ + 100
    frame %10: 0x00704fb2 mscorlibtests`mscorlib_System_Globalization_CultureInfo_GetCultures_System_Globalization_CultureTypes + 192
    frame %11: 0x0100f422 mscorlibtests`mscorlibtests1_MonoTests_System_DateTimeTest_Parse_Bug53023b + 192
    frame %12: 0x00a28702 mscorlibtests`aot_wrapper_gsharedvt_out_sig_pinvoke_void_this_ + 28
    frame %13: 0x009fa2c2 mscorlibtests`mscorlib_wrapper_runtime_invoke_object_runtime_invoke_sig_void_intptr_intptr_object_intptr_intptr_intptr + 312
    frame %14: 0x019278f2 mscorlibtests`mono_llvmonly_runtime_invoke(method=0x17953820, info=0x1842a9a0, obj=0x053b7c40, params=0x00000000, exc=0x01dc8550, error=0x01dc88a4) at mini-runtime.c:3000:2
```

@lambdageek suggested this fix after showing this trace to him. As far as I understand we do _not_ know the root cause yet. The handle leak happens in this trace:
```
(lldb) mbt
* thread %1
  * frame %0: 0x0176192c mscorlibtests`do_debug_me_please_kkthx at object.c:128:2
    frame %1: 0x01761a62 mscorlibtests`mono_runtime_object_init_handle(this_obj=MonoObjectHandle @ 0x01b53fbc, error=0x01b5404c) at object.c:146:3
    frame %2: 0x0176191e mscorlibtests`mono_runtime_object_init_checked(this_obj_raw=0x01fde880, error=0x01b5404c) at object.c:176:2
    frame %3: 0x0173ce32 mscorlibtests`ves_icall_System_Globalization_CultureInfo_internal_get_cultures(neutral='\0', specific='\x01', installed='\0') at locales.c:712:4
    frame %4: 0x004931d8 mscorlibtests`aot_wrapper___System_dot_Globalization_System_dot_Globalization_dot_CultureInfo__internal_get_cultures_pinvoke_cl2a_System_2eGlobalization_2eCultureInfo_5b_5d__cl4_bool_cl4_bool_cl4_bool_cl2a_System_2eGlobalization_2eCultureInfo_5b_5d__cl4_bool_cl4_bool_cl4_bool_ + 100
    frame %5: 0x00491f9a mscorlibtests`mscorlib_System_Globalization_CultureInfo_GetCultures_System_Globalization_CultureTypes + 192
    frame %6: 0x00d9b8f4 mscorlibtests`mscorlibtests1_MonoTests_System_DateTimeTest_Parse_Bug53023b + 192
    frame %7: 0x007b56ea mscorlibtests`aot_wrapper_gsharedvt_out_sig_pinvoke_void_this_ + 28
```
`mono_runtime_object_init_checked ()` already should take care of the handle stack 😕
2019-05-09 11:31:24 -04:00
Alexander Köplinger a597cee5b0 [sdks] Add .cs source files to ios archive
XI/XM install the Mono sources as part of their package.
2019-05-09 17:24:35 +02:00
Alexander Köplinger 969c04b141 [packaging] Add some missing .pdb's to Windows MSI (#14420) 2019-05-09 16:14:21 +02:00
Jay Krell 2524d5613b Usually do not create a handle in mono_runtime_invoke_handle. (#14404)
Use mono_runtime_invoke_handle_void instead.
2019-05-09 16:13:21 +02:00
Egor Bogatov b4e565f21b [netcore] Set of workarounds for ArrayTests (#14369)
* Fix ushort to char conversion

* fix one more test

* Enable more Array tests

* fix comment

* Fix CreateInstance_NotSupportedType_ThrowsNotSupportedException

* Address feedback

* Update ArraySortHelper.cs

* fix compilation error?

* bump corefx-tests, fix one more array.copy issue
2019-05-09 14:36:44 +02:00
Alexander Köplinger 8370fe318b [sdks] Make sure the mono-version.txt directory exists 2019-05-09 11:48:56 +02:00
Jay Krell c7697e0643 Mechanize strings in marshal.c register_icall and cleanup a little. (#14357)
The less mechical parts:
 - spell out monoeg_g_free
 - register_dyn_icall not used, remove
 - register_icall_no_wrapper only used once, spell it out instead

This is nice cosmetically on its own and will help remove JIT icall hashing.
2019-05-09 10:03:55 +02:00
Alexander Köplinger be571243e4 Bump helix-binaries
Helix recently started using Python 3 so we need to have a compatible xunit-reporter.py script.
2019-05-09 09:44:53 +02:00
Jay Krell 997190c12c Introduce enum and static data for JIT icalls, that are currently hashed (#14359)
* Introduce enum and static data for JIT icalls, that are currently hashed
by string and address and use dynamic allocation.

These will be used shortly.

* PR: Move MONO_JIT_ICALLS content from class-internals.h to jit-icall-reg.h.
Not clear what is the best name but moving along.
2019-05-09 02:06:52 -04:00
Ryan Lucia 6a20b25cc6 [corlib] Implement AssemblyBuilder.get_ReflectionOnly() (#14406)
* [corlib] Implement AssemblyBuilder.get_ReflectionOnly()

Fixes #13028

* Bump API snapshot submodule
2019-05-08 23:53:35 +02:00
Ryan Lucia 2894e57ed7 [gitignore] Add crash dump files, .dylib.dSYM directories, and test-path (#14408)
[gitignore] Add crash dump files, .dylib.dSYM directories, and test-path

Wasn't sure where in the file to best put the .dylib.dSYM stuff, so suggestions are welcome
2019-05-08 17:36:11 -04:00
Larry Ewing 0dd432096b Merge pull request #14203 from kjpou1/wasm-sdk-lower-version
[wasm][sdk] Fix warning NU1604, does not contain an inclusive lower b…
2019-05-08 11:44:03 -05:00
Alexander Köplinger 622ae6b8d4 [sdks] Add Mono version to ios/mac archive 2019-05-08 17:07:20 +02:00
Bernhard Urban 19f57ad0b8 [llvmonly] make local copy of trace_ips pointer from exception object (#14400)
Fixes a race in llvmonly (watchOS):
```
Process 397 stopped
* thread %10, name = 'tid_8e2f', stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
    frame %0: 0x0177f690 mscorlibtests`mono_llvm_load_exception at mini-exceptions.c:3886:23
   3883                 size_t upper = mono_array_length_internal (mono_ex->trace_ips);
   3884
   3885                 for (int i = 0; i < upper; i += TRACE_IP_ENTRY_SIZE) {
-> 3886                         gpointer curr_ip = mono_array_get_internal (mono_ex->trace_ips, gpointer, i);
   3887                         for (int j = 0; j < TRACE_IP_ENTRY_SIZE; ++j) {
   3888                                 gpointer p = mono_array_get_internal (mono_ex->trace_ips, gpointer, i + j);
   3889                                 trace_ips = g_list_append (trace_ips, p);
Target 0: (mscorlibtests) stopped.

(lldb) mbt
* thread %10
  * frame %0: 0x0177f690 mscorlibtests`mono_llvm_load_exception at mini-exceptions.c:3886:23
    frame %1: 0x00e23b7a mscorlibtests`mscorlibtests1_MonoTests_System_LazyTest__c__DisplayClass16_0__ConcurrentInitializationb__1 + 254
    frame %2: 0x0087af98 mscorlibtests`mscorlib_wrapper_delegate_invoke__Module_invoke_void + 610
    frame %3: 0x00368856 mscorlibtests`mscorlib_System_Threading_ThreadHelper_ThreadStart_Context_object + 448
  [...]
(lldb) p/x mono_ex
(MonoException *) $2 = 0x01d9e968
(lldb) p/x mono_ex->trace_ips
(MonoArray *) $3 = 0x00000000
(lldb) thread list
Process 397 stopped
  thread %1: tid = 0x38772, 0x018156aa mscorlibtests`jit_info_table_copy_and_split_chunk(table=0x17635a00, chunk=0x17b767f0) at jit-info.c:483:28, name = 'tid_303', queue = 'com.apple.main-thread'
  thread %3: tid = 0x387ad, 0x1c4f9764 libsystem_kernel.dylib`__psynch_cvwait + 24, name = 'SGen worker'
  thread %4: tid = 0x387b0, 0x1c4f1224 libsystem_kernel.dylib`semaphore_wait_trap + 8, name = 'Finalizer'
  thread %5: tid = 0x387b5, 0x1c4fa6cc libsystem_kernel.dylib`__workq_kernreturn + 8
  thread %6: tid = 0x387b6, 0x1c4f11d4 libsystem_kernel.dylib`mach_msg_trap + 20, name = 'com.apple.uikit.eventfetch-thread'
* thread %10: tid = 0x389a6, 0x0177f690 mscorlibtests`mono_llvm_load_exception at mini-exceptions.c:3886:23, name = 'tid_8e2f', stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
  thread %11: tid = 0x38985, 0x1c4f9764 libsystem_kernel.dylib`__psynch_cvwait + 24, name = 'tid_8113'
  thread %12: tid = 0x38986, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
  thread %13: tid = 0x38987, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
  thread %14: tid = 0x389a3, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
  thread %15: tid = 0x389a4, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
  thread %16: tid = 0x389a5, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
(lldb) thread select 1
* thread %1, name = 'tid_303', queue = 'com.apple.main-thread'
    frame %0: 0x018156aa mscorlibtests`jit_info_table_copy_and_split_chunk(table=0x17635a00, chunk=0x17b767f0) at jit-info.c:483:28
   480                          jit_info_table_split_chunk (chunk, &new_table->chunks [j], &new_table->chunks [j + 1]);
   481                          j += 2;
   482                  } else {
-> 483                          new_table->chunks [j] = table->chunks [i];
   484                          ++new_table->chunks [j]->refcount;
   485                          ++j;
   486                  }
(lldb) mbt
* thread %1
  * frame %0: 0x018156aa mscorlibtests`jit_info_table_copy_and_split_chunk(table=0x17635a00, chunk=0x17b767f0) at jit-info.c:483:28
    frame %1: 0x01815304 mscorlibtests`jit_info_table_chunk_overflow(table=0x17635a00, chunk=0x17b767f0) at jit-info.c:579:10
    frame %2: 0x018146ee mscorlibtests`jit_info_table_add(domain=0x16624cc0, table_ptr=0x16624d9c, ji=0x176f4428) at jit-info.c:614:33
    frame %3: 0x01814662 mscorlibtests`mono_jit_info_table_add(domain=0x16624cc0, ji=0x176f4428) at jit-info.c:674:2
    frame %4: 0x0175f5da mscorlibtests`mono_aot_find_jit_info(domain=0x16624cc0, image=0x16c07200, addr=0x00271ff1) at aot-runtime.c:3710:3
    frame %5: 0x0181443e mscorlibtests`mono_jit_info_table_find_internal(domain=0x16624cc0, addr=0x00271ff1, try_aot=1, allow_trampolines=0) at jit-info.c:306:9
    frame %6: 0x018145e0 mscorlibtests`mono_jit_info_table_find(domain=0x16624cc0, addr=0x00271ff1) at jit-info.c:335:9
    frame %7: 0x01780212 mscorlibtests`build_stack_trace(frame_ctx=0x01c2fb18, state=0x01c2ffb8) at mini-exceptions.c:392:31
    frame %8: 0x1c598aa2 libunwind.dylib`_Unwind_Backtrace + 232
    frame %9: 0x0177f4fc mscorlibtests`throw_exception(ex=0x01d9e968, rethrow=0) at mini-exceptions.c:3800:3
    frame %10: 0x0177f3c8 mscorlibtests`mono_llvm_throw_exception(ex=0x01d9e968) at mini-exceptions.c:3823:2
    frame %11: 0x00439ed0 mscorlibtests`mscorlib_System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 116
    frame %12: 0x00271ff0 mscorlibtests`mscorlib_System_LazyHelper_ThrowException + 98
    frame %13: 0x002730c2 mscorlibtests`mscorlib_System_Lazy_1_T_REF_CreateValue + 194
    frame %14: 0x00273390 mscorlibtests`mscorlib_System_Lazy_1_T_REF_get_Value + 128
    frame %15: 0x0027307a mscorlibtests`mscorlib_System_Lazy_1_T_REF_CreateValue + 122
    frame %16: 0x00273390 mscorlibtests`mscorlib_System_Lazy_1_T_REF_get_Value + 128
    frame %17: 0x00e22eb0 mscorlibtests`mscorlibtests1_MonoTests_System_LazyTest_ConcurrentInitialization + 1422
    frame %18: 0x008948e2 mscorlibtests`aot_wrapper_gsharedvt_out_sig_pinvoke_void_this_ + 28
    frame %19: 0x008664a2 mscorlibtests`mscorlib_wrapper_runtime_invoke_object_runtime_invoke_sig_void_intptr_intptr_object_intptr_intptr_intptr + 312
```
2019-05-08 09:39:59 -04:00
Zoltan Varga f879e35e3e [runtime] Use MAP_JIT automatically when running under a hardened runtime on osx. (#14395)
* [runtime] Use MAP_JIT automatically when running under a hardened runtime on osx.

* Fix memory ordering.
2019-05-08 07:20:55 -04:00
Alexander Köplinger 76f3d2da55 [sdks] Add Mono binaries to mac archive 2019-05-08 12:42:54 +02:00
Jay Krell 8928ed6fd8 Mechanize strings in mini-runtime.c register_jit_icall. (#14374)
* Mechanism strings to register_dyn_icall in mini-runtime.c.
That is both, generate them kinda, and make them available for some later manipulation.

* Mechanize strings for JIT icall registration in mini-runtime.c.
Generate them slightly and make them amenable to crude preprocessor transforms later.

* Try to improve github diff presentation.
2019-05-08 03:46:31 -04:00
lateralusX 6fc4fe419d Bump LLVM to include build/package/upload/download of Windows LLVM builds. 2019-05-08 09:24:38 +02:00
Zoltan Varga 5ccb9854b8 [interp] Add tracing support. Return values are not yet supported. (#14389) 2019-05-07 23:16:20 -04:00
Jo Shields 1ecbff9e93 Don't apply MONO_ATTR_FORMAT_PRINTF to mono_error_set_argument (#14385)
The constructor for mono_error_set_argument lacks a `const char *msg_format`
so clearly we shouldn't be applying formatting from an entirely
unrelated parameter.

This was flagged by `-Werror=format-security`
2019-05-07 15:52:35 -04:00
Jo Shields 80f99fc37d Remapping should affect GAC search paths considered by the loader (#14384)
Closes: #14366

Fixes Mac package failures during IronRuby compilation
2019-05-07 15:32:30 -04:00
Alexis Christoforides 2454ccb800 [corlib] Fix exception 'replacement' in IsolatedStorageFile.MoveFile()
This was caused by changes in File.Move coming from https://github.com/mono/mono/pull/12000
2019-05-07 14:33:27 -04:00
Larry Ewing b0ec83c4d0 Merge pull request #14370 from lewing/mixed-sample
[wasm] Add a mixed target for sample
2019-05-07 11:05:50 -05:00
Alexander Köplinger bf7faa00ad [sdks] Add Mono libraries to mac archive 2019-05-07 17:43:03 +02:00
Alexander Köplinger b39d38ece1 [sdks] Add mono-2.pc to mac archive
Xamarin.Mac needs it.
2019-05-07 17:43:03 +02:00
Alexander Köplinger ece23539f1 [sdks] Add Mono libraries and frameworks to iOS archive 2019-05-07 17:43:03 +02:00
Alexander Köplinger 5c4f523065 [sdks] Remove --with-monotouch from configure arguments
They are only needed for BCL builds and those are disabled by --disable-mcs-build
2019-05-07 17:43:03 +02:00
Alexander Köplinger 37f3fa17a1 [sdks] Fix README.md 2019-05-07 17:43:03 +02:00
Johan Lorensson 5bcf166375 Merge pull request #14375 from lateralusX/lateralusX/fix-mutex-leak-on-gc
Mutex memory leak on sgen GC (nursery, major).
2019-05-07 13:57:05 +02:00
Juan Antonio Cano b5b9ac7456 Fix for #14353 (#14354) 2019-05-07 11:40:55 +02:00
Bernhard Urban 8913a1a73e [arm] fix armv7k regression on struct passing (#14362)
We can't use `slotsize=8` on `armv7k` as it leads to stack corruption.

Note that `mtouch` already calls the AOT compiler with `--aot=mtriple=arm64_32-ios`, so no changes are required there.

Regression introduced by https://github.com/mono/mono/pull/12992

Fixes https://github.com/mono/mono/issues/13454
2019-05-07 05:24:55 -04:00
lateralusX c5d014397a Mutex memory leak on sgen GC (nursery, major).
During GC we allocate a gray queue protected by a mutex, sgen_gray_object_queue_init.
This mutex is never destroyed when clearing up the object containing it,
sgen_gray_object_queue_dispose, so it will leak. Overtime this could cause
OOM on some systems depending on how memory related to system primitives are
handled and partitioned.
2019-05-07 10:20:31 +02:00
Anirudh Agnihotry f46b93c5f4 making DiagnosticCounter internal (dotnet/coreclr#24427)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-07 07:02:02 +02:00
Jay Krell b3ecd17109 Mechanize strings in cominterop register_jit_icall. (#14356)
This reduces the current source code and will be useful in eliminating JIT icall hashing.
2019-05-06 19:31:03 -04:00
Jay Krell 072ff8fcfb Mechanize strings in remoting.c register_icall. (#14360)
This will help remove/reduce JIT icall hashing, as the
name will also be a field name or token paste to an enum value.
2019-05-06 19:29:42 -04:00
Thays Grazia 1294e4d0e5 A deadlock happens when during a process_suspend there is a pending invoke and then when it's calling the invoke there is another call to process_suspend in the same thread. (#14368) 2019-05-06 19:24:02 -03:00
Jay Krell a41be28871 Make mono_fmod extern "C and not static, to simplify later (#14355)
* Make mono_fmod extern "C and not static, to simplify later
removal of JIT icall hashing. Making it more consistent with other icalls.
Costing maybe one instruction in some slow paths.

* Move mono_fmod from mini-runtime.c to jit-icalls.c.

* Fix declaratoin of mono_fmod.
2019-05-06 23:49:29 +02:00
Aaron Robinson b8cf9823a8 Port all managed product binaries to use SDK style projects (#24285)
Convert managed product binary to use SDK project system.
 - Uses Arcade for versions strings
 - Overrides Arcade defined output paths - should change in the future

Signed-off-by: dotnet-bot <[email protected]>
2019-05-06 20:20:25 +02:00
Krzysztof Wicher 8ab1154d23 Nullable: System.Collections.Generic remainder (dotnet/coreclr#24340)
* Nullable: System.Collections.Generic remainder

* apply review feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-06 16:57:18 +02:00
sancheolz 3e51e7d222 [WinForms] fix EditingCellFormattedValue getter and setter for bool value (#13845)
* [WinForms] If DataGridViewCheckBoxCell not in threeState mode
EditingCellFormattedValue must return true or false, instead of
value of CheckState type

* [WinForms] DataGrid: fix type check in EditingCellFormattedValue setter.
When set bool value to EditingCellFormattedValue there will be exception.
Type equality must be done through IsAssignableFrom not direct

* [WinForms] DataGrid: Add test for EditingCellFormattedValue getter and setter.
2019-05-06 15:11:49 +02:00
monojenkins b6a652c072 Bump API snapshot submodule 2019-05-06 15:00:15 +02:00
Marek Safar ad3a5196dc [Facades] Include missing enums in System.Memory 2019-05-06 15:00:15 +02:00
Alexander Köplinger 4eea0870e1 [tests] Write nunit/xunit exclude categories to a file (#14281)
So we can include it in the SDKs archive.
2019-05-06 13:59:03 +02:00
Ben Adams 3bb7f82d00 Move AsyncMethodBuilder.SetStateMachine to non-generic (#24403)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-06 10:55:35 +02:00
pedestrianlove f60a397ab5 Remove special casing (#14155)
* match the parameter

* Removed special handling.

Removed special handling of TypedReference and RuntimeArgumentHandle

* Remove the whole special casing block

* Revert part of last commit

Restored the check for IsByRefLikeAttribute

* Corrected the function name
2019-05-06 02:00:16 -04:00
Larry Ewing 8d80ccc897 Merge pull request #14259 from jeromelaban/dev/jela/wasm-dlopen
[Wasm] Add support for P/Invoke through dynamic linking
2019-05-05 16:39:52 -05:00
Patrik Švikruha b30604fe9f fix typos - expext to expect in wasm test 2019-05-05 12:39:29 +02:00
Larry Ewing 59caa3e992 Add replace ContainsKey with a consistency check in object registration (#14343) 2019-05-05 08:04:37 +02:00
lateralusX edc7c34502 Add execute permissions on build scripts. 2019-05-04 13:29:36 +02:00
Larry Ewing b2a9049de4 Merge pull request #14331 from BrzVlad/feature-interp-ldsflda-opt
[interp] Optimize ldsflda opcode
2019-05-04 00:55:38 -05:00
Egor Bogatov 534c6883b1 [netcore] Fix CreateInstance_PublicOnlyValueTypeWithPrivateDefaultConstructor_T… (#14321)
* Fix CreateInstance_PublicOnlyValueTypeWithPrivateDefaultConstructor_ThrowsMissingMethodException

* Update excludes-System.Runtime.Tests.rsp

* Update RuntimeType.cs
2019-05-04 06:36:03 +02:00
Jan Kotas 744d3b7713 Fix CoreRT build breaks
Signed-off-by: dotnet-bot <[email protected]>
2019-05-04 06:25:52 +02:00
Filip Navara b7876417d3 Implement String.IsAscii in shared CoreLib and use it for [Is]Normalize[d] for all runtimes (#24373)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-04 06:25:52 +02:00
Levi Broderick f96706874d Vector.CopyTo / TryCopyTo should be readonly methods (dotnet/coreclr#24359)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-04 06:25:52 +02:00
Larry Ewing 887887a7fe Merge pull request #14340 from lewing/wasm-link-descriptor
[wasm] Add --link-descriptor arg to packager
2019-05-03 22:56:13 -05:00
Jérôme Laban ff4839d99e Regenerate m2n trampolines 2019-05-03 20:42:10 -04:00
Jérôme Laban 40981f0cfd Adjust indentation 2019-05-03 20:40:31 -04:00
Jérôme Laban 21743bd58d Add vifffff and viffffff trampolines 2019-05-03 20:40:30 -04:00
Jérôme Laban 04b8dd0f9b Fix invalid emscripten path file name 2019-05-03 20:39:18 -04:00
Jérôme Laban ca9892c340 Lookup pinvoke_names in wasm_dl_load first 2019-05-03 20:39:18 -04:00
Jérôme Laban 4c034a4678 Adjust indentation 2019-05-03 20:39:18 -04:00
Jérôme Laban ee6603916d Make wasm dlopen use only for release-dynamic configuration 2019-05-03 20:39:18 -04:00
Jérôme Laban 8a0e78d5a9 Move -s MAIN_MODULE=1 to all configurations
This will avoid emscripten to call abort() because  MAIN_MODULE is not defined.
2019-05-03 20:39:18 -04:00
Jérôme Laban b5b860f8d7 Make libmono_icall_table_la_LIBADD and libmono_ilgen_la_LIBADD conditional to wasm. 2019-05-03 20:39:18 -04:00
Jérôme Laban 8bddfdb2d2 Fix indentation, spacing. 2019-05-03 20:39:17 -04:00
Jérôme Laban f8371d8114 Generate m2n after update 2019-05-03 20:39:17 -04:00
Jérôme Laban c48414e9ef Apply fix for emscripten issue
https://github.com/emscripten-core/emscripten/issues/8511
2019-05-03 20:30:00 -04:00
Jérôme Laban 935bc21276 Fix indentation 2019-05-03 20:30:00 -04:00
Jérôme Laban 3f303a5033 Adjust release-dynamic output 2019-05-03 20:30:00 -04:00
Jérôme Laban ecd8c210e0 Add more driver cookies 2019-05-03 20:30:00 -04:00
Jérôme Laban aaccedfbfb Adjust touch of the release-dynamic folder 2019-05-03 20:30:00 -04:00
Jérôme Laban 6207844e39 try build release-dynamic 2019-05-03 20:29:59 -04:00
Jérôme Laban 51abc92b6e mono emscripten double loading issue 2019-05-03 20:29:59 -04:00
Jérôme Laban a1cda38793 Workaround for second dlopen failure returns non-null 2019-05-03 20:29:59 -04:00
Jérôme Laban 195e7f0b05 Add missing include 2019-05-03 20:29:59 -04:00
Jérôme Laban b50d35f620 Add minimal dl support 2019-05-03 20:29:59 -04:00
Jérôme Laban f334609ad5 Add EXPORT_ALL
https://github.com/emscripten-core/emscripten/blob/399cd460a4c7f12fbc7104cc7d1e7e20e7b574bf/tests/test_browser.py#L3420
2019-05-03 20:29:58 -04:00
Jérôme Laban 96e4e2f532 Enable dynamic linking support for mono 2019-05-03 20:29:58 -04:00
Larry Ewing 4cc2c190c0 Merge pull request #14309 from lewing/icall-branch
[wasm] generate icall_trampoline_dispatch as nested branches
2019-05-03 17:56:32 -05:00
Larry Ewing ea912ff155 Merge pull request #14306 from radical/bump_msbuild_master
[msbuild] Bump to pick up test fixes
2019-05-03 16:12:56 -05:00
Larry Ewing 0262d10220 Add --link-descriptor arg to packager to allow custom linker configuration 2019-05-03 13:45:21 -05:00
Jo Shields cae7795990 [netcore] Unique Asset Manifest filenames per branch 2019-05-03 14:41:44 -04:00
Larry Ewing 1d86f1a792 Order the groupings preferentially by length to reduce the worst case 2019-05-03 13:31:55 -05:00
Jo Shields 2331437db0 [netcore] Install and use GNU sed on Mac 2019-05-03 14:02:12 -04:00
Jo Shields 4b6f7f090a [netcore] Looks like dependsOn only references base job name, not each leg 2019-05-03 13:41:45 -04:00
Jo Shields 7fcf315af7 [netcore] Add OSX build (#14337) 2019-05-03 13:32:47 -04:00
Jo Shields 99853eeeb3 [netcore] Publish to BAR too (#14334) 2019-05-03 10:49:41 -04:00
Martin Baulig 40372422e7 Add a few RuntimeFeature.IsDynamicCodeSupported conditionals. (#14284)
* Add a few `RuntimeFeature.IsDynamicCodeSupported` conditionals.

* Update RuntimeMethodInfo.cs
2019-05-03 16:09:48 +02:00
lateralusX f42c1e0a67 Add option to restore VS build env from file. 2019-05-03 15:14:22 +02:00
lateralusX 568813b93b Add support for cygwin and WSL in helper build scripts. 2019-05-03 15:14:21 +02:00
lateralusX 488e15e8ab Add support to include external build LLVM binaries in Mono build output. 2019-05-03 15:14:21 +02:00
lateralusX f83d9f3575 Add LLVM SDK build/package support for Windows msvc build LLVM. 2019-05-03 15:14:21 +02:00
Zoltan Varga 231da41c78 [corlib] Avoid a runtime crash on new ArgIterator(new RuntimeArgumentHandle()). 2019-05-03 12:55:41 +02:00
Vlad Brezae ccdc79fd9e [interp] Optimize ldsflda opcode
2-4x speedup
2019-05-03 13:54:06 +03:00
Sung Yoon Whang 2867365120 Add Series/CounterType to CounterPayload and IncrementingCounterPayload (#24349)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-03 09:08:20 +02:00
Jay Krell d37cd2c2fc ld -Bsymboli so dynamic linker does not get betweem mono and itself. (#14298) 2019-05-03 02:29:56 -04:00
Paul Hebble 955faeac52 Fix light on light ListViewGroup headers on dark theme 2019-05-02 22:16:06 -05:00
Zoltan Varga 15f9b329c0 [runtime] Fix the signature of the AppDomain:DoUnhandledException () icall. (#14322) 2019-05-02 22:44:08 -04:00
Larry Ewing 795fed8852 Merge pull request #14319 from lewing/set-options-strdup
[wasm] Define wasm_strdup when setting options
2019-05-02 20:25:18 -05:00
Larry Ewing e6422bc3b4 Define wasm_strdup when setting options 2019-05-02 14:24:36 -05:00
Zoltan Varga 8312f0abe3 [wasm] Add a --runtime-arg= argument to runtime-tests.js to allow setting runtime arguments like --trace. (#14305) 2019-05-02 14:46:18 -04:00
Krzysztof Wicher 6ea6d1a481 Add using System.Diagnostics on some files
Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Stephen Toub b607d622ff Delete stale compilation constants from AsyncIteratorMethodBuilder (#37331)
I accidentally left these MICROSOFT_BCL_ASYNCINTERFACES_PACKAGE references in as part of some recent churn.  This compilation constant isn't set anywhere.

And the CORERT ifdef is no longer needed now that we've consolidated the code to shared.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Stephen Toub b1c8ebcdd4 Add ManualResetValueTaskSourceCore / AsyncIterateMethodBuilder to Microsoft.Bcl.AsyncInterfaces (#37320)
* Add ManualResetValueTaskSourceCore / AsyncIterateMethodBuilder to Microsoft.Bcl.AsyncInterfaces

These two types needed modifications to target .NET Standard 2.0 and are the necessary pieces to enable the compiler to compile async iterators.

- Copied ManualResetValueTaskSourceCore.cs from coreclr and tweaked it.  I opted to do this rather than ifdef because the changes are not localized and I didn't want to significantly perturb the primary implementation.
- Added a few ifdefs to the shared AsyncIteratorMethodBuilder.  It already had ifdefs, so I just added to it.
- Added a test project, and included the existing ManualResetValueTaskSourceCore tests.  I had to disable two of the tests because of some of the optimization differences.
- Augmented those tests to validate that the compiler is able to successfully generate iterators and await foreach them.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Ludovic Henry 7336f1d621 Implement GC.RegisterMemoryLoadChangeNotification (dotnet/coreclr#24202)
* Implement GC.RegisterMemoryLoadChangeNotification

This allows users to register a callback to be called whenever the
memory load is between a low and high thresholds. The idea is to allow
them to tweak their memory usage based on the available memory.

It is only internal for now because we are not confident on the shape of
the API and if it's the best we can provide users. This needs to go
through a few iterations with first party users like ASP.NET or corefx.

WIP for https://github.com/dotnet/coreclr/issues/18619

* fixup! Implement GC.RegisterMemoryLoadChangeNotification

* fixup! Implement GC.RegisterMemoryLoadChangeNotification

* fixup! Implement GC.RegisterMemoryLoadChangeNotification

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Dan Moseley 4b40a182b1 Adjust some terms (dotnet/coreclr#24351)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Krzysztof Wicher e09ca81503 Nullable: Interop and src/System remainder (dotnet/coreclr#24328)
* Nullable: Interop and src/System remainder

* apply feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Krzysztof Wicher c8b4fc18c3 Nullable: System.Collections remainder (non-generic) (dotnet/coreclr#24326)
* Nullable: System.Collections remainder (non-generic)

* apply feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Blake Hensley 6f1121badb Added overloads to Path.Join (dotnet/coreclr#24307)
* Added overloads to Path.Join

* Refactor Path.Join and Path.Combine to use ValueStringBuilder

* Use proper defined const for empty string

* Fix Windows-specific const

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Stephen Toub 8c5f625792 Move the new ConfigureAwait/WithCancellation extension methods to a new type (#24331)
We decided after all to put these on a different type, TaskAsyncEnumerableExtensions.  This commit adds the new type.  We can delete the methods in the old location once corefx consumes an updated build and switches over to using the new ones.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Santiago Fernandez Madero 3c0290dfcd Merge pull request dotnet/coreclr#24258 from dotnet/NullableFeature
Merge nullable feature into master

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Buyaa Namnan a25a0c2fc6 Fix test failures
Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Krzysztof Wicher 50a010a39f fix build errors after merge
Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Santiago Fernandez Madero 8f883a789f Nullable: Comparers, Dictionary and Friends (dotnet/coreclr#23971)
* Nullable: Comparers, Dictionary and Friends

* Add object constraint to Dictionary

* Fix warning from new compiler and annotating dictionary

* PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
buyaa-n 3183fd2028 Nullable for Type class (dotnet/coreclr#23489)
System.Type, System.Reflection nullability

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Krzysztof Wicher ab23b7e07d Nullable: System.Diagnostics.Tracing (dotnet/coreclr#24070)
* Nullable: System.Diagnostics.Tracing

* apply feedback

* fix one more comment

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Bernhard Urban 1cbd5cbacf [arm] amend stack pointer properly in exception trampoline (#14310)
The previous attempt ( https://github.com/mono/mono/pull/14078 ) only fixed it for ABIs where the stack pointer alignment is 8 bytes. ABIs, such as watchOS, require 16 byte alignment.
2019-05-02 13:48:41 -04:00
Alexander Kyte b15631d641 [llvm] Widen vector equality (OP_PCMPEQx) (#14292)
* [llvm] Widen vector equality (OP_PCMPEQx)

Fixes https://github.com/mono/mono/issues/14261
Fixes https://github.com/mono/mono/issues/14143

This was causing an issue when trying to inline
System.Numerics.Vectors.Vector`1<byte>:Equals into System.Span.IndexOf
from System.Memory.dll as provided by nuget. I believe that it is
comparing the result of a SIMD operation on two SIMD registers there with a
SIMD register full of zero bytes.

When we produce the Equals call (no inline), we spill the SIMD <4 x i32>
vector to the stack in the caller, and we then later load it
with the widened type used here <16 x i8>.

When we inline, we end up making the args into XMOV opcodes,
and then doing the "pcmpeqb" mini opcode with the return values
from those operations. This becomes a register to register no-op
copy, and the original <4 x i32> gets compared against the <16 x i8>
type:

```
  %116 = icmp eq <16 x i8> zeroinitializer, <4 x i32> %115
```

This does not go the way we want it to. It reliably leads to IndexOf
breaking and only finding the desired byte in the portion not processed
by the SIMD code (in the last few elements of the array).

This fix checks if the input dimensions differ, and does a conversion.
This produces the following IR:

```
  %114 = bitcast <4 x i32> %99 to <16 x i8>
  %115 = icmp eq <16 x i8> %114, %113
  %116 = sext <16 x i1> %115 to <16 x i8>
  %117 = icmp eq <16 x i8> zeroinitializer, %116
```

* [llvm] Widen vector greater-than

Here we do the same trick used in the above fix, but for the parallel greater-than operation.
2019-05-02 12:24:35 -04:00
Jay Krell d371432a10 Move three trivial threadpool icalls to callers. (#14296)
ves_icall_System_Threading_ThreadPool_PostQueuedCompletionStatus
 ves_icall_System_Threading_ThreadPool_BindIOCompletionCallbackNative
 ves_icall_System_Threading_ThreadPool_IsThreadPoolHosted
2019-05-02 10:25:58 -04:00
Jo Shields 748da2e4a9 [netcore] Onboard Arcade (#14301) 2019-05-02 10:24:10 -04:00
Friedrich von Never c9c50f85f4 Fix #14255: correct type and bitness for TARGETS request of X11 clipboard 2019-05-02 14:23:02 +02:00
Egor Bogatov ea917ba76a [netcore] clean up excludes-System.Runtime.Tests.rsp (#14294)
* update System.Runtime.Tests.rsp

* Update System.Private.CoreLib.csproj

* Update excludes-System.Runtime.Tests.rsp

* Invoke AppContext.OnProcessExit from runtime

* remove Utf16/Utf8 tests

* Implement LoadFromPath

* make NativeLibrary os specific

* Add missing LoadWithPartialName

* Update Assembly.cs

* Update Assembly.cs

* Update NativeLibrary.Unix.cs
2019-05-02 14:00:39 +02:00
Larry Ewing 2e97d6edd7 Merge pull request #14295 from vargaz/mixed-eh-5
[runtime] Fix some mixed EH problems.
2019-05-02 01:46:36 -05:00
Larry Ewing f557414b61 Try out a branching trampoline dispatch 2019-05-01 23:29:48 -05:00
Ankit Jain 3fe8360358 [msbuild] Bump to pick up test fixes 2019-05-01 15:43:27 -04:00
Alexis Christoforides 2fc4d80c99 corlib] Add API that was dropped during the coreFX System.IO integration (#14265) 2019-05-01 11:24:21 -04:00
Marek Safar cece97035d Make block optimized ClearWithoutReferences fully shared (#24312)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-01 09:28:17 +02:00
Zoltan Varga 781d20bab4 [runtime] Fix some mixed EH problems. 2019-05-01 02:00:56 -04:00
Zoltan Varga e431093f73 [aot] Avoid passing -march=arm to llc when using thumb, it forces arm32 code generation. (#14288)
Fixes https://github.com/mono/mono/issues/14247.
2019-04-30 20:47:27 -04:00
Ankit Jain a27a7737c4 Update nuget.exe too 2019-04-30 20:12:08 +02:00
Ankit Jain 450e296221 Bump msbuild to track xplat-master 2019-04-30 20:12:08 +02:00
Tanner Gooding 285992a721 Updating System.Numerics.Vector<T> to use the readonly members feature. (#23827)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 18:29:44 +02:00
monojenkins 0da2ba771b [csproj] Update project files 2019-04-30 12:14:57 +02:00
lateralusX 81ce33f6b6 Add minimal COM support into WinAOT BCL profile and Windows Mono runtime.
Technologies like SharpDX uses a minimal set of COM support from runtime
and System.Runtime.InteropServices.Marshal:

AddRef
Release
QueryInterface

All these are low level wrappers around methods in IUknown interface and
doesn't need any of the additional runtime COM support enabled to work.

Technologies like CoreRT includes these methods in their full AOT
profile, meaning that SharpDX can run on CoreRT on Windows platforms. Mono's
WinAOT profile and runtime currently don't, making it impossible  to use
SharpDX.

This PR adds the needed methods into WinAOT profile and also make
sure corresponding icalls always gets included on Windows build Mono runtime.
2019-04-30 12:14:57 +02:00
Marek Safar 92cb0369bb Fix the build 2019-04-30 09:39:12 +02:00
Levi Broderick 98846ea2ff Add more span-based Vector<T> ctors and CopyTo methods (#23333)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
Egor Bogatov 5702e95cea Move DefaultBinder.CanConvert.cs to shared (dotnet/coreclr#23931)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
Michal Strehovský 7bca6da11f Move NativeLibrary to the shared partition (dotnet/coreclr#24143)
I'm taking the LibraryNameVariation helper from System.Runtime.Loader for the ride as well because it's a general purpose probing logic that is useful in a managed implementation of NativeLibrary.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
dschinde 6291956230 Improve pref of Array.IndexOf() for certain T. (dotnet/coreclr#24293)
Applies changes to `Array.IndexOf()` and `Array.LastIndexOf()` similar
to the changes made in #20855, so that types other than `byte` and
`char` can use use the fast vectorized path.

Also allows 32-bit and 64-bit types for which
`RuntimeHelpers.IsBitwiseEquatable<T>()` returns `true` to use the
faster implementation of `IndexOf` and `LastIndexOf` from
`MemoryExtensions`.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
Jan Kotas cee1268335 Workaround memset alignment sensitivity (dotnet/coreclr#24302)
* Workaround memset alignment sensitivity

memset is up to 2x slower on misaligned block on some types of hardware. The problem is uneven performance of "rep stosb"
used to implement the memset in some cases. The exact matrix on when it is slower and by how much is very complex.

This change workarounds the issue by aligning the memory block before it is passed to memset and filling in the potential misaligned
part manually. This workaround will regress performance by a few percent (<10%) in some cases, but we will gain up to 2x improvement
in other cases.

Fixes #24300

Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
Anirudh Agnihotry b3eeab7410 Improve Precision to 10 microseconds in timespan (dotnet/coreclr#24279)
* Increasing precision properly and leaving the rounding of to casting operator

* disabling corefx tests in coreclr and addressing feedback

* correcting test project name

* Fix json

Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 07:48:31 +02:00
Zoltan Varga cf10cb7238 [wasm] Add support for pinvokes in user assemblies. (#14253)
The --pinvoke-libs=x argument to packager.exe can be used to generate pinvoke linking tables.
'x' is a list of library names used in DllImport declarations, i.e. --pinvoke-libs=libtest is used
to link with [DllImport ("libtest")].
2019-04-29 19:20:28 -04:00
Larry Ewing 498974d09a Merge pull request #14199 from kjpou1/wasm-sdk-cl-args
[wasm][sdk] Add command line quoting and escaping to WasmLinkAssembli…
2019-04-29 17:33:44 -05:00
Marek Safar dc683e5cd3 Fix the build 2019-04-29 22:47:13 +02:00
Steve MacLean c86a8f843e Fix Satellite Assembly loading (dotnet/coreclr#24191)
* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-29 22:47:13 +02:00
Anirudh Agnihotry f503eb7dbc Revert "Dummy commit" (dotnet/coreclr#24197)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-29 22:47:13 +02:00
Anipik 45f19a5577 Dummy commit
Signed-off-by: dotnet-bot <[email protected]>
2019-04-29 22:47:13 +02:00
Anipik c94f194278 synving with coreclr 2019-04-29 22:10:14 +02:00
Marek Safar c6c25db0c2 Mirror changes from mono/coreclr,corefx,corert (#14163)
Mirror changes from mono/coreclr,corefx,corert
2019-04-29 19:30:57 +02:00
monojenkins 344df07dd2 [csproj] Update project files 2019-04-29 15:47:04 +02:00
Martin Baulig 23343ab506 Remove ClientRealProxy on wasm and testing_aot. 2019-04-29 15:47:04 +02:00
Martin Baulig 06487590ff Define DISABLE_SECURITY and DISABLE_REMOTING on wasm and testing_aot. 2019-04-29 15:47:04 +02:00
Martin Baulig b22ed1a09f Make testing_aot_full tests build again in System.Security. (#14244)
* Make `testing_aot_full` tests build again in System.Security.

* Add System.Security tests.
2019-04-29 15:43:33 +02:00
Kenneth Pouncey 1faa0ec279 Set an explicit version.
Address review comments by Katelyn Gadd
2019-04-29 05:51:06 +02:00
Jay Krell 90a91429ae Remove libgcc_s_seh-1.dll dependency when targeting Win32 with gcc. (#14251)
Don't use popcount intrinsic.
Alternative but not exactly contradictory to https://github.com/mono/mono/pull/14248.

Note that this is a single inlinable instruction on x86,
if you assume at least SSE4 from circa 2007, which I am avoiding here.
2019-04-27 21:57:17 -04:00
Vlad Brezae 6d9c4c24d2 [interp] Optimize enum Hasflag (#14173)
* [interp] Optimize enum.HasFlag for csc pattern

Avoid boxing and slow call. Makes it 100x faster.

* [interp] Optimize enum.HasFlag for mcs pattern

* [interp] Transform ldc.i4 + conv.i8 into ldc.i8

Simplifies code, making enum.HasFlag optimization work for long enums.
2019-04-27 12:14:16 +03:00
Kenneth Pouncey 5d9ecd7112 [wasm][bindings] Refactor WebAssembly.Core object instantiation. (#14191)
* Refactor WebAssembly.Core object instantiation.

- Move the supported Core object identification into javascript.
- Runtime the core object type is now passed into the Runtime from javascript binding support instead of being housed in managed code.

* Address review comments.

* Fix indentation

* Implement suggestion by Katelyn Gadd to use Symbol instead of a Map or WeakMap.

- This removes the previous mono_wasm_core_map used for type mapping.
- Attach a special named symbol for `wasm type` to the prototype property for the Core objects that we have bound.
- The Managed Type is stored in the symbol property that will be passed to the managed side.
2019-04-27 09:27:22 +02:00
monojenkins 87000b43bb [bcl] Update BCL Linked Size 2019-04-27 08:38:28 +02:00
Vlad Brezae a68022ae7e [interp] Optimize special static field access (#14202)
* [interp] Optimize special static field access

3x faster. For value types 10x.

* [interp] Remove duplicated code

* [interp] Further optimize thread static field access

Provides an additional 50% perf gain.
2019-04-27 00:28:12 +03:00
Vlad Brezae 6fb7b496bd [interp] Don't change next_jit_code_hash during imethod transform (#14240)
This field is used by the internal hash table to link nodes and it can be changed during hash table insertion of other imethods. Copying this field back was leading to random hangs in hash table lookup.
2019-04-26 17:20:33 +02:00
Zoltan Varga c2e540331d [runtime] Add a python version of the offsets tool. (#14229)
* [runtime] Add a python version of the offsets tool.

This version only depends on python and libclang. It currently only
works on osx.

* [runtime] Add a dummy structure needed by the python version of the offsets tool.

* [offsets-tool-py] Change some argument names for compatibility.

* [wasm] Use the python offsets tool on osx, the c# version is 32 bit, and the 64 bit version doesn't work.

* [wasm] Fix the ordering of mono libraries on the link line.
2019-04-26 11:12:24 -04:00
Martin Baulig 5e2069746c Avoid HashAlgorithm.Create() on FULL_AOT_RUNTIME. (#14228) 2019-04-26 14:08:36 +02:00
Kenneth Pouncey c97840f414 Replace the command line generation using string formatting with the ProcessArguments routines that will add escaping and quoting to the parameters and as necessary.
- The routine specifically will escape path separators when needed for instance on windows instead of using the simplified `.Replace ("\\", "\\\\")` as previously implemented.
- The routine will also add quoting when necessary.
2019-04-26 12:00:30 +02:00
Kenneth Pouncey cefbe81ee9 Rebase WasmLinkAssemblies 2019-04-26 11:12:08 +02:00
Jo Shields d44e45c32e [netcore] Avoid touching or using submodules in coreonly mode 2019-04-26 08:53:25 +02:00
Jo Shields 82a60e239f [netcore] Copy in 3 files, to avoid need for corert submodule in coreonly 2019-04-26 08:53:25 +02:00
Jérôme Laban 95cc5b2f45 Add missing pinvoke-tables-default.h from build artifacts. (#14237)
[Wasm] Add missing pinvoke-tables-default.h from build artifacts

This change restores the ability to build wasm AOT apps outside the mono source tree.
2019-04-26 00:45:45 -04:00
Martin Baulig 19387b1f41 Disable "unreachable code" warnings on wasm. (#14230) 2019-04-25 22:02:53 +02:00
Jo Shields 3521df4cf4 [netcore] Smarter version numbering of nupkg (#14011)
The version number in version.h only shows e.g. "6.3.0", and we
want full version numbers ideally, to match what our Mac pkg files
show. This logic calculates that version number.
2019-04-25 15:42:56 -04:00
Jo Shields b1d54d2e42 [netcore] Fix make dist following https://github.com/mono/mono/pull/14167 (#14233) 2019-04-25 14:27:46 -04:00
Jay Krell 8eec35bcdd Fix arm32 tailcall_reg/tailcall_membase. (#14187)
* Revert "[Tailcall] [arm] [jit] Fix moving tailcall parameters. (#12701)"

This reverts commit 257efc6374.

* When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes https://github.com/mono/mono/issues/11489.
2019-04-25 13:10:06 -04:00
Egor Bogatov 591d6d0a21 [netcore] ASP.NET Core sample (#14224)
* ASP.NET Core sample

* update makefile

* update Home page

* Update Makefile

* remove ASPNET_SHAREDRUNTIME

* replace mvc with web sample
2019-04-25 18:28:56 +02:00
Alexis Christoforides e541be2da2 [monodroid] Enable System.IO.Pipes (#14160)
* [monodroid] Enable System.IO.Pipes

* Bump API snapshot submodule

* [csproj] Update project files
2019-04-25 11:05:11 -04:00
monojenkins 3d7a63ba17 [csproj] Update project files 2019-04-25 09:17:13 +02:00
Martin Baulig 0a5a9ec821 Remove DISABLE_REMOTING conditional. 2019-04-25 09:17:13 +02:00
Martin Baulig b07f68a61c Getting rid of the DISABLE_REMOTING conditional. 2019-04-25 09:17:13 +02:00
Vlad Brezae 913951b350 [interp] Don't check for exception in native wrappers (#14184)
We already do it when we get back to the interpreter.
2019-04-25 10:09:11 +03:00
Johan Lorensson 45a3eef924 Merge pull request #14101 from lateralusX/lateralusX/add-coop-support-windows-msvc
Add hybrid/cooperate suspend runtime support on Windows.
2019-04-25 02:53:13 -04:00
Bernhard Urban b658792614 [interp] fix op_explicit for cast from nfloat to nint and vice versa (#14201)
Fixes https://github.com/xamarin/xamarin-macios/issues/5809
2019-04-25 08:37:01 +02:00
monojenkins 1e9ea1c616 [bcl] Update BCL Linked Size 2019-04-25 08:15:15 +02:00
Kenneth Pouncey e412e520f5 [wasm][sdk] Add dotnet new custom template. (#14183)
* [wasm][sdk] Add dotnet new custom template.

```
Templates                                         Short Name         Language          Tags
----------------------------------------------------------------------------------------------------------------------------
Mono WebAssembly Starter                          wasm               [C#]              Mono/WebAssembly
```

Example use:

```
dotnet new wasm -n Test.WebAssembly -o Test.WebAssembly
```

* Package the template files
2019-04-25 05:50:54 +02:00
Kenneth Pouncey 7f6deb2b6f [wasm] [bindings] Package doc .xml files (#14174) 2019-04-25 05:49:54 +02:00
Filip Navara 019b4563d3 [netcore] Restore Roslyn compilers from NuGet to allow up-to-date version to be used (#14157)
* Restore Roslyn compilers from NuGet to allow up-to-date version to be used

* Move the Roslyn version to makefile, ensure that it is updated before building System.Private.CoreLib

* Pass the whole path to Roslyn props file instead of just Roslyn version to dotnet build

* Make the Roslyn restore compatible with .NET Core 2.2 SDK
2019-04-24 17:24:46 +02:00
Egor Bogatov 95b873997a [netcore] Don't wrap CustomAttributeNamedArgument into CustomAttributeNamedArgument (#14180)
* don't wrap CustomaAttributeNamedArg

* fix BlockCopy failing test

* update NETCORETESTS_VERSION and NETCOREAPP_VERSION

* avoid typedard creation in netcore

* fix merge issue
2019-04-24 17:23:51 +02:00
Alexander Kyte 0d9e13f983 [llvm] Propagate nonnull attribute through LLVM IR (#13697)
## Summary

This change allows LLVM to identify unnecessary null checks. We mark GOT accesses (including those made by LDSTR) and new object calls as nonnull.

Since LLVM won't propagate this, we propagate from definition to usage, across casts, and from usage to definition (conditionally).

This enables it to remove a significant portion of some benchmarks. 

In real-world code, we can expect to see this remove the unnecessary null checks made by private methods. 

## Example

### C#:

Note that the constant strings are trivially non-null. This PR spots and propagates that. 

```

   static void ThrowIfNull(string s)
    {
        if (s == null)
            ThrowArgumentNullException();
    }

    static void ThrowArgumentNullException()
    {
        throw new ArgumentNullException();
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    static int Bench(string a, string b, string c, string d)
    {
        ThrowIfNull(a);
        ThrowIfNull(b);
        ThrowIfNull(c);
        ThrowIfNull(d);

        return a.Length + b.Length + c.Length + d.Length;
    }

    [Benchmark(Description = nameof(NoThrowInline))]
    public int Test() => Bench("a", "bc", "def", "ghij");

```

### Before:

```

define hidden monocc i32 @NoThrowInline_MainClass_Bench_string_string_string_string(i64*  %arg_a, i64* %arg_b, i64* %arg_c, i64*  %arg_d) #6 gc "mono" {
BB0:
  br label %INIT_BB1

INIT_BB1:                                         ; preds = %BB0
  br label %INITED_BB2

INITED_BB2:                                       ; preds = %INIT_BB1
  br label %BB3

BB3:                                              ; preds = %INITED_BB2
  br label %BB2

BB2:                                              ; preds = %BB3
  notail call monocc void @NoThrowInline_MainClass_ThrowIfNull_string(i64* %arg_a)
  notail call monocc void @NoThrowInline_MainClass_ThrowIfNull_string(i64* %arg_b)
  notail call monocc void @NoThrowInline_MainClass_ThrowIfNull_string(i64* %arg_c)
  notail call monocc void @NoThrowInline_MainClass_ThrowIfNull_string(i64* %arg_d)
  %0 = bitcast i64* %arg_a to i32*
  %1 = getelementptr i32, i32* %0, i32 4
  %t50 = load volatile i32, i32* %1
  %2 = bitcast i64* %arg_b to i32*
  %3 = getelementptr i32, i32* %2, i32 4
  %t52 = load volatile i32, i32* %3
  %t53 = add i32 %t50, %t52
  %4 = bitcast i64* %arg_c to i32*
  %5 = getelementptr i32, i32* %4, i32 4
  %t55 = load volatile i32, i32* %5
  %t56 = add i32 %t53, %t55
  %6 = bitcast i64* %arg_d to i32*
  %7 = getelementptr i32, i32* %6, i32 4
  %t58 = load volatile i32, i32* %7
  %t60 = add i32 %t56, %t58
  br label %BB1

BB1:                                              ; preds = %BB2
  ret i32 %t60
}

```

### After:

Note: safepoint in below code is added by backend, not part of this change

```

define hidden monocc i32 @NoThrowInline_MainClass_Bench_string_string_string_string(i64* nonnull %arg_a, i64* nonnull %arg_b, i64* nonnull %arg_c, i64* nonnull %arg_d) #6 gc "mono" {
BB0:
  %0 = getelementptr i64, i64* %arg_a, i64 2
  %1 = bitcast i64* %0 to i32*
  %t50 = load volatile i32, i32* %1, align 4
  %2 = getelementptr i64, i64* %arg_b, i64 2
  %3 = bitcast i64* %2 to i32*
  %t52 = load volatile i32, i32* %3, align 4
  %t53 = add i32 %t52, %t50
  %4 = getelementptr i64, i64* %arg_c, i64 2
  %5 = bitcast i64* %4 to i32*
  %t55 = load volatile i32, i32* %5, align 4
  %t56 = add i32 %t53, %t55
  %6 = getelementptr i64, i64* %arg_d, i64 2
  %7 = bitcast i64* %6 to i32*
  %t58 = load volatile i32, i32* %7, align 4
  %t60 = add i32 %t56, %t58
  %8 = load i64*, i64** getelementptr inbounds ([37 x i64*], [37 x i64*]* @mono_aot_NoThrowInline_llvm_got, i64 0, i64 7), align 8
  %9 = load i64, i64* %8, align 4
  %10 = icmp eq i64 %9, 0
  br i1 %10, label %gc.safepoint_poll.exit, label %gc.safepoint_poll.poll.i

gc.safepoint_poll.poll.i:                         ; preds = %BB0
  %11 = load void ()*, void ()** bitcast (i64** getelementptr inbounds ([37 x i64*], [37 x i64*]* @mono_aot_NoThrowInline_llvm_got, i64 0, i64 25) to void ()**), align 8
  call void %11() #8
  br label %gc.safepoint_poll.exit

gc.safepoint_poll.exit:                           ; preds = %BB0, %gc.safepoint_poll.poll.i
  ret i32 %t60
}

```

## Dependencies 

This depends on https://github.com/mono/linker/pull/528.
2019-04-24 16:53:47 +02:00
Jo Shields 5c02267668 [netcore] Fix escaping (#14209) 2019-04-24 10:50:16 -04:00
Jo Shields 1fe9041e4b [netcore] This is a bash script, not a batch file. Correct env var use. (#14207) 2019-04-24 10:09:27 -04:00
Larry Ewing 194070823c Merge pull request #14192 from kjpou1/wasm-fix-cl
[wasm][tests] Fix browser test command line arguments.
2019-04-24 08:59:39 -05:00
Jo Shields 9d4c9a89f1 [netcore] Try passing dnceng PAT for internal builds (#14204) 2019-04-24 09:21:21 -04:00
lateralusX 0d390066ca Fix race condition under wow64 for cooperative suspended threads.
Under hybrid suspend a thread can be cooperative suspended but still
checked for a platform critical region under wow64. Since thread is
not preemptive suspended we can't reliably call GetThreadContext and
doing so could also (even correctly) return a context flagged as critical
triggering an assert in stw for cooperative suspended threads.
2019-04-24 14:16:03 +02:00
lateralusX f26e30c38a Add hybrid/cooperate runtime support on Windows. 2019-04-24 14:15:45 +02:00
Kenneth Pouncey c5aa3ecdec [wasm][sdk] Fix warning NU1604, does not contain an inclusive lower bound 2019-04-24 13:57:16 +02:00
Santiago Fernandez Madero 7bd9e122aa Fix build errors in Interop.Errors
Signed-off-by: dotnet-bot <[email protected]>
2019-04-24 11:02:06 +02:00
Santiago Fernandez Madero be620ee542 Disable warning in ValueStringBuilder.ToString
Signed-off-by: dotnet-bot <[email protected]>
2019-04-24 11:02:06 +02:00
Kenneth Pouncey 9a0ce7242c [wasm][sdk] Add command line quoting and escaping to WasmLinkAssemblies ToolTask.
- This resolves a few issues when executing `monolinker.exe` from windows build.
2019-04-24 10:52:45 +02:00
Alexander Köplinger 4873b27706 [acceptance-tests] Run roslyn tests using in-tree mono instead of system mono (#14186)
We were inadvertently running the roslyn tests against the system mono in CI.
Instead we now install mono to a custom prefix, prepend that to PATH and run
the roslyn tests against the correct mono we just built.
2019-04-24 08:50:58 +02:00
Kenneth Pouncey fd0b6a769a [wasm][tests] Fix command line arguments.
- Add `.pdb` file support to the karma config.
2019-04-24 06:50:02 +02:00
Katelyn Gadd 14e83aab44 Add roslyn bump instructions next to roslyn-binaries 2019-04-23 18:38:55 -04:00
Zoltan Varga fdc2dce384 [netcore] Convert netcore/Makefile.am to a normal makefile, get the configure variables from config.make. (#14167)
* [netcore] Convert netcore/Makefile.am to a normal makefile, get the configure variables from config.make.

* [netcore] Convert mcs/class/System.Private.CoreLib/Makefile.am to a normal makefile.
2019-04-23 17:01:23 -04:00
Jo Shields 73c2145c28 [netcore] Fix error in sed, screwing up submodules (#14189) 2019-04-23 16:45:53 -04:00
Jo Shields 4a144ac103 Merge pull request #14188 from directhex/mangle-submodules-internally
[netcore] Mangle .gitmodules on internal project to internal mirrors
2019-04-23 16:23:42 -04:00
Jo Shields 6e10a33a07 [netcore] Mangle .gitmodules on internal project to internal mirrors 2019-04-23 16:01:58 -04:00
Zoltan Varga c1c7a739cc [netcore] Throw the correct exception for byref returns returning null, .net core throws a nullref. (#14128) 2019-04-23 12:05:50 -04:00
Bernhard Urban 223e0bd78d [aot] partial revert of #14043 (#14135)
We need to emit a real call here. On arm/android we would emit this now:
```asm
ldr pc, =label
.ltorg         # place address of `label` here.
```
which is a jump to `label`, not a call.

We need a different solution to make larger assemblies work, but for now
I revert it so the `2019-02` intergration is unblocked.

Partial revert of #14043
2019-04-23 15:53:05 +02:00
Thays Grazia aed21f3e4b [DIM] Throwing AmbiguousImplementationException on call of multiple candidate implementations. (#14127)
* Adding AmbiguousImplementationException exception and throwing this when there are multiple candidate implementations.
2019-04-23 09:48:39 -03:00
Filip Navara 921f00352f [netcore] Establish a baseline for make xtestpass (#14072)
* Bump CoreFX version, include few more packages

* Add exclusions for System.Collections.NonGeneric.Tests

* Exclude tests that crash runtime

* Add more exclusions for known failures

* Exclude System.Utf8String.Experimental.Tests, it is CoreCLR specific
Exclude System.ComponentModel.Composition.Registration.Tests, the published version throws PNSE for all methods

Please enter the commit message for your changes. Lines starting

* Make a list of known non-passing tests and establish baseline for 'make xtestpass'

* Add exclusions

* Reenable System.Net.NameResolution.Functional.Tests

* Reenable System.Net.Sockets.Tests

* Reenable System.Diagnostics.Tracing.Tests

* Reenable System.Net.Http.Functional.Tests

* Reenable System.Net.HttpListener.Tests

* Reenable System.CodeDom.Tests

* Reenable System.Linq.Expressions.Tests

* Reenable System.Threading.ThreadPool.Tests

* Reenable System.Runtime.Tests

* Reenable System.Collections.Tests

* Reenable System.Threading.ThreadPool.Tests

* Reenable System.Memory.Tests

* Reenable System.Linq.Parallel.Tests

* Update exclusions for System.Diagnostics.Process.Tests

* Reenable System.Dynamic.Runtime.Tests

* Reenable System.Runtime.Numerics.Tests

* Sort excluded tests

* Reenable System.Reflection.Tests

* Reenable System.Reflection.Emit.Tests

* Reenable System.Linq.Parallel.Tests

* Reenable System.Diagnostics.TraceSource.Tests

* Reenable System.Threading.Tests

* Disable tests that trigger UI on macOS

* Update System.Runtime.Tests exclusion list

* Update line numbers
2019-04-23 14:44:39 +02:00
Jay Krell 1ffb5fb83f Cleanup patch_info code a little. (#14037)
e.g. whenever underlying representation is nul terminated string.
 MONO_PATCH_INFO_LDSTR_LIT
 MONO_PATCH_INFO_OBJC_SELECTOR_REF
almost the same as
 MONO_PATCH_INFO_JIT_ICALL
 MONO_PATCH_INFO_JIT_ICALL_ADDR
 MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL

MONO_PATCH_INFO_LDSTR_LIT no longer allocate
 and copy the string from the AOT image into image_pool.

g_str_equal check pointer equality first.
While obviously correct, not obviously faster,
as it adds cost when strings are unequal.

Uninline g_str_equal, seems cleaner, but perhaps less efficient.

Combine the switch-exit and default: paths,
as only one case other than default exited the switch.

Lift out other common subexpressions.
2019-04-23 10:57:31 +02:00
Kenneth Pouncey 778f3a4925 [wasm][sdk] Fixes to the sdk packages (#14120)
* Package the wasm and wasm Facades correctly.

* Move the build props and targets file to netstandard2.0 build directory.

* Place framework .props file properly for build

* Place runtime .props file properly for build

* A little cleanup and add escaping windows path separator.

- There are problems executing mononlinker.exe on windows if the windows path separators are not escaped.
2019-04-23 07:17:26 +02:00
Zoltan Varga 2477d73d58 [runtime] Fix a warning. (#14168) 2019-04-22 20:56:48 -04:00
Zoltan Varga 0a95f46f30 [llvm] Remove unused dlsym_cb. (#14164) 2019-04-22 20:56:33 -04:00
Zoltan Varga f1d1bd6084 [llvmonly] Enable invariant loads from preinited got slots. (#14027) 2019-04-22 18:03:36 -04:00
Aleksey Kliger (λgeek) 43540e6649 [image] Create MonoImageStorage to own the image raw data (#13942)
* [image] Create MonoImageStorage to own the image raw data

Create a new data structure: MonoImageStorage.

It is an object that will have the responsibility for the raw data of a
MonoImage.  It has a string key and a refcount that is used to share a
MonoImageStorage between multiple MonoImage objects.

The reason we need this is because the current MonoAssembly/MonoImage design is
broken for multiple domains and (more evidently) it will be broken when we add
AssemblyLoadContext support.  The issue is that a MonoImage may be shared
between multiple domains (or ALCs), but it has a 'references' field which
points to a single other MonoAssembly.

This is a problem because the references of an image may be resolved
differently in different domains (or ALCs).

The eventual solution will be to stop sharing MonoImages based on path name (or
in the case of in-memory images based on a name made up from the address of the
byte blob).

However we still don't want to open the same data more than once (if we're on a
config where we don't have mmap, we malloc some memory and dump the data in
there - we don't want to do that multiple times for the same file).

So the solution is to create this MonoImageStorage object and make it possible
to share it based on path name, but don't give it any responsibilities except
for owning the memory.  It doesn't know anything about metadata or assemblies
or any of that stuff - it just owns a chunk of memory and knows when and how to
free it.

This commit just adds the MonoImageStorage object and wires it up in MonoImage
loading.  There should be no observable behavioral changes from this commit.

* [win32] call FreeLibrary from MonoImageStorage dtor, not mono_image_close_except_pools

If we're sharing a MonoImageStorage, only call FreeLibrary when the storage is
finally destroyed, not every time one of the images is closed.
2019-04-22 14:43:11 -04:00
Steve MacLean f318317bbd Remove create assembly name (dotnet/coreclr#24154)
* Remove RuntimeAssembly.CreateAssemblyName

Fixes #24135

CreateAssemblyName was not compatible with AssemblyLoadContext isolation.

Assembly.Load(string)
Assembly.LoadWithPartialName(string)
Activator.CreateInstance(...)

* Remove unused AssemblyNameNative::Init arguments

* Temp disable corefx CreateInstanceAssemblyResolve

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:49:48 +00:00
dotnet-maestro-bot ba4e9450aa Update BuildTools, CoreClr to preview4-03917-01, preview5-27618-71, respectively (master) (#24060)
* Update BuildTools, CoreClr to preview4-03917-01, preview5-27618-71, respectively

* Fix build errors

* Disable warning with pragma and linked issue

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:49:47 +00:00
Steve MacLean 9cf417d5b7 Fix Timezone whitespace (dotnet/coreclr#24137)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:49:41 +00:00
Tanner Gooding 2119795cae Pulling in CoreFX changes and fixing up Sse2.StoreLow to be Sse2.StoreScalar (#24123)
* Update dependencies from https://github.com/dotnet/corefx build 20190419.5

    - Microsoft.NETCore.Platforms - 3.0.0-preview5.19219.5
    - Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview5.19219.5

* Removing the Sse2.StoreLow(long/ulong*, ...) methods that have been replaced

* Moving the Sse2.StoreLow(long/ulong*, ...) tests to be Sse2.StoreScalar tests

* Fixing some existing usages of Sse2.StoreLow(long/ulong*, ...)

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:47 +00:00
Koundinya Veluri b1255e5f83 Implement APIs for some threading metrics (CoreCLR) (dotnet/coreclr#24113)
Implement APIs for some threading metrics (CoreCLR)

API review: https://github.com/dotnet/corefx/issues/35500

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:47 +00:00
Krzysztof Wicher a97a684f25 Nullable: couple of missing #nullable enable (dotnet/coreclr#24094)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:46 +00:00
Stephen Toub 029b95b2c5 Nullable: System.Collections.Concurrent (dotnet/coreclr#24054)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:45 +00:00
Benjamin Bartels 8430f02a5a Fixed ChunkEnumerator.Current NRE (dotnet/coreclr#24076)
* Fixed ChunkEnumerator.Current NRE

* Added Nullable Flow analysis annotation comment

* Changed TODO-NULLABLE comment to link to appropriate issue

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:44 +00:00
Santiago Fernandez Madero 7d24b8eeef Fix StringBuilder annotations and debug.asserts (dotnet/coreclr#24069)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:44 +00:00
Stephen Toub a19c49cf77 Nullable: Addition COM types (dotnet/coreclr#24032)
Somehow these slipped through previous rounds of annotating.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:42 +00:00
Stephen Toub c9d58058fc Fix a few internal nullable annotations and comments (dotnet/coreclr#23987)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:43:21 +00:00
Stephen Toub 656238b95b Nullable: System.Runtime.InteropServices.CustomMarshalers/WindowsRuntime (#23930)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:43:20 +00:00
Stephen Toub dd29d74ca4 Nullable: src\System\Runtime\InteropServices (dotnet/coreclr#23936)
* Nullable: src\System\Runtime\InteropServices

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:43:20 +00:00
buyaa-n f7c25c025c Nullable: Enums, Structures from Reflection folder (dotnet/coreclr#23933)
* Nullable: Enums, Structures from Reflection

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:43:19 +00:00
Anirudh Agnihotry 8104af8221 Nullable System.ComponentModel, System.Diagnostics.CodeAnalysis, System.Diagnostics.Contracts (#23910)
* Nullable System.ComponentModel, System.Diagnostics.CodeAnalysis, System.Diagnostics.Contracts

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:42:09 +00:00
Stephen Toub f1901501e8 Nullable: Runtime serialization, COM, Vector, remaining IO, and other (#23895)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:42:05 +00:00
Stephen Toub bde9213406 Nullable: System.Runtime.CompilerServices (dotnet/coreclr#23886)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:38:01 +00:00
Krzysztof Wicher 2126d5a92c Nullable: Globalization native interop + some missing files (#23914)
* Nullable: globalization native + some missing files

* address feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:38:00 +00:00
Stephen Toub 01917a7a4a Update Version annotations to match changes in master (#23917)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:38:00 +00:00
Anirudh Agnihotry 06441b788f Nullable: System.Diagnostics (dotnet/coreclr#23753)
* added nullable annotation for system.Diagnostics

* fixing build errors with nullableFeature branch

* stephen feedback

* annotating files in the shared folder

* removing newline, correxting message and adding comments

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:37:59 +00:00
Anirudh Agnihotry 74dc838b36 Nullable System.Diagnostics.Store (dotnet/coreclr#23874)
* removing using systems and adding nullability for System.Diagnostics.SymbolStore

* annotating the class that implements the internal interface

* adding bang to fix failure

* correcting the byte array declarations

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:37:58 +00:00
Anirudh Agnihotry 452db22237 Nullable: Interop.Adavapi32 (dotnet/coreclr#23875)
* interop definations nullified

* reverting null check and adding arguments nullable to match win32 function definations

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:37:57 +00:00
Santiago Fernandez Madero 88f40c0547 Fix build errors due to merge conflicts
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:37:53 +00:00
Krzysztof Wicher b4ed8f6782 Nullable: Interop: Kernel32 and few others (dotnet/coreclr#23880)
* Nullable: Interop: Kernel32 and few others

* fix compile errors (new compiler)

* address feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:35:22 +00:00
Stephen Toub 933536a87a Address follow-up PR feedback on System nullability annotations (#23878)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:35:00 +00:00
Stephen Toub 3418f9c1f8 Nullable: System (most of it) (dotnet/coreclr#23774)
* Nullable: shared\System (most of it)

And some other things it touches.

* Nullable: src\System (most of it)

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:32:38 +00:00
Anirudh Agnihotry 1e64bf5c1c Nullable Internal.Win32.RegistryKey (dotnet/coreclr#23856)
* anootated registrykey

* Fixing the build for windows

* Adding bang after the resize argument

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:28:33 +00:00
Krzysztof Wicher 6f07ebbfc6 Nullable: System.Resources (dotnet/coreclr#23830)
* nullable: system.resources

* apply feedback

* apply another feedback

* fix SR.cs after rebase

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:28:33 +00:00
Stephen Toub 074f8a9e6c Nullable: Attributes, SafeHandles, and misc (dotnet/coreclr#23810)
* Nullable: Attributes, SafeHandles, and misc

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:28:28 +00:00
Stephen Toub 7d9c1bc28d Nullable: System.IO (dotnet/coreclr#23732)
* Nullable: System.IO

Everything exception StreamReader, StreamWriter, BinaryReader, BinaryWriter, which are waiting for some changes in master to propagate over to the feature branch.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:27:20 +00:00
Santiago Fernandez Madero c7abb47a8a Fix build errors with new compiler
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:27:19 +00:00
Krzysztof Wicher 62ab4ced87 Nullable: System.Text (dotnet/coreclr#23708)
* Nullable: System.Text

* apply feedback

* simplify second enc.Clone() call

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:27:15 +00:00
Tanner Gooding a7e61a0a10 Nullable: System.Runtime.InteropServices.Marshal (dotnet/coreclr#23699)
* Nullable: System.Runtime.InteropServices.Marshal

* Fixing the nullable annotations for BindToMoniker and GetObjectForIUnknown

* Fixing the nullability of PtrToStringAuto(IntPtr, int)

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:26:04 +00:00
Anirudh Agnihotry a9193f4dc3 adding null annotations (dotnet/coreclr#23744)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:24:08 +00:00
Stephen Toub 2996c13498 Nullable: Array (dotnet/coreclr#23746)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:24:07 +00:00
Stephen Toub e329b82c14 Nullable: Span and friends (dotnet/coreclr#23734)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:24:06 +00:00
Jay Krell 800701fe3f Small step toward reduction/elimination of JIT icall hashing. (#14149)
Ultimate goal is to significantly reduce or maybe completely
eliminate the hashing of JIT icalls.

It is not a small change.

This is a small digestable albeit tedious step toward that.

The "names" of opcode emulation icalls are needed for
token pasting and/or struct fields. They are needed without quotes.

This PR removes the quotes.
And then for now, just always restores them.

This is extracted from https://github.com/mono/mono/pull/14047
as a step toward making it easier to review.
2019-04-22 11:04:32 +02:00
Vlad Brezae afc16a8733 [interp] Fix buffer overflow when incrementing sp
Fixes https://github.com/mono/mono/issues/14079
2019-04-21 10:06:34 +03:00
Alexander Köplinger 6b73e8db82 Bump monolite (#14144)
Looks like monolite was broken somehow. Rebuild it.
2019-04-20 00:35:18 +02:00
Larry Ewing 061fb88295 Merge pull request #14136 from kjpou1/wasm-function-tests
[wasm] Fix NRE WebAssembly.Core.Array during initialization
2019-04-19 16:08:12 -05:00
Aleksey Kliger (λgeek) 7ba1f77f6d [loader] Don't store through a null ptr (#14110)
* [loader] Dont't store through a null ptr

If 'status' is null, don't try to write to it.

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

* [metadata] Protect writes to MonoImageOpenStatus* in a few places.

When possible assert that `MonoImageOpenStatus *status` arguments to various
functions in the runtime aren't null.  There are a few places (MONO_API) where
it's possible that callers are passing null.  In that case, use a local
MonoImageOpenStatus, or check for null before doing assignments.
2019-04-19 15:57:31 -04:00
pedestrianlove 1bdffd21cb Make dedicated MonoError for mono_error_set_argument_out_of_range (#14119)
* Make dedicated MonoError for mono_error_set_argument_out_of_range
2019-04-19 12:13:21 -04:00
Jay Krell 435feaaa02 [Coop] Convert performance counters and performance counter categories. (#13623)
* Cut down on strlen calls.
But keep the shared memory format unchanged to match .NET. (i.e. don't
put string lengths in it).

* PR: MONO_ENTER_NO_SAFEPOINTS instead of gchandle.

Push/pop frames in loops and mind the return/goto/break/continue carefully, instead of using assignment.

*PR: Reduce gsize to adequate int, move multiple int declarations to same line.

* PR: Fix prototypes in disabled code.

* PR: Spell out `int` as `gint32`.

Use an uppercase guid to workaround Windows problem.

* A bit more true to the previous version.
* Reduce diff a little.
* if (is_ok()) around one line instead of goto around it.
* Restore some old code.
* Restore more verbosity, that used to have a point but no longer does.
2019-04-19 11:27:16 -04:00
Kenneth Pouncey 12aa4de4a7 Add tests for WebAssemlby.Core.Array initialization
- Add tests for WebAssembly.Core.Function
2019-04-19 13:21:35 +02:00
Kenneth Pouncey 02d72c7e85 Fix NRE WebAssembly.Core.Array 2019-04-19 13:20:31 +02:00
Zoltan Varga 84f6e1dfac [llvm] Avoid looking up intrinsics by name in most cases. (#14029)
[llvm] Avoid looking up intrinsics by name in most cases.
2019-04-19 04:15:54 -04:00
Tanner Gooding 54776b2541 Adding Sse2.StoreScalar(long*, V128) which will replace Sse2.StoreLow(long*, V128) (#24102)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-19 08:34:08 +02:00
Larry Ewing e0e3592c20 Merge pull request #14129 from lewing/sample-tfm
[wasm] Fix the samples target framework
2019-04-18 21:24:47 -05:00
Larry Ewing 45bf2cf557 Add a mixed target for sample 2019-04-18 21:05:13 -05:00
Katelyn Gadd d9c1f37780 Fix start-compiler-server (#14117) 2019-04-18 14:54:25 -07:00
Zoltan Varga f7dff29c6c [aot] Add a depfile= argument which causes the AOT compiler to write out a gcc style dep file listing the dependencies between the output file and all referenced assemblies. (#14124)
* [aot] Add a depfile= argument which causes the AOT compiler to write out a gcc style dep file listing the dependencies between the output file and all referenced assemblies.

* Add a manpage entry.

* Update after comments.
2019-04-18 16:41:47 -04:00
Larry Ewing 783f8e9c07 Fix the samples target framework 2019-04-18 14:49:35 -05:00
Larry Ewing eaba6c608c Merge pull request #14113 from vargaz/netcore-pinvoke
[wasm] Fix the types of the generated function declarations in the pinvoke table.
2019-04-18 11:43:09 -05:00
Thays Grazia bc2d8e7c92 Protecting boxing a null value (#14018)
When a static method is called the obj is not used, so it can be null and it doesn't need to be boxed.
Adding an assert in the method to prevent other crash in this method if a NULL is received.
2019-04-18 13:29:21 -03:00
Bernhard Urban dacee19252 [interp] disable tail call opt if managed debugger is enabled (#14098)
[interp] disable tail call opt if managed debugger is enabled 

Fixes https://github.com/mono/mono/issues/12981
2019-04-18 11:56:10 -04:00
Alexander Köplinger 9dcb8311ef [ci] Workaround races in the tests build (#14121)
We're still seeing some failing tests build sometimes.
2019-04-18 15:51:40 +02:00
Vincent Povirk 8c2d1829c1 Respect call convention modopts in native wrappers. (#14017)
MS's C++ compiler emits code that uses this.
2019-04-18 09:44:31 -04:00
Justin Needham a738d0e284 Update documentation for --with-large-heap
This Flags only applies to the Boehm GC
2019-04-18 13:59:27 +02:00
Johan Lorensson 90869d7708 Merge pull request #13931 from lateralusX/lateralusX/external-direct-icalls-symbol-name
Add support for direct icalls using external functions not in icall-def.h.
2019-04-18 06:20:54 -04:00
Jay Krell c7e5f4150b mono_remoting_marshal_init in mono_marshal_get_proxy_cancast to register icalls. (#14097)
Alternatively move the registration to mono_remoting_init.
2019-04-18 10:10:47 +02:00
Filip Navara 7e35b5128b [netcore] Fix failures in System.Tests.MulticastDelegateTests (#14096) 2019-04-18 08:39:31 +02:00
Egor Bogatov 61dbc22bfd [netcore] improve Windows support (#14100)
* better Windows support

* remove unzip.py

* move FeaturePortableTimer to csproj
2019-04-18 08:30:11 +02:00
Zoltan Varga 569be02071 [netcore] Fix the tests. (#14108)
* [netcore] Fix the tests.

* Fix Monitor class too.
2019-04-18 08:23:01 +02:00
Katelyn Gadd b043647c48 Adjust roslyn mcs dll deploy list based on #13755. Keep Tasks.Extensions and Memory because their facades are only deployed on mobile. 2019-04-18 08:21:31 +02:00
Larry Ewing 93c45bae27 Merge pull request #14088 from vargaz/wasm-direct-calls
[llvmonly] Allow direct calls to inflated methods since they can initialize themselves correctly now.
2019-04-17 17:55:00 -05:00
Larry Ewing 1cd911a844 Merge pull request #14041 from kjpou1/wasm-sdk-packages
[wasm] [sdk] Build and package the sdk nugets.
2019-04-17 17:32:27 -05:00
Zoltan Varga 9551e22ba9 [wasm] Fix the types of the generated function declarations in the pinvoke table. 2019-04-17 14:53:52 -04:00
Vlad Brezae 3f11315916 [interp] Small vt opcode optimisations (#14040)
[interp] Simplify cpobj.vt

[interp] Optimize stelem.vt/ldelem.vt

[interp] Avoid unnecessary write barrier for ldobj.vt
Write barriers are only required for stores in the major heap/los.

[interp] Simplify ldfld.vt/stfld.vt
2019-04-17 20:47:48 +02:00
Vlad Brezae 183de1c302 [interp] Improve boxing/unboxing (#14048)
* [interp] Remove redundant check

It can't be an enum if it is stored on the vtstack

* [interp] Optimize boxing

Makes boxing of primitives 4x faster and boxing of vt 3x faster.

* [interp] Remove unneccessary check in unbox

We do the same check as jit. Makes unboxing 10x faster.

* [interp] Extract some duplicate code for boxing

* [interp] Fix boxing of nullable with constrained calls

Before the box opcode optimization, it was handling nullable. When normally boxing a nullable we call the Box method, but this is awkward when doing a constrained call, so we just add a separate opcode. This is slightly slower than calling Box, but much faster than the old code using the generic mono_value_box_checked.
2019-04-17 21:38:19 +03:00
lateralusX c31b4dd5b4 Review feedback. 2019-04-17 17:04:08 +02:00
Egor Bogatov afcd30d8c2 [netcore] Fix two System.Tests.PseudoCustomAttributeTests tests (#14073)
Now all custom attribute related tests pass in System.Runtime.Tests.
Also this PR fixes broken acceptance tests for regular mono introduced in https://github.com/mono/mono/pull/13809
2019-04-17 16:39:38 +02:00
Vlad Brezae 1b4a2a68f5 [interp] Fix interp strmfld vt (#14086)
* [interp] Fix store remote value type field

Looks like the culprit for some random mcs tests failures

* [interp] Delete dummy code
2019-04-17 16:40:07 +03:00
Jay Krell d882ea388a Replace two element hash table with two element array and cheap linear search. (#14049)
Replace two element hash table with two element array and cheap linear search.

Maybe I misunderstand the code?
Or significant expansion is expected?
2019-04-17 05:06:28 -04:00
Jay Krell cd5e14a3cc Factor the function mono_call_add_patch_info out of a few lines of repeated code in many backends. (#13970)
This notably does not apply to amd64, x86.
They have more logic intertwined around the patch when they emit the call.
2019-04-17 09:41:54 +02:00
Zoltan Varga 9e10afd3d6 [netcore] Create netcore specific versions of refsource classes. (#14074) 2019-04-17 08:56:16 +02:00
Zoltan Varga 605ea1555c [llvmonly] Add stubs for methods which cannot be compiled since they can be called directly. 2019-04-16 19:44:28 -04:00
Jay Krell 6a39d91078 Remove a few string allocs/copies, i.e. for generic trampoline names. (#14038) 2019-04-17 00:37:10 +02:00
Bernhard Urban 98a1d40584 [arm] align stack pointer in throw trampoline (#14078)
This is a regression introduced by e46fa20466

Fixes https://github.com/mono/mono/issues/13672
2019-04-17 00:36:05 +02:00
Zoltan Varga 08f4d74daf [wasm] Only aot with interp support when in mixed mode. 2019-04-16 16:40:17 -04:00
Zoltan Varga 61d6860f21 [llvmonly] Make direct calls to more methods, not enabled yet. 2019-04-16 16:39:21 -04:00
Zoltan Varga d257f7a663 [aot] Prepend the assembly name to the mangled method names. 2019-04-16 16:38:52 -04:00
Zoltan Varga 3ef6463a03 [netcore] Allow cross-module direct calls to alloc wrappers. 2019-04-16 14:55:05 -04:00
Filip Navara e10034c1ff Update CustomAttributeExtensions to call Attribute class to get proper parameter validation. Fixes System.Reflection.Extensions.Tests. 2019-04-16 19:35:35 +02:00
Marek Safar 3c2025bb58 Reflect shared partition changes 2019-04-16 19:24:43 +02:00
Filip Navara d5a4f9b8a9 Move EventSource to shared CoreLib partition (dotnet/coreclr#23925)
* Move most of EventSource to shared CoreLib partition

* Reenable some code that can be shared with Microsoft.Diagnostics.Tracing.EventSource.Redist in CoreFX

* Remove unused functions

* Fix placement of #endregion

* Clean up P/Invoke prototypes

* Move remaining code from EventSource_CoreCLR to shared partition (guarded by !CORERT)

* Remove more unnecessary marshalling attributes

* Move remaining CoreRT/ProjectN code to shared partition

* Avoid using Windows errors on non-Windows platforms

Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 19:24:43 +02:00
Zoltan Varga b71e29a62d [llvmonly] Allow direct calls to inflated methods since they can initialize themselves correctly now. 2019-04-16 13:19:19 -04:00
Zoltan Varga 1c568bf16f [aot] Change how the context is computed in init_aot_method (). Instead of (#14026)
getting it from the caller, save it in the aot image and read it back.
This will make it possible to emit direct calls to gshared methods later.
2019-04-16 11:30:16 -04:00
Jay Krell 18f0bf055e Register mono_gc_wbarrier_generic_nostore_internal regular with its own name, not dynamic with a special name. (#14042) 2019-04-16 13:34:46 +02:00
Jay Krell 6225a9b031 Register g_free icall regular, as monoeg_g_free. (#14044)
The point here is that register_dyn is a bit obscure and could use clarification.
2019-04-16 13:34:29 +02:00
Egor Bogatov 8cd9b562ea [netcore] Fix WaitHandle.SignalAndWait (#13809)
* fix failing tests

* Add build-corefx-test-for- rule

* Update WaitHandle.cs

* fix S.T.T.rsp file

* fix build

* bump corlib version

* handle new errors in old mono

* Update w32handle.c
2019-04-16 12:04:02 +02:00
Egor Bogatov d2054f6cc0 [netcore] Fix System.Tests.PseudoCustomAttributeTests.* tests (#14065)
* fix Custom Attribute tests

* fix CA

* fix CA

* Update MonoCustomAttrs.cs

* fix MarshalAsAttribute

* Update MarshalAsAttribute.cs

* Update MarshalAsAttribute.cs
2019-04-16 11:51:26 +02:00
Zoltan Varga edae380da5 [netcore] Add linker descriptor for corelib. (#14064)
* [netcore] Add linker descriptor. This is just a copy of the mscorlib descriptor.

* [netcore] Update linker descriptor for netcore.

* Remove com/remoting related classes.
* Other smaller changes.

* [netcore] Allow loading corlib from MONO_PATH.

* Update System.Private.CoreLib.xml
2019-04-16 11:48:12 +02:00
Levi Broderick 7ae2e1e769 Fix incorrect bit match pattern in UTF-16 validation (dotnet/coreclr#24015)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 11:27:33 +02:00
Jan Kotas d99f005b4b Fold ResourceSet::CommonInit into constructor (dotnet/coreclr#23993)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 11:27:33 +02:00
Egor Bogatov 128aec0590 Add "partial" to MarshalAsAttribute (dotnet/coreclr#24014)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 11:27:33 +02:00
Jan Kotas 31b890bd2e Remove redundant UnderlyingSystemType calls (dotnet/coreclr#24000)
UnderlyingSystemType is virtual

Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 11:04:44 +02:00
Kenneth Pouncey aa01f6fb75 Add sdk package solution to be built by dotnet command. 2019-04-16 09:19:35 +02:00
Filip Navara fbac2cb6f0 [netcore] Fix couple of custom attribute tests (#14063)
* Revert "[netcore] fix some CustomAttribute related tests (#14056)"

This reverts commit b1af4c2726.

* Add parameter validation to Attribute.GetCustomAttribute

* Fix indentation
2019-04-16 08:10:54 +02:00
Kenneth Pouncey 81b0163bca Merge branch 'master' of https://github.com/mono/mono into wasm-sdk-packages 2019-04-16 05:20:44 +02:00
Kenneth Pouncey eb98d562b0 [wasm] [packager] Run mono-cil-strip from wasm-tools (#14035)
* [wasm] Add mono-cil-strip to the wasm tools build

* Run mono-cil-strip.exe from tools.
2019-04-16 04:55:29 +02:00
Zoltan Varga 9d91df98df [llvmonly] Fix a buffer overflow. (#14057) 2019-04-15 19:23:05 -04:00
Bernhard Urban 9ff3b0d65e [aot] change method table generation so that it works for larger assemblies on ARM (#14043)
[aot] change method table generation so that it works for larger assemblies on ARM

At the end of the AOT compilation, we dump a table containing all method
entrypoints using the toolchain linker to resolve the addresses. Previously
we used `bl` for that, however on larger assemblies the offset might
overflow the 24bit immediate (thus, the linker bailing out with
"Error: branch out of range"). Instead, using `ldr pc,=<label>` followed
by `.ltorg` emits the full 32bit address to a method. That takes 8 bytes
for each method instead of 4 bytes.


( I couldn't reopen https://github.com/mono/mono/pull/3486 anymore)
2019-04-15 18:25:51 -04:00
Egor Bogatov b1af4c2726 [netcore] fix some CustomAttribute related tests (#14056)
* fix CA

* fix CA

* remove redundant checks

* remove redundant checks
2019-04-15 19:06:52 +02:00
Filip Navara 30e947a667 Fix stack overflow introduced in 012ac05aa9 2019-04-15 16:59:08 +02:00
Filip Navara 012ac05aa9 [netcore] Misc. fixes (#14050)
* Check for lower bounds on non-zero-based arrays

* Grab correct version of System.Reflection.Context

* Move Attribute type validation to fix checking for custom attributes using interface types

* Fix parameter checks
2019-04-15 15:02:47 +02:00
Vlad Brezae 79f15ccd35 [interp] Static field access fixes (#14009)
* [interp] Further optimize static vt field access

We don't require any write barrier checking since we always copy between interpreter vt_stack and static data. We can also include the vt size in the code stream. Makes it over 1.5x times faster.

* [interp] Fix static field access using ldfld/stfld

Static field access using the ldfld/stfld instructions was not updated when stsfld/ldsfld were optimized.

* [interp] Fix special static vtype field access
2019-04-15 15:35:34 +03:00
Kenneth Pouncey a487fb83b6 use dotnet instead of msbuild 2019-04-15 14:25:52 +02:00
Filip Navara 8c85c29841 [netcore] Switch to msbuild nuget which is available for all platforms (#13989)
* Switch to msbuild nuget which is available for all platforms

* Remove check-env rule dependency

* Add missing reference to System.Composition.TypedParts

* Sort references by name
2019-04-15 11:30:46 +02:00
Kenneth Pouncey 58196e1aab [wasm] [sdk] Build and package the sdk nugets. 2019-04-15 10:26:58 +02:00
Marco Rossignoli 64799bb439 improve entropy (dotnet/coreclr#23591)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-15 08:53:55 +02:00
Egor Bogatov 2a8028f7ce [netcore] Do not inline if [DynamicSecurityMethod] exists (#14032)
* fix crash

* fix build
2019-04-15 08:34:23 +02:00
Raz Friman 791139bead Remove unused offset calculation (dotnet/coreclr#23793)
Utf8Parser has a redundant calculation of date time offset.

Fix #21834

Signed-off-by: dotnet-bot <[email protected]>
2019-04-15 08:32:36 +02:00
Levi Broderick daa940339c Remove old method names from Rune (dotnet/coreclr#23938)
* Remove old method names from Rune, reenable suppressed tests

* Revert re-enablement of failing ArraySegment tests

Signed-off-by: dotnet-bot <[email protected]>
2019-04-15 08:32:36 +02:00
Jay Krell cfdcf29478 Remove redundant check of llvm_acfg->aot_opts.direct_icalls. (#14028) 2019-04-14 15:58:17 -04:00
Filip Navara 7ac572217d [netcore] Make System.Private.CoreLib and host APIs compilable on Windows (#13943)
* Fix Windows builds of CLR hosting API

* Make System.Private.CoreLib compilable on Windows

* Remove accidental change

* Fix Unix build

* Update GlobalizationMode.cs

* Update GlobalizationMode.Unix.cs
2019-04-14 18:58:40 +02:00
Jay Krell 568c822ae9 Remove constant parameter to mono_tls_get_tls_setter and mono_tls_get_tls_getter. (#13894)
It doesn't matter, but for code clarity.
Also strengthen the types of both of these, though rarely enough to avoid casts.
2019-04-14 16:24:18 +02:00
Marek Safar 233f5ad096 Reflect shared partition changes 2019-04-14 15:54:18 +02:00
Jan Kotas 30d94ae529 Fix AssemblyName regression
Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Jan Kotas 1baa703c92 Move GCMemoryInfo to shared partition
Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
dotnet-maestro-bot 592dac20f9 Update BuildTools, CoreClr to preview4-03913-01, preview5-27612-73, respectively (master) (#23916)
* Update BuildTools, CoreClr to preview4-03913-01, preview5-27612-73, respectively

* Fix nullable build errors

Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Jan Kotas 88c35b4974 Delete unused AssemblyName._hashForControl and related code (#23972)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Steve MacLean 64c0733212 EnterContextualReflection handle null (dotnet/coreclr#23953)
* EnterContextualReflection handle null

* Add ContextualReflection MockAssembly test

* Fix ContextualReflection typo

Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Jan Kotas a49d96b057 Delete outdated comment
Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Filip Navara b672c05ad0 Move DateTime Windows implementation to shared CoreLib (#23888)
* Move DateTime Windows implementation to shared CoreLib

* Make all the BOOL/struct marshalling explicit

* internal -> private

* Use unsafe code on all layers, remove unnecessary fixed blocks

Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Jan Kotas 13183af5c3 Delete COMPlus_FinalizeOnShutdown (dotnet/coreclr#23595)
This compat quirk is increasingly more broken since the framework is generally not compatible with, and we have not heard anybody actually using it.

Changed Environment.HasShutdownStarted to unconditionally return false. It does not make sense for it to ever return true with shutdown finalization disabled.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:44:21 +02:00
Kenneth Pouncey a26c8bca81 Updating to recent sdk 1.38.30. (#14023)
osx binaries are now available.

```

touch .stamp-wasm-checkout-and-update-emsdk
cd /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk && ./emsdk install sdk-1.38.30-64bit
Fetching all tags from Emscripten Github repository...
Done. 158 tagged releases available, latest is 1.38.30.
Fetching all tags from Binaryen Github repository...
Done. 85 tagged Binaryen releases available, latest is 1.38.30.
Fetching all precompiled tagged releases..
Downloading: /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk/llvm-tags-32bit.txt from https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/osx_32bit/index.txt
Downloading: /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk/llvm-tags-64bit.txt from https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/osx_64bit/index.txt, 2629 Bytes
Downloading: /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk/upstream/lkgr.json from https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json, 4641 Bytes
Installing SDK 'sdk-1.38.30-64bit'..
Installing tool 'clang-e1.38.30-64bit'..
Downloading: /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk/zips/emscripten-llvm-e1.38.30.tar.gz from https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/osx_64bit/emscripten-llvm-e1.38.30.tar.gz, 318164889 Bytes

```
2019-04-13 06:08:18 -04:00
dotnet-maestro[bot] 3e19f1b052 Update dependencies from dotnet/corefx (dotnet/coreclr#23893)
* Update dependencies from https://github.com/dotnet/corefx build 20190411.2

- Microsoft.NETCore.Platforms - 3.0.0-preview5.19211.2
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview5.19211.2

* Update dependencies from https://github.com/dotnet/corefx build 20190411.22

- Microsoft.NETCore.Platforms - 3.0.0-preview5.19211.22
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview5.19211.22

* Removing renamed HWIntrinsic APIs from S.P.Corelib

* Updating the hwintrinsiclistxarch to match the new intrinsic API names

* Updating the HWIntrinsic generated tests to use the new API names

Signed-off-by: dotnet-bot <[email protected]>
2019-04-13 08:13:39 +02:00
monojenkins 21d82e7d0b [bcl] Update BCL Linked Size 2019-04-13 08:09:56 +02:00
Marek Safar cc5886e3d5 Reflect shared partition changes 2019-04-12 23:45:22 +02:00
Steve MacLean 28e5883c8d Contextual reflection (dotnet/coreclr#23740)
* Add ContextualReflection APIs

Add ContextualReflection APIs approved in dotnet/corefx#36236
Fix issue #22213

* SetParentAssembly even when IsCollectible()
* ContextualReflection tests

* PR Feedback
* Add more usage tests

Add using statement tests
Add bad usage tests including Assert.Throws<>

* Only initialize on set
* Add XML API comments
* Unify VerifyIsolation
* Fix unused expectedAssembly
* Remove ContextualReflectionScope throw
* Clean up TestResolveMissingAssembly et. al
* Remove unused QCall::AppDomainHandle
* Remove AppDomainBaseObject
* Pass AssemblyLoadContext as managed object to native
* Fix AssemblyLoadContextBaseObject packing

* AssemblyLoadContext backing stores

Use explicit backing stores for events and properties

* Remove StaticAsyncLocalCurrentContextualReflectionContext
* Remove PermissionSetObject

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Egor Bogatov 1fc8151c7c Move AssemblyName to shared (dotnet/coreclr#23737)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Ludovic Henry 1271a16b46 Make GC.GetGCMemoryInfo public (dotnet/coreclr#23779)
* Make GC.GetGCMemoryInfo public

This is to be used to allow users to optimize memory consumption based
on what's available to the GC and on the system.

This is based on https://github.com/dotnet/corefx/issues/34631

* Address reviews

- Pass GCMemoryInfo struct to native in place of many arguments
- Make GCMemoryInfo.HeapSize and GCMemoryInfo.Fragmentation long in place of IntPtr

* Address reviews

- Mark GCMemoryInfo readonly

* Rearrange fields and match managed/native names

* Fix compilation

* Use getter shorthand

* Address API Design Review

https://github.com/dotnet/corefx/issues/34631#issuecomment-481358549

* Fix comments

* Fix comments

* Do everything in managed

* Address review

 - Remove unecessary [StructLayout.Sequential]
 - Remove "_" prefix for parameters variables

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Tarek Mahmoud Sayed 79ee7156df Update Range.GetOffsetAndLength (dotnet/coreclr#23855)
* Update Range.GetOffsetAndLength

Make it return offset and length tuple instead of the old Type Range.OffsetAndLength

* Fix the return Tuple fields names

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Tanner Gooding 608be919cb Tweaking some APIs according to user feedback. (dotnet/coreclr#23857)
* Updating the Avx2.ConvertToVector256UInt APIs to return a signed type (matching the native signature and Sse41 APIs).

* Adding explicit overloads for `Sse41.ConvertToVector128Int*` and `Avx2.ConvertToVector256Int*` that take a pointer

* Updating the word ordering for the Compare/CompareScalar methods.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Sung Yoon Whang 28c375e962 Expose new EventCounter APIs (dotnet/coreclr#23808)
* rename BaseCounter to DiagnosticCounter

* Change MetaData->Metadata

* Make EventSource and Name a property for counter classes

* Make the counter APIs public

* fix build errors

* Change float to double

* Few cleanups, fix test

* fix GetMetadataString

* PR feedback

* More PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Jan Kotas 261191886e Disable nullability-related warnings
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Vlad Brezae e30e45f94b [interp] Optimize ldobj/stobj (#13761)
* [interp] Remove dead code

It doesn't make sense to dereference a value type

* [interp] Emit faster instructions for ldobj

* [interp] Emit faster instructions for stobj

* [interp] Simply ldobj vt

This makes it 10x faster

* [interp] Make ldind.r8 unaligned friendly
2019-04-12 21:50:05 +03:00
Levi Broderick e3dd143a5d Clarify comment in 3-byte processing
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 585f55636a Add missing check to 3-byte processing logic
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 51bac6357b PR feedback: Clarify 3-byte sequence processing
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 5246c85995 Fix compilation failure in Utf16Utility
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick d0ec53204d PR feedback: document tempUtf8CodeUnitCountAdjustment usage
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 5034af7331 PR feedback: Clarify charIsNonAscii vector usage
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 02505b8dbd PR feedback: Validate nint definitions
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 94bd111713 PR feedback: Remove redundant endianess checks
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick a92e26d2b4 PR feedback: CountNumberOfLeadingAsciiBytesFrom24BitInteger
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick e1d5e9f79e PR feedback: Fix typos
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 5f292a145d Re-flow Utf8Utility.Helpers
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 445efebc58 Rename DWORD -> UInt32 throughout API surface
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 7bb04786ec Add comments tracking JIT workarounds.
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick d015b30937 Fix incorrect Debug.Assert statements
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick f241bc0016 Expand masks in Utf8Utility, fix const in fallback path
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 9f2d23cf50 PR feedback: Enable SSE2 in Utf16Utility code
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick d7feacf303 PR feedback - Simplify CountNumberOfLeadingAsciiBytesFrom24BitInteger - Extract some consts out to top of file w/ comments
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 4d112e6ef1 PR feedback: GetElement(0) -> Sse2.StoreLow
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 2ecf1e7a20 Simplify vectorized logic; remove unnecessary adjustment
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick f2e4d316e7 Clarify that vector read is unaligned
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 639df30083 Remove SSE41.X64 optimization from AsciiUtility RyuJIT now handles this optimally
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 5a17d4224b Improve perf of "is ASCII?" inner loop in UTF-8 validation.
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 77863a7ab0 Hook up new UTF-8 logic through UTF8Encoding - Add vectorized UTF-16 validation and transcoded byte counts - Move Utf16Utility into Unicode namespace alongside Utf8Utility - Fix some bugs in DecoderNLS's draining logic
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick a86f468670 Add optimized UTF-8 validation and transcoding logic - Hook it up through the existing Utf8 public static APIs - Move some shared methods out of ASCIIUtility - Hook it up through the Utf8String ctor
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Steve MacLean 9501ef8cfb Fix Assembly.LoadFromPartialName(string) (dotnet/coreclr#23912)
Assembly.LoadFromPartialName(string) should not throw FileNotFoundException, but
should rather return null.

ArgumentException should use nameof(partialName)

Fixes #19817

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Stephen Toub 23b6c94d58 Fix Version's comparer operators to allow null (dotnet/coreclr#23898)
Previously for `<`/`<=` it would throw if `v1` argument was null, but for `>`/`>=` would throw if the `v1` argument was null, albeit using `v1` in the exception parameter name.  It's also not expected for comparisons like this to throw, in general.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Filip Navara 2e480766b3 Move TimerQueue.TickCount Windows implementation to shared CoreLib (#23838)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Alexander Köplinger b1c39e4e3d [corlib] Disable FileTest.SymLinkStats() on TVOS
Symlinks on TVOS run into sandboxing restrictions. We've already disabled a similar test.

This test was added recently as part of 26e0b1deec.

(cherry picked from commit b85fdbdb10)
2019-04-12 14:27:41 +02:00
Jay Krell 22bbf4416a Increase gsharedvt trampolines by 10% from 4000 to 4400.
There are many minor arguments here.

Where this matters most -- iOS -- the pool is already dynamic.

Other platforms could use a dynamic pool or JIT (despite FullAOT).
Using JIT would defeat the test coverage.

Mitigates https://github.com/mono/mono/issues/13888.
If this feels too tenative, go bigger.
2019-04-12 08:30:15 +02:00
Maxim Lipnin ded4fa6558 [w32error] Add ENONET error case 2019-04-12 08:29:02 +02:00
Santiago Fernandez Madero 990a90fea0 Add back using to EventSourceException
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 08:15:02 +02:00
Maxim Lipnin 3657c0239a Remove #if-def for TypedReference.MakeTypedReference readonly restriction 2019-04-12 08:07:07 +02:00
Kenneth Pouncey 0d6f7a9e6f Add tests for past issues to catch regressions. (#13981)
- Add IssuesTestSuite to test suite make build.
- Add new issues spec and test calls.
2019-04-12 04:55:14 +02:00
Jo Shields a7c7f903f3 Merge pull request #13998 from directhex/extradist_20190411
[netcore] hand-craft a dist-recursive rule for System.Private.CoreLib
2019-04-11 15:15:29 -04:00
Jo Shields 40e7b26702 [netcore] hand-craft a dist-recursive rule for System.Private.CoreLib
`make dist` stopped erroring in #13961 but didn't actually work, because
the relevant Makefile.am was not distributed, causing configure to fail
(because the Makefile.am was cited as an input, unconditionally).

We can't rely on the dist-recusrive from library.make or build.make because
this lib is in a weirdo format which doesn't comply with the requirements
of those helpers, so craft a simple handwritten replacement for our special
case
2019-04-11 11:04:01 -04:00
Zoltan Varga 5036336df8 [jit] Make dlmalloc use mono_valloc so it picks up the MAP_JIT flag on osx. (#13979)
Fixes https://github.com/mono/mono/issues/13878.
2019-04-11 09:19:42 -04:00
Miguel de Icaza 56db577988 [debugger-agent]: Print error if the socket can not be created, remove assert that probed the wrong value, Coverity 1307166 (#13860) 2019-04-11 09:38:17 -03:00
Zoltan Varga 1a76a455a7 Add missing DynamicSecurityMethod attributes. 2019-04-11 11:21:02 +02:00
Zoltan Varga 8b1a18784d [jit] Disable inlining for methods with [System.Security.DynamicSecurityMethod], its used to make methods which contain a StackCrawlMark.
Also check that the attribute is present for StackMaekMark locals.
2019-04-11 11:21:02 +02:00
Marek Safar 995bbb998c Merge pull request #13815 from radical/nuget-5
[nuget] Bump to nuget 5.0.0
2019-04-11 11:08:41 +02:00
Alexander Köplinger ec045a52b0 [cil-strip] Fix reading of undefined NativeType values in old Cecil (#13954)
cil-strip crashed when processing this method: https://github.com/mono/corefx/blob/f54e64b341a7b114c3502e197b46670cacb28639/src/Microsoft.CSharp/tests/DefaultParameterTests.cs#L88

It uses `MarshalAs((UnmanagedType)2000)`, i.e. an undefined value for the native type. The old Cecil embedded in cil-strip tried to read more than one byte which blows up in this case.

Upstream Cecil just reads a single byte:
https://github.com/jbevain/cecil/blob/1b79b96d29f1e8e9ba832191b1b42ea9cb750d20/Mono.Cecil/AssemblyReader.cs#L3700-L3703

Fixes https://github.com/mono/mono/issues/13639
2019-04-11 11:08:25 +02:00
sancheolz 4eb4173b57 [WinForms] Fix displayed image in TreeNode when ImageIndex set to -2
When ImageIndex in TreeNode set to -2 must not displayed any image
2019-04-11 10:51:59 +02:00
Filip Navara 8ba5a5201f [netcore] Implement Assembly.GetExecutingAssembly with stack mark parameter (#13903)
* Implement Assembly.GetExecutingAssembly with stack mark parameter

* Address PR feedback
2019-04-11 04:31:22 -04:00
Filip Navara 847296f1f0 [netcore] Fix marshalling of ref ptr return types (#13914)
* Fix marshalling of ref ptr return types

* Revert assert -> exception change
2019-04-11 04:31:11 -04:00
Filip Navara a26f73dcd9 Do not crash the runtime in System.Reflection.Emit.ILGeneration tests (#13917) 2019-04-11 04:30:59 -04:00
Johan Lorensson 562ac284e4 Merge pull request #13959 from filipnavara/link-windows
[windows] Link libgcc statically on Windows
2019-04-11 04:18:47 -04:00
Patrik Švikruha 49cc696bd7 fix link in README.MD
fix link to WebAssembly packager.exe in README.MD
2019-04-11 09:50:26 +02:00
Maxim Lipnin 068e8fe042 Use DNS.GetHostAddressesAsync instead of sync version (#13949)
Fixes #13163
2019-04-11 09:07:14 +02:00
Johan Lorensson 0c1489b836 Merge pull request #13946 from lateralusX/lateralusX/merge-icall-hash-maps
Merge icall_hash and icall_hash_foreign into one.
2019-04-11 02:58:59 -04:00
Kenneth Pouncey e0eff41f9e Add generated xml doc to sdk build. (#13965)
- Add the WebAssembly.Bindings.xml to the package.
- Add the WebAssembly.Net.Http.xml to the package.
2019-04-11 07:36:56 +02:00
Kenneth Pouncey 75d74f2eb6 [wasm] Revert Update to emscripten 1.38.30 https://github.com/mono/mono/pull/13759 (#13964)
- 1.38.30 is still not available for mac:
2019-04-11 05:01:36 +02:00
Thays Grazia bf8d7ef448 Cleaning exceptions during static constructor loading (#13962)
Cleaning exceptions during static constructor loading

Reset the stack_trace and trace_ips because the type initialization exception is reused.
Fixes #13714
2019-04-10 18:25:49 -04:00
Jo Shields 9d4d20b389 Merge pull request #13976 from directhex/another-llvm-symbol
Add another symbol for loadedllvm
2019-04-10 15:46:09 -04:00
Jo Shields 8fa16b329c Add another symbol for loadedllvm
Closes https://github.com/mono/mono/issues/13974
2019-04-10 15:45:30 -04:00
Alexander Köplinger 39e5c5f057 [corlib] Disable a ParameterInfoTest test on MONOTOUCH
It needs SRE and even with interpreter config this doesn't work yet.

(cherry picked from commit 766b3204c3)
2019-04-10 21:00:20 +02:00
Marek Safar c10e8da1b5 Merge pull request #13972 from filipnavara/netcore-nullability
[netcore] Disable nullability-related warnings
2019-04-10 19:08:07 +02:00
Marek Safar e1164a8dbd Merge pull request #13963 from Dotnet-GitSync-Bot/mirror-merge-10135517
Mirror changes from mono/corefx,coreclr,corert
2019-04-10 19:07:08 +02:00
Jo Shields fd8598a994 Merge pull request #13973 from directhex/netcore-pipeline
[netcore] Add a Pipeline yaml for Core build
2019-04-10 12:44:50 -04:00
Jason Imison c16b4cff44 [MacSDK] Bump F# to 4.5 (#10919)
* Use a custom prefix instead of trying to infer it, which doesn't work under bockbuild.

The following line is problematic in the scope of building the Mac SDK package (using bockbuild):

https://github.com/fsharp/fsharp/blob/ccfccbacfdb16b2ab143cf83f5ece20f738fd864/mono/config.make#L5

It's problematic because where `mono` lives in this case would be something like `/macsdk-staging-dir/bin/mono` which is not the actual prefix (prefix here being the final destination, `/Library/Frameworks/Mono.framework/...`) but a staging area that bockbuild uses (this is how we build on system prefixes without installing on CI)

For the F# build, bockbuild expects things to end up  in `/fsharp-staging-dir/$(prefix)` (because that's what most `make install`s do when given `DESTDIR=/fsharp-staging-dir/`). If things end up in _any other_ directory in `/fsharp-staging-dir/`  (like `/fsharp-staging-dir/macsdk-staging-dir` in our case) that would cause us to miss packaging those files (this has happened before, with packages that have broken or different use of `DESTDIR`). So there is an added write-protection for anywhere in `/fsharp-staging-dir` that *isn't*  `/fsharp-staging-dir/$(prefix)` , because a write-protection error, while obtuse, is much preferable to missing the fact that some files are not packaged (as would have happened here)

So the fix is to stop trying to infer the prefix, and return to providing it explicitly to the build system (this used to be the case via the `configure` step)

* Also, if we are doing an override of the 'make' command, we need to take care of passing DESTDIR ourselves too

* Since now we perform 'make install' on the make step, make the 'install' step into a no-operation.

* Look for sn where mono is, not in the final destination (which again, may not be the same)
2019-04-10 12:35:44 -04:00
Jo Shields 08a8880ddd Merge pull request #13961 from directhex/makedist_again
[netcore] Fix `make dist`
2019-04-10 12:08:11 -04:00
Jo Shields 992b0249f0 [netcore] Add a Pipeline yaml for Core build 2019-04-10 11:33:20 -04:00
Filip Navara 226d5a0885 Disable nullability-related warnings 2019-04-10 17:31:39 +02:00
Johan Lorensson b016a0a945 Make nullable embedding API's public. (#13950)
Currently we have two nullable API's that will have value in the public
embedding API (already requestsed by users), eliminating the needs to go
from native->managed and back to get nullable information about a type.

mono_class_is_nullable
mono_class_get_nullable_param

This PR moves them from class-internals.h into class.h and mark them
with MONO_API and when needed include GC UNSAFE/SAFE transition.
2019-04-10 11:29:00 -04:00
Alexander Köplinger e8caaa1dbd [configure] Add failsafe for missing submodules (#13957)
GitHub provides a way to download a .zip/.tar.gz of the repository content in their UI, however the archive doesn't contain git submodules.

The mono build then fails with confusing "missing file" errors.

Since GitHub doesn't let us disable the archive download we should at least add some logic to detect this broken case and bail out.
2019-04-10 15:26:28 +02:00
Alexander Köplinger 183b22b4db [System.Net.Http] Make some tests specific to HttpClientHandler
Otherwise they throw PNSE on e.g. WatchOS.

(cherry picked from commit 0b6dbfa349)
2019-04-10 15:03:50 +02:00
Martin Baulig 22c6ed3f1c Add conditionals allowing some calenders to be disabled. (#13730)
Add `GlobalizationMode.Invariant` conditionals to some calendar code.

This allows the Japanese, Taiwan and Hebrew calendars to be disabled.
2019-04-10 13:44:11 +02:00
lateralusX dd2d363e76 WASM driver uses incompatible signatures for icall lookup.
uses_handles parameter is a gboolean -> int32_t in Mono but was uint8_t
in WASM implementation. This triggered a problem when a uninitialized
gboolean was used and only parts of it got set and method still returns
an address, indicating success. This is a different behavior compared to
Mono's default implementation. Fix to this particular problem was to init
the gboolean variable before calling, but good to make sure the signatures are in
sync anyways.
2019-04-10 10:16:32 +02:00
lateralusX 18bba37796 Merge icall_hash and icall_hash_foreign into one.
icalls registered with mono_add_internal_call, mono_add_internal_call_with_flags
or mono_add_internal_call_internal ended up in two different hash tables
depending if they were "foreign" or not. This caused double lookups in
mono_lookup_internal_call_full. There are also use cases where it could be
interesting to keep additional flags related to the icall, that could be
used by codegen for various optimization.

This PR merge the two hash tables into one and add a flag describing icall
details. The flag could later be extended with additional behaviors going
forward if needed.
2019-04-10 10:10:27 +02:00
Aleksey Kliger 72c8776d8f [utils] stub mono_setmmapjit on Win32 and Wasm 2019-04-09 17:35:35 -04:00
Miguel de Icaza bc4a1ac85a Do not use MAP_JIT by default, instead make this something that is toggled by Xamarin.Mac which needs it 2019-04-09 17:35:35 -04:00
Jan Kotas c828db526f Update CoreRT for changes in shared partition
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:31:08 -07:00
Stephen Toub 84b81ac290 Improve RuntimeHelpers.GetSubArray (dotnet/coreclr#23829)
* Improve RuntimeHelpers.GetSubArray

This change does three things.

First, it fixes `GetSubArray` to work when the supplied array is actually a `U[]` where `U : T`.  Currently this case ends up throwing an exception inside of span, which doesn't like working with arrays covariantly.

Second, it fixes argument validation so that we throw an ArgumentNullException if the input array is null rather than NullReferenceException.

Third, it improves the performance of `GetSubArray` for the 95% common case where either `T` is a value type or the type of the array matches the `T` type specified.

* Only use `Array.Empty<T>` when `typeof(T[]) == array.GetType()`

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:26 -07:00
Stephen Toub 2570c11ec4 Fix two new nullable warnings with latest compiler
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:26 -07:00
Hugh Bellamy 727ff4b34d Remove remaining devdocs and cleanup ComponentModel code (#23175)
* Remove remaining devdocs and cleanup ComponentModel code

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:25 -07:00
Jeremy Koritzinsky 6a5487c8e1 Match PtrToStringUTF8 to the other PtrToString* families. (#23731)
* Match PtrToStringUTF8 to the other PtrToString* families.

* Make PtrToString*(IntPtr,int) exceptions consistent.

* Exclude out-of-date tests in CoreFX.

* Update exclusions to cover tests that are now throwing ArgumentOutOfRangeExceptions instead of ArgumentExceptions.

* Fix parameter order for exception.

* Pass value to exception.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:24 -07:00
Steve MacLean 7cf81c817b Whitespace (dotnet/coreclr#23772)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:23 -07:00
Tanner Gooding b7d729d2ef Update the JIT to recognize the IsSupported property for all HWIntrinsics (#23751)
* Moving some JITDUMP calls into Compiler::lookupNamedIntrinsic

* Marking the IsSupported methods as Intrinsic for all HWIntrinsic ISAs

* Updating the hwintrinsic importation to more generally handle IsSupported and ThrowPNSE

* Applying formatting patch.

* Adding using System.Runtime.CompilerServices to the various x86 PlatformNotSupported HWIntrinsic files

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:22 -07:00
Stephen Toub 51d6b9bf02 Don't null out references in Stream/BinaryReader/Writer (#23725)
These types null out some fields on Dispose, and some of those fields are accessible directly via exposed properties, which means that nulling them out would either force us to annotate those properties as being nullable or would require us to lie about them being nullable.  Nulling them out also makes it easier to accidentally null ref in the implementation, and prevents us from making the fields readonly.

It should be exceedingly rare that you dispose of one of these objects and then keep it alive while also being concerned about keeping alive the other helper objects the type uses.  So this change just uses a separate flag to track disposal, and avoids nulling out the fields, which is not a common practice elsewhere in the framework.

This will be a visible change in that after Dispose, properties like StreamWriter.BaseStream/Encoding will now return the stream/encoding rather than null.  In theory that could break someone if they were using those properties to determine whether the writer had been disposed, but that seems unlikely / similar fallout from most any bug fix, and objects generally aren't supposed to be touched after Dispose, anyway.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:21 -07:00
Grant fccd3ad15b Revert optimization (dotnet/coreclr#23759)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:19 -07:00
Levi Broderick a55709fa7a Improve performance of Memory<T>.Span property getter (#23750)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:19 -07:00
Santiago Fernandez Madero ebe0d573b8 Fix Debug.Assert in GenericDelegateCache (dotnet/coreclr#23755)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:18 -07:00
Santiago Fernandez Madero b3d4e338cf Fix merge conflicts on Delegate and String.resx
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:17 -07:00
Stephen Toub 28c0991cfc Fix build break due to conflicting PRs (dotnet/coreclr#23726)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:16 -07:00
Krzysztof Wicher 0ff89565f5 Nullable: shared/System/Security (dotnet/coreclr#23623)
* Nullable: shared/System/Security

* fix windows

* address feedback

* IIIIdentity.Identity?

* apply feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:15 -07:00
Stephen Toub e90270aefb Nullable: Streams (dotnet/coreclr#23703)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:09 -07:00
Bernhard Urban de1fc96374 [aot] use g_malloc () instead of malloc () (#13953)
[aot] use g_malloc () instead of malloc ()

Unbreaks jemalloc support as it hooks into `g_malloc ()` instead of replacing `malloc ()`.

```
%4  0x000055ee6af0d27b in sigabrt_signal_handler (_dummy=6, _info=0x7ffc7b0c4ff0, context=0x7ffc7b0c4ec0) at mini-posix.c:232
%5  <signal handler called>
%6  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
%7  0x00007f4ae0d73801 in __GI_abort () at abort.c:79
%8  0x000055ee6b2ab6ed in rtree_child_leaf_tryread (elm=0x55ee6b75b028 <je_extents_rtree+704104>, dependent=true) at src/rtree.c:205
%9  0x000055ee6b2ab95f in je_rtree_leaf_elm_lookup_hard (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true, init_missing=false) at src/rtree.c:292
%10 0x000055ee6b242f70 in rtree_leaf_elm_lookup (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true, init_missing=false) at include/jemalloc/internal/rtree.h:369
%11 0x000055ee6b242fb5 in rtree_read (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true) at include/jemalloc/internal/rtree.h:394
%12 0x000055ee6b2431ee in rtree_szind_slab_read (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true, r_szind=0x7ffc7b0c6000, r_slab=0x7ffc7b0c6004) at include/jemalloc/internal/rtree.h:446
%13 0x000055ee6b24d468 in ifree (tsd=0x7f4ae1f05738, ptr=0x55ee6c7dfad0, tcache=0x7f4ae1f058f0, slow_path=true) at src/jemalloc.c:2126
%14 0x000055ee6b24de06 in mono_jefree (ptr=0x55ee6c7dfad0) at src/jemalloc.c:2290
%15 0x000055ee6b2c6c68 in monoeg_g_free (ptr=0x55ee6c7dfad0) at gmem.c:83
%16 0x000055ee6adefafa in emit_method_code (acfg=0x7f4ae0986000, cfg=0x7f4ae0ad4e00) at aot-compiler.c:6243
%17 0x000055ee6adf9534 in emit_code (acfg=0x7f4ae0986000) at aot-compiler.c:9704
%18 0x000055ee6ae04a9d in emit_aot_image (acfg=0x7f4ae0986000) at aot-compiler.c:13535
%19 0x000055ee6ae03b7c in mono_compile_assembly (ass=0x7f4ae09a9300, opts=374434303, aot_options=0x7f4ae093c000 "bind-to-runtime-version,outfile=./../../class/lib/build-linux//Microsoft.CodeAnalysis.CSharp.dll.so", global_aot_state=0x7ffc7b0c6438) at aot-compiler.c:13357

```
2019-04-09 16:25:53 -04:00
Stephen Toub a8ba76c4c1 Nullable: System.Threading.Tasks (dotnet/coreclr#23691)
* Nullable: System.Threading.Tasks

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:25 -07:00
Santiago Fernandez Madero 1675c9e7d4 Nullable: All remaining exceptions (dotnet/coreclr#23676)
* Nullable: All remaining exceptions

* Fix build break and PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:21 -07:00
Stephen Toub e4865826f1 Nullable: ReaderWriterLockSlim (dotnet/coreclr#23657)
* Nullable: ReaderWriterLockSlim

* Address PR feedback

* Audit System.Threading for unannotated statics

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:19 -07:00
Stephen Toub 1e799563fc Nullable: System.Threading (dotnet/coreclr#23663)
Finishes off annotation of the System.Threading namespace, not including subnamespaces.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:18 -07:00
Stephen Toub 2a9ae82761 Nullable: Interlocked, Volatile (dotnet/coreclr#23655)
Also fixing the class? annotation on public LazyInitializer methods.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:17 -07:00
buyaa-n 75f54646fb Nullable: System.Enum
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:16 -07:00
Krzysztof Wicher 192062ee5b Nullable: globalization remainder (dotnet/coreclr#23526)
* Nullable: remainder of globalization

* annotate windows specific files

* add TODO-NULLABLE next to TODO suggesting comments

* fixes after merging other globalization annotations, apply feedback

* fix windows

* address feedback

* fix windows

* fixes

* apply feedback

* remove workaround

* s_Invariant?, couple of Debug.Asserts

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:15 -07:00
Stephen Toub e5828e1a8d Nullable: System.Buffers (dotnet/coreclr#23619)
* Nullable: System.Buffers

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:12 -07:00
Stephen Toub aad1b221c5 Nullable: AsyncLocal (dotnet/coreclr#23618)
* Nullable: AsyncLocal

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:10 -07:00
Stephen Toub 95d18423a4 Nullable: WaitHandles (dotnet/coreclr#23604)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:09 -07:00
Stephen Toub 02f2718c86 Nullable: SemaphoreSlim (dotnet/coreclr#23628)
* Nullable: SemaphoreSlim

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:08 -07:00
Stephen Toub 4a47ccbfaf Nullable: ExecutionContext (dotnet/coreclr#23611)
* Nullable: ExecutionContext

* Add TODO comments

* Fix conflict with ThreadPool PR

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:07 -07:00
Stephen Toub 1b6614ea4a Fix build break due to nullable PR conflicts (dotnet/coreclr#23641)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:06 -07:00
Stephen Toub 406cfbc6d3 Nullable: ThreadLocal (dotnet/coreclr#23626)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:05 -07:00
Stephen Toub c9b17e9bed Nullable: Lazy (dotnet/coreclr#23639)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:04 -07:00
Stephen Toub 6f1aaede58 Nullable: SpinWait/Lock (dotnet/coreclr#23613)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:03 -07:00
Stephen Toub 557efaa549 Nullable: CancellationToken (dotnet/coreclr#23609)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:02 -07:00
Stephen Toub 015cc4c0f3 Nullable: ManualResetEventSlim (dotnet/coreclr#23630)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:00 -07:00
Stephen Toub 2bcad8bd47 Nullable: SynchronizationContext (dotnet/coreclr#23634)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:00 -07:00
Santiago Fernandez Madero 6daecf7f18 Nullable: Annotate remaining System.*Exception (dotnet/coreclr#23585)
* Nullable: Annotate remaining System.*Exception

* PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:59 -07:00
Stephen Toub 1e0dc722cc Nullable: ThreadPool (dotnet/coreclr#23600)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:57 -07:00
Dan Moseley 7e2fad45c5 Annotate Unix interop (dotnet/coreclr#23589)
* Unix interop

* More interop

* Fix

* fix

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:56 -07:00
Tanner Gooding b04c1e800a Nullable: System.Runtime.Intrinsics
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:55 -07:00
Tanner Gooding e5f984a353 Fixing the StringInfo constructor to work with the nullability analysis
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:53 -07:00
Krzysztof Wicher 70759684c3 Nullable: DateTimeFormat, DateTimeFormatInfoScanner, SortKey, StringInfo, TextElementEnumerator, TimeSpanFormat, TimeSpanParse (#23486)
* nullable: DateTimeFormat, DateTimeFormatInfoScanner, SortKey, StringInfo, TextElementEnumerator, TimeSpanFormat, TimeSpanParse

* prefix workaround comment with TODO-NULLABLE

* add TODO-NULLABLE

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:52 -07:00
Krzysztof Wicher 3b1c91d8cf Nullable: NumberFormatInfo, CultureInfo (dotnet/coreclr#23459)
* Nullable: NumberFormatInfo, CultureInfo

* fix build

* fix windows

* fix APPX issue

* another appx failure

* get rid of line split

* mark retVal as nullable

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:51 -07:00
Santiago Fernandez Madero 69a0897eb7 Nullable: Exception, SystemException, Argument*Exception (#23515)
* Nullable: Exception, SystemException, Argument*Exception

* Add Debug.Assert rather than comment

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:50 -07:00
Santiago Fernandez Madero e2f1a0913e Nullable: make Object.ToString() return nullable (dotnet/coreclr#23510)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:49 -07:00
Santiago Fernandez Madero 9ff4795adb Nullable: System.Double, System.Single (dotnet/coreclr#23503)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:48 -07:00
Jo Shields 96246ab598 [netcore] Fix make dist
```
make[5]: Entering directory `/mnt/jenkins/workspace/build-source-tarball-mono/mcs/class/System.Private.CoreLib'
make[5]: Leaving directory `/mnt/jenkins/workspace/build-source-tarball-mono/mcs/class/System.Private.CoreLib'

make[5]: *** No rule to make target `dist-recursive'.  Stop.
make[4]: *** [dist-recursive] Error 1
```
2019-04-09 16:06:26 -04:00
Alexander Köplinger c3541fc543 [nunit-lite] Use .NOTPARALLEL to possibly fix some races
We're seeing occasional build errors on CI that seem to be some kind
of race when compiling nunit-lite and nunit-lite-console.
2019-04-09 20:44:43 +02:00
Filip Navara f90133579f Link libgcc statically on Windows 2019-04-09 18:52:12 +02:00
Jo Shields 430307e24b [netcore] Runtime nupkg fixes (#13934)
We can now build `--with-core=only` on Linux or Mac with the same makefile, and have a functional `make nupkg` rule which attempts to produce a .nupkg of the runtime in the format consumed by core-setup.
2019-04-09 17:41:46 +02:00
Jo Shields 6544999e86 Merge pull request #13955 from directhex/more-loadedllvm-magic
Make sure mini_method_is_default_method is in loaded LLVM
2019-04-09 11:28:34 -04:00
Jo Shields 2c42f8d317 Make sure mini_method_is_default_method is in loaded LLVM
mono: symbol lookup error: /usr/lib/libmono-llvm.so: undefined symbol: mini_method_is_default_method
2019-04-09 10:53:53 -04:00
Rolf Bjarne Kvinge 6492dd3a6f [corlib] Fix a few NSLogWriter issues. (#13799)
* [corlib] Make NSLogWriter thread-safe.

* [corlib] Simplify newline checking in NSLogWriter.

Checking the StringBuilder buffer after writing to it instead of the input
string/char[] makes the code somewhat simpler.

* [corlib] Fix NSLogWriter.Write to take into account the index and count parameters.
2019-04-09 14:58:15 +02:00
Johan Lorensson 00b8b21e72 Merge pull request #13928 from lateralusX/lateralusX/use-tls-key-lmf-add-windows
Use TLS_KEY_LMF_ADDR on Windows when pusing lmf frame.
2019-04-09 05:26:35 -04:00
Filip Navara 4449463256 [netcore] Allow reflection invocation of methods with ByRef return types (#13901)
CoreCLR allows reflection on methods with ByRef return types under certain conditions. The PR implementing it is https://github.com/dotnet/coreclr/pull/17639.

Mono already implemented most of it in the marshalling code but artificially blocked it in `ves_icall_InternalInvoke`. I changed the condition for the exception to match the condition in `emit_invoke_call` (marshal-ilgen.c). It's similar to the condition in CoreCLR, but it may not handle byref-like types correctly. It would have to fixed on both places if it turns out to be the case.

The remaining issue is that null references returned in ByRef are not checked and converted to correct exception. It should result in `NullReferenceException` with special message that doesn't get wrapped in `TargetInvocationException`. I put a TODO marker at a place where I think it should be handled, but it's a bit over my head to implement it.

/cc @vargaz
2019-04-09 10:42:18 +02:00
Johan Lorensson fd4539b0ed Merge pull request #13930 from lateralusX/lateralusX/add-supported-additional-defines-windows
Make sure additional supported enable defines ends up in config.h on Windows.
2019-04-09 04:16:44 -04:00
lateralusX 491a4d5da8 Add support for direct icalls not defined in icall-def.h.
An icall declaration can now use the following attribute:

MonoDirectICallSymbolNameAttribute("MyNativeCFunction")

and if not already defined in icall-def.h and direct-icalls are used when
AOT compile the assembly, a direct call will use symbol defined in attribute
as the symbol for direct call. Using this attribute will also enable inlining
for the specific icall wrapper generating inlined direct icalls to external
defined native methods.

This feature is valuable when embedding the runtime and extend with icalls
added using mono_add_internal_call. By applying the above attribute, it is
possible to do AOT with direct-icalls and get static linked icalls without
the need to extend and rebuild cross compiler in the process.
2019-04-09 08:55:29 +02:00
Kenneth Pouncey 68278f0326 [wasm] Core Bindings for SharedArrayBuffer (#13913)
* Add support for core SharedArrayBuffer.

- Add SharedArrayBuffer implementation
- Add SharedArrayBuffer constructors to TypedArray implemenations

* Add tests for SharedArrayBuffer.

- Refactored the test code to add specific test files for Core Bindings.  This separates the tests into specific test regions.
- Moved bindings tests from the http tests to the core bindings tests.

* Cleanup debugging code.
2019-04-09 08:46:36 +02:00
Alexander Kyte b0ae9dbdaa [merp] Restore non-assertion behavior in debugger-engine.c (#13865) 2019-04-08 22:23:35 -04:00
Zoltan Varga 69b6667e2f [llvm] If a true/false branch of a conditional branch is marked as out-of-line, emit an llvm.expect call. (#13915) 2019-04-08 21:57:44 -04:00
Katelyn Gadd ef99519ae5 Bump macsdk msbuild hash to msbuild that uses new roslyn, matching mono master (#13852) 2019-04-09 01:21:39 +02:00
Alexander Köplinger 3903a50e43 [System.Data] Remove unnecessary file from xunit tests (#13935)
It contained DllImports to some Windows APIs which causes issues on xamarin-macios which expects all pinvokes to exist.

Turns out we don't even need that file.
2019-04-08 23:51:34 +02:00
Larry Ewing e51645a560 Merge pull request #13759 from kjpou1/wasm-update-sdk
[wasm] Update to emscripten 1.38.30
2019-04-08 13:23:55 -05:00
lateralusX 03071d5aca Make sure additional supported enable defines ends up in config.h on Windows. 2019-04-08 16:59:10 +02:00
lateralusX f204ccf058 Use TLS_KEY_LMF_ADDR on Windows when pusing lmf frame. 2019-04-08 16:33:03 +02:00
Bernhard Urban 6c774081b5 [AOT] fix winaot LLVM profile (#13909)
[AOT] fix winaot LLVM profile

Regression due to https://github.com/mono/mono/pull/13877
2019-04-08 10:16:37 -04:00
Jo Shields 7b3bb4bfe0 Merge pull request #13918 from directhex/reenable_llvm_test
Reenable LLVM JIT CI
2019-04-08 09:47:14 -04:00
Alexander Köplinger ea13df0e75 Bump bockbuild to get GTK fix (#13912)
https://github.com/mono/bockbuild/pull/93
2019-04-08 15:46:55 +02:00
Jo Shields d52bfac874 Reenable LLVM JIT CI 2019-04-08 09:35:22 -04:00
Zoltan Varga e6385a35c9 [jit] Avoid adding a needless zext which confuses abcrem. (#13890)
[jit] Avoid adding a needless zext which confuses abcrem.

Fixes https://github.com/mono/mono/issues/13889.
2019-04-08 09:06:11 -04:00
Alexander Köplinger da34285bc1 Revert "[image] Create MonoImageStorage to own the image raw data (#13892)" (#13916)
This reverts commit a56573fb7c.
2019-04-08 13:09:46 +02:00
Egor Bogatov b49e72950e [llvm] do not emit safe points for simple methods (#13887)
* do not emit sp on method entry for simple methods

* do not emit sp on method entry for simple methods

* address feedback
2019-04-08 10:53:52 +02:00
Filip Navara f13239aae8 Fix cut & paste error in TypeLoadException constructor 2019-04-08 08:53:57 +02:00
Filip Navara 194c275878 Reenable working Enum tests 2019-04-08 08:53:20 +02:00
Zoltan Varga 8170457d4f [netcore] Remove an assertion which is no longer needed. 2019-04-08 08:48:54 +02:00
Kenneth Pouncey b6237c392f [wasm] Javascript Core Function (#13528)
* Add JavaScript Core support for Function

* Fix compile

* Fix bindings tests

* Add Core Function tests

- TestFunctionSum
   - Create a new Function with a body that returns the sum of two numbers
   - call method `Call` on the sum Function

- TestFunctionApply
   - Return the Math.min function from the Global Math space
   - Call method `Apply` on the min Function to return the minimum value from an array.

* Use Core Function to determine streaming instead of calling InvokeJS which uses javascript Eval.

* Move nested array checking to managed code as per review comments.

- This removes the icall as per review suggestion.
2019-04-08 07:09:27 +02:00
Zoltan Varga e8b77c3af7 [wasm] Generate the pinvoke tables. (#13897)
* [wasm] Generate the pinvoke tables.

Put the default non-linked version of the table into version control, usable by the interpreter only build.

* Add a comment to the generated file.
2019-04-07 06:20:19 -04:00
Aleksey Kliger (λgeek) a56573fb7c [image] Create MonoImageStorage to own the image raw data (#13892)
Create a new data structure: MonoImageStorage.

It is an object that will have the responsibility for the raw data of a
MonoImage.  It has a string key and a refcount that is used to share a
MonoImageStorage between multiple MonoImage objects.

The reason we need this is because the current MonoAssembly/MonoImage design is
broken for multiple domains and (more evidently) it will be broken when we add
AssemblyLoadContext support.  The issue is that a MonoImage may be shared
between multiple domains (or ALCs), but it has a 'references' field which
points to a single other MonoAssembly.

This is a problem because the references of an image may be resolved
differently in different domains (or ALCs).

The eventual solution will be to stop sharing MonoImages based on path name (or
in the case of in-memory images based on a name made up from the address of the
byte blob).

However we still don't want to open the same data more than once (if we're on a
config where we don't have mmap, we malloc some memory and dump the data in
there - we don't want to do that multiple times for the same file).

So the solution is to create this MonoImageStorage object and make it possible
to share it based on path name, but don't give it any responsibilities except
for owning the memory.  It doesn't know anything about metadata or assemblies
or any of that stuff - it just owns a chunk of memory and knows when and how to
free it.

This commit just adds the MonoImageStorage object and wires it up in MonoImage
loading.  There should be no observable behavioral changes from this commit.
2019-04-07 05:23:29 -04:00
Filip Navara 9a63a2d41f Propagate System.Globalization.Invariant from runtimeconfig.json to GlobalizationMode 2019-04-07 08:56:52 +02:00
Filip Navara eddd208dfb Update CoreFX / Runtime versions, download the CoreFX binaries and use them for running the tests 2019-04-07 08:43:06 +02:00
Jay Krell b3917b60ec Remove obsolete AOT relocations for code clarity, assuming no need to support old AOT images. (#13893)
Remove mono_get_throw_exception_by_name declaration.
2019-04-07 02:21:36 -04:00
Miguel de Icaza 7116ecaf4e [metadata] Fix memory leak for the last iteration of the loop, Coverity #1444258 (#13856) 2019-04-06 11:46:27 +02:00
Miguel de Icaza 8567415aea [Coverity] Ensure that we never return -1 from pagesize operation, helps eliminate many false positives (#13863) 2019-04-06 11:41:28 +02:00
Miguel de Icaza af4b09ba27 [metadata] Handle condition in ftell, Coverity 1307192 (#13862)
ftell can be a negative value, handle that scenario.
2019-04-06 11:35:07 +02:00
Filip Navara f29dd7622c [netcore] Implement RuntimeImports.RhBulkMoveWithWriteBarrier (#13840)
* [netcore] Implement RuntimeImports.RhBulkMoveWithWriteBarrier

* Add the actual write barrier to RhBulkMoveWithWriteBarrier

* Rename ves_icall_System_Runtime_RuntimeImports_Memmove_wbarrier to ves_icall_System_Runtime_RuntimeImports_RhBulkMoveWithWriteBarrier

Fixes 15 failures in System.Memory.Tests.
2019-04-06 11:26:55 +02:00
Filip Navara d074481a29 [netcore] Fix Marshal.IsPinnable regression (#13876)
Fix regression from https://github.com/mono/mono/pull/13807/files#diff-e881a4d9491559282e7ae2021f8ad3a4R54.

CoreCLR code for reference: https://github.com/dotnet/coreclr/blob/2f4a7564beb6f8c1f4929504ee2221953d25fc39/src/vm/marshalnative.cpp#L276-L278

Fixes `System.Tests.StringTests.Ctor_CharPtr_DoesNotAccessInvalidPage` in `System.Runtime.Tests`.

My understanding is that IsPinnable should return `true` for:
- Any blittable type
- Any array of blittable types
- Any array of primitive types (covers bool[])
- String, Utf8String (handled separately in managed code in Mono)

It should not return `true` for:
- Primitive non-blittable type
- Value types that are not blittable (eg. contain pointers to other GC objects)
2019-04-06 11:21:07 +02:00
Filip Navara 6346235702 [netcore] More Array.Copy fixes (#13842)
Remaining errors:
```
/Users/filipnavara/Documents/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs(391,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    System.Tests.ArrayTests.Copy_SZArray(sourceArray: [0, 1, 2, 3, null, ...], sourceIndex: 2, destinationArray: [204, 204, 204, 204, 204, ...], destinationIndex: 5, length: 3, expected: [204, 204, 204, 204, 204, ...]) [FAIL]
      System.InvalidCastException : Specified cast is not valid.
      Stack Trace:
        /Users/filipnavara/Documents/mono/mcs/class/System.Private.CoreLib/System/Array.cs(170,0): at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
        /Users/filipnavara/Documents/mono/mcs/class/System.Private.CoreLib/System/Array.cs(87,0): at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
        /Users/vsts/agent/2.149.2/work/1/s/src/System.Runtime/tests/System/ArrayTests.cs(1293,0): at System.Tests.ArrayTests.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Array expected)
        /Users/vsts/agent/2.149.2/work/1/s/src/System.Runtime/tests/System/ArrayTests.cs(1243,0): at System.Tests.ArrayTests.Copy_SZArray(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Array expected)
        /Users/filipnavara/Documents/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs(391,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    System.Tests.ArrayTests.SetValue_Casting_Invalid [FAIL]
      Assert.Throws() Failure
      Expected: typeof(System.InvalidCastException)
      Actual:   (No exception was thrown)
      Stack Trace:
        /Users/vsts/agent/2.149.2/work/1/s/src/System.Runtime/tests/System/ArrayTests.cs(3939,0): at System.Tests.ArrayTests.SetValue_Casting_Invalid()
        /Users/filipnavara/Documents/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs(391,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
```

The last Copy_SZArray test case is `yield return new object[] { new object[] { 0, 1, 2, 3, null, 5, 6, 7, 8, 9 }, 2, new int?[] { 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc }, 5, 3, new int?[] { 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 2, 3, null, 0xcc, 0xcc } };`
2019-04-06 11:17:32 +02:00
Kenneth Pouncey d12d4c9f45 [wasm] Fix Uint8ClampedArray.From(byte[]) invalid cast (#13790)
* Handle Uint8ClampedArray from byte[] array correctly.

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

* Add tests for TypedArray.From

* Fix assert descriptions.

* Add TypedArrayTypeCode which is an enum of typed array types.

- Add tests
2019-04-06 10:36:33 +02:00
Marek Safar 1ae3a94254 Reflect shared code changes 2019-04-06 08:07:10 +02:00
Marek Safar fe75f010c2 Move parts of delegate to shared partition (dotnet/coreclr#23552)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-06 08:07:10 +02:00
Bernhard Urban 61100b24e0 [AOT] remove confusing llcopts flag (#13877)
[AOT] remove confusing llcopts flag

Introduced by
https://github.com/mono/mono/commit/2eeaf888c1d0a681c8705bd609f76196d8fb82ed
2019-04-05 16:05:56 -04:00
Jo Shields 0fc2363a4a Merge pull request #13866 from lambdageek/fix-no-gc-unsafe-dl-fallback-register
[mono-dl] Don't do thread state transitions in mono_dl_fallback_register
2019-04-05 15:50:57 -04:00
Alexander Kyte 5f5c51f3ef [merp] Fix image size reported (#13847)
* [merp] Point managed image_size at correct size field

* [merp] Bump merp version number

Fixes #13834
2019-04-05 21:26:13 +02:00
Alexander Kyte 715d33c46e [llvm] Make GOT a typed struct (#13803) 2019-04-05 15:25:09 -04:00
Vlad Brezae 47a0ad469b [interp] Add intrinsics for common object methods (#13762)
GetHashCode is 2x faster while GetType is 10x faster.
2019-04-05 22:10:16 +03:00
Zoltan Varga 25157c4ccd [netcore] Avoid loading the globalization native lib in invariant mode. (#13853)
* [netcore] Avoid loading the globalization native lib in invariant mode.

* Fix a c++-ism.
2019-04-05 14:48:00 -04:00
Filip Navara 7bf675a760 Remove -noappdomain and -noshadow too 2019-04-05 18:00:49 +02:00
Filip Navara b60ca5fb6b Keep the xunit parallelization setting at default value to allow 'Xunit.CollectionBehavior(DisableTestParallelization = true)' override 2019-04-05 18:00:49 +02:00
Alexander Kyte 0cbdcd8e5a [llvm] Give LLVM noalias info about alloc functions (#13801)
From: https://llvm.org/docs/LangRef.html

```
Furthermore, the semantics of the noalias attribute on return values are stronger than the semantics of the attribute when used on function arguments. On function return values, the noalias attribute indicates that the function acts like a system memory allocation function, returning a pointer to allocated storage disjoint from the storage for any other object accessible to the caller.
```

Think this probably helps LLVM reorder the method calls, telling it that allocating won't return a pointer to something else on the stack.
2019-04-05 17:12:34 +02:00
Aleksey Kliger (λgeek) c434294b24 [metadata] Don't free_aggregate_modifiers in mono_metadata_free_type (#13785)
The aggregate modifiers container is owned by a MonoImageSet.  The aggregate
modifiers may be shared by more than one MonoType that happen to need the same
modifiers. (Similar to how generic instantiations are shared)

When the image set is cleaned up the aggregate modifier cleanup will free the
types in the aggregate modifiers container (the call to
free_aggregate_modifiers in mono_metadata_clean_for_image).

With this extra call to free_aggregate_modifiers in mono_metadata_free_type may
cause the same memory to be freed twice.

Fixes https://github.com/mono/mono/issues/13775
2019-04-05 11:01:24 -04:00
Jay Krell 36c5f3f370 Add MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR and MONO_PATCH_INFO_SPECIFIC_TRAMPOLINE_LAZY_FETCH_ADDR. (#13794)
* Add MONO_PATCH_INFO_LAZY_FETCH_ADDR and MONO_PATCH_INFO_TRAMP_ADDR.
These are int-based alternatives to MONO_PATCH_INFO_JIT_ICALL_ADDR + sprintf.

This clarifies work to remove the JIT icall hash tables that are used with:
 MONO_PATCH_INFO_JIT_ICALL
 MONO_PATCH_INFO_JIT_ICALL_ADDR
 MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL

making it easier to make those enum-based, indexing a fixed size dense array.

As a related side effect, that could be achieved otherwise,
this fixes apparent leaks.

And clarify MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL slightly, by making
searches for it find one more hit.

That is, those three enums are mostly used with a fixed set of strings.
Except for as in this PR where they are used with indefinite strings.
The removal of the indefinite strings eases replacement of the fixed
set of strings with an enum.

* Bump MONO_AOT_FILE_VERSION.

* PR feedback: Remove unused code and historical commentary.
Also updated PR title with more verbose actual names of the new symbols:
  `MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR`
  `MONO_PATCH_INFO_SPECIFIC_TRAMPOLINE_LAZY_FETCH_ADDR`

* Add missing break.
2019-04-05 03:43:28 -04:00
Zoltan Varga 3344bd64c8 [netcore] System.Runtime.InteropServices test fixes. (#13807)
* [netcore] Fix Marshal test failures.

* [netcore] Add exclusions for System.Runtime.InteropServices.Tests.

* [netcore] Make an icall internal.

* Add more test exclusions.

* Address review comments.
2019-04-05 02:13:52 -04:00
Zoltan Varga 22e2cd87a7 [interp] Add more netcore intrinsics. (#13849)
* [interp] Add more netcore intrinsics.

* Address review comments.

* Fix a warning.
2019-04-05 02:13:34 -04:00
Alexander Köplinger 7030a95c84 Fix .vscode/c_cpp_properties.json 2019-04-05 01:04:12 +02:00
Aleksey Kliger 275d1f5d16 [mono-dl] Don't do thread state transitions in mono_dl_fallback_register
1. it doesn't touch the managed runtime

2. it may be called (arguably it ought to be called only) before the runtime is
initialized (and in particular before the current thread is attached).
2019-04-04 18:09:41 -04:00
Vlad Brezae 474305cbce [interp] Fix GetFunctionPointer (#13708)
This method returns a function pointer that can be called with a calli instruction. On interpreter we use a pointer to InterpMethod while on jit we use the native code address. Normally, GetFunctionPointer should return the InterpMethod pointer if called from interp or the native code address if called from jit. Since we don't have any information about the execution engine of the caller, we solve this by intrinsifying all these calls, that happen in the interpreter.

Passing such function pointers between jitted and interp code is probably still unreliable.

Fixes https://github.com/mono/mono/issues/13654
2019-04-04 22:19:50 +02:00
Jo Shields 4b46c5fca4 Merge pull request #13858 from kg/disable-llvmjit-on-ci
Disable llvmjit in the packaging test ci lane so we can turn the lane back on
2019-04-04 16:14:54 -04:00
Katelyn Gadd 5e58ed80c8 Disable llvmjit in this ci lane so we can turn the lane back on 2019-04-04 12:46:45 -07:00
Thays Grazia beb81d3deb [DIM] Do not order implemented interfaces (#13721)
This test https://github.com/dotnet/coreclr/blob/1649da12db73c8c07513c9168cb30ec70c310063/tests/src/Regressions/coreclr/20452/twopassvariance.il

On mono we were ordering the list of implemented interfaces and shouldn't do this as it's described on ECMA-335 Section II.12.2.1 and II.12.2.2.
The ordering was removed on ilasm and some changes were needed on metadata either because it's not ordered anymore.

There were two bugs, one on ilasm and other on class initialization on mono.

### ILAsm ###

If we get the .exe generated by .net Framework it doesn't execute on mono without modifications because we ordered the implemented interfaces list by id. And doing that the order defined on source code is ignored.

If we get the .exe generated by Mono it doesn't execute on .net Framework because on IlAsm we order the list and loose the order defined on source code.

The interfaces on metadata before these changes on IlAsm were like this:
```
1: Fooer1 implements class IFoo<class Derived>
2: Fooer1 implements class IFoo<class Base>
3: Fooer2 implements class IFoo<class Base>
4: Fooer2 implements class IFoo<class Derived>
5: Fooer3 implements class IFoo<object>
6: Fooer3 implements class IBar<class Derived>
7: Fooer3 implements class IBaz<class Base>
8: IBar implements class IFoo<!0>
9: IBaz implements class IFoo<!0>
10: Fooer4 implements IQux
11: Fooer4 implements class IBar<class Derived>
12: IQux implements class IFoo<class Base>
13: IQux implements class IFoo<class Derived>
14: Fooer5 implements IQux
15: Fooer5 implements class IBar<class Derived>
16: Fooer6 implements class IBar<class Base>
17: Fooer6 implements class IFoo<class Base>
18: Fooer7 implements class IFoo<class Base>
19: Fooer7 implements class IBar<class Base>
```

And After the changes they follow the definition order which is the same order of IlAsm for .net framework and .net core.
```
1: IBar implements class IFoo<!0>
2: IBaz implements class IFoo<!0>
3: IQux implements class IFoo<class Base>
4: IQux implements class IFoo<class Derived>
5: Fooer1 implements class IFoo<class Base>
6: Fooer1 implements class IFoo<class Derived>
7: Fooer2 implements class IFoo<class Derived>
8: Fooer2 implements class IFoo<class Base>
9: Fooer3 implements class IBaz<class Base>
10: Fooer3 implements class IBar<class Derived>
11: Fooer3 implements class IFoo<object>
12: Fooer4 implements IQux
13: Fooer4 implements class IBar<class Derived>
14: Fooer5 implements class IBar<class Derived>
15: Fooer5 implements IQux
16: Fooer6 implements class IFoo<class Base>
17: Fooer6 implements class IBar<class Base>
18: Fooer7 implements class IBar<class Base>
19: Fooer7 implements class IFoo<class Base>
```

### Mono vtable layout ###

Internally when Mono computes the interface table for each class, it would previously sort the interfaces by `MonoClass:interface_id` which is a unique id assigned (roughly) in load order.  This was incorrect because the order of the interfaces determines the final vtable for the class.  This PR changes the interface table computation so that the interfaces of a single class are ordered in declaration order, following ECMA. 

One consequence is that we can no longer use binary search with the interface id as the key to find out if a class implements an interface.  We have to do a linear scan. On the other hand, we expect that the number of interfaces implemented by a single class is small in practice.

This is how the Vtable for Fooer1 and Fooer2 looks like after the changes:
```
*** Vtable for class 'Fooer1' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fd78681db20]
[O][001][INDEX 001] object:GetHashCode () [0x7fd78681daf8]
[O][002][INDEX 002] object:Finalize () [0x7fd78681dad0]
[O][003][INDEX 003] object:Equals (object) [0x7fd78681daa8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fd786503800]
[I][005][INDEX 000] IFoo:Gimme () [0x7fd7865038c0]
Packed interface table for class Fooer1 has size 2
[000][UUID 078][SLOT 004][SIZE 001] interface IFoo[Base]
[001][UUID 079][SLOT 005][SIZE 001] interface IFoo[Derived]
```
and
```
*** Vtable for class 'Fooer2' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fd78681db20]
[O][001][INDEX 001] object:GetHashCode () [0x7fd78681daf8]
[O][002][INDEX 002] object:Finalize () [0x7fd78681dad0]
[O][003][INDEX 003] object:Equals (object) [0x7fd78681daa8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fd7865038c0]
[I][005][INDEX 000] IFoo:Gimme () [0x7fd786503800]
Packed interface table for class Fooer2 has size 2
[000][UUID 079][SLOT 004][SIZE 001] interface IFoo[Derived]
[001][UUID 078][SLOT 005][SIZE 001] interface IFoo[Base]
```

This is how the VTable for Fooer1 and Fooer2 looks like before the changes, as you can see Packed interface table are the same in Fooer1 and Fooer2, so the behavior of both classes was the same:

```
Vtable for class 'Fooer1' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fcf3801d920]
[O][001][INDEX 001] object:GetHashCode () [0x7fcf3801d8f8]
[O][002][INDEX 002] object:Finalize () [0x7fcf3801d8d0]
[O][003][INDEX 003] object:Equals (object) [0x7fcf3801d8a8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fcf37c29880]
[I][005][INDEX 000] IFoo:Gimme () [0x7fcf37c29940]
Packed interface table for class Fooer1 has size 2
[000][UUID 076][SLOT 004][SIZE 001] interface IFoo[Base]
[001][UUID 077][SLOT 005][SIZE 001] interface IFoo[Derived]
```

```
Vtable for class 'Fooer2' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fcf3801d920]
[O][001][INDEX 001] object:GetHashCode () [0x7fcf3801d8f8]
[O][002][INDEX 002] object:Finalize () [0x7fcf3801d8d0]
[O][003][INDEX 003] object:Equals (object) [0x7fcf3801d8a8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fcf37c29940]
[I][005][INDEX 000] IFoo:Gimme () [0x7fcf37c29880]
Packed interface table for class Fooer2 has size 2
[000][UUID 076][SLOT 005][SIZE 001] interface IFoo[Base]
[001][UUID 077][SLOT 004][SIZE 001] interface IFoo[Derived]
```
2019-04-04 15:38:21 -03:00
Zoltan Varga aba1bac992 [llvm] Fix llvm JIT. (#13835)
[llvm] Fix llvm JIT.

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-04-04 09:46:06 -04:00
Stephen Toub 463e323a9c Don't null out buffer in MemoryStream on Capacity reset (#23700)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 15:32:31 +02:00
Bernhard Urban 83243d9a3a [fullaot+interp] add Facades to this profile (#13824)
* [fullaot+interp] add Facades to this profile

* [csproj] Update project files
2019-04-04 11:58:53 +02:00
Kenneth Pouncey 55a6457f58 [wasm] Disable debugger tests (#13827) 2019-04-04 11:44:30 +02:00
Sung Yoon Whang 80d5c49c52 Add CPU runtime counter (dotnet/coreclr#23680)
* Add cpu counter

* Fix windows build

* Make the counter just return current CPU usage as %

* Add Unix

* Fix unix build

* Some cleanup

* rename

* fixing some build errors

* some cleanup

* remove unused using

* more cleanup

* newline

* Address PR feedback

* more pr feedback

* More feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:35:46 +02:00
Filip Navara 281721bea0 Move null check into separate method to prevent unnecessary conversion of null into ReadOnlySpan (#23616)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:35:46 +02:00
Jeremy Koritzinsky d8f557209d Change Auto charset to mean UTF-8 off-Windows (dotnet/coreclr#23664)
Match Mono's behavior by changing the Auto character set to mean UTF-8 on non-Windows platforms (new behavior) and UCS-2/UTF-16 on Windows (current behavior).

Fixes #23464
Fixes dotnet/corefx#32442

Impact of breaking change: It is highly unlikely that anyone is actively using current behavior since it is inconsistent with Mono and doesn't match any native system APIs on non-Windows platforms (they're all UTF-8 based).

We will need to update our documentation to reflect this updated behavior.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:35:46 +02:00
Alexander Köplinger e75ba60277 Update csproj file 2019-04-04 11:09:55 +02:00
Jan Vorlicek 2f0ae8e621 Remove s_isProcessExiting and Clear of ALC list at exit
Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:09:04 +02:00
Jan Vorlicek 41316a7438 Deliver Unload event at exit for all ALCs
Sending it just for collectible ALCs is not correct at process exit.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:09:04 +02:00
Jan Vorlicek a449662610 Fix accidental non-collectible context unloading
The OnProcessExit was iterating over the s_contextsToUnload and calling
Unload on each of the contexts. However the s_contextsToUnload is a
misnomer, it contains all the contexts, both collectible and
non-collectible ones. So we were calling Unload on non-collectible
contexts too there. That resulted in InvalidOperationException being
thrown from the OnProcessExit.

This change fixes that by calling unload only on ALCs whose
IsCollectible returns true. It also renames the s_contextsToUnload to
s_allContexts.

Close #22902

Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:09:04 +02:00
Filip Navara 9270f159bf [netcore] Improve support for rare enum types (#13825)
* [netcore] Improve support for rare enum types (IntPtr, UIntPtr, Single, Double, Char, Boolean backing types)

* Add back Intrinsic attribute

* Update Enum.cs
2019-04-04 11:08:07 +02:00
Egor Bogatov 271c4448b4 [netcore] Implement missing Math and MathF methods (#13833)
* Add missing Math(f) methods

* remove extra empty line
2019-04-04 10:37:05 +02:00
Vlad Brezae e6c43065f7 [interp] Optimize static vtype field access (#13769)
We want to avoid calling stackval_to/from methods. Also include the field address in the instruction stream. This makes static vtype field access 10x faster.

Refactor the code a bit.
2019-04-04 11:06:19 +03:00
Alexander Köplinger af92a7fc54 [corlib] Disable EncodingTest.AllEncodingsAreSerializable() on XM4.5 too
(cherry picked from commit 9eb2dbf4cc)
2019-04-04 01:57:21 +02:00
Alexander Köplinger 2f6753a179 Bump bockbuild 2019-04-04 00:12:44 +02:00
Alexander Köplinger 011b333848 Bump linker to latest master (#13818)
(cherry picked from commit 6717c3422a)
2019-04-03 23:42:07 +02:00
Filip Navara c27e3c58c0 [netcore] Implement RuntimeAssembly.InternalLoadAssemblyName 2019-04-03 22:58:41 +02:00
Vlad Brezae cfa75e8ca5 [gsharedvt] Fix sizeof opcode (#13817)
[gsharedvt] Fix sizeof opcode

We were setting the stack type by using another global local named ins.

This lead to missing methods in the aot image due to invalid IL. Fixes https://github.com/mono/mono/issues/13479.
2019-04-03 14:26:00 -04:00
Jo Shields 4c07ca4e46 Merge pull request #13828 from directhex/loadedllvmaot
Add MONO_LLVM_INTERNAL to re-fix LLVM AOT with loadedllvm
2019-04-03 14:09:29 -04:00
Jo Shields 124025fc4d Merge pull request #13750 from directhex/test-installed-prefix-mono
Add tests to ensure `make install` prefix is functional
2019-04-03 13:38:20 -04:00
Jo Shields 656208c004 Add MONO_LLVM_INTERNAL to re-fix LLVM AOT with loadedllvm 2019-04-03 13:19:57 -04:00
Vlad Brezae f98a81b488 [interp] Add intrinsics for Math operations (#13635) 2019-04-03 19:56:35 +03:00
Marek Safar 9bdf6c2c6c [netcore] Simplify runtime and tests synchronization 2019-04-03 17:35:14 +02:00
Alexander Köplingeranddirecthex 4df8ca38d6 Update scripts/ci/run-test-make-install.sh
Co-Authored-By: directhex <[email protected]>
2019-04-03 10:47:10 -04:00
Alexis Christoforides bd25e86727 [MacSDK] Bump bockbuild for fix to https://github.com/mono/mono/issues/13804 2019-04-03 10:41:10 -04:00
Jo Shields 8bd6a288b5 Add tests to ensure make install prefix is functional
Adds 5 quick checks, on prefix-tests tag:
* Build a basic file with mcs
* Build a basic file with Roslyn
* AOT an assembly
* LLVM AOT an assembly (loadedllvm)
* LLVM JIT an assembly (loadedllvm)

This should let us spot regressions affecting installed prefixes sooner
2019-04-03 09:11:54 -04:00
Filip Navara 180915ffa6 [netcore] Improve element type checks in Array.Copy and Array.ConstrainedCopy (#13811)
* [netcore] Improve element type checks in Array.Copy and Array.ConstrainedCopy

* Reshuffle ifs
2019-04-03 12:09:51 +02:00
Ankit Jain 285443b5d4 [nuget] Bump to nuget 5.0.0 2019-04-03 04:26:15 -04:00
Filip Navara ced517784b [netcore] Reenable some methods on RuntimeType 2019-04-03 10:23:56 +02:00
Jan Kotas 757a07c284 Avoid unnecessary SetLastError on PInvokes (dotnet/corefx#36544)
These console PInvokes are used in nearly every app. Omitting unnecessary SetLastError
will save us from generating marshalling stub for them.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-03 10:20:58 +02:00
Filip Navara bd8ec57901 [netcore] Bump SDK version 2019-04-03 10:16:28 +02:00
Jay Krell 5ed727ed8e Rename cabs/cimag/creal to mono_cabs/mono_cimag/mono_creal without macro to rename. (#13663)
Also make cimag/creal macros for guaranteed inlining -- instead of passing structs by value.
And add spaces before parens to follow coding convention (which is designed
to ease low tech searches for entire words).

This was agreed to when the code was first ported to C++ but got dropped.
The compromise though was to put the defines relatively late to limit their impact.
2019-04-03 03:26:28 -04:00
Alexander Köplinger 02946b7ced [bcl] Fix compiling nunitlite when PARENT_PROFILE is defined (#13791)
In this case we relied on nunitlite to be compiled when the parent profile is compiled. That doesn't work however if we compile the child profile first (e.g. during a parallel make) since it'll
complain about missing nunitlite.dll.

We now compile nunitlite in the child profiles too even though we don't use it.
This is an alternative solution to what I tried in https://github.com/mono/mono/pull/5357 since I couldn't get it to work and this should be the easier fix.

It allows us to finally remove the `-i` (ignore errors) from the CI scripts and catch test assembly breakages in mobile profiles which we ignored before.
2019-04-02 21:41:43 +02:00
Jo Shields 688ac23fb6 Merge pull request #13797 from directhex/remove-csc-dim-some-more
Remove csc-dim script, since csc-dim is gone
2019-04-02 14:04:55 -04:00
Filip Navara 02be9aeba3 [netcore] Cleanup + test fixes (#13795)
Avoid using `wget` since it's not installed on macOS by default.
2019-04-02 17:49:20 +02:00
Jo Shields d828e92449 Remove csc-dim script, since csc-dim is gone 2019-04-02 11:20:38 -04:00
Egor Bogatov 3bb6fe8797 [netcore] Fix few Array tests (#13756)
* fix test

* fix tests

* Fix ArgumentNullException empty ParamName

* System.Text.Tests.StringBuilderTests are fine

* fix BlockCopy test

* enable more tests

* Enable more tests

* address feedback
2019-04-02 14:48:53 +02:00
Alexander Köplinger 448cf31a8d [System] Clear MONO_CFG_DIR before starting mcs in CodeDOM CSharpCodeGenerator for XM4.5 (#13742)
* [System] Clear MONO_CFG_DIR before starting mcs in CodeDOM CSharpCodeGenerator

This showed up in the xamarin-macios 2019-02 integration.
When you used Xslt with a custom C# script in a Xamarin.Mac Full application
we'd try to launch mcs via CodeDOM to compile the script.

This started failing in 2019-02 because System.Native (mono-native) wasn't found,
the reason is that XM sets MONO_CFG_DIR to point to the Contents/MonoBundle
in the app bundle where it packages the global config file with dllmaps.

However the started Mono wasn't able to find mono-native since the config
there uses a different name for the file.

To prevent that we now clear MONO_CFG_DIR so it uses the default value for the
mono process we're starting (note that setting it to String.Empty doesn't work)

* Make it specific to XM 4.5
2019-04-02 10:46:07 +02:00
Zoltan Varga df846bcbc9 [netcore] Fixes for System.Reflection tests. (#13776)
* [netcore] Add error checking for assembly version parsing, pass the full 32 bit value to managed code.

* [netcore] Implement RuntimeType.StructLayoutAttribute.

* [runtime] Implement RuntimeFieldHandle.GetValueDirect (), convert SetValueDirect () to handles.

* [netcore] Implement Assembly.GetFiles ()/GetForwardedTypes ().

* [runtime] Handle 'ARM' as a valid architecture in assembly name parsing.

* [netcore] Implement ParameterInfo.MarshalAsAttribute, AssemblyName.EscapedCodeBase.

* [netcore] Add exclusions for System.Reflection.Tests.

* [netcore] Update test exclusions.

* [netcore] Fix CustomAttributeExtensions.

* [netcore] Add a list of passing test suites.

* [netcore] Add a missing argument check.

* Update Object.cs
2019-04-02 09:02:25 +02:00
Krzysztof Wicher b7140b3a9e PermissionSet: follow netfx more in order to avoid workarounds with nullable (#23637)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-02 08:54:54 +02:00
Krzysztof Wicher 9bbfc63c4c Change PermissionSet.SyncRoot to return this instead of null (#23631)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-02 08:36:39 +02:00
Filip Navara a63a85b21d [netcore] Add exception for System.Threading.ThreadPool tests 2019-04-02 00:08:49 +02:00
Filip Navara ed01dc0e92 [netcore] Add exception for System.IO tests 2019-04-02 00:08:49 +02:00
Filip Navara 8b2463b57c [netcore] Add exception for System.Text.Json tests 2019-04-02 00:08:49 +02:00
Levi Broderick b4b41e15d5 Fix bad Debug.Assert statements in UTF-8 processing (dotnet/coreclr#23627)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-01 23:36:28 +02:00
Zoltan Varga cee8934bce [netcore] Fix a number of SRE argument checking failures. 2019-04-01 23:20:38 +02:00
Zoltan Varga 7b2d7dfd6f [netcore] Implement RuntimeMethodInfo.GetPseudoCustomAttributes (). 2019-04-01 23:20:38 +02:00
Zoltan Varga 476514ec98 [sre] Emit custom modifiers for return values. 2019-04-01 23:20:38 +02:00
Acid Chicken (硫酸鶏) 004f1ba107 Add new era in Japan called "Reiwa" (dotnet/coreclr#23614)
* Add new era in Japan called "Reiwa"

* Update Japanese eras English names

refs: <https://github.com/dotnet/coreclr/pull/23614#issuecomment-478680005>

Signed-off-by: dotnet-bot <[email protected]>
2019-04-01 23:05:21 +02:00
Filip Navara a1e65c0559 [netcore] Fix TrySetApartmentStateUnchecked return value 2019-04-01 23:04:41 +02:00
Jo Shields 262a543a17 Fix tarball builds 2019-04-01 15:50:51 -04:00
Alexander Köplinger 7a9cb8f420 Apply API snapshot and csproj changes from https://github.com/mono/mono/pull/13767 2019-04-01 21:45:41 +02:00
Martin Baulig f42f1026cd Add netcore/Makefile to .gitignore (#13771) 2019-04-01 20:14:22 +02:00
Zoltan Varga 37a09e9eb0 [interp] Add Internal.Runtime.CompilerServices.Unsafe intrinsics. (#13732)
[interp] Add Internal.Runtime.CompilerServices.Unsafe intrinsics.
2019-04-01 13:15:52 -04:00
Jay Krell ff1d485b56 Fix a few deficiencies in mono_path_filename_in_basedir. Mainly strstr. (#13719)
* Fix a few deficiencies in mono_path_filename_in_basedir.
The main one is that strstr is too loose.
Add tests.
Make it case insensitive on Win32 and allow some denormal input.
 Note that case sensitivity is a function of file system, not
 operating system, but a lot of code gets it wrong, so here does too.

Add more data to asserts.

Account for test reality -- filename is not absolute.

The Win32 code paths can be tested on Unix and vice versa
w/o compromise. See https://github.com/mono/mono/pull/13707

* Reduce testing per PR feedback.

* Edit/add comments.
This is an attempt to clarify and hopefully doesn't backfire.

* Try to make tests clearer, and stop skipping some oops.

* PR: Restore case insensitivity testing on Windows. Tweak a little bit.

* Include the .c file instead of .h to fix some builds.
2019-04-01 12:43:10 -04:00
Jo Shields c4eb7d679b Merge pull request #13767 from directhex/master
Bump version to 6.3
2019-04-01 11:40:54 -04:00
Jo Shields b198ef5ad6 Bump version to 6.3 2019-04-01 10:43:21 -04:00
Filip Navara acb8dd1183 Fix WASM build (#13763)
Broken by https://github.com/mono/mono/pull/13712.
2019-04-01 12:15:50 +02:00
Alexander Köplinger 7c62c3b838 Update API snapshot 2019-04-01 11:33:15 +02:00
monojenkins df0b3ae630 [bcl] Update BCL Linked Size 2019-04-01 08:12:39 +02:00
Kenneth Pouncey a26ef0b6a1 [wasm] Update to emscripten 1.38.30 2019-04-01 06:02:43 +02:00
Marek Habersack acbeffd073 [sdks,mac] Remove dependency on MXE in favor of MinGW
It turns out that homebrew now has a package for the MinGW gcc-based windows
cross compiler which is awesome as it allows us to skip building MXE and use the
latest version of the GCC suite pre-packaged for Mac. This commit removes almost
all traces of MXE (except for `mxe.mk` itself, because I don't know if any bot
or external tool, whatever, use targets in it) and adds the following brew
packages to SDK bot provisioning as well as to the `provision-mxe` target of
Mono SDKs:

  * mingw-w64
  * xamarin/xamarin-android-windeps/mingw-zlib

The latter package builds a Windows version of zlib using MinGW and it comes
from Xamarin's own homebrew tap at https://github.com/xamarin/homebrew-xamarin-android-windeps/blob/f4cc90845ff1953800d8d71035566a12d9b7aa24/mingw-zlib.rb

Additionally, this commit adds a new `configure` flag: `--with-static-zlib=PATH`
which allows one to specify the static zlib archive to use when linking Mono.
The static archive supersedes the otherwise indicated or detected zlib. This is
the recommended mode of operation for MinGW builds as it avoids problems with
`zlib.dll` versions on the target machine.
2019-03-31 11:51:13 -04:00
Filip Navara 9ccfd778e3 [System.Private.CoreLib/mscorlib] Implement Interlocked.MemoryBarrierProcessWide (#13712)
* Implement Interlocked.MemoryBarrierProcessWide

* Bump MONO_CORLIB_VERSION

* Bump API snapshot submodule
2019-03-31 12:08:51 +02:00
Ganbarukamo41 e894d683f9 Implement IEquatable to Memory and ReadOnlyMemory (dotnet/coreclr#23586)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-31 09:51:23 +02:00
Egor Bogatov 282a9635b3 fix IsPinnable 2019-03-31 09:50:09 +02:00
Marcos Cobeña Morián 4747e3c057 Fixed casing (#13736) 2019-03-30 16:53:24 +01:00
Steve MacLean 7ffd5ed8aa Assembly.Load ALC name (dotnet/coreclr#23574)
Use normalized path for ALC name

Signed-off-by: dotnet-bot <[email protected]>
2019-03-30 00:39:00 +01:00
Alexander Köplinger 5cce664b6f Update System.Net.Http for Watch
(cherry picked from commit 4e3ef48ff0)
2019-03-30 00:13:07 +01:00
Alexander Köplinger bb4a72ae3b Bump binary-reference-assemblies
(cherry picked from commit 0366d7da15)
2019-03-29 23:51:52 +01:00
Alexander Köplinger a2462e19e9 [System.Net.Http] Add IVT to Xamarin.* assemblies and update Mac
NSUrlSessionHandler is in Foundation namespace on XM

(cherry picked from commit 5460d8af74)
2019-03-29 23:48:52 +01:00
Marek Safar 4d7931cd0f enable more tests 2019-03-29 23:30:00 +01:00
Marek Safar c302bfdc66 [netcore] Reorder test targets 2019-03-29 23:30:00 +01:00
Marek Safar b3fc4b1263 [System.Private.CoreLib] Adopt delegate to netcore 2019-03-29 23:30:00 +01:00
Marek Safar ec0618dd9e [System.Private.CoreLib] Fix the type conflicts with corefx types 2019-03-29 23:30:00 +01:00
Jo Shields 37a4bd4c08 Fix for OpenBSD scope error in https://github.com/mono/mono/pull/13633 2019-03-29 16:54:26 -04:00
Martin Baulig ccb95fc05f [wasm]: Disable managed collation on wasm. (#13684)
* The `SimpleCollator` class now implements a new internal interface `ISimpleCollator`.
  In `CompareInfo`, we reference it by that interface everywhere except `GetCollator ()`,
  so we can `#if`-def it out.

  Later on, we will use the linker to do this dynamically with some sort of conditional,
  but even then the interface is required to limit references to the `SimpleCollator` type
  to one single method.

* Add `Mono.Globalization.Unicode/SimpleCollator.cs` to `wasm_corlib.dll.exclude.sources`.

* `corlib/Makefile`: remove collation resources on WASM.

* Added new `[Category ("ManagedCollator")]` to the relevant tests.
2019-03-29 21:31:17 +01:00
Aleksey Kliger (λgeek) 20b523ee9c [arm] Don't use C++ keyword as a variable name (#13744)
Fixes the nightly C++ Jenkins jobs
https://jenkins.mono-project.com/job/test-mono-mainline-linux-cxx/
2019-03-29 16:27:49 -04:00
Alexander Köplinger 41672cbc74 Bump binary-reference-assemblies 2019-03-29 19:43:24 +01:00
Alexander Köplinger 15a0b97b10 [System.Net.Http] Move Mac/iOS specific HttpMessageHandler's to Xamarin.*.dll (#13746)
* Revert "[System.Net.Http] Move NSUrlSessionHandler from xamarin-macios to mono (#13229)"

This reverts commit 5bf74a9954.

* [System.Net.Http] Move Mac/iOS specific HttpMessageHandler's to Xamarin.*.dll

We decided to move these types into Xamarin products since they can't be
used without the underlying infrastructure anyway.

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-29 19:27:07 +01:00
Jo Shields 9ebf3a834c Merge pull request #13747 from directhex/dependency_tracking_is_hard
Add missing assemblies needed by Roslyn snapshot
2019-03-29 14:03:40 -04:00
Jo Shields ece0f7cc26 Add missing assemblies needed by Roslyn snapshot 2019-03-29 14:03:06 -04:00
Jo Shields fbc7da2a3f Merge pull request #13633 from rfht/master
Fix DNS Name Resolution Failure on OpenBSD (GitHub issue #8168)
2019-03-29 13:27:48 -04:00
Filip Navara a7a225ceaf [netcore] Guard for skipFrames overflow, update test exclusions (#13745)
* [netcore] Guard for skipFrames overflow

* [netcore] Remove Timer tests exclusion

* [netcore] Remove unnecessary null check
2019-03-29 17:53:52 +01:00
Katelyn Gadd 0de947787c Add missing roslyn assemblies to mcs package makefile (#13738)
* Add missing roslyn assemblies to mcs package makefile

* Remove deploy step for dynamic interface methods prototype since current roslyn has DIM

Roslyn picked up some new dependencies that I failed to add to a Makefile containing a list of its dependencies. This may fix some scenarios (not covered by CI) that result in csc and/or msbuild not working.
2019-03-29 16:39:11 +01:00
Koundinya Veluri 3eef668848 Change Timer implementation on Unixes to use only one scheduling thread (#7071)
* Change Timer implementation on Unixes to use only one scheduling thread

- Separated from https://github.com/dotnet/corert/pull/7066

* Address feedback from https://github.com/dotnet/corert/pull/7066

* Remove reference to s_lock

* Reduce work inside lock

* Move _id

* Fix duplicate timers in scheduled timer list, move info to TimerQueue

Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 15:21:46 +01:00
Egor Bogatov 8cce577994 Update tests 2019-03-29 14:56:22 +01:00
Filip Navara 7ea8460025 Make the DnsTest more resilient to multi-IP DNS results (#13737)
Sometimes Google DNS is/was returning "dns.google" for reverse query of 8.8.8.8 and 8.8.4.4 instead of the expected "google-public-dns-a.google.com" and "google-public-dns-b.google.com". Since "dns.google" resolves to both 8.8.8.8 and 8.8.4.4 in random order the round-trip tests for IP -> hostname -> IP were failing when they got the other IP.

This changes the logic in the hostname -> IP check to check whether the expected IP is any one of the returned ones (ie. non necessarily the first one).
2019-03-29 14:54:49 +01:00
Tanner Gooding 40532637b9 Updating BuildTools, CoreCLR to preview4-03828-01, preview4-27528-71, respectively (#23536)
* Removing FeedTasksPackageVersion from dependencies.props
* The corresponding metadata was removed in https://github.com/dotnet/coreclr/pull/22884

* Updating BuildTools, CoreCLR to preview4-03828-01, preview4-27528-71, respectively

* Adding a ! in String.Searching.cs

Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 14:46:41 +01:00
Zoltan Varga 77e99d080d [netcore] Ongoing work. (#13731) 2019-03-29 12:47:16 +01:00
Ben Adams 20c9bdc20a Avoid boxing allocations for async in Tier0 (dotnet/coreclr#22984)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 08:04:23 +01:00
Marek Safar afb35526cf Simplify StackFrame class (dotnet/coreclr#23483)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 08:04:23 +01:00
Jan Kotas 9d354a7332 Delete RuntimeThread.cs (dotnet/coreclr#23532)
No longer needed

Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 08:04:23 +01:00
Levi Broderick e2c52c86d3 Improve performance of Marvin32 (dotnet/coreclr#22816)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 08:04:23 +01:00
Sung Yoon Whang 419b334239 Fix increment calculation in IncrementingPollingCounter (#23502)
* Add test for IncrementingPollingCounter

* Fix a bug in Increment calculation in IncrementingPollingCounter

* Remove setting DisplayName property since that's a private property for now

* fix comment

* Remove unused variables

Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 07:56:07 +01:00
Santiago Fernandez Madero cbf08f3dd6 Nullable: System.Object (dotnet/coreclr#23466)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 20:17:41 +01:00
Krzysztof Wicher b2e00ef754 Nullable: all calendars (dotnet/coreclr#23469)
* calendar

* nullable: all calendars

* fix likely corert error

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 20:17:41 +01:00
Santiago Fernandez Madero bc096b344f Nullable: System.Char (dotnet/coreclr#23480)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 20:17:41 +01:00
Egor Bogatov 2522547cd5 [netcore] Improve xtest command (#13703)
The python script now also extracts downloaded zips and `make xtest-%` is now able to consume these artifacts.
E.g.
```
make xtest-System.Collections.Tests COREFX_ROOT=/prj/corefx-repo
```
We still need COREFX_ROOT because of two missing files:
`CoreFx.Private.TestUtilities.dll` and `xunit.console.deps.json`
maybe I should just add them to our repo?

Also this PR fixes `RemoteExecutorConsoleApp` problems for `make xtest-%`
2019-03-28 18:00:34 +01:00
Larry Ewing 49ba9f32ec Merge pull request #13705 from kjpou1/wasm-issue-12871
[wasm] Fix System.DllNotFoundException: libc
2019-03-28 11:44:43 -05:00
Alexander Köplinger f48b0a70c3 [Mono.Runtime.Tests] Remove duplicate file in .sources 2019-03-28 16:40:07 +01:00
simplejackcoder e3471b915d GetPinnableReference on String.cs (dotnet/coreclr#23428)
* GetPinnableReference on String.cs

* Add attributes for debugger and performance

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 16:31:00 +01:00
Jo Shields 7e99ce2960 Merge pull request #13700 from directhex/compress-with-xz
Switch `make dist` format from BZip2 to XZ.
2019-03-28 11:22:09 -04:00
Radek Doulik 4cf13bcd16 [profiler] Add duration=NUM parameter to AOT profiler (#13688)
* [profiler] Add duration=NUM parameter to AOT profiler

It instructs the AOT profiler to write the data after NUM seconds
measured from runtime initialization.

* [profilers] Added aot:duration=NUM parameter description
2019-03-28 10:54:36 -04:00
Alexander Köplinger c6b066a7ab Bump corefx to get unit test reliability fix (#13709) 2019-03-28 15:46:21 +01:00
Jo Shields ac0f7ece35 Merge pull request #13699 from directhex/no-more-monograph
Delete monograph. Closes https://github.com/mono/mono/issues/7845
2019-03-28 10:18:53 -04:00
Maxim Lipnin 03e3608b87 Move checks for empty command text to SqlCommand 2019-03-28 15:02:24 +01:00
Maxim Lipnin b1a0ee371a Throw ArgumentException if there is no active statement during reading a row 2019-03-28 15:02:24 +01:00
Filip Navara 8f99674718 Update Makefile 2019-03-28 14:36:07 +01:00
Filip Navara 141493c473 Separate out common code from pinvoke_probe_for_module_relative_directories into pinvoke_probe_for_module_in_directory 2019-03-28 14:36:07 +01:00
Filip Navara 4648210f3b [netcore] Move P/Invoke directory lookup from mono_dl_fallback to pinvoke_probe_for_module_relative_directories 2019-03-28 14:36:07 +01:00
Filip NavaraandAleksey Kliger 3e05b4ea77 [netcore] Handle NATIVE_DLL_SEARCH_DIRECTORIES for p/invoke
Co-authored-by: Aleksey Kliger <[email protected]>
2019-03-28 14:36:07 +01:00
Jan Kotas 8bad65acb8 Move QueryPerformanceCounter PInvokes to shared (dotnet/corefx#36409)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
buyaa-n e76b69f37b Nullable updates for byte type (dotnet/coreclr#23460)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
buyaa-n 1feba9a019 Nullable changes for boolean type (dotnet/coreclr#23451)
* Nullable changes for boolean type

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Santiago Fernandez Madero 6b79fcecc8 Nullable: String (dotnet/coreclr#23450)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Krzysztof Wicher 6ac3ca34e7 nullable: number (dotnet/coreclr#23454)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Krzysztof Wicher c0f4d63fa0 Nullable: Uint32, (U)Int16, (U)Int64 (dotnet/coreclr#23449)
* Nullable: UInt32

* (U)Int16, (U)Int64

* Make NumberFormatInfo non-nullable

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Krzysztof Wicher 23b6018c77 Nullable: Int32 (dotnet/coreclr#23443)
* Nullable: Int32

* remove restore and move nullable up front

* remove trailing \n after #nullable to make it easier to remove later

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Steve MacLean dae859e9e2 ALC Enhancement nits (dotnet/coreclr#23506)
isCollectible default should be false
String should be string

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Steve MacLean ea3b4ae05f ALC enhancements (dotnet/coreclr#22273)
* Initial implementatation of ALC enhancements

Add public constructor with name
Add Name property
Add Assemblies property
Add All property
Override ToString
Name Default and Assembly.Load(...) ALCs
Add AssemblyLoadContext30Extensions test

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:02:28 +01:00
Vlad Brezae 23aa609af7 [interp] Small changes (#13691)
* [interp] Extract the code pushing lmf in separate function

There is no reason to not optimize the code inside do_icall

* [interp] Remove dead code

Trace ips are filled in mono_handle_exception_internal
2019-03-28 13:12:17 +01:00
Zoltan Varga 34f3b8947c [llvm] Fix the computation of size of gshared instances in another place.
Fixes https://github.com/mono/mono/issues/13610.
2019-03-28 13:07:45 +01:00
Filip Navara d261a9ace1 [netcore] Implement missing functions in RegisteredWaitHandle and EventWaitHandle 2019-03-28 08:30:20 +01:00
Jay Krell 83acc1a343 Restore domain in error path. (#13662)
* In mono_threadpool_enqueue_work_item, if mono_runtime_invoke_checked fails,
still restore domain.

In mono_threadpool_enqueue_work_item, acknowledge with a comment but do not change
that mono_domain_set failing leads to returning success.

In mono_threadpool_enqueue_work_item, refactor for sharing code without loss
of efficiency or hopefully clarity.

* Keep this line duplicated:
`mono_runtime_invoke_checked (unsafe_queue_custom_work_item_method, NULL, args, error);`
2019-03-28 02:20:53 -04:00
Jay Krell 3fae397cce Cleanup mono_marshal_get_icall_wrapper (#13661)
Every caller was consistently forming the same name based on callinfo->name
and passing callinfo->func and callinfo->sig.
Pass callinfo instead and do the common work in mono_marshal_get_icall_wrapper.

This has the following side effects:
 Do not form and free name when there is a cache hit. This seems like a nice optimization.
 Allow name when there is a cache hit. This is unintended. We could assert if it is a problem.
2019-03-28 02:20:35 -04:00
Kenneth Pouncey 4904dac430 [wasm] Fix System.DllNotFoundException: libc
Fixes issue: https://github.com/mono/mono/issues/12871
2019-03-28 06:42:10 +01:00
Zoltan Varga 5433bd030e [runtime] Revert daf92b9e62. (#13696)
Fixes https://github.com/mono/mono/issues/13607.
2019-03-27 23:46:43 +01:00
Jo Shields a9c340a063 Switch make dist format from BZip2 to XZ.
Closes https://github.com/mono/mono/issues/9267
2019-03-27 15:50:25 -04:00
Jo Shields 38fdb39cac Delete monograph. Closes https://github.com/mono/mono/issues/7845 2019-03-27 15:45:06 -04:00
Alexander Köplinger 77cf4cc4f8 [tests] Remove MONOMAC ifdef from BCL tests (#13694)
It was set by xamarin-macios when they were still taking the raw .cs source files
but since we switched to prebuilt binaries we need to replace it with
some define we're actually setting in Mono.

Most cases can be replaced by just XAMMAC_4_5 since MOBILE is defined on the xammac profile.
2019-03-27 20:21:48 +01:00
Jo Shields e40d76cb4a Merge pull request #13673 from directhex/runtime-nupkg
Runtime nupkg generation
2019-03-27 14:39:17 -04:00
Alexander Köplinger e8c660ce90 [mono] Don't try "open" handlers on iOS/Android in ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (#13693)
When you use `Process.Start()` with `UseShellExecute=true` (which is the default on Mono/.NET Framework, but false on .NET Core) then we'd still try to first start the file directly, before falling back to trying the "open" handlers like xdg-open to launch the file.

Presumably we do this so that on mobile you can still start a process without needing to explicitly set `UseShellExecute=false`.

However we don't need to try the fallback on iOS/Android since the "open" handlers won't work there anyway.

This recently showed up on the Xamarin.iOS Mono 2019-02 integration where we started running the `System.Diagnostics.ProcessTest` suite and the `Start1_FileName_NotFound()` would fail at `#C6` because the native error code wasn't 2 (file not found) but 13 (invalid data). This is because it tried
to use `/usr/bin/open` which doesn't work of course so it got to the `mono_w32error_set_last (ERROR_INVALID_DATA)` on L2088.
2019-03-27 19:11:48 +01:00
Jo Shields a48e2c8e10 Add some RID detection, and use it to allow runtime nupkg generation
We cannot presume more than just "linux" or "osx" in our RIDs, because
if we want to enable --host vs --build, we can't detect the OS from
the runtime environment.

This is an okay compromise for now.
2019-03-27 10:28:50 -04:00
Jo Shields 7f04ffa847 Add possibility of generating a runtime .nupkg for Mono (Mac-only right now) 2019-03-27 10:28:50 -04:00
Filip Navara 7a74f15949 [netcore] Fix stack size for new threads 2019-03-27 15:23:59 +01:00
Marek Safar fdc4920d5f [System.Private.CoreLib] Implement exceptions capturing 2019-03-27 15:22:50 +01:00
Maxim Lipnin a9f3b8ca54 Port 13553 "Fix transition offset logic" to master 2019-03-27 14:57:03 +01:00
Filip Navara c45f622d97 [netcore] Fix thread debugging messages 2019-03-27 14:33:54 +01:00
Tanner Gooding e658a7d478 Cleaning up the P/Invoke signatures for QPF and QPC to avoid marshalling and pinning (#36071)
* Cleaning up the P/Invoke signatures for QPF and QPC to avoid marshalling and pinning

* Responding to PR feedback.

* Dropping support for low resolution stopwatch

* Removing BestFitMapping=false

* Removing unneeded unsafe declarations

* Addressing more PR feedback

* Fixing the pal_time header file

* Fixing the Unix P/Invoke signatures for GetTimestamp and GetTimestampResolution to return ulong.

* Fixing GetTimestampResolution to scale the result for HAVE_CLOCK_MONOTONIC

Signed-off-by: dotnet-bot <[email protected]>
2019-03-27 14:32:40 +01:00
lateralusX b98013086e Fix incorrect use of FreeHGlobal on Marshal UTF8 allocated string. 2019-03-27 14:23:44 +01:00
Zoltan Varga c7d6919ceb [netcore] Download test assets from the dotnet-core blob feed. 2019-03-27 14:22:41 +01:00
sancheolz a68389fe9a Fix NRE when combobox was disposed and Text set (#13665)
If combobox already was disposed and we setting Text field there will be NullReferenceException. On .net winforms there no excetions.
2019-03-27 13:02:56 +01:00
Alexander Köplinger 1bc213fac1 [System.Xml] Don't hardcode nunit-lite-console in GeneratedCodeAttribute
Instead determine it at runtime.
2019-03-27 11:39:22 +01:00
Alexander Köplinger 5602acf399 [corlib] Skip FileTest.LastWriteTimeSubMsCopy on older iOS Simulators (#13681)
When we switched to using the corefx System.IO.File implementation we also switched to an implementation that uses the `copyfile()` standard library call on macOS/iOS to copy files. This should preserve file metadata such as timestamps.

However there's a small edge case: when using an older version of the iOS Simulator < 11.0 the `copyfile()` call doesn't copy sub-second timestamps, presumably because older iOS ran on HFS which doesn't support that.
When we run this simulator on modern macOS which uses APFS and thus supports sub-second timestamps the origin file used for the test _does_ have sub-second timestamps and the test would fail.

We now skip the test in such environments.

PS: why did this not fail with the old Mono implementation? We used to always call utimes() on the destination file after copying to copy metadata, which in turn would update the file in the simulator host.
It doesn't seem worth it to replicate that behavior for this small edge case.
2019-03-27 11:26:16 +01:00
Katelyn Gadd e9d847d0f6 Bump roslyn binaries to 3.1.0 and add VBCSCompiler.exe to the set of paths auto-detected by configure.ac (#13518)
* Reconfigure bump for PR test

* Actually bump submodule this time probably

* Bump submodule

* Revert "Bump submodule"

This reverts commit b47679be10d3c38d40673cf73e0dc48a300318bc.

* Bump submodule

* Modify csi-test.csx to manually reference netstandard 2.0, because this is required for some reason

* Checkpoint: Test modifying csi.rsp instead of csi-test

* Git

* Update submodule

* Update submodule compiler path

* Remove binaries-new submodule

* Update to latest roslyn-binaries revision and update path in configure.ac
2019-03-27 09:17:24 +01:00
Zoltan Varga 4bb8637454 [netcore] Fix some thread failures. 2019-03-27 09:15:45 +01:00
Zoltan Varga de89d6dc77 [netcore] Fix ArgumentException argument order. 2019-03-27 09:15:45 +01:00
Zoltan Varga 593853ef06 [netcore] Disable boehm. 2019-03-27 09:15:45 +01:00
Martin Baulig 1af992a5ff Split AppDomain.DoTypeResolve(object) into DoTypeResolve() and DoTypeBuilderResolve(). (#13142)
* Instead of having one `AppDomain.DoTypeResolve(object)` that checks at runtime whether
  the argument is a `string` or a `TypeBuilder`, use two strongly-typed methods
  `DoTypeResolve(string)` and `DoTypeBuilderResolve(TypeBuilder)`.

* Add both to the `corlib/LinkerDescriptor/mscorlib.xml`.

* Adjust the code in `appdomain.c` accordingly.

* Bump corlib version.

This is part of a larger on-going project to improve the linker logic.

The rationale behind this is that the new `AppDomain.DoTypeResolve(string)`
that is being called from `mono_domain_try_type_resolve_name()` should not
reference `TypeBuilder`, to allow the linker to remove some of the
`System.Reflection.Emit` types.
2019-03-27 01:51:38 -04:00
Jay Krell 636160148f Cleanup double semi-colons. (#13660)
Cleanup double semi-colons.
2019-03-26 23:45:42 -04:00
Filip Navara fea837d6d3 Fix sample path 2019-03-26 20:47:21 +01:00
Filip Navara b9b6923a58 Exception stack trace should be null when not thrown yet 2019-03-26 20:47:21 +01:00
Marek Safar 06cdc67e2f [System.Private.CoreLib] Implement StackTrace construction from current thread 2019-03-26 19:52:00 +01:00
Egor Bogatov 2f1c1d3b2c [netcore] Implement Array.Sort (#13674)
* Update Array.cs

* implement Array.Sort
2019-03-26 18:10:23 +01:00
Martin Baulig 22073ed676 Cosmetic: remove accidentally added gensources debugging flag. (#13678) 2019-03-26 18:02:55 +01:00
Bernhard Urban 5e70d5ee51 [intrinsics] sync implementation with IL code (#13647)
* [intrinsics] sync implementation with IL code

Before the intrinsic implemented
```
ldarg.0
ldarg.1
sizeof !!T
mul
conv.i
add
ret
```

now it implements
```
ldarg.0
ldarg.1
sizeof !!T
conv.i
mul
add
ret
```

`conv.i` and `mul` have been swapped. Also see https://github.com/mono/mono/pull/13609

* fix op_sext_i4 usage
2019-03-26 12:30:18 -04:00
Zoltan Varga 9d652a972a [llvm] Fix the computation of size of gshared instances in emit_args_to_vtype (). (#13659)
Fixes https://github.com/mono/mono/issues/13610.
2019-03-26 16:28:59 +01:00
Filip Navara e7011c780f Convert from ucontext_t (or platform equivalent) to MonoContext early and propagate it through 2019-03-26 10:56:49 +01:00
Filip Navara 69abf8f5e4 Preserve the native crash context instead of MonoContext to allow printing managed stack trace later 2019-03-26 10:56:49 +01:00
Filip Navara d8e53c515d [netcore] Change loader behaviour to disable assembly remapping and allow loading newer assembly versions 2019-03-26 09:03:04 +01:00
Marek Safar 86506fbdbd [System.Private.CoreLib] Implement StackFrame initialization 2019-03-26 08:39:15 +01:00
Larry Ewing ed2d3504d6 Merge pull request #13620 from kjpou1/wasm-misc-cleanup
[wasm] Remove specific link to framework file when building test-suite
2019-03-25 13:55:51 -05:00
Bernhard Urban 64e17113b2 [amd64] use 32bit variant of lea_membase for 32bit operations (#13642)
[amd64] use 32bit variant of lea_membase for 32bit operations

Consider
```
 xor %r15, %r15       // %r15 = 0x0
 dec %r15d            // %r15 = 0xffff_ffff
 lea 0x1(%r15), %rdx  // %rdx = 0x1_0000_0000 but should be 0x0
```

instead `lea 0x1(%r15), %edx` should be generated.


Fixes #13452
Fixes #13597
2019-03-25 14:25:43 -04:00
Larry Ewing 05a40c67ea Merge pull request #13636 from kjpou1/wasm-add-bindings
[wasm] [packager] Remove the unnecessary call to add_bindings()
2019-03-25 12:13:01 -05:00
Egor Bogatov e653d48b3a [netcore] Improve xunit console runner (#13648)
* improve xunit runner

* improve xunit runner
2019-03-25 16:40:42 +01:00
Larry Ewing 478656ff1d Merge pull request #13416 from kjpou1/wasm-websocket-tests
[wasm][tests] Add WebSocket tests
2019-03-25 09:12:29 -05:00
Zoltan Varga 1fb3b3b87d [netcore] Add System.Reflection.Emit support. (#13613) 2019-03-25 15:04:36 +01:00
Marek Safar 48b8f5ce47 Revert "Do not use MAP_JIT by default, instead make this something that is toggled by Xamarin.Mac which needs it"
This reverts commit a4c8606767.
2019-03-25 14:56:41 +01:00
Johan Lorensson cae256c3b0 Merge pull request #13571 from lateralusX/lateralusX/add-utc-timezone-on-fallback
Add UTC timezone in WinRT GetSystemTimeZones fallback implementation.
2019-03-25 09:30:47 -04:00
Jay Krell 8feaad70f0 Remove const on struct fields. (#13624)
It is unusual and not useful.
2019-03-25 08:36:38 -04:00
Miguel de Icaza a4c8606767 Do not use MAP_JIT by default, instead make this something that is toggled by Xamarin.Mac which needs it 2019-03-25 12:00:41 +01:00
Johan Lorensson 1ff137d950 Merge pull request #13572 from lateralusX/lateralusX/change-test-spincount
Increase spin-count on test to not end up in frequent sleeps on multicore machines.
2019-03-25 06:48:41 -04:00
Kenneth Pouncey 85d86d2215 [wasm] Remove the unnecessary call to add_bindings() when runtime.js is generated. 2019-03-25 11:38:28 +01:00
Jay Krell 004314e9dd [windows]Fix and cleanup configure.ac parsing for MONO_CORLIB_VERSION and ACINIT. (#13630)
Not just a guid or an uppercase guid.
2019-03-25 10:55:15 +01:00
Bernhard Urban eb1cb188a6 [interp] fix "This greater-than-or-equal-to-zero comparison of an unsigned value is always true" reported by Coverity (#13625)
[interp] fix "This greater-than-or-equal-to-zero comparison of an unsigned value is always true" reported by Coverity
2019-03-25 05:45:59 -04:00
Egor Bogatov ac2fb76ed0 [netcore] Marshal.IsPinnable (#13628)
Needed for MSBuild.
Stream changes were copied from [CoreRT](https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/src/System/IO/Stream.CoreRT.cs).
IsPinnable - perhaps it should be an icall/intrinsics for better perf?
[CoreCLR impl for IsPinnable (InternalCall)](https://github.com/dotnet/coreclr/blob/1f3f474a13bdde1c5fecdf8cd9ce525dbe5df000/src/vm/marshalnative.cpp#L257)
[CoreRT impl for IsPinnable](https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs#L114) (and [MightBeBlittable](https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/src/System/Runtime/InteropServices/InteropExtensions.cs#L60))
2019-03-25 10:22:54 +01:00
Nick Schonning 47cc95bbb6 typo: Double word "both" (dotnet/corefx#36272)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 65b123d5e9 typo: Double word "never" (dotnet/corefx#36300)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning f1bde8bbaa typo: Double word "to" (dotnet/corefx#36264)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 659cf556ef typo: Double word "that" (dotnet/corefx#36269)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 83133240dc typo: Double word "a" (dotnet/corefx#36271)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 2a659f1cda typo: Double word "in" (dotnet/corefx#36270)
* typo: Double word "in"

* Update src/System.Console/src/System/Console.cs

Co-Authored-By: nschonni <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 0f3c093b09 typo: Double word "the" (dotnet/corefx#36274)
* typo: Double word "the"

* Apply suggestions from code review

Co-Authored-By: nschonni <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 0719b0209c typo: Double word "this" (dotnet/corefx#36273)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 4b2c08e01b typo: Double word "are" (dotnet/corefx#36275)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 42199a6297 typo: Double word "types" (dotnet/corefx#36276)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 84bc77cabf typo: Double word "is" (dotnet/corefx#36283)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 32c4104e44 typo: Double word "we" (dotnet/corefx#36288)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Egor Bogatov b3287d7157 [netcore] Semaphore (#13627)
* Update Semaphore.cs

* netcore Semaphore

* Update Semaphore.cs
2019-03-25 08:51:52 +01:00
Nick Schonning 21b1ee3b62 typo: Double word "as" (dotnet/corefx#36277)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 08:34:52 +01:00
Jay Krell fd1baed2af Remove the parsing, hashing, locking, allocations associated with JIT icall signatures. (#13579)
* Remove the parsing, hashing, locking, allocations associated with JIT icall signatures.
Make them statically allocated, single-instanced at compile time, and almost
statically initialized.

Fix C++ and x86.

More x86 fix.

Fix ARMv5.

Undo tedious work to be redone instead of merged from old.

Put all signatures back, prepare for automated conversion.

Replace all the register_icall strings with:

my @a = ("double double",
"long long long",
"long long int32",
"double double double",
"ulong float",
"ulong double",
"long float",
"double int32",
"float float float",
"long double",
"object ptr int int32",
"double ptr",
"int int int ptr ptr ptr",
"int obj ptr",
"int obj",
"int ptr int int ptr object",
"int32 double",
"int32 int32 int32",
"int32 int32 ptr",
"int32 obj",
"int32 object ptr ptr ptr",
"int32 object",
"int32 ptr ptr ptr ptr ptr int32",
"int32 ptr ptr",
"obj ptr int",
"obj ptr",
"object int object object",
"object int object",
"object int",
"object int32",
"object object ptr ptr",
"object object ptr",
"object object",
"object ptr int int int int",
"object ptr int int int",
"object ptr int int",
"object ptr int ptr",
"object ptr int",
"object ptr int32",
"object ptr ptr int32",
"object ptr ptr ptr ptr ptr",
"object ptr ptr",
"object ptr",
"object",
"ptr int",
"ptr obj",
"ptr object int ptr ptr",
"ptr object int32 int32",
"ptr object ptr ptr",
"ptr object ptr",
"ptr object",
"ptr ptr int ptr",
"ptr ptr int",
"ptr ptr int32",
"ptr ptr ptr ptr",
"ptr ptr ptr",
"ptr ptr",
"ptr",
"uint32 double",
"uint32 ptr int32",
"void double ptr",
"void int",
"void int32",
"void obj ptr",
"void object object ptr",
"void object object",
"void object ptr int32 int32",
"void object ptr int32",
"void object ptr",
"void object",
"void ptr int int object",
"void ptr int object",
"void ptr int ptr",
"void ptr int",
"void ptr int32",
"void ptr object int32",
"void ptr ptr int",
"void ptr ptr int32",
"void ptr ptr ptr",
"void ptr ptr",
"void ptr",
"void ptr object",
"void",
);

while (my $line = <>)
{
	if ($line =~ /register|mono_create_icall_signature/ && $line =~ /"/)
	{
		for my $from (@a)
		{
			my $to = "mono_icall_sig_$from";
			$to =~ s/ /_/g;
			$to =~ s/"//g;
			$to =~ s/"//g;
			$to =~ s/"//g;
			$line =~ s/\Q"$from"\E/$to/;
		}
	}
	print($line);
}

Remove whitespace from end of line.

Convert the strings to smaller arrays, of chars now,
that are scaled offsets into MonoDefaults, or -1 for ptrref.

Use smaller encoding.

fix merge

cleanup

* Larger representation that handles alignment.

* Try to undo external changel.

* Fix AOT.

* Fix code search and comments

* Restore warning in this PR.

* More ARM signatures.

* Change representation from pointer to offset.
  Use sizeof for the special case ptrref.
Comments. Perhaps too much.
asserts. Perhaps too much.
A little bit more verbose/readable but essentially the same thing otherwise.
 Perhaps too verbose.

* The initializer all-but-must be pointer-sized.
Even if the values fit in much smaller.
Add comments.
On obscure systems size_t is smaller than a pointer so
gsize or uintptr_t is required. Use gsize.

* Spaces before parens.

* PR: Use enum instead of offsetof.
Use may_alias some.
mono builds with -fno-strict-aliasing, but we had recent
aliasing problem (the enum operators with older g++)
and this looks a little hazardous

We could also have a separate integer or array of byte or array of integer or perhaps string
to resolve the aliasing.

integer: 16 values, 8 max -- could just use an int instead of this array business,
but the representation would be full with no room for expansion.
We are not wasting any/much memory here -- maybe one word per the 200 signatures,
because of sloppyness around any_size_array.

Work a little on dealiasing.
Comment some aliases and make obj/object, int/ptr, bool/boolean share values.

* tweak: Compute all the values once and then directly index small local array.

* Adjust comments to new reality.
Add comments explaining aliasing.

* Add casts to attempt to abide by strict aliasing rules.
2019-03-24 23:16:32 -04:00
thfrwn 6d3aa51dd3 Fix DNS Name Resolution Failure on OpenBSD (GitHub issue #8168) 2019-03-24 17:10:22 -07:00
Kenneth Pouncey 5e61de3a2c Modify packager to load the .pdb files for framework packages. (#13608) 2019-03-24 08:33:27 +01:00
リーフストーム 0b58483fa8 Fix handle leak in cominterop (#13536) 2019-03-23 15:15:57 -04:00
Alexander Köplinger d4953f63ca [sdks] Easier labels for pipeline parts 2019-03-23 10:42:42 +01:00
Alexander Köplinger afdf77b053 [sdks] Build Android Linux Mono SDKs package on CI 2019-03-23 10:30:45 +01:00
Levi Broderick 6ddc22cefe Replace slow implementations in ASCIIUtility with fast implementations (#22516)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-23 09:56:52 +01:00
Jérôme Laban 5134c0fec6 Include the corebindings.c in the package output (#13606)
This update restores the ability to use the packager outside of the mono source tree.
2019-03-23 07:11:01 +01:00
Alexander Kyte 0eac33443d [runtime] Add MONO_LLVM_INTERNAL to *get_aot_init_wrapper* marshal funcs (#13611) 2019-03-23 01:36:58 -04:00
Kenneth Pouncey 1b7c7561ab Remove specific link to framework file when building test-suite 2019-03-23 05:32:51 +01:00
Tarek Mahmoud Sayed 612c1b9f42 Apply Optimization in Index.GetOffset suggested by Levi (#23349)
* Apply Optimization in Index.GetOffset suggested by Levi

* Add Comment

* address the feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-03-22 23:30:09 +01:00
Marek Safar 871975de4e Adopt to shared Exception 2019-03-22 23:27:38 +01:00
Marek Safar 7541d7e5fb Move Exception to shared partition (dotnet/coreclr#23361)
* Move Exception to shared partition

* Remove class name caching

* Not useful comments removal

Signed-off-by: dotnet-bot <[email protected]>
2019-03-22 23:27:38 +01:00
Andrew Hoefling 8fe79b4c8e Updated Exception Handling for Collection<T> (dotnet/coreclr#23290)
* Updated Argument Helper param from list->collection since the parameter name is collection

* Updated exception message to use an out of range exception that doesn't explicitly reference a list

* Simplified if statements that verify if the index is out of range

* Updated if logic to be simplified using (uint)

* Updated exception handling to throw ThrowHelper.ThrowArgumentOutOfRange_IndexException() when the ExceptionArgument was 'Index'

Signed-off-by: dotnet-bot <[email protected]>
2019-03-22 23:27:38 +01:00
Thays Grazia 4abc661805 [DIM] Method call of a class that implements a protected nested interface (#13558)
* Unexpected System.MethodAccessException is thrown for a method call of a class that implements a protected interface inside another interface.

```
public interface I1
{
    protected interface T1
    {
        void M1();
    }

    protected class T2
    {}

    protected struct T3
    {}

    protected enum T4
    {
        B
    }
}

class Test1 : I1
{
    static void Main()
    {
        I1.T1 a = new Test2();
        a.M1();
        System.Console.WriteLine(new I1.T2());
        System.Console.WriteLine(new I1.T3());
        System.Console.WriteLine(I1.T4.B);
    }

    class Test2 : I1.T1
    {
        public void M1()
        {
            System.Console.WriteLine("M1");
        }
    }
}
``


Fixing this case Test1 implements I1<int> but can access methods from I1<object>
public interface I1<X>
{
    protected interface T1
    {
        void M1();
    }

    protected class T2
    {}

    protected struct T3
    {}

    protected enum T4
    {
        B
    }
}

class Test1 : I1<int>
{
    static void Main()
    {
        I1<object>.T1 a = new Test2();
        a.M1();
        System.Console.WriteLine(new I1<object>.T2());
        System.Console.WriteLine(new I1<object>.T3());
        System.Console.WriteLine(I1<object>.T4.B);
    }

    class Test2 : I1<object>.T1
    {
        public void M1()
        {
            System.Console.WriteLine("M1");
        }
    }
}
2019-03-22 18:37:16 -03:00
Marek Safar 1a4014dbc0 Move Buffer constants to platform specific files (dotnet/coreclr#23352)
* Move Buffer constants to platform specific files

* Add explicit access modifier

Signed-off-by: dotnet-bot <[email protected]>
2019-03-22 21:57:24 +01:00
Aleksey Kliger (λgeek) d465a7ad65 [aot] cleanup MonoError in add_extra_method_with_depth (#13605)
I missed something in the code review for #13581.  Need to cleanup MonoError if it's not ok.
2019-03-22 21:24:56 +01:00
Egor Bogatov e72d6d9e1c [netcore] Implement missing bits in Mutex (#13591)
Needed for xunit console runner tool.
2019-03-22 18:54:20 +01:00
Zoltan Varga b4f4acc133 [aot] Avoid an assert which can happen in normal usage. (#13581)
Fixes https://github.com/mono/mono/issues/13455.
2019-03-22 16:02:15 +01:00
Alexander Köplinger c8508e56b6 [ci] Build macOS .pkg PR builds on a separate bot (#13600)
This allows us to get faster results.
2019-03-22 15:19:24 +01:00
Alexander Köplinger a766d2e802 Bump linker to latest master (#13594)
* Bump linker to latest master

The linker source were reorganized a little bit, e.g. sources in src/

* [csproj] Update project files
2019-03-22 10:10:08 +01:00
Vlad Brezae 216e4aa405 [interp] Make transform phase more flexible (#13516)
* [interp] Fix instruction length

* [interp] Don't generate directly into linear code stream

Allocate each instruction into the mempool and link them together. At the end of code generation and after all potential optimisation passes, we will compact this code into its final form.

* [interp] Add support for branch relocations

For each branch instruction, we store in its data field the il offset that we are branching to. During the final code generation, we resolve all backward branches and add relocs for forward branches. These relocs are then resolved after all instructions have been emitted in the final code stream.

* [interp] Extract vararg call code in separate instruction

It requires a different instruction size and is extremely rare code.

* [interp] Fix backwards branch with large offset

We were adding an unsigned instead of subtracting.

* [interp] Fix line numbers

For each il offset that generated interpreter instructions we store the native offset, during the compaction phase.

* [interp] Fix seq points

We have to defer SeqPoint data creation during the compact generation phase, because that's when we have native offset information. We add a flags field to the interpreter instruction to store any relevant information coming from the compilation phase.

* [interp] Make verbose logging a bit nicer

We no longer have the native offset during the first IL instruction interation. Maybe we should bring back logging for the IL -> IR mapping during the compaction phase.

* [interp] Remove some dead code
2019-03-22 10:06:10 +02:00
Kenneth Pouncey 31cb0e28a5 Fix indentation to address review comments 2019-03-22 05:13:12 +01:00
Jo Shields 21cfdbe81c Make test runner able to deal with whitespace patterns other than newline (#13587)
Helix wasn't running our runtime tests as expected, because the test runner expected newline-separated tests to run, and we were generating space-separated.

Following "be liberal in what you accept" philosophy, and to prevent this issue in the future, just deal with "whitespace separated" rather than "this specific whitespace and no other"
2019-03-22 00:23:28 +01:00
Alexis Christoforides c803e6f75b Xamarin.Android integration fixes (#13589)
Backport of #12940.

- Disable other failing tests (they are tests that are newly added, not regressions)
- Look for mono_pal_init() directly in the System.Native library
- [configure] Have libmono-native depend on libmono(-sgen) for the Android build
If this is not done, Android is not able to resolve mono symbols that are used in mono-native (e.g. mono_add_internal_call_with_flags), and will refuse to load the library with 'cannot locate symbol' errors
2019-03-22 00:15:08 +01:00
Egor Bogatov 0fc15b168f [netcore] Xunit console runner (#13592)
* xunit console runner

* add more xunit args

* use rsp file
2019-03-21 23:43:48 +01:00
Zoltan Varga 53bef4aec4 [llvmonly] Add gsharedvt in wrappers to calls which could go to the interpreter. (#13548)
[llvmonly] Add gsharedvt in wrappers to calls which could go to the interpreter.

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




<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-03-21 15:56:06 -04:00
Vlad Brezae 8423f0e9a0 [interp] Enable compile all debug option also on interp (#13570)
[interp] Enable compile all debug option also on interp
2019-03-21 12:05:48 -04:00
Kenneth Pouncey 2b37e1c0b5 Add tests for send and receive of text and binary messages. 2019-03-21 16:37:36 +01:00
Johan Lorensson 7e8d4303fa Couple of fixes to LLVM AOT compiler on Windows x64. (#13474)
* Enable MSVC objects on LLVM >= 6.00
* Always used PIC relocation-model on Windows x64 due to LLVM problem with
static triggering incorrect ADDR32 relocation entries in 64-bit objects.
* Add CodeView symbol format instead of DWARF for Windows x64.
* Fix LLVM outfile when doing static link to not end up in temp directory.
* Only add /DEFAULTLIB when using MSVC and not doing static compile. For
static compile the needed libraries must be added when objects get's linked
and since the needed libraries are c-runtime libraries, should be transparent
for most applications consuming the object files.
2019-03-21 10:05:01 -04:00
Kenneth Pouncey 6513fffcd7 Add tests for
- Client Close
- Host Close with CloseStatus and CloseStatusDescription filled in from Host.
2019-03-21 14:22:31 +01:00
Bernhard Urban 5852d1cf74 [arm] respect potential spilling for overflow flag check (#13564)
[arm] respect potential spilling for overflow flag check

```
  18 int_sbb R77 <- R54 R57
  19 store_membase_reg [arm_fp + 0x24] <- R77
  20 cond_exc_c OverflowException
```
this wasn't properly handled by the arch lowering pass.

Fixes https://github.com/mono/mono/issues/13284
2019-03-21 08:15:31 -04:00
Nikita Voronchev 037faa47cc [WinForms] Related Forms closing issue (#13150) (#13151)
Fixes #13150
2019-03-21 12:57:55 +01:00
lateralusX b554e0ea2c Increase spin-count on test to not end up in frequent sleeps on multicore machines. 2019-03-21 11:43:55 +01:00
lateralusX 33ea64cf7e Add UTC timezone in WinRT GetSystemTimeZones fallback implementation.
Needed by tests when hitting fallback solution in TimeZoneInfo.WinRT.cs.

Fix also sort the TimeZones similar to how its done in .NET Framework/Core.
2019-03-21 11:38:29 +01:00
Zoltan Varga 6a0a5bf3ca [netcore] Implement/fix enum/nullable comparers. 2019-03-21 11:33:34 +01:00
Zoltan Varga a6dc1cec3b [netcore] Implement RuntimeAssembly.GetSatelliteAssembly (). 2019-03-21 11:33:34 +01:00
Zoltan Varga 622bb8d5d5 [jit] Add JitHelpers.EnumEquals ()/EnumCompareTo () intrinsics. 2019-03-21 11:33:34 +01:00
Egor Bogatov 36a62bbf8a [netcore] Implement missing bits in ThreadPool (#13566)
* implement missing bits in ThreadPool

* remove [SecurityCritical]
2019-03-21 11:29:43 +01:00
Kenneth Pouncey 7dbcf1ed4b Add more tests for websockets. 2019-03-21 11:02:43 +01:00
Kenneth Pouncey a15526af3a [wasm][websockets]Fix Error Code not reported correctly with ClientWebSocket 2019-03-21 11:01:24 +01:00
Jan Kotas f2065c849a Hoist calls to IsBitwiseEquatable (dotnet/coreclr#23381)
Smaller IL is easier for JIT

Signed-off-by: dotnet-bot <[email protected]>
2019-03-21 08:10:47 +01:00
Marek Safar 701ca04b36 Update with shared partition changes 2019-03-21 08:05:14 +01:00
Jan Kotas 48114c0375 Unify EnumInfo and NamesAndValues
Signed-off-by: dotnet-bot <[email protected]>
2019-03-21 08:05:14 +01:00
Alexander Kyte 42c3b73ac1 [merp] Fix anon allocation, use MAP_PRIVATE 2019-03-21 07:48:25 +01:00
Egor Bogatov 8cf878ff50 advanced MemberData support 2019-03-21 07:46:56 +01:00
Bernhard Urban 4111910dd8 [llvm] dump bitcode file even if verifier fails (#13556)
[llvm] dump bitcode file even if verifier fails

This can be useful for debugging issues in the products.
2019-03-20 19:45:39 -04:00
Johan Lorensson d3a2841e93 Adjust genconst to changes in winsetup.bat. (#13554)
When logic moved from winsetup.bat into an msbuild task that changed the
console output of winsetup.bat causing problems for genconst to find
MONO_VERSION and MONO_CORLIB_VERSION. There was also a potential problem
where winsetup.bat couldn't find msbuild.exe if not included in PATH.

This fix makes sure winsetup.bat detect and setup a full msbuild environment
before running msbuild.exe. It also change genconsts to look at the generated
config.h for the correct values of MONO_VERSION and MONO_CORLIB_VERSION that
will be used by the runtime builds.
2019-03-20 18:48:20 -04:00
Bernhard Urban 00d871d103 [ssa] avoid code motion to try-blocks (#13555)
[ssa] avoid code motion to try-blocks

Consider
```
BB4:  // successor BB5, BB9
[...]
br [B9]

BB5: // catch handler block for BB4
[...]
br BB9

BB9:
aotconst R90
gc_safe_point R90
[...]
```

Previously, our invariant code motion pass would move `aotconst R90` to the end of BB4. Unfortunately, BB4 contains instructions that can cause an exception and thus control flow is broken and continues to BB5. `aotconst R90` wouldn't be loaded correctly in this scenario.

When lowered to LLVM IR this is more obvious, and the verification pass of LLVM catches this.

Fixes https://github.com/mono/mono/issues/13460
2019-03-20 18:45:47 -04:00
Thays Grazia 4e13c53451 [dim] System.MethodAccessException is thrown for a protected method declared in an interface (#13513)
* ```
interface I1<T>
{
    sealed protected void M1()
    {
        System.Console.WriteLine("M1");
    }
}

interface I3<T> : I1<T>
{}

interface I2<T> : I3<T>
{
    static void Test(I2<int> x)
    {
        x.M1();
    }
}

class A : I2<int>
{
    static void Main()
    {
        I2<byte>.Test(new A());
    }
}
```
When a interface implements another interface and they are generics, we don't need to check the datatypes of generics, we only need to check the inheritance.
Fixes 13467

* Adding test.

* Using the getter functions

* Initializing klass->interfaces/interfaces_count.

* Update mono/metadata/class.c

Co-Authored-By: thaystg <[email protected]>

* Fixing side effect on dim-simple.il
2019-03-20 18:08:51 -04:00
Aleksey Kliger (λgeek) 60221d88d5 [aot] Fix a few memory leaks (#13514)
1. aot-compiler: don't leak `MonoCustomAttrInfo`

2. aot-runtime: don't leak sigs when decoding wrapper references.  All of these cases we decode a sig (which uses malloc), and then call some method that immediately calls `mini_get_underlying_signature` which dups the sig, so the one from the decode isn't needed anymore.
2019-03-20 16:50:25 +01:00
Alexander Köplinger 242596b243 Bump corefx 2019-03-20 12:10:31 +01:00
Johan Lorensson a0e999549e Merge pull request #13529 from lateralusX/lateralusX/fix-mixup-global-cotask-alloc
Fix mixup of Global Free and CoTaskMem Alloc in Marshal's Secure String implementation.
2019-03-20 05:44:35 -04:00
Egor Bogatov b87bd4f6e4 [netcore] Allow all primitive types to be passed to Buffer.BlockCopy (#13544)
* Update Buffer.cs

* allow all primitive types to be passed to BlockCopy

* convert Len to bytes
2019-03-20 08:41:58 +01:00
Egor Bogatov 8b4eef9387 [netcore] Initial MemberDataAttribute support (#13543)
This PR adds ~2200 tests to System.Runtime.Tests and ~1000 to System.Collections.Tests
2019-03-20 08:40:46 +01:00
Thays Grazia b811e645a3 When it is a sealed method in Interface it's not Static nor Virtual and shouldn't add virtual.
Fixes #13508
2019-03-20 08:36:21 +01:00
Alexander Köplinger 8aaf420efe Fix Windows MSI build 2019-03-20 01:49:26 +01:00
Thays Grazia 86e7400525 [metadata][dim] Unexpected System.NotSupportedException in presence of default interface implementations (#13468)
* namespace Application
{
	public interface I1 { void M1() { System.Console.WriteLine("Unexpected!!!"); }}

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

	public interface I3 : I1 { void I1.M1() { System.Console.WriteLine("I3.I1.M1"); }}

	public interface I4 : I1 { void I1.M1() { System.Console.WriteLine("I4.I1.M1"); }}

	class Test10 : I1, I2, I3, I4 { public void M1() { System.Console.WriteLine("Test10.M1"); } }

	class MainClass {
		public static void Main(string[] args)
		{
			I1 var = new Test10();
			var.M1();
		}
	}
}

The interface method M1 is overridden at I1, at I2, at I3, at I4. The class Test10 overrides method M1 so regardless of having methods overriden in interface, the method of the class should be priority in this case. And then I remove the conflicts because there is not a conflict anymore.
2019-03-19 19:26:09 -03:00
Egor Bogatov 3a2d027e5e fix literals 2019-03-19 23:13:58 +01:00
Sung Yoon Whang dd6a9063c9 Remove timer in RuntimeEventSource (dotnet/coreclr#23311)
* Change RuntimeEventSource's counter types

* cleanup

* cleanup

Signed-off-by: dotnet-bot <[email protected]>
2019-03-19 23:02:11 +01:00
Grant 0584d63bf1 Trim/TrimStart/TrimEnd methods for Memory and Span (dotnet/coreclr#22798)
* Span.Trim

* Add another helper

* Remove redundant comments

* Optimize Trim(ReadOnlySpan<char>)

* Suggested overload for byte

* CR fixes

* CR fix

* Add Span overloads

* Add Memory overloads

* CR

* Rename method

* Optimization

* Tweaks

* Refactor

* Opt

* Use 2 helpers

* CR fixes

* CR fixes

* Nits

* CR fixes

* remove in params

* Bug

* Bug

* Move Trim methods to their own dedicated file

* Add char overloads

* Use Contains

* CR fixes

* Optmize ClampNull

* Nit

* Revert optimization

* Make existing implementations consistent with new

* Revert existing methods

* Move helpers

* Span, Memory and RoM should use consistent pattern

* POC for changing RoS

* Revert POC

* Use consistent idiom

* More inlining of explaining vars

* Use expression body for existing code

* CR fixes

* Nit

* Grammar

* CR fixes

* Fix perf bug in existing code

* Perf fix

* Force CI build

* Force CI

Signed-off-by: dotnet-bot <[email protected]>
2019-03-19 22:29:01 +01:00
Egor Bogatov 2785cdbd30 fix typo 2019-03-19 22:27:50 +01:00
Alexander Köplinger a0f593958b [ci] Fix wrong redirect which would overwrite Make.config 2019-03-19 21:53:40 +01:00
Alexander Köplinger dbc3c1a1cd [sdks] Build mac in Mono SDKs (#13535)
Enables building of the xammac runtime and BCL/tests into the SDKs archive.

Contributes to #11397
2019-03-19 20:44:42 +01:00
Bernhard Urban 4cd5068230 [aot] force v7 on arm when using LLVM on iOS (#13521)
[aot] force v7 on arm when using LLVM on iOS

In https://github.com/mono/mono/pull/11172 we added passing `-march=arm` to `llc`, so that newer LLVM would generate code correctly for the target arch. Unfortunately this seems to break older LLVM, that is still used for 32bit code on Xamarin.iOS. For iOS we need to force it to armv7, otherwise it will try to substitute certain locking primitives with builtins that aren't available as hardware instructions on armv5.


Before this change:

```console
$ nm ./obj/iPhone/Release/mtouch-cache/armv7/mscorlib.dll-llvm.o | grep sync_
         U ___sync_fetch_and_add_4
         U ___sync_lock_test_and_set_4
         U ___sync_synchronize
         U ___sync_val_compare_and_swap_4
00079e1c T _mscorlib_System_Runtime_CompilerServices_AsyncMethodBuilderCore_ThrowAsync_System_Exception_System_Threading_SynchronizationContext
00057f80 T _mscorlib_System_Threading_SemaphoreSlim_WaitAsync_int_System_Threading_CancellationToken
00058430 T _mscorlib_System_Threading_SemaphoreSlim_WaitUntilCountOrTimeoutAsync_System_Threading_SemaphoreSlim_TaskNode_int_System_Threading_CancellationToken
         U _p_1214_plt_mscorlib_System_Threading_SemaphoreSlim_WaitAsync_int_System_Threading_CancellationToken_llvm
         U _p_1217_plt_mscorlib_System_Threading_SemaphoreSlim_WaitUntilCountOrTimeoutAsync_System_Threading_SemaphoreSlim_TaskNode_int_System_Threading_CancellationToken_llvm
         U _p_1735_plt_mscorlib_System_Runtime_CompilerServices_AsyncMethodBuilderCore_ThrowAsync_System_Exception_System_Threading_SynchronizationContext_llvm
         U _p_1976_plt_mscorlib_System_Threading_SemaphoreSlim_WaitAsync_llvm
         U _p_37_plt_mscorlib__jit_icall_ves_icall_thread_finish_async_abort_llvm

```

After this change:

```console
$ nm ./obj/iPhone/Release/mtouch-cache/armv7/mscorlib.dll-llvm.o | grep sync_
0007008c T _mscorlib_System_Runtime_CompilerServices_AsyncMethodBuilderCore_ThrowAsync_System_Exception_System_Threading_SynchronizationContext
00050654 T _mscorlib_System_Threading_SemaphoreSlim_WaitAsync_int_System_Threading_CancellationToken
00050ab4 T _mscorlib_System_Threading_SemaphoreSlim_WaitUntilCountOrTimeoutAsync_System_Threading_SemaphoreSlim_TaskNode_int_System_Threading_CancellationToken
         U _p_1214_plt_mscorlib_System_Threading_SemaphoreSlim_WaitAsync_int_System_Threading_CancellationToken_llvm
         U _p_1217_plt_mscorlib_System_Threading_SemaphoreSlim_WaitUntilCountOrTimeoutAsync_System_Threading_SemaphoreSlim_TaskNode_int_System_Threading_CancellationToken_llvm
         U _p_1735_plt_mscorlib_System_Runtime_CompilerServices_AsyncMethodBuilderCore_ThrowAsync_System_Exception_System_Threading_SynchronizationContext_llvm
         U _p_1976_plt_mscorlib_System_Threading_SemaphoreSlim_WaitAsync_llvm
         U _p_37_plt_mscorlib__jit_icall_ves_icall_thread_finish_async_abort_llvm
```

Fixes https://github.com/mono/mono/issues/13478
2019-03-19 12:46:00 -04:00
Alexander Kyte 04d65f2986 [runtime] Default llvm to self-init+direct native calls (#13312)
* [runtime] Default llvm to self-init

Now the init code is behind llvm_plt_init. Setting
--aot=llvm-plt will bring back the legacy llvm+plt behavior

* [llvm] Mark managed methods no-inline by llvm

* [runtime] Clean up self-disabling machinery

* [llvm] Skip self-init on cctors

* [runtime] Always make ctors call their cctors

* [runtime] Improve mono_print_unwind_info, add cases

* [runtime] Fix too-early eager calling of cctors

We emitted all of the lazy checks and init around a specific static
method, but still were initializing it when we initialized methods
that access it. This made static cctors run before they were supposed
to.

The problem was that the call site here has method == NULL, because
we don't compute it. That's expected, as we don't compute the method
along this path.

This initial "&&" looks like it was supposed to avoid calling the method
on a null MonoMethod reference. This preserves that, while fixing the
control flow issues.

* [runtime] Associate init_method native code with MonoMethod

* [runtime] Future-proof against aot init wrapper subtype mixups

* [runtime] Fix goto in AOT-init change for c++

* [runtime] Move docs for llvm-disable-self-init into runtime

* [runtime] Fix bitcode, remove unneeded wrapper around init icall

* [llvm] Include global prefix in init name

* [comment] Describe debugging usage of llvm self-init disable flag

* [aot] Consolidate mangler string append lines

* [llvm] Make self-init documentation changes

* [llvm] Rename self-init funcs, mini_llvmonly_ to mini_llvm_

* [runtime] Enable inlining for methods without init
2019-03-19 11:13:11 -04:00
lateralusX d4e5d14569 Fix mixup of global and cotask mem alloc heaps in Marshal's Secure String. 2019-03-19 15:53:23 +01:00
Bernhard Urban 6cb5c7f9cf [llvm] fix field init for platforms where unbox_trampolines tables are not used (#13527)
Fixes https://github.com/mono/mono/issues/13522
2019-03-19 15:31:44 +01:00
Kenneth Pouncey d4dec33b84 Merge branch 'master' of https://github.com/mono/mono into wasm-websocket-tests 2019-03-19 14:38:15 +01:00
Zoltan Varga 7a5487b966 [netcore] Ongoing work. (#13509)
* [netcore] Avoid casting to generic parameters in gen-xunit-runner.

* [netcore] Make the build-/run- targets more generic, add support for more test suites.

* remove NIE from Exception

* [netcore] Convert gen-xunit-runner to use roslyn for code generation instead of codedom.

* [netcore] Add check target to run all test suites.
2019-03-19 12:19:33 +01:00
Vsevolod Kukol 8a292ff635 Bump bockbuild to fix Gtk NSView embedding on Mac (#13511)
This fixes mouse event handling for NSViews embedded in Gtk.

Fixes VSTS #802376
Fixes VSTS #821841
2019-03-19 10:23:59 +01:00
Alexander Köplinger 31516f0b3e Reduce number of classes in winaot mscorlib. (#13341)
* Reduce number of classes in winaot mscorlib.

Winaot profile should be a Windows AOT friendly profile close to mobile
and consoles. At some point it was set to include the full net_4_x that
cause problems on none desktop platforms. This fix reduce the set to only
include classes similar to mobile and console profiles.

* Reverting changes to TimeZoneInfo test when reducing classes in corlib winaot.

* Move SafePasswordHandle to win32_build_corlib profile.

* Excluded some additional none Windows sources from win32_build/winaot profile.
2019-03-19 10:07:13 +01:00
monojenkins cecd6b316f [csproj] Update project files 2019-03-19 09:06:36 +00:00
Levi Broderick 909cae3de9 Add Utf8String skeleton (dotnet/coreclr#23209)
Utf8String is an experimental type that is string-like (heap-allocated, immutable, variable-length, null-terminated) but whose inner representation is UTF-8, not UTF-16.

This is a skeleton implementation of the basic API shape. The ecosystem of APIs has not yet been built around it. All Utf8String-related code is currently surrounded by ifdefs to allow easy identification and removal from release branches.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-19 09:44:07 +01:00
Vincent Povirk d21d4764e8 [mono/tests] Fix out of tree build. 2019-03-19 09:40:06 +01:00
Levi Broderick e9e902b929 Add Rune.TryEncodeToUtf8 and related APIs (dotnet/coreclr#23250)
Also renames the existing Encode / Decode APIs per design review feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-03-19 09:33:25 +01:00
Thays Grazia 4fbdcf504d [dim] Interface with sealed method (#13501)
* '''
interface I1
{
   sealed void M1()
   {
       System.Console.WriteLine(“M1”);
   }
}

interface I2 : I1
{
   static void Test<T>(T x) where T : I2
   {
       x.M1();
   }
}

class A : I2
{
   static void Main()
   {
       I2.Test(new A());
   }
}
'''

When an interface implements a Sealed method, this method is not virtual, so it will not be available at vtable. But in the IL the call is a virtual call, but in this case we don't need to search at vtable.

Fixes #13466

* Change IL test.
2019-03-18 18:46:07 -03:00
Johan Lorensson a66f944ff7 Fix a couple of build warnings under MSVC. (#13475) 2019-03-18 14:38:27 -04:00
Alexander Köplinger 9bcad32ca5 Update csproj 2019-03-18 19:30:42 +01:00
Marek Safar b1a155979b Update codeowners (#13505) 2019-03-18 17:32:43 +01:00
Ludovic Henry 1965786397 Update CODEOWNERS 2019-03-18 08:50:19 -07:00
Alexander Kyte f7796b0da0 Merge pull request #13447 from alexanderkyte/fallback_merp_allocator
[crash] Fallback to MAP_ANONYMOUS for allocator
2019-03-18 11:49:52 -04:00
Zoltan Varga d5dfc5e76c [jit] Add RuntimeHelpers:IsBitwiseEquatable () intrinsic. (#13499)
* [jit] Add RuntimeHelpers:IsBitwiseEquatable () intrinsic.

* Update access modifier
2019-03-18 16:33:29 +01:00
Zoltan Varga 5232408f7a [runtime] Avoid putting non-virtual and non-static DIM methods into vtables, roslyn generates these for private property accessors. (#13449)
Fixes part of https://github.com/mono/mono/issues/13374.
2019-03-18 11:54:33 -03:00
Alexander Köplinger 12043bb6f5 [System.Drawing.Common] Enable debug symbols
The facade contains code now so we should build a .pdb.
2019-03-18 15:43:30 +01:00
Zoltan Varga 32b84339cb [netcore] Disable runtime cleanup on netcore, coreclr does not cleanup either. Also disable aborting background threads, its no longer needed. (#13469) 2019-03-18 10:40:22 -04:00
Jay Krell 23999ca43d Cleanup mono_array_new_1, mono_array_new_2, mono_array_new_3, mono_array_new_4.
Mainly to remove the dynamic alloca but also combine common code.
If there is a perf concern then we can forceinline mono_array_new_n.
2019-03-18 15:02:30 +01:00
Alexander Köplinger 5521ad349f [System.Net.Http] Port https://github.com/xamarin/xamarin-macios/pull/5769 to mono 2019-03-18 14:39:54 +01:00
Alexander Köplinger e0326df7c6 More Windows MSI fixes 2019-03-18 13:19:17 +01:00
Alexander Köplinger d431fd5619 Fix nunit-lite signing key 2019-03-18 12:40:38 +01:00
Alexander Köplinger 0ae04b8e80 Fix Windows MSI build, msbuild is now in Current instead of 15.0 2019-03-18 11:40:03 +01:00
Alexander Köplinger 362eface2c Remove more unnecessary nunit24 cruft 2019-03-18 11:31:06 +01:00
Johan Lorensson 273776c737 Merge pull request #13482 from lateralusX/lateralusX/windows-build-script-updates
Windows full AOT build scripts update.
2019-03-18 06:15:42 -04:00
Egor Bogatov 9f25f0f540 cache downloaded net core sdk 2019-03-18 11:15:09 +01:00
Marek Safar 4014060cca Reflect shared code changes 2019-03-18 11:12:40 +01:00
Levi Broderick 9ef79a5156 Make more types eligible for vectorized code paths in MemoryExtensions (#20855)
Types like sbyte, ushort, and other 8-bit / 16-bit elemental types are now directed down the fast vectorized code paths that previously only byte and char were eligible for.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-18 11:12:40 +01:00
monojenkins e52716f9a0 [bcl] Update BCL Linked Size 2019-03-18 11:08:16 +01:00
EgorBo 88acef1575 fix formatting 2019-03-18 10:49:06 +01:00
Egor Bogatov 253753bdb7 Add failing tests 2019-03-18 10:49:06 +01:00
Egor Bogatov 0801bfe4aa fix bug 2019-03-18 10:49:06 +01:00
Egor Bogatov 0d48237457 fix case when InlineData's type != ParameterType 2019-03-18 10:49:06 +01:00
Zoltan Varga 8b9d89b150 [netcore] Fix running tests. (#13493)
* [netcore] Fix running the tests.

* [netcore] Implement missing enum icalls.
2019-03-17 20:55:49 -04:00
Marek Safar fc7ab5076e Adapt shared Enum 2019-03-17 13:42:00 +01:00
Egor Bogatov 5df1bae25d Move Enum and CorElementType to shared (dotnet/coreclr#23177)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-17 13:42:00 +01:00
Sung Yoon Whang bc420a440e Fixing some payload serialization issue on new EventCounters (#23295)
* Fixing some payload serialization issue on new EventCounters

* Fix build error

Signed-off-by: dotnet-bot <[email protected]>
2019-03-17 08:09:21 +01:00
Nikita Potapenko cfa37ea29b Fix typo (dotnet/coreclr#23300)
.Net -> .NET

Signed-off-by: dotnet-bot <[email protected]>
2019-03-16 18:44:58 +01:00
sancheolz 1ca9fcc201 Fix local variable assign
Local variable must be assigned before use
2019-03-16 10:30:49 +01:00
[email protected] f278deee46 Fix Stackoverflow when SplitContainer`s SplitterDistance setted in SplitterMoved event subscription 2019-03-16 10:30:49 +01:00
monojenkins 9522ae42bb [bcl] Update BCL Linked Size 2019-03-16 10:22:50 +01:00
Zoltan Varga a0d0209fb1 [netcore] Add support for running tests.
* Move the sdk download from netcore/sample/Makefile to netcore/Makefile
* Add targets for running the System.Runtime.Tests test suite.
2019-03-16 10:20:51 +01:00
Jay Krell d34b6da0d8 [Coop] Convert ves_icall_System_Globalization_CultureData_fill_number_data. (#13477)
* [Coop] Convert ves_icall_System_Globalization_CultureData_fill_number_data.

Tested by running this program:
```
class A
{
	public static void Main()
	{
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.CompareInfo);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.AMDesignator);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.DateSeparator);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.DisplayName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.EnglishName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.IsNeutralCulture);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.IsReadOnly);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.LCID);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.Name);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.NativeName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.CurrencySymbol);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalDigits);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.Parent);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.TextInfo);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.ThreeLetterISOLanguageName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.ThreeLetterWindowsLanguageName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
	}
}
```

which covers some but not all of the data.

*  - Use gint32 instead of int when interfacing directly with managed code.
   Indirectly would be passing the parameter off to additional native code; compiler
   can often silently convert.
   int will always be 32 bits.

 - Expand tedious error-prone code instead of using preprocessor to automate.

 - Add comments that the native and managed types must match.

 - Rename the managed type to match the native type (not necessary,
   but might as well have them grep perfectly coincidentally.).

 - Sort the fields and some of their uses for easier reading.
 It might be infinitesimally faster to line up the order
 with the native structure, to synchronize access order (i.e. sequential access to all).

 - Restore parameter name to number_index.

 - Validate, with assert, number_index maximum not just minimum.

* Restore the group_sizes logic.
group_sizes is an array of up to two integers, -1 terminated.

* restore const

* Add comment explaining the ordered -- sorted alphabetically.
2019-03-15 16:56:41 -04:00
Larry Ewing e61f00cd2d Merge pull request #12984 from kjpou1/wasm-typed-arrays
[wasm] Typed Array support for better memory usage
2019-03-15 15:36:17 -05:00
Jo Shields 0f457095e5 Don't produce nunit-console scripts in bin/ (#13480)
NUnit bundle is gone, these scripts are empty and useless

```
10:27:45  DEBUG: Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/mono-core-6.1.0.462-0.nightly.1.epel6.x86_64
10:27:45  DEBUG: BUILDSTDERR: error: Installed (but unpackaged) file(s) found:
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console2
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console4
10:27:45  DEBUG: RPM build errors:
10:27:45  DEBUG: BUILDSTDERR:     Installed (but unpackaged) file(s) found:
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console2
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console4
```
2019-03-15 19:16:15 +01:00
Johan Lorensson 36a2cabc7b Default to sgen on Windows x64. (#13473)
Since Boehm is not supported on Windows x64 we should set sgen as default
GC instead of forcing the use of --disable-bohem.
2019-03-15 12:12:10 -04:00
lateralusX 47ee8c8f46 Excluded some additional none Windows sources from win32_build/winaot profile. 2019-03-15 17:02:48 +01:00
Zoltan Varga db12fc8666 [wasm] Update to emscripten 1.38.29. 2019-03-15 10:33:37 -05:00
Justin Van Patten 202a217e15 Collection<T>: Validate parameters in the public methods (#23166)
I was looking over the new Range methods on `Collection<T>` and it occurred to me that for all existing methods, parameter validation is done in the *public* methods before calling the *protected virtual* methods. This changes the new Range methods to do the same.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-15 16:01:50 +01:00
lateralusX dab3cc35c0 Windows full AOT build scripts update.
* Only do clean/rebuild when an assembly changed.
* Add wrappers for different full AOT build configurations.
* Make scripts callable from different working directory.
2019-03-15 15:58:50 +01:00
Alexander Köplinger cfb3704940 [eglib] Remap g_utf16_len and g_utf16_len to monoeg_ prefix (#13476)
They fail a xamarin-macios public symbols check otherwise (monoeg_ is whitelisted).
2019-03-15 15:56:05 +01:00
Johan Lorensson f375ffd08c Merge pull request #13472 from lateralusX/lateralusX/enable-all-ci-tests-llvm-windows
Enable all CI test suites for Windows x64 full AOT + LLVM.
2019-03-15 10:27:13 -04:00
Zoltan Varga 9cdb5b4a12 [llvm] Fix receiving rgctx argument in DIM methods, they receive the mrgctx even if they are not generic. 2019-03-15 14:34:24 +01:00
Jo Shields 85ccf3ec02 Merge pull request #13437 from DavidKarlas/patch-1
Fix generating `.dSYM` for GTK assemblies
2019-03-15 09:15:15 -04:00
Bernhard Urban 4a2e7ce6f9 [mini] Remove public symbol helper_sig_llvmonly_imt_trampoline (#13462)
Fixes Xamarin.Tests.Misc.PublicSymbols test.
2019-03-15 12:34:43 +01:00
Marek Safar 2fa8290b7a Update for shared partition change 2019-03-15 11:20:43 +01:00
Egor Bogatov 6b2958e199 Move TypeLoadException to shared (dotnet/coreclr#23238)
* fix coding-style

* shorter form for TypeName property

* move coreclr-specific ctor to TypeLoadException

Signed-off-by: dotnet-bot <[email protected]>
2019-03-15 11:20:43 +01:00
Kenneth Pouncey b9bc111f01 Address review comments - Rename HostObjectInterface to IHostObject 2019-03-15 10:52:21 +01:00
Larry Ewingandkjpou1 e00dc00649 Update sdks/wasm/binding_support.js
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:34:16 +01:00
Larry Ewingandkjpou1 953acc3afd Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:32:57 +01:00
Larry Ewingandkjpou1 dd92015bbd Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:32:32 +01:00
Larry Ewingandkjpou1 caedcc8270 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:32:15 +01:00
Larry Ewingandkjpou1 e346211299 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:31:58 +01:00
Larry Ewingandkjpou1 e3a1b8714e Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:31:36 +01:00
Larry Ewingandkjpou1 b325eaacd1 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:31:10 +01:00
Larry Ewingandkjpou1 892b7ac039 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/ArrayBuffer.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:30:52 +01:00
Larry Ewingandkjpou1 4d17766a23 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:29:54 +01:00
Larry Ewingandkjpou1 e3ed42a492 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:29:37 +01:00
Larry Ewingandkjpou1 670b032653 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:29:22 +01:00
Larry Ewingandkjpou1 a4bb7611b8 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:29:11 +01:00
Larry Ewingandkjpou1 57aa52db5a Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:28:23 +01:00
Larry Ewingandkjpou1 6ff0679677 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:28:06 +01:00
Larry Ewingandkjpou1 3e4706cf24 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/ArrayBuffer.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:27:51 +01:00
Kenneth Pouncey 7708f047d6 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-03-15 09:35:47 +01:00
Marek Safar 0bd836b2f2 [System.Private.CoreLib] Remove unused variables from TypeNameParser 2019-03-15 09:28:07 +01:00
Marek Safar 25abfa4a3f [System.Private.CoreLib] Small StackTrace cleanup 2019-03-15 09:27:41 +01:00
lateralusX d06927eecf Move SafePasswordHandle to win32_build_corlib profile. 2019-03-15 09:20:03 +01:00
lateralusX 8a77ff6c05 Reverting changes to TimeZoneInfo test when reducing classes in corlib winaot. 2019-03-15 09:20:03 +01:00
lateralusX e36be73ffb Reduce number of classes in winaot mscorlib.
Winaot profile should be a Windows AOT friendly profile close to mobile
and consoles. At some point it was set to include the full net_4_x that
cause problems on none desktop platforms. This fix reduce the set to only
include classes similar to mobile and console profiles.
2019-03-15 09:20:03 +01:00
lateralusX 3fabfccb73 Enable all CI test suites for Windows x64 full AOT + LLVM. 2019-03-15 08:50:43 +01:00
Egor Bogatov e8a66f38da bump netcore sdk version 2019-03-14 23:39:05 +01:00
lateralusX 8a6a8b7f88 Fix missing llc options for Windows x64 full AOT + LLVM mini regression tests. 2019-03-14 16:39:36 -04:00
Vlad Brezae 73ff4a7434 [interp] Make sure we call init before registering counters (#13457)
[interp] Make sure we call init before registering counters
2019-03-14 15:55:56 -04:00
Jo Shields cd8dc77a8e [win] Don't try to install NUnit 2.4, it's dead now 2019-03-14 15:01:34 -04:00
Alexander Kyte b20b86ff11 Merge pull request #13247 from lateralusX/lateralusX/fix-llvm-dwarf-cfi-windows-x64
Fix LLVM Dwarf CFI on Windows x64. Bump to corresponding LLVM commit.
2019-03-14 13:30:48 -04:00
Kenneth Pouncey 9f2dd3f554 [wasm][doc] Add Packager doc (#13411)
* Add Packager doc

* Fix numbering

* Address review comments

Packager.exe to packager.exe

* Move packager readme doc from getting started as per review comment.

* - Addresses review comment -- Fix emdash in `packager.exe -help` command line.

* Fix command line argument -- instead of single -
2019-03-14 17:45:56 +01:00
Vlad Brezae 620a46d8f2 [profiler] Fix vtune build (#13390)
[profiler] Fix vtune build
2019-03-14 11:19:47 -04:00
Marek Safar c194209317 [netcore] Generate full project setup in gen-xunit-runner 2019-03-14 14:35:29 +01:00
Jb Evain 959fbda60a [sdb] Add property AssemblyMirror.HasDebugInfo (#13353)
* [sdb] Add property AssemblyMirror.HasDebugInfo

* Fix mono_debug_image_has_debug_info to work with ppdb

* Bump API snapshot submodule
2019-03-14 09:44:17 +01:00
Aleksey Kliger (λgeek) c0b48793db Custom modifier equivalence, duplication, appending and inflation (#13320)
This all stems from ECMA 335, 7.1.1:

> The CLI itself shall treat required and optional modifiers in the same
> manner. Two signatures that differ only by the addition of a custom
> modifier (required or optional) shall not be considered to match. Custom
> modifiers have no other effect on the operation of the VES.

This rule means that when comparing signatures, we have to treat two types that
differ only in their custom modifiers as distinct. In particular, we have to do
this when comparing signatures in order to fill in the vtable for a class.  And
moreover, we have to concatenate custom modifiers when doing generic
instantiation.  If a method in a generic type has signature `T modopt(IsConst)
Method()` and we instantiate T with `int32 modopt(IsLong)`, we are expected to
produce the signature `int32 modopt(IsConst) modopt(IsLong) Method()` (with the
custom modifiers on `int32` in that order).

So this PR implements the following operations:
1. custom modifier appending during `mono_metadata_type_dup_with_cmods`
2. custom modifier-respecting comparison in `do_mono_metadata_type_equal`

To do this, we actually have to introduce a second representation of custom
modifiers: in the normal representation, all the cmod type specs come from a
single image.  Whereas now, due to inflation of signatures, we can have a mix
of modifiers from different images.  So in the MonoAggregateModContainer
representation, we pair each typespec token with the image in which it is to be
resolved.

We keep the old representation (a single image to resolve the entire set of
typespec tokens) because it's natural when you're just reading from a single
image.  Also this representation is part of the embedding API.

---

### But that's not all ###


It is possible for generic parameters of a generic class to appear in the
_custom modifiers_ of a type in a method signature.  For example:
```
    T modopt(Nullable`1<T>) Method ()
```

In this case, when we inflate this signature, we need to inflate not only the
return type, but also the modifiers on a return type.

That means our old aggregate representation (where each modifier is a pair of a
MonoImage and a typespec token) is inadequate: we can inflate a signature and
get a custom modifier that doesn't appear as a typespec in any table of any
existing image.

This is the same situation as generic instances: as a program runs, it creates
generic instances that are not part of the source code.  So we solve it the
same way as with generic instances.

Our new `MonoAggregateModContainer` representation is a pointer into memory owned
by a MonoImageSet that contains an entire MonoType for each custom modifier.

The invariant is that the aggregate modifier container is allocated from a
mempool of a `MonoImageSet` that includes the images of all the modifiers.

In general, when inflating, we first create a provisional candidate
MonoAggregateModContainer on the stack and then look it up the image set that
should own it and then look for a "canonical" mod container in the
`MonoImageSet:aggergate_modifiers_cache`

---

Also had to bump the AOT image format, which now always reads back in using the aggregate representation.

---

This should address #10564, #10565, #12422, #10945 (again), #6936, and the parts of #11350 that **don't** deal with arrays.

---

TODO:

- [x] Add some representative test cases to this PR.
- [ ] Modify our acceptance tests to run the various disabled Roslyn tests.
2019-03-14 09:16:42 +01:00
Johan Lorensson 557d8406f6 Merge pull request #13444 from lateralusX/lateralusX/fix-simd-llvm-issue
Fix error in SIMD test on Windows x64 LLVM due to changed llc defaults.
2019-03-14 03:43:12 -04:00
Maxim Lipnin 55fbd14763 Remove nunit24 from mono build and tree (#13415)
* Remove nunit24 from mono build and tree

* More cleanup

* Fix build

* [csproj] Update project files
2019-03-13 23:47:39 +01:00
Levi Broderick f62dfab807 Add OperationStatus-based UTF8 transcoding APIs (dotnet/coreclr#23219)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-13 23:46:08 +01:00
Alexander Kyte 1a574284ac [crash] Fallback to MAP_ANONYMOUS for allocator
This is helpful by allowing the crash reporter to work even while
unable to write to the working directory.
2019-03-13 14:30:57 -04:00
Zoltan Varga 8fed6666b0 Address review comments. 2019-03-13 17:52:11 +01:00
Zoltan Varga dfb3ebd706 [netcore] Improvements to gen-xunit-runner.
* Add support for response files.
* Fix encoding of small primitive types.
* Print number of run/failed/skipped tests.
2019-03-13 17:52:11 +01:00
Zoltan Varga 23fea25e80 [netcore] Define COMPlus_DebugWriteToStdErr=1 in make run to enable debug logging. 2019-03-13 17:52:11 +01:00
Zoltan Varga c3d77000a7 [netcore] Test fixes.
* EqualityComparer.cs: Add LastIndexOf ().
* RuntimeAssembly.cs: Implement	       CreateAssemblyName ().
* AssemblyLoadContext.cs: Handle windows paths.		  Add DoAssemblyResolve () method.
* Array.cs: Add/fix error handling. Implement LastIndexOf ()/GetRawArrayData ().
* Attribute.cs:	    Implement.
* Buffer.cs: Add/fix error handling.
* DefaultBinder.cs: Implement.
* RuntimeType.cs: Implement HasSameMetadataDefinitionAs ().
* RuntimeEventInfo.cs: Ditto.
* RuntimeFieldInfo.cs: Ditto.
* RuntimeMethodInfo.cs: Ditto.
* RuntimePropertyInfo.cs: Ditto.
* MonoCustomAttrs.cs: Add eror handling. Implement inheritance support for parameters.
* gc.cs: Fix error handling.
* rttype.cs: Fix handling of null namespaces.
2019-03-13 17:52:11 +01:00
Zoltan Varga aa949e2114 [runtime] Add more error checking and special cases to the Array get/set icalls. 2019-03-13 17:52:11 +01:00
Zoltan Varga 46ae93a23c [runtime] Add a few more m_class accessors. 2019-03-13 17:52:11 +01:00
Zoltan Varga d5feee9c71 [runtime] Fix the ordering of the Buffer icalls. 2019-03-13 17:52:11 +01:00
Zoltan Varga 3dcee3319e [runtime] Avoid asserting if AppDomainUnloadedException is not found. 2019-03-13 17:52:11 +01:00
Zoltan Varga 7f9cb785f2 [runtime] Fix the creation of argument exceptions in netcore, the layout of ArgumentException is no longer visible to the runtime. 2019-03-13 17:52:11 +01:00
Zoltan Varga d7ba254448 [jit] Fix a IL verification error which the netcore tests run into. 2019-03-13 17:52:11 +01:00
Ankit Jain 4cb9a914f0 [msbuild] Update to track upstream vs16.0 branch (#13053) 2019-03-13 16:40:05 +01:00
Michal Strehovsky 90bdd5da71 Fix missed RelocatedType annotation
[tfs-changeset: 1735855]

Signed-off-by: dotnet-bot <[email protected]>
2019-03-13 15:58:58 +01:00
Aleksey Kliger d28aab8d56 [class-init] Take loader lock around mono_class_setup_interface_id_internal
Writing to MonoClass:interface_id must be done with the loader lock held.

Fixes assertion:
```
* Assertion at class-init.c:1830, condition `i == 0 || interfaces_full [i]->interface_id >= interfaces_full [i - 1]->interface_id' not met
```
2019-03-13 10:54:07 -04:00
lateralusX 9b440da1f2 Fix error in SIMD test on Windows x64 LLVM due to changed llc defaults. 2019-03-13 15:52:48 +01:00
Johan Lorensson eaa5805af7 Merge pull request #13393 from lateralusX/lateralusX/fix-build-warning-local-global
Fix build warning, local variable hides global.
2019-03-13 08:39:02 -04:00
Rolf Bjarne Kvinge a72e7ffc0d Revert "[mini] Inline Selector.GetHandle for tvOS and watchOS assemblies as well. (#13246)" (#13418)
Revert "[mini] Inline Selector.GetHandle for tvOS and watchOS assemblies as well. (#13246)"

This reverts commit c99fe4b462.

It doesn't work when LLVM is enabled for tvOS: https://github.com/xamarin/xamarin-macios/pull/5742#issuecomment-471007078, it causes multiple compilation errors like this:

    Process exited with code 1, command:
    /Applications/Xcode101.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -isysroot /Applications/Xcode101.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -Qunused-arguments -mtvos-version-min=12.1 -fembed-bitcode-marker -arch arm64 -c -o /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.o -x assembler /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.s
    /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.s:4665:14: error: invalid variant 'OBJC_SELECTOR_REFERENCES_.2@PAGE'
            adrp    x8, l_@OBJC_SELECTOR_REFERENCES_.2@PAGE
                           ^
    /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.s:4673:18: error: invalid variant 'OBJC_SELECTOR_REFERENCES_.2@PAGEOFF'
            ldr     x1, [x8, l_@OBJC_SELECTOR_REFERENCES_.2@PAGEOFF]




<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-03-13 08:05:48 -04:00
Alexis Christoforides f934b60854 [MacSDK] Bump Nuget to 4.8.2 2019-03-13 11:28:58 +01:00
Marek Safar fa7b007914 [System.Private.CoreLib] Remove duplicate checks 2019-03-13 10:35:25 +01:00
Sung Yoon Whang 6e85a0fb99 Add new counter APIs (dotnet/coreclr#23077)
* Refactor EventCounter and add PollingCounter

* Add PollingCounter

* Add IncrementingEventCounter and IncrementingPollingCounter

* Add MetaData API to Counters

* Some more refactoring

* removing commented out code

* some more cleanup

* build fix and addressing some PR comments

* Addressing PR feedback

* use StringBuilder to generate metadata string

Signed-off-by: dotnet-bot <[email protected]>
2019-03-13 10:03:41 +01:00
David Karlaš a716c9ad7b Fix generating .dSYM for GTK assemblies
Problem is that https://github.com/mono/bockbuild/blob/14535c270ea9f8d536efe6852700d8d1cb657c1f/packages/gtk%2B.py#L4 passes `gtk` for repository name to `GitHubPackage` which then uses this as package name. So when it's decided if `-g` should be added at https://github.com/mono/bockbuild/blob/5c2378112dc681cea0aa5c2447661fb13adbc46b/bockbuild/darwinprofile.py#L158-L159 it's false hence GTK assemblies don't get debug symbols.
2019-03-13 09:39:22 +01:00
Calvin Buckley 55d913c2d3 Bump corefx for System.Native posix_fadvise change (#13409) 2019-03-13 02:18:47 +01:00
Tanner Gooding cde76c1521 Fixing a couple of issues in the Utf8Parsing/Formatting code (#23134)
* Fixing NumberToSingle and NumberToDouble to handle DigitsCount == 0

* Fixing Utf8Formatter.Float to transcode non ASCII bytes

* Responding to PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-03-12 22:42:53 +01:00
Alexander Köplinger d884bd3e12 [corlib] Fix RuntimeFeatureTest.NoNewFeaturesAdded()
DefaultImplementationsOfInterfaces was enabled with https://github.com/mono/mono/pull/13417
2019-03-12 21:03:06 +01:00
Alexander Köplinger 92b435d6fe Move drawing types for XI/XM/wasm/orbis/unreal to System.Drawing.Common (#13414)
* Move drawing types for XI/XM/wasm/orbis/unreal to System.Drawing.Common

For XI/XM they were in Xamarin.iOS.dll/OpenTK-1.0.dll before.

For wasm/orbis/unreal we remove System.Drawing.dll from the profiles and
add the types to System.Drawing.Common.dll instead to align with the other
mobile profiles (only "net_4_x" and "build" still have System.Drawing.dll).

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-12 18:07:19 +01:00
Joshua Peterson 244c1aab8e Fix a possible crash while printing a warning (#13399)
The format string was incorrect in this case, which leads to a crash
in Unity. Simply remove the unused `%s` format specifier here.
2019-03-12 18:03:58 +01:00
monojenkins fb8554d76f [csproj] Update project files 2019-03-12 17:26:20 +01:00
monojenkins 0a85578bd0 Bump API snapshot submodule 2019-03-12 17:26:20 +01:00
Zoltan Varga 522a46dcac [corlib] Define FEATURE_DEFAULT_INTERFACES so RuntimeFeatures indicates DIMs are supported. 2019-03-12 17:26:20 +01:00
Kenneth Pouncey 205bb1666a [wasm][tests] Add WebSocket tests 2019-03-12 14:57:50 +01:00
Zoltan Varga 00c837d66a [netcore] Implement Type.GetType () overloads with assembly/type resolve delegates. (#13410)
Instead of extending the runtime gettype implementation, port the type parsing code
to C#.
2019-03-12 13:01:34 +01:00
Zoltan Varga ec7b9ec409 [jit] Implement Unsafe:ByteOffset<T> intrinsic. 2019-03-12 12:19:51 +01:00
Kenneth Pouncey 38ec3156f5 Address review by @Suchiman after conflict resolution. Thanks for the catch. 2019-03-12 11:02:28 +01:00
Kenneth Pouncey 9a73ea12b7 Confilct with Runtime.cs
Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays

# Conflicts:
#	sdks/wasm/framework/src/WebAssembly.Bindings/Runtime.cs
2019-03-12 10:11:04 +01:00
Larry Ewing 4ff1307e21 Remove all use of ContainsKey from js bindings (#13376) 2019-03-12 09:18:09 +01:00
Maxim Lipnin ad5fe197a3 Add reflected type to event methods (#13397)
Fixes https://github.com/mono/mono/issues/13350
Fixes https://github.com/mono/mono/issues/10277
2019-03-12 08:32:40 +01:00
Hugh Bellamy 030111234e Fix NRE in EqualStringArrays (dotnet/coreclr#23174)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-11 22:35:21 +01:00
Michal Strehovský 07c383b829 Replace Delegate.CreateDelegate (dotnet/corert#7147)
Replacing this with a pattern that is easier to statically analyze. We use the GetType/GetMethod/CreateDelegate pattern in several places already.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-11 22:20:53 +01:00
Alexander Köplinger b92a105992 [configure.ac] Fix configure checks for Mono.Native (#13395)
When the configure checks were ported from configure.cmake in corefx
a couple of mistakes happened:

- Using AC_TRY_COMPILE instead of AC_TRY_LINK:
  CMake's check_c_source_compiles() function compiles *and* links while
  AC_TRY_COMPILE only does the former. This hides potential linking issues
  which should fail the configure check.
- Using CFLAGS="-Werror -W....":
  This works in CMake but autoconf always appends the previously defined
  CFLAGS and since we set e.g. `-Wno-undefined` some configure checks
  would fail due to an unrelated warning being treated as an error.
  We need to only promot specific warnings to errors instead.

While looking at this I also found that we were setting CFLAGS after
we already AC_SUBST() it, we need to do this very close to the end of configure.ac.
Moved some code into that last block.

Finally, Android has special cases for sendfile and arc4random_buf where
they're defined in the header but aren't actually there for certain API profiles.
For now we disable arc4random_buf on Android and add a special check for sendfile.

* Fix sendfile with 6 parameters being misdetected

We need to make sure to actually prevent the implicit prototype since
in this case sendfile with different set of parameters actually exists
so the linker wouldn't fail.

Also fixed a few other cases of wrong configure checks due to missing headers.

* Move GSS checks into the Mono.Native checks section

This allows us to have a 1:1 mapping of the checks from configure.cmake
2019-03-11 20:36:40 +01:00
Thays Grazia 3537672955 [debugger] Fixing two crashes while debugging an Android app. (#13373)
* [debugger] Fixing two crashes while debugging an Android app.

-> Doing stepping into in VSM in some situation the frame saved in TLS is not synchronised with what is really been executed in the main thread. This makes the debugger-agent crashes because it tries to get variable info in some memory that is not available anymore.
	-> To fix it I forced the update of stack when CMD_THREAD_GET_FRAME_INFO is called.

-> Doing step over in Visual Studio for Windows, if you have the threads debugger window enabled, VSW calls frame_commands for each thread that is showed, and if the thread is not really_suspended it tries to get variable info from a memory that is not available anymore because the thread is not suspended yet.
	-> To fix it I don't send variable info of a frame if the thread is not really_suspended and doesn't have an async_state valid.

#Fixes 12843
2019-03-11 15:55:47 -03:00
Alexander Köplinger 0d7ce1f767 Fix build on Alpine Linux (#13394)
- sys/sysctl.h isn't available on Alpine and not needed by the code,
  guard it using HAVE_SYS_SYSCTL_H like elsewhere. Added by https://github.com/mono/mono/pull/11855

- pthread_mutexattr_setprotocol doesn't support PTHREAD_PRIO_INHERIT,
  check return value. Added by https://github.com/mono/mono/pull/13333
2019-03-11 16:59:44 +01:00
Kenneth Pouncey cbe835d0c1 Use new HostObject instead of NewJSObject. 2019-03-11 15:36:33 +01:00
Kenneth Pouncey 911b21dff4 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays
# Conflicts:
#	sdks/wasm/framework/src/WebAssembly.Net.Http/WasmHttpMessageHandler.cs
2019-03-11 15:24:26 +01:00
Egor Bogatov d0013e438c Add System.Drawing converters to netstandard facade (#13326)
This PR adds missing System.Drawing converters thus it completes NS2.1 support (as of today) for all profiles except macOS\IOS specific ones: monotouch, tv, watch, xammac, xammac_net_4_5.
2019-03-11 13:23:31 +01:00
Zoltan Varga db67d18d0d [netcore] Ongoing work. (#13391)
* [runtime] Add a few new m_class inline functions.

* [netcore] Implement Array.IndexOf ().

* [netcore] Implement RuntimeHelpers.PrepareMethod ().

* Add error checks to RuntimeHelpers.GetUninitializedObject ().
* Fix some type attributes.
* Fix some TypedReference special cases.
2019-03-11 08:16:21 -04:00
Zoltan Varga 38a2639fc1 [netcore] Fix build. (#13392)
* [netcore] Fix build.

* Update Buffer.cs
2019-03-11 12:57:44 +01:00
lateralusX ce3bbb011b Fix build warning, local variable hides global.
On Windows MSVC build this cause:

warning C4459: declaration of 'mono_cfg_dir' hides global declaration
2019-03-11 12:36:25 +01:00
Johan Lorensson ed3039b377 Merge pull request #13367 from lateralusX/lateralusX/fix-windows-build-warning
Fix build warning in mono-error.h.
2019-03-11 07:12:29 -04:00
Kenneth Pouncey b124b51066 Address review comments.
- Cleanup docs.
- Cleanup implicit conversions.
- Remove ToSpan()
2019-03-11 12:02:11 +01:00
Zoltan Varga ea761357f8 [jit] Reenable the EqualityComparer:Default devirt optimization. (#13321) 2019-03-11 06:09:59 -04:00
Calvin Buckley e9e52de223 Fix System.Decimal regression from .NET Core on big endian (#13348)
Upstream must have rewritten, because the runtime checks were
replaced with the (not good for Mono) ifdefs.

Not throughly tested, but unbreaks build locally; waiting for CI
to come back with more results.

If it works, could someone get this upstream?
2019-03-11 10:20:49 +01:00
Johan Lorensson a91e3f162a Merge pull request #13366 from lateralusX/lateralusX/add-missing-public-header-to-dist
Include mono-forward.h public header on Windows.
2019-03-11 04:29:42 -04:00
monojenkins 0e804950b5 [csproj] Update project files 2019-03-11 09:11:16 +01:00
monojenkins 0086403d54 Bump API snapshot submodule 2019-03-11 09:11:16 +01:00
Steve Pfister a49d5df03f These changes help prep for refsrc System.Web
* DynamicRoleClaimProvider to help with legacy role management in web forms
* Added AppDomainManagerAssembly, AppDomainManagerType, and PartialTrustVisibleAssemblies
  properties to AppDomainSetup. They don't do anything, but having  them there
  helps lessen the amount of change in refsrc System.Web.
2019-03-11 09:11:16 +01:00
Larry Ewing b5082160c3 Remove linq usage from WasmHttpMessageHandler 2019-03-11 09:10:59 +01:00
Levi Broderick 31b5a4554a Refactor Encoding to split fast-path and fallback logic (#23098)
This refactoring is limited to ASCIIEncoding at the moment, but it can easily be applied to UTF-8 / UTF-16 / UTF-32.

High-level changes:
- Fallback logic has been split from the fast-path, improving performance of GetBytes and similar routines.
- All of the plumbing of when to invoke the fallback logic and how to manage leftover data has been moved into the base class.
- Almost all of the logic except for the fast-path is now written in terms of verifiable code (Span and ReadOnlySpan).
- Minor bug fixes in EncoderNLS.Convert (see https://github.com/dotnet/coreclr/issues/23020).

Signed-off-by: dotnet-bot <[email protected]>
2019-03-11 09:05:29 +01:00
monojenkins db6ee0108b [bcl] Update BCL Linked Size 2019-03-11 09:01:51 +01:00
Bernhard Urban 2eeaf888c1 [AOT] add option to control arguments to llc and add fallback for x86 (#13323)
* [AOT] add option to control arguments to llc and add fallback for x86

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

* rename
2019-03-11 08:40:22 +01:00
Kenneth Pouncey 24a0e0d7f2 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-03-11 06:23:29 +01:00
monojenkins 3489679dc5 Bump API snapshot submodule 2019-03-10 13:11:12 +01:00
Steve Pfister 063f2a2b9a Added missing ToolLocationHelper methods that will be
used by refsrc System.Web.Compliation.AssemblyResolver.
2019-03-10 13:11:12 +01:00
Larry Ewing 5dbf642965 Add Blazor E2E test to wasm bcl-size-diff 2019-03-10 13:11:01 +01:00
Kurt Van Dijck 3e8108ea65 threads: set mutex PRIO_INHERIT in attribute (#13333)
threads: set mutex PRIO_INHERIT in attribute

When running multiple threads on a linux-rt kernel, with different priorities, the lack of priority-inheritance
makes the kernel make wrong scheduling choices.
This commit changes the system-wide mutex initializers.
This change protects our system against unexpected latencies in higher priority threads.

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2019-03-09 23:35:34 -05:00
Marek Safar 4259cfad8f Remove local Buffer copy 2019-03-10 00:56:08 +01:00
Egor Bogatov 8a3a41b81a Move Buffer to shared (dotnet/coreclr#23157)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-10 00:56:08 +01:00
Dan Moseley 73caa49efb Remove 2 suffix step 1 (dotnet/corefx#35904)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-10 00:56:08 +01:00
Stephen Toub d5b0333f37 Add stack depth check to all Task continuations (dotnet/coreclr#23152)
Currently Task has a stack depth check that avoids stack overflows on very deep stack continuation chains, but it only applies to Task.ContinueWith, not to other kinds of continuations.  This changes that to have it apply to all.

As part of this, this also deletes the current StackGuard type used to achieve the check.  The type was meant to avoid expensive calls to check where we are on the stack, but now that we're using TryEnsureSufficientExecutionStack, it's actually faster to just call that rather than access the current StackGuard from a ThreadLocal.  This then also cleans up the call sites nicely, as they no longer need finally blocks to undo the increment performed on the StackGuard.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-09 17:48:20 +01:00
Zoltan Varga 92dfcb120b [netcore] Use codedom for code emission in the xunit generator. Add support for Theories and inline data. 2019-03-09 11:52:49 +01:00
Zoltan Varga 0f798ae6cf [netcore] Ongoing work. (#13357)
* [netcore] Implement MethodBody using internal Runtime* classes. Use the mono version for ModuleHandle.

* [netcore] Reflection fixes.

* Address review comments.

* [netcore] Implement RuntimeHelpers:GetUninitializedObject ().

* [netcore] Implement the Type::GetMethod () overload which has a genericParameterCount parameter.

* [netcore] Implement Thread.OptimalMaxSpinWaitsPerSpinIteration.

* Revert a change to fix a test failure.

* [netcore] Implement Marshal:GetExceptionForHRInternal ().

* [netcore] Implement GC:GetSegmentSize ().

* [runtime] Allow pointer type members in typed references.
2019-03-09 05:26:40 -05:00
Marek Safar dd0e9a8aa3 Fix the build 2019-03-09 09:27:46 +01:00
Marek Safar 289eb40af4 Move part of RuntimeHelpers to shared partition (dotnet/coreclr#23130)
* Move part of RuntimeHelpers to shared partition

* Remove FormatterServices.cs

Signed-off-by: dotnet-bot <[email protected]>
2019-03-09 09:27:46 +01:00
Steve Pfister 0306c38fed Add refsrc DataProtector to System.Security (#13365)
* Added DataProtector abstract class to be used when refsrc
System.Web gets ported over.

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-09 01:07:53 +01:00
Zoltan Varga 4401acd172 [jit] Avoid an assert with default interface methods and gsharing.
Fixes https://github.com/mono/mono/issues/13319.
2019-03-09 00:55:39 +01:00
Dotnet-GitSync-Bot 8efb2906d2 Mirror changes from mono/coreclr,corert (#13375)
* Added new Range Manipulation APIs for Collection<T> which propogate up to ObservableCollection<T>. AddRange, InsertRange, RemoveRange and Replace Range

Signed-off-by: dotnet-bot <[email protected]>

* Updated index out of range exception check to be a single comparison

Signed-off-by: dotnet-bot <[email protected]>

* Updated foreach to use T instead of var

Signed-off-by: dotnet-bot <[email protected]>

* Adding braces on for loop

Signed-off-by: dotnet-bot <[email protected]>

* Added ReplaceItemsRange API and updated ReplaceRange to invoke the protected method

Signed-off-by: dotnet-bot <[email protected]>

* Remove ternary operator from invocation as it is the same as inputing items.Count

Signed-off-by: dotnet-bot <[email protected]>

* Updated RemoveItemsRange to prevent int.MaxValue overflow errors

Signed-off-by: dotnet-bot <[email protected]>

* Updated RemoveItemsRange to properly remove each item and not just the index items

Signed-off-by: dotnet-bot <[email protected]>

* Added ArgumentOutOfRangeException exception in RemoveRange if the count is less than 0

Signed-off-by: dotnet-bot <[email protected]>

* Updated RemoveRange invocation of RemoveAt to use index instead of i, because the array changes with each iteration of the for loop and will cause side-effects which may include index out of range exceptions. This needs to be index because as the array shrinks the index is always at the correct position.

Signed-off-by: dotnet-bot <[email protected]>

* Updated RemoveAt->RemoveItem. This change removes redundent validation checks that happen using the RemoveAt API. RemoveItem gives us direct access to invoke the command

Signed-off-by: dotnet-bot <[email protected]>

* Updated InsertItemsRange to simplify the expression and added performance improvements. If the underlying `items` is using List<T> we should use it's InsertRange method since it is optimized, othersie we use InsertItem

Signed-off-by: dotnet-bot <[email protected]>

* Added new RemoveRange validation check to see if the resulting range (index + count) > items.Count and if it is true throw ArgumentException

Signed-off-by: dotnet-bot <[email protected]>

* Removed (Int64) cast statements from RemoveItemsRange when checking for overflow errors

Signed-off-by: dotnet-bot <[email protected]>

* InsertItemsRange API now checks if the underlying items.IsReadOnly first then collection == null

Signed-off-by: dotnet-bot <[email protected]>

* Simplified the RemoveItem logic since we have more robust validation

Signed-off-by: dotnet-bot <[email protected]>

* Optimized RemoveItemsRange to call the list.RemoveRange if the items is of type List<T>

Signed-off-by: dotnet-bot <[email protected]>
2019-03-09 00:51:26 +01:00
Filip Navara 19258e1680 Allow deserialization for ResourceManager created with non-default resource set type (#23051)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-09 00:44:14 +01:00
Johan Lorensson 2e30dbab63 Correctly defined thread API support for different Windows platforms. (#13344) 2019-03-08 14:34:49 -05:00
Zoltan Varga 6c81f5dbd2 [sdb] Avoid stack overflows caused by recursive calls between suspend_current () and invoke_method (). (#13362)
Fixes https://github.com/mono/mono/issues/13261.
2019-03-08 14:20:36 -05:00
Johan Lorensson 4c57215ca9 Fix GetTokenName to fail with exception on none Windows desktop platforms. (#13343) 2019-03-08 12:38:56 -05:00
Johan Lorensson 526939e146 Better probing logic on Windows when Unicode Win32 symbols are used. (#13345)
Several of the corefx interop sources uses the Unicode names of Win32 symbols.
Our current probing implementation on Windows will test the given name last
when nomangle is not provided (default). On Windows that will be a large number
of probes due to old stdcall name mangling rules. Fix makes sure we first test
the symbol against its charset and the given symbol, before trying the stdcall
name mangling rules. Will reduce the probing a lot on Windows for corefx Win32
interop classes.
2019-03-08 12:35:56 -05:00
Larry Ewing 27197d3f15 Add System.Runtime.Serialization targets 2019-03-08 10:36:31 -06:00
Larry Ewing f2b8ec3b3d Move the disabled tests under INCLUDE_DISABLED 2019-03-08 10:36:31 -06:00
Larry Ewing ad4e0414cd Add DataContractSerializer test 2019-03-08 10:36:31 -06:00
Larry Ewing a7f4dea649 Add linker test for Queryable 2019-03-08 10:36:31 -06:00
Alexander Köplinger 566e4565f4 [corlib] Remove Interop.MountPoints.cs from .sources (#13363)
* [corlib] Remove Interop.MountPoints.cs from .sources

We no longer need it since https://github.com/mono/mono/pull/13125 and having
it included makes xamarin-macios still complain about the missing symbol.

* [csproj] Update project files
2019-03-08 17:19:09 +01:00
lateralusX 7014dc1f8c Fix LLVM Dwarf CFI on Windows x64. Bump to corresponding LLVM commit. 2019-03-08 16:33:17 +01:00
lateralusX 5d5cb61243 Fix build warning in mono-error.h.
Warning (at least on Windows) due to unamed struct:

C4201, nonstandard extension used : nameless struct/union

Since the header can be consumed by embedders this warning should be
disabled.
2019-03-08 16:11:14 +01:00
lateralusX e9183496fb Include mono-forward.h public header on Windows. 2019-03-08 15:35:10 +01:00
Kenneth Pouncey e0651ded29 Add exclude features option when linking to the sdk. (#13340) 2019-03-08 15:22:36 +01:00
Johan Lorensson f89fdf28a3 Fix build warning in full AOT build. (#13342) 2019-03-08 06:37:46 -05:00
Marek Safar 63a58325b5 Remove unused type 2019-03-08 09:50:42 +01:00
Marek Safar 841a1d49b7 Use platform specific implementation of GetCurrentProcessId (#23084)
* Use platform specific implementation of GetCurrentProcessId

directly in shared location instead of relying on runtime export

* Move GetCurrentProcessId to Interop class

* Update ES_BUILD_STANDALONE build

Signed-off-by: dotnet-bot <[email protected]>
2019-03-08 09:50:42 +01:00
Marek Safar 14b0f985de Merge pull request #13356 from monojenkins/bclsizediff
[bcl] Update BCL Linked Size
2019-03-08 09:38:42 +01:00
Jb Evain 297b6ba328 [sdb] Avoid double lookup of replay packets 2019-03-08 09:34:54 +01:00
Dávid Kaya 8fc751180c Added UserFlags field, unblocks #34560 (dotnet/corefx#35851)
* Added UserFlags field

* Added UserFlags

Signed-off-by: dotnet-bot <[email protected]>
2019-03-08 07:39:21 +01:00
monojenkins b5daa32188 [bcl] Update BCL Linked Size 2019-03-08 03:38:14 +00:00
Alexander Köplinger 8cd69e14e3 Update System.Net.Http.csproj
Change missed in https://github.com/mono/mono/commit/97adf2e53e20c127bc38cb4f64a43f55c77e5c7e
2019-03-07 23:41:22 +01:00
Stephen Toub ad819c8921 Add missing CopyToAsync override in FileStream.Unix.cs (#23101)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 23:38:17 +01:00
Zoltan Varga 11349df4e6 [netcore] Add a tool to convert corefx test assemblies into simple test runners. (#13346)
* [netcore] Add a tool to convert corefx test assemblies into simple test runners.

* Fix computation of traits.
2019-03-07 22:50:42 +01:00
Hugh Bellamy f6179a0e68 Cleanup Globalization info code (dotnet/coreclr#22591)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 22:24:52 +01:00
Martin Baulig 97adf2e53e HttpClient for Web Assembly. 2019-03-07 21:49:27 +01:00
Alexander Köplinger 2e4d4a040c [sqlmetal] Distribute DbLinq.snk in tarball 2019-03-07 19:05:05 +01:00
monojenkins dbcd755c86 Bump API snapshot submodule 2019-03-07 18:47:03 +01:00
monojenkins ebb8b6fff2 [csproj] Update project files 2019-03-07 18:47:03 +01:00
Martin Baulig 2d6f02a83c HttpClient for Android. 2019-03-07 18:47:03 +01:00
Vlad Brezae deebdd1489 [interp] Add a few starting stats (#13347)
* [runtime] Use same single convention for stats tracking time

Also avoid useless mallocs/frees

* [interp] Add counters for transform phase
2019-03-07 11:53:11 -05:00
Kenneth Pouncey cad455b393 Fix HttpMessageHandler request content as binary. 2019-03-07 11:50:09 +01:00
Alexander Köplinger f77193d306 [mono/tests] Add fullaot-mixed to SUBDIRS
Fixes tarball build break.
2019-03-07 11:43:56 +01:00
Kenneth Pouncey 8d12c53c0a Fix ClientWebSocket passing of ArraySegment. 2019-03-07 11:35:16 +01:00
Kenneth Pouncey bb5eb13967 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays
# Conflicts:
#	sdks/wasm/framework/src/WebAssembly.Bindings/WebAssembly.Bindings.csproj
2019-03-07 10:10:59 +01:00
monojenkins 7fe2472b34 [csproj] Update project files 2019-03-07 10:03:14 +01:00
monojenkins 530596db02 Bump API snapshot submodule 2019-03-07 10:03:14 +01:00
Steve Pfister 6a9950c5d2 * System.Data.Linq now points to reference source
* Created SR and Strings helpers as refsrc resources are
  missing / incomplete

* Moved existing tests into the Test folder

* Moved old DBLinq code into tools/sqlmetal as there are no other
  alternatives.
2019-03-07 10:03:14 +01:00
Marek Safar c96df417d1 Remove code moved to shared 2019-03-07 00:42:25 +01:00
Tanner Gooding 57c75cbb94 Fixing the float/double parsing logic to handle exponents that are too large/small (#23043)
* Fixing the float/double parsing logic to handle exponents that are too large/small

* Fixing the debug assert to use >= and <=

* Fixing the max exponents to be +1 to match what scale uses.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Stephen Toub 6d8df4e7f3 Clean up some string.Format usage (dotnet/coreclr#23025)
* Clean up some string.Format usage

Mainly changes some string.Format usage to be SR.Format when working with resource strings.  Also cleans up a few asserts that were using string.Format.

* Address PR feedback and clean up src

* Address more feedback

* Update src/System.Private.CoreLib/shared/System/Type.Enum.cs

Thanks.

Co-Authored-By: stephentoub <[email protected]>
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Maryam Ariyan d56e47721a Add Type Forward (dotnet/coreclr#23036)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Marek Safar 72406ff802 Move more Assembly methods to shared partition (dotnet/coreclr#22817)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Andrew Au a7963f4e51 Fix issue 23009
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Honza Rameš d1b1ce9dfa Fix ValueStringBuilder.EnsureCapacity to call Grow correctly (#35810)
* Fix ValueStringBuilder.EnsureCapacity to call Grow correctly (#35746)

Call to EnsureCapacity may result in invalid buffer size being
allocated.

* Update ValueStringBuilder.Grow to prevent misuse (#35746)

Updated name of the argument to make it clearer on the call-site also
added summary co clearly state the behavior of Grow.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
dotnet-maestro[bot] 60de375154 Update dependencies from dotnet/core-setup (dotnet/corefx#35713)
* Update dependencies from https://github.com/dotnet/core-setup build 20190301.13

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27501-13
- Microsoft.NETCore.DotNetHost - 3.0.0-preview4-27501-13
- Microsoft.NETCore.DotNetHostPolicy - 3.0.0-preview4-27501-13

* Remove workaround for System.Runtime.CompilerServices.Unsafe

* Update dependencies from https://github.com/dotnet/core-setup build 20190302.8

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27502-8
- Microsoft.NETCore.DotNetHost - 3.0.0-preview4-27502-8
- Microsoft.NETCore.DotNetHostPolicy - 3.0.0-preview4-27502-8

* Update dependencies from https://github.com/dotnet/core-setup build 20190303.9

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27503-9
- Microsoft.NETCore.DotNetHost - 3.0.0-preview4-27503-9
- Microsoft.NETCore.DotNetHostPolicy - 3.0.0-preview4-27503-9

* Update dependencies from https://github.com/dotnet/core-setup build 20190304.10

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27504-10
- Microsoft.NETCore.DotNetHost - 3.0.0-preview4-27504-10
- Microsoft.NETCore.DotNetHostPolicy - 3.0.0-preview4-27504-10

* Don't include EventRegistrationToken on Unix

This type was accidentally duplicated between CoreLib and contracts.

Suppress that for now since we're detecting the duplication in the shared framework.

Make a fix in the shared items to restore the condition on this type.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Viktor Hofer af3965d9d2 Project msbuild syntax cleanup (dotnet/corefx#35686)
* Remove license header from non-shipping files

* Remove obsolete Project attributes

* Remove xml header and remove DefaultTargets

Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Michal Strehovský edf4941ec3 Fix ProjectN build breaks (dotnet/corert#7115)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Marek Safar 186ae08b0a Move fully managed TimerQueue implementation to shared partition (#7111)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Alexander Köplinger 97f2393f3e [mono/tests] Add common_mixed.mk to EXTRA_DIST 2019-03-06 23:58:48 +01:00
Alexander Köplinger 2f2881fc4b Add .gitignore for mono/tests/fullaot-mixed 2019-03-06 23:56:11 +01:00
Alexander Köplinger aabd3ab102 Bump bockbuild to get GTK fix
See https://github.com/mono/bockbuild/pull/90
2019-03-06 23:45:10 +01:00
Marek Safar fbffa8719a [System.Private.CoreLib] Fix the build 2019-03-06 23:05:20 +01:00
Martin Baulig 6034bc00c4 Introducing HttpClient.CreateDefaultHandler(). (#13305)
* The default `HttpClient` constructor now calls a static method `CreateDefaultHandler()`;
   we provide a platform-specific implementation of it.

* Replaced `HeaderUtils` with `PlatformHelper` and removed the `LEGACY_HTTPCLIENT` conditional.

* Added a new `socketshandler.sources` file to keep the sources in one place.

* Use a reflection check in the tests instead of the `LEGACY_HTTPCLIENT` conditional.

* This allows us to also get rid of the `SOCKETSHTTPHANDLER` define.
2019-03-06 20:56:42 +01:00
Zoltan Varga 835c8590ca [netcore] Implement DependentHandle using the existing ephemeron code. 2019-03-06 18:24:46 +01:00
Katelyn Gadd d02c43e23e Propagate type load errors out of IsAssignableFrom instead of erroneously returning false. Makes the underlying cause of #13113 discoverable. (#13324) 2019-03-06 11:41:55 -05:00
Ludovic Henry 6527e21bb4 [safepoint] Use LLVM pass to insert safepoint (#11789)
* [safepoint] Use LLVM pass to insert safepoint

This is to avoid safepoints to stop optimizations from happening.

* [safepoint] Use LLVM pass to insert safepoint

This is to avoid safepoints to stop optimizations from happening.

* fix error: emit_gc_safepoint_poll does not return anything

* Revert partial 4150f06f8621f2f2918e3bd747bf80a0f0f8c9c6

* Fix build

* [runtime] Add mono_threads_state_poll to preinited icalls

* [runtime] Adding back in safepoint icall skip code

* Revert mini.c to 100f422

* [runtime] Add missing deref to safepoint poll

* [runtime] Make safepoint functions have WeakODR linkage
2019-03-06 11:38:48 -05:00
Alexander Köplinger cacc9b7c4c [Facades] Add typeforwarders for DispatchProxy and TypeExtensions (#13325)
* [Facades] Add typeforwarders for DispatchProxy and TypeExtensions

DispatchProxy lives in System.Core for all profiles since https://github.com/mono/mono/pull/13198.

TypeExtensions live in corlib since https://github.com/mono/mono/pull/9746.

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-06 16:20:51 +01:00
Zoltan Varga 2b761f9ea5 [linker] Only preserve the m_value fields of the primitive types. 2019-03-06 11:34:34 +01:00
Egor Bogatov e42bf95d14 NS2.1 Sync new changes, mobile profiles (#13198)
* Add RuntimeHelpers.GetSubArray. Add missing types to NS's TypeForwarders.cs

* more NS2.1 changes

* ios changes

* Update Decimal (it's now readonly struct)

* fix mcs

* add ROMC.cs

* Fix tests, finish monodroid profile

* Make SRE-not-supported NS2.1 compatible

* Make monotouch_tv and watch NS2.1 compatible

* make some SRE types more NS21 compatible (non-abstract now)

* bump corefx

* More NS21 fixes

* bump coreclr acceptance tests

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-06 08:55:16 +01:00
Alexander Köplinger b31a445e85 [gitattributes] Do CRLF normalization on sln/proj files
They can be used with native line endings.

We now have a shared folder with the dotnet repos and they have CRLF normalization enabled.
This difference leads to conflicts while applying changes from the dotnet repos to mono.
2019-03-06 08:34:01 +01:00
justremotephone eb3f7312bd [System.ServiceModel] Fix a race condition in HttpRequestChannel. (#13304)
Concurrent request completions could cause following exception:

```
    FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException:
        Index was out of range. Must be non-negative and less than
        the size of the collection.
        Parameter name: index
       at System.Collections.Generic.List`1[T].RemoveAt (System.Int32 index) [0x00009] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Collections.Generic.List`1[T].Remove (T item) [0x0000c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.Cleanup () [0x00011] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.set_IsCompleted (System.Boolean value) [0x00034] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.Complete (System.Exception ex) [0x0001a] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+<>c__DisplayClass7_1.<BeginProcessRequest>b__0 (System.IAsyncResult r) [0x000bd] in <28c4695205ef47378f5370502b066592>:0

    This stack was captured after some changes in AwaitTaskContinuation.RunOrScheduleAction.
    Unfortunately the current implementation of AwaitTaskContinuation.RunOrScheduleAction re-throws the above
    exception with a wrong stack:

       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishContinuations () [0x00052] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageTwo () [0x000a1] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.Finish (System.Boolean bUserDelegateExecuted) [0x00003] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.TrySetException (System.Object exceptionObject) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException (System.Exception exception) [0x00029] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Net.HttpWebRequest+<RunWithTimeoutWorker>d__241`1[T].MoveNext () [0x000e0] in <3e9b3e26c4694baab3f689687ad40612>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00024] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishContinuations () [0x00052] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult result) [0x0004f] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetResult (TResult result) [0x0003d] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Net.ServicePointScheduler+<WaitAsync>d__45.MoveNext () [0x000f7] in <3e9b3e26c4694baab3f689687ad40612>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in <4a8a0
```

On an Android Xamarin installation this causes an app crash. Since no user code is active the exception cannot be caught.
2019-03-06 01:07:29 +01:00
Alexander Kyte 24c637dd26 Merge pull request #13262 from alexanderkyte/fixup_no_threads
[crash] Detect when 0 attached threads, fix hang/double-fault.
2019-03-05 17:38:16 -05:00
Maxim Lipnin 0e9495a034 Get fully qualified name of ModuleBuilder (#13308)
* Get fully qualified name of ModuleBuilder

* Use MethodBuilder.FileName to find main module
2019-03-05 16:20:47 -05:00
Kenneth Pouncey 9330096912 [wasm][ci]Update to latest JavaScript (engine) Version Updater (#13307)
- The purpose of this is to be able to respond to CI incidents faster for instance specific engine versions when JavaScript engines do not update/install correctly.
- This will install from a forked version of the jsvu repo: https://github.com/GoogleChromeLabs/jsvu
- Forked version rests here:  https://github.com/kjpou1/jsvu/tree/mono-wasm
   - The forked version removes the Node >= 10.0 dependency but brings in the newest 1.4.0 version modifications.
- This should be temporary until we get another solution i.e. a managed version of the engine updater.
2019-03-05 17:08:45 +01:00
Alexander Köplinger d99af881c3 [corlib] Disable ThreadPoolTest.GetAvailableThreads () on machines with many cores
It doesn't work well on the new 64 core ARM machines we have in CI.
2019-03-05 14:33:26 +01:00
Zoltan Varga af87454146 [jit] Avoid an assert when gsharedvt enums are boxed. (#13301)
Fixes https://github.com/mono/mono/issues/13297.
2019-03-05 01:21:02 -05:00
Alexander Köplinger c2a1eb5de6 [corlib] Improve ThreadPoolTest.GetAvailableThreads ()
Don't print console output in the loop and bump timeout.
2019-03-05 01:44:07 +01:00
Zoltan Varga 819660ef97 [netcore] Ongoing work.
* Implement all CustomAttributeExtensions methods.
* Add stubs for __ComObject which is needed by the runtime.
2019-03-04 19:33:46 +01:00
monojenkins 24d55fb184 [master] Fix mono conc hashtable lookup endless loop (#13292)
Fix mono conc hashtable lookup endless loop
2019-03-04 13:11:55 -05:00
monojenkins ef30f5589b [bcl] Update BCL Linked Size 2019-03-04 18:40:41 +01:00
Aaron Hill 290b537a73 Ensure that the module cctor is run before the entry point is executed (#13242)
* Ensure that the module cctor is run before the entry point is executed

We need to ensure that any module cctor for the 'main' image
is run *before* we invoke the entry point

This is required in order for tools like Costura
(https://github.com/Fody/Costura) to work properly. These tools inject
a module initializer which sets up event handlers (e.g. AssemblyResolve),
which allows the main method to run properly

For more information about module constructors,
see https://blogs.msdn.microsoft.com/junfeng/2005/11/19/module-initializer-a-k-a-module-constructor/

* Fix module-cctor-entrypoint.il
2019-03-04 12:31:17 -05:00
Alexander Köplinger e8fbaa5531 [linker] Fix monotouch tests which need Xamarin.iOS.dll (#13287)
The linker couldn't resolve Xamarin.iOS.dll which System.Net.Http references now.
2019-03-04 17:46:56 +01:00
Egor Bogatov af6d863e52 [corlib] Fix Directory.GetLogicalDrives () (#13125)
Fixes #13030
2019-03-04 16:43:46 +01:00
sancheolz 89f264ad86 [SWF] Method OnClosed should pass FormClosedEventArgs type, instead of EventArgs.Empty (#13283)
Fixes #13282
2019-03-04 15:31:59 +01:00
Bernhard Urban 1da9c0f9e7 [interp] mixed mode fixes for delegates (#13215)
* [interp] avoid multiple transformations

* [interp] remove delegate hack for method_ptr=imethod case

it isn't needed anymore

* [interp] ensure initialized fields of a class retrieved from wrapper data

* [fullaot mixed] add test for specific mixed mode scenario

* [interp] remove assertion, it does not take into account multiple threads transforming the same method

* [interp] avoid non-lazy compilation of delegate if interpreter is involved

* [fullaot-mixed] disable on i386

* [interp] propagate errors on delegate init

* fix c++ build

* [tests] improve return codes

* error only for dynamic methods

* [fullaot-mixed] disable test on coop
2019-03-04 15:06:35 +01:00
sancheolz bac5347996 [System.Runtime.Remoting] Implement CustomErrorsMode for RemotingConfiguration (#13251)
Implemented property RemotingConfiguration.CustomErrorsMode.

Fixes #13250
2019-03-04 15:01:40 +01:00
Marek Safar a08eff03f7 [System.Private.CoreLib] Implement more APIs 2019-03-04 12:58:03 +01:00
Zoltan Varga 85c8e85476 [netcore] Ongoing work. (#13278)
* Implement CustomAttributeExtensions methods.
* Add a AssemblyFileVersion attribute.
* Don't try AppDomain.TypeResolve.
2019-03-04 11:59:37 +01:00
Zoltan Varga f82ae71c90 [netcore] Fix threading. 2019-03-03 13:42:10 +01:00
Zoltan Varga 6b6b1ce35e [jit] Fix the RuntimeHelpers.ObjectHasComponentSize () intrinsics. (#13271) 2019-03-03 06:58:11 -05:00
Jan Kotas 9bdb423e5d Fix CoreCLR build break
Signed-off-by: dotnet-bot <[email protected]>
2019-03-03 12:12:26 +01:00
Jan Kotas 6578e93670 Update CoreRT for changes in shared partition
Signed-off-by: dotnet-bot <[email protected]>
2019-03-03 12:10:25 +01:00
Marek Safar 519139773f Fix the build 2019-03-03 12:01:00 +01:00
Marek Safar 243d669a2e Move Activator to shared partition (dotnet/coreclr#22894)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-03 12:01:00 +01:00
Grant d8e9e8fa6d Use BitOperations in more callsites (CoreCLR) (dotnet/coreclr#22630)
* Missed perf improvement in EventProvider

* Add missing methods to StubEnvironment

Signed-off-by: dotnet-bot <[email protected]>
2019-03-02 23:07:39 +01:00
Jan Kotas 84d6476152 Fix CoreFX build break
Signed-off-by: dotnet-bot <[email protected]>
2019-03-02 21:10:37 +01:00
Jan Kotas a31af4add7 Fix netfx build break
Signed-off-by: dotnet-bot <[email protected]>
2019-03-02 21:10:37 +01:00
Alexander Köplinger 64556b9bb9 [ci] Shorten timeout in SDKs tests
The tests normally complete in a few mins.
2019-03-02 12:46:27 +01:00
Calvin Buckley 2ecf08d265 More PPC/AIX regression fixes (#13264)
* Fix System.Math regressions brought on by PowerPC JIT optimizations

	* While frin[.] does do rounding, the semantics are slightly
	  different enough from the BCL that it subtly breaks, as
	  seen by some tests. Ceil/Floor/Trunc are fine, however.
	  Perhaps the sysmath.c version can be translated to asma.

	* Fix typo where signed long comparison for isel was using
	  an unsigned comparison.
	  Add a test for this in the JIT regression check.

* Link against (not fd.o) libbsd for System.Native on AIX

The way we link the library by default will allow some unresolved
symbols. These will get resolved to the runtime when loaded by it.
However, flock isn't in AIX libc, and the native library needs it.
This doesn't seem to be a problem on AIX, but on i libbsd doesn't
seem to be in the dependency chain, so it errors out when you use
it. The workaround is to link libbsd (not the freedesktop.org one)
into the library. According to dump, it seems it has its own copy
of ioctl and fnctl, but they seem benign according to objdump and
don't seem to affect System and corlib tests I've ran to check it.
2019-03-02 12:43:12 +01:00
Marek Safar 30d70e98e6 Fix the build 2019-03-02 11:05:00 +01:00
Morgan Brown 580f5ef53a Implement Serialization Guard
Add Serialization Guard API and consume it in CoreLib targets

Signed-off-by: dotnet-bot <[email protected]>
2019-03-02 11:05:00 +01:00
Maxim Lipnin ed0d055424 Throw InvalidOperationException if inner handler is not assigned 2019-03-02 02:31:54 +01:00
Alexander Kyte db5d8729b4 [crash] Detect when 0 attached threads, fix hang/double-fault. 2019-03-01 16:11:11 -05:00
Zoltan Varga 4970e055b3 [netcore] Implements threads. (#13245)
* [netcore] Implements threads.

There is only one thread object, since there are no domains.

* Make the start callback internal.
2019-03-01 15:15:31 -05:00
Ludovic Henry 234daf1cf3 [android] Fix Mono.Debugger.Soft tests with Android SDKs (#13218)
* [android] Fix Mono.Debugger.Soft tests with Android SDKs

* [android] Fix connecting with LLDB

* [android] Add scaffolding to run profiler tests

* [android] Fix some corlib tests

* [android] Fix Mono.DebuggerTests.ExceptionFilter2

* [csproj] Update project files
2019-03-01 21:03:26 +01:00
Rolf Bjarne Kvinge c99fe4b462 [mini] Inline Selector.GetHandle for tvOS and watchOS assemblies as well. (#13246) 2019-03-01 11:10:04 -05:00
monojenkins 83d5cf0c5c [android] Fix inaccurate detection of sendfile() (#13243)
[android] Fix inaccurate detection of sendfile()
2019-03-01 10:28:34 -05:00
Alexander Kyte 23c83a48cd [runtime] Optimize array_set_value_impl slow path (#13186)
* [runtime] Add unmanaged fast-path for mono_class_is_assignable_from

Our managed code has a fast path for this that checks if the two types
are the same. The unmanaged calls here always falls back on the slow path.

This leads to a latency that is pretty observable during
array_set_value_impl calls.

* [runtime] Make faster already-pinned nullable init path

* [runtime] Expose non-handle-allocating object_handle_isinst_mbyref

* [runtime] Use MONO_ENTER_NO_SAFEPOINTS for array_set_value_impl
2019-03-01 10:21:02 -05:00
Vlad Brezae e4b281825a [interp] Add fast paths for common cast checks (#13225)
* [interp] Remove some duplicated code

* [interp] Optimize type checking for interfaces

Mainly to avoiding handles for common scenarios. Makes type checking for common interfaces 10x faster.

* [interp] Optimize type checking for common classes

Mainly to avoiding handles for common scenarios. Makes type checking for common classes 10x faster.
2019-03-01 10:19:12 -05:00
Alexander Köplinger 98e0f2697d [sdks] Use throttle() instead of lock()
The former works in freestyle builds.
2019-03-01 14:45:16 +01:00
Alexander Köplinger f5b9af2505 Revert "[sdks] Make sure to run only one build per type per node"
This reverts commit b740313aa5.

We actually want to only run one build per product on a node,
e.g. so that android-debug and android-release can't run on
the same node and stomp on each other's toolchain.
2019-03-01 13:57:06 +01:00
Alexander Köplinger 793c3aa3aa [ci] Add node name to log of Jenkins pipeline builds
Makes it easier to figure out where a build ran.
2019-03-01 13:31:01 +01:00
Alexander Köplinger 5bf74a9954 [System.Net.Http] Move NSUrlSessionHandler from xamarin-macios to mono (#13229)
* [System.Net.Http] Move NSUrlSessionHandler from xamarin-macios to mono

This allows us to remove the need for a special custom System.Net.Http.dll
build in the xamarin-macios repository.

Part of #11397

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-01 12:20:27 +01:00
Katelyn Gadd 6c58376102 If a ClientIdentity has no ClientProxy then return null from the accessor instead of throwing. Experimental partial fix for issue #13113 2019-03-01 11:59:50 +01:00
Levi Broderick fcbc8c3792 Add Rune.DecodeUtf16 / DecodeUtf8 and friends (dotnet/coreclr#22725)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-01 09:57:09 +01:00
Aaron Robinson 3508069707 Move COM related attributes to the shared source location of Object class. (#22942)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-01 09:57:09 +01:00
Tanner Gooding 5b02347ae8 Removing the ExtractVector128 and InsertVector128 APIs that take an address. (#22886)
* Removing the InsertVector128 and ExtractVector128 overloads that take an address from S.P.Corelib

* Removing the ExtractStore and InsertLoad tests.

* Fixing the PacketTracer test to use the appropriate Extract/InsertVector128 overloads

* Removing the JIT support for the Extract/InsertVector128 overloads that take an address.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-01 09:54:21 +01:00
monojenkins 041e874182 [bcl] Update BCL Linked Size 2019-03-01 09:32:07 +01:00
Alexis Christoforides adc62b328e [monodroid] Use CoreFX to implement System.Drawing types that used to be in Mono.Android.dll (#13135)
* [monodroid] Use CoreFX to fill in reference stubs for System.Drawing types that are currently 'forked' from Mono into Mono.Android.dll

The list of localy implemented System.Drawing types: https://github.com/xamarin/xamarin-android/blob/e0da1f152de84c4cc39983f2fda775ec98c08250/src/Mono.Android/Mono.Android.csproj#L311-L325

* [netstandard] Update for Mono.Android change

* Bump reference assemblies to include Mono.Android update

* Use System.Drawing.Common to find moved types in monodroid case for netstandard facade

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-01 01:50:44 +01:00
Alexander Köplinger 4ea57007fa [Mono.Debugger.Soft] Disable Attach() test that fails or hangs (#13239)
It was recently reenabled in #9091 but it fails/hangs frequently.
2019-03-01 01:43:19 +01:00
Aaron Robinson b5d6e5344f Set the MarshalByRefObject to be ComVisible and (dotnet/coreclr#22930)
a IDispatch class interface. this is being done
  to ensure WinForms consumers can interact with
  COM based controls.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-01 00:28:08 +01:00
Stephen Toub b0935ae258 Fix DumpAsync to understand ContinuationWrapper (dotnet/coreclr#22913)
Continuations created while the debugger is attached or certain EventSource events are enabled end up getting wrapped in an extra ContinuationWrapper object that carries some additional information.  DumpAsync currently isn't unwrapping these but should.  This just teaches it to look for a known field name so that it can "see through" these wrappers while following async "stacks".

Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 23:30:53 +01:00
Marek Safar a88ad66551 Build fixes 2019-02-28 23:05:24 +01:00
Jan Kotas 51a4aae4ff Fix CoreRT build break
Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 23:05:24 +01:00
Stephen Toub ee67c17eb3 Address PR feedback (clean up style in Thread.CoreCLR.cs)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 23:05:24 +01:00
Stephen Toub 54d2a05d66 Fix Thread-related breaking changes
- Thread.ExecutionContext needs to return ExecutionContext.Capture() to public callers.
- Fix restoring of culture to be inside of the ExecutionContext callback where applicable

Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 23:05:24 +01:00
Marek Safar 4c4421f30d Fix the build 2019-02-28 22:41:40 +01:00
Filip Navara d14b15f502 Move Thread to shared CoreLib (dotnet/coreclr#22744)
* Move Thread to shared CoreLib

* Remove all local variables from Thread in shared code

* Remove duplicate checks

* Port back CoreRT changes needed for shared code

* Fix missing culture initialization in ThreadStart()

* Adjust for shared WaitHandle

Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 22:41:40 +01:00
Johan Lorensson 80e5e7ff62 Cancel sync IO on Windows when aborting thread. (#13173)
* Cancel sync IO on Windows when aborting thread.

Using CancelIO/CancelIOEx or CancelSynchronousIo on a thread that is moving
into a suspended state can cause these calls to hang (they shouldn’t but
have been observed to be the case). Fix does the cancel of sync IO after
the aborted thread has been resumed, but before releasing suspend locks
making sure thread won't be suspend again until after cancel IO call has
completed.

* Add tests aborting blocking socket and file IO on Windows.
2019-02-28 16:02:21 -05:00
Alexander Köplinger e3caf01677 [sdks] Use abspath instead of PWD on iOS app build (#13230)
PWD is the wrong directory when e.g. you're doing "make -C sdks/ios" from the repo root.

Fixes https://github.com/mono/mono/issues/13224
2019-02-28 21:47:21 +01:00
Mikhail Filippov f512a68edc [Mono.Debugger.Soft] Add new debugger tests and fix the Attach() test (#9091)
* Fixed the Attach() test which required a free port to attach.

* Added test for incorrect events behavior when VM is started with suspend

* Bump API snapshot submodule
2019-02-28 19:29:30 +01:00
Calvin Buckley a4eee02195 PPC JIT optimizations (System.Math instruction inlining) (#11964)
* [ppc] Optimize floating point performance in the JIT sqrt/sqrtf/abs

* [ppc] Integer Min/Max inlining wiht POWER5 isel instruction

Compresses a function call down to two instruction, for both signed
and unsigned, long and int. Needs to check for POWE5 though, and I
don't know the effects of this on ppc32. FP version using fsel is
also desirable, but not in the scope of this commit.

* [ppc] Check for POWER5 compatible CPU before using isel

* [ppc] Don't use long min/max inlining for ppc32

Other 64-bit operations are marked for ppc64 only.

* [ppc] also ifdef that out for ppc32 too

* [ppc] Rounding function optimizations
2019-02-28 09:31:12 -05:00
Johan Lorensson 3487962a82 Merge pull request #13210 from lateralusX/lateralusX/adjust-test-console-output
Update output from console-output test.
2019-02-28 06:40:33 -05:00
Johan Lorensson dd9ee189c6 Merge pull request #13212 from lateralusX/lateralusX/add-waitforkeypress-test-project
Add atexit-waitforkeypress handler in Visual Studio mono.sln test projects run args.
2019-02-28 05:06:38 -05:00
monojenkins ace38db535 [bcl] Update BCL Linked Size 2019-02-28 08:24:51 +01:00
Martin Baulig 3f43547cd6 [corlib]: Use Guid.NewGuid() implementation from CoreFx. (#13189)
* [corlib]: Use `Guid.NewGuid()` implementation from CoreFx.

The corefx implementation of `Guid.NewGuid()` uses the internal
`Interop.GetRandomBytes(byte*, int)`, which uses `RNGCryptoServiceProvider`
directly without using `CryptoConfig`.

* [csproj] Update project files

* Rename Guid.MonoTouch.cs -> CommonCrypto/Guid.cs.
2019-02-28 00:37:25 -05:00
Ludovic Henry 53b7b79f53 Initial support for Fuchsia (#13200)
* Initial support for Fuchsia

Compile like this:

if you have Zircon installed, with the prebuilts on "../zircon", use this to compile:

CC="`pwd`/../zircon/prebuilt/downloads/clang/bin/clang-9 -nostdlib -O2 -g -fdebug-prefix-map=/cvs/fuchsia/zircon=. -finline -fno-common -ffunction-sections -fdata-sections -no-canonical-prefixes -march=x86-64 -mcx16 --target=x86_64-fuchsia -fPIC -D_ALL_SOURCE=1 -DENABLE_DRIVER_TRACING=1 -fasynchronous-unwind-tables -fno-omit-frame-pointer  -std=c11 -I`pwd`/../zircon/build-x64-clang/sysroot/include/ -I`pwd`/../zircon/system/public" LDFLAGS="-L`pwd`/../zircon/build-x64-clang/sysroot/lib/ -L`pwd`/../zircon/build-x64-clang/sysroot/debug" ./configure --host=x86_64-google-fuchsia

* Use HOST_FUCHSIA rather than TARGET_FUCHSIA
2019-02-27 21:33:15 -05:00
Bernhard Urban 69cb9ad922 [interp] fix conflict of #13154 and #13177 (#13208)
See https://github.com/mono/mono/pull/13177#discussion_r259872514
2019-02-27 21:32:37 -05:00
Bernhard Urban 2030ebdc5e [interp] compute size of generic valuetype correctly (#13216)
[interp] compute size of generic valuetype correctly

Otherwise we smash the stack.


Contributes to https://github.com/xamarin/xamarin-macios/issues/5622
2019-02-27 18:25:40 -05:00
Calvin Buckley a3be248d3f [corlib] Simplify RuntimeInformation by getting OS name from the runtime (#13164)
We can get the the OS name similar to the architecture from the value that is used by the runtime for DllMaps.

Cached the values into static fields so we only need to do the runtime icall once.

Added all the existing OS names recognized by DllMap to RuntimeInformation.
This also allows us to mark some corlib/System tests that hang the runtime on AIX as non-working.
2019-02-27 23:21:34 +01:00
Miguel de Icaza fe92cea485 Use HOST_FUCHSIA rather than TARGET_FUCHSIA 2019-02-27 16:54:50 -05:00
Bernhard Urban a3dd8b3246 [lldb] fix helper for interpreter stacktraces (#13211)
Broke due to b6775765ed
2019-02-27 21:55:14 +01:00
Marek Safar 6f8ec5fdce Fixes build 2019-02-27 21:24:21 +01:00
Grant 448fd6ac62 Make BitOperations public (CoreCLR) (dotnet/coreclr#22864)
* Make BitOps public

* Update name to BitOperations

* Change namespace to System.Numerics

* Fix file name

* Alphabetical

Signed-off-by: dotnet-bot <[email protected]>
2019-02-27 21:24:21 +01:00
Maxim Lipnin 1ab0ffc964 [corlib] Update DriveInfo tests to use the newer RuntimeInformation APIs (#13205) 2019-02-27 19:23:19 +01:00
lateralusX 695743e3ab Add atexit-waitforkeypress handler in Visual Studio mono.sln test projects run args. 2019-02-27 17:45:57 +01:00
lateralusX ac906dd937 Update output from console-output test.
Current output from console-output test is just Error and Out (indicating)
the different console output streams. When seen in log files the error output
string can be misleading. Fix makes it clearer that the output is originating
from a test and not an “error”.
2019-02-27 17:19:30 +01:00
Zoltan Varga 8ca41f08a0 [jit] Fix the class of the stack entry for ldelema, it should be the class not its element class. (#13134)
Fixes https://github.com/mono/mono/issues/10101.
2019-02-27 16:31:54 +01:00
Martin Baulig 55a34261c9 [Mono.Security]: minor CryptoConvert changes to make it more linker-friendly. (#13204)
* Add new internal `CryptoConvert.TryImportCapiPrivateKeyBlob()` method that's using `RSAManaged` directly to make it more linker-friendly.

* Also add new internal `CryptoConvert.TryImportCapiPublicKeyBlob()`.

* Use it in `AssemblyName.IsPublicKeyValid`.
2019-02-27 12:56:06 +01:00
Zoltan Varga ce2259d009 [runtime] Default Interface method fixes. (#13154)
* [runtime] Inflate overridden methods properly during vtable construction when using default interface methods.

* [jit] Handle default interface methods in constrained calls, they need to box if the constrained type is a valuetype which doesn't override the default method.

* [runtime] Update Default Interface Methods tests from coreclr.

* [jit] Fix interp support.
2019-02-26 22:00:46 -05:00
Ankit Jain f7d053a0d6 nuget-hash-extractor: Improvements to reduce unnecessary diffs on update (#13197)
* [nuget-hash-extractor] Make the order for denied lists deterministic and

.. stable. We were not sorting the list of assemblies with the same
version, causing irrelevant changes in updates.

* Update denied assembly list to fix order

.. to be deterministic. Generated with the updated
nuget-hash-extractor.cs .

* [nuget-hash-extractor] Make the order of assemblies deterministic

The .nupkgs were being processed in arbitrary order, causing unncessary
diffs when updating them which required manual work to check and fix
them.
2019-02-27 00:41:11 +01:00
Martin Baulig 6a3b12b622 Revert "[Mono.Security]: minor CryptoConvert changes to make it more linker-friendly." (#13202)
This reverts commit ef7e64a5be.
2019-02-27 00:17:37 +01:00
Stephen Toub 48f65d5108 Special-case 1 module per assembly in Assembly.GetTypes/DefinedTypes (#22825)
It's very common for an assembly to have only one module, in which case we can avoid unnecessary allocations and copies in Assembly.GetTypes() and Assembly.DefinedTypes.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-27 00:03:26 +01:00
Dotnet-GitSync-Bot 2b4bff1956 Mirror changes from mono/coreclr (#13192)
This PR contains mirrored changes from mono/coreclr


**Please REBASE this PR when merging**

 cc @grant-d
2019-02-26 23:59:38 +01:00
Ludovic Henry a685cf26a4 [ci] Add new mode of execution for nunit tests on Android (#13098)
* [ci] Add new mode of execution for nunit tests on Android

This makes it possible to run the `nunit-lite-console.exe` on the host, while the tests still run on the device. This makes it transparent wherever the tests are running, giving us a seamless integration with the existing infrastructure based around nunit.

* [android] Fix System.Net.Http test suite

* [android] Fix System.ServiceModel.Web test suite

* [android] Fix Mono.Security test suite

* fixup! [ci] Add new mode of execution for nunit tests on Android

* [ci] Disable failing tests

* [csproj] Update project files
2019-02-26 22:08:01 +01:00
Miguel de Icaza a55e8496be Initial support for Fuchsia
Compile like this:

if you have Zircon installed, with the prebuilts on "../zircon", use this to compile:

CC="`pwd`/../zircon/prebuilt/downloads/clang/bin/clang-9 -nostdlib -O2 -g -fdebug-prefix-map=/cvs/fuchsia/zircon=. -finline -fno-common -ffunction-sections -fdata-sections -no-canonical-prefixes -march=x86-64 -mcx16 --target=x86_64-fuchsia -fPIC -D_ALL_SOURCE=1 -DENABLE_DRIVER_TRACING=1 -fasynchronous-unwind-tables -fno-omit-frame-pointer  -std=c11 -I`pwd`/../zircon/build-x64-clang/sysroot/include/ -I`pwd`/../zircon/system/public" LDFLAGS="-L`pwd`/../zircon/build-x64-clang/sysroot/lib/ -L`pwd`/../zircon/build-x64-clang/sysroot/debug" ./configure --host=x86_64-google-fuchsia
2019-02-26 15:55:41 -05:00
Zoltan Varga 5f5ef1efe5 [wasm] Disable chakra tests until its fixed. (#13199) 2019-02-26 21:41:46 +01:00
Vlad Brezae 88c560ad72 [interp] Avoid clearing the stack with each call (#13177)
* [interp] Move special case initialisation of frame->ip

* [interp] Properly init locals

When we have locals that need to be initialized.

* [interp] Load the entire enum value

When calling calling method on constrained type for enums with long storage.

* [interp] Avoid clearing the stack with each call

Reducing overhead for each call, this can give an overall performance improvement of 5%.
2019-02-26 12:01:29 -05:00
Alexander Kyte a0c6a15465 [runtime] Use FastCopy on multidimensional arrays (#13181) 2019-02-26 10:09:46 -05:00
Maxim Lipnin fc240aaa1c Consider unknown GB18030 characters as invalid to enforce use of replacement character instead of throwing SystemException. (#13188)
* Consider unknown GB18030 characters as invalid to enforce use of replacement character instead of throwing SystemException.

* Return negative result for unknown character instead of throwing SystemException in GB18030Source.FromUCS
2019-02-26 12:51:51 +01:00
Zoltan Varga 5225828263 [corlib] Add a RuntimeTypeHandle::GetCorElementType () icall, use it to remove a few other small icalls. 2019-02-26 12:51:14 +01:00
Alexander Köplinger 97f0a0f94c [ci] Use dl.internalx.com when building on private Jenkins
(cherry picked from commit 9d4aa950aa)
2019-02-26 11:25:45 +01:00
Martin Baulig ef7e64a5be [Mono.Security]: minor CryptoConvert changes to make it more linker-friendly.
* Add new internal `CryptoConvert.TryImportCapiPrivateKeyBlob()`
  method that's using `RSAManaged` directly to make it more
  linker-friendly.

* Use it in `AssemblyName.IsPublicKeyValid`.
2019-02-26 10:18:54 +01:00
Kenneth Pouncey 07287648b2 [wasm] Add browser test suite. (#13145)
* [wasm] Add browser test suite.

- Runs a series of tests against the HttpClientHandler and blob tests.

* Setup custom browser launcher to pass `--no-sandbox` to work on CI

* Remove auto client config that caused async errors on tests.
2019-02-26 10:07:21 +01:00
Marek Safar 7c975c18d8 AssemblyLoadContext from shared 2019-02-25 23:39:31 +01:00
Marek Safar 5ae98353a6 Move AssemblyLoadContext to shared partition (dotnet/coreclr#22685)
* Move AssemblyLoadContext to shared partition

* Move static initializer to DefaultAssemblyLoadContext

and remove stream copying from lock scope

Signed-off-by: dotnet-bot <[email protected]>
2019-02-25 23:39:31 +01:00
Martin Baulig 7f3a127b6d Remove unused (and broken) mono_btls_ssl_ctx_get_servername(). (#13184) 2019-02-25 20:15:17 +01:00
Bernhard Urban fc171a192a [aot] abort lookup early when a method isn't available in AOT image (#13138)
[aot] abort lookup early when a method isn't available in AOT image

Mixed mode depends on that.  Usually, compile_method of mini takes care
to request only existing methods from the AOT image, but in some cases,
e.g. from a trampoline, AOT runtime is quiered directly.

Contributes to https://github.com/xamarin/xamarin-macios/issues/5618
2019-02-25 10:56:15 -05:00
Jay Krell 2f3f58c7f1 [mkbundle] Fix mapping length (#13061)
* https://github.com/mono/mono/issues/11643 mkbundle problem - Illegal byte sequence

The size of the mapping is the maximum file offset to map.
See https://docs.microsoft.com/en-us/windows/desktop/Memory/creating-a-file-mapping-object.

When I tried it, I got a different error.

If in the debugger you simulate this fix, it gets further.

Here is a small program to exercise and see the behavior:

```
// include <windows.h>
// include <stdio.h>
// include <stdlib.h>
//
// int main()
// {
//  // Create a 128K file.
//
//  HANDLE file = CreateFile("1", GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
//  printf("createfile %p %d\n", file, GetLastError());
//
//  HANDLE map = CreateFileMapping(file, 0, PAGE_READWRITE, 0, 1 << 17, 0);
//  printf("createmap %p %d\n", map, GetLastError());
//
//  CloseHandle(map);
//  CloseHandle(file);
//  system("dir");
//
//  // Attempt to map the second 64K of the 128K file, with a 64K mapping.
//
//  file = CreateFile("1", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
//  printf("createfile %p %d\n", file, GetLastError());
//
//  map = CreateFileMapping(file, 0, PAGE_READWRITE, 0, 1 << 16, 0);
//  printf("createmap %p %d\n", map, GetLastError());
//
//   // This fails.
//
//  PVOID view = MapViewOfFile(map, FILE_MAP_WRITE, 0, 1 << 16, 1 << 16);
//  printf("view %p %d\n", view, GetLastError());
//
//  CloseHandle(map);
//
//  // Use a 128K mapping instead. It works.
//
//  map = CreateFileMapping(file, 0, PAGE_READWRITE, 0, 1 << 17, 0);
//  printf("createmap %p %d\n", map, GetLastError());
//
//  view = MapViewOfFile(map, FILE_MAP_WRITE, 0, 1 << 16, 1 << 16);
//  printf("view %p %d\n", view, GetLastError());
// }
```

Here is debugging mono and simulating the fix in the debugger (I did not build or test
the fix):

```

\bin\amd64\cdb C:\Users\jaykrell\Downloads\output\output.exe

0:000> bm kernel*!*createfilemap*
0:000> g

Breakpoint 2 hit
KERNELBASE!CreateFileMappingW:
00007ffd`0a449de0 4883ec48        sub     rsp,48h
0:000> dv
                  hFile = 0x00000000`00000200
lpFileMappingAttributes = 0x00000000`00000000
              flProtect = 2
      dwMaximumSizeHigh = 0
       dwMaximumSizeLow = 0x477000
                 lpName = 0x00000000`00000000 ""

0:000> bm kern*!*mapviewoffile*
0:000> g
Breakpoint 38 hit
KERNEL32!MapViewOfFileStub:
00007ffd`0b09bfa0 48ff2591c10500  jmp     qword ptr [KERNEL32!_imp_MapViewOfFile (00007ffd`0b0f8138)] ds:00007ffd`0b0f8138={KERNELBASE!MapViewOfFile (00007ffd`0a465ad0)}
0:000> dv
  hFileMappingObject = 0x00000000`00000204
     dwDesiredAccess = 4
    dwFileOffsetHigh = 0
     dwFileOffsetLow = 0x30000
dwNumberOfBytesToMap = 0x477000
0:000> gu
0:000> r rax
rax=0000000000000000
0:000> !gle
LastErrorValue: (Win32) 0x5 (5) - Access is denied.
LastStatusValue: (NTSTATUS) 0xc000001f - {Invalid Mapping}  An attempt was made to create a view for a section which is bigger than the section.

0:000> .restart
0:000> bm kernel*!*createfilemap*
0:000> g
0:000> dv
                  hFile = 0x00000000`00000220
lpFileMappingAttributes = 0x00000000`00000000
              flProtect = 2
      dwMaximumSizeHigh = 0
       dwMaximumSizeLow = 0x477000
                 lpName = 0x00000000`00000000 ""
0:000> ?? dwMaximumSizeLow += 0x30000
unsigned long 0x4a7000
0:000> bc *
0:000> g
Corlib not in sync with this runtime: The runtime did not find the mscorlib.dll it expected. Expected interface version CA4932AE-2294-4ECD-B863-BF98FDD84F33 but found 0CC970F6-6F25-4218-9427-3E4C3DC8DE33. Check that your runtime and class libraries are matching.
Loaded from: mscorlib.dll
Download a newer corlib or a newer runtime at http://www.mono-project.com/download.

```

* Restore useful part of comment.

* Restore dead code.

* Add to comment the other possibility that is being countered.

* Additional explanation.
2019-02-25 09:48:04 -05:00
Johan Lorensson e6d259b82c Fix multiple issues with response file option on Windows. (#13132)
* Fix multiple issues with --response file option on Windows.

* If file is UTF8 encoded and include BOM mark, implementation failed to
detect and remove BOM mark causing errors. Fix check for BOM mark and if
found, remove it before passed to parsing. NOTE, current implementation
only supports UTF8 (and ASCII) content in response file and won't detect
or handle any other codepages.

* Since the content in --response file should mimic what should have been
passed on command line, we should apply same parsing rules on Windows as done
by the shell when running the arguments on the command line. Current
implementation uses its own parsing that is not the same as used by the Windows
shell, meaning that arguments can't be identical in response file compared to
what's passed on command line. This commit fix parsing of the command
line in the response file so its first parsed by the shell before added
to internal argc, argv parameters (similar as done when passed to main function).

* Add support to handle new lines in response file on Windows.
2019-02-25 09:42:44 -05:00
Radek Doulik 4a96c5e715 [aot] Resolve profile against compiled assembly (#13148)
[aot] Resolve profile against compiled assembly

When trying to use AOT profile in XA for assembly AOT compilation, the
methods from the profile were not compiled.

Context: https://github.com/xamarin/xamarin-android/issues/2504

The problem was, the profile data were not resolved, as there was no
assembly loaded in the domain.

With this fix, the compiled assembly is used to resolve the profile as
well.
2019-02-25 08:35:48 -05:00
Marek Safar ecef8d334a [System.Private.CoreLib] Implement more APIs 2019-02-25 13:51:30 +01:00
monojenkins 8a417e9cb6 Bump API snapshot submodule 2019-02-25 13:30:32 +01:00
Martin Baulig aee90aca7c Make System.dll internals visible to Mono.Android. 2019-02-25 13:30:32 +01:00
Zoltan Varga c94af71bf0 [corlib] Hardcode IsRunningOnWindows as false on WASM too. (#13161) 2019-02-25 03:18:28 -05:00
Kenneth Pouncey fdbebe278e Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-02-25 04:54:45 +01:00
Zoltan Varga 6644136745 [wasm] Update to emscripten 1.38.28. (#13160)
* [wasm] Update to emscripten 1.38.28.

The emscripten patch is no longer needed.

* [wasm] Disable optimizations in SHA1Transform (), the normal version seems to cause stack overflows in binaryen's asm2wasm tool.
2019-02-24 22:50:31 -05:00
Zoltan Varga f52f874aae [wasm] Small fixes. (#13166)
* [wasm] Disable an unused icall which has an invalid signature under wasm.

* [aot] Make the dedup pass less verbose.
2019-02-24 22:42:55 -05:00
Eric StJohn b936c53101 Make System.Runtime.CompilerServices.Unsafe inbox (dotnet/corefx#35526)
* Make System.Runtime.CompilerServices.Unsafe inbox

Fix a couple places where we wanted to use it from other inbox assemblies but couldn't.

Unsafe remains as a package and newer versions of Unsafe will replace the inbox Version,
permitting us to add API over time.

* Update Rune tests to use TryEncodeToUtf8Bytes directly

* Add temporary suppression to package tests

Signed-off-by: dotnet-bot <[email protected]>
2019-02-23 08:52:41 +01:00
Ankit Jain 6df26e8287 [nuget] Add new versions of System.Net.Http
.. to the list of denied assemblies. Added `4.3.4`.

Prompted by issue #12603 .
2019-02-23 08:51:03 +01:00
Ankit Jain ae240f1f8e [nuget] Add new versions of System.Text.Encoding.CodePages ..
.. to the list of denied assemblies. Added:

- `4.5.0`
- `4.5.1`

Fixes issue #12603 .
2019-02-23 08:51:03 +01:00
Jan Kotas 6df88479c8 Change Environment.Version to return product version (dotnet/coreclr#22664)
* Change Environment.Version to return product version

- Contributes to https://github.com/dotnet/corefx/issues/31099
- Use AssemblyInformationalVersion attribute as fallback

* Add sanity test for Environment.Version

* Disable CodeDom tests

* Fix test assembly name

Signed-off-by: dotnet-bot <[email protected]>
2019-02-23 08:49:36 +01:00
Stephen Toub b0d3ead369 Ignore EINVAL/EBADF errors from FTruncate in FileStream.Init (#22788)
They indicate we're working with a special file, where failure to truncate is not a fatal condition.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-22 22:24:37 +01:00
Vincent Dondain 0525583d1e [System] Bump SocketTest.TestSelect1 socket timeout to 1ms (#13152)
- Previous test with 100 micro second timeout would fail on iOS device when running **all the socket tests** about 3 times out of 5.
- With a 1 millisecond timeout, it didn't fail the 10 times I tried locally, hopefully this is enough to fix the flakiness.
- Fixes #8360: [System.Net.Sockets] flakey failures of SocketTest.TestSelect1 on Darwin systems
  (https://github.com/mono/mono/issues/8360)
- Also partial fix for maccore issue https://github.com/xamarin/maccore/issues/1069
2019-02-22 21:28:06 +01:00
Kenneth Pouncey 80f8aa27b1 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays
# Conflicts:
#	sdks/wasm/Makefile
2019-02-22 14:24:14 +01:00
Ankit Jain a4fada3900 [fsharp] Fix a type inference error introduced by recent changes (#13109)
```
@/external/bockbuild/builds/fsharp-fsharp-6624925/src/scripts/fssrgen.fsx(334,28): error FS0041: A unique overload for method 'GetFileNameWithoutExtension' could not be determined based on type information prior to this program point.
A type annotation may be needed. Candidates: System.IO.Path.GetFileNameWithoutExtension(path: System.ReadOnlySpan<char>) : System.ReadOnlySpan<char>, System.IO.Path.GetFileNameWithoutExtension(path: string) : string
[@/external/bockbuild/builds/fsharp-fsharp-6624925/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj]
```
2019-02-22 08:00:41 -05:00
Bernhard Urban 3be2390665 [aot] add wrappers to "slim" mscorlib (i.e. --aot=interp) (#13137)
* [aot] add gc wrappers in interp scenario

* [aot] add icall wrappers in interp scenario
2019-02-22 07:59:53 -05:00
Zoltan Varga 55c998d282 [aot] Only emit the static interp trampolines/wrappers into the mscorlib AOT image. (#13117) 2019-02-22 07:58:57 -05:00
Ludovic Henry 49b6628370 [aot] use unbox arbitrary trampolines for "slim" mscorlib (#13139)
We need the recently introduced "unbox arbitrary" trampolines in one more
scenario: non-mscorlib AOT code calls a method from mscorlib with
interpreter. Before we just relied on the amodule not being available,
but mscorlib amodule is always present due to wrappers, trampolines,
etc.
2019-02-22 07:57:16 -05:00
Vlad Brezae b6775765ed [interp] Cleanup code a little (#13092)
* [interp] Cleanup code a little

* [interp] Rename rtm to imethod
2019-02-22 07:55:37 -05:00
Thays Grazia 1e1e0b6b01 [wasm] [debugger] Add test suite. (#13093)
* [wasm] [debugger] Add test suite.

* [wasm] [debugger] Add test suite.

* [wasm] [debugger] Add test suite.

* Changing what Larry suggested and removing some -debug that is not used.

* Adding the DebuggingTestSuite.

* indentation

* Update run-jenkins.sh
2019-02-22 07:52:59 -05:00
Zoltan Varga 50ce9ed8e5 [netcore] Implement AppContext. 2019-02-22 10:19:37 +01:00
monojenkins 66e88b1e6b [bcl] Update BCL Linked Size 2019-02-22 10:03:28 +01:00
Bernhard Urban af46af33a1 [jit/cprop] insert dummy insn if first insn of basic block got replaced (#13127)
[jit/cprop] insert dummy insn if first insn of basic block got replaced

Fixes https://github.com/mono/mono/issues/13056 & https://github.com/mono/mono/issues/13057
2019-02-21 21:05:34 -05:00
Bernhard Urban 8891a4b778 [aot] use unbox arbitrary trampolines for "slim" mscorlib
We need the recently introduced "unbox arbitrary" trampolines in one more
scenario: non-mscorlib AOT code calls a method from mscorlib with
interpreter. Before we just relied on the amodule not being available,
but mscorlib amodule is always present due to wrappers, trampolines,
etc.
2019-02-21 23:28:41 +01:00
Zoltan Varga 2124448a37 [runtime] Move mono_get_context_capture_method () from security-manager.c to object.c. (#13071) 2019-02-21 16:26:05 -05:00
Maxim Lipnin 506406df06 Try to extract valid drive name from DriveInfo ctor string argument (#13105)
It's possible to pass any string as an argument to DriveInfo ctor (e.g.  `new DriveInfo(Path.GetTempPath())`). Mono throws ArgumentException if there is no exactly the same drive name in the list of available drives.

I tried to handle this case by extracting any valid drive name from the array of available drives sorted by path in descending order.

Fixes https://github.com/mono/mono/issues/12157
2019-02-21 21:57:55 +01:00
Marek Safar 020ce70e30 [System.Private.CoreLib] Implement more APIs 2019-02-21 21:34:18 +01:00
Martin Baulig 7277e3bb5e SslStream improvements and tests
* Add server-side Server-Name-Indication (SNI) support (both AppleTls and BTLS).

* Support the new `SslServerAuthenticationOptions.ServerCertificateSelectionCallback`.

* Server certificate selection is now compatible with CoreFx behavior; first
  checking the new `ServerCertSelectionDelegate` then `LocalCertSelectionCallback`
  and finally using an explicitly provided certificate.

* Misc exception checks and fixes to make behavior consistent with CoreFx;
  any exception thrown by reading / writing the underlying stream will now be
  propagated verbatim (and not wrapped in an `AuthenticationException`);
  exceptions thrown by the handshake / TLS stack itself will still be wrapped.

* Added `System.Net.Security` xUnit tests from CoreFx.

* Misc test cleanups; moved certificate test files from `System.Net.Http` into
  `System` and embed them in the test assembly as resources, adjusting
  `test-helpers/Configuration.Certificates.cs` accordingly.
2019-02-21 20:43:25 +01:00
Zoltan Varga aa04713723 [llvmonly] Do null checks on interp transitions for virtual->non virtual calls. (#13118)
Fixes https://github.com/mono/mono/issues/12998.
2019-02-21 12:24:14 -05:00
Alexander Köplinger b740313aa5 [sdks] Make sure to run only one build per type per node
They could conflict while provisioning android toolchains etc. otherwise.
2019-02-21 17:33:41 +01:00
Ankit Jain bda914c9b5 [bockbuild] Bump to master HEAD to get new fixes (#13108) 2019-02-21 17:19:27 +01:00
Zoltan Varga 576b1a0827 [llvm] Mark the branch in OP_GC_SAFE_POINT as taken. (#13114) 2019-02-21 10:08:04 -05:00
Kenneth Pouncey 7038d1915a Small cleanup 2019-02-21 14:05:08 +01:00
Kenneth Pouncey 49b92c95d0 Modify public interface CopyTo and CopyFrom to use lightweight Span<U>.
- Modifications in response to review comments.
2019-02-21 14:03:24 +01:00
Johan Lorensson 6f786bc465 Disable Mono.CSharp on Windows x64 full AOT test. (#13124)
Not part (and should not be) part of the winaot profile and therefore not testable (even though they pass when manually AOT:ing the assembly).
2019-02-21 13:29:34 +01:00
Vlad Brezae ff84ee290e [runtime] Remove dead code (#13089)
[runtime] Remove dead code

Interface method calls on constrained types are resolved in get_method_constrained now (apparently since https://github.com/mono/mono/commit/3259e04ace67552fc8d63a8f1ddbb830e526f05f)
2019-02-21 06:55:48 -05:00
Tanner Gooding af1034a99c Enable the HWIntrinsic extension methods and remove the instance implementations (#22705)
* Removing various S.R.I.Vector instance method APIs, since they should now be exposed as extension methods

* Updating the JIT to recognize the S.R.I.Vector extension methods.

* Updating various S.R.I.Vector test templates

* Regenerating the S.R.I tests that are created from a template.

* Fixing the numArgs for Base_Vector256_GetLower

* Fixing the handling for `Base_VectorXXX_As` to normalize the struct type.

* Adding the Base_Vector128_As intrinsics back for arm64

Signed-off-by: dotnet-bot <[email protected]>
2019-02-21 12:26:09 +01:00
Nikolay Sivov ffd601eed4 Fix some compiler warnings (#13044)
Fix some compiler warnings

Compiled with gcc 8.2.0/x86_64-linux-gnu.
2019-02-21 06:05:47 -05:00
Vlad Brezae 809e40435f [tests] Fix function signature (#13090)
[tests] Fix function signature

To match pinvoke signature from pinvoke-2 test.
2019-02-21 04:15:53 -05:00
Johan Lorensson 3622703cbe Enable all CI test suites for Windows x64 full AOT. (#13102) 2019-02-21 10:04:20 +01:00
Ben Adams bcdc345b44 Reduce struct copy by 1 in ValueTask.GetAwaiter (dotnet/coreclr#22738)
* Reduce struct copy by 1 in ValueTask.GetAwaiter

* Bit more explicit

Signed-off-by: dotnet-bot <[email protected]>
2019-02-21 10:02:14 +01:00
Filip Navara 5d36e4b2a7 Move Thread to shared CoreLib (dotnet/corefx#35462)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-21 10:00:54 +01:00
Zoltan Varga b4943dec39 [jit] Fix the loaded llvm build. (#13110) 2019-02-21 03:45:36 -05:00
Zoltan Varga d48b84d67f [llvm] Fix a 'incoming phi sreg1' llvm failure which happens with valuetypes+phi nodes. (#13077)
[llvm] Fix a 'incoming phi sreg1' llvm failure which happens with valuetypes+phi nodes.

Fixes https://github.com/mono/mono/issues/12988.
2019-02-21 03:35:54 -05:00
Aleksey Kliger (λgeek) 72512cfbcb [loader] Fix off by 1 (netstandard is a framework facade) (#13111)
[loader] Fix off by 1 (netstandard is a framework facade)

Before 5e0d39a8a1, there used to be a handwritten binary search that traveersed `framework_assemblies` to determine if a given assembly was a framework assembly or not.  The binary search used `last = G_N_ELEMENTS (framework_assemblies) - 1` as the initial condition, but it used an inclusive `first <= last` as the loop count.

After we switched to a hashtable, we used the same final value initialize `assembly_remapping_table`.

We didn't notice because `mscorlib` used to be the last assembly in the table and `mscorlib` already has a ton of special handling in the loader.  But `netstandard` is not special.  So we added it to the table, but it still doesn't get special handling.

This should fix instances where code references netstandard 2.0.0.0, but we give it netstandard 2.1.0.0

https://github.com/mono/mono/blob/f8094319132d2d40f37e8cac6058e783b5648260/mono/metadata/assembly.c#L345
2019-02-21 01:45:50 -05:00
Stephen Toub f809431913 Use ThrowHelper in ManualResetValueTaskSourceCore (dotnet/coreclr#22714)
Just move the helper being used to ThrowHelper.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 22:47:35 +01:00
Stephen Toub a5e27b6316 Fix bug introduced during cleanup in JapaneseLunisolarCalendar (#22717)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 20:24:29 +01:00
Ben Adams bce27a80de Allow Task.WaitAny completion to run synchronously (dotnet/coreclr#21245)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 20:24:29 +01:00
Johan Lorensson 795dc5ebd2 Remaining fixes needed to pass rest of CI test suites for windows x64 full AOT. (#13084)
* Fix for runtime mcs-compileall test on Windows x64 full AOT.

Test picked up full AOT:ed libraries as well as managed libraries failing
the test. Full AOT:ed shared libraries on Windows has .dll.dll prefix and
full AOT:ed executables on Windows has .exe.dll prefix.

Fix makes sure to filter out any files ending with dll.dll or exe.dll.

* Fix build errors in System.Web.Services test under winaot profile.

* Fix errors in System.Core test under winaot profile.

* Fix build error in linker tests on Windows under winaot profile.

Build fails since profile build mscorlib is used as well as default
triggering build error. Fix is to build linker tests using -nostdlib flag.
2019-02-20 14:17:10 -05:00
Johan Lorensson 3bcebfb0a0 Don't install jay as part of make install. (#13086)
Should not be part of the package and cause issues on Windows 32-bit
cygwin build since it's not using makefile generated by autotools. When
make install is run it will build jay one more time, but picking up
cygwin default gcc compiler instead of the one used in configure step, mingw.
That cause link errors since the object files are not rebuild, only relinked
with different linker, causing errors.
2019-02-20 14:01:03 -05:00
Alexander Köplinger 78ef5a9722 [ci] Prefer gmake over make for SDKs build (#13091)
Apple's make doesn't support the --output-sync option and Homebrew's make is installed as gmake.

Also fixed a few places in the repo where we directly invoked make instead of $(MAKE).
2019-02-20 19:46:54 +01:00
Marek Safar 951803d082 [System.Private.CoreLib] Implement more APIs 2019-02-20 17:55:17 +01:00
Stephen Toub 5ec1def012 Fix race condition in ManualResetValueTaskSourceCore (dotnet/coreclr#22711)
* Fix race condition in ManualResetValueTaskSourceCore

ManualResetValueTaskSourceCore.GetStatus is used from ValueTaskAwaiter.IsCompleted.  If GetStatus returns Success too early, then IsCompleted will also return true too early, which will result in GetResult being called too early.  This doesn't happen today when an MRVTSC is used sequentially.  But if an instance is pooled by the object its stored on getting put back into a pool as part of a call to the wrapper's GetResult, then we can end up in the following situation:
- Thread 1 starts an await on an instance containing an MRVTSC.  It calls IsCompleted.
- Thread 2 starts to complete that instance, getting as far as calling SignalCompletion and setting _completed to true but not yet setting _continuation.
- Thread 1 sees _completed == true and returns true from IsCompleted.  It calls GetResult, and the wrapper extracts the result from the instance, resets it, and puts it back into the pool.
- Thread 3 takes the object out of the pool and starts using it.
- Thread 2 continues SignalCompletion on that instance, and sets _continuation to the sentinel.
- Now Thread 3's instance's _continuation is the sentinel when it should be null.  If it calls SignalCompletion, it'll erroneously find that _continuation is not null and will queue _continuation/_continuationState for execution, resulting in the sentinel getting executed.  If it calls OnCompleted, it'll find that the _continuation is not null, and will queue the supplied continuation/state to execute immediately even though the operation may not yet actually be done.

The fix is simply to check not just _completed but also _continuation.  The operation is considered pending if either _completed is false, meaning SignalCompletion has not yet been called, or if _continuation is still null, meaning it's neither been set to the supplied delegate nor to the sentinel.  We can't just rely on _completed for the above outlined reasons, and we can't just rely on _continuation because it can be non-null if OnCompleted was called to hook up a callback (if we only cared about the await pattern, then we could just check _continuation and wouldn't need _completed, but we also need to support non-await access).

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 13:02:45 +01:00
Alexander Köplinger 3ac43f72bb Update sdks-archive.groovy android packages 2019-02-20 11:46:36 +01:00
Egor Bogatov 3c41d74f1e NS2.1: System.Security.Cryptography changes (#13022)
* NS21: X509Store, rsa.cs

* More NS2.1 changes

* remove X509Stubs.cs

* Add corert/CancellationTokenRegistration.cs

* Implement Socket.ReceiveAsync

* Add X509Certificates stubs

* bump corefx and corert

* bump corefx

* remove corefx/tmp

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-20 11:43:26 +01:00
monojenkins fceb9471e2 [bcl] Update BCL Linked Size 2019-02-20 09:16:55 +01:00
Jan Kotas ad4c22c4f4 Use out arguments in UmAlQuraCalendar (dotnet/coreclr#22704)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 09:13:30 +01:00
Kenneth Pouncey 16f1845a19 Fix spacing 2019-02-20 07:30:24 +01:00
Kenneth Pouncey 2e4713cb39 Fix spelling 2019-02-20 07:29:49 +01:00
Kenneth Pouncey d60440869c Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-02-20 06:40:15 +01:00
Ludovic Henry 7f017427ea Update CODEOWNERS 2019-02-19 19:41:45 -05:00
Radek Doulik 30799ff97f [profiler] Do not print that many new lines (#13060)
The `mono_profiler_printf` already adds `\n` char, so we don't need to
add them in most cases.

Before the fix the output of aot profiler with verbose enabled looked
like:

    02-19 10:50:02.877 22795 22815 I mono-prof: System.OutOfMemoryException:.ctor (string) 2
    02-19 10:50:02.877 22795 22815 I mono-prof:
    02-19 10:50:02.877 22795 22815 I mono-prof: System.SystemException:.ctor (string) 4
    02-19 10:50:02.877 22795 22815 I mono-prof:
    02-19 10:50:02.877 22795 22815 I mono-prof: System.Exception:.ctor (string) 6
    02-19 10:50:02.877 22795 22815 I mono-prof:
    02-19 10:50:02.877 22795 22815 I mono-prof: System.Exception:.cctor () 7
    02-19 10:50:02.877 22795 22815 I mono-prof:
    ...

The `usage ()`'s output should now look similar to other profilers
usage output.
2019-02-19 18:27:04 -05:00
Stephen Toub aff251e11c Move EventRegistrationToken to shared (dotnet/coreclr#22565)
* Move EventRegistrationToken to shared

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 00:18:55 +01:00
Stephen Toub e5f7fa3e67 Use RunContinuationsAsynchronously in SemaphoreSlim.WaitAsync (#22686)
SemaphoreSlim.Release shouldn't invoke arbitrary continuations as part of its invocation, so when it dequeues a task waiter and goes to complete it, rather than just calling TrySetResult, it queues the task to the thread pool to have TrySetResult invoked there.  Now that we have RunContinuationsAsynchronously, though, we can just use that functionality instead.  This has two main benefits:
1. We avoid queueing a work item entirely if there are no continuations from the task.  This might happen, for example, if the semaphore is released so quickly after waiting on it that the WaitAsync caller hasn't yet hooked up a continuation, in which case the await on the WaitAsync task will just see IsCompleted as true and continue running.
2. We avoid queueing a work item when the task represents a synchronous Wait, which happens if there's already a pending WaitAsync when Wait goes to block.  The main benefit here is avoiding potential thread pool starvation, if threads in the pool are blocked in such Waits, and previously another thread pool thread would have been needed to run the queued work item to complete the synchronous Wait.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-19 23:45:33 +01:00
Hugh Bellamy dc32ce591e Cleanup Calendars code (dotnet/coreclr#22582)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-19 23:45:33 +01:00
Martin Baulig 23762efca5 Add temporary workaround for internal StreamContent constructor. 2019-02-19 23:19:07 +01:00
Maxim Lipnin c890be00c9 use for loop to access item values and avoid InvalidCastException which occurs because VirtualDirectoryMappingCollection enumerator returns key and it's not expected 2019-02-19 21:08:02 +01:00
Fei Peng 1f33f3923a Optimize Vector128/256<T>.Get/WithElement (dotnet/coreclr#22353)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-19 17:08:46 +01:00
Johan Lorensson 187711df20 Enable runtime + corlib tests on CI for Windows x64 full AOT. (#13059) 2019-02-19 09:37:43 -05:00
Vlad Brezae c21c2df0af [interp] Kill stinarg opcodes (#13038)
* [interp] Extract some duplicated code

* [interp] Kill stinarg opcodes

Before we were reallocating the arguments in the current frame and had a stinarg opcode for copying each argument there. Access the arguments directly from the parent frame, to reduce call overhead. This can give up to 5-10% general speedup.
2019-02-19 08:40:00 -05:00
roozbehid af0bdab76d add missing typeforwardes in facades (#12694)
* add missing typeforwardes

* Bump API snapshot submodule
2019-02-19 13:38:17 +01:00
Zoltan Varga 9f9067094f [netcore] Fix GCHandles, the lowest bit is used by the GCHandle class to store information. 2019-02-19 10:51:51 +01:00
Marek Safar 2e88b48fde [mcs] Remove doc about CAS security 2019-02-19 10:14:48 +01:00
Zoltan Varga b8b2469380 [jit] Add a few more unsafe intrinsics. (#12971) 2019-02-19 02:27:40 -05:00
Katelyn Gadd 66092e0571 Update roslyn-binaries submodule to point to latest master revision (#12833)
This updates our roslyn submodule so that the new csc-dim is available.
2019-02-18 22:54:54 +01:00
Alexander Köplinger 1c26f21c0d Bump linker submodule to latest master (#13031)
* Bump linker submodule to latest master

* [csproj] Update project files
2019-02-18 14:02:34 +01:00
Phil Jaenke 8c185ed423 Remove leading . from script invocation (#13046)
The leading `.` in the script invocation causes the tests to fail on multiple platforms by causing the required argument to not be passed correctly resulting in bad output. Removal of the leading `.` ensures correct operation on all platforms.
2019-02-18 12:45:25 +01:00
Alexander Köplinger 602bdea385 Set executable bit for all .sh files in repo 2019-02-18 12:39:57 +01:00
bwadswor fe7c3d43e5 Correct access permissions to include "user execute" for run-msbuild.sh. (#13042)
Correct access permissions for run-msbuild.sh.  Adding "user execute" seems to fix the following build error.  With this change I'm able to build on windows in Cygwin.  without, I see the below error:

```
$ make -j4
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /cygdrive/c/mono/mono/missing autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
Git submodules updated successfully
make  all-recursive
make[1]: Entering directory '/cygdrive/c/mono/mono'
Making all in msvc
make[2]: Entering directory '/cygdrive/c/mono/mono/msvc'
Building Mono runtime using Visual Studio.
../msvc/run-msbuild.sh "build" "i686"
**/bin/sh: ../msvc/run-msbuild.sh: Permission denied**
make[2]: *** [Makefile:614: all-local] Error 126
make[2]: Leaving directory '/cygdrive/c/mono/mono/msvc'
make[1]: *** [Makefile:583: all-recursive] Error 1
make[1]: Leaving directory '/cygdrive/c/mono/mono'
make: *** [Makefile:513: all] Error 2
```
2019-02-18 12:34:29 +01:00
Zoltan Varga 77644b833e [netcore] EH work (#13041)
* [netcore] Switch to Debugger class from corlib.

* [netcore] Implement exception stack trace support.

* Address review comments.

* [netcore] Create a netcore specific version of Exception based on the refsource version.
2019-02-18 10:20:45 +01:00
Martin Baulig 099e003240 Add types supporting C# 8.0 Ranges. (#12841)
* Add types for C# 8.0 Ranges.

* Add workaround from @lewurm to fix the native crash.

* Fix compiler error test.

* [interp] guard span get_item intrinsic regarding its signature

* Cleanup sources and remove duplicates; thanks Egor!

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-18 09:55:45 +01:00
Marek Safar ad62ab26b7 Merge pull request #13040 from marek-safar/build-fixes
[System.Private.CoreLib] Implement more APIs
2019-02-17 11:03:18 +01:00
Jan Kotas 003a626bba Avoid pulling in Lazy<T> during startup (dotnet/coreclr#22659)
Environment constructor runs on every startup path. Remove dependency on Lazy<T> from it.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-17 11:02:36 +01:00
Thays Grazia 194b82b8b0 If getter is not implemented in a property we don't want to show this property, in Vs the behaviour is the same. (#13033)
Fixes #12964
2019-02-16 11:48:00 -02:00
Marek Safar f0ca41c781 [System.Private.CoreLib] Implement more APIs 2019-02-16 00:47:18 +01:00
Tanner Gooding a12209bf52 Updating some local functions to be 'static' (captureless). (#22635)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-16 00:20:34 +01:00
Alexander Kyte 12b3dbcc38 [crash] Move dump_memory_around_ip after the native crash (#13021)
If someone jumps to a bogus address for some reason, this will
double-fault. On OSX, a double fault is often a hang.
2019-02-15 18:14:03 -05:00
Vlad Brezae b3839e4434 [interp] Fix unaligned crashes on arm (#12985)
* [interp] Fix unaligned access crashes on arm

strd instruction fails if the memory address is not word aligned.

Fixes corlib-xunit suite on arm.

* [interp] Fix warning
2019-02-16 00:06:00 +02:00
Alexander Köplinger d224a047e0 Revert "[Facades] Remove System.Drawing.Primitives from xammac_net_4_5_SUBDIRS"
This reverts commit 9c1fd50666.

This is wrong, net_4_x_SUBDIRS only includes common_deps_SUBDIRS, not common_SUBDIRS.
2019-02-15 20:39:33 +01:00
Ludovic Henry 42f7bff05b [ci] Fix Bitcode{+Interpter} on AArch64 (#13016) 2019-02-15 13:38:20 -05:00
Kenneth Pouncey ccfa653b48 [wasm][CI] Reactivate Chakra tests in CI (#13026)
- Chakra install fails: https://github.com/Microsoft/ChakraCore/issues/5945
2019-02-15 12:12:37 +01:00
Alexander Köplinger 9c1fd50666 [Facades] Remove System.Drawing.Primitives from xammac_net_4_5_SUBDIRS
It's already included in the common_SUBDIRS and confuses a build safeguard in xamarin-macios.
2019-02-15 12:03:40 +01:00
Marek Safar 34c3055a7c Move Interlocked 2019-02-15 09:25:26 +01:00
Tanner Gooding 884b4c2473 Fixing the number formatting code to only recognize 'R' for double/float. (#22613)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-15 09:25:26 +01:00
Marek Safar f2c8664ac1 Move Reflection.Emit Tokens to shared partition (dotnet/coreclr#22602)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-15 09:25:26 +01:00
monojenkins 4ee073da2a [bcl] Update BCL Linked Size 2019-02-15 08:34:51 +01:00
Grant 7e52c1973e Missed optimization from #22497
Signed-off-by: dotnet-bot <[email protected]>
2019-02-15 08:33:24 +01:00
Larry Ewing 7f0eaf39ca Add some blazor binaries to bcl-size-diff 2019-02-14 23:57:30 +01:00
Grant d91a227cba Consolidate implementation of Rotate and PopCount (dotnet/coreclr#22584)
* Perf: BitOps.LeadingZeroCount

* Remove redundant MSIL cast, conv.u8

* Use local functions for SoftwareFallback

* Target BIT32/64

Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 23:00:36 +01:00
Marek Safar 8294fc0588 Remove local FrameworkEventSource 2019-02-14 22:47:06 +01:00
Marek Safar dbac2e4ffc Move FrameworkEventSource to shared partition (dotnet/coreclr#22507)
* Move FrameworkEventSource to shared partition

and remove unused code

* Remove more unused code

* Remove CA8001 suppress message

Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 22:47:06 +01:00
Levi Broderick 776e2a84c3 Add Rune creation API from UTF-16 surrogate pair (dotnet/coreclr#22590)
Also brings in some perf improvements to existing char and UnicodeUtility APIs

Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 22:47:06 +01:00
Egor Bogatov cf69b47259 NS2.1: System.IO, System.Reflection.Emit, etc (#12854)
* System.IO, System.Data

* lots of small ns21 improvements

* More changes (System.Reflection.Emit)

* Add IEquatable to S.R.Emit types

* bump corefx

* fix unix build

* more NS21 changes

* more changes

* bump corefx

* Fix failing tests (Sockets)

* bump corefx

* tmp workaround

* move DispatchProxyGenerator to net_4_x

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-14 22:40:58 +01:00
Grant 572d9928c0 Perf: Consolidate implementation of LeadingZeroCount (dotnet/coreclr#22497)
* Perf: BitOps.LeadingZeroCount

* CR fix

* CR fixes

* Optimization

* Revert

* Confirmed fix

* Simplify

* Return int

* Fixes

* Simplify

* CR fixes

* CR fixes

* Fix unit failure on Linux-musl x64 Debug

* CR fixes

* CR fixes

* Cleanup

Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 22:38:32 +01:00
Fei Peng 938477a7de Remove unnecessary ThrowIfUnsupportedType calls and definitions
Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 22:38:32 +01:00
Ludovic Henry 1be2bbce16 [ci] Enable working Bitcode{+Interpreter} test suites (#12997) 2019-02-14 14:47:05 -05:00
Martin Baulig 5c754423f2 Pass X509Certificate2 to the certificate validator.
This makes us consistent with corefx; see also
https://github.com/dotnet/corefx/pull/35306.

Using `X509Certificate` has become a problem because the
`HttpClientHandler.ServerCertificateCustomValidationCallback`
callback takes an `X509Certificate2` parameter.
2019-02-14 18:27:13 +01:00
Maxim Lipnin 347af5d61f Bump ikdasm 2019-02-14 18:09:49 +01:00
Rolf Bjarne Kvinge 4fec79cc6a [tests] Add the BitcodeNotSupported category to tests exercising non-bitcode-compatible API. (#13007)
* [tests] Add the BitcodeNotSupported category to tests exercising non-bitcode-compatible API.

We have APIs that use exception filter clauses, and we don't support that when
compiling to bitcode.

So mark any tests exercising such API accordingly, so that we can skip those
tests when running tests on targets that use bitcode (watchOS).

* [tests] Use BitcodeNotSupported on applying profiles
2019-02-14 11:49:29 -05:00
Bernhard Urban 920a621367 [bitcode] round up value type size for slot calculation (#12992)
consider

```csharp
struct S3
{
    public ushort X;
    public ushort Y;
    public ushort Z;
}
```
this would be 3 * 2 = 6 bytes. Structs, however, are passed around as i32
arrays in LLVM IR between functions. Those, if such a struct is passed, are
split to int32 depending on the struct's size. The previous calulation was
wrongly reserving one such i32 slot instead of two for `S3` above.

Additionally increase slot size to i64 so that it aligns with a
slightly different ABI on arm64_32.
2019-02-14 14:56:45 +01:00
Alexander Köplinger 9e8317f877 [System.Net.Http] Improve HttpClientTest to use the retry http listener (#12994)
It was missed in https://github.com/mono/mono/pull/11829 so we were still manually
creating HttpListeners which are not hardened against "Address already in use".

Should fix/improve https://github.com/xamarin/maccore/issues/1407.
2019-02-14 11:32:12 +01:00
Zoltan Varga f1ccdc49a9 [runtime] Avoid depending on the layout of the ParameterInfo class in the runtime, netcore has a version with a different layout. (#12980) 2019-02-14 09:32:42 +01:00
Kenneth Pouncey f5084b594f Move the index accessors to TypedArray instead duplicating the logic. 2019-02-14 06:32:37 +01:00
Alexander Kyte 4b83678a4a [crash] Add more detailed reporting for exceptions (#12946)
* [crash] Add more detailed reporting for exceptions

This bumps the crash reporting file format to version 0.0.3.

* [crash] Fix exception stack walker to consider captured_traces

Previously we were missing these frames from the captured_traces fields
of MonoException and MonoStackTrace.
2019-02-13 23:27:17 -05:00
Ludovic Henry e0643e5ac7 [ci] Fix Linux x64 Bitcode job (#12970)
* [ci] Fix Linux x64 Bitcode job

* [ci] Add Bitcode+Interpreter job

* [ci] Improve output information when AOTting the BCL
2019-02-13 18:31:31 -05:00
Alexander Köplinger 1c2ef6a472 Mono.Native: Simplify checking for min-version
We don't need to do the replacement sed magic for the compat library,
it should just use whatever is passed in.
2019-02-13 23:36:07 +01:00
Alexander Köplinger ae507fc4c4 [corlib] Fix CustomAttributeDataTest.MethodIncludesDllImportAttributeData() on watch/tv
Bitcode requires that the native symbol exists.
Changed the pinvoke to something that exists in libc.
2019-02-13 23:35:52 +01:00
Marek Safar 689e9b2e03 Remove local SafeHandle version 2019-02-13 23:24:44 +01:00
Stephen Toub 85caf55c16 Move SafeHandle to managed code and shared (dotnet/coreclr#22564)
* Move SafeHandle to managed code and shared

This moves the implementation of SafeHandle from native code in the runtime to managed.  I used corert's implementation as a base, and reviewed it again against the existing native implementation, making a few tweaks to better match the existing semantics.

This should be a valid move because of the reduced goals around CERs, thread aborts, etc.

However, there are places in the runtime that access SafeHandle functionality via its native counterpart, so I kept the relevant pieces of the native code intact.  Most code will continue to use the managed APIs, but the runtime can continue calling into the native versions when needed.

* Address PR feedback

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-13 23:24:44 +01:00
Alexander Köplinger c81e675866 [wasm][ci] Disable ChakraCore tests"
Downloading ChakraCore is broken right now due to https://github.com/Microsoft/ChakraCore/issues/5945.
2019-02-13 23:06:12 +01:00
Michal Strehovský 268f9e41cc Annotate EventCounter as a relocated type (dotnet/corert#6990)
This moved to CoreLib and needs to be annotated as such for Project N.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-13 21:06:20 +01:00
Fei Peng 745499f724 Remove unnecessary ThrowIfUnsupportedType calls and definitions
Signed-off-by: dotnet-bot <[email protected]>
2019-02-13 20:57:02 +01:00
Ludovic Henry bbb71e04a0 [ci] Use testing_aot_full_interp for FullAOT+Interpreter+LLVM (#12976) 2019-02-13 09:56:32 -05:00
Kenneth Pouncey 49d1d1795b Add U : struct constraint on TypeArray. Addresses comment review. 2019-02-13 15:38:07 +01:00
Kenneth Pouncey 1f9533a777 Fix delegate call back. Causes memory access crash with AOT. 2019-02-13 14:45:04 +01:00
Aleksey Kliger (λgeek) 5f1a8e7764 [debug-helpers] Include custom modifiers in mono_type_get_desc (#12979)
* [debug-helpers] Include custom modifiers in mono_type_get_desc

* [mini] Print return type in MONO_METHOD_VERBOSE output
2019-02-13 08:38:16 -05:00
Zoltan Varga 2466c2fc79 [netcore] Implement Assembly/AssemblyName/Module.
For RuntimeAssembly, make a fork since the amount of changes is very big. For AssemblyName/RuntimeModule, use the corlib version with some
ifdefs.
2019-02-13 11:11:37 +01:00
Kenneth Pouncey d81f8c7370 Modification of sdk framework build to not include the initialisation of the Bindings as it is now automatic. 2019-02-13 10:46:46 +01:00
Kenneth Pouncey 6dc1f10af1 Add corebindings build module and inclusion AOT
- Conditional include of bindings depending on if  --nobindings is specified.
- Packager: AOT ninja build modifications.
   - Add corebindings build dependency
   - Add bindings_support.j build dependency
   - Remove dependency to add Bindings initialisation to build and mono_config.js
 - Modify runtime.js and runtime-tests.js to remove the bindings initialisation code.
2019-02-13 10:45:12 +01:00
Ludovic Henry a43f1d2909 [sdks] Add mac-{mac32,mac64} targets (#12959)
* [sdks] Add mac-{mac32,mac64} targets

* [sdks] Add configure-* and build-* for CI
2019-02-12 18:57:56 -05:00
Tarek Mahmoud Sayed 469b0a7a0f Index and Range updates (dotnet/coreclr#22331)
* Index and Range updates

* Address @mikedn  feedback

* Address Feedback

* more feedback

* Use Deconstruct in Range.GetOffsetAndLength

* Rename GetArrayRange to GetSubArray

* Temporary disable the old Corefx Range tests

* Return back the TimeSpan test disabling

* Fix Range jit test

* Exclude the jit test

* revert the changes in the jit Range test

* Address Suggested Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-13 00:01:05 +01:00
Jan Kotas 781bebfdcb Fix CoreRT build breaks - Adjust resource name - Workaround C# compiler/analyzer bug
Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 23:36:22 +01:00
Marek Safar 3f5471a602 Remove local version of GCHandle 2019-02-12 21:19:29 +01:00
Stephen Toub 64a626fa87 Move GCHandle to shared (dotnet/coreclr#22499)
* Move GCHandle to shared

* Cache the handle in a local to make it easier for JIT to generate good code

* Rename m_handle to _handle to match the coding conventions

* Delete isPinned argument for GCHandleInternalCompareExchange

* Add fast path to GCHandle.Alloc/Free FCalls

* Disable outdated test

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 21:19:29 +01:00
Sung Yoon Whang c005351c61 Renaming RuntimeEventSource to NativeRuntimeEventSource (#22533)
* Renaming RuntimeEventSource to NativeRuntimeEventSource

* missed a couple of comments and XPlatEventLogger

* rename DotNETRuntimeEventSource.cs to NativeRuntimeEventSource.cs

* use condition= instead of ifdef

* removing ifdef from NativeRuntimeEventSource.cs

* Fix case for 'eventing' directory in csproj

* Fix unix builds

* This should fix unix build...

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 20:57:00 +01:00
Tanner Gooding 39f83e1925 Add extensions methods for several of the VectorXXX<T> helper methods (#22336)
* Moving several of the Vector128<T> instance methods to be extension methods.

* Moving several of the Vector256<T> instance methods to be extension methods.

* Moving several of the Vector64<T> instance methods to be extension methods.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 19:18:32 +01:00
Marek Safar d0c5bcff23 Fix the build 2019-02-12 18:37:19 +01:00
Marek Safar 27ea466b0b [System.Private.CoreLib] Clean up EqualityComparer 2019-02-12 18:37:19 +01:00
Thays Grazia 5f65ce9f7d [debugger] Reverting part of https://github.com/mono/mono/pull/12114 (#12950)
* [debugger] Reverting part of this commit https://github.com/mono/mono/pull/12114, removing this part the test ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter continues working and solve the regressions of 12881.
Inserted a new test that reproduces the regression.
Fixes #12881
2019-02-12 14:20:38 -02:00
Larry Ewing 2b9e5db153 Remove the logic that prepends a line in source references
Remove the hack that injected an extra line with the source
location now that we reference local sources when we can and
fix the Match logic so that it corrects for the difference
between pdbs and chrome breakpoints
2019-02-12 10:06:31 -06:00
Larry Ewing 2dcbeb5548 Use file: urls when when the files exist locally
Unknown schemes (dotnet:) are not well supported by all the
tools that support the chrome DevTools protocol so if the
file exists locally use a file: url rather than a dotnet:
url to reference it.
2019-02-12 10:06:31 -06:00
Larry Ewing 36d26498d4 Handle urlRegex breakpoint requests.
VisualStudio debug agents use urlRegex rather than url
when looking for breakpoint locations so add support for those
requests.
2019-02-12 10:06:31 -06:00
Larry Ewing 419646c960 VSCode expects the decription field to be populated for the variables display 2019-02-12 09:37:01 -06:00
Larry Ewing ce751cbe55 Make sure we add callFrameId so that the debugger populates locals 2019-02-12 09:37:01 -06:00
Michal Strehovský 52d6e18ea6 Ifdef out code that triggers UTC bug (dotnet/corert#7003)
This results in bad codegen on AMD64. I filed a bug internally; hopefully we can get a fix soon.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 16:17:04 +01:00
hamish-rose 412f75a1c5 Add new rounding modes to System.Math, System.MathF (dotnet/coreclr#20815)
* add new rounding modes to MidpointRounding.cs

new modes added to enum
implemented ToZero for double in Math.cs

* ToZero implementation

* implement double and float rounding modes

* updating rounding implementation

now round inline with DecCalc internal round implementation

* small bug fix

also replace var to make things obvious

* update implementation - floor/ceil

code review feedback

* review feedback

add comments, update MathF with floor/ceil

* code review feedback

 - fix comments
 - replace ifelse with switch
 - remove RoundingMode enum from DecCalc

* exclude outdated corefx test

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 16:12:49 +01:00
Larry Ewing 80c10f6307 Merge pull request #12952 from lewing/debugger-proxy-discovery
[Wasm] Proxy More of the DevTools protocol
2019-02-12 08:32:59 -06:00
Kenneth Pouncey 56d77dcce9 Remove unused code 2019-02-12 14:14:12 +01:00
Maxim Lipnin b4370f6e76 Update System.Data.Entity to handle new String overloads (#12680)
* Add new String overloads

* Remove some overloads with non-primitive types

* Remove IndexOf overloads with more than 1 argument

* Remove Trim() from TrimTranslator because CanonicalFunctionDefaultTranslator already supports it.

* Trim/TrimStart/TrimEnd: remove Char parameter overloads; add condition to support parameterless overloads.

* Remove unsupported Char overloads of Contains, IndexOf, StartWith and EndWith methods
2019-02-12 13:59:39 +01:00
Kenneth Pouncey fbaa3db2e0 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-02-12 13:30:53 +01:00
Kenneth Pouncey 58fe50e028 Add support for CopyTo
- ArraySegment
- primitive array
- memory address CopyTo (IntPtr, offset, count)
2019-02-12 13:16:16 +01:00
Kenneth Pouncey b1f7a22a8b Add CopyFrom implementation and support for
- ArraySegment
- support CopyFrom IntPtr, offset, count to marshal memory pointer from Heap to TypedArray
2019-02-12 10:32:20 +01:00
monojenkins 5374e7ef46 [csproj] Update project files 2019-02-12 08:52:42 +01:00
monojenkins e4303ac76f Bump API snapshot submodule 2019-02-12 08:52:42 +01:00
Alexander Köplinger 6474cf7b61 Bump cecil submodule 2019-02-12 08:52:42 +01:00
Zoltan Varga 19d705c69d [bcl] Restructure the Module classes to simplify netcore integration.
* Move all icalls to RuntimeModule.
* Make all icalls static and receive the module as an IntPtr.
* Remove some duplicate code between the RuntimeModule and ModuleBuilder classes.
2019-02-12 08:46:09 +01:00
Dotnet-GitSync-Bot 374f44ebe8 Mirror changes from mono/corert,coreclr (#12951)
* Make Module partial to allow additional changed for Mono

Signed-off-by: dotnet-bot <[email protected]>

* Move ConditionalWeakTable to shared (dotnet/coreclr#22531)

Leaves DependentHandle as being the runtime PAL

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 01:45:39 -05:00
Larry Ewing 85bf22730b Proxy More of the DevTools protocol
Much of the tooling around DevTools expects
actions under /json to return useful data
this adds adds some simple logic to proxy those
so that you can point tooling directly at the
proxied port and get responses you expect
2019-02-11 21:18:15 -06:00
Larry Ewing a51b475173 Merge pull request #12809 from lewing/wasm-debug-documentation
[WASM] debug documentation and sample updates
2019-02-11 20:08:54 -06:00
Marek Safar ac5ab1a7ef Use shared Volatile 2019-02-12 00:32:45 +01:00
Stephen Toub 9d136f9446 Move Volatile to shared (dotnet/coreclr#22523)
* Move Volatile to shared

This largely takes corert's implementation, which uses Unsafe.As and volatile fields.

We could investigate also removing the JIT's replacements subsequently.

* Add [Intrinsic] attributes

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 00:32:45 +01:00
Alexander Köplinger 6ca20e92b6 [ci] Bump timeout for corlib-xunit tests
See https://github.com/mono/mono/issues/12945
2019-02-11 20:34:04 +01:00
Kenneth Pouncey 17134ec2b6 Add support for CopyFrom
- Array, offset, count
- ArraySegment
2019-02-11 17:13:45 +01:00
Bernhard Urban aac567ff66 [ios] add crosswatch64_32 target (#12893)
* [ios] add crosswatch64_32 target

* fix gnu triple for wasm
2019-02-11 11:08:02 -05:00
Alexander Köplinger ff7fc7e93a [ci] Bump bockbuild to get fontconfig download url fix 2019-02-11 16:56:46 +01:00
Aleksey Kliger (λgeek) 95f31d0259 [runtime] Refactor pinvoke probing, part 2 (#12850)
* [marshal] Add emit_exception_for_error callback

* [runtime] MonoError-ize mono_lookup_pinvoke_call_internal

Two complications:

1. Marshalling needs to turn a MonoError into MethodBuilder instructions to
   emit an exception.
2. The public API uses two string to signal an error.  So we have to use
   a custom status struct to return the error code.

* [loader] Factor out library path transformations

* [marshal] Copy error msg in mono_mb_emit_exception_for_error

Add new mono_mb_stdrup to make a copy of a given string into the memory that
will live with the MethodBuilder's method.

* [interp] Callvirt of an icall should call the wrapper.

See pinvoke2.cs test_0_missing_virtual_pinvoke_method ()

You can have an icall override a virtual method:

    	public class T2 : T {
    		[MethodImplAttribute(MethodImplOptions.InternalCall)]
    		public override extern object MyClone ();
    	}

When the interpret saw this, it was setting up a child frame with the frame
method being the MonoMethod of the icall itself, not the wrapper.  But it was
executing the wrapper.  As a result if the wrapper body had a LDSTR in it, we
would hit the assertion in the MINT_LDSTR_TOKEN case where
frame->imethod->method->wrapper_type == MONO_WRAPPER_NONE is not allowed.

With this change the frame method is now the wrapper which has a correct
wrapper type.

* [loader] remove pinvoke_probe_transform_path do{}while(0) construct

take the line damage; make the code easier to understand.
2019-02-11 10:49:56 -05:00
Jonathan Chambers 7176289621 Grow StackSlotInfo array rather than asserting (#12829) 2019-02-11 09:28:48 -05:00
Johan Lorensson dad67f4760 Incorrect call to MONO_HANDLE_SETRAW causes random crash in sgen. (#12851)
mono_string_utf16_to_builder_copy incorrectly uses MONO_HANDLE_SETRAW to
update the chunkLength field with a string length. Since MONO_HANDLE_SETRAW
assumes the argument is a MonoObject reference this could lead to a dereference
and since the value is a string length, that dereference will lead to a crash.

The problem happens in mono_gc_wbarrier_set_arrayref_internal where vtable
is retrieved from value. The crash happens randomly since it is depending
on the object being moved out of the nursery + sgen_binary_protocol_wbarrier
not being eliminated.

Fix is to use MONO_HANDLE_SETVAL since the value is not a reference so no need
to trigger a write barrier.
2019-02-11 09:12:20 -05:00
Johan Lorensson 4ba6733438 Fix OP_GET_LAST_ERROR codegen on Windows x64 full AOT. (#12853)
Current codegen incorrectly read back last error when doing p/invoke for
full AOT. This caused many failed corlib tests ~600. It also
turns out that the test for set/get last error related to p/invoke that we
have in pinvoke2.exe, is not run for the full AOT profile, due to other tests
depending on none full AOT features. In order to make sure we run the test
and not regress, test has been moved into its own runtime tests, running as
part of full AOT testing.
2019-02-11 09:11:50 -05:00
Alexander Kyte 9531662837 [crash] Use safer invalid-free test (#12864)
When using the previous test, some memory unsafety was
observed. It's rather unrecoverable memory unsafety, as
it corrupts heap memory used by the sequence points, registered MERP
paths, jit info internals, and output string.

Crashes seen here: https://github.com/mono/mono/pull/12387 reproduce
with less than 100 iterations of this malloc test run as the stress
test.

```
(MonoJitInfoTable) $2 = {
  domain = 0x5050505050505050
  num_chunks = 1347440720
  num_valid = 1347440720
  chunks = {}
}
```

with

```
(lldb) p/x 1347440720
(int) $0 = 0x50505050
```

And sometimes the mono crash

```
(lldb) p *it
(SeqPointIterator) $3 = {
  seq_point = (il_offset = 0, native_offset = 0, flags = 0, next_offset = 0, next_len = 0)
  ptr = 0x5050505050505050 <no value available>
  begin = 0x5050505050505050 <no value available>
  end = 0x5050505050505064 <no value available>
  has_debug_data = 0
}
```

===

These do not reproduce when doing a double free of legally allocated
memory.

I think that the crash reporting tests aren't the place to check if the
OS allows for wild heap corruption when doing these things. I don't
think it's currently in scope for the runtime to do crash reporting
after it's internal metadata tables have been corrupted. They're the
source of truth for symbolication. We don't have many options to
validate and reparse them, unless we want to make this all very
heavyweight.
2019-02-11 09:11:11 -05:00
Johan Lorensson 1a3813e899 Fix errors in TimeZoneInfoTest on Windows full AOT using winaot profile. (#12852)
Fix errors in TimeZoneInfoTest on Windows full AOT using winaot profile.
2019-02-11 08:35:54 -05:00
Kenneth Pouncey 949f3f7125 Add implicit conversion to and from primitive array. 2019-02-11 13:49:30 +01:00
Kenneth Pouncey 0e1a202bbb Add Type Array CopyFrom support.
- This will copy a managed array from heap to the typed array memory.
2019-02-11 10:29:02 +01:00
Marek Safar d5147e88bb [System.Private.CoreLib] Add more APIs 2019-02-11 09:50:36 +01:00
Kenneth Pouncey 56021009aa Misspellings 2019-02-11 07:37:03 +01:00
Kenneth Pouncey 07bb573833 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-02-11 06:09:05 +01:00
Vlad Brezae 846eca0dbd [interp] Fix ldelema (#12903)
The ldelema IL instruction provided the element class while the Address intrinsic provided the array class.

Fixes https://github.com/xamarin/xamarin-macios/issues/5363
2019-02-11 01:09:06 +02:00
Calvin Buckley b2f590b599 Fix build and use System.Native on FreeBSD (#12921)
* Required includes for system headers to behave on FreeBSD

* System.Native on FreeBSD
2019-02-10 10:27:54 +01:00
Jan Kotas b98780c71b Fix casing of interop directories (dotnet/corert#6982)
Match convention introduced by https://github.com/dotnet/corefx/pull/35085

Signed-off-by: dotnet-bot <[email protected]>
2019-02-10 09:37:18 +01:00
Sung Yoon Whang 544c43d0d6 set up CoreLib to include EventCounter in build project (#22501)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-10 09:32:05 +01:00
Marek Safar ca418e412b [netcore] Update to the latest version 2019-02-09 17:31:41 +01:00
Alexander Köplinger 67f1926803 [ci] Fix windows job name in osx-package.groovy 2019-02-09 14:32:27 +01:00
Marek Safar 903b264c4f Move Array's SZGenericArrayEnumerator to shared partition (#22480)
* Move Array's SZGenericArrayEnumerator to shared partition

* Remove legacy comment

* Move all array enumerators to a new file

Signed-off-by: dotnet-bot <[email protected]>
2019-02-09 08:30:10 +01:00
monojenkins 1f330171a8 [bcl] Update BCL Linked Size 2019-02-09 08:27:25 +01:00
Sung Yoon Whang 3fa2c0511f move EventCounter to shared CoreLib (dotnet/corefx#35183)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-09 08:25:51 +01:00
Marek Safar 5f9b66db43 [System.Private.CoreLib] Add missing Array APIs 2019-02-09 08:23:04 +01:00
Grant 29942cfd80 BitOps.TrailingZeroCount has inconsistent software fallback (#22333)
Fix #22326

Signed-off-by: dotnet-bot <[email protected]>
2019-02-09 00:58:07 +01:00
Marek Safar 38550e117e [System.Private.CoreLib] Implement part of GCSettings 2019-02-09 00:08:20 +01:00
Marek Safar 54f35f6198 Clean up GCSettings temp version 2019-02-08 23:15:15 +01:00
Stephen Toub 4bb7d23683 Move GCSettings to shared (dotnet/coreclr#22483)
Mainly just type definitions and error handling that gets shared.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 23:15:15 +01:00
Ludovic Henry f804ffdd2c Merge pull request #12810 from lateralusX/lateralusX/fix-win-fullaot-runtime-tests
Fix Windows x64 full AOT runtime test failures.
2019-02-08 15:50:03 -05:00
Ludovic Henry 719668fda1 Merge pull request #12856 from migueldeicaza/registry-finalizer-fixed
[Registry] Prevent crash due to background thread facing problems in the file system
2019-02-08 15:44:23 -05:00
Ludovic Henry 2355e592dc [arm/bitcode] mark valuetype returns as such when dealing with pinvokes (#12894)
On armv7 our calling convention happens to be the same as the platform
one. However, when using a armv7 cross compiler to generate bitcode that
targets a different platform (e.g. arm64_32) the calling convention can
be different (e.g. on arm64_32, a return buffer must be passed via r8).
Thus, mark it properly for LLVM so it can generate correct code.
2019-02-08 15:38:00 -05:00
Bernhard Urban 8ad82bbfc1 [ios] link mono-native correctly (#12895)
Fixes this app startup issue

```
dyld: Library not loaded: /Users/lewurm/work/mono-watch4-ios-sdk/sdks/out/ios-target64-release/lib/libmono-native-unified.0.dylib
  Referenced from: /var/containers/Bundle/Application/9697C8F3-811C-4BF3-B1BC-1E6385673984/PublicStaging.app/test-Mono.Runtime.Tests
  Reason: image not found
Process 2269 exited with status = 0 (0x00000000) Terminated due to signal 6
```
2019-02-08 15:36:53 -05:00
Vlad Brezae b62cca8974 [interp] Remove some cknull uses (#12849)
* [interp] Avoid using MINT_CKNULL

Unnecessary overhead for this tiny instruction.

* [interp] Do null check for this before inlining

Otherwise we miss it.
2019-02-08 15:32:07 -05:00
Vlad Brezae edccda13d3 [interp] Add method to seq_points table after we finish registering it (#12902)
* [interp] Add method to seq_points table after we finish registering it

When adding a breakpoint (mono_de_set_breakpoint) we search in this table for seq_point information for the method. If we find the information we expect that the method is already compiled and has the metadata initialized when actually adding the breakpoint (set_bp_in_method). We were crashing if the jinfo field of the interp method was not yet initialized.

Fixes https://github.com/xamarin/xamarin-macios/issues/5381

* [interp] Move profiler callback when we are actually done

Just in case.
2019-02-08 15:29:07 -05:00
Jan Kotas b8ee1ca51f Update CoreRT with shared array implementation
Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 19:58:21 +01:00
Zoltan Varga f1dfd9c413 [llvmonly] Add a mini_llvmonly_throw_nullref_exception () jit icall to throw nullref exceptions, it occurs very frequently when explicit null checks are enabled. (#12883) 2019-02-08 13:06:11 -05:00
Zoltan Varga e14ef8a658 [corlib] Move the implementations of virtual methods from Assembly to RuntimeAssembly to ease netcore integration. (#12805)
* [corlib] Move the implementations of virtual methods from Assembly to RuntimeAssembly to ease netcore integration.

* [corlib] Move more code to RuntimeAssembly.

* [corlib] Move fields from Assembly to RuntimeAssembly/AssemblyBuilder.cs. Reduce the amount of fields visible to runtime code.

* Update serialization tests.

* Fix the MOBILE build.

* Bump API snapshot submodule
2019-02-08 13:05:54 -05:00
Zoltan Varga 83fc1456db [wasm] Add mixed tests to CI. (#12882)
* [wasm] Only dedup the assemblies which are actually AOTed in mixed mode.

* [wasm] Add mixed mode test targets.

* [wasm] Add mixed tests to CI.
2019-02-08 13:05:35 -05:00
Alexander Köplinger b01cfed2a4 [ci] Support building the OSX .pkg on private Jenkins 2019-02-08 17:18:41 +01:00
Alex Thibodeau d5dfaf6006 FIxing crash where a generic enum is passed into get_shared_type. Also added automated test to catch this scenario. (#12622) 2019-02-08 09:27:54 -05:00
Bernhard Urban b9c611e93c [arm64] encode offset within stack slot for r4 in gsharedvt descriptor (#12867)
Follow up fix for https://github.com/mono/mono/pull/11741

Fixes https://github.com/mono/mono/issues/12831
2019-02-08 12:28:29 +01:00
Bernhard Urban 63f4ee5540 [arm/bitcode] mark valuetype returns as such when dealing with pinvokes
On armv7 our calling convention happens to be the same as the platform
one. However, when using a armv7 cross compiler to generate bitcode that
targets a different platform (e.g. arm64_32) the calling convention can
be different (e.g. on arm64_32, a return buffer must be passed via r8).
Thus, mark it properly for LLVM so it can generate correct code.
2019-02-08 11:17:06 +01:00
Aleksey Kliger 972f29179d [sre] Handle null values in MarshalAsAttribute CustomAttributeBuilder
Normally strings are encoded as length-then-utf8 in ECMA-335.  But a null
String is encoded as just the byte 0xFF.

When we make a CustomAttributeBuilder for a MarshalAsAttribute and attach it to
some parameter we first encode the CAB as a byte blob and then decode it in
CAB.get_umarshal into a UnmanagedMarshal attribute.  But the decoding didn't
account for the possibility of null strings.

Fixes https://github.com/mono/mono/issues/12747
2019-02-08 10:56:08 +01:00
Marek Safar 49c0a9c2de Remove local DateTime 2019-02-08 10:37:29 +01:00
Marek Safar 9636096e3b Move DateTime for Unix to shared partition (dotnet/coreclr#22383)
* Move DateTime for Unix to shared partition

* Keep CoreCLR specific implementation

Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:37:29 +01:00
Marek Safar f4c9b79905 Use local Array version 2019-02-08 10:27:04 +01:00
Stephen Toub a4681c14d9 Fix CoreLib to include PasteArguments.Unix.cs correctly (#22453)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:27:04 +01:00
Marek Safar 2e267dfa80 Move Array to shared partition (dotnet/coreclr#22321)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:27:04 +01:00
Marek Safar 8608d281c6 Implement ManifestBasedResourceGroveler::GetNeutralResourcesLanguageAttribute (#22372)
* Implement ManifestBasedResourceGroveler::GetNeutralResourcesLanguageAttribute in shared managed code

* Remove native ::GetNeutralResourcesLanguage

Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:27:04 +01:00
Tarek Mahmoud Sayed ab717125aa Index and Range updates (dotnet/coreclr#22331)
* Index and Range updates

* Address @mikedn  feedback

* Address Feedback

* more feedback

* Use Deconstruct in Range.GetOffsetAndLength

* Rename GetArrayRange to GetSubArray

* Temporary disable the old Corefx Range tests

* Return back the TimeSpan test disabling

* Fix Range jit test

* Exclude the jit test

* revert the changes in the jit Range test

* Address Suggested Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:27:04 +01:00
Bernhard Urban 33d6380103 [aot] interp flag on AOT images only on mscorlib required (#12838)
[aot] interp flag on AOT images only on mscorlib required

/cc @spouliot. This fixes `--interpreter=-all` on Xamarin.iOS.
2019-02-07 17:15:50 -05:00
Bernhard Urban 21c65aafc8 [ios] pass --enable-monotouch to cross compilers so icall defintions are visible to it (#12834)
This fixes a regression introduced by https://github.com/mono/mono/commit/5187b0bdaaff56936d697b0753dad51e7498991d

The AOT compiler wasn't aware of the icalls since they are guarded by `ENABLE_MONOTOUCH`. Passing `--enable-monotouch` to configure of the AOT compiler enables that define, so it can properly resolve those icalls. However, to avoid `zlib` dependency for the cross compilers, we stub
them out.
2019-02-07 20:26:42 +01:00
Alexander Kyte 0e65799c8e [runtime] Use temp folders for merp tests (#12830)
The 2018-10 lane seemed to be failing some tests because the merp-json-valid.exe test left behind the crash log file. I fixed that in this PR, but also move the tests into their separate folders so they can run at the same time safely.
2019-02-07 19:32:06 +01:00
Tanner Gooding 321e0b511f Fixing Utf8Formatter.Float to support all the same format specifiers as the utf16 formatter. (#22434)
* Fixing Utf8Formatter.Float to support all the same format specifiers as the utf16 formatter.

* Disabling some outdated CoreFX tests.

* Fixing TryFormatFloatingPoint to special-case format.IsDefault

Signed-off-by: dotnet-bot <[email protected]>
2019-02-07 18:47:19 +01:00
Stephen Toub 75a7b9601f Finish removing Environment from corefx
Signed-off-by: dotnet-bot <[email protected]>
2019-02-07 18:30:59 +01:00
Miguel de Icaza 39397b5e92 [Registry] Prevent crash due to background thread facing problems in the file system 2019-02-07 11:52:59 -05:00
Zoltan Varga b019ca4d5a [wasm] Fix icall table linking, generate one table per assembly. (#12840) 2019-02-07 11:44:11 -05:00
Vlad Brezae 33189ef31f [tests] Enable test suites on interpreter (#12806)
Seem to pass locally
2019-02-07 16:13:24 +02:00
Johan Lorensson bbe84c03fa Merge pull request #12811 from lateralusX/lateralusX/fix-win-fullaot-runtime-tests-toggleref
Fix issue where togglerefs might be incorrectly pinned by GC.
2019-02-07 02:59:45 -05:00
Kenneth Pouncey dedbbbf401 Fix error with bindings. 2019-02-07 07:09:08 +01:00
Aleksey Kliger (λgeek) d36f437f60 [runtime] Refactor pinvoke probing (#12795)
* [runtime] Mark mono_lookup_pinvoke_call external only

Runtime should use mono_lookup_pinvoke_call_internal

* [loader] Factor out helper functions from mono_lookup_pinvoke_call

Separate the logic for probing for a dynamic library module from the logic for
looking for a symbol inside the module.

* [loader] Factor out relative directory probing in pinvoke lookup
2019-02-06 20:50:32 -05:00
Zoltan Varga 9453281f0c [ci] Enable llvmonly+mixed tests on CI. (#12777) 2019-02-06 20:46:06 -05:00
Alexander Köplinger 004deafa3a [tests] Disable flaky block_guard_restore_aligment_on_exit.exe on Windows PRs
See https://github.com/mono/mono/issues/12839
2019-02-07 01:25:13 +01:00
Thays Grazia ada7c1b821 [wasm][debugger] Bug on attributes with value type string and content NULL (#12827)
* An attribute with a content that was a string null was creating two items in result json and it was throwing an exception in client side because it is expected a name and a value and not a name and two values.
2019-02-06 21:19:01 -02:00
Alexander Köplinger ea3d9b80b5 [corlib] Remove reflection-based Mono.Native test (#12828)
The managed linker removes the type embedded inside mscorlib and we don't want to whitelist it in linker xml since then it'd be kept for everyone.

Instead move the type to the test assembly and remove the reflection-based tests.
2019-02-06 22:47:19 +01:00
Miguel de Icaza b3eeb1667a [man] mono.1 - describe how to get the list of options 2019-02-06 15:52:19 -05:00
Alexander Köplinger b4c66a1d59 [mono-native] Remove accidentally added brotli.c file
It broke the iOS SDK build because of duplicated main().

See https://github.com/mono/mono/pull/12189
2019-02-06 20:50:50 +01:00
Alexander Köplinger 04c71af56a Extend mono-native minimum version magic to CPPFLAGS/CXXFLAGS (#12801)
We were only doing the -mmacosx-min-version replacement magic on
CFLAGS and LDFLAGS for mono-native-compat and -unified,
but we need to do the same for CPPFLAGS/CXXFLAGS too.

Fixes an issue where the libraries were targeting the wrong minimum OSX
version when built from xamarin-macios since they pass the minimum version
in CPPFLAGS instead of CFLAGS for OSX.
2019-02-06 19:07:58 +01:00
Martin Baulig 5c17c4cf31 Add support for async-streams (C# 8.0). (#12674)
Bring some new APIs from corefx master for async-streams (C# 8.0):

- `IAsyncDisposable`
- `IAsyncEnumerable`
- `IAsyncEnumerator`
- `AsyncIteratorMethodBuilder`
- `AsyncIteratorStateMachineAttribute`
- `ConfiguredAsyncDisposable`
- `ConfiguredCancelableAsyncEnumerable`
- `ManualResetValueTaskSourceCore`
- `TaskExtensions` (replacing our reference source version).

Minor changes to existing code:

- Add `ExecutionContext.ContextCallback<TState>(ref TState state)` delegate.
- Add `ExecutionContext.RunInternal<TState>` method.
- Uncomment `AsyncMethodBuilderCore.Start<TStateMachine>`.
- Add new `ThreadPool.QueueUserWorkItem<T>(Action<T>,T,bool)` and `UnsafeQueueUserWorkItem<T>(Action<T>,T,bool)` overloads.

New xUnit tests from CoreFX:

- `System.Threading.Tasks/tests/System.Runtime.CompilerServices/ConfiguredCancelableAsyncEnumerableTests.netcoreapp.cs`
- `System.Threading.Tasks.Extensions/tests/ManualResetValueTaskSourceTests.cs`
- `System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs`
- `Common/tests/System/Threading/Tasks/Sources/ManualResetValueTaskSource.cs`
- `Common/tests/System/Threading/Tasks/Sources/ManualResetValueTaskSourceFactory.cs`
- `System.Threading.Tasks.Extensions/tests/AsyncValueTaskMethodBuilderTests.cs`
- `System.Threading.ThreadPool/tests/ThreadPoolTests.cs`
- `System.Threading.ThreadPool/tests/ThreadPoolTests.netcoreapp.cs` (partial due to missing `IThreadPoolWorkItem`)
2019-02-06 15:01:45 +01:00
Kenneth Pouncey fdc3d56c9b Typed Array Support - Initial commit
- Contains breaking changes
  - Remove NewArrayJS which is replaced with Array bidning.
- Add support for working with Typed Arrays, ArrayBuffer and Array.
-  Typed arrays supported

   - Int8Array 		| int8_t	| byte or SByte (signed byte)
   - Uint8Array		| uint8_t	| byte or Byte (unsigned byte)
   - Uint8ClampedArray| uint8_t	| byte or Byte (unsigned byte)
   - Int16Array		| int16_t	| short (signed short)
   - Uint16Array		| uint16_t	| ushort (unsigned short)
   - Int32Array		| int32_t	| int (signed integer)
   - Uint32Array		| uint32_t	| uint (unsigned integer)
   - Float32Array		| float		| float
   - Float64Array		| double	| double

- Split the bindings into separate file for easier support and to keep the driver program size down.
2019-02-06 14:52:30 +01:00
Thays Grazia e1602576d3 [wasm][debugger] Evaluate properties and generics. (#12782)
* [wasm][debugger] Evaluate properties and generics.
2019-02-06 09:39:00 -02:00
Alexander Köplinger aedc1ca38f [ci] Support Mono version 6.x in Windows .msi build 2019-02-06 11:47:02 +01:00
Vlad Brezae 7869333c52 [metadata] Fix dynamic delegate (#12762)
* [metadata] Decouple dynamic method signature from its delegate invoke wrapper

The invoke wrapper should not be referencing the signature because it will be freed once with the dynamic method. The wrapper can outlive the dynamic method, it is cached based on the signature.

Fixes crash on old IronJS benchmark with interpreter (which uses a lot of delegate wrappers, compared to jit)

* [interp] Add debug method for printing transformed code
2019-02-06 11:19:26 +01:00
Larry Ewing 5b44b5cbb8 Update README.md debugger instructions to match the current layout 2019-02-05 19:42:17 -06:00
Larry Ewing 1ea56466e4 Include mono-config.js produced by packager in debug.html 2019-02-05 19:41:37 -06:00
Larry Ewing d4251f42f4 Remove shell prompt from README.md to be consistent and improve cut and paste 2019-02-05 19:39:04 -06:00
Larry Ewing 879afec442 Merge pull request #12540 from jeromelaban/dev/jela/wasm-debugger-update
[WASM] Improve debugging support
2019-02-05 19:01:30 -06:00
Egor Bogatov 2f6104f163 [System.IO.Compression] Brotli from CoreFX (#12189)
Resolves https://github.com/mono/mono/issues/11431

I put the native impl to Mono.Native, but probably it should be in a separate lib (`libmono-native.0.dylib` before: **81kb**, after: **898kb**) if Linker is not able to trim it if it's not used.
Compiles and works on Windows (however, we don't build Mono.Native for Windows, but we can borrow `clrcompression.dll` from .net core) and macOS but requires changes in mono/corefx,

I disabled xunit tests as those need 50mb of test data.

PS: Brotli could be fully managed 😢 https://github.com/dotnet/corefxlab/issues/1673

C# ports:

- https://github.com/master131/BrotliSharpLib 
A quick benchmark (Compressing a 5mb file with max compression level=11)
Mono JIT: 25sec
Mono LLVM-AOT: 7.8sec
.NET Core 2.2: 6.8sec
.NET Core 3.0: 5.8sec
.NET Core's BrotliStream (with native lib): 3.5sec


- https://github.com/google/brotli/tree/master/csharp - official C# port. Based on Java sources, slow, outdated (2 years ago).
2019-02-06 00:25:19 +01:00
Martin Baulig 94f00fe796 Fix HttpClient on AIX (#12744). (#12771)
Define `PLATFORM_UNIX` in `mcs/build/platforms/unix.make` and make
`mcs/build/profiles/net_4_x.make` define `SOCKETSHTTPHANDLER=1` when set.
2019-02-05 22:41:43 +01:00
Alexander Köplinger fd71ea2fd3 [corlib] Disable GetFrames_AsyncCalls on mobile
See https://github.com/mono/mono/pull/12790
2019-02-05 21:33:56 +01:00
Michal Strehovský 399d14104a Fix ProjectN build breaks (dotnet/corert#6954)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-05 19:13:59 +01:00
lateralusX c432251142 Fix issue where togglerefs might be incorrectly pinned.
Due to current order, process togglerefs and then take current threads
stack could cause a problem where toogleref references might be left
in registers after native code process the list and those reference
would then be put into current thread context, incorrectly pinning the
toggleref, preventing it from being GC:ed. The problem was observed on
Windows (in debug build) running sgen-toggleref.exe runtime test since
the native compile of sgen_process_togglerefs used a register when
walking the list of togglerefs that was then not re-used until the
current threads stack was taken, causing incorrect pinning. This problem
could in theory happen on any platform depending on how sgen_process_togglerefs
would been compiled and what register will be used.

Fix is to take current threads context before walking the togglerefs to make
sure we are not getting managed references into registers as part of managing
the toggleref list in native code.
2019-02-05 18:37:05 +01:00
lateralusX ecc42a8410 Fix failure in catchfault_tail.exe due to stack overwrite in final handler.
Combination of Windows x64 ABI and the lack of not checking for fault handlers
in OP_START_HANDLER cause a hard to track stack corruption when combined with
tail calls. Fix is to make sure we also handle fault regions in handlers to
handle cases like the one exposed by catchfault_tail.exe test.
2019-02-05 18:34:20 +01:00
lateralusX dfa2fe6d2b Add better support to dynamically setup content of config.h in Windows MSVC builds.
When running tests on CI the runtime is configured from autogen.sh script.
When running fullaot there are a couple of features not supported so they are
disabled. The problem is that the MSVC Windows builds have its own winconfig.h
template, losing all the disabled features from configures config.h.

This commit adds support to detect the disable defines from configures config.h
if one exists. Since the complexity of this step increases the work previously
done in winsetup.bat has been moved into a msbuild target that is used from
both within VS build as well as winsetup.bat (there are a couple of other builds
using that bat file, so won't remove it).

The winconfig.h template we had is quite outdated compared to what’s generated
by configure. This commit also updates the winconfig.h to closer match what generated
for corresponding mingw build but keep all the Windows specific configurations
included in current version.
2019-02-05 18:34:20 +01:00
lateralusX c39e3e1200 Fix failing test under debug mode due to incorrect marshal alloc. 2019-02-05 18:34:20 +01:00
lateralusX 46e65d2a09 Fix process stress tests to not popup thousands of Windows.
Fix runtime test run to pickup working wrapper when running
with --enable-msvc but not setting MONO_EXECUTABLE.
2019-02-05 18:34:20 +01:00
Jo Shields 667925b987 Merge pull request #12794 from directhex/master
Bump version to 6.1.0
2019-02-05 11:26:56 -05:00
Jo Shields 1f77041f92 Bump version to 6.1.0 2019-02-05 09:42:19 -05:00
Marek Safar 29594b984c [corlib] Fix GetFrames_AsyncCalls test not to block 2019-02-05 13:09:36 +01:00
monojenkins ae99e720cd [csproj] Update project files 2019-02-05 13:08:33 +01:00
monojenkins b7fe8104e6 Bump API snapshot submodule 2019-02-05 13:08:33 +01:00
Egor Bogatov 4285787ece improve test 2019-02-05 13:08:33 +01:00
Egor Bogatov 5946cd6cb5 use CoreRT's CancellationToken and CancellationTokenSource 2019-02-05 13:08:33 +01:00
Egor Bogatov 56aab1437d add #if MONO to ref-source file 2019-02-05 13:08:33 +01:00
Egor Bogatov 3c9035442b Do not clone SyncronizationContext in EE 2019-02-05 13:08:33 +01:00
Martin Baulig afd4971208 "Ice Blue": Adding some "Connection Info" properties to SslStream. 2019-02-05 10:49:47 +01:00
Zoltan Varga 51287431af [netcore] Ongoing work. (#12750) 2019-02-05 10:34:31 +01:00
Ben Adams 45b6b640a4 Fix string.strlen (dotnet/coreclr#22397)
* Add explanation comment

Fixes #22393

Signed-off-by: dotnet-bot <[email protected]>
2019-02-05 10:29:49 +01:00
Marek Safar dc323ae290 Remove local SynchronizationContext 2019-02-05 10:20:12 +01:00
Marek Safar d2ee660406 Move SynchronizationContext to shared partition (dotnet/coreclr#22389)
* Move SynchronizationContext to shared partition

* Move WaitHelperNative to WaitHandle

Signed-off-by: dotnet-bot <[email protected]>
2019-02-05 10:20:12 +01:00
Vlad Brezae 63fc0ebdfa [interp] Add missing write barrier (#12772) 2019-02-05 09:30:33 +02:00
Jan Kotas 88a621524e More compact implementation of Marshal.GenerateProgIdForType (#22395)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-04 22:53:05 +01:00
Martin Baulig 721a437310 Remove internal WebRequest.RequestCallback to fix a compiler warning. 2019-02-04 22:52:38 +01:00
Jérôme Laban a95bbcb8e7 Fix lookup for all SourceLink mappings, prefer local file over SourceLink 2019-01-23 21:09:44 -05:00
Jérôme Laban 133088a437 Update GetScriptSource more async, show exception message. 2019-01-23 15:50:55 -05:00
Jérôme Laban 920074b55f Fix invalid csharp_space_between_method_declaration_name_and_open_parenthesis 2019-01-21 17:52:12 -05:00
Jérôme Laban 90234bd386 Reformat additions based on editor config file 2019-01-21 17:47:55 -05:00
Jérôme Laban bba2b18202 Adjust editor config based on https://www.mono-project.com/community/contributing/coding-guidelines/#style-guidelines 2019-01-21 17:47:09 -05:00
Jérôme Laban 4461e1e6a1 Adjust formatting, add .editorconfig 2019-01-21 12:50:50 -05:00
Jérôme Laban 78ef51b90a Add support for full document path
- Show the full file name in chrome source browser
- Fix support for duplicate file names in different paths
2019-01-21 11:26:12 -05:00
Jérôme Laban 4d4dc12932 Fix "Collection was modified" for pending operations 2019-01-21 11:26:12 -05:00
Jérôme Laban 91909b2b24 Fix NRE for unknown method token for some generated methods 2019-01-21 11:26:12 -05:00
Jérôme Laban 6160337c0f Fixed support for local urls 2019-01-21 11:26:12 -05:00
Jérôme Laban 49fddf283f Add support for mono pdbs, sourcelink 2019-01-21 11:26:12 -05:00
Jonathan Chambers 9de58a07c0 Don't try to access metadata for dynamic method added to non-dynamic image. Fixes issue #10201. 2018-08-20 16:51:18 -04:00
5987 changed files with 397935 additions and 329192 deletions

No files matched your search

+10 -4
View File
@@ -1,3 +1,6 @@
# diff settings
*.cs diff=csharp
# ensure LF endings on all checkouts
configure.ac crlf=input
config.rpath crlf=input
@@ -7,17 +10,20 @@ mkinstalldirs crlf=input
*.sources crlf=input
.gitattributes crlf=input
*akefile* crlf=input
m4/mono-output.m4 crlf=input
# ensure native line endings on checkout
*.c crlf
*.h crlf
*.cs crlf
*.il crlf
*.sln crlf
*.*proj* crlf
# don't do anything to line-endings. Let CRLFs go into the repo, and CRLF on checkout
*.bat -crlf
*.sln -crlf
*.*proj* -crlf
*.bat text eol=crlf
*.cmd text eol=crlf
# don't do anything to line-endings. Let CRLFs/LFs go into the repo, and CRLF/LFs on checkout
*.xml -crlf
# CRLF Handling
+90 -83
View File
@@ -10,20 +10,20 @@
# These owners will be the default owners for everything in the repo.
* @luhenry @marek-safar
* @marek-safar
# Order is important. The last matching pattern has the most precedence.
/acceptance-tests @akoeplinger @kg
/acceptance-tests/profiler-stress* @alexrp @akoeplinger
/acceptance-tests/profiler-stress* @BrzVlad @akoeplinger
/data @marek-safar @akoeplinger @luhenry
/data/gdb @vargaz @luhenry
/data/lldb @lewurm @vargaz
/data @directhex @akoeplinger
/data/gdb @vargaz
/data/lldb @vargaz
/docs @luhenry @marek-safar @akoeplinger
/docs/riscv.md @alexrp @lewurm
/docs/sources/mono-api-profiler.html @alexrp
/docs @marek-safar @akoeplinger
/docs/riscv.md @alexrp
/docs/sources/mono-api-profiler.html @BrzVlad
/external @akoeplinger @marek-safar
/external/api-snapshot @marek-safar @akoeplinger
@@ -31,125 +31,132 @@
/external/bockbuild @akoeplinger @alexischr
/external/boringssl @baulig
/external/cecil @marek-safar @akoeplinger
/external/corefx @akoeplinger @marek-safar @egorbo @alexischr
/external/corert @akoeplinger @marek-safar @egorbo @alexischr
/external/corefx @akoeplinger @marek-safar @egorbo @steveisok
/external/corert @akoeplinger @marek-safar @egorbo @steveisok
/external/linker @marek-safar
/external/llvm @luhenry @vargaz
/external/llvm-project @SamMonoRT @vargaz @imhameed
/external/nuget-buildtasks @radical @akoeplinger
/external/roslyn-binaries @kg @marek-safar @akoeplinger
/external/roslyn-binaries @kg @marek-safar @akoeplinger @lewing
/libgc @BrzVlad @vargaz @luhenry
/libgc @BrzVlad @vargaz @naricc
/llvm @vargaz @luhenry
/llvm @vargaz @SamMonoRT @imhameed
/man @marek-safar @miguel @luhenry
/man/*prof* @alexrp
/man @marek-safar @miguel
/man/*prof* @BrzVlad
/mcs @marek-safar @luhenry
/mcs @marek-safar @akoeplinger @egorbo
/mcs/build @marek-safar @akoeplinger
/mcs/class @marek-safar @akoeplinger
/mcs/class @steveisok @akoeplinger
/mcs/class/corlib/System.Reflection*/ @vargaz @lambdageek
/mcs/class/corlib/System.Security.Cryptography.X509Certificates @baulig @marek-safar
/mcs/class/Mono.Btls.Interface @bauligg @marek-safar
/mcs/class/corlib/System.Security.Cryptography.X509Certificates @baulig @steveisok
/mcs/class/Mono.Btls.Interface @baulig @steveisok
/mcs/class/Mono.Data.Tds @egorbo
/mcs/class/Mono.Debugger.Soft @vargaz @thaystg
/mcs/class/Mono.Options @jonpryor @marek-safar
/mcs/class/Mono.Profiler.Log @alexrp @luhenry
/mcs/class/Mono.Security/Mono.Security/Interface @baulig @marek-safar
/mcs/class/Mono.Profiler.Log @lambdageek
/mcs/class/Mono.Security/Mono.Security/Interface @baulig @steveisok
/mcs/class/System/Mono.AppleTls @baulig @rolf
/mcs/class/System/Mono.Btls @baulig @marek-safar
/mcs/class/System/Mono.Net.Security @baulig @marek-safar
/mcs/class/System/Mono.Security.Interface @baulig @marek-safar
/mcs/class/System/System.Security.Cryptography.X509Certificates @baulig @marek-safar
/mcs/class/System.Data* @egorbo @marek-safar
/mcs/class/System/Mono.Btls @baulig @marek-safar
/mcs/class/System/Mono.Net.Security @baulig @steveisok
/mcs/class/System/Mono.Security.Interface @baulig @steveisok
/mcs/class/System/System.Security.Cryptography.X509Certificates @baulig @steveisok
/mcs/class/System.Data* @egorbo @steveisok
/mcs/errors @marek-safar @lewurm
/mcs/ilasm @marek-safar @lewurm
/mcs/jay @marek-safar @lewurm
/mcs/mcs @marek-safar @lewurm
/mcs/tests @marek-safar @lewurm
/mcs/errors @marek-safar
/mcs/ilasm @marek-safar
/mcs/jay @marek-safar
/mcs/mcs @marek-safar
/mcs/tests @marek-safar
/mcs/tools @marek-safar @akoeplinger
/mcs/tools @marek-safar @akoeplinger @steveisok
/mcs/tools/gensources @kg @akoeplinger
/mcs/tools/resx2sr @baulig
/mcs/tools/upload-to-sentry @alexanderkyte @akoeplinger
/mcs/tools/upload-to-sentry @directhex @akoeplinger
/mono/arch @vargaz @lewurm
/mono/arch @vargaz
/mono/btls @baulig @luhenry @marek-safar
/mono/btls @baulig @marek-safar
/mono/dis @lambdageek @vargaz
/mono/eglib @vargaz @luhenry
/mono/eglib @vargaz @lambdageek
/mono/benchmark @alexanderkyte @luhenry
/mono/benchmark @SamMonoRT
/mono/metadata @vargaz @lambdageek
/mono/metadata/*verify* @lambdageek @luhenry
/mono/metadata/*profiler* @alexrp @luhenry
/mono/metadata/handle* @luhenry @lambdageek
/mono/metadata @vargaz @lambdageek @thaystg
/mono/metadata/*profiler* @lambdageek
/mono/metadata/handle* @lambdageek @vargaz
/mono/metadata/monitor* @brzvlad @vargaz
/mono/metadata/sgen* @brzvlad @vargaz
/mono/metadata/thread* @luhenry @lateralusX
/mono/metadata/w32* @luhenry @lateralusX
/mono/metadata/*-win* @lateralusX @luhenry @luhenry
/mono/metadata/sgen* @brzvlad @vargaz @naricc
/mono/metadata/thread* @lateralusX @lambdageek
/mono/metadata/w32* @lateralusX @lambdageek
/mono/metadata/*-win* @lateralusX @lambdageek
/mono/metadata/appdomain* @vargaz @lambdageek @CoffeeFlux
/mono/metadata/assembly* @vargaz @lambdageek @CoffeeFlux
/mono/metadata/domain* @vargaz @lambdageek @CoffeeFlux
/mono/metadata/loader* @vargaz @lambdageek @CoffeeFlux
/mono/metadata/native-library* @vargaz @lambdageek @CoffeeFlux
/mono/metadata/*-unix* @lambdageek @CoffeeFlux
/mono/mini @vargaz @lewurm
/mono/mini/*cfgdump* @lewurm @luhenry
/mono/mini/*exceptions* @lewurm @luhenry
/mono/mini @vargaz @lambdageek @SamMonoRT
/mono/mini/*cfgdump* @vargaz
/mono/mini/*exceptions* @vargaz @BrzVlad
/mono/mini/*ppc* @lewurm @vargaz
/mono/mini/*riscv* @alexrp @lewurm
/mono/mini/*type-check* @lewurm @lambdageek
/mono/mini/interp/* @lewurm @BrzVlad
/mono/mini/*profiler* @alexrp @luhenry
/mono/mini/debugger-agent.c @vargaz @thaystg @DavidKarlas
/mono/mini/*type-check* @lambdageek
/mono/mini/*llvm* @vargaz @imhameed
/mono/mini/interp/* @BrzVlad
/mono/mini/*profiler* @BrzVlad @lambdageek
/mono/mini/debugger-agent.c @vargaz @thaystg @DavidKarlas @lambdageek
/mono/native @baulig @luhenry @marek-safar
/mono/native @baulig @egorbo @alexischr @marek-safar
/mono/profiler @alexrp @luhenry
/mono/profiler @BrzVlad @lambdageek
/mono/sgen @BrzVlad @luhenry
/mono/sgen @BrzVlad @lambdageek
/mono/utils @vargaz @lewurm
/mono/utils/atomic* @lewurm @luhenry
/mono/utils/mono-hwcap* @lewurm @luhenry
/mono/utils/mono-mem* @lewurm @luhenry
/mono/utils/mono-threads* @luhenry @vargaz
/mono/utils/*-win* @lateralusX @luhenry
/mono/tools/offsets-tool @rolfbjarne
/msvc @lateralusX @luhenry
/msvc/*profiler* @alexrp @luhenry
/mono/utils @vargaz @lambdageek
/mono/utils/atomic* @vargaz
/mono/utils/mono-hwcap* @vargaz
/mono/utils/mono-mem* @vargaz
/mono/utils/mono-merp* @alexischr @lambdageek
/mono/utils/mono-state* @alexischr @lambdageek
/mono/utils/mono-threads* @lambdageek @vargaz
/mono/utils/*-win* @lateralusX @lambdageek
/msvc @lateralusX @kg @akoeplinger
/msvc/scripts @akoeplinger @kg
/netcore @marek-safar @akoeplinger @egorbo
/netcore @marek-safar @akoeplinger @egorbo @vargaz @steveisok
/packaging @alexischr @akoeplinger @luhenry @directhex
/packaging @alexischr @akoeplinger @directhex
/packaging/MacSDK/msbuild.py @radical @akoeplinger
/runtime @akoeplinger @marek-safar @luhenry
/runtime @akoeplinger @marek-safar
/samples @luhenry @lewurm
/samples/profiler @alexrp @luhenry
/samples/size @alexrp @luhenry
/samples @lambdageek
/samples/profiler @BrzVlad @lambdageek
/samples/size @alexrp @lambdageek
/scripts @akoeplinger @luhenry
/scripts/ci @akoeplinger @alexischr
/scripts @akoeplinger @directhex
/scripts/ci @akoeplinger @directhex
/sdks @marek-safar @luhenry @vargaz
/sdks/builds/android* @luhenry @jonpryor
/sdks/builds/mxe* @luhenry @jonpryor
/sdks @marek-safar @vargaz @lambdageek
/sdks/builds/android* @alexischr @jonpryor
/sdks/builds/mxe* @alexischr @jonpryor
/sdks/builds/ios* @vargaz @rolfbjarne
/sdks/builds/wasm* @vargaz @kjpou1 @lewing
/sdks/wasm @vargaz @kjpou1 @kg @lewing
/sdks/ios @vargaz @rolfbjarne
/sdks/android @luhenry @jonpryor
/sdks/android @alexischr @jonpryor
/support @luhenry @vargaz
/support @lambdageek @vargaz
/tools @luhenry @vargaz
/tools @lambdageek @vargaz
/tools/locale-builder @marek-safar @egorbo
/tools/monograph @vargaz @vargaz
/tools/nuget-hash-extractor @marek-safar @radical
/tools/offsets-tool @lewurm @rolfbjarne
/tools/pedump @lambdageek @lewurm
/tools/sgen @brzvlad @vargaz
/tools/nuget-hash-extractor @marek-safar @radical @akoeplinger
/tools/pedump @lambdageek
/tools/sgen @brzvlad @vargaz @naricc
+1 -1
View File
@@ -43,5 +43,5 @@ Please paste the stack trace here if available.
```
<!--
You can join us at https://gitter.im/mono/mono to discuss your reported issue
You can join us on Discord (https://aka.ms/dotnet-discord) in the #monovm channel to discuss your reported issue
-->
+14 -1
View File
@@ -18,13 +18,13 @@
*.vssscc
*_i.c
*_p.c
*.mdb
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.ilk
*.log
*.lib
*.sbr
*.sdf
@@ -129,9 +129,22 @@ docs/perlmod*
compile
mono.h
mono-*.tar.*
mono_crash*
tmpinst-dir.stamp
msvc/scripts/inputs/
extensions-config.h
*.dylib.dSYM
*.mlpd
llvm/build/
llvm/usr/
sdks/builds/llvm-*/
sdks/builds/android-*/
mcs/build/compiler-server.log
##############################################################################
# Arcade output directories
##############################################################################
.packages
artifacts
.dotnet
+7 -4
View File
@@ -58,13 +58,16 @@
[submodule "external/api-snapshot"]
path = external/api-snapshot
url = git://github.com/mono/api-snapshot.git
[submodule "external/llvm"]
path = external/llvm
url = git://github.com/mono/llvm.git
branch = release_60
[submodule "external/helix-binaries"]
path = external/helix-binaries
url = git://github.com/mono/helix-binaries.git
[submodule "external/illinker-test-assets"]
path = external/illinker-test-assets
url = git://github.com/mono/illinker-test-assets.git
[submodule "external/llvm-project"]
path = external/llvm-project
url = git://github.com/dotnet/llvm-project.git
branch = release/6.x
[submodule "external/bdwgc"]
path = external/bdwgc
url = git://github.com/Unity-Technologies/bdwgc.git
+7 -8
View File
@@ -3,11 +3,8 @@
{
"name": "Mac",
"includePath": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"${default}",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
@@ -17,11 +14,8 @@
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"${default}",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
@@ -31,6 +25,7 @@
"databaseFilename": ""
},
"macFrameworkPath": [
"${default}",
"/System/Library/Frameworks",
"/Library/Frameworks"
]
@@ -38,6 +33,7 @@
{
"name": "Linux",
"includePath": [
"${default}",
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
@@ -49,6 +45,7 @@
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"${default}",
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
@@ -63,6 +60,7 @@
{
"name": "Win32",
"includePath": [
"${default}",
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
@@ -76,6 +74,7 @@
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${default}",
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}",
"${workspaceRoot}/mono",
+1 -3
View File
@@ -28,8 +28,6 @@ Mono itself, and does not end up in the redistributable part of Mono:
* mcs/jay: 4-clause BSD licensed
* mcs/nunit24: MS-PL
* mcs/class/I18N/mklist.sh, tools/cvt.sh: GNU GPLv2
Runtime Code
@@ -78,7 +76,7 @@ The Licenses
These are the licenses used in Mono, the files are located:
### MIT X11 License
### MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
+18 -48
View File
@@ -2,32 +2,16 @@ ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = $(WERROR_CFLAGS)
MONOTOUCH_SUBDIRS = $(libgc_dir) mono
SUBDIRS = @MONO_SUBDIRS@
noinst_SUBDIRS = @MONO_NOINST_SUBDIRS@
DIST_SUBDIRS = $(SUBDIRS) m4 netcore
# Some tools might not build when cross-compiling
if CROSS_COMPILING
tools_dir =
else
tools_dir = tools
endif
if !ENABLE_NETCORE
if ENABLE_MSVC
build_with_msvc = msvc
build_without_msvc =
else
build_with_msvc =
build_without_msvc = msvc
endif
all: $(update_submodules)
SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests
# Keep in sync with SUBDIRS
DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests
all: update_submodules
SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
update_submodules:
@$(srcdir)/scripts/update_submodules.sh
@cd $(srcdir) && scripts/update_submodules.sh
.PHONY: update_submodules
@@ -40,9 +24,10 @@ EXTRA_DIST= \
winconfig.h \
code_of_conduct.md \
external \
netcore/Makefile \
mcs/class/referencesource
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false
# Distribute the 'mcs' tree too
GIT_DIR ?= $(srcdir)/.git
@@ -59,7 +44,10 @@ dist-hook:
rm -f `find $(top_distdir)/external -name '\.dirstamp'`
rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*' -not -path '*/helix-binaries/*'`
rm -rf "$(top_distdir)/external/linker/linker/Tests"
rm -rf "$(top_distdir)/external/linker/test"
rm -rf "$(top_distdir)/external/llvm-project/lldb/test"
rm -rf "$(top_distdir)/external/llvm-project/libcxx/test"
rm -rf "$(top_distdir)/external/llvm-project/clang/test"
pkgconfigdir = $(libdir)/pkgconfig
noinst_DATA = mono-uninstalled.pc
@@ -106,30 +94,10 @@ mcs-do-compiler-tests:
bootstrap-world: compiler-tests
$(MAKE) install
if INSTALL_MONOTOUCH
monotouch-do-build: config.h
@list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
case "x$$subdir" in \
xmono ) target="monotouch-do-build";; \
* ) target="all";; \
esac; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
done;
(cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
monotouch-do-clean:
@list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
case "x$$subdir" in \
xmono ) target="monotouch-do-clean";; \
* ) target="clean";; \
esac; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
done;
(cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
endif
install:
for mydir in $(filter-out $(noinst_SUBDIRS),$(SUBDIRS)); do \
(cd $${mydir} && ${MAKE} install) \
done
update-csproj:
-rm msvc/scripts/order
@@ -173,3 +141,5 @@ update-solution-files:
update-solution-files-with-tests:
$(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files
endif
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
+14 -7
View File
@@ -5,7 +5,13 @@ standards for C# and the Common Language Runtime.
The Mono project is part of the [.NET Foundation](https://www.dotnetfoundation.org/)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mono/mono?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Join us on [Discord](https://aka.ms/dotnet-discord) in the `#monovm` channel:
<a href="https://aka.ms/dotnet-discord">
<img src="https://img.shields.io/discord/732297728826277939?style=flat-square&label=Discord&logo=discord&logoColor=white&color=7289DA">
</a>
### Contents
1. [Compilation and Installation](#compilation-and-installation)
2. [Using Mono](#using-mono)
@@ -30,7 +36,8 @@ The Mono project is part of the [.NET Foundation](https://www.dotnetfoundation.o
| Windows | i386 | [![windows-i386][17]][18] |
| CentOS | s390x (cs) | [![centos-s390x][19]][20] |
| Debian 9 | ppc64el (cs) | [![debian-9-ppc64el][21]][22]|
| AIX | ppc64 (cs) | [![aix-ppc64][23]][24] |
| AIX 6.1 | ppc64 (cs) | [![aix-ppc64][23]][24] |
| FreeBSD 12 | amd64 (cs) | [![freebsd-amd64][25]][26] |
_(cs) = community supported architecture_
@@ -58,6 +65,8 @@ _(cs) = community supported architecture_
[22]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-9-ppc64el
[23]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=aix-ppc64/badge/icon
[24]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=aix-ppc64
[25]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=freebsd-12-amd64/badge/icon
[26]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=freebsd-12-amd64
Compilation and Installation
============================
@@ -306,6 +315,9 @@ faster under the Xen virtualization system.
* `--with-large-heap=yes,no` - Enable support for GC heaps larger than 3GB.
* This only applies only to the Boehm garbage collector, the SGen garbage
collector does not use this configuration option.
* This defaults to `no`.
* `--enable-small-config=yes,no` - Enable some tweaks to reduce memory usage
@@ -428,7 +440,6 @@ Disables compilation for the SSA optimization
framework, and the various SSA-based optimizations.
* `--enable-llvm`
* `--enable-loadedllvm`
* This enables the use of LLVM as a code generation engine
for Mono. The LLVM code generator and optimizer will be
@@ -441,10 +452,6 @@ full details and up-to-date information on this feature.
* You will need to have an LLVM built that Mono can link
against.
* The `--enable-loadedllvm` variant will make the LLVM backend
into a runtime-loadable module instead of linking it directly
into the main mono binary.
* `--enable-big-arrays` - Enable use of arrays with indexes larger
than Int32.MaxValue.
+185
View File
@@ -0,0 +1,185 @@
Mono uses third-party libraries or other resources that may be
distributed under licenses different than the Mono software.
Attributions and license notices for test cases originally authored by
third parties can be found in the respective test directories.
In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:
[email protected]
The attached notices are provided for information only.
License notice for Mono
-----------------------
Note: multiple license notices are provided that occure in source code.
They are equivalent forms of the the MIT license from various copyright holders.
// Dual licensed under the terms of the MIT X11 or GNU GPL
// Copyright 2003-2011 Novell, Inc.
// Copyright 2011 Xamarin Inc
/**
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
* Copyright (C) 2012 Xamarin Inc
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
/******************************************************************************
* The MIT License
* Copyright (c) 2003 Novell Inc. 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.
*******************************************************************************/
License notice for Apple
-------------------------
Content: https://github.com/mono/mono/blob/435f968102d0820ca65d63e1e741e4130b4d1303/support/ios/net/route.h
License: https://opensource.apple.com/apsl/
License for GCC
---------------
License: http://gcc.gnu.org/onlinedocs/gcc-4.6.4/libstdc++/manual/manual/license.html
Content: https://github.com/mono/mono/blob/c398e19d3515c6bbb6046ed014b2095594a15229/mono/mini
Example: https://github.com/mono/mono/blob/c398e19d3515c6bbb6046ed014b2095594a15229/mono/mini/decompose.c#L967
GCC RUNTIME LIBRARY EXCEPTION
Version 3.1, 31 March 2009
Copyright (C) 2009 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
This GCC Runtime Library Exception ("Exception") is an additional
permission under section 7 of the GNU General Public License, version
3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
bears a notice placed by the copyright holder of the file stating that
the file is governed by GPLv3 along with this Exception.
When you use GCC to compile a program, GCC may combine portions of
certain GCC header files and runtime libraries with the compiled
program. The purpose of this Exception is to allow compilation of
non-GPL (including proprietary) programs to use, in this way, the
header files and runtime libraries covered by this Exception.
0. Definitions.
A file is an "Independent Module" if it either requires the Runtime
Library for execution after a Compilation Process, or makes use of an
interface provided by the Runtime Library, but is not otherwise based
on the Runtime Library.
"GCC" means a version of the GNU Compiler Collection, with or without
modifications, governed by version 3 (or a specified later version) of
the GNU General Public License (GPL) with the option of using any
subsequent versions published by the FSF.
"GPL-compatible Software" is software whose conditions of propagation,
modification and use would permit combination with GCC in accord with
the license of GCC.
"Target Code" refers to output from any compiler for a real or virtual
target processor architecture, in executable form or suitable for
input to an assembler, loader, linker and/or execution
phase. Notwithstanding that, Target Code does not include data in any
format that is used as a compiler intermediate representation, or used
for producing a compiler intermediate representation.
The "Compilation Process" transforms code entirely represented in
non-intermediate languages designed for human-written code, and/or in
Java Virtual Machine byte code, into Target Code. Thus, for example,
use of source code generators and preprocessors need not be considered
part of the Compilation Process, since the Compilation Process can be
understood as starting with the output of the generators or
preprocessors.
A Compilation Process is "Eligible" if it is done using GCC, alone or
with other GPL-compatible software, or if it is done without using any
work based on GCC. For example, using non-GPL-compatible Software to
optimize any GCC intermediate representations would not qualify as an
Eligible Compilation Process.
1. Grant of Additional Permission.
You have permission to propagate a work of Target Code formed by
combining the Runtime Library with Independent Modules, even if such
propagation would otherwise violate the terms of GPLv3, provided that
all Target Code was generated by Eligible Compilation Processes. You
may then convey such a combination under terms of your choice,
consistent with the licensing of the Independent Modules.
2. No Weakening of GCC Copyleft.
The availability of this Exception does not imply any general
presumption that third-party software is unaffected by the copyleft
requirements of the license of GCC.
Hopefully that text is self-explanatory. If it isn't, you need to speak to your lawyer, or the Free Software Foundation.
License notice for Silicon Graphics and HP
------------------------------------------
/*
* Copyright (c) 1996-1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Copyright (c) 2002
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
/*
* This implements standard-conforming allocators that interact with
* the garbage collector. Gc_alloctor<T> allocates garbage-collectable
* objects of type T. Traceable_allocator<T> allocates objects that
* are not temselves garbage collected, but are scanned by the
* collector for pointers to collectable objects. Traceable_alloc
* should be used for explicitly managed STL containers that may
* point to collectable objects.
*
* This code was derived from an earlier version of the GNU C++ standard
* library, which itself was derived from the SGI STL implementation.
*/
Content: https://github.com/mono/mono/blob/d58dfa185af1d48fb93efdef1d046762f214f0a7/libgc/include/gc_allocator.h
+2 -2
View File
@@ -2,7 +2,7 @@
{
"name": "roslyn",
"url": "git://github.com/mono/roslyn.git",
"rev": "7a840bd5697ef6ea41f554a09d837636fba9d88d",
"rev": "6bfcd4e770609a38b8523e83ce1ec943162f30bb",
"remote-branch": "origin/mono-testing",
"branch": "mono-testing",
"directory": "roslyn"
@@ -10,7 +10,7 @@
{
"name": "coreclr",
"url": "git://github.com/mono/coreclr.git",
"rev": "1e8d7a94155a04a6556a7ae9ef8dc5841b3ab206",
"rev": "90f7060935732bb624e1f325d23f63072433725f",
"remote-branch": "origin/mono",
"branch": "mono",
"directory": "coreclr"
+2
View File
@@ -1,4 +1,6 @@
check-roslyn:
@echo "Runnning roslyn tests using mono from PATH:"
mono --version
@$(MAKE) validate-roslyn RESET_VERSIONS=1
cd $(ROSLYN_PATH); \
./build.sh --restore --build --test --mono || exit; \
+31 -10
View File
@@ -104,12 +104,10 @@ if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
fi
fi
#
# Plug in the extension module
#
# Parse parameters
has_ext_mod=false
ext_mod_args=''
has_disable_boehm=false
for PARAM; do
if [[ $PARAM =~ "--enable-extension-module" ]] ; then
has_ext_mod=true
@@ -117,10 +115,16 @@ for PARAM; do
ext_mod_args=`echo $PARAM | cut -d= -f2`
fi
fi
if [[ $PARAM =~ "--disable-boehm" ]] ; then
has_disable_boehm=true
fi
done
#
# Plug in the extension module
#
if test x$has_ext_mod = xtrue; then
pushd ../mono-extensions/scripts
pushd $top_srcdir../mono-extensions/scripts
sh ./prepare-repo.sh $ext_mod_args || exit 1
popd
else
@@ -150,17 +154,34 @@ automake $am_opt ||
echo "Running autoconf ..."
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
if test -d $srcdir/libgc; then
echo Running libgc/autogen.sh ...
(cd $srcdir/libgc ; NOCONFIGURE=1 ./autogen.sh "$@")
echo Done running libgc/autogen.sh ...
# Update all submodules recursively to ensure everything is checked out
if test -e $srcdir/scripts/update_submodules.sh; then
(cd $srcdir && scripts/update_submodules.sh)
fi
if test x$has_disable_boehm = xfalse -a -d $srcdir/external/bdwgc; then
echo Running external/bdwgc/autogen.sh ...
(cd $srcdir/external/bdwgc ; NOCONFIGURE=1 ./autogen.sh "$@")
echo Done running external/bdwgc/autogen.sh ...
fi
if test x$MONO_EXTRA_CONFIGURE_FLAGS != x; then
echo "MONO_EXTRA_CONFIGURE_FLAGS is $MONO_EXTRA_CONFIGURE_FLAGS"
fi
conf_flags="$MONO_EXTRA_CONFIGURE_FLAGS --enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
host_conf_flag=
build_uname_all=`(uname -a) 2>/dev/null`
case "$build_uname_all" in
CYGWIN*)
if [[ "$@" != *"--host="* ]]; then
echo "Missing --host parameter, configure using ./configure --host=i686-w64-mingw32 or --host=x86_64-w64-mingw32"
echo "Falling back using --host=x86_64-w64-mingw32 as default."
host_conf_flag="--host=x86_64-w64-mingw32"
fi
;;
esac
conf_flags="$MONO_EXTRA_CONFIGURE_FLAGS --enable-maintainer-mode --enable-compile-warnings $host_conf_flag" #--enable-iso-c
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
+104 -320
View File
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
MinimumVisualStudioVersion = 15.0.0.0
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jay", "mcs/jay/jay.vcxproj", "{5d485d32-3b9f-4287-ab24-c8da5b89f537}"
EndProject
@@ -570,28 +570,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Drawing.Prim
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Net.Http.Rtc", "mcs/class/Facades/System.Net.Http.Rtc/Facades_System.Net.Http.Rtc.csproj", "{786AAD60-DBEA-4F9B-BF1B-C3486CE000D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUnit.Framework", "mcs/nunit24/NUnitFramework/framework/NUnit.Framework.csproj", "{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core.interfaces", "mcs/nunit24/NUnitCore/interfaces/nunit.core.interfaces.csproj", "{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core", "mcs/nunit24/NUnitCore/core/nunit.core.csproj", "{559F5BCC-3235-494A-9D86-4F26F67F9E40}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.util", "mcs/nunit24/ClientUtilities/util/nunit.util.csproj", "{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.mocks", "mcs/nunit24/NUnitMocks/mocks/nunit.mocks.csproj", "{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.extensions", "mcs/nunit24/NUnitExtensions/framework/nunit.framework.extensions.csproj", "{DFE253AA-843E-4374-B862-9F0B7414CB8C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core.extensions", "mcs/nunit24/NUnitExtensions/core/nunit.core.extensions.csproj", "{6464D30A-2B8E-458D-B96A-2ECDE947B58B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-console-runner", "mcs/nunit24/ConsoleRunner/nunit-console/nunit-console-runner.csproj", "{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-console", "mcs/nunit24/ConsoleRunner/nunit-console-exe/nunit-console.csproj", "{2D845BF5-42C7-41D3-AC01-F63980F76B22}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ilasm", "mcs/ilasm/ilasm.csproj", "{C02B3C37-DB98-40A5-84F0-F98633DA7EE4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "al", "mcs/tools/al/al.csproj", "{0A20671F-CCA9-457D-886C-0828C7D64128}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aprofutil", "mcs/tools/aprofutil/aprofutil.csproj", "{658B566B-CED1-4C42-9926-C1AA930BA368}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "monolinker", "mcs/tools/linker/monolinker.csproj", "{D60432F1-3C12-4235-A1CC-4CA5575403BD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "culevel", "mcs/tools/culevel/culevel.csproj", "{E8E246BD-CD0C-4734-A3C2-7F44796EC47B}"
@@ -1126,22 +1110,14 @@ Global
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|orbis.ActiveCfg = Debug|orbis
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|orbis.Build.0 = Debug|orbis
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|orbis.ActiveCfg = Release|orbis
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|orbis.Build.0 = Release|orbis
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|unreal.ActiveCfg = Debug|unreal
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|unreal.Build.0 = Debug|unreal
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|unreal.ActiveCfg = Release|unreal
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|unreal.Build.0 = Release|unreal
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|wasm.ActiveCfg = Debug|wasm
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|wasm.Build.0 = Debug|wasm
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|wasm.ActiveCfg = Release|wasm
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|wasm.Build.0 = Release|wasm
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|winaot.ActiveCfg = Debug|winaot
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|winaot.Build.0 = Debug|winaot
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|winaot.ActiveCfg = Release|winaot
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|winaot.Build.0 = Release|winaot
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|orbis.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|orbis.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|unreal.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|unreal.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|wasm.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|wasm.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|winaot.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|winaot.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|xammac.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|xammac.ActiveCfg = Release|net_4_x
{4900DA48-CB1B-4520-98EE-F6B0F3054341}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
@@ -1560,10 +1536,8 @@ Global
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|unreal.Build.0 = Debug|unreal
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|unreal.ActiveCfg = Release|unreal
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|unreal.Build.0 = Release|unreal
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|wasm.ActiveCfg = Debug|wasm
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|wasm.Build.0 = Debug|wasm
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|wasm.ActiveCfg = Release|wasm
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|wasm.Build.0 = Release|wasm
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|wasm.ActiveCfg = Debug|net_4_x
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|wasm.ActiveCfg = Release|net_4_x
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|winaot.ActiveCfg = Debug|winaot
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|winaot.Build.0 = Debug|winaot
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|winaot.ActiveCfg = Release|winaot
@@ -1688,10 +1662,8 @@ Global
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|unreal.Build.0 = Debug|unreal
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|unreal.ActiveCfg = Release|unreal
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|unreal.Build.0 = Release|unreal
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|wasm.ActiveCfg = Debug|wasm
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|wasm.Build.0 = Debug|wasm
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|wasm.ActiveCfg = Release|wasm
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|wasm.Build.0 = Release|wasm
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|wasm.ActiveCfg = Release|net_4_x
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|winaot.ActiveCfg = Debug|winaot
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|winaot.Build.0 = Debug|winaot
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|winaot.ActiveCfg = Release|winaot
@@ -2238,10 +2210,8 @@ Global
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|unreal.Build.0 = Debug|unreal
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|unreal.ActiveCfg = Release|unreal
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|unreal.Build.0 = Release|unreal
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|wasm.ActiveCfg = Debug|wasm
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|wasm.Build.0 = Debug|wasm
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|wasm.ActiveCfg = Release|wasm
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|wasm.Build.0 = Release|wasm
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|wasm.ActiveCfg = Debug|net_4_x
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|wasm.ActiveCfg = Release|net_4_x
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|winaot.ActiveCfg = Debug|winaot
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|winaot.Build.0 = Debug|winaot
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|winaot.ActiveCfg = Release|winaot
@@ -2300,10 +2270,8 @@ Global
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|unreal.Build.0 = Debug|unreal
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|unreal.ActiveCfg = Release|unreal
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|unreal.Build.0 = Release|unreal
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|wasm.ActiveCfg = Debug|wasm
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|wasm.Build.0 = Debug|wasm
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|wasm.ActiveCfg = Release|wasm
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|wasm.Build.0 = Release|wasm
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|wasm.ActiveCfg = Debug|net_4_x
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|wasm.ActiveCfg = Release|net_4_x
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|winaot.ActiveCfg = Debug|winaot
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|winaot.Build.0 = Debug|winaot
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|winaot.ActiveCfg = Release|winaot
@@ -2406,10 +2374,8 @@ Global
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|unreal.Build.0 = Debug|unreal
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|unreal.ActiveCfg = Release|unreal
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|unreal.Build.0 = Release|unreal
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|wasm.ActiveCfg = Debug|wasm
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|wasm.Build.0 = Debug|wasm
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|wasm.ActiveCfg = Release|wasm
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|wasm.Build.0 = Release|wasm
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|wasm.ActiveCfg = Debug|net_4_x
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|wasm.ActiveCfg = Release|net_4_x
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|winaot.ActiveCfg = Debug|winaot
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|winaot.Build.0 = Debug|winaot
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|winaot.ActiveCfg = Release|winaot
@@ -2600,10 +2566,8 @@ Global
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|unreal.Build.0 = Debug|unreal
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|unreal.ActiveCfg = Release|unreal
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|unreal.Build.0 = Release|unreal
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|wasm.ActiveCfg = Debug|wasm
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|wasm.Build.0 = Debug|wasm
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|wasm.ActiveCfg = Release|wasm
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|wasm.Build.0 = Release|wasm
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|wasm.ActiveCfg = Debug|net_4_x
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|wasm.ActiveCfg = Release|net_4_x
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|winaot.ActiveCfg = Debug|winaot
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|winaot.Build.0 = Debug|winaot
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|winaot.ActiveCfg = Release|winaot
@@ -3668,10 +3632,8 @@ Global
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|unreal.Build.0 = Debug|unreal
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|unreal.ActiveCfg = Release|unreal
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|unreal.Build.0 = Release|unreal
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|wasm.ActiveCfg = Debug|wasm
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|wasm.Build.0 = Debug|wasm
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|wasm.ActiveCfg = Release|wasm
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|wasm.Build.0 = Release|wasm
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|wasm.ActiveCfg = Debug|net_4_x
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|wasm.ActiveCfg = Release|net_4_x
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|winaot.ActiveCfg = Debug|winaot
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|winaot.Build.0 = Debug|winaot
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|winaot.ActiveCfg = Release|winaot
@@ -3994,10 +3956,8 @@ Global
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|unreal.Build.0 = Debug|unreal
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|unreal.ActiveCfg = Release|unreal
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|unreal.Build.0 = Release|unreal
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|wasm.ActiveCfg = Debug|wasm
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|wasm.Build.0 = Debug|wasm
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|wasm.ActiveCfg = Release|wasm
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|wasm.Build.0 = Release|wasm
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|wasm.ActiveCfg = Debug|net_4_x
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|wasm.ActiveCfg = Release|net_4_x
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|winaot.ActiveCfg = Debug|winaot
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|winaot.Build.0 = Debug|winaot
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|winaot.ActiveCfg = Release|winaot
@@ -4054,24 +4014,42 @@ Global
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|net_4_x.Build.0 = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|net_4_x.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|net_4_x.Build.0 = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monodroid.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|orbis.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|orbis.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|unreal.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|unreal.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|wasm.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|wasm.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|winaot.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|winaot.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|xammac.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|xammac.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monodroid.ActiveCfg = Debug|monodroid
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monodroid.Build.0 = Debug|monodroid
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monodroid.ActiveCfg = Release|monodroid
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monodroid.Build.0 = Release|monodroid
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch.ActiveCfg = Debug|monotouch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch.Build.0 = Debug|monotouch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch.ActiveCfg = Release|monotouch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch.Build.0 = Release|monotouch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_tv.ActiveCfg = Debug|monotouch_tv
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_tv.Build.0 = Debug|monotouch_tv
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_tv.ActiveCfg = Release|monotouch_tv
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_tv.Build.0 = Release|monotouch_tv
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_watch.ActiveCfg = Debug|monotouch_watch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_watch.Build.0 = Debug|monotouch_watch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_watch.ActiveCfg = Release|monotouch_watch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_watch.Build.0 = Release|monotouch_watch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|orbis.ActiveCfg = Debug|orbis
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|orbis.Build.0 = Debug|orbis
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|orbis.ActiveCfg = Release|orbis
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|orbis.Build.0 = Release|orbis
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|unreal.ActiveCfg = Debug|unreal
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|unreal.Build.0 = Debug|unreal
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|unreal.ActiveCfg = Release|unreal
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|unreal.Build.0 = Release|unreal
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|wasm.ActiveCfg = Debug|wasm
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|wasm.Build.0 = Debug|wasm
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|wasm.ActiveCfg = Release|wasm
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|wasm.Build.0 = Release|wasm
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|winaot.ActiveCfg = Debug|winaot
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|winaot.Build.0 = Debug|winaot
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|winaot.ActiveCfg = Release|winaot
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|winaot.Build.0 = Release|winaot
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|xammac.ActiveCfg = Debug|xammac
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|xammac.Build.0 = Debug|xammac
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|xammac.ActiveCfg = Release|xammac
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|xammac.Build.0 = Release|xammac
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|net_4_x.Build.0 = Debug|net_4_x
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|net_4_x.ActiveCfg = Release|net_4_x
@@ -4100,10 +4078,8 @@ Global
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|unreal.Build.0 = Debug|unreal
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|unreal.ActiveCfg = Release|unreal
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|unreal.Build.0 = Release|unreal
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|wasm.ActiveCfg = Debug|wasm
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|wasm.Build.0 = Debug|wasm
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|wasm.ActiveCfg = Release|wasm
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|wasm.Build.0 = Release|wasm
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|wasm.ActiveCfg = Release|net_4_x
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|winaot.ActiveCfg = Debug|winaot
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|winaot.Build.0 = Debug|winaot
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|winaot.ActiveCfg = Release|winaot
@@ -4224,10 +4200,8 @@ Global
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|unreal.Build.0 = Debug|unreal
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|unreal.ActiveCfg = Release|unreal
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|unreal.Build.0 = Release|unreal
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|wasm.ActiveCfg = Debug|wasm
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|wasm.Build.0 = Debug|wasm
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|wasm.ActiveCfg = Release|wasm
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|wasm.Build.0 = Release|wasm
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|wasm.ActiveCfg = Release|net_4_x
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|winaot.ActiveCfg = Debug|winaot
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|winaot.Build.0 = Debug|winaot
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|winaot.ActiveCfg = Release|winaot
@@ -4264,10 +4238,8 @@ Global
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|unreal.Build.0 = Debug|unreal
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|unreal.ActiveCfg = Release|unreal
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|unreal.Build.0 = Release|unreal
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|wasm.ActiveCfg = Debug|wasm
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|wasm.Build.0 = Debug|wasm
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|wasm.ActiveCfg = Release|wasm
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|wasm.Build.0 = Release|wasm
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|wasm.ActiveCfg = Debug|net_4_x
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|wasm.ActiveCfg = Release|net_4_x
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|winaot.ActiveCfg = Debug|winaot
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|winaot.Build.0 = Debug|winaot
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|winaot.ActiveCfg = Release|winaot
@@ -4524,10 +4496,8 @@ Global
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|unreal.Build.0 = Debug|unreal
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|unreal.ActiveCfg = Release|unreal
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|unreal.Build.0 = Release|unreal
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|wasm.ActiveCfg = Debug|wasm
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|wasm.Build.0 = Debug|wasm
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|wasm.ActiveCfg = Release|wasm
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|wasm.Build.0 = Release|wasm
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|wasm.ActiveCfg = Debug|net_4_x
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|wasm.ActiveCfg = Release|net_4_x
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|winaot.ActiveCfg = Debug|winaot
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|winaot.Build.0 = Debug|winaot
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|winaot.ActiveCfg = Release|winaot
@@ -6042,10 +6012,8 @@ Global
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|unreal.Build.0 = Debug|unreal
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|unreal.ActiveCfg = Release|unreal
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|unreal.Build.0 = Release|unreal
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|wasm.ActiveCfg = Debug|wasm
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|wasm.Build.0 = Debug|wasm
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|wasm.ActiveCfg = Release|wasm
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|wasm.Build.0 = Release|wasm
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|wasm.ActiveCfg = Release|net_4_x
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|winaot.ActiveCfg = Debug|winaot
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|winaot.Build.0 = Debug|winaot
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|winaot.ActiveCfg = Release|winaot
@@ -6082,10 +6050,8 @@ Global
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|unreal.Build.0 = Debug|unreal
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|unreal.ActiveCfg = Release|unreal
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|unreal.Build.0 = Release|unreal
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|wasm.ActiveCfg = Debug|wasm
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|wasm.Build.0 = Debug|wasm
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|wasm.ActiveCfg = Release|wasm
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|wasm.Build.0 = Release|wasm
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|wasm.ActiveCfg = Debug|net_4_x
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|wasm.ActiveCfg = Release|net_4_x
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|winaot.ActiveCfg = Debug|winaot
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|winaot.Build.0 = Debug|winaot
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|winaot.ActiveCfg = Release|winaot
@@ -6562,10 +6528,8 @@ Global
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|unreal.Build.0 = Debug|unreal
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|unreal.ActiveCfg = Release|unreal
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|unreal.Build.0 = Release|unreal
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|wasm.ActiveCfg = Debug|wasm
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|wasm.Build.0 = Debug|wasm
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|wasm.ActiveCfg = Release|wasm
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|wasm.Build.0 = Release|wasm
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|wasm.ActiveCfg = Release|net_4_x
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|winaot.ActiveCfg = Debug|winaot
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|winaot.Build.0 = Debug|winaot
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|winaot.ActiveCfg = Release|winaot
@@ -6602,10 +6566,8 @@ Global
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|unreal.Build.0 = Debug|unreal
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|unreal.ActiveCfg = Release|unreal
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|unreal.Build.0 = Release|unreal
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|wasm.ActiveCfg = Debug|wasm
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|wasm.Build.0 = Debug|wasm
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|wasm.ActiveCfg = Release|wasm
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|wasm.Build.0 = Release|wasm
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|wasm.ActiveCfg = Release|net_4_x
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|winaot.ActiveCfg = Debug|winaot
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|winaot.Build.0 = Debug|winaot
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|winaot.ActiveCfg = Release|winaot
@@ -9882,10 +9844,8 @@ Global
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|unreal.Build.0 = Debug|unreal
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|unreal.ActiveCfg = Release|unreal
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|unreal.Build.0 = Release|unreal
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|wasm.ActiveCfg = Debug|wasm
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|wasm.Build.0 = Debug|wasm
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|wasm.ActiveCfg = Release|wasm
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|wasm.Build.0 = Release|wasm
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|wasm.ActiveCfg = Debug|net_4_x
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|wasm.ActiveCfg = Release|net_4_x
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|winaot.ActiveCfg = Debug|winaot
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|winaot.Build.0 = Debug|winaot
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|winaot.ActiveCfg = Release|winaot
@@ -10116,204 +10076,6 @@ Global
{786AAD60-DBEA-4F9B-BF1B-C3486CE000D0}.Release|winaot.ActiveCfg = Release|net_4_x
{786AAD60-DBEA-4F9B-BF1B-C3486CE000D0}.Debug|xammac.ActiveCfg = Debug|net_4_x
{786AAD60-DBEA-4F9B-BF1B-C3486CE000D0}.Release|xammac.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|net_4_x.Build.0 = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|net_4_x.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|net_4_x.Build.0 = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|monodroid.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|monotouch.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|orbis.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|orbis.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|unreal.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|unreal.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|wasm.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|wasm.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|winaot.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|winaot.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|xammac.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|xammac.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|net_4_x.Build.0 = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|net_4_x.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|net_4_x.Build.0 = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|monodroid.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|monotouch.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|orbis.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|orbis.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|unreal.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|unreal.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|wasm.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|wasm.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|winaot.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|winaot.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|xammac.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|xammac.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|net_4_x.Build.0 = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|net_4_x.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|net_4_x.Build.0 = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|monodroid.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|monotouch.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|orbis.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|orbis.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|unreal.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|unreal.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|wasm.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|wasm.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|winaot.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|winaot.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|xammac.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|xammac.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|net_4_x.Build.0 = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|net_4_x.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|net_4_x.Build.0 = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|monodroid.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|monotouch.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|orbis.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|orbis.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|unreal.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|unreal.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|wasm.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|wasm.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|winaot.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|winaot.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|xammac.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|xammac.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|net_4_x.Build.0 = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|net_4_x.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|net_4_x.Build.0 = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|monodroid.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|monotouch.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|orbis.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|orbis.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|unreal.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|unreal.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|wasm.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|wasm.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|winaot.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|winaot.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|xammac.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|xammac.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|net_4_x.Build.0 = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|net_4_x.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|net_4_x.Build.0 = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|monodroid.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|monotouch.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|orbis.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|orbis.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|unreal.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|unreal.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|wasm.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|wasm.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|winaot.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|winaot.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|xammac.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|xammac.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|net_4_x.Build.0 = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|net_4_x.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|net_4_x.Build.0 = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|monodroid.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|monotouch.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|orbis.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|orbis.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|unreal.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|unreal.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|wasm.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|wasm.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|winaot.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|winaot.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|xammac.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|xammac.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|net_4_x.Build.0 = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|net_4_x.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|net_4_x.Build.0 = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|monodroid.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|monotouch.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|orbis.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|orbis.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|unreal.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|unreal.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|wasm.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|wasm.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|winaot.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|winaot.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|xammac.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|xammac.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|net_4_x.Build.0 = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|net_4_x.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|net_4_x.Build.0 = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|monodroid.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|monotouch.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|orbis.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|orbis.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|unreal.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|unreal.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|wasm.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|wasm.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|winaot.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|winaot.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|xammac.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|xammac.ActiveCfg = Release|net_4_x
{C02B3C37-DB98-40A5-84F0-F98633DA7EE4}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{C02B3C37-DB98-40A5-84F0-F98633DA7EE4}.Debug|net_4_x.Build.0 = Debug|net_4_x
{C02B3C37-DB98-40A5-84F0-F98633DA7EE4}.Release|net_4_x.ActiveCfg = Release|net_4_x
@@ -10358,6 +10120,28 @@ Global
{0A20671F-CCA9-457D-886C-0828C7D64128}.Release|winaot.ActiveCfg = Release|net_4_x
{0A20671F-CCA9-457D-886C-0828C7D64128}.Debug|xammac.ActiveCfg = Debug|net_4_x
{0A20671F-CCA9-457D-886C-0828C7D64128}.Release|xammac.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|net_4_x.Build.0 = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|net_4_x.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|net_4_x.Build.0 = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|monodroid.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|monotouch.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|orbis.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|orbis.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|unreal.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|unreal.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|wasm.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|wasm.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|winaot.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|winaot.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|xammac.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|xammac.ActiveCfg = Release|net_4_x
{D60432F1-3C12-4235-A1CC-4CA5575403BD}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{D60432F1-3C12-4235-A1CC-4CA5575403BD}.Debug|net_4_x.Build.0 = Debug|net_4_x
{D60432F1-3C12-4235-A1CC-4CA5575403BD}.Release|net_4_x.ActiveCfg = Release|net_4_x
+4 -48
View File
@@ -1,50 +1,6 @@
# Contributor Code of Conduct
# Code of Conduct
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
This project has adopted the code of conduct defined by the Contributor Covenant
to clarify expected behavior in our community.
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at miguel@xamarin.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
+1345 -645
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -7,7 +7,7 @@ EXTRA_DIST = \
config.in \
browscap.ini mono.supp mono.d README \
mono.pc.in mono-2.pc.in monosgen-2.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in \
mono-cairo.pc.in mono-options.pc.in cecil.pc.in \
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
dtrace-prelink.sh system.web.mvc.pc.in system.web.mvc2.pc.in system.web.mvc3.pc.in aspnetwebstack.pc.in \
reactive.pc.in xbuild12.pc \
@@ -25,10 +25,10 @@ else
SGENPCFILE=
endif
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc $(SGENPCFILE) mono-sgen-gdb.py
mono_DATA = config \
+1 -1
View File
@@ -6,7 +6,7 @@
<dllmap dll="libintl" name="bind_textdomain_codeset" target="@LIBC@" os="solaris"/>
<dllmap dll="libintl" target="@INTL@" os="!windows"/>
<dllmap dll="i:libxslt.dll" target="libxslt@libsuffix@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="libodbc@libsuffix@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="@ODBC@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="libiodbc.dylib" os="osx"/>
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
Regular → Executable
View File
File mode changed.
+13 -13
View File
@@ -1,8 +1,9 @@
import lldb
import traceback
def print_frames(thread, num_frames, current_thread):
# TODO: Make output header similar to bt.
print '%c thread #%i' % ('*' if current_thread else ' ', thread.idx)
print('%c thread #%i' % ('*' if current_thread else ' ', thread.idx))
if current_thread:
selected_frame = thread.GetSelectedFrame()
@@ -14,17 +15,16 @@ def print_frames(thread, num_frames, current_thread):
if function_name == "interp_exec_method_full":
try:
s = 'frame->imethod->method'
klassname = frame.EvaluateExpression('(char*) ' + s + '->klass->name').summary[1:-1]
methodname = frame.EvaluateExpression('(char*) ' + s + '->name').summary[1:-1]
methoddesc = frame.EvaluateExpression('(char*) mono_method_full_name (' + s + ', 1)').summary[1:-1]
ipoffset = frame.EvaluateExpression('ip').GetValueAsUnsigned()
insn = ''
if ipoffset != 0:
ipoffset -= frame.EvaluateExpression('rtm->code').GetValueAsUnsigned()
insn = "\"" + frame.EvaluateExpression('mono_interp_opname [*ip]').summary[1:-1] + "\""
var = '%s::%s @ %d %s || %s' % (klassname, methodname, ipoffset, insn, frame)
ipoffset -= frame.EvaluateExpression('frame->imethod->code').GetValueAsUnsigned()
insn = "\"" + frame.EvaluateExpression('mono_interp_opname (*ip)').summary[1:-1] + "\""
var = '%s @ %d %s || %s' % (methoddesc, ipoffset, insn, frame)
except Exception as e:
print "DBG: execfail:" + str(e)
traceback.print_exc()
elif function_name == "mono_interp_transform_method":
try:
s = 'runtime_method->method'
@@ -32,7 +32,7 @@ def print_frames(thread, num_frames, current_thread):
methodname = frame.EvaluateExpression('(char*) ' + s + '->name').summary[1:-1]
var = 'transforming %s::%s || %s' % (klassname, methodname, frame)
except Exception as e:
print "DBG: transformfail:" + str(e)
print("DBG: transformfail:" + str(e))
elif pc[0] == '0':
try:
framestr = frame.EvaluateExpression('(char*)mono_pmip((void*)%s)' % pc).summary[1:-1]
@@ -40,7 +40,7 @@ def print_frames(thread, num_frames, current_thread):
except:
pass
print ' %c %s' % ('*' if current_thread and frame.idx == selected_frame.idx else ' ', var)
print(' %c %s' % ('*' if current_thread and frame.idx == selected_frame.idx else ' ', var))
def monobt(debugger, command, result, dict):
opts = {'all_bt': False, 'num_frames': None}
@@ -50,20 +50,20 @@ def monobt(debugger, command, result, dict):
elif command.isdigit():
opts['num_frames'] = int(command)
elif command != '':
print 'error: monobt [<number>|all]'
print('error: monobt [<number>|all]')
return
target = debugger.GetSelectedTarget()
process = target.process
if not process.IsValid():
print 'error: invalid process'
print('error: invalid process')
return
if opts['all_bt']:
for thread in process.threads:
print_frames(thread, len(thread), process.selected_thread == thread)
print ''
print('')
else:
thread = process.selected_thread
num_frames = len(thread) if opts['num_frames'] is None else opts['num_frames']
@@ -76,4 +76,4 @@ def __lldb_init_module (debugger, dict):
# Add any commands contained in this module to LLDB
debugger.HandleCommand('command script add -f monobt.monobt monobt')
debugger.HandleCommand('command alias mbt monobt')
print '"monobt" command installed'
print('"monobt" command installed')
-9
View File
@@ -1,9 +0,0 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
Name: Mono NUnit
Description: Mono's version of NUnit
Version: @VERSION@
Libs: -r:${libdir}/mono/4.5/nunit.core.dll -r:${libdir}/mono/4.5/nunit.core.interfaces.dll -r:${libdir}/mono/4.5/nunit.core.extensions.dll -r:${libdir}/mono/4.5/nunit.framework.dll -r:${libdir}/mono/4.5/nunit.framework.extensions.dll -r:${libdir}/mono/4.5/nunit.mocks.dll -r:${libdir}/mono/4.5/nunit.util.dll -r:${libdir}/mono/4.5/nunit-console-runner.dll
-2
View File
@@ -237,8 +237,6 @@
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- NUnit broken key -->
<map Token="96d09a1eb7f44a77" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- XNA Framework key -->
<map Token="6d5c3888ef60e27d" PublicKey="0024000004800000940000000602000000240000525341310004000001000100f9a2641bac9847900d92a33d652ccc4e8b529360f908e7af53e57008b2a9a1938c32a160d47f795a23590557608d2c8d0c0e8846a052d070f9298281b8185343dbe5b479bd52de256f73c2a943e1a8a42065b5c918622dc14b1c0151dbd94d9a4543e7cd03e536b1b1d2d6d99af535d227ab9bdac76af9312a21d457bdf817e6" />
</pubTokenMapping>
-2
View File
@@ -220,8 +220,6 @@
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- NUnit broken key -->
<map Token="96d09a1eb7f44a77" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- XNA Framework key -->
<map Token="6d5c3888ef60e27d" PublicKey="0024000004800000940000000602000000240000525341310004000001000100f9a2641bac9847900d92a33d652ccc4e8b529360f908e7af53e57008b2a9a1938c32a160d47f795a23590557608d2c8d0c0e8846a052d070f9298281b8185343dbe5b479bd52de256f73c2a943e1a8a42065b5c918622dc14b1c0151dbd94d9a4543e7cd03e536b1b1d2d6d99af535d227ab9bdac76af9312a21d457bdf817e6" />
</pubTokenMapping>
-2
View File
@@ -237,8 +237,6 @@
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- NUnit broken key -->
<map Token="96d09a1eb7f44a77" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- XNA Framework key -->
<map Token="6d5c3888ef60e27d" PublicKey="0024000004800000940000000602000000240000525341310004000001000100f9a2641bac9847900d92a33d652ccc4e8b529360f908e7af53e57008b2a9a1938c32a160d47f795a23590557608d2c8d0c0e8846a052d070f9298281b8185343dbe5b479bd52de256f73c2a943e1a8a42065b5c918622dc14b1c0151dbd94d9a4543e7cd03e536b1b1d2d6d99af535d227ab9bdac76af9312a21d457bdf817e6" />
</pubTokenMapping>
-2
View File
@@ -240,8 +240,6 @@
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- NUnit broken key -->
<map Token="96d09a1eb7f44a77" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- XNA Framework key -->
<map Token="6d5c3888ef60e27d" PublicKey="0024000004800000940000000602000000240000525341310004000001000100f9a2641bac9847900d92a33d652ccc4e8b529360f908e7af53e57008b2a9a1938c32a160d47f795a23590557608d2c8d0c0e8846a052d070f9298281b8185343dbe5b479bd52de256f73c2a943e1a8a42065b5c918622dc14b1c0151dbd94d9a4543e7cd03e536b1b1d2d6d99af535d227ab9bdac76af9312a21d457bdf817e6" />
</pubTokenMapping>
@@ -242,7 +242,7 @@ namespace HtmlAgilityPack
}
/// <summary>
/// Checks for existance of attribute with given name
/// Checks for existence of attribute with given name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
+1 -1
View File
@@ -22,7 +22,7 @@ Layout
as well as the upcoming Monodoc tools and index creation
tools).
The files can contain any ammount of extra information.
The files can contain any amount of extra information.
The documentation from the source code is then merged with
these files and the header/footer information to produce
+23
View File
@@ -18,6 +18,27 @@ convert.exe: $(srcdir)/convert.cs AgilityPack.dll
AgilityPack.dll:
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
ifdef MCS_MODE
monoapi.zip:
touch $@
monoapi.tree: monoapi.zip
touch $@
mono-tools.zip:
touch $@
mono-tools.tree: mono-tools.zip
touch $@
mono-file-formats.zip:
touch $@
mono-file-formats.tree: mono-file-formats.zip
touch $@
else
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
@@ -36,5 +57,7 @@ mono-file-formats.zip: mono-file-formats.tree
mono-file-formats.tree: $(srcdir)/mono-file-formats.config $(srcdir)/docs.make
$(MDOC) assemble -o mono-file-formats -f man $<
endif
.doc-stamp:
+61 -39
View File
@@ -2,36 +2,58 @@
These are some useful links and notes pertaining to the RISC-V port of Mono.
## Useful RISC-V documents
## Useful RISC-V documentation
* [RISC-V User-Level ISA Specification](https://riscv.org/specifications/)
* [RISC-V Privileged ISA Specification](https://riscv.org/specifications/privileged-isa/)
* [RISC-V Debug Specification Standard](https://github.com/riscv/riscv-debug-spec/blob/master/riscv-debug-spec.pdf)
* [RISC-V Assembly Programmer's Manual](https://github.com/riscv/riscv-asm-manual/blob/master/riscv-asm.md)
* [RISC-V ELF psABI Specification](https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md)
* [RISC-V User-Level ISA Specification](https://riscv.org/specifications)
* [RISC-V Privileged ISA Specification](https://riscv.org/specifications/privileged-isa)
* [RISC-V Debug Specification](https://riscv.org/specifications/debug-specification)
* [RISC-V ELF psABI Specification](https://github.com/riscv/riscv-elf-psabi-doc)
* [RISC-V C API Specification](https://github.com/riscv/riscv-c-api-doc)
* [RISC-V Toolchain Conventions](https://github.com/riscv/riscv-toolchain-conventions)
* [RISC-V Assembly Programmer's Manual](https://github.com/riscv/riscv-asm-manual)
## Useful RISC-V repositories
* [RISC-V Organization](https://github.com/riscv)
* [RISC-V Linux](https://github.com/riscv/riscv-linux)
* [RISC-V LLD](https://github.com/riscv/riscv-lld)
* [RISC-V GNU Toolchain](https://github.com/riscv/riscv-gnu-toolchain)
* [RISC-V Binutils](https://github.com/riscv/riscv-binutils-gdb)
* [RISC-V GCC](https://github.com/riscv/riscv-gcc)
* [RISC-V Glibc](https://github.com/riscv/riscv-glibc)
* [RISC-V Newlib](https://github.com/riscv/riscv-newlib)
* [RISC-V Tools](https://github.com/riscv/riscv-tools)
* [RISC-V GNU Toolchain](https://github.com/riscv/riscv-gnu-toolchain)
* [RISC-V Binutils](https://github.com/riscv/riscv-binutils-gdb)
* [RISC-V GCC](https://github.com/riscv/riscv-gcc)
* [RISC-V Glibc](https://github.com/riscv/riscv-glibc)
* [RISC-V Newlib](https://github.com/riscv/riscv-newlib)
* [RISC-V QEMU](https://github.com/riscv/riscv-qemu)
* [RISC-V Opcodes](https://github.com/riscv/riscv-opcodes)
* [RISC-V Tests](https://github.com/riscv/riscv-tests)
* [lowRISC Organization](https://github.com/lowrisc)
* [RISC-V LLVM](https://github.com/lowrisc/riscv-llvm)
## Setting up a cross environment
Setting up a cross environment with a Linux toolchain and QEMU is quite easy.
### Debian/Ubuntu packages
First, add these to your `.bashrc` (or some other script that you run):
This is the most painless way of getting a functional toolchain installed. Note
that these packages may not be available on older distributions; this is tested
on Ubuntu 19.04.
First, add this to your `$HOME/.bashrc` (or some other script that you run):
```bash
export RISCV=$HOME/riscv
export PATH=$RISCV/bin:$PATH
export QEMU_LD_PREFIX=/usr/riscv64-linux-gnu
```
Next, install the toolchain packages like so:
```bash
# apt install autoconf automake binutils-riscv64-linux-gnu build-essential gcc-riscv64-linux-gnu gdb-multiarch g++-riscv64-linux-gnu libtool qemu qemu-system-misc qemu-user qemu-user-static
```
You will now have all the toolchain binaries in `/usr/bin`.
### Building manually
This approach may be somewhat unstable since you will be using the latest
versions of the various parts of the toolchain.
First, add this to your `$HOME/.bashrc` (or some other script that you run):
```bash
export RISCV=$HOME/riscv
@@ -39,47 +61,42 @@ export PATH=$RISCV/bin:$PATH
export QEMU_LD_PREFIX=$RISCV/sysroot
```
Install some dependencies needed to build the toolchain:
Next, install some dependencies needed to build the toolchain:
```console
# apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev libglib2.0-dev libpixman-1-dev
# apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
```
Now you can build the toolchain:
Finally, build the toolchain:
```console
$ git clone --recursive [email protected]:riscv/riscv-tools.git
$ cd riscv-tools
$ ./build.sh
$ git clone --recursive [email protected]:riscv/riscv-gnu-toolchain.git
$ cd riscv-gnu-toolchain
$ ./configure --prefix=$RISCV --enable-multilib
$ ./configure --prefix=$RISCV --enable-linux --enable-multilib --with-arch=rv64imafdc --with-abi=lp64d
$ make linux
$ cd ../..
$ git clone --recursive [email protected]:riscv/riscv-qemu.git
$ cd riscv-qemu
$ mkdir build
$ cd build
$ ../configure --prefix=$RISCV --disable-werror
$ make
$ make install
```
This will install the built toolchain binaries in `$RISCV/bin`.
## Building Mono with a cross toolchain
Building Mono is quite straightforward:
```console
$ ./autogen.sh --prefix=$RISCV/sysroot --host=riscv64-unknown-linux-gnu
$ ./autogen.sh --prefix=$RISCV/sysroot --host=riscv64-linux-gnu
$ make
$ make install
```
(Note: You may need to use `--host=riscv64-unknown-linux-gnu` instead if you
built the toolchain manually.)
You can set `CFLAGS` as appropriate to change the RISC-V options, such as which
standard extensions and ABI to use. For example, to use the 64-bit soft float
ABI:
```console
$ CFLAGS="-mabi=lp64" ./autogen.sh --prefix=$RISCV/sysroot --host=riscv64-unknown-linux-gnu
$ CFLAGS="-mabi=lp64" ./autogen.sh --prefix=$RISCV/sysroot --host=riscv64-linux-gnu
```
Note that, since this is a cross build, the `mcs` directory won't be built. You
@@ -89,19 +106,24 @@ Mono and copy them into `$RISCV/sysroot`.
You can run Mono with QEMU like this:
```console
$ qemu-riscv64 $RISCV/sysroot/bin/mono hello.exe
$ qemu-riscv64 ./mono/mini/mono hello.exe
```
## Debugging
Debugging with GDB currently requires a manually built toolchain.
It can be done like so:
```console
$ qemu-riscv64 -g 12345 ./mono/mini/mono-sgen --interp basic.exe &
$ riscv64-unknown-elf-gdb -ex 'target remote localhost:12345' -ex 'b main' -ex 'c' ./mono/mini/mono-sgen
$ qemu-riscv64 -g 12345 ./mono/mini/mono --interp basic.exe &
$ riscv64-unknown-elf-gdb -ex 'target remote localhost:12345' -ex 'b main' -ex 'c' ./mono/mini/mono
```
## Things to be done
In no particular order:
Things that need to be done beyond the basic 64-bit port, in no particular
order:
* Complete the soft float port.
* Complete the 32-bit port.
+6
View File
@@ -109,6 +109,12 @@ typedef struct {
<h3>Write Barriers</h3>
<p>SGen is a concurrent and generational GC, features which require
tracking changes to the state of the heap. This is achieved through
write barriers. Whenever native code is changing the state of the
heap by storing references into another managed object, it needs to
do it using this write barrier API.
<h4><a name="api:mono_gc_wbarrier_arrayref_copy">mono_gc_wbarrier_arrayref_copy</a></h4>
<h4><a name="api:mono_gc_wbarrier_generic_nostore">mono_gc_wbarrier_generic_nostore</a></h4>
<h4><a name="api:mono_gc_wbarrier_generic_store">mono_gc_wbarrier_generic_store</a></h4>
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Private.CoreFx.NETCoreApp" Version="5.0.0-alpha.1.19563.3">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>5cee7c97d602f294e27c582d4dab81ec388f1d7b</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App" Version="5.0.0-alpha.1.19564.1">
<Uri>https://github.com/dotnet/core-setup</Uri>
<Sha>c77948d92a2f950140f09384f057cb893ec3955a</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers" Version="3.3.1-beta4-19476-06">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>39d545dc14bc4d5a546e5e2f58d1ebaca72fcd61</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20201.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>bce0a98620c1c5a110b2bba9912f3d5929069c6b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20201.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>bce0a98620c1c5a110b2bba9912f3d5929069c6b</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>5.0.0</VersionPrefix>
<PreReleaseVersionLabel>prerelease</PreReleaseVersionLabel>
<!-- Package versions -->
<!-- corefx -->
<MicrosoftPrivateCoreFxNETCoreAppVersion>5.0.0-alpha.1.19563.3</MicrosoftPrivateCoreFxNETCoreAppVersion>
<!-- core-setup -->
<MicrosoftNETCoreAppVersion>5.0.0-alpha.1.19564.1</MicrosoftNETCoreAppVersion>
<!-- roslyn -->
<MicrosoftNetCompilersVersion>3.3.1-beta4-19476-06</MicrosoftNetCompilersVersion>
</PropertyGroup>
</Project>
+2
View File
@@ -0,0 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*"
+11
View File
@@ -0,0 +1,11 @@
@{
IncludeRules=@('PSAvoidUsingCmdletAliases',
'PSAvoidUsingWMICmdlet',
'PSAvoidUsingPositionalParameters',
'PSAvoidUsingInvokeExpression',
'PSUseDeclaredVarsMoreThanAssignments',
'PSUseCmdletCorrectly',
'PSStandardDSCFunctionsInResource',
'PSUseIdenticalMandatoryParametersForDSC',
'PSUseIdenticalParametersForDSC')
}
+28
View File
@@ -0,0 +1,28 @@
# Don't touch this folder
uuuuuuuuuuuuuuuuuuuu
u" uuuuuuuuuuuuuuuuuu "u
u" u$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
$ $$$" ... "$... ...$" ... "$$$ ... "$$$ $
$ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $
$ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $
$ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $
$ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$" u"
"u """""""""""""""""" u"
""""""""""""""""""""
!!! Changes made in this directory are subject to being overwritten by automation !!!
The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first.
+141
View File
@@ -0,0 +1,141 @@
# This file is a temporary workaround for internal builds to be able to restore from private AzDO feeds.
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
#
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
# under <packageSourceCredentials> for each Maestro managed private feed. Two additional credential
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
#
# This script needs to be called in every job that will restore packages and which the base repo has
# private AzDO feeds in the NuGet.config.
#
# See example YAML call for this script below. Note the use of the variable `$(dn-bot-dnceng-artifact-feeds-rw)`
# from the AzureDevOps-Artifact-Feeds-Pats variable group.
#
# - task: PowerShell@2
# displayName: Setup Private Feeds Credentials
# condition: eq(variables['Agent.OS'], 'Windows_NT')
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)][string]$ConfigFile,
[Parameter(Mandatory = $true)][string]$Password
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
. $PSScriptRoot\tools.ps1
# Add source entry to PackageSources
function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $Password) {
$packageSource = $sources.SelectSingleNode("add[@key='$SourceName']")
if ($packageSource -eq $null)
{
$packageSource = $doc.CreateElement("add")
$packageSource.SetAttribute("key", $SourceName)
$packageSource.SetAttribute("value", $SourceEndPoint)
$sources.AppendChild($packageSource) | Out-Null
}
else {
Write-Host "Package source $SourceName already present."
}
AddCredential -Creds $creds -Source $SourceName -Username $Username -Password $Password
}
# Add a credential node for the specified source
function AddCredential($creds, $source, $username, $password) {
# Looks for credential configuration for the given SourceName. Create it if none is found.
$sourceElement = $creds.SelectSingleNode($Source)
if ($sourceElement -eq $null)
{
$sourceElement = $doc.CreateElement($Source)
$creds.AppendChild($sourceElement) | Out-Null
}
# Add the <Username> node to the credential if none is found.
$usernameElement = $sourceElement.SelectSingleNode("add[@key='Username']")
if ($usernameElement -eq $null)
{
$usernameElement = $doc.CreateElement("add")
$usernameElement.SetAttribute("key", "Username")
$sourceElement.AppendChild($usernameElement) | Out-Null
}
$usernameElement.SetAttribute("value", $Username)
# Add the <ClearTextPassword> to the credential if none is found.
# Add it as a clear text because there is no support for encrypted ones in non-windows .Net SDKs.
# -> https://github.com/NuGet/Home/issues/5526
$passwordElement = $sourceElement.SelectSingleNode("add[@key='ClearTextPassword']")
if ($passwordElement -eq $null)
{
$passwordElement = $doc.CreateElement("add")
$passwordElement.SetAttribute("key", "ClearTextPassword")
$sourceElement.AppendChild($passwordElement) | Out-Null
}
$passwordElement.SetAttribute("value", $Password)
}
function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Password) {
$maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")
Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds."
ForEach ($PackageSource in $maestroPrivateSources) {
Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key
AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -Password $Password
}
}
if (!(Test-Path $ConfigFile -PathType Leaf)) {
Write-PipelineTelemetryError -Category 'Build' -Message "Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile"
ExitWithExitCode 1
}
if (!$Password) {
Write-PipelineTelemetryError -Category 'Build' -Message 'Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Please supply a valid PAT'
ExitWithExitCode 1
}
# Load NuGet.config
$doc = New-Object System.Xml.XmlDocument
$filename = (Get-Item $ConfigFile).FullName
$doc.Load($filename)
# Get reference to <PackageSources> or create one if none exist already
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
if ($sources -eq $null) {
$sources = $doc.CreateElement("packageSources")
$doc.DocumentElement.AppendChild($sources) | Out-Null
}
# Looks for a <PackageSourceCredentials> node. Create it if none is found.
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
if ($creds -eq $null) {
$creds = $doc.CreateElement("packageSourceCredentials")
$doc.DocumentElement.AppendChild($creds) | Out-Null
}
# Insert credential nodes for Maestro's private feeds
InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Password $Password
$dotnet3Source = $sources.SelectSingleNode("add[@key='dotnet3']")
if ($dotnet3Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet3-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
}
$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']")
if ($dotnet31Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
}
$doc.Save($filename)
+149
View File
@@ -0,0 +1,149 @@
#!/usr/bin/env bash
# This file is a temporary workaround for internal builds to be able to restore from private AzDO feeds.
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
#
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
# under <packageSourceCredentials> for each Maestro's managed private feed. Two additional credential
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
#
# This script needs to be called in every job that will restore packages and which the base repo has
# private AzDO feeds in the NuGet.config.
#
# See example YAML call for this script below. Note the use of the variable `$(dn-bot-dnceng-artifact-feeds-rw)`
# from the AzureDevOps-Artifact-Feeds-Pats variable group.
#
# - task: Bash@3
# displayName: Setup Private Feeds Credentials
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
# arguments: $(Build.SourcesDirectory)/NuGet.config $Token
# condition: ne(variables['Agent.OS'], 'Windows_NT')
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
ConfigFile=$1
CredToken=$2
NL='\n'
TB=' '
source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/tools.sh"
if [ ! -f "$ConfigFile" ]; then
Write-PipelineTelemetryError -Category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile"
ExitWithExitCode 1
fi
if [ -z "$CredToken" ]; then
Write-PipelineTelemetryError -category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Please supply a valid PAT"
ExitWithExitCode 1
fi
if [[ `uname -s` == "Darwin" ]]; then
NL=$'\\\n'
TB=''
fi
# Ensure there is a <packageSources>...</packageSources> section.
grep -i "<packageSources>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding <packageSources>...</packageSources> section."
ConfigNodeHeader="<configuration>"
PackageSourcesTemplate="${TB}<packageSources>${NL}${TB}</packageSources>"
sed -i.bak "s|$ConfigNodeHeader|$ConfigNodeHeader${NL}$PackageSourcesTemplate|" NuGet.config
fi
# Ensure there is a <packageSourceCredentials>...</packageSourceCredentials> section.
grep -i "<packageSourceCredentials>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding <packageSourceCredentials>...</packageSourceCredentials> section."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceCredentialsTemplate="${TB}<packageSourceCredentials>${NL}${TB}</packageSourceCredentials>"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourcesNodeFooter${NL}$PackageSourceCredentialsTemplate|" NuGet.config
fi
PackageSources=()
# Ensure dotnet3-internal and dotnet3-internal-transport are in the packageSources if the public dotnet3 feeds are present
grep -i "<add key=\"dotnet3\"" $ConfigFile
if [ "$?" == "0" ]; then
grep -i "<add key=\"dotnet3-internal\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v2\" />"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3-internal')
grep -i "<add key=\"dotnet3-internal-transport\"" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal-transport to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal-transport\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v2\" />"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3-internal-transport')
fi
# Ensure dotnet3.1-internal and dotnet3.1-internal-transport are in the packageSources if the public dotnet3.1 feeds are present
grep -i "<add key=\"dotnet3.1\"" $ConfigFile
if [ "$?" == "0" ]; then
grep -i "<add key=\"dotnet3.1-internal\"" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3.1-internal to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3.1-internal\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2\" />"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3.1-internal')
grep -i "<add key=\"dotnet3.1-internal-transport\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3.1-internal-transport to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3.1-internal-transport\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2\" />"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3.1-internal-transport')
fi
# I want things split line by line
PrevIFS=$IFS
IFS=$'\n'
PackageSources+="$IFS"
PackageSources+=$(grep -oh '"darc-int-[^"]*"' $ConfigFile | tr -d '"')
IFS=$PrevIFS
for FeedName in ${PackageSources[@]} ; do
# Check if there is no existing credential for this FeedName
grep -i "<$FeedName>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding credentials for $FeedName."
PackageSourceCredentialsNodeFooter="</packageSourceCredentials>"
NewCredential="${TB}${TB}<$FeedName>${NL}<add key=\"Username\" value=\"dn-bot\" />${NL}<add key=\"ClearTextPassword\" value=\"$CredToken\" />${NL}</$FeedName>"
sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile
fi
done
+153
View File
@@ -0,0 +1,153 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string][Alias('c')]$configuration = "Debug",
[string]$platform = $null,
[string] $projects,
[string][Alias('v')]$verbosity = "minimal",
[string] $msbuildEngine = $null,
[bool] $warnAsError = $true,
[bool] $nodeReuse = $true,
[switch][Alias('r')]$restore,
[switch] $deployDeps,
[switch][Alias('b')]$build,
[switch] $rebuild,
[switch] $deploy,
[switch][Alias('t')]$test,
[switch] $integrationTest,
[switch] $performanceTest,
[switch] $sign,
[switch] $pack,
[switch] $publish,
[switch] $clean,
[switch][Alias('bl')]$binaryLog,
[switch] $ci,
[switch] $prepareMachine,
[switch] $help,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)
# Unset 'Platform' environment variable to avoid unwanted collision in InstallDotNetCore.targets file
# some computer has this env var defined (e.g. Some HP)
if($env:Platform) {
$env:Platform=""
}
function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
Write-Host " -platform <value> Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild"
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
Write-Host " -binaryLog Output binary log (short: -bl)"
Write-Host " -help Print help and exit"
Write-Host ""
Write-Host "Actions:"
Write-Host " -restore Restore dependencies (short: -r)"
Write-Host " -build Build solution (short: -b)"
Write-Host " -rebuild Rebuild solution"
Write-Host " -deploy Deploy built VSIXes"
Write-Host " -deployDeps Deploy dependencies (e.g. VSIXes for integration tests)"
Write-Host " -test Run all unit tests in the solution (short: -t)"
Write-Host " -integrationTest Run all integration tests in the solution"
Write-Host " -performanceTest Run all performance tests in the solution"
Write-Host " -pack Package build outputs into NuGet packages and Willow components"
Write-Host " -sign Sign build outputs"
Write-Host " -publish Publish artifacts (e.g. symbols)"
Write-Host " -clean Clean the solution"
Write-Host ""
Write-Host "Advanced settings:"
Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
Write-Host " -ci Set when running on CI server"
Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build"
Write-Host " -warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
Write-Host ""
Write-Host "Command line arguments not listed above are passed thru to msbuild."
Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)."
}
. $PSScriptRoot\tools.ps1
function InitializeCustomToolset {
if (-not $restore) {
return
}
$script = Join-Path $EngRoot 'restore-toolset.ps1'
if (Test-Path $script) {
. $script
}
}
function Build {
$toolsetBuildProj = InitializeToolset
InitializeCustomToolset
$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' }
$platformArg = if ($platform) { "/p:Platform=$platform" } else { '' }
if ($projects) {
# Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons.
# Explicitly set the type as string[] because otherwise PowerShell would make this char[] if $properties is empty.
[string[]] $msbuildArgs = $properties
# Resolve relative project paths into full paths
$projects = ($projects.Split(';').ForEach({Resolve-Path $_}) -join ';')
$msbuildArgs += "/p:Projects=$projects"
$properties = $msbuildArgs
}
MSBuild $toolsetBuildProj `
$bl `
$platformArg `
/p:Configuration=$configuration `
/p:RepoRoot=$RepoRoot `
/p:Restore=$restore `
/p:DeployDeps=$deployDeps `
/p:Build=$build `
/p:Rebuild=$rebuild `
/p:Deploy=$deploy `
/p:Test=$test `
/p:Pack=$pack `
/p:IntegrationTest=$integrationTest `
/p:PerformanceTest=$performanceTest `
/p:Sign=$sign `
/p:Publish=$publish `
@properties
}
try {
if ($clean) {
if (Test-Path $ArtifactsDir) {
Remove-Item -Recurse -Force $ArtifactsDir
Write-Host 'Artifacts directory deleted.'
}
exit 0
}
if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) {
Print-Usage
exit 0
}
if ($ci) {
$binaryLog = $true
$nodeReuse = $false
}
if ($restore) {
InitializeNativeTools
}
Build
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
ExitWithExitCode 1
}
ExitWithExitCode 0
+216
View File
@@ -0,0 +1,216 @@
#!/usr/bin/env bash
# Stop script if unbound variable found (use ${var:-} if intentional)
set -u
# Stop script if command returns non-zero exit code.
# Prevents hidden errors caused by missing error code propagation.
set -e
usage()
{
echo "Common settings:"
echo " --configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
echo " --verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
echo " --binaryLog Create MSBuild binary log (short: -bl)"
echo " --help Print help and exit (short: -h)"
echo ""
echo "Actions:"
echo " --restore Restore dependencies (short: -r)"
echo " --build Build solution (short: -b)"
echo " --rebuild Rebuild solution"
echo " --test Run all unit tests in the solution (short: -t)"
echo " --integrationTest Run all integration tests in the solution"
echo " --performanceTest Run all performance tests in the solution"
echo " --pack Package build outputs into NuGet packages and Willow components"
echo " --sign Sign build outputs"
echo " --publish Publish artifacts (e.g. symbols)"
echo " --clean Clean the solution"
echo ""
echo "Advanced settings:"
echo " --projects <value> Project or solution file(s) to build"
echo " --ci Set when running on CI server"
echo " --prepareMachine Prepare machine for CI run, clean up processes after build"
echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
echo ""
echo "Command line arguments not listed above are passed thru to msbuild."
echo "Arguments can also be passed in with a single hyphen."
}
source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
restore=false
build=false
rebuild=false
test=false
integration_test=false
performance_test=false
pack=false
publish=false
sign=false
public=false
ci=false
clean=false
warn_as_error=true
node_reuse=true
binary_log=false
pipelines_log=false
projects=''
configuration='Debug'
prepare_machine=false
verbosity='minimal'
properties=''
while [[ $# > 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-help|-h)
usage
exit 0
;;
-clean)
clean=true
;;
-configuration|-c)
configuration=$2
shift
;;
-verbosity|-v)
verbosity=$2
shift
;;
-binarylog|-bl)
binary_log=true
;;
-pipelineslog|-pl)
pipelines_log=true
;;
-restore|-r)
restore=true
;;
-build|-b)
build=true
;;
-rebuild)
rebuild=true
;;
-pack)
pack=true
;;
-test|-t)
test=true
;;
-integrationtest)
integration_test=true
;;
-performancetest)
performance_test=true
;;
-sign)
sign=true
;;
-publish)
publish=true
;;
-preparemachine)
prepare_machine=true
;;
-projects)
projects=$2
shift
;;
-ci)
ci=true
;;
-warnaserror)
warn_as_error=$2
shift
;;
-nodereuse)
node_reuse=$2
shift
;;
*)
properties="$properties $1"
;;
esac
shift
done
if [[ "$ci" == true ]]; then
pipelines_log=true
binary_log=true
node_reuse=false
fi
. "$scriptroot/tools.sh"
function InitializeCustomToolset {
local script="$eng_root/restore-toolset.sh"
if [[ -a "$script" ]]; then
. "$script"
fi
}
function Build {
InitializeToolset
InitializeCustomToolset
if [[ ! -z "$projects" ]]; then
properties="$properties /p:Projects=$projects"
fi
local bl=""
if [[ "$binary_log" == true ]]; then
bl="/bl:\"$log_dir/Build.binlog\""
fi
MSBuild $_InitializeToolset \
$bl \
/p:Configuration=$configuration \
/p:RepoRoot="$repo_root" \
/p:Restore=$restore \
/p:Build=$build \
/p:Rebuild=$rebuild \
/p:Test=$test \
/p:Pack=$pack \
/p:IntegrationTest=$integration_test \
/p:PerformanceTest=$performance_test \
/p:Sign=$sign \
/p:Publish=$publish \
$properties
ExitWithExitCode 0
}
if [[ "$clean" == true ]]; then
if [ -d "$artifacts_dir" ]; then
rm -rf $artifacts_dir
echo "Artifacts directory deleted."
fi
exit 0
fi
if [[ "$restore" == true ]]; then
InitializeNativeTools
fi
Build
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
# resolve $SOURCE until the file is no longer a symlink
while [[ -h $source ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where
# the symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/build.sh" --restore --build --test --pack --publish --ci $@
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
+3
View File
@@ -0,0 +1,3 @@
# Debian (sid) # UNSTABLE
deb http://ftp.debian.org/debian/ sid main contrib non-free
deb-src http://ftp.debian.org/debian/ sid main contrib non-free
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
@@ -0,0 +1,71 @@
From e72c9d7ead60e3317bd6d1fade995c07021c947b Mon Sep 17 00:00:00 2001
From: Mathieu Desnoyers <[email protected]>
Date: Thu, 7 May 2015 13:25:04 -0400
Subject: [PATCH] Fix: building probe providers with C++ compiler
Robert Daniels wrote:
> > I'm attempting to use lttng userspace tracing with a C++ application
> > on an ARM platform. I'm using GCC 4.8.4 on Linux 3.14 with the 2.6
> > release of lttng. I've compiled lttng-modules, lttng-ust, and
> > lttng-tools and have been able to get a simple test working with C
> > code. When I attempt to run the hello.cxx test on my target it will
> > segfault.
>
>
> I spent a little time digging into this issue and finally discovered the
> cause of my segfault with ARM C++ tracepoints.
>
> There is a struct called 'lttng_event' in ust-events.h which contains an
> empty union 'u'. This was the cause of my issue. Under C, this empty union
> compiles to a zero byte member while under C++ it compiles to a one byte
> member, and in my case was four-byte aligned which caused my C++ code to
> have the 'cds_list_head node' offset incorrectly by four bytes. This lead
> to an incorrect linked list structure which caused my issue.
>
> Since this union is empty, I simply removed it from the struct and everything
> worked correctly.
>
> I don't know the history or purpose behind this empty union so I'd like to
> know if this is a safe fix. If it is I can submit a patch with the union
> removed.
That's a very nice catch!
We do not support building tracepoint probe provider with
g++ yet, as stated in lttng-ust(3):
"- Note for C++ support: although an application instrumented with
tracepoints can be compiled with g++, tracepoint probes should be
compiled with gcc (only tested with gcc so far)."
However, if it works fine with this fix, then I'm tempted to take it,
especially because removing the empty union does not appear to affect
the layout of struct lttng_event as seen from liblttng-ust, which must
be compiled with a C compiler, and from probe providers compiled with
a C compiler. So all we are changing is the layout of a probe provider
compiled with a C++ compiler, which is anyway buggy at the moment,
because it is not compatible with the layout expected by liblttng-ust
compiled with a C compiler.
Reported-by: Robert Daniels <[email protected]>
Signed-off-by: Mathieu Desnoyers <[email protected]>
---
include/lttng/ust-events.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/usr/include/lttng/ust-events.h b/usr/include/lttng/ust-events.h
index 328a875..3d7a274 100644
--- a/usr/include/lttng/ust-events.h
+++ b/usr/include/lttng/ust-events.h
@@ -407,8 +407,6 @@ struct lttng_event {
void *_deprecated1;
struct lttng_ctx *ctx;
enum lttng_ust_instrumentation instrumentation;
- union {
- } u;
struct cds_list_head node; /* Event list in session */
struct cds_list_head _deprecated2;
void *_deprecated3;
--
2.7.4
+97
View File
@@ -0,0 +1,97 @@
diff -u -r a/usr/include/urcu/uatomic/generic.h b/usr/include/urcu/uatomic/generic.h
--- a/usr/include/urcu/uatomic/generic.h 2014-03-28 06:04:42.000000000 +0900
+++ b/usr/include/urcu/uatomic/generic.h 2017-02-13 10:35:21.189927116 +0900
@@ -65,17 +65,17 @@
switch (len) {
#ifdef UATOMIC_HAS_ATOMIC_BYTE
case 1:
- return __sync_val_compare_and_swap_1(addr, old, _new);
+ return __sync_val_compare_and_swap_1((uint8_t *) addr, old, _new);
#endif
#ifdef UATOMIC_HAS_ATOMIC_SHORT
case 2:
- return __sync_val_compare_and_swap_2(addr, old, _new);
+ return __sync_val_compare_and_swap_2((uint16_t *) addr, old, _new);
#endif
case 4:
- return __sync_val_compare_and_swap_4(addr, old, _new);
+ return __sync_val_compare_and_swap_4((uint32_t *) addr, old, _new);
#if (CAA_BITS_PER_LONG == 64)
case 8:
- return __sync_val_compare_and_swap_8(addr, old, _new);
+ return __sync_val_compare_and_swap_8((uint64_t *) addr, old, _new);
#endif
}
_uatomic_link_error();
@@ -100,20 +100,20 @@
switch (len) {
#ifdef UATOMIC_HAS_ATOMIC_BYTE
case 1:
- __sync_and_and_fetch_1(addr, val);
+ __sync_and_and_fetch_1((uint8_t *) addr, val);
return;
#endif
#ifdef UATOMIC_HAS_ATOMIC_SHORT
case 2:
- __sync_and_and_fetch_2(addr, val);
+ __sync_and_and_fetch_2((uint16_t *) addr, val);
return;
#endif
case 4:
- __sync_and_and_fetch_4(addr, val);
+ __sync_and_and_fetch_4((uint32_t *) addr, val);
return;
#if (CAA_BITS_PER_LONG == 64)
case 8:
- __sync_and_and_fetch_8(addr, val);
+ __sync_and_and_fetch_8((uint64_t *) addr, val);
return;
#endif
}
@@ -139,20 +139,20 @@
switch (len) {
#ifdef UATOMIC_HAS_ATOMIC_BYTE
case 1:
- __sync_or_and_fetch_1(addr, val);
+ __sync_or_and_fetch_1((uint8_t *) addr, val);
return;
#endif
#ifdef UATOMIC_HAS_ATOMIC_SHORT
case 2:
- __sync_or_and_fetch_2(addr, val);
+ __sync_or_and_fetch_2((uint16_t *) addr, val);
return;
#endif
case 4:
- __sync_or_and_fetch_4(addr, val);
+ __sync_or_and_fetch_4((uint32_t *) addr, val);
return;
#if (CAA_BITS_PER_LONG == 64)
case 8:
- __sync_or_and_fetch_8(addr, val);
+ __sync_or_and_fetch_8((uint64_t *) addr, val);
return;
#endif
}
@@ -180,17 +180,17 @@
switch (len) {
#ifdef UATOMIC_HAS_ATOMIC_BYTE
case 1:
- return __sync_add_and_fetch_1(addr, val);
+ return __sync_add_and_fetch_1((uint8_t *) addr, val);
#endif
#ifdef UATOMIC_HAS_ATOMIC_SHORT
case 2:
- return __sync_add_and_fetch_2(addr, val);
+ return __sync_add_and_fetch_2((uint16_t *) addr, val);
#endif
case 4:
- return __sync_add_and_fetch_4(addr, val);
+ return __sync_add_and_fetch_4((uint32_t *) addr, val);
#if (CAA_BITS_PER_LONG == 64)
case 8:
- return __sync_add_and_fetch_8(addr, val);
+ return __sync_add_and_fetch_8((uint64_t *) addr, val);
#endif
}
_uatomic_link_error();
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
@@ -0,0 +1,11 @@
deb http://deb.debian.org/debian buster main
deb-src http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian-security/ buster/updates main
deb-src http://deb.debian.org/debian-security/ buster/updates main
deb http://deb.debian.org/debian buster-updates main
deb-src http://deb.debian.org/debian buster-updates main
deb http://deb.debian.org/debian buster-backports main contrib non-free
deb-src http://deb.debian.org/debian buster-backports main contrib non-free
@@ -0,0 +1,12 @@
deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main
deb http://deb.debian.org/debian-security/ stretch/updates main
deb-src http://deb.debian.org/debian-security/ stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main
deb http://deb.debian.org/debian stretch-backports main contrib non-free
deb-src http://deb.debian.org/debian stretch-backports main contrib non-free
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
@@ -0,0 +1,3 @@
# Debian (jessie) # Stable
deb http://ftp.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.debian.org/debian/ jessie main contrib non-free
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -e
__ARM_SOFTFP_CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__TIZEN_CROSSDIR="$__ARM_SOFTFP_CrossDir/tizen"
if [[ -z "$ROOTFS_DIR" ]]; then
echo "ROOTFS_DIR is not defined."
exit 1;
fi
# Clean-up (TODO-Cleanup: We may already delete $ROOTFS_DIR at ./cross/build-rootfs.sh.)
# hk0110
if [ -d "$ROOTFS_DIR" ]; then
umount $ROOTFS_DIR/*
rm -rf $ROOTFS_DIR
fi
TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp
mkdir -p $TIZEN_TMP_DIR
# Download files
echo ">>Start downloading files"
VERBOSE=1 $__ARM_SOFTFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR
echo "<<Finish downloading files"
echo ">>Start constructing Tizen rootfs"
TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm`
cd $ROOTFS_DIR
for f in $TIZEN_RPM_FILES; do
rpm2cpio $f | cpio -idm --quiet
done
echo "<<Finish constructing Tizen rootfs"
# Cleanup tmp
rm -rf $TIZEN_TMP_DIR
# Configure Tizen rootfs
echo ">>Start configuring Tizen rootfs"
rm ./usr/lib/libunwind.so
ln -s libunwind.so.8 ./usr/lib/libunwind.so
ln -sfn asm-arm ./usr/include/asm
patch -p1 < $__TIZEN_CROSSDIR/tizen.patch
echo "<<Finish configuring Tizen rootfs"
+171
View File
@@ -0,0 +1,171 @@
#!/usr/bin/env bash
set -e
if [[ -z "${VERBOSE// }" ]] || [ "$VERBOSE" -ne "$VERBOSE" ] 2>/dev/null; then
VERBOSE=0
fi
Log()
{
if [ $VERBOSE -ge $1 ]; then
echo ${@:2}
fi
}
Inform()
{
Log 1 -e "\x1B[0;34m$@\x1B[m"
}
Debug()
{
Log 2 -e "\x1B[0;32m$@\x1B[m"
}
Error()
{
>&2 Log 0 -e "\x1B[0;31m$@\x1B[m"
}
Fetch()
{
URL=$1
FILE=$2
PROGRESS=$3
if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then
CURL_OPT="--progress-bar"
else
CURL_OPT="--silent"
fi
curl $CURL_OPT $URL > $FILE
}
hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; }
hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; }
hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; }
TMPDIR=$1
if [ ! -d $TMPDIR ]; then
TMPDIR=./tizen_tmp
Debug "Create temporary directory : $TMPDIR"
mkdir -p $TMPDIR
fi
TIZEN_URL=http://download.tizen.org/releases/milestone/tizen
BUILD_XML=build.xml
REPOMD_XML=repomd.xml
PRIMARY_XML=primary.xml
TARGET_URL="http://__not_initialized"
Xpath_get()
{
XPATH_RESULT=''
XPATH=$1
XML_FILE=$2
RESULT=$(xmllint --xpath $XPATH $XML_FILE)
if [[ -z ${RESULT// } ]]; then
Error "Can not find target from $XML_FILE"
Debug "Xpath = $XPATH"
exit 1
fi
XPATH_RESULT=$RESULT
}
fetch_tizen_pkgs_init()
{
TARGET=$1
PROFILE=$2
Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE"
TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs
if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi
mkdir -p $TMP_PKG_DIR
PKG_URL=$TIZEN_URL/$PROFILE/latest
BUILD_XML_URL=$PKG_URL/$BUILD_XML
TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML
TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML
TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML
TMP_PRIMARYGZ=${TMP_PRIMARY}.gz
Fetch $BUILD_XML_URL $TMP_BUILD
Debug "fetch $BUILD_XML_URL to $TMP_BUILD"
TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()"
Xpath_get $TARGET_XPATH $TMP_BUILD
TARGET_PATH=$XPATH_RESULT
TARGET_URL=$PKG_URL/$TARGET_PATH
REPOMD_URL=$TARGET_URL/repodata/repomd.xml
PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)'
Fetch $REPOMD_URL $TMP_REPOMD
Debug "fetch $REPOMD_URL to $TMP_REPOMD"
Xpath_get $PRIMARY_XPATH $TMP_REPOMD
PRIMARY_XML_PATH=$XPATH_RESULT
PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH
Fetch $PRIMARY_URL $TMP_PRIMARYGZ
Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ"
gunzip $TMP_PRIMARYGZ
Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY"
}
fetch_tizen_pkgs()
{
ARCH=$1
PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)'
PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())'
for pkg in ${@:2}
do
Inform "Fetching... $pkg"
XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg}
XPATH=${XPATH/_ARCH_/$ARCH}
Xpath_get $XPATH $TMP_PRIMARY
PKG_PATH=$XPATH_RESULT
XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg}
XPATH=${XPATH/_ARCH_/$ARCH}
Xpath_get $XPATH $TMP_PRIMARY
CHECKSUM=$XPATH_RESULT
PKG_URL=$TARGET_URL/$PKG_PATH
PKG_FILE=$(basename $PKG_PATH)
PKG_PATH=$TMPDIR/$PKG_FILE
Debug "Download $PKG_URL to $PKG_PATH"
Fetch $PKG_URL $PKG_PATH true
echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null
if [ $? -ne 0 ]; then
Error "Fail to fetch $PKG_URL to $PKG_PATH"
Debug "Checksum = $CHECKSUM"
exit 1
fi
done
}
Inform "Initialize arm base"
fetch_tizen_pkgs_init standard base
Inform "fetch common packages"
fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel libatomic
fetch_tizen_pkgs noarch linux-glibc-devel
Inform "fetch coreclr packages"
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel krb5 krb5-devel libcurl libcurl-devel
Inform "Initialize standard unified"
fetch_tizen_pkgs_init standard unified
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l gssdp gssdp-devel tizen-release
@@ -0,0 +1,50 @@
lang en_US.UTF-8
keyboard us
timezone --utc Asia/Seoul
part / --fstype="ext4" --size=3500 --ondisk=mmcblk0 --label rootfs --fsoptions=defaults,noatime
rootpw tizen
desktop --autologinuser=root
user --name root --groups audio,video --password 'tizen'
repo --name=standard --baseurl=http://download.tizen.org/releases/milestone/tizen/unified/latest/repos/standard/packages/ --ssl_verify=no
repo --name=base --baseurl=http://download.tizen.org/releases/milestone/tizen/base/latest/repos/standard/packages/ --ssl_verify=no
%packages
tar
gzip
sed
grep
gawk
perl
binutils
findutils
util-linux
lttng-ust
userspace-rcu
procps-ng
tzdata
ca-certificates
### Core FX
libicu
libunwind
iputils
zlib
krb5
libcurl
libopenssl
%end
%post
### Update /tmp privilege
chmod 777 /tmp
####################################
%end
+18
View File
@@ -0,0 +1,18 @@
diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so
--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900
+++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900
@@ -2,4 +2,4 @@
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) )
+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) )
diff -u -r a/usr/lib/libpthread.so b/usr/lib/libpthread.so
--- a/usr/lib/libpthread.so 2016-12-30 23:00:19.408951841 +0900
+++ b/usr/lib/libpthread.so 2016-12-30 23:00:39.068951801 +0900
@@ -2,4 +2,4 @@
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
-GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a )
+GROUP ( libpthread.so.0 libpthread_nonshared.a )
+131
View File
@@ -0,0 +1,131 @@
#!/usr/bin/env bash
set -e
__NDK_Version=r21
usage()
{
echo "Creates a toolchain and sysroot used for cross-compiling for Android."
echo.
echo "Usage: $0 [BuildArch] [ApiLevel]"
echo.
echo "BuildArch is the target architecture of Android. Currently only arm64 is supported."
echo "ApiLevel is the target Android API level. API levels usually match to Android releases. See https://source.android.com/source/build-numbers.html"
echo.
echo "By default, the toolchain and sysroot will be generated in cross/android-rootfs/toolchain/[BuildArch]. You can change this behavior"
echo "by setting the TOOLCHAIN_DIR environment variable"
echo.
echo "By default, the NDK will be downloaded into the cross/android-rootfs/android-ndk-$__NDK_Version directory. If you already have an NDK installation,"
echo "you can set the NDK_DIR environment variable to have this script use that installation of the NDK."
echo "By default, this script will generate a file, android_platform, in the root of the ROOTFS_DIR directory that contains the RID for the supported and tested Android build: android.28-arm64. This file is to replace '/etc/os-release', which is not available for Android."
exit 1
}
__ApiLevel=28 # The minimum platform for arm64 is API level 21 but the minimum version that support glob(3) is 28. See $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/glob.h
__BuildArch=arm64
__AndroidArch=aarch64
__AndroidToolchain=aarch64-linux-android
for i in "$@"
do
lowerI="$(echo $i | awk '{print tolower($0)}')"
case $lowerI in
-?|-h|--help)
usage
exit 1
;;
arm64)
__BuildArch=arm64
__AndroidArch=aarch64
__AndroidToolchain=aarch64-linux-android
;;
arm)
__BuildArch=arm
__AndroidArch=arm
__AndroidToolchain=arm-linux-androideabi
;;
*[0-9])
__ApiLevel=$i
;;
*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $i"
;;
esac
done
# Obtain the location of the bash script to figure out where the root of the repo is.
__ScriptBaseDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
__CrossDir="$__ScriptBaseDir/../../../.tools/android-rootfs"
if [[ ! -f "$__CrossDir" ]]; then
mkdir -p "$__CrossDir"
fi
# Resolve absolute path to avoid `../` in build logs
__CrossDir="$( cd "$__CrossDir" && pwd )"
__NDK_Dir="$__CrossDir/android-ndk-$__NDK_Version"
__lldb_Dir="$__CrossDir/lldb"
__ToolchainDir="$__CrossDir/android-ndk-$__NDK_Version"
if [[ -n "$TOOLCHAIN_DIR" ]]; then
__ToolchainDir=$TOOLCHAIN_DIR
fi
if [[ -n "$NDK_DIR" ]]; then
__NDK_Dir=$NDK_DIR
fi
echo "Target API level: $__ApiLevel"
echo "Target architecture: $__BuildArch"
echo "NDK location: $__NDK_Dir"
echo "Target Toolchain location: $__ToolchainDir"
# Download the NDK if required
if [ ! -d $__NDK_Dir ]; then
echo Downloading the NDK into $__NDK_Dir
mkdir -p $__NDK_Dir
wget -q --progress=bar:force:noscroll --show-progress https://dl.google.com/android/repository/android-ndk-$__NDK_Version-linux-x86_64.zip -O $__CrossDir/android-ndk-$__NDK_Version-linux-x86_64.zip
unzip -q $__CrossDir/android-ndk-$__NDK_Version-linux-x86_64.zip -d $__CrossDir
fi
if [ ! -d $__lldb_Dir ]; then
mkdir -p $__lldb_Dir
echo Downloading LLDB into $__lldb_Dir
wget -q --progress=bar:force:noscroll --show-progress https://dl.google.com/android/repository/lldb-2.3.3614996-linux-x86_64.zip -O $__CrossDir/lldb-2.3.3614996-linux-x86_64.zip
unzip -q $__CrossDir/lldb-2.3.3614996-linux-x86_64.zip -d $__lldb_Dir
fi
echo "Download dependencies..."
__TmpDir=$__CrossDir/tmp/$__BuildArch/
mkdir -p "$__TmpDir"
# combined dependencies for coreclr, installer and libraries
__AndroidPackages="libicu"
__AndroidPackages+=" libandroid-glob"
__AndroidPackages+=" liblzma"
__AndroidPackages+=" krb5"
__AndroidPackages+=" openssl"
for path in $(wget -qO- http://termux.net/dists/stable/main/binary-$__AndroidArch/Packages |\
grep -A15 "Package: \(${__AndroidPackages// /\\|}\)" | grep -v "static\|tool" | grep Filename); do
if [[ "$path" != "Filename:" ]]; then
echo "Working on: $path"
wget -qO- http://termux.net/$path | dpkg -x - "$__TmpDir"
fi
done
cp -R "$__TmpDir/data/data/com.termux/files/usr/"* "$__ToolchainDir/sysroot/usr/"
# Generate platform file for build.sh script to assign to __DistroRid
echo "Generating platform file..."
echo "RID=android.${__ApiLevel}-${__BuildArch}" > $__ToolchainDir/sysroot/android_platform
echo "Now to build coreclr, libraries and installers; run:"
echo ROOTFS_DIR=\$\(realpath $__ToolchainDir/sysroot\) ./build.sh --cross --arch $__BuildArch \
--subsetCategory coreclr
echo ROOTFS_DIR=\$\(realpath $__ToolchainDir/sysroot\) ./build.sh --cross --arch $__BuildArch \
--subsetCategory libraries
echo ROOTFS_DIR=\$\(realpath $__ToolchainDir/sysroot\) ./build.sh --cross --arch $__BuildArch \
--subsetCategory installer
+278
View File
@@ -0,0 +1,278 @@
#!/usr/bin/env bash
usage()
{
echo "Usage: $0 [BuildArch] [CodeName] [lldbx.y] [--skipunmount] --rootfsdir <directory>]"
echo "BuildArch can be: arm(default), armel, arm64, x86"
echo "CodeName - optional, Code name for Linux, can be: trusty, xenial(default), zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen."
echo " for FreeBSD can be: freebsd11 or freebsd12."
echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine and FReeBSD"
echo "--skipunmount - optional, will skip the unmount of rootfs folder."
exit 1
}
__CodeName=xenial
__CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__InitialDir=$PWD
__BuildArch=arm
__UbuntuArch=armhf
__UbuntuRepo="http://ports.ubuntu.com/"
__LLDB_Package="liblldb-3.9-dev"
__SkipUnmount=0
# base development support
__UbuntuPackages="build-essential"
__AlpinePackages="alpine-base"
__AlpinePackages+=" build-base"
__AlpinePackages+=" linux-headers"
__AlpinePackagesEdgeTesting=" lldb-dev"
__AlpinePackagesEdgeMain=" llvm9-libs"
__AlpinePackagesEdgeMain+=" python3"
# symlinks fixer
__UbuntuPackages+=" symlinks"
# CoreCLR and CoreFX dependencies
__UbuntuPackages+=" libicu-dev"
__UbuntuPackages+=" liblttng-ust-dev"
__UbuntuPackages+=" libunwind8-dev"
__AlpinePackages+=" gettext-dev"
__AlpinePackages+=" icu-dev"
__AlpinePackages+=" libunwind-dev"
__AlpinePackages+=" lttng-ust-dev"
# CoreFX dependencies
__UbuntuPackages+=" libcurl4-openssl-dev"
__UbuntuPackages+=" libkrb5-dev"
__UbuntuPackages+=" libssl-dev"
__UbuntuPackages+=" zlib1g-dev"
__AlpinePackages+=" curl-dev"
__AlpinePackages+=" krb5-dev"
__AlpinePackages+=" openssl-dev"
__AlpinePackages+=" zlib-dev"
__FreeBSDBase="12.1-RELEASE"
__FreeBSDPkg="1.10.5"
__FreeBSDPackages="libunwind"
__FreeBSDPackages+=" icu"
__FreeBSDPackages+=" libinotify"
__FreeBSDPackages+=" lttng-ust"
__FreeBSDPackages+=" llvm-90"
__FreeBSDPackages+=" krb5"
__UnprocessedBuildArgs=
while :; do
if [ $# -le 0 ]; then
break
fi
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
-?|-h|--help)
usage
exit 1
;;
arm)
__BuildArch=arm
__UbuntuArch=armhf
__AlpineArch=armhf
__QEMUArch=arm
;;
arm64)
__BuildArch=arm64
__UbuntuArch=arm64
__AlpineArch=aarch64
__QEMUArch=aarch64
;;
armel)
__BuildArch=armel
__UbuntuArch=armel
__UbuntuRepo="http://ftp.debian.org/debian/"
__CodeName=jessie
;;
x86)
__BuildArch=x86
__UbuntuArch=i386
__UbuntuRepo="http://archive.ubuntu.com/ubuntu/"
;;
lldb3.6)
__LLDB_Package="lldb-3.6-dev"
;;
lldb3.8)
__LLDB_Package="lldb-3.8-dev"
;;
lldb3.9)
__LLDB_Package="liblldb-3.9-dev"
;;
lldb4.0)
__LLDB_Package="liblldb-4.0-dev"
;;
lldb5.0)
__LLDB_Package="liblldb-5.0-dev"
;;
lldb6.0)
__LLDB_Package="liblldb-6.0-dev"
;;
no-lldb)
unset __LLDB_Package
;;
trusty) # Ubuntu 14.04
if [ "$__CodeName" != "jessie" ]; then
__CodeName=trusty
fi
;;
xenial) # Ubuntu 16.04
if [ "$__CodeName" != "jessie" ]; then
__CodeName=xenial
fi
;;
zesty) # Ubuntu 17.04
if [ "$__CodeName" != "jessie" ]; then
__CodeName=zesty
fi
;;
bionic) # Ubuntu 18.04
if [ "$__CodeName" != "jessie" ]; then
__CodeName=bionic
fi
;;
jessie) # Debian 8
__CodeName=jessie
__UbuntuRepo="http://ftp.debian.org/debian/"
;;
stretch) # Debian 9
__CodeName=stretch
__UbuntuRepo="http://ftp.debian.org/debian/"
__LLDB_Package="liblldb-6.0-dev"
;;
buster) # Debian 10
__CodeName=buster
__UbuntuRepo="http://ftp.debian.org/debian/"
__LLDB_Package="liblldb-6.0-dev"
;;
tizen)
if [ "$__BuildArch" != "armel" ]; then
echo "Tizen is available only for armel."
usage;
exit 1;
fi
__CodeName=
__UbuntuRepo=
__Tizen=tizen
;;
alpine)
__CodeName=alpine
__UbuntuRepo=
;;
freebsd11)
__FreeBSDBase="11.3-RELEASE"
;&
freebsd12)
__CodeName=freebsd
__BuildArch=x64
__SkipUnmount=1
;;
--skipunmount)
__SkipUnmount=1
;;
--rootfsdir|-rootfsdir)
shift
__RootfsDir=$1
;;
*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
;;
esac
shift
done
if [ "$__BuildArch" == "armel" ]; then
__LLDB_Package="lldb-3.5-dev"
fi
__UbuntuPackages+=" ${__LLDB_Package:-}"
if [ -z "$__RootfsDir" ] && [ ! -z "$ROOTFS_DIR" ]; then
__RootfsDir=$ROOTFS_DIR
fi
if [ -z "$__RootfsDir" ]; then
__RootfsDir="$__CrossDir/../../../.tools/rootfs/$__BuildArch"
fi
if [ -d "$__RootfsDir" ]; then
if [ $__SkipUnmount == 0 ]; then
umount $__RootfsDir/*
fi
rm -rf $__RootfsDir
fi
if [[ "$__CodeName" == "alpine" ]]; then
__ApkToolsVersion=2.9.1
__AlpineVersion=3.9
__ApkToolsDir=$(mktemp -d)
wget https://github.com/alpinelinux/apk-tools/releases/download/v$__ApkToolsVersion/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz -P $__ApkToolsDir
tar -xf $__ApkToolsDir/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz -C $__ApkToolsDir
mkdir -p $__RootfsDir/usr/bin
cp -v /usr/bin/qemu-$__QEMUArch-static $__RootfsDir/usr/bin
$__ApkToolsDir/apk-tools-$__ApkToolsVersion/apk \
-X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/main \
-X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/community \
-U --allow-untrusted --root $__RootfsDir --arch $__AlpineArch --initdb \
add $__AlpinePackages
$__ApkToolsDir/apk-tools-$__ApkToolsVersion/apk \
-X http://dl-cdn.alpinelinux.org/alpine/edge/main \
-U --allow-untrusted --root $__RootfsDir --arch $__AlpineArch --initdb \
add $__AlpinePackagesEdgeMain
$__ApkToolsDir/apk-tools-$__ApkToolsVersion/apk \
-X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
-U --allow-untrusted --root $__RootfsDir --arch $__AlpineArch --initdb \
add $__AlpinePackagesEdgeTesting
rm -r $__ApkToolsDir
elif [[ "$__CodeName" == "freebsd" ]]; then
mkdir -p $__RootfsDir/usr/local/etc
wget -O - https://download.freebsd.org/ftp/releases/amd64/${__FreeBSDBase}/base.txz | tar -C $__RootfsDir -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version
# For now, ask for 11 ABI even on 12. This can be revisited later.
echo "ABI = \"FreeBSD:11:amd64\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > ${__RootfsDir}/usr/local/etc/pkg.conf
echo "FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"${__RootfsDir}/usr/share/keys/pkg\", enabled: yes }" > ${__RootfsDir}/etc/pkg/FreeBSD.conf
mkdir -p $__RootfsDir/tmp
# get and build package manager
wget -O - https://github.com/freebsd/pkg/archive/${__FreeBSDPkg}.tar.gz | tar -C $__RootfsDir/tmp -zxf -
cd $__RootfsDir/tmp/pkg-${__FreeBSDPkg}
./autogen.sh && ./configure --prefix=$__RootfsDir/host && make install
rm -rf $__RootfsDir/tmp/pkg-${__FreeBSDPkg}
# install packages we need.
$__RootfsDir/host/sbin/pkg -r $__RootfsDir -C $__RootfsDir/usr/local/etc/pkg.conf update
$__RootfsDir/host/sbin/pkg -r $__RootfsDir -C $__RootfsDir/usr/local/etc/pkg.conf install --yes $__FreeBSDPackages
elif [[ -n $__CodeName ]]; then
qemu-debootstrap --arch $__UbuntuArch $__CodeName $__RootfsDir $__UbuntuRepo
cp $__CrossDir/$__BuildArch/sources.list.$__CodeName $__RootfsDir/etc/apt/sources.list
chroot $__RootfsDir apt-get update
chroot $__RootfsDir apt-get -f -y install
chroot $__RootfsDir apt-get -y install $__UbuntuPackages
chroot $__RootfsDir symlinks -cr /usr
if [ $__SkipUnmount == 0 ]; then
umount $__RootfsDir/*
fi
if [[ "$__BuildArch" == "arm" && "$__CodeName" == "trusty" ]]; then
pushd $__RootfsDir
patch -p1 < $__CrossDir/$__BuildArch/trusty.patch
patch -p1 < $__CrossDir/$__BuildArch/trusty-lttng-2.4.patch
popd
fi
elif [ "$__Tizen" == "tizen" ]; then
ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh
else
echo "Unsupported target platform."
usage;
exit 1
fi
+162
View File
@@ -0,0 +1,162 @@
set(CROSS_ROOTFS $ENV{ROOTFS_DIR})
set(TARGET_ARCH_NAME $ENV{TARGET_BUILD_ARCH})
if(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version)
set(CMAKE_SYSTEM_NAME FreeBSD)
else()
set(CMAKE_SYSTEM_NAME Linux)
endif()
set(CMAKE_SYSTEM_VERSION 1)
if(TARGET_ARCH_NAME STREQUAL "armel")
set(CMAKE_SYSTEM_PROCESSOR armv7l)
set(TOOLCHAIN "arm-linux-gnueabi")
if("$ENV{__DistroRid}" MATCHES "tizen.*")
set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/6.2.1")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "arm")
set(CMAKE_SYSTEM_PROCESSOR armv7l)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf)
set(TOOLCHAIN "armv6-alpine-linux-musleabihf")
else()
set(TOOLCHAIN "arm-linux-gnueabihf")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "arm64")
set(CMAKE_SYSTEM_PROCESSOR aarch64)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl)
set(TOOLCHAIN "aarch64-alpine-linux-musl")
else()
set(TOOLCHAIN "aarch64-linux-gnu")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86")
set(CMAKE_SYSTEM_PROCESSOR i686)
set(TOOLCHAIN "i686-linux-gnu")
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(triple "x86_64-unknown-freebsd11")
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64 and x86 are supported!")
endif()
if(DEFINED ENV{TOOLCHAIN})
set(TOOLCHAIN $ENV{TOOLCHAIN})
endif()
# Specify include paths
if(TARGET_ARCH_NAME STREQUAL "armel")
if(DEFINED TIZEN_TOOLCHAIN)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi)
endif()
endif()
if("$ENV{__DistroRid}" MATCHES "android.*")
if(TARGET_ARCH_NAME STREQUAL "arm")
set(ANDROID_ABI armeabi-v7a)
elseif(TARGET_ARCH_NAME STREQUAL "arm64")
set(ANDROID_ABI arm64-v8a)
endif()
# extract platform number required by the NDK's toolchain
string(REGEX REPLACE ".*\\.([0-9]+)-.*" "\\1" ANDROID_PLATFORM "$ENV{__DistroRid}")
set(ANDROID_TOOLCHAIN clang)
set(FEATURE_EVENT_TRACE 0) # disable event trace as there is no lttng-ust package in termux repository
set(CMAKE_SYSTEM_LIBRARY_PATH "${CROSS_ROOTFS}/usr/lib")
set(CMAKE_SYSTEM_INCLUDE_PATH "${CROSS_ROOTFS}/usr/include")
# include official NDK toolchain script
include(${CROSS_ROOTFS}/../build/cmake/android.toolchain.cmake)
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
# we cross-compile by instructing clang
set(CMAKE_C_COMPILER_TARGET ${triple})
set(CMAKE_CXX_COMPILER_TARGET ${triple})
set(CMAKE_ASM_COMPILER_TARGET ${triple})
set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
else()
set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
set(CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
endif()
# Specify link flags
if(TARGET_ARCH_NAME STREQUAL "armel")
if(DEFINED TIZEN_TOOLCHAIN) # For Tizen only
add_link_options("-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
add_link_options("-L${CROSS_ROOTFS}/lib")
add_link_options("-L${CROSS_ROOTFS}/usr/lib")
add_link_options("-L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86")
add_link_options(-m32)
endif()
# Specify compile options
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$" AND NOT "$ENV{__DistroRid}" MATCHES "android.*")
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN})
endif()
if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$")
add_compile_options(-mthumb)
if (NOT DEFINED CLR_ARM_FPU_TYPE)
set (CLR_ARM_FPU_TYPE vfpv3)
endif (NOT DEFINED CLR_ARM_FPU_TYPE)
add_compile_options (-mfpu=${CLR_ARM_FPU_TYPE})
if (NOT DEFINED CLR_ARM_FPU_CAPABILITY)
set (CLR_ARM_FPU_CAPABILITY 0x7)
endif (NOT DEFINED CLR_ARM_FPU_CAPABILITY)
add_definitions (-DCLR_ARM_FPU_CAPABILITY=${CLR_ARM_FPU_CAPABILITY})
if(TARGET_ARCH_NAME STREQUAL "armel")
add_compile_options(-mfloat-abi=softfp)
if(DEFINED TIZEN_TOOLCHAIN)
add_compile_options(-Wno-deprecated-declarations) # compile-time option
add_compile_options(-D__extern_always_inline=inline) # compile-time option
endif()
endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86")
add_compile_options(-m32)
add_compile_options(-Wno-error=unused-command-line-argument)
endif()
# Set LLDB include and library paths for builds that need lldb.
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$")
if(TARGET_ARCH_NAME STREQUAL "x86")
set(LLVM_CROSS_DIR "$ENV{LLVM_CROSS_HOME}")
else() # arm/armel case
set(LLVM_CROSS_DIR "$ENV{LLVM_ARM_HOME}")
endif()
if(LLVM_CROSS_DIR)
set(WITH_LLDB_LIBS "${LLVM_CROSS_DIR}/lib/" CACHE STRING "")
set(WITH_LLDB_INCLUDES "${LLVM_CROSS_DIR}/include" CACHE STRING "")
set(LLDB_H "${WITH_LLDB_INCLUDES}" CACHE STRING "")
set(LLDB "${LLVM_CROSS_DIR}/lib/liblldb.so" CACHE STRING "")
else()
if(TARGET_ARCH_NAME STREQUAL "x86")
set(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/i386-linux-gnu" CACHE STRING "")
set(CHECK_LLVM_DIR "${CROSS_ROOTFS}/usr/lib/llvm-3.8/include")
if(EXISTS "${CHECK_LLVM_DIR}" AND IS_DIRECTORY "${CHECK_LLVM_DIR}")
set(WITH_LLDB_INCLUDES "${CHECK_LLVM_DIR}")
else()
set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include")
endif()
else() # arm/armel case
set(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}" CACHE STRING "")
set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include" CACHE STRING "")
endif()
endif()
endif()
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+11
View File
@@ -0,0 +1,11 @@
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted
deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted
deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted
deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted
deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
+47
View File
@@ -0,0 +1,47 @@
param (
$darcVersion = $null,
$versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16',
$verbosity = 'minimal',
$toolpath = $null
)
. $PSScriptRoot\tools.ps1
function InstallDarcCli ($darcVersion, $toolpath) {
$darcCliPackageName = 'microsoft.dotnet.darc'
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = & "$dotnet" tool list -g
if ($toolList -like "*$darcCliPackageName*") {
& "$dotnet" tool uninstall $darcCliPackageName -g
}
# If the user didn't explicitly specify the darc version,
# query the Maestro API for the correct version of darc to install.
if (-not $darcVersion) {
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
}
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
Write-Host "Installing Darc CLI version $darcVersion..."
Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.'
if (-not $toolpath) {
Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g
}else {
Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity --tool-path '$toolpath'"
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath"
}
}
try {
InstallDarcCli $darcVersion $toolpath
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Darc' -Message $_
ExitWithExitCode 1
}
+82
View File
@@ -0,0 +1,82 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
darcVersion=''
versionEndpoint='https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16'
verbosity='minimal'
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
--darcversion)
darcVersion=$2
shift
;;
--versionendpoint)
versionEndpoint=$2
shift
;;
--verbosity)
verbosity=$2
shift
;;
--toolpath)
toolpath=$2
shift
;;
*)
echo "Invalid argument: $1"
usage
exit 1
;;
esac
shift
done
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/tools.sh"
if [ -z "$darcVersion" ]; then
darcVersion=$(curl -X GET "$versionEndpoint" -H "accept: text/plain")
fi
function InstallDarcCli {
local darc_cli_package_name="microsoft.dotnet.darc"
InitializeDotNetCli
local dotnet_root=$_InitializeDotNetCli
if [ -z "$toolpath" ]; then
local tool_list=$($dotnet_root/dotnet tool list -g)
if [[ $tool_list = *$darc_cli_package_name* ]]; then
echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g)
fi
else
local tool_list=$($dotnet_root/dotnet tool list --tool-path "$toolpath")
if [[ $tool_list = *$darc_cli_package_name* ]]; then
echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name --tool-path "$toolpath")
fi
fi
local arcadeServicesSource="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"
echo "Installing Darc CLI version $darcVersion..."
echo "You may need to restart your command shell if this is the first dotnet tool you have installed."
if [ -z "$toolpath" ]; then
echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g)
else
echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath")
fi
}
InstallDarcCli
+2
View File
@@ -0,0 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*"
+28
View File
@@ -0,0 +1,28 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $verbosity = 'minimal',
[string] $architecture = '',
[string] $version = 'Latest',
[string] $runtime = 'dotnet',
[string] $RuntimeSourceFeed = '',
[string] $RuntimeSourceFeedKey = ''
)
. $PSScriptRoot\tools.ps1
$dotnetRoot = Join-Path $RepoRoot '.dotnet'
$installdir = $dotnetRoot
try {
if ($architecture -and $architecture.Trim() -eq 'x86') {
$installdir = Join-Path $installdir 'x86'
}
InstallDotNet $installdir $version $architecture $runtime $true -RuntimeSourceFeed $RuntimeSourceFeed -RuntimeSourceFeedKey $RuntimeSourceFeedKey
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
ExitWithExitCode 1
}
ExitWithExitCode 0
+89
View File
@@ -0,0 +1,89 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/tools.sh"
version='Latest'
architecture=''
runtime='dotnet'
runtimeSourceFeed=''
runtimeSourceFeedKey=''
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
-version|-v)
shift
version="$1"
;;
-architecture|-a)
shift
architecture="$1"
;;
-runtime|-r)
shift
runtime="$1"
;;
-runtimesourcefeed)
shift
runtimeSourceFeed="$1"
;;
-runtimesourcefeedkey)
shift
runtimeSourceFeedKey="$1"
;;
*)
Write-PipelineTelemetryError -Category 'Build' -Message "Invalid argument: $1"
exit 1
;;
esac
shift
done
# Use uname to determine what the CPU is.
cpuname=$(uname -p)
# Some Linux platforms report unknown for platform, but the arch for machine.
if [[ "$cpuname" == "unknown" ]]; then
cpuname=$(uname -m)
fi
case $cpuname in
aarch64)
buildarch=arm64
;;
amd64|x86_64)
buildarch=x64
;;
armv*l)
buildarch=arm
;;
i686)
buildarch=x86
;;
*)
echo "Unknown CPU $cpuname detected, treating it as x64"
buildarch=x64
;;
esac
dotnetRoot="$repo_root/.dotnet"
if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then
dotnetRoot="$dotnetRoot/$architecture"
fi
InstallDotNet $dotnetRoot $version "$architecture" $runtime true $runtimeSourceFeed $runtimeSourceFeedKey || {
local exit_code=$?
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
ExitWithExitCode $exit_code
}
ExitWithExitCode 0
@@ -0,0 +1,13 @@
param(
[string] $token
)
. $PSScriptRoot\pipeline-logging-functions.ps1
# Write-PipelineSetVariable will no-op if a variable named $ci is not defined
# Since this script is only ever called in AzDO builds, just universally set it
$ci = $true
Write-PipelineSetVariable -Name 'VSS_NUGET_ACCESSTOKEN' -Value $token -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'VSS_NUGET_URI_PREFIXES' -Value 'https://dnceng.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/dnceng/;https://devdiv.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/devdiv/' -IsMultiJobVariable $false
+86
View File
@@ -0,0 +1,86 @@
Param(
[Parameter(Mandatory=$true)][string] $barToken, # Token generated at https://maestro-prod.westus2.cloudapp.azure.com/Account/Tokens
[Parameter(Mandatory=$true)][string] $gitHubPat, # GitHub personal access token from https://github.com/settings/tokens (no auth scopes needed)
[Parameter(Mandatory=$true)][string] $azdoPat, # Azure Dev Ops tokens from https://dev.azure.com/dnceng/_details/security/tokens (code read scope needed)
[Parameter(Mandatory=$true)][string] $outputFolder, # Where the graphviz.txt file will be created
[string] $darcVersion, # darc's version
[string] $graphvizVersion = '2.38', # GraphViz version
[switch] $includeToolset # Whether the graph should include toolset dependencies or not. i.e. arcade, optimization. For more about
# toolset dependencies see https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#toolset-vs-product-dependencies
)
function CheckExitCode ([string]$stage)
{
$exitCode = $LASTEXITCODE
if ($exitCode -ne 0) {
Write-PipelineTelemetryError -Category 'Arcade' -Message "Something failed in stage: '$stage'. Check for errors above. Exiting now..."
ExitWithExitCode $exitCode
}
}
try {
$ErrorActionPreference = 'Stop'
. $PSScriptRoot\tools.ps1
Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1')
Push-Location $PSScriptRoot
Write-Host 'Installing darc...'
. .\darc-init.ps1 -darcVersion $darcVersion
CheckExitCode 'Running darc-init'
$engCommonBaseDir = Join-Path $PSScriptRoot 'native\'
$graphvizInstallDir = CommonLibrary\Get-NativeInstallDirectory
$nativeToolBaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external'
$installBin = Join-Path $graphvizInstallDir 'bin'
Write-Host 'Installing dot...'
.\native\install-tool.ps1 -ToolName graphviz -InstallPath $installBin -BaseUri $nativeToolBaseUri -CommonLibraryDirectory $engCommonBaseDir -Version $graphvizVersion -Verbose
$darcExe = "$env:USERPROFILE\.dotnet\tools"
$darcExe = Resolve-Path "$darcExe\darc.exe"
Create-Directory $outputFolder
# Generate 3 graph descriptions:
# 1. Flat with coherency information
# 2. Graphviz (dot) file
# 3. Standard dependency graph
$graphVizFilePath = "$outputFolder\graphviz.txt"
$graphVizImageFilePath = "$outputFolder\graph.png"
$normalGraphFilePath = "$outputFolder\graph-full.txt"
$flatGraphFilePath = "$outputFolder\graph-flat.txt"
$baseOptions = @( '--github-pat', "$gitHubPat", '--azdev-pat', "$azdoPat", '--password', "$barToken" )
if ($includeToolset) {
Write-Host 'Toolsets will be included in the graph...'
$baseOptions += @( '--include-toolset' )
}
Write-Host 'Generating standard dependency graph...'
& "$darcExe" get-dependency-graph @baseOptions --output-file $normalGraphFilePath
CheckExitCode 'Generating normal dependency graph'
Write-Host 'Generating flat dependency graph and graphviz file...'
& "$darcExe" get-dependency-graph @baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath
CheckExitCode 'Generating flat and graphviz dependency graph'
Write-Host "Generating graph image $graphVizFilePath"
$dotFilePath = Join-Path $installBin "graphviz\$graphvizVersion\release\bin\dot.exe"
& "$dotFilePath" -Tpng -o"$graphVizImageFilePath" "$graphVizFilePath"
CheckExitCode 'Generating graphviz image'
Write-Host "'$graphVizFilePath', '$flatGraphFilePath', '$normalGraphFilePath' and '$graphVizImageFilePath' created!"
}
catch {
if (!$includeToolset) {
Write-Host 'This might be a toolset repo which includes only toolset dependencies. ' -NoNewline -ForegroundColor Yellow
Write-Host 'Since -includeToolset is not set there is no graph to create. Include -includeToolset and try again...' -ForegroundColor Yellow
}
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Arcade' -Message $_
ExitWithExitCode 1
} finally {
Pop-Location
}
+26
View File
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">
<PropertyGroup>
<Language>msbuild</Language>
</PropertyGroup>
<ItemGroup>
<HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)">
<PayloadDirectory>%(Identity)</PayloadDirectory>
</HelixCorrelationPayload>
</ItemGroup>
<ItemGroup>
<HelixWorkItem Include="WorkItem" Condition="'$(WorkItemDirectory)' != ''">
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<Command>$(WorkItemCommand)</Command>
<Timeout Condition="'$(WorkItemTimeout)' != ''">$(WorkItemTimeout)</Timeout>
</HelixWorkItem>
</ItemGroup>
<ItemGroup>
<XUnitProject Include="$(XUnitProjects.Split(';'))">
<Arguments />
</XUnitProject>
</ItemGroup>
</Project>
+3
View File
@@ -0,0 +1,3 @@
@echo off
powershell -NoProfile -NoLogo -ExecutionPolicy ByPass -command "& """%~dp0init-tools-native.ps1""" %*"
exit /b %ErrorLevel%
+152
View File
@@ -0,0 +1,152 @@
<#
.SYNOPSIS
Entry point script for installing native tools
.DESCRIPTION
Reads $RepoRoot\global.json file to determine native assets to install
and executes installers for those tools
.PARAMETER BaseUri
Base file directory or Url from which to acquire tool archives
.PARAMETER InstallDirectory
Directory to install native toolset. This is a command-line override for the default
Install directory precedence order:
- InstallDirectory command-line override
- NETCOREENG_INSTALL_DIRECTORY environment variable
- (default) %USERPROFILE%/.netcoreeng/native
.PARAMETER Clean
Switch specifying to not install anything, but cleanup native asset folders
.PARAMETER Force
Clean and then install tools
.PARAMETER DownloadRetries
Total number of retry attempts
.PARAMETER RetryWaitTimeInSeconds
Wait time between retry attempts in seconds
.PARAMETER GlobalJsonFile
File path to global.json file
.NOTES
#>
[CmdletBinding(PositionalBinding=$false)]
Param (
[string] $BaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external',
[string] $InstallDirectory,
[switch] $Clean = $False,
[switch] $Force = $False,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30,
[string] $GlobalJsonFile
)
if (!$GlobalJsonFile) {
$GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName 'global.json'
}
Set-StrictMode -version 2.0
$ErrorActionPreference='Stop'
. $PSScriptRoot\pipeline-logging-functions.ps1
Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1')
try {
# Define verbose switch if undefined
$Verbose = $VerbosePreference -Eq 'Continue'
$EngCommonBaseDir = Join-Path $PSScriptRoot 'native\'
$NativeBaseDir = $InstallDirectory
if (!$NativeBaseDir) {
$NativeBaseDir = CommonLibrary\Get-NativeInstallDirectory
}
$Env:CommonLibrary_NativeInstallDir = $NativeBaseDir
$InstallBin = Join-Path $NativeBaseDir 'bin'
$InstallerPath = Join-Path $EngCommonBaseDir 'install-tool.ps1'
# Process tools list
Write-Host "Processing $GlobalJsonFile"
If (-Not (Test-Path $GlobalJsonFile)) {
Write-Host "Unable to find '$GlobalJsonFile'"
exit 0
}
$NativeTools = Get-Content($GlobalJsonFile) -Raw |
ConvertFrom-Json |
Select-Object -Expand 'native-tools' -ErrorAction SilentlyContinue
if ($NativeTools) {
$NativeTools.PSObject.Properties | ForEach-Object {
$ToolName = $_.Name
$ToolVersion = $_.Value
$LocalInstallerArguments = @{ ToolName = "$ToolName" }
$LocalInstallerArguments += @{ InstallPath = "$InstallBin" }
$LocalInstallerArguments += @{ BaseUri = "$BaseUri" }
$LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" }
$LocalInstallerArguments += @{ Version = "$ToolVersion" }
if ($Verbose) {
$LocalInstallerArguments += @{ Verbose = $True }
}
if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') {
if($Force) {
$LocalInstallerArguments += @{ Force = $True }
}
}
if ($Clean) {
$LocalInstallerArguments += @{ Clean = $True }
}
Write-Verbose "Installing $ToolName version $ToolVersion"
Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'"
& $InstallerPath @LocalInstallerArguments
if ($LASTEXITCODE -Ne "0") {
$errMsg = "$ToolName installation failed"
if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) {
$showNativeToolsWarning = $true
if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) {
$showNativeToolsWarning = $false
}
if ($showNativeToolsWarning) {
Write-Warning $errMsg
}
$toolInstallationFailure = $true
} else {
# We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482
Write-Host $errMsg
exit 1
}
}
}
if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) {
# We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482
Write-Host 'Native tools bootstrap failed'
exit 1
}
}
else {
Write-Host 'No native tools defined in global.json'
exit 0
}
if ($Clean) {
exit 0
}
if (Test-Path $InstallBin) {
Write-Host 'Native tools are available from ' (Convert-Path -Path $InstallBin)
Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)"
return $InstallBin
}
else {
Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message 'Native tools install directory does not exist, installation failed'
exit 1
}
exit 0
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message $_
ExitWithExitCode 1
}
+173
View File
@@ -0,0 +1,173 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
base_uri='https://netcorenativeassets.blob.core.windows.net/resource-packages/external'
install_directory=''
clean=false
force=false
download_retries=5
retry_wait_time_seconds=30
global_json_file="$(dirname "$(dirname "${scriptroot}")")/global.json"
declare -A native_assets
. $scriptroot/pipeline-logging-functions.sh
. $scriptroot/native/common-library.sh
while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--baseuri)
base_uri=$2
shift 2
;;
--installdirectory)
install_directory=$2
shift 2
;;
--clean)
clean=true
shift 1
;;
--force)
force=true
shift 1
;;
--donotabortonfailure)
donotabortonfailure=true
shift 1
;;
--donotdisplaywarnings)
donotdisplaywarnings=true
shift 1
;;
--downloadretries)
download_retries=$2
shift 2
;;
--retrywaittimeseconds)
retry_wait_time_seconds=$2
shift 2
;;
--help)
echo "Common settings:"
echo " --installdirectory Directory to install native toolset."
echo " This is a command-line override for the default"
echo " Install directory precedence order:"
echo " - InstallDirectory command-line override"
echo " - NETCOREENG_INSTALL_DIRECTORY environment variable"
echo " - (default) %USERPROFILE%/.netcoreeng/native"
echo ""
echo " --clean Switch specifying not to install anything, but cleanup native asset folders"
echo " --donotabortonfailure Switch specifiying whether to abort native tools installation on failure"
echo " --donotdisplaywarnings Switch specifiying whether to display warnings during native tools installation on failure"
echo " --force Clean and then install tools"
echo " --help Print help and exit"
echo ""
echo "Advanced settings:"
echo " --baseuri <value> Base URI for where to download native tools from"
echo " --downloadretries <value> Number of times a download should be attempted"
echo " --retrywaittimeseconds <value> Wait time between download attempts"
echo ""
exit 0
;;
esac
done
function ReadGlobalJsonNativeTools {
# Get the native-tools section from the global.json.
local native_tools_section=$(cat $global_json_file | awk '/"native-tools"/,/}/')
# Only extract the contents of the object.
local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}')
native_tools_list=${native_tools_list//[\" ]/}
native_tools_list=$( echo "$native_tools_list" | sed 's/\s//g' | sed 's/,/\n/g' )
local old_IFS=$IFS
while read -r line; do
# Lines are of the form: 'tool:version'
IFS=:
while read -r key value; do
native_assets[$key]=$value
done <<< "$line"
done <<< "$native_tools_list"
IFS=$old_IFS
return 0;
}
native_base_dir=$install_directory
if [[ -z $install_directory ]]; then
native_base_dir=$(GetNativeInstallDirectory)
fi
install_bin="${native_base_dir}/bin"
installed_any=false
ReadGlobalJsonNativeTools
if [[ ${#native_assets[@]} -eq 0 ]]; then
echo "No native tools defined in global.json"
exit 0;
else
native_installer_dir="$scriptroot/native"
for tool in "${!native_assets[@]}"
do
tool_version=${native_assets[$tool]}
installer_path="$native_installer_dir/install-$tool.sh"
installer_command="$installer_path"
installer_command+=" --baseuri $base_uri"
installer_command+=" --installpath $install_bin"
installer_command+=" --version $tool_version"
echo $installer_command
if [[ $force = true ]]; then
installer_command+=" --force"
fi
if [[ $clean = true ]]; then
installer_command+=" --clean"
fi
if [[ -a $installer_path ]]; then
$installer_command
if [[ $? != 0 ]]; then
if [[ $donotabortonfailure = true ]]; then
if [[ $donotdisplaywarnings != true ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed"
fi
else
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed"
exit 1
fi
else
$installed_any = true
fi
else
if [[ $donotabortonfailure == true ]]; then
if [[ $donotdisplaywarnings != true ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script"
fi
else
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script"
exit 1
fi
fi
done
fi
if [[ $clean = true ]]; then
exit 0
fi
if [[ -d $install_bin ]]; then
echo "Native tools are available from $install_bin"
echo "##vso[task.prependpath]$install_bin"
else
if [[ $installed_any = true ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed"
exit 1
fi
fi
exit 0
+133
View File
@@ -0,0 +1,133 @@
param(
[Parameter(Mandatory=$true)][string] $Operation,
[string] $AuthToken,
[string] $CommitSha,
[string] $RepoName,
[switch] $IsFeedPrivate
)
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 2.0
. $PSScriptRoot\tools.ps1
# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed
# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in
# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. This should ONLY be called from identified
# internal builds
function SetupCredProvider {
param(
[string] $AuthToken
)
# Install the Cred Provider NuGet plugin
Write-Host 'Setting up Cred Provider NuGet plugin in the agent...'
Write-Host "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..."
$url = 'https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1'
Write-Host "Writing the contents of 'installcredprovider.ps1' locally..."
Invoke-WebRequest $url -OutFile installcredprovider.ps1
Write-Host 'Installing plugin...'
.\installcredprovider.ps1 -Force
Write-Host "Deleting local copy of 'installcredprovider.ps1'..."
Remove-Item .\installcredprovider.ps1
if (-Not("$env:USERPROFILE\.nuget\plugins\netcore")) {
Write-PipelineTelemetryError -Category 'Arcade' -Message 'CredProvider plugin was not installed correctly!'
ExitWithExitCode 1
}
else {
Write-Host 'CredProvider plugin was installed correctly!'
}
# Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable
# feeds successfully
$nugetConfigPath = "$RepoRoot\NuGet.config"
if (-Not (Test-Path -Path $nugetConfigPath)) {
Write-PipelineTelemetryError -Category 'Build' -Message 'NuGet.config file not found in repo root!'
ExitWithExitCode 1
}
$endpoints = New-Object System.Collections.ArrayList
$nugetConfigPackageSources = Select-Xml -Path $nugetConfigPath -XPath "//packageSources/add[contains(@key, 'darc-int-')]/@value" | foreach{$_.Node.Value}
if (($nugetConfigPackageSources | Measure-Object).Count -gt 0 ) {
foreach ($stableRestoreResource in $nugetConfigPackageSources) {
$trimmedResource = ([string]$stableRestoreResource).Trim()
[void]$endpoints.Add(@{endpoint="$trimmedResource"; password="$AuthToken"})
}
}
if (($endpoints | Measure-Object).Count -gt 0) {
# Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}'
$endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress
# Create the environment variables the AzDo way
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $endpointCredentials -Properties @{
'variable' = 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS'
'issecret' = 'false'
}
# We don't want sessions cached since we will be updating the endpoints quite frequently
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data 'False' -Properties @{
'variable' = 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED'
'issecret' = 'false'
}
}
else
{
Write-Host 'No internal endpoints found in NuGet.config'
}
}
#Workaround for https://github.com/microsoft/msbuild/issues/4430
function InstallDotNetSdkAndRestoreArcade {
$dotnetTempDir = "$RepoRoot\dotnet"
$dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*)
$dotnet = "$dotnetTempDir\dotnet.exe"
$restoreProjPath = "$PSScriptRoot\restore.proj"
Write-Host "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..."
InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion"
'<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' | Out-File "$restoreProjPath"
& $dotnet restore $restoreProjPath
Write-Host 'Arcade SDK restored!'
if (Test-Path -Path $restoreProjPath) {
Remove-Item $restoreProjPath
}
if (Test-Path -Path $dotnetTempDir) {
Remove-Item $dotnetTempDir -Recurse
}
}
try {
Push-Location $PSScriptRoot
if ($Operation -like 'setup') {
SetupCredProvider $AuthToken
}
elseif ($Operation -like 'install-restore') {
InstallDotNetSdkAndRestoreArcade
}
else {
Write-PipelineTelemetryError -Category 'Arcade' -Message "Unknown operation '$Operation'!"
ExitWithExitCode 1
}
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Arcade' -Message $_
ExitWithExitCode 1
}
finally {
Pop-Location
}
+142
View File
@@ -0,0 +1,142 @@
#!/usr/bin/env bash
set -e
# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed
# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in
# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables.
# This should ONLY be called from identified internal builds
function SetupCredProvider {
local authToken=$1
# Install the Cred Provider NuGet plugin
echo "Setting up Cred Provider NuGet plugin in the agent..."...
echo "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..."
local url="https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh"
echo "Writing the contents of 'installcredprovider.ps1' locally..."
local installcredproviderPath="installcredprovider.sh"
if command -v curl > /dev/null; then
curl $url > "$installcredproviderPath"
else
wget -q -O "$installcredproviderPath" "$url"
fi
echo "Installing plugin..."
. "$installcredproviderPath"
echo "Deleting local copy of 'installcredprovider.sh'..."
rm installcredprovider.sh
if [ ! -d "$HOME/.nuget/plugins" ]; then
Write-PipelineTelemetryError -category 'Build' 'CredProvider plugin was not installed correctly!'
ExitWithExitCode 1
else
echo "CredProvider plugin was installed correctly!"
fi
# Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable
# feeds successfully
local nugetConfigPath="$repo_root/NuGet.config"
if [ ! "$nugetConfigPath" ]; then
Write-PipelineTelemetryError -category 'Build' "NuGet.config file not found in repo's root!"
ExitWithExitCode 1
fi
local endpoints='['
local nugetConfigPackageValues=`cat "$nugetConfigPath" | grep "key=\"darc-int-"`
local pattern="value=\"(.*)\""
for value in $nugetConfigPackageValues
do
if [[ $value =~ $pattern ]]; then
local endpoint="${BASH_REMATCH[1]}"
endpoints+="{\"endpoint\": \"$endpoint\", \"password\": \"$authToken\"},"
fi
done
endpoints=${endpoints%?}
endpoints+=']'
if [ ${#endpoints} -gt 2 ]; then
# Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}'
local endpointCredentials="{\"endpointCredentials\": "$endpoints"}"
echo "##vso[task.setvariable variable=VSS_NUGET_EXTERNAL_FEED_ENDPOINTS]$endpointCredentials"
echo "##vso[task.setvariable variable=NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED]False"
else
echo "No internal endpoints found in NuGet.config"
fi
}
# Workaround for https://github.com/microsoft/msbuild/issues/4430
function InstallDotNetSdkAndRestoreArcade {
local dotnetTempDir="$repo_root/dotnet"
local dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*)
local restoreProjPath="$repo_root/eng/common/restore.proj"
echo "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..."
echo "<Project Sdk=\"Microsoft.DotNet.Arcade.Sdk\"/>" > "$restoreProjPath"
InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion"
local res=`$dotnetTempDir/dotnet restore $restoreProjPath`
echo "Arcade SDK restored!"
# Cleanup
if [ "$restoreProjPath" ]; then
rm "$restoreProjPath"
fi
if [ "$dotnetTempDir" ]; then
rm -r $dotnetTempDir
fi
}
source="${BASH_SOURCE[0]}"
operation=''
authToken=''
repoName=''
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
--operation)
operation=$2
shift
;;
--authtoken)
authToken=$2
shift
;;
*)
echo "Invalid argument: $1"
usage
exit 1
;;
esac
shift
done
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/tools.sh"
if [ "$operation" = "setup" ]; then
SetupCredProvider $authToken
elif [ "$operation" = "install-restore" ]; then
InstallDotNetSdkAndRestoreArcade
else
echo "Unknown operation '$operation'!"
fi
@@ -0,0 +1,4 @@
<!-- 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. -->
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
</Project>
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
</PropertyGroup>
<ItemGroup>
<!-- Clear references, the SDK may add some depending on UsuingToolXxx settings, but we only want to restore the following -->
<PackageReference Remove="@(PackageReference)"/>
<PackageReference Include="Microsoft.DotNet.IBCMerge" Version="$(MicrosoftDotNetIBCMergeVersion)" Condition="'$(UsingToolIbcOptimization)' == 'true'" />
<PackageReference Include="Drop.App" Version="$(DropAppVersion)" ExcludeAssets="all" Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'"/>
</ItemGroup>
<PropertyGroup>
<RestoreSources></RestoreSources>
<RestoreSources Condition="'$(UsingToolIbcOptimization)' == 'true'">
https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json;
</RestoreSources>
<RestoreSources Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'">
$(RestoreSources);
https://devdiv.pkgs.visualstudio.com/_packaging/VS/nuget/v3/index.json;
</RestoreSources>
</PropertyGroup>
<!-- Repository extensibility point -->
<Import Project="$(RepositoryEngineeringDir)InternalTools.props" Condition="Exists('$(RepositoryEngineeringDir)InternalTools.props')" />
</Project>
+26
View File
@@ -0,0 +1,26 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $verbosity = 'minimal',
[bool] $warnAsError = $true,
[bool] $nodeReuse = $true,
[switch] $ci,
[switch] $prepareMachine,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs
)
. $PSScriptRoot\tools.ps1
try {
if ($ci) {
$nodeReuse = $false
}
MSBuild @extraArgs
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Build' -Message $_
ExitWithExitCode 1
}
ExitWithExitCode 0
+58
View File
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
verbosity='minimal'
warn_as_error=true
node_reuse=true
prepare_machine=false
extra_args=''
while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--verbosity)
verbosity=$2
shift 2
;;
--warnaserror)
warn_as_error=$2
shift 2
;;
--nodereuse)
node_reuse=$2
shift 2
;;
--ci)
ci=true
shift 1
;;
--preparemachine)
prepare_machine=true
shift 1
;;
*)
extra_args="$extra_args $1"
shift 1
;;
esac
done
. "$scriptroot/tools.sh"
if [[ "$ci" == true ]]; then
node_reuse=false
fi
MSBuild $extra_args
ExitWithExitCode 0
+389
View File
@@ -0,0 +1,389 @@
<#
.SYNOPSIS
Helper module to install an archive to a directory
.DESCRIPTION
Helper module to download and extract an archive to a specified directory
.PARAMETER Uri
Uri of artifact to download
.PARAMETER InstallDirectory
Directory to extract artifact contents to
.PARAMETER Force
Force download / extraction if file or contents already exist. Default = False
.PARAMETER DownloadRetries
Total number of retry attempts. Default = 5
.PARAMETER RetryWaitTimeInSeconds
Wait time between retry attempts in seconds. Default = 30
.NOTES
Returns False if download or extraction fail, True otherwise
#>
function DownloadAndExtract {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $Uri,
[Parameter(Mandatory=$True)]
[string] $InstallDirectory,
[switch] $Force = $False,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30
)
# Define verbose switch if undefined
$Verbose = $VerbosePreference -Eq "Continue"
$TempToolPath = CommonLibrary\Get-TempPathFilename -Path $Uri
# Download native tool
$DownloadStatus = CommonLibrary\Get-File -Uri $Uri `
-Path $TempToolPath `
-DownloadRetries $DownloadRetries `
-RetryWaitTimeInSeconds $RetryWaitTimeInSeconds `
-Force:$Force `
-Verbose:$Verbose
if ($DownloadStatus -Eq $False) {
Write-Error "Download failed"
return $False
}
# Extract native tool
$UnzipStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath `
-OutputDirectory $InstallDirectory `
-Force:$Force `
-Verbose:$Verbose
if ($UnzipStatus -Eq $False) {
# Retry Download one more time with Force=true
$DownloadRetryStatus = CommonLibrary\Get-File -Uri $Uri `
-Path $TempToolPath `
-DownloadRetries 1 `
-RetryWaitTimeInSeconds $RetryWaitTimeInSeconds `
-Force:$True `
-Verbose:$Verbose
if ($DownloadRetryStatus -Eq $False) {
Write-Error "Last attempt of download failed as well"
return $False
}
# Retry unzip again one more time with Force=true
$UnzipRetryStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath `
-OutputDirectory $InstallDirectory `
-Force:$True `
-Verbose:$Verbose
if ($UnzipRetryStatus -Eq $False)
{
Write-Error "Last attempt of unzip failed as well"
# Clean up partial zips and extracts
if (Test-Path $TempToolPath) {
Remove-Item $TempToolPath -Force
}
if (Test-Path $InstallDirectory) {
Remove-Item $InstallDirectory -Force -Recurse
}
return $False
}
}
return $True
}
<#
.SYNOPSIS
Download a file, retry on failure
.DESCRIPTION
Download specified file and retry if attempt fails
.PARAMETER Uri
Uri of file to download. If Uri is a local path, the file will be copied instead of downloaded
.PARAMETER Path
Path to download or copy uri file to
.PARAMETER Force
Overwrite existing file if present. Default = False
.PARAMETER DownloadRetries
Total number of retry attempts. Default = 5
.PARAMETER RetryWaitTimeInSeconds
Wait time between retry attempts in seconds Default = 30
#>
function Get-File {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $Uri,
[Parameter(Mandatory=$True)]
[string] $Path,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30,
[switch] $Force = $False
)
$Attempt = 0
if ($Force) {
if (Test-Path $Path) {
Remove-Item $Path -Force
}
}
if (Test-Path $Path) {
Write-Host "File '$Path' already exists, skipping download"
return $True
}
$DownloadDirectory = Split-Path -ErrorAction Ignore -Path "$Path" -Parent
if (-Not (Test-Path $DownloadDirectory)) {
New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null
}
if (Test-Path -IsValid -Path $Uri) {
Write-Verbose "'$Uri' is a file path, copying file to '$Path'"
Copy-Item -Path $Uri -Destination $Path
return $?
}
else {
Write-Verbose "Downloading $Uri"
# Don't display the console progress UI - it's a huge perf hit
$ProgressPreference = 'SilentlyContinue'
while($Attempt -Lt $DownloadRetries)
{
try {
Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $Path
Write-Verbose "Downloaded to '$Path'"
return $True
}
catch {
$Attempt++
if ($Attempt -Lt $DownloadRetries) {
$AttemptsLeft = $DownloadRetries - $Attempt
Write-Warning "Download failed, $AttemptsLeft attempts remaining, will retry in $RetryWaitTimeInSeconds seconds"
Start-Sleep -Seconds $RetryWaitTimeInSeconds
}
else {
Write-Error $_
Write-Error $_.Exception
}
}
}
}
return $False
}
<#
.SYNOPSIS
Generate a shim for a native tool
.DESCRIPTION
Creates a wrapper script (shim) that passes arguments forward to native tool assembly
.PARAMETER ShimName
The name of the shim
.PARAMETER ShimDirectory
The directory where shims are stored
.PARAMETER ToolFilePath
Path to file that shim forwards to
.PARAMETER Force
Replace shim if already present. Default = False
.NOTES
Returns $True if generating shim succeeds, $False otherwise
#>
function New-ScriptShim {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $ShimName,
[Parameter(Mandatory=$True)]
[string] $ShimDirectory,
[Parameter(Mandatory=$True)]
[string] $ToolFilePath,
[Parameter(Mandatory=$True)]
[string] $BaseUri,
[switch] $Force
)
try {
Write-Verbose "Generating '$ShimName' shim"
if (-Not (Test-Path $ToolFilePath)){
Write-Error "Specified tool file path '$ToolFilePath' does not exist"
return $False
}
# WinShimmer is a small .NET Framework program that creates .exe shims to bootstrapped programs
# Many of the checks for installed programs expect a .exe extension for Windows tools, rather
# than a .bat or .cmd file.
# Source: https://github.com/dotnet/arcade/tree/master/src/WinShimmer
if (-Not (Test-Path "$ShimDirectory\WinShimmer\winshimmer.exe")) {
$InstallStatus = DownloadAndExtract -Uri "$BaseUri/windows/winshimmer/WinShimmer.zip" `
-InstallDirectory $ShimDirectory\WinShimmer `
-Force:$Force `
-DownloadRetries 2 `
-RetryWaitTimeInSeconds 5 `
-Verbose:$Verbose
}
if ((Test-Path (Join-Path $ShimDirectory "$ShimName.exe"))) {
Write-Host "$ShimName.exe already exists; replacing..."
Remove-Item (Join-Path $ShimDirectory "$ShimName.exe")
}
& "$ShimDirectory\WinShimmer\winshimmer.exe" $ShimName $ToolFilePath $ShimDirectory
return $True
}
catch {
Write-Host $_
Write-Host $_.Exception
return $False
}
}
<#
.SYNOPSIS
Returns the machine architecture of the host machine
.NOTES
Returns 'x64' on 64 bit machines
Returns 'x86' on 32 bit machines
#>
function Get-MachineArchitecture {
$ProcessorArchitecture = $Env:PROCESSOR_ARCHITECTURE
$ProcessorArchitectureW6432 = $Env:PROCESSOR_ARCHITEW6432
if($ProcessorArchitecture -Eq "X86")
{
if(($ProcessorArchitectureW6432 -Eq "") -Or
($ProcessorArchitectureW6432 -Eq "X86")) {
return "x86"
}
$ProcessorArchitecture = $ProcessorArchitectureW6432
}
if (($ProcessorArchitecture -Eq "AMD64") -Or
($ProcessorArchitecture -Eq "IA64") -Or
($ProcessorArchitecture -Eq "ARM64")) {
return "x64"
}
return "x86"
}
<#
.SYNOPSIS
Get the name of a temporary folder under the native install directory
#>
function Get-TempDirectory {
return Join-Path (Get-NativeInstallDirectory) "temp/"
}
function Get-TempPathFilename {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $Path
)
$TempDir = CommonLibrary\Get-TempDirectory
$TempFilename = Split-Path $Path -leaf
$TempPath = Join-Path $TempDir $TempFilename
return $TempPath
}
<#
.SYNOPSIS
Returns the base directory to use for native tool installation
.NOTES
Returns the value of the NETCOREENG_INSTALL_DIRECTORY if that environment variable
is set, or otherwise returns an install directory under the %USERPROFILE%
#>
function Get-NativeInstallDirectory {
$InstallDir = $Env:NETCOREENG_INSTALL_DIRECTORY
if (!$InstallDir) {
$InstallDir = Join-Path $Env:USERPROFILE ".netcoreeng/native/"
}
return $InstallDir
}
<#
.SYNOPSIS
Unzip an archive
.DESCRIPTION
Powershell module to unzip an archive to a specified directory
.PARAMETER ZipPath (Required)
Path to archive to unzip
.PARAMETER OutputDirectory (Required)
Output directory for archive contents
.PARAMETER Force
Overwrite output directory contents if they already exist
.NOTES
- Returns True and does not perform an extraction if output directory already exists but Overwrite is not True.
- Returns True if unzip operation is successful
- Returns False if Overwrite is True and it is unable to remove contents of OutputDirectory
- Returns False if unable to extract zip archive
#>
function Expand-Zip {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $ZipPath,
[Parameter(Mandatory=$True)]
[string] $OutputDirectory,
[switch] $Force
)
Write-Verbose "Extracting '$ZipPath' to '$OutputDirectory'"
try {
if ((Test-Path $OutputDirectory) -And (-Not $Force)) {
Write-Host "Directory '$OutputDirectory' already exists, skipping extract"
return $True
}
if (Test-Path $OutputDirectory) {
Write-Verbose "'Force' is 'True', but '$OutputDirectory' exists, removing directory"
Remove-Item $OutputDirectory -Force -Recurse
if ($? -Eq $False) {
Write-Error "Unable to remove '$OutputDirectory'"
return $False
}
}
if (-Not (Test-Path $OutputDirectory)) {
New-Item -path $OutputDirectory -Force -itemType "Directory" | Out-Null
}
Add-Type -assembly "system.io.compression.filesystem"
[io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$OutputDirectory")
if ($? -Eq $False) {
Write-Error "Unable to extract '$ZipPath'"
return $False
}
}
catch {
Write-Host $_
Write-Host $_.Exception
return $False
}
return $True
}
export-modulemember -function DownloadAndExtract
export-modulemember -function Expand-Zip
export-modulemember -function Get-File
export-modulemember -function Get-MachineArchitecture
export-modulemember -function Get-NativeInstallDirectory
export-modulemember -function Get-TempDirectory
export-modulemember -function Get-TempPathFilename
export-modulemember -function New-ScriptShim
+168
View File
@@ -0,0 +1,168 @@
#!/usr/bin/env bash
function GetNativeInstallDirectory {
local install_dir
if [[ -z $NETCOREENG_INSTALL_DIRECTORY ]]; then
install_dir=$HOME/.netcoreeng/native/
else
install_dir=$NETCOREENG_INSTALL_DIRECTORY
fi
echo $install_dir
return 0
}
function GetTempDirectory {
echo $(GetNativeInstallDirectory)temp/
return 0
}
function ExpandZip {
local zip_path=$1
local output_directory=$2
local force=${3:-false}
echo "Extracting $zip_path to $output_directory"
if [[ -d $output_directory ]] && [[ $force = false ]]; then
echo "Directory '$output_directory' already exists, skipping extract"
return 0
fi
if [[ -d $output_directory ]]; then
echo "'Force flag enabled, but '$output_directory' exists. Removing directory"
rm -rf $output_directory
if [[ $? != 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to remove '$output_directory'"
return 1
fi
fi
echo "Creating directory: '$output_directory'"
mkdir -p $output_directory
echo "Extracting archive"
tar -xf $zip_path -C $output_directory
if [[ $? != 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to extract '$zip_path'"
return 1
fi
return 0
}
function GetCurrentOS {
local unameOut="$(uname -s)"
case $unameOut in
Linux*) echo "Linux";;
Darwin*) echo "MacOS";;
esac
return 0
}
function GetFile {
local uri=$1
local path=$2
local force=${3:-false}
local download_retries=${4:-5}
local retry_wait_time_seconds=${5:-30}
if [[ -f $path ]]; then
if [[ $force = false ]]; then
echo "File '$path' already exists. Skipping download"
return 0
else
rm -rf $path
fi
fi
if [[ -f $uri ]]; then
echo "'$uri' is a file path, copying file to '$path'"
cp $uri $path
return $?
fi
echo "Downloading $uri"
# Use curl if available, otherwise use wget
if command -v curl > /dev/null; then
curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail
else
wget -q -O "$path" "$uri" --tries="$download_retries"
fi
return $?
}
function GetTempPathFileName {
local path=$1
local temp_dir=$(GetTempDirectory)
local temp_file_name=$(basename $path)
echo $temp_dir$temp_file_name
return 0
}
function DownloadAndExtract {
local uri=$1
local installDir=$2
local force=${3:-false}
local download_retries=${4:-5}
local retry_wait_time_seconds=${5:-30}
local temp_tool_path=$(GetTempPathFileName $uri)
echo "downloading to: $temp_tool_path"
# Download file
GetFile "$uri" "$temp_tool_path" $force $download_retries $retry_wait_time_seconds
if [[ $? != 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to download '$uri' to '$temp_tool_path'."
return 1
fi
# Extract File
echo "extracting from $temp_tool_path to $installDir"
ExpandZip "$temp_tool_path" "$installDir" $force $download_retries $retry_wait_time_seconds
if [[ $? != 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to extract '$temp_tool_path' to '$installDir'."
return 1
fi
return 0
}
function NewScriptShim {
local shimpath=$1
local tool_file_path=$2
local force=${3:-false}
echo "Generating '$shimpath' shim"
if [[ -f $shimpath ]]; then
if [[ $force = false ]]; then
echo "File '$shimpath' already exists." >&2
return 1
else
rm -rf $shimpath
fi
fi
if [[ ! -f $tool_file_path ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Specified tool file path:'$tool_file_path' does not exist"
return 1
fi
local shim_contents=$'#!/usr/bin/env bash\n'
shim_contents+="SHIMARGS="$'$1\n'
shim_contents+="$tool_file_path"$' $SHIMARGS\n'
# Write shim file
echo "$shim_contents" > $shimpath
chmod +x $shimpath
echo "Finished generating shim '$shimpath'"
return $?
}
+117
View File
@@ -0,0 +1,117 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. $scriptroot/common-library.sh
base_uri=
install_path=
version=
clean=false
force=false
download_retries=5
retry_wait_time_seconds=30
while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--baseuri)
base_uri=$2
shift 2
;;
--installpath)
install_path=$2
shift 2
;;
--version)
version=$2
shift 2
;;
--clean)
clean=true
shift 1
;;
--force)
force=true
shift 1
;;
--downloadretries)
download_retries=$2
shift 2
;;
--retrywaittimeseconds)
retry_wait_time_seconds=$2
shift 2
;;
--help)
echo "Common settings:"
echo " --baseuri <value> Base file directory or Url wrom which to acquire tool archives"
echo " --installpath <value> Base directory to install native tool to"
echo " --clean Don't install the tool, just clean up the current install of the tool"
echo " --force Force install of tools even if they previously exist"
echo " --help Print help and exit"
echo ""
echo "Advanced settings:"
echo " --downloadretries Total number of retry attempts"
echo " --retrywaittimeseconds Wait time between retry attempts in seconds"
echo ""
exit 0
;;
esac
done
tool_name="cmake-test"
tool_os=$(GetCurrentOS)
tool_folder=$(echo $tool_os | awk '{print tolower($0)}')
tool_arch="x86_64"
tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch"
tool_install_directory="$install_path/$tool_name/$version"
tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name"
shim_path="$install_path/$tool_name.sh"
uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz"
# Clean up tool and installers
if [[ $clean = true ]]; then
echo "Cleaning $tool_install_directory"
if [[ -d $tool_install_directory ]]; then
rm -rf $tool_install_directory
fi
echo "Cleaning $shim_path"
if [[ -f $shim_path ]]; then
rm -rf $shim_path
fi
tool_temp_path=$(GetTempPathFileName $uri)
echo "Cleaning $tool_temp_path"
if [[ -f $tool_temp_path ]]; then
rm -rf $tool_temp_path
fi
exit 0
fi
# Install tool
if [[ -f $tool_file_path ]] && [[ $force = false ]]; then
echo "$tool_name ($version) already exists, skipping install"
exit 0
fi
DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds
if [[ $? != 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed'
exit 1
fi
# Generate Shim
# Always rewrite shims so that we are referencing the expected version
NewScriptShim $shim_path $tool_file_path true
if [[ $? != 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed'
exit 1
fi
exit 0
+117
View File
@@ -0,0 +1,117 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. $scriptroot/common-library.sh
base_uri=
install_path=
version=
clean=false
force=false
download_retries=5
retry_wait_time_seconds=30
while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--baseuri)
base_uri=$2
shift 2
;;
--installpath)
install_path=$2
shift 2
;;
--version)
version=$2
shift 2
;;
--clean)
clean=true
shift 1
;;
--force)
force=true
shift 1
;;
--downloadretries)
download_retries=$2
shift 2
;;
--retrywaittimeseconds)
retry_wait_time_seconds=$2
shift 2
;;
--help)
echo "Common settings:"
echo " --baseuri <value> Base file directory or Url wrom which to acquire tool archives"
echo " --installpath <value> Base directory to install native tool to"
echo " --clean Don't install the tool, just clean up the current install of the tool"
echo " --force Force install of tools even if they previously exist"
echo " --help Print help and exit"
echo ""
echo "Advanced settings:"
echo " --downloadretries Total number of retry attempts"
echo " --retrywaittimeseconds Wait time between retry attempts in seconds"
echo ""
exit 0
;;
esac
done
tool_name="cmake"
tool_os=$(GetCurrentOS)
tool_folder=$(echo $tool_os | awk '{print tolower($0)}')
tool_arch="x86_64"
tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch"
tool_install_directory="$install_path/$tool_name/$version"
tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name"
shim_path="$install_path/$tool_name.sh"
uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz"
# Clean up tool and installers
if [[ $clean = true ]]; then
echo "Cleaning $tool_install_directory"
if [[ -d $tool_install_directory ]]; then
rm -rf $tool_install_directory
fi
echo "Cleaning $shim_path"
if [[ -f $shim_path ]]; then
rm -rf $shim_path
fi
tool_temp_path=$(GetTempPathFileName $uri)
echo "Cleaning $tool_temp_path"
if [[ -f $tool_temp_path ]]; then
rm -rf $tool_temp_path
fi
exit 0
fi
# Install tool
if [[ -f $tool_file_path ]] && [[ $force = false ]]; then
echo "$tool_name ($version) already exists, skipping install"
exit 0
fi
DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds
if [[ $? != 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed'
exit 1
fi
# Generate Shim
# Always rewrite shims so that we are referencing the expected version
NewScriptShim $shim_path $tool_file_path true
if [[ $? != 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed'
exit 1
fi
exit 0
+132
View File
@@ -0,0 +1,132 @@
<#
.SYNOPSIS
Install native tool
.DESCRIPTION
Install cmake native tool from Azure blob storage
.PARAMETER InstallPath
Base directory to install native tool to
.PARAMETER BaseUri
Base file directory or Url from which to acquire tool archives
.PARAMETER CommonLibraryDirectory
Path to folder containing common library modules
.PARAMETER Force
Force install of tools even if they previously exist
.PARAMETER Clean
Don't install the tool, just clean up the current install of the tool
.PARAMETER DownloadRetries
Total number of retry attempts
.PARAMETER RetryWaitTimeInSeconds
Wait time between retry attempts in seconds
.NOTES
Returns 0 if install succeeds, 1 otherwise
#>
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $ToolName,
[Parameter(Mandatory=$True)]
[string] $InstallPath,
[Parameter(Mandatory=$True)]
[string] $BaseUri,
[Parameter(Mandatory=$True)]
[string] $Version,
[string] $CommonLibraryDirectory = $PSScriptRoot,
[switch] $Force = $False,
[switch] $Clean = $False,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30
)
. $PSScriptRoot\..\pipeline-logging-functions.ps1
# Import common library modules
Import-Module -Name (Join-Path $CommonLibraryDirectory "CommonLibrary.psm1")
try {
# Define verbose switch if undefined
$Verbose = $VerbosePreference -Eq "Continue"
$Arch = CommonLibrary\Get-MachineArchitecture
$ToolOs = "win64"
if($Arch -Eq "x32") {
$ToolOs = "win32"
}
$ToolNameMoniker = "$ToolName-$Version-$ToolOs-$Arch"
$ToolInstallDirectory = Join-Path $InstallPath "$ToolName\$Version\"
$Uri = "$BaseUri/windows/$ToolName/$ToolNameMoniker.zip"
$ShimPath = Join-Path $InstallPath "$ToolName.exe"
if ($Clean) {
Write-Host "Cleaning $ToolInstallDirectory"
if (Test-Path $ToolInstallDirectory) {
Remove-Item $ToolInstallDirectory -Force -Recurse
}
Write-Host "Cleaning $ShimPath"
if (Test-Path $ShimPath) {
Remove-Item $ShimPath -Force
}
$ToolTempPath = CommonLibrary\Get-TempPathFilename -Path $Uri
Write-Host "Cleaning $ToolTempPath"
if (Test-Path $ToolTempPath) {
Remove-Item $ToolTempPath -Force
}
exit 0
}
# Install tool
if ((Test-Path $ToolInstallDirectory) -And (-Not $Force)) {
Write-Verbose "$ToolName ($Version) already exists, skipping install"
}
else {
$InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri `
-InstallDirectory $ToolInstallDirectory `
-Force:$Force `
-DownloadRetries $DownloadRetries `
-RetryWaitTimeInSeconds $RetryWaitTimeInSeconds `
-Verbose:$Verbose
if ($InstallStatus -Eq $False) {
Write-PipelineTelemetryError "Installation failed" -Category "NativeToolsetBootstrapping"
exit 1
}
}
$ToolFilePath = Get-ChildItem $ToolInstallDirectory -Recurse -Filter "$ToolName.exe" | % { $_.FullName }
if (@($ToolFilePath).Length -Gt 1) {
Write-Error "There are multiple copies of $ToolName in $($ToolInstallDirectory): `n$(@($ToolFilePath | out-string))"
exit 1
} elseif (@($ToolFilePath).Length -Lt 1) {
Write-Host "$ToolName was not found in $ToolFilePath."
exit 1
}
# Generate shim
# Always rewrite shims so that we are referencing the expected version
$GenerateShimStatus = CommonLibrary\New-ScriptShim -ShimName $ToolName `
-ShimDirectory $InstallPath `
-ToolFilePath "$ToolFilePath" `
-BaseUri $BaseUri `
-Force:$Force `
-Verbose:$Verbose
if ($GenerateShimStatus -Eq $False) {
Write-PipelineTelemetryError "Generate shim failed" -Category "NativeToolsetBootstrapping"
return 1
}
exit 0
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category "NativeToolsetBootstrapping" -Message $_
exit 1
}
@@ -0,0 +1,121 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">
<PropertyGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
<WorkItemCommand>%HELIX_CORRELATION_PAYLOAD%\performance\scripts\benchmarks_ci.py --csproj %HELIX_CORRELATION_PAYLOAD%\performance\$(TargetCsproj)</WorkItemCommand>
<CliArguments>--dotnet-versions %DOTNET_VERSION% --cli-source-info args --cli-branch %PERFLAB_BRANCH% --cli-commit-sha %PERFLAB_HASH% --cli-repository https://github.com/%PERFLAB_REPO% --cli-source-timestamp %PERFLAB_BUILDTIMESTAMP%</CliArguments>
<Python>py -3</Python>
<CoreRun>%HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe</CoreRun>
<BaselineCoreRun>%HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe</BaselineCoreRun>
<HelixPreCommands>$(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD%</HelixPreCommands>
<ArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts</ArtifactsDirectory>
<BaselineArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory>
<ResultsComparer>%HELIX_CORRELATION_PAYLOAD%\performance\src\tools\ResultsComparer\ResultsComparer.csproj</ResultsComparer>
<DotnetExe>%HELIX_CORRELATION_PAYLOAD%\performance\tools\dotnet\$(Architecture)\dotnet.exe</DotnetExe>
<Percent>%25%25</Percent>
<XMLResults>%HELIX_WORKITEM_ROOT%\testResults.xml</XMLResults>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'false'">
<BaseDirectory>$HELIX_CORRELATION_PAYLOAD</BaseDirectory>
<PerformanceDirectory>$(BaseDirectory)/performance</PerformanceDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'true'">
<BaseDirectory>$HELIX_WORKITEM_PAYLOAD</BaseDirectory>
<PerformanceDirectory>$(BaseDirectory)</PerformanceDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'">
<WorkItemCommand>$(PerformanceDirectory)/scripts/benchmarks_ci.py --csproj $(PerformanceDirectory)/$(TargetCsproj)</WorkItemCommand>
<CliArguments>--dotnet-versions $DOTNET_VERSION --cli-source-info args --cli-branch $PERFLAB_BRANCH --cli-commit-sha $PERFLAB_HASH --cli-repository https://github.com/$PERFLAB_REPO --cli-source-timestamp $PERFLAB_BUILDTIMESTAMP</CliArguments>
<Python>python3</Python>
<CoreRun>$(BaseDirectory)/Core_Root/corerun</CoreRun>
<BaselineCoreRun>$(BaseDirectory)/Baseline_Core_Root/corerun</BaselineCoreRun>
<HelixPreCommands>$(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh</HelixPreCommands>
<ArtifactsDirectory>$(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts</ArtifactsDirectory>
<BaselineArtifactsDirectory>$(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory>
<ResultsComparer>$(PerformanceDirectory)/src/tools/ResultsComparer/ResultsComparer.csproj</ResultsComparer>
<DotnetExe>$(PerformanceDirectory)/tools/dotnet/$(Architecture)/dotnet</DotnetExe>
<Percent>%25</Percent>
<XMLResults>$HELIX_WORKITEM_ROOT/testResults.xml</XMLResults>
</PropertyGroup>
<PropertyGroup Condition="'$(UseCoreRun)' == 'true'">
<CoreRunArgument>--corerun $(CoreRun)</CoreRunArgument>
</PropertyGroup>
<PropertyGroup Condition="'$(UseBaselineCoreRun)' == 'true'">
<BaselineCoreRunArgument>--corerun $(BaselineCoreRun)</BaselineCoreRunArgument>
</PropertyGroup>
<PropertyGroup Condition="'$(WorkItemCommand)' != ''">
<WorkItemCommand>$(Python) $(WorkItemCommand) --incremental no --architecture $(Architecture) -f $(_Framework) $(PerfLabArguments)</WorkItemCommand>
</PropertyGroup>
<PropertyGroup Condition="'$(_Framework)' != 'net461'">
<WorkItemCommand>$(WorkItemCommand) $(CliArguments)</WorkItemCommand>
</PropertyGroup>
<ItemGroup>
<HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)">
<PayloadDirectory>%(Identity)</PayloadDirectory>
</HelixCorrelationPayload>
</ItemGroup>
<PropertyGroup>
<PartitionCount>5</PartitionCount>
</PropertyGroup>
<ItemGroup>
<Partition Include="$(BuildConfig).Partition0" Index="0" />
<Partition Include="$(BuildConfig).Partition1" Index="1" />
<Partition Include="$(BuildConfig).Partition2" Index="2" />
<Partition Include="$(BuildConfig).Partition3" Index="3" />
<Partition Include="$(BuildConfig).Partition4" Index="4" />
</ItemGroup>
<PropertyGroup Condition="'$(Compare)' == 'true'">
<FailOnTestFailure>false</FailOnTestFailure>
</PropertyGroup>
<!--
Partition the Microbenchmarks project, but nothing else
-->
<ItemGroup Condition="$(TargetCsproj.Contains('MicroBenchmarks.csproj'))">
<HelixWorkItem Include="@(Partition)">
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<PreCommands Condition="'$(Compare)' == 'true'">$(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</PreCommands>
<Command>$(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</Command>
<PostCommands Condition="'$(Compare)' == 'true'">$(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand)</PostCommands>
<Timeout>4:00</Timeout>
</HelixWorkItem>
</ItemGroup>
<ItemGroup Condition="!$(TargetCsproj.Contains('MicroBenchmarks.csproj'))">
<HelixWorkItem Include="$(BuildConfig).WorkItem">
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<PreCommands Condition="'$(Compare)' == 'true'">$(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument)"</PreCommands>
<Command>$(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)"</Command>
<PostCommands Condition="'$(Compare)' == 'true'">$(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults)</PostCommands>
<Timeout>4:00</Timeout>
</HelixWorkItem>
</ItemGroup>
<ItemGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
<HelixWorkItem Include="Crossgen System.Private.Xml.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen System.Linq.Expressions.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen Microsoft.CodeAnalysis.VisualBasic.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen Microsoft.CodeAnalysis.CSharp.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
</ItemGroup>
</Project>
@@ -0,0 +1,114 @@
Param(
[string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY,
[string] $CoreRootDirectory,
[string] $BaselineCoreRootDirectory,
[string] $Architecture="x64",
[string] $Framework="netcoreapp5.0",
[string] $CompilationMode="Tiered",
[string] $Repository=$env:BUILD_REPOSITORY_NAME,
[string] $Branch=$env:BUILD_SOURCEBRANCH,
[string] $CommitSha=$env:BUILD_SOURCEVERSION,
[string] $BuildNumber=$env:BUILD_BUILDNUMBER,
[string] $RunCategories="Libraries Runtime",
[string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj",
[string] $Kind="micro",
[switch] $Internal,
[switch] $Compare,
[string] $Configurations="CompilationMode=$CompilationMode RunKind=$Kind"
)
$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance") -or ($Repository -eq "dotnet-performance")
$UseCoreRun = ($CoreRootDirectory -ne [string]::Empty)
$UseBaselineCoreRun = ($BaselineCoreRootDirectory -ne [string]::Empty)
$PayloadDirectory = (Join-Path $SourceDirectory "Payload")
$PerformanceDirectory = (Join-Path $PayloadDirectory "performance")
$WorkItemDirectory = (Join-Path $SourceDirectory "workitem")
$ExtraBenchmarkDotNetArguments = "--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true"
$Creator = $env:BUILD_DEFINITIONNAME
$PerfLabArguments = ""
$HelixSourcePrefix = "pr"
$Queue = "Windows.10.Amd64.ClientRS4.DevEx.15.8.Open"
if ($Framework.StartsWith("netcoreapp")) {
$Queue = "Windows.10.Amd64.ClientRS5.Open"
}
if ($Compare) {
$Queue = "Windows.10.Amd64.19H1.Tiger.Perf.Open"
$PerfLabArguments = ""
$ExtraBenchmarkDotNetArguments = ""
}
if ($Internal) {
$Queue = "Windows.10.Amd64.19H1.Tiger.Perf"
$PerfLabArguments = "--upload-to-perflab-container"
$ExtraBenchmarkDotNetArguments = ""
$Creator = ""
$HelixSourcePrefix = "official"
}
# FIX ME: This is a workaround until we get this from the actual pipeline
$CommonSetupArguments="--channel master --queue $Queue --build-number $BuildNumber --build-configs $Configurations --architecture $Architecture"
$SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments"
#This grabs the LKG version number of dotnet and passes it to our scripts
$VersionJSON = Get-Content global.json | ConvertFrom-Json
$DotNetVersion = $VersionJSON.tools.dotnet
$SetupArguments = "--dotnet-versions $DotNetVersion $SetupArguments"
if ($RunFromPerformanceRepo) {
$SetupArguments = "--perf-hash $CommitSha $CommonSetupArguments"
robocopy $SourceDirectory $PerformanceDirectory /E /XD $PayloadDirectory $SourceDirectory\artifacts $SourceDirectory\.git
}
else {
git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory
}
if ($UseCoreRun) {
$NewCoreRoot = (Join-Path $PayloadDirectory "Core_Root")
Move-Item -Path $CoreRootDirectory -Destination $NewCoreRoot
}
if ($UseBaselineCoreRun) {
$NewBaselineCoreRoot = (Join-Path $PayloadDirectory "Baseline_Core_Root")
Move-Item -Path $BaselineCoreRootDirectory -Destination $NewBaselineCoreRoot
}
$DocsDir = (Join-Path $PerformanceDirectory "docs")
robocopy $DocsDir $WorkItemDirectory
# Set variables that we will need to have in future steps
$ci = $true
. "$PSScriptRoot\..\pipeline-logging-functions.ps1"
# Directories
Write-PipelineSetVariable -Name 'PayloadDirectory' -Value "$PayloadDirectory" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'PerformanceDirectory' -Value "$PerformanceDirectory" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'WorkItemDirectory' -Value "$WorkItemDirectory" -IsMultiJobVariable $false
# Script Arguments
Write-PipelineSetVariable -Name 'Python' -Value "py -3" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'ExtraBenchmarkDotNetArguments' -Value "$ExtraBenchmarkDotNetArguments" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'SetupArguments' -Value "$SetupArguments" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'PerfLabArguments' -Value "$PerfLabArguments" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'BDNCategories' -Value "$RunCategories" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'TargetCsproj' -Value "$Csproj" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Kind' -Value "$Kind" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Architecture' -Value "$Architecture" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'UseCoreRun' -Value "$UseCoreRun" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'UseBaselineCoreRun' -Value "$UseBaselineCoreRun" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'RunFromPerfRepo' -Value "$RunFromPerformanceRepo" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Compare' -Value "$Compare" -IsMultiJobVariable $false
# Helix Arguments
Write-PipelineSetVariable -Name 'Creator' -Value "$Creator" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Queue' -Value "$Queue" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'HelixSourcePrefix' -Value "$HelixSourcePrefix" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name '_BuildConfig' -Value "$Architecture.$Kind.$Framework" -IsMultiJobVariable $false
exit 0
+223
View File
@@ -0,0 +1,223 @@
#!/usr/bin/env bash
source_directory=$BUILD_SOURCESDIRECTORY
core_root_directory=
baseline_core_root_directory=
architecture=x64
framework=netcoreapp5.0
compilation_mode=tiered
repository=$BUILD_REPOSITORY_NAME
branch=$BUILD_SOURCEBRANCH
commit_sha=$BUILD_SOURCEVERSION
build_number=$BUILD_BUILDNUMBER
internal=false
compare=false
kind="micro"
run_categories="Libraries Runtime"
csproj="src\benchmarks\micro\MicroBenchmarks.csproj"
configurations="CompliationMode=$compilation_mode RunKind=$kind"
run_from_perf_repo=false
use_core_run=true
use_baseline_core_run=true
while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--sourcedirectory)
source_directory=$2
shift 2
;;
--corerootdirectory)
core_root_directory=$2
shift 2
;;
--baselinecorerootdirectory)
baseline_core_root_directory=$2
shift 2
;;
--architecture)
architecture=$2
shift 2
;;
--framework)
framework=$2
shift 2
;;
--compilationmode)
compilation_mode=$2
shift 2
;;
--repository)
repository=$2
shift 2
;;
--branch)
branch=$2
shift 2
;;
--commitsha)
commit_sha=$2
shift 2
;;
--buildnumber)
build_number=$2
shift 2
;;
--kind)
kind=$2
shift 2
;;
--runcategories)
run_categories=$2
shift 2
;;
--csproj)
csproj=$2
shift 2
;;
--internal)
internal=true
shift 1
;;
--compare)
compare=true
shift 1
;;
--configurations)
configurations=$2
shift 2
;;
--help)
echo "Common settings:"
echo " --corerootdirectory <value> Directory where Core_Root exists, if running perf testing with --corerun"
echo " --architecture <value> Architecture of the testing being run"
echo " --configurations <value> List of key=value pairs that will be passed to perf testing infrastructure."
echo " ex: --configurations \"CompilationMode=Tiered OptimzationLevel=PGO\""
echo " --help Print help and exit"
echo ""
echo "Advanced settings:"
echo " --framework <value> The framework to run, if not running in master"
echo " --compliationmode <value> The compilation mode if not passing --configurations"
echo " --sourcedirectory <value> The directory of the sources. Defaults to env:BUILD_SOURCESDIRECTORY"
echo " --repository <value> The name of the repository in the <owner>/<repository name> format. Defaults to env:BUILD_REPOSITORY_NAME"
echo " --branch <value> The name of the branch. Defaults to env:BUILD_SOURCEBRANCH"
echo " --commitsha <value> The commit sha1 to run against. Defaults to env:BUILD_SOURCEVERSION"
echo " --buildnumber <value> The build number currently running. Defaults to env:BUILD_BUILDNUMBER"
echo " --csproj The relative path to the benchmark csproj whose tests should be run. Defaults to src\benchmarks\micro\MicroBenchmarks.csproj"
echo " --kind <value> Related to csproj. The kind of benchmarks that should be run. Defaults to micro"
echo " --runcategories <value> Related to csproj. Categories of benchmarks to run. Defaults to \"coreclr corefx\""
echo " --internal If the benchmarks are running as an official job."
echo ""
exit 0
;;
esac
done
if [ "$repository" == "dotnet/performance" ] || [ "$repository" == "dotnet-performance" ]; then
run_from_perf_repo=true
fi
if [ -z "$configurations" ]; then
configurations="CompliationMode=$compilation_mode"
fi
if [ -z "$core_root_directory" ]; then
use_core_run=false
fi
if [ -z "$baseline_core_root_directory" ]; then
use_baseline_core_run=false
fi
payload_directory=$source_directory/Payload
performance_directory=$payload_directory/performance
workitem_directory=$source_directory/workitem
extra_benchmark_dotnet_arguments="--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true"
perflab_arguments=
queue=Ubuntu.1804.Amd64.Open
creator=$BUILD_DEFINITIONNAME
helix_source_prefix="pr"
if [[ "$compare" == true ]]; then
extra_benchmark_dotnet_arguments=
perflab_arguments=
# No open queues for arm64
if [[ "$architecture" = "arm64" ]]; then
echo "Compare not available for arm64"
exit 1
fi
queue=Ubuntu.1804.Amd64.Tiger.Perf.Open
fi
if [[ "$internal" == true ]]; then
perflab_arguments="--upload-to-perflab-container"
helix_source_prefix="official"
creator=
extra_benchmark_dotnet_arguments=
if [[ "$architecture" = "arm64" ]]; then
queue=Ubuntu.1804.Arm64.Perf
else
queue=Ubuntu.1804.Amd64.Tiger.Perf
fi
fi
common_setup_arguments="--channel master --queue $queue --build-number $build_number --build-configs $configurations --architecture $architecture"
setup_arguments="--repository https://github.com/$repository --branch $branch --get-perf-hash --commit-sha $commit_sha $common_setup_arguments"
# Get the tools section from the global.json.
# This grabs the LKG version number of dotnet and passes it to our scripts
dotnet_version=`cat global.json | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["tools"]["dotnet"])'`
setup_arguments="--dotnet-versions $dotnet_version $setup_arguments"
if [[ "$run_from_perf_repo" = true ]]; then
payload_directory=
workitem_directory=$source_directory
performance_directory=$workitem_directory
setup_arguments="--perf-hash $commit_sha $common_setup_arguments"
else
git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $performance_directory
docs_directory=$performance_directory/docs
mv $docs_directory $workitem_directory
fi
if [[ "$use_core_run" = true ]]; then
new_core_root=$payload_directory/Core_Root
mv $core_root_directory $new_core_root
fi
if [[ "$use_baseline_core_run" = true ]]; then
new_baseline_core_root=$payload_directory/Baseline_Core_Root
mv $baseline_core_root_directory $new_baseline_core_root
fi
ci=true
_script_dir=$(pwd)/eng/common
. "$_script_dir/pipeline-logging-functions.sh"
# Make sure all of our variables are available for future steps
Write-PipelineSetVariable -name "UseCoreRun" -value "$use_core_run" -is_multi_job_variable false
Write-PipelineSetVariable -name "UseBaselineCoreRun" -value "$use_baseline_core_run" -is_multi_job_variable false
Write-PipelineSetVariable -name "Architecture" -value "$architecture" -is_multi_job_variable false
Write-PipelineSetVariable -name "PayloadDirectory" -value "$payload_directory" -is_multi_job_variable false
Write-PipelineSetVariable -name "PerformanceDirectory" -value "$performance_directory" -is_multi_job_variable false
Write-PipelineSetVariable -name "WorkItemDirectory" -value "$workitem_directory" -is_multi_job_variable false
Write-PipelineSetVariable -name "Queue" -value "$queue" -is_multi_job_variable false
Write-PipelineSetVariable -name "SetupArguments" -value "$setup_arguments" -is_multi_job_variable false
Write-PipelineSetVariable -name "Python" -value "$python3" -is_multi_job_variable false
Write-PipelineSetVariable -name "PerfLabArguments" -value "$perflab_arguments" -is_multi_job_variable false
Write-PipelineSetVariable -name "ExtraBenchmarkDotNetArguments" -value "$extra_benchmark_dotnet_arguments" -is_multi_job_variable false
Write-PipelineSetVariable -name "BDNCategories" -value "$run_categories" -is_multi_job_variable false
Write-PipelineSetVariable -name "TargetCsproj" -value "$csproj" -is_multi_job_variable false
Write-PipelineSetVariable -name "RunFromPerfRepo" -value "$run_from_perf_repo" -is_multi_job_variable false
Write-PipelineSetVariable -name "Creator" -value "$creator" -is_multi_job_variable false
Write-PipelineSetVariable -name "HelixSourcePrefix" -value "$helix_source_prefix" -is_multi_job_variable false
Write-PipelineSetVariable -name "Kind" -value "$kind" -is_multi_job_variable false
Write-PipelineSetVariable -name "_BuildConfig" -value "$architecture.$kind.$framework" -is_multi_job_variable false
Write-PipelineSetVariable -name "Compare" -value "$compare" -is_multi_job_variable false
+242
View File
@@ -0,0 +1,242 @@
# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1 and modified.
# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1
$script:loggingCommandPrefix = '##vso['
$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"?
New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' }
New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' }
New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' }
New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' }
)
# TODO: BUG: Escape % ???
# TODO: Add test to verify don't need to escape "=".
# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set
function Write-PipelineTelemetryError {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Category,
[Parameter(Mandatory = $true)]
[string]$Message,
[Parameter(Mandatory = $false)]
[string]$Type = 'error',
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput,
[switch]$Force)
$PSBoundParameters.Remove('Category') | Out-Null
if($Force -Or ((Test-Path variable:ci) -And $ci)) {
$Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message"
}
$PSBoundParameters.Remove('Message') | Out-Null
$PSBoundParameters.Add('Message', $Message)
Write-PipelineTaskError @PSBoundParameters
}
# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set
function Write-PipelineTaskError {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Message,
[Parameter(Mandatory = $false)]
[string]$Type = 'error',
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput,
[switch]$Force
)
if(!$Force -And (-Not (Test-Path variable:ci) -Or !$ci)) {
if($Type -eq 'error') {
Write-Host $Message -ForegroundColor Red
return
}
elseif ($Type -eq 'warning') {
Write-Host $Message -ForegroundColor Yellow
return
}
}
if(($Type -ne 'error') -and ($Type -ne 'warning')) {
Write-Host $Message
return
}
$PSBoundParameters.Remove('Force') | Out-Null
if(-not $PSBoundParameters.ContainsKey('Type')) {
$PSBoundParameters.Add('Type', 'error')
}
Write-LogIssue @PSBoundParameters
}
function Write-PipelineSetVariable {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Name,
[string]$Value,
[switch]$Secret,
[switch]$AsOutput,
[bool]$IsMultiJobVariable=$true)
if((Test-Path variable:ci) -And $ci) {
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{
'variable' = $Name
'isSecret' = $Secret
'isOutput' = $IsMultiJobVariable
} -AsOutput:$AsOutput
}
}
function Write-PipelinePrependPath {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$Path,
[switch]$AsOutput)
if((Test-Path variable:ci) -And $ci) {
Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput
}
}
<########################################
# Private functions.
########################################>
function Format-LoggingCommandData {
[CmdletBinding()]
param([string]$Value, [switch]$Reverse)
if (!$Value) {
return ''
}
if (!$Reverse) {
foreach ($mapping in $script:loggingCommandEscapeMappings) {
$Value = $Value.Replace($mapping.Token, $mapping.Replacement)
}
} else {
for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) {
$mapping = $script:loggingCommandEscapeMappings[$i]
$Value = $Value.Replace($mapping.Replacement, $mapping.Token)
}
}
return $Value
}
function Format-LoggingCommand {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Area,
[Parameter(Mandatory = $true)]
[string]$Event,
[string]$Data,
[hashtable]$Properties)
# Append the preamble.
[System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder
$null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event)
# Append the properties.
if ($Properties) {
$first = $true
foreach ($key in $Properties.Keys) {
[string]$value = Format-LoggingCommandData $Properties[$key]
if ($value) {
if ($first) {
$null = $sb.Append(' ')
$first = $false
} else {
$null = $sb.Append(';')
}
$null = $sb.Append("$key=$value")
}
}
}
# Append the tail and output the value.
$Data = Format-LoggingCommandData $Data
$sb.Append(']').Append($Data).ToString()
}
function Write-LoggingCommand {
[CmdletBinding(DefaultParameterSetName = 'Parameters')]
param(
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Area,
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Event,
[Parameter(ParameterSetName = 'Parameters')]
[string]$Data,
[Parameter(ParameterSetName = 'Parameters')]
[hashtable]$Properties,
[Parameter(Mandatory = $true, ParameterSetName = 'Object')]
$Command,
[switch]$AsOutput)
if ($PSCmdlet.ParameterSetName -eq 'Object') {
Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput
return
}
$command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties
if ($AsOutput) {
$command
} else {
Write-Host $command
}
}
function Write-LogIssue {
[CmdletBinding()]
param(
[ValidateSet('warning', 'error')]
[Parameter(Mandatory = $true)]
[string]$Type,
[string]$Message,
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)
$command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{
'type' = $Type
'code' = $ErrCode
'sourcepath' = $SourcePath
'linenumber' = $LineNumber
'columnnumber' = $ColumnNumber
}
if ($AsOutput) {
return $command
}
if ($Type -eq 'error') {
$foregroundColor = $host.PrivateData.ErrorForegroundColor
$backgroundColor = $host.PrivateData.ErrorBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Red
$backgroundColor = [System.ConsoleColor]::Black
}
} else {
$foregroundColor = $host.PrivateData.WarningForegroundColor
$backgroundColor = $host.PrivateData.WarningBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Yellow
$backgroundColor = [System.ConsoleColor]::Black
}
}
Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor
}
+179
View File
@@ -0,0 +1,179 @@
#!/usr/bin/env bash
function Write-PipelineTelemetryError {
local telemetry_category=''
local force=false
local function_args=()
local message=''
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-category|-c)
telemetry_category=$2
shift
;;
-force|-f)
force=true
;;
-*)
function_args+=("$1 $2")
shift
;;
*)
message=$*
;;
esac
shift
done
if [[ $force != true ]] && [[ "$ci" != true ]]; then
echo "$message" >&2
return
fi
message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message"
function_args+=("$message")
if [[ $force == true ]]; then
function_args+=("-force")
fi
Write-PipelineTaskError $function_args
}
function Write-PipelineTaskError {
if [[ $force != true ]] && [[ "$ci" != true ]]; then
echo "$@" >&2
return
fi
local message_type="error"
local sourcepath=''
local linenumber=''
local columnnumber=''
local error_code=''
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-type|-t)
message_type=$2
shift
;;
-sourcepath|-s)
sourcepath=$2
shift
;;
-linenumber|-ln)
linenumber=$2
shift
;;
-columnnumber|-cn)
columnnumber=$2
shift
;;
-errcode|-e)
error_code=$2
shift
;;
*)
break
;;
esac
shift
done
local message="##vso[task.logissue"
message="$message type=$message_type"
if [ -n "$sourcepath" ]; then
message="$message;sourcepath=$sourcepath"
fi
if [ -n "$linenumber" ]; then
message="$message;linenumber=$linenumber"
fi
if [ -n "$columnnumber" ]; then
message="$message;columnnumber=$columnnumber"
fi
if [ -n "$error_code" ]; then
message="$message;code=$error_code"
fi
message="$message]$*"
echo "$message"
}
function Write-PipelineSetVariable {
if [[ "$ci" != true ]]; then
return
fi
local name=''
local value=''
local secret=false
local as_output=false
local is_multi_job_variable=true
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-name|-n)
name=$2
shift
;;
-value|-v)
value=$2
shift
;;
-secret|-s)
secret=true
;;
-as_output|-a)
as_output=true
;;
-is_multi_job_variable|-i)
is_multi_job_variable=$2
shift
;;
esac
shift
done
value=${value/;/%3B}
value=${value/\\r/%0D}
value=${value/\\n/%0A}
value=${value/]/%5D}
local message="##vso[task.setvariable variable=$name;isSecret=$secret;isOutput=$is_multi_job_variable]$value"
if [[ "$as_output" == true ]]; then
$message
else
echo "$message"
fi
}
function Write-PipelinePrependPath {
local prepend_path=''
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-path|-p)
prepend_path=$2
shift
;;
esac
shift
done
export PATH="$prepend_path:$PATH"
if [[ "$ci" == true ]]; then
echo "##vso[task.prependpath]$prepend_path"
fi
}
@@ -0,0 +1,48 @@
param(
[Parameter(Mandatory=$true)][int] $BuildId,
[Parameter(Mandatory=$true)][int] $ChannelId,
[Parameter(Mandatory=$true)][string] $MaestroApiAccessToken,
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com',
[Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16'
)
try {
. $PSScriptRoot\post-build-utils.ps1
# Check that the channel we are going to promote the build to exist
$channelInfo = Get-MaestroChannel -ChannelId $ChannelId
if (!$channelInfo) {
Write-PipelineTelemetryCategory -Category 'PromoteBuild' -Message "Channel with BAR ID $ChannelId was not found in BAR!"
ExitWithExitCode 1
}
# Get info about which channel(s) the build has already been promoted to
$buildInfo = Get-MaestroBuild -BuildId $BuildId
if (!$buildInfo) {
Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "Build with BAR ID $BuildId was not found in BAR!"
ExitWithExitCode 1
}
# Find whether the build is already assigned to the channel or not
if ($buildInfo.channels) {
foreach ($channel in $buildInfo.channels) {
if ($channel.Id -eq $ChannelId) {
Write-Host "The build with BAR ID $BuildId is already on channel $ChannelId!"
ExitWithExitCode 0
}
}
}
Write-Host "Promoting build '$BuildId' to channel '$ChannelId'."
Assign-BuildToChannel -BuildId $BuildId -ChannelId $ChannelId
Write-Host 'done.'
}
catch {
Write-Host $_
Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'"
ExitWithExitCode 1
}
@@ -0,0 +1,25 @@
param(
[Parameter(Mandatory=$true)][string] $PromoteToChannels, # List of channels that the build should be promoted to
[Parameter(Mandatory=$true)][array] $AvailableChannelIds # List of channel IDs available in the YAML implementation
)
try {
. $PSScriptRoot\post-build-utils.ps1
# Check that every channel that Maestro told to promote the build to
# is available in YAML
$PromoteToChannelsIds = $PromoteToChannels -split "\D" | Where-Object { $_ }
foreach ($id in $PromoteToChannelsIds) {
if (($id -ne 0) -and ($id -notin $AvailableChannelIds)) {
Write-PipelineTaskError -Type 'warning' -Message "Channel $id is not present in the post-build YAML configuration!"
}
}
Write-Host 'done.'
}
catch {
Write-Host $_
Write-PipelineTelemetryError -Category 'CheckChannelConsistency' -Message "There was an error while trying to check consistency of Maestro default channels for the build and post-build YAML configuration."
ExitWithExitCode 1
}
@@ -0,0 +1,24 @@
# This script validates NuGet package metadata information using this
# tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage
param(
[Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are
[Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to
)
try {
. $PSScriptRoot\post-build-utils.ps1
$url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1'
New-Item -ItemType 'directory' -Path ${ToolDestinationPath} -Force
Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1
& ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_
ExitWithExitCode 1
}
@@ -0,0 +1,91 @@
# Most of the functions in this file require the variables `MaestroApiEndPoint`,
# `MaestroApiVersion` and `MaestroApiAccessToken` to be globally available.
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 2.0
# `tools.ps1` checks $ci to perform some actions. Since the post-build
# scripts don't necessarily execute in the same agent that run the
# build.ps1/sh script this variable isn't automatically set.
$ci = $true
$disableConfigureToolsetImport = $true
. $PSScriptRoot\..\tools.ps1
function Create-MaestroApiRequestHeaders([string]$ContentType = 'application/json') {
Validate-MaestroVars
$headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]'
$headers.Add('Accept', $ContentType)
$headers.Add('Authorization',"Bearer $MaestroApiAccessToken")
return $headers
}
function Get-MaestroChannel([int]$ChannelId) {
Validate-MaestroVars
$apiHeaders = Create-MaestroApiRequestHeaders
$apiEndpoint = "$MaestroApiEndPoint/api/channels/${ChannelId}?api-version=$MaestroApiVersion"
$result = try { Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
return $result
}
function Get-MaestroBuild([int]$BuildId) {
Validate-MaestroVars
$apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken
$apiEndpoint = "$MaestroApiEndPoint/api/builds/${BuildId}?api-version=$MaestroApiVersion"
$result = try { return Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
return $result
}
function Get-MaestroSubscriptions([string]$SourceRepository, [int]$ChannelId) {
Validate-MaestroVars
$SourceRepository = [System.Web.HttpUtility]::UrlEncode($SourceRepository)
$apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken
$apiEndpoint = "$MaestroApiEndPoint/api/subscriptions?sourceRepository=$SourceRepository&channelId=$ChannelId&api-version=$MaestroApiVersion"
$result = try { Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
return $result
}
function Assign-BuildToChannel([int]$BuildId, [int]$ChannelId) {
Validate-MaestroVars
$apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken
$apiEndpoint = "$MaestroApiEndPoint/api/channels/${ChannelId}/builds/${BuildId}?api-version=$MaestroApiVersion"
Invoke-WebRequest -Method Post -Uri $apiEndpoint -Headers $apiHeaders | Out-Null
}
function Trigger-Subscription([string]$SubscriptionId) {
Validate-MaestroVars
$apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken
$apiEndpoint = "$MaestroApiEndPoint/api/subscriptions/$SubscriptionId/trigger?api-version=$MaestroApiVersion"
Invoke-WebRequest -Uri $apiEndpoint -Headers $apiHeaders -Method Post | Out-Null
}
function Validate-MaestroVars {
try {
Get-Variable MaestroApiEndPoint -Scope Global | Out-Null
Get-Variable MaestroApiVersion -Scope Global | Out-Null
Get-Variable MaestroApiAccessToken -Scope Global | Out-Null
if (!($MaestroApiEndPoint -Match '^http[s]?://maestro-(int|prod).westus2.cloudapp.azure.com$')) {
Write-PipelineTelemetryError -Category 'MaestroVars' -Message "MaestroApiEndPoint is not a valid Maestro URL. '$MaestroApiEndPoint'"
ExitWithExitCode 1
}
if (!($MaestroApiVersion -Match '^[0-9]{4}-[0-9]{2}-[0-9]{2}$')) {
Write-PipelineTelemetryError -Category 'MaestroVars' -Message "MaestroApiVersion does not match a version string in the format yyyy-MM-DD. '$MaestroApiVersion'"
ExitWithExitCode 1
}
}
catch {
Write-PipelineTelemetryError -Category 'MaestroVars' -Message 'Error: Variables `MaestroApiEndPoint`, `MaestroApiVersion` and `MaestroApiAccessToken` are required while using this script.'
Write-Host $_
ExitWithExitCode 1
}
}
@@ -0,0 +1,257 @@
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$false)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade
[Parameter(Mandatory=$false)][string] $GHCommit, # GitHub commit SHA used to build the packages
[Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use
)
. $PSScriptRoot\post-build-utils.ps1
# Cache/HashMap (File -> Exist flag) used to consult whether a file exist
# in the repository at a specific commit point. This is populated by inserting
# all files present in the repo at a specific commit point.
$global:RepoFiles = @{}
# Maximum number of jobs to run in parallel
$MaxParallelJobs = 6
# Wait time between check for system load
$SecondsBetweenLoadChecks = 10
$ValidatePackage = {
param(
[string] $PackagePath # Full path to a Symbols.NuGet package
)
. $using:PSScriptRoot\..\tools.ps1
# Ensure input file exist
if (!(Test-Path $PackagePath)) {
Write-Host "Input file does not exist: $PackagePath"
return 1
}
# Extensions for which we'll look for SourceLink information
# For now we'll only care about Portable & Embedded PDBs
$RelevantExtensions = @('.dll', '.exe', '.pdb')
Write-Host -NoNewLine 'Validating ' ([System.IO.Path]::GetFileName($PackagePath)) '...'
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId
$FailedFiles = 0
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Directory]::CreateDirectory($ExtractPath) | Out-Null
try {
$zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath)
$zip.Entries |
Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} |
ForEach-Object {
$FileName = $_.FullName
$Extension = [System.IO.Path]::GetExtension($_.Name)
$FakeName = -Join((New-Guid), $Extension)
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName
# We ignore resource DLLs
if ($FileName.EndsWith('.resources.dll')) {
return
}
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true)
$ValidateFile = {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $RealPath,
[ref] $FailedFiles
)
$sourcelinkExe = "$env:USERPROFILE\.dotnet\tools"
$sourcelinkExe = Resolve-Path "$sourcelinkExe\sourcelink.exe"
$SourceLinkInfos = & $sourcelinkExe print-urls $FullPath | Out-String
if ($LASTEXITCODE -eq 0 -and -not ([string]::IsNullOrEmpty($SourceLinkInfos))) {
$NumFailedLinks = 0
# We only care about Http addresses
$Matches = (Select-String '(http[s]?)(:\/\/)([^\s,]+)' -Input $SourceLinkInfos -AllMatches).Matches
if ($Matches.Count -ne 0) {
$Matches.Value |
ForEach-Object {
$Link = $_
$CommitUrl = "https://raw.githubusercontent.com/${using:GHRepoName}/${using:GHCommit}/"
$FilePath = $Link.Replace($CommitUrl, "")
$Status = 200
$Cache = $using:RepoFiles
if ( !($Cache.ContainsKey($FilePath)) ) {
try {
$Uri = $Link -as [System.URI]
# Only GitHub links are valid
if ($Uri.AbsoluteURI -ne $null -and ($Uri.Host -match 'github' -or $Uri.Host -match 'githubusercontent')) {
$Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode
}
else {
$Status = 0
}
}
catch {
write-host $_
$Status = 0
}
}
if ($Status -ne 200) {
if ($NumFailedLinks -eq 0) {
if ($FailedFiles.Value -eq 0) {
Write-Host
}
Write-Host "`tFile $RealPath has broken links:"
}
Write-Host "`t`tFailed to retrieve $Link"
$NumFailedLinks++
}
}
}
if ($NumFailedLinks -ne 0) {
$FailedFiles.value++
$global:LASTEXITCODE = 1
}
}
}
&$ValidateFile $TargetFile $FileName ([ref]$FailedFiles)
}
}
catch {
}
finally {
$zip.Dispose()
}
if ($FailedFiles -eq 0) {
Write-Host 'Passed.'
return 0
}
else {
Write-PipelineTelemetryError -Category 'SourceLink' -Message "$PackagePath has broken SourceLink links."
return 1
}
}
function ValidateSourceLinkLinks {
if ($GHRepoName -ne '' -and !($GHRepoName -Match '^[^\s\/]+/[^\s\/]+$')) {
if (!($GHRepoName -Match '^[^\s-]+-[^\s]+$')) {
Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHRepoName should be in the format <org>/<repo> or <org>-<repo>. '$GHRepoName'"
ExitWithExitCode 1
}
else {
$GHRepoName = $GHRepoName -replace '^([^\s-]+)-([^\s]+)$', '$1/$2';
}
}
if ($GHCommit -ne '' -and !($GHCommit -Match '^[0-9a-fA-F]{40}$')) {
Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHCommit should be a 40 chars hexadecimal string. '$GHCommit'"
ExitWithExitCode 1
}
if ($GHRepoName -ne '' -and $GHCommit -ne '') {
$RepoTreeURL = -Join('http://api.github.com/repos/', $GHRepoName, '/git/trees/', $GHCommit, '?recursive=1')
$CodeExtensions = @('.cs', '.vb', '.fs', '.fsi', '.fsx', '.fsscript')
try {
# Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash
$Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree
foreach ($file in $Data) {
$Extension = [System.IO.Path]::GetExtension($file.path)
if ($CodeExtensions.Contains($Extension)) {
$RepoFiles[$file.path] = 1
}
}
}
catch {
Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL . Execution will proceed without caching."
}
}
elseif ($GHRepoName -ne '' -or $GHCommit -ne '') {
Write-Host 'For using the http caching mechanism both GHRepoName and GHCommit should be informed.'
}
if (Test-Path $ExtractPath) {
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
}
# Process each NuGet package in parallel
Get-ChildItem "$InputPath\*.symbols.nupkg" |
ForEach-Object {
Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName | Out-Null
$NumJobs = @(Get-Job -State 'Running').Count
while ($NumJobs -ge $MaxParallelJobs) {
Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again."
sleep $SecondsBetweenLoadChecks
$NumJobs = @(Get-Job -State 'Running').Count
}
foreach ($Job in @(Get-Job -State 'Completed')) {
Receive-Job -Id $Job.Id
Remove-Job -Id $Job.Id
}
}
$ValidationFailures = 0
foreach ($Job in @(Get-Job)) {
$jobResult = Wait-Job -Id $Job.Id | Receive-Job
if ($jobResult -ne '0') {
$ValidationFailures++
}
}
if ($ValidationFailures -gt 0) {
Write-PipelineTelemetryError -Category 'SourceLink' -Message "$ValidationFailures package(s) failed validation."
ExitWithExitCode 1
}
}
function InstallSourcelinkCli {
$sourcelinkCliPackageName = 'sourcelink'
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = & "$dotnet" tool list --global
if (($toolList -like "*$sourcelinkCliPackageName*") -and ($toolList -like "*$sourcelinkCliVersion*")) {
Write-Host "SourceLink CLI version $sourcelinkCliVersion is already installed."
}
else {
Write-Host "Installing SourceLink CLI version $sourcelinkCliVersion..."
Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.'
& "$dotnet" tool install $sourcelinkCliPackageName --version $sourcelinkCliVersion --verbosity "minimal" --global
}
}
try {
InstallSourcelinkCli
ValidateSourceLinkLinks
}
catch {
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'SourceLink' -Message $_
ExitWithExitCode 1
}
@@ -0,0 +1,188 @@
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][string] $DotnetSymbolVersion # Version of dotnet symbol to use
)
function FirstMatchingSymbolDescriptionOrDefault {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
[string] $SymbolsPath
)
$FileName = [System.IO.Path]::GetFileName($FullPath)
$Extension = [System.IO.Path]::GetExtension($FullPath)
# Those below are potential symbol files that the `dotnet symbol` might
# return. Which one will be returned depend on the type of file we are
# checking and which type of file was uploaded.
# The file itself is returned
$SymbolPath = $SymbolsPath + '\' + $FileName
# PDB file for the module
$PdbPath = $SymbolPath.Replace($Extension, '.pdb')
# PDB file for R2R module (created by crossgen)
$NGenPdb = $SymbolPath.Replace($Extension, '.ni.pdb')
# DBG file for a .so library
$SODbg = $SymbolPath.Replace($Extension, '.so.dbg')
# DWARF file for a .dylib
$DylibDwarf = $SymbolPath.Replace($Extension, '.dylib.dwarf')
$dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools"
$dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe"
& $dotnetSymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null
if (Test-Path $PdbPath) {
return 'PDB'
}
elseif (Test-Path $NGenPdb) {
return 'NGen PDB'
}
elseif (Test-Path $SODbg) {
return 'DBG for SO'
}
elseif (Test-Path $DylibDwarf) {
return 'Dwarf for Dylib'
}
elseif (Test-Path $SymbolPath) {
return 'Module'
}
else {
return $null
}
}
function CountMissingSymbols {
param(
[string] $PackagePath # Path to a NuGet package
)
# Ensure input file exist
if (!(Test-Path $PackagePath)) {
Write-PipelineTaskError "Input file does not exist: $PackagePath"
ExitWithExitCode 1
}
# Extensions for which we'll look for symbols
$RelevantExtensions = @('.dll', '.exe', '.so', '.dylib')
# How many files are missing symbol information
$MissingSymbols = 0
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$PackageGuid = New-Guid
$ExtractPath = Join-Path -Path $ExtractPath -ChildPath $PackageGuid
$SymbolsPath = Join-Path -Path $ExtractPath -ChildPath 'Symbols'
[System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath)
Get-ChildItem -Recurse $ExtractPath |
Where-Object {$RelevantExtensions -contains $_.Extension} |
ForEach-Object {
if ($_.FullName -Match '\\ref\\') {
Write-Host "`t Ignoring reference assembly file " $_.FullName
return
}
$SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName '--microsoft-symbol-server' $SymbolsPath
$SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName '--internal-server' $SymbolsPath
Write-Host -NoNewLine "`t Checking file " $_.FullName "... "
if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) {
Write-Host "Symbols found on MSDL ($SymbolsOnMSDL) and SymWeb ($SymbolsOnSymWeb)"
}
else {
$MissingSymbols++
if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) {
Write-Host 'No symbols found on MSDL or SymWeb!'
}
else {
if ($SymbolsOnMSDL -eq $null) {
Write-Host 'No symbols found on MSDL!'
}
else {
Write-Host 'No symbols found on SymWeb!'
}
}
}
}
Pop-Location
return $MissingSymbols
}
function CheckSymbolsAvailable {
if (Test-Path $ExtractPath) {
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
}
Get-ChildItem "$InputPath\*.nupkg" |
ForEach-Object {
$FileName = $_.Name
# These packages from Arcade-Services include some native libraries that
# our current symbol uploader can't handle. Below is a workaround until
# we get issue: https://github.com/dotnet/arcade/issues/2457 sorted.
if ($FileName -Match 'Microsoft\.DotNet\.Darc\.') {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}
elseif ($FileName -Match 'Microsoft\.DotNet\.Maestro\.Tasks\.') {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}
Write-Host "Validating $FileName "
$Status = CountMissingSymbols "$InputPath\$FileName"
if ($Status -ne 0) {
Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $Status modules in the package $FileName"
ExitWithExitCode $exitCode
}
Write-Host
}
}
function InstallDotnetSymbol {
$dotnetSymbolPackageName = 'dotnet-symbol'
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = & "$dotnet" tool list --global
if (($toolList -like "*$dotnetSymbolPackageName*") -and ($toolList -like "*$dotnetSymbolVersion*")) {
Write-Host "dotnet-symbol version $dotnetSymbolVersion is already installed."
}
else {
Write-Host "Installing dotnet-symbol version $dotnetSymbolVersion..."
Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.'
& "$dotnet" tool install $dotnetSymbolPackageName --version $dotnetSymbolVersion --verbosity "minimal" --global
}
}
try {
. $PSScriptRoot\post-build-utils.ps1
Add-Type -AssemblyName System.IO.Compression.FileSystem
InstallDotnetSymbol
CheckSymbolsAvailable
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'CheckSymbols' -Message $_
ExitWithExitCode 1
}
@@ -0,0 +1,64 @@
param(
[Parameter(Mandatory=$true)][string] $SourceRepo,
[Parameter(Mandatory=$true)][int] $ChannelId,
[Parameter(Mandatory=$true)][string] $MaestroApiAccessToken,
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com',
[Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16'
)
try {
. $PSScriptRoot\post-build-utils.ps1
# Get all the $SourceRepo subscriptions
$normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '')
$subscriptions = Get-MaestroSubscriptions -SourceRepository $normalizedSourceRepo -ChannelId $ChannelId
if (!$subscriptions) {
Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'"
ExitWithExitCode 0
}
$subscriptionsToTrigger = New-Object System.Collections.Generic.List[string]
$failedTriggeredSubscription = $false
# Get all enabled subscriptions that need dependency flow on 'everyBuild'
foreach ($subscription in $subscriptions) {
if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) {
Write-Host "Should trigger this subscription: ${$subscription.id}"
[void]$subscriptionsToTrigger.Add($subscription.id)
}
}
foreach ($subscriptionToTrigger in $subscriptionsToTrigger) {
try {
Write-Host "Triggering subscription '$subscriptionToTrigger'."
Trigger-Subscription -SubscriptionId $subscriptionToTrigger
Write-Host 'done.'
}
catch
{
Write-Host "There was an error while triggering subscription '$subscriptionToTrigger'"
Write-Host $_
Write-Host $_.ScriptStackTrace
$failedTriggeredSubscription = $true
}
}
if ($subscriptionsToTrigger.Count -eq 0) {
Write-Host "No subscription matched source repo '$normalizedSourceRepo' and channel ID '$ChannelId'."
}
elseif ($failedTriggeredSubscription) {
Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message 'At least one subscription failed to be triggered...'
ExitWithExitCode 1
}
else {
Write-Host 'All subscriptions were triggered successfully!'
}
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message $_
ExitWithExitCode 1
}
+78
View File
@@ -0,0 +1,78 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = 'Debug',
[string] $task,
[string] $verbosity = 'minimal',
[string] $msbuildEngine = $null,
[switch] $restore,
[switch] $prepareMachine,
[switch] $help,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)
$ci = $true
$binaryLog = $true
$warnAsError = $true
. $PSScriptRoot\tools.ps1
function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -task <value> Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)"
Write-Host " -restore Restore dependencies"
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"
Write-Host " -help Print help and exit"
Write-Host ""
Write-Host "Advanced settings:"
Write-Host " -prepareMachine Prepare machine for CI run"
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
Write-Host ""
Write-Host "Command line arguments not listed above are passed thru to msbuild."
}
function Build([string]$target) {
$logSuffix = if ($target -eq 'Execute') { '' } else { ".$target" }
$log = Join-Path $LogDir "$task$logSuffix.binlog"
$outputPath = Join-Path $ToolsetDir "$task\\"
MSBuild $taskProject `
/bl:$log `
/t:$target `
/p:Configuration=$configuration `
/p:RepoRoot=$RepoRoot `
/p:BaseIntermediateOutputPath=$outputPath `
@properties
}
try {
if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) {
Print-Usage
exit 0
}
if ($task -eq "") {
Write-PipelineTelemetryError -Category 'Build' -Message "Missing required parameter '-task <value>'" -ForegroundColor Red
Print-Usage
ExitWithExitCode 1
}
$taskProject = GetSdkTaskProject $task
if (!(Test-Path $taskProject)) {
Write-PipelineTelemetryError -Category 'Build' -Message "Unknown task: $task" -ForegroundColor Red
ExitWithExitCode 1
}
if ($restore) {
Build 'Restore'
}
Build 'Execute'
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Build' -Message $_
ExitWithExitCode 1
}
ExitWithExitCode 0
Loaded 100 of 5987 files, more files were not shown because too many files have changed in this diff. Show more