Bernhard Urban-Forster [Thu, 10 Oct 2019 09:21:23 +0000 (11:21 +0200)]
[mini] trace snippet should restore return value (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
6ebf07f2cd4f71218c6a4a2ed5f855a5ac9ce9e3
Jay Krell [Thu, 10 Oct 2019 08:26:14 +0000 (01:26 -0700)]
Fix g_assert_not_reached message regression. (mono/mono#17263)
Fix g_assert_not_reached message regression.
Commit migrated from https://github.com/mono/mono/commit/
8c5581a6f2190cbfee3c223ef8ccaf84802de041
Jay Krell [Wed, 9 Oct 2019 20:56:06 +0000 (13:56 -0700)]
Remove varargs from g_assert and g_assert_not_reachable. (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
8718b75b7a89f04e2423d11a009f11b37ef802df
Bernhard Urban-Forster [Wed, 9 Oct 2019 18:16:04 +0000 (20:16 +0200)]
[mini] print inserted instruction in verbose logging (mono/mono#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
```
Commit migrated from https://github.com/mono/mono/commit/
1cf081529e5e37dd9472f7c7b0d0ead659e9b54f
Filip Navara [Wed, 9 Oct 2019 13:47:43 +0000 (15:47 +0200)]
[mini] Fix check for FastAllocateString that used old name (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
cbc8cc658bee5d8447f538bf5e6775bd8dd0dae9
Vlad Brezae [Wed, 9 Oct 2019 11:37:41 +0000 (14:37 +0300)]
[sgen] Fix invalid value passed to write barrier (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
8e649c35450e77e68ff468ced77987e4c0b51f99
Johan Lorensson [Wed, 9 Oct 2019 08:06:09 +0000 (10:06 +0200)]
Running --enable-msvc-only didn't find jay.vcxproj. (mono/mono#17228)
Commit migrated from https://github.com/mono/mono/commit/
7fad4a12e223bb3fc89ae75d448b93ecabc825f0
Filip Navara [Tue, 8 Oct 2019 21:37:34 +0000 (23:37 +0200)]
[netcore] Fix NULL dereference when running LLVM JIT
Commit migrated from https://github.com/mono/mono/commit/
28b3446d9eb433a23b595996d4a32dcea5f46b14
Jay Krell [Wed, 9 Oct 2019 04:54:44 +0000 (21:54 -0700)]
Revert mono_runtime_set_main_args in mono/mono@
44ff0597b835d0af62f526169dba3b365c9c3411. (mono/mono#17233)
It breaks Xamarin.Android.
Commit migrated from https://github.com/mono/mono/commit/
cacf99b97314870585af79e78191b836f9e072b5
Vlad Brezae [Tue, 8 Oct 2019 22:08:44 +0000 (01:08 +0300)]
[interp] Small cleanups (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
579e385b96c5fd4d9e0b597d4820e3bd2e6cd24a
Filip Navara [Tue, 8 Oct 2019 21:45:17 +0000 (23:45 +0200)]
[netcore] Port CoreCLR implementation of Exception.SetCurrentStackTrace (mono/mono#17243)
* Port CoreCLR implementation of Exception.SetCurrentStackTrace
* Update SerializationRemoteStackTraceString
* Update Exception.cs
Commit migrated from https://github.com/mono/mono/commit/
63025d93fd36e834a5f0aca46b659cad0d01d2a2
Alexander Köplinger [Tue, 8 Oct 2019 15:39:41 +0000 (17:39 +0200)]
[netcore] Disable some SafeWaitHandle tests everywhere, not just Linux (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
209c4bae3ec1827d1b0e4799b12a51e88012554c
Filip Navara [Tue, 8 Oct 2019 11:06:38 +0000 (13:06 +0200)]
Fix check in fix_libc_name to trigger only for libc, not or other names with same prefix (mono/mono#17222)
See https://github.com/mono/mono/pull/17210#pullrequestreview-
298663220
Commit migrated from https://github.com/mono/mono/commit/
e8ed2494ca4af4d64706ac3ab06ba405391977c6
Steffen Kieß [Tue, 8 Oct 2019 10:04:45 +0000 (12:04 +0200)]
Clean up map.c /map.h (mono/mono#16746)
* [Mono.Posix] Move Mono_Posix_{From,To}MremapFlags() to support/sys-mman.c
Since mono/mono@
b522eab5ff5466debaacf9e971e26cfc464ebba5 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 mono/mono@
ed892ccf27849c082ce6ca46fa8b96d86ca7c329 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 mono/mono@
22b6b9581418260397b701c17b16c3eb55136de7 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.
Commit migrated from https://github.com/mono/mono/commit/
8bb7b8645a2622462f065d53f252b922bb304134
Ryan Lucia [Mon, 7 Oct 2019 18:16:10 +0000 (14:16 -0400)]
[netcore] Add libc name transition
Commit migrated from https://github.com/mono/mono/commit/
3355d2dd8115b3b2a412acc6efacd43fe0d63093
Alexis Christoforides [Mon, 7 Oct 2019 22:05:13 +0000 (18:05 -0400)]
Remove unused variable
Commit migrated from https://github.com/mono/mono/commit/
37c197f225608b052e1e53c72a63f14488185dcf
Alexis Christoforides [Mon, 7 Oct 2019 20:58:18 +0000 (16:58 -0400)]
[merp] Print missing status marker file for stage 1 (setup)
Commit migrated from https://github.com/mono/mono/commit/
2ca93bd2f9f06b2bc6592b53b89a996691ecde4b
Alexis Christoforides [Mon, 7 Oct 2019 20:59:52 +0000 (16:59 -0400)]
Zeroing is not necessary, snprintf() always null-terminates in this case
Commit migrated from https://github.com/mono/mono/commit/
b18d52bf1cb9832d89802cfc6dbb2ec373f8099e
Vlad Brezae [Fri, 4 Oct 2019 11:22:13 +0000 (14:22 +0300)]
[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.
Commit migrated from https://github.com/mono/mono/commit/
d9c9a5333249a3274f788776de33e06de92d5674
Vlad Brezae [Fri, 4 Oct 2019 08:18:42 +0000 (11:18 +0300)]
[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.
Commit migrated from https://github.com/mono/mono/commit/
f2006f61dc763cf8f8fd7f56743d7cd40f2f22c8
Vlad Brezae [Fri, 4 Oct 2019 07:13:27 +0000 (10:13 +0300)]
[interp] Skip NOPs when checking previous instruction
When emitting stloc.np, which looks for stloc/ldloc pair.
Commit migrated from https://github.com/mono/mono/commit/
fc100ae04315a8954881169eee5cdf156a43b48c
Calvin Buckley [Mon, 7 Oct 2019 22:19:28 +0000 (19:19 -0300)]
dladdr shim for gmodule; try to enable crash reporter on AIX (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
01dd63c440d0ad09542b8d3b9301658a6e8a0d30
Jo Shields [Mon, 7 Oct 2019 20:36:13 +0000 (16:36 -0400)]
Bump version to 6.9 (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
d28d72cb960111e038a54e7b7ea1f897cebe12a1
Ryan Lucia [Thu, 3 Oct 2019 21:15:33 +0000 (17:15 -0400)]
Don't declare mono_get_module* on non-win32
Commit migrated from https://github.com/mono/mono/commit/
1d18c27dbe99a5b5e8489ce6a9c9113023f056e3
Ryan Lucia [Wed, 18 Sep 2019 19:56:37 +0000 (15:56 -0400)]
Use eglib win32 helper functions without MAX_PATH limit
Commit migrated from https://github.com/mono/mono/commit/
ca5926fa3fb595c720fb427c7bd74968ebfbeb42
Ryan Lucia [Tue, 17 Sep 2019 23:47:29 +0000 (19:47 -0400)]
Escape type namespaces, document that we aren't escaping names for now
Commit migrated from https://github.com/mono/mono/commit/
d12db16723f648b11ce1b0cd306a3c82ce4f89cd
Ryan Lucia [Tue, 17 Sep 2019 23:46:38 +0000 (19:46 -0400)]
Make the mono identifier escape function work like unescape and public
Commit migrated from https://github.com/mono/mono/commit/
8760cd446cca20c8ba7f9a49cfacb20e653cc3dd
Ryan Lucia [Tue, 17 Sep 2019 21:20:17 +0000 (17:20 -0400)]
Unescape type names in the managed parser
Commit migrated from https://github.com/mono/mono/commit/
7c2d2a551cf831c2111b6070674b2f564d218efe
Ryan Lucia [Tue, 17 Sep 2019 20:25:53 +0000 (16:25 -0400)]
Make TypeNameParser consistently use tabs
Is this worth the line damage? Unsure.
Commit migrated from https://github.com/mono/mono/commit/
f37c3a649f465ae0c1dde2b3edf8fa71bffe6746
Ryan Lucia [Tue, 17 Sep 2019 20:11:51 +0000 (16:11 -0400)]
Partially revert "Remove redundant function call of EscapeTypeName to make (mono/mono#16425)"
This partially reverts commit mono/mono@
abe48e3fd48407a5b76a6581ae7853c66d800b19.
Commit migrated from https://github.com/mono/mono/commit/
fa8fbbbc36409424c0aeb79ef38e5fffcd8cd422
Jay Krell [Mon, 7 Oct 2019 14:42:13 +0000 (07:42 -0700)]
Do not zero localalloc if not asked. (mono/mono#16881)
Note that we will still touch the pages (mono_emit_stack_alloc).
Commit migrated from https://github.com/mono/mono/commit/
f0ff9f3860b50f3ed857b9b820d5adce5cbd7f10
Jay Krell [Mon, 7 Oct 2019 14:40:22 +0000 (07:40 -0700)]
[Coop] Convert Get/SetGenericValueImpl. (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
957e6fa4ddb9a4cdae818b49850a7b6949a5e6a2
Alexander Köplinger [Mon, 7 Oct 2019 14:38:49 +0000 (16:38 +0200)]
Default --host in autogen.sh on cygwin when missing. (mono/mono#17164)
Commit migrated from https://github.com/mono/mono/commit/
495b08a3c7e4fde49b919749a369e8805f5190c1
Ryan Lucia [Mon, 7 Oct 2019 14:38:23 +0000 (10:38 -0400)]
[IO] Remove read-only logic in mono_w32_get_disk_free_space (mono/mono#17177)
This brings us in line with GetDiskFreeSpaceExW on Windows as well as .NET Core.
Commit migrated from https://github.com/mono/mono/commit/
6f723639326f6c479b604c0d955991519d85ff2d
Thays Grazia [Mon, 7 Oct 2019 12:22:06 +0000 (08:22 -0400)]
[debugger][exception] Debugger breaks on handled exceptions (mono/mono#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 mono/mono#17083
* Reverting unit test changed on commit 405d521.
* Fixing assert when calling mono_jit_info_get_method if it was a trampoline.
Commit migrated from https://github.com/mono/mono/commit/
18fac0a24190cb3f90057d86232e773758bb1284
Egor Bogatov [Mon, 7 Oct 2019 10:29:22 +0000 (13:29 +0300)]
[netcore] Optimize Buffer.BlockCopy and Buffer.IsPrimitiveArray (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
35c6b7691f4043fd49d8393b84224f0d1df1e7fe
Jay Krell [Sun, 6 Oct 2019 08:27:42 +0000 (01:27 -0700)]
Optimize and extend System.Array intrinsic identification. (mono/mono#17047)
* Optimize and extend System.Array intrinsic identification.
i.e. do the strcmp last.
Add GetRawArrayData.
* Use [Intrinsic] attribute instead of comment.
Commit migrated from https://github.com/mono/mono/commit/
f57af77e69ebe0f47da00716cef4a8ff5ec9d9fc
Zoltan Varga [Sun, 6 Oct 2019 00:51:52 +0000 (20:51 -0400)]
[mixed] Add interp entry wrappers for devirtualized calls as well. (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
d2f543b4b1f10bb43a78da807888c3af01cfca25
Aleksey Kliger (λgeek) [Sat, 5 Oct 2019 17:01:56 +0000 (13:01 -0400)]
[merp] Put thread into async context before running summarizer (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
cb52186661254bb17e809ccb753198e7e59c2d90
Aleksey Kliger (λgeek) [Sat, 5 Oct 2019 13:59:05 +0000 (09:59 -0400)]
[merp] exit_status is 0 if we ran the uploader successfully (mono/mono#17185)
Not 1 (TRUE)
Commit migrated from https://github.com/mono/mono/commit/
2f7fd4f03e464946ea752800ca06aa2676e9d75f
Marek Safar [Sat, 5 Oct 2019 07:16:00 +0000 (09:16 +0200)]
[System.Private.CoreLib] Fixes build
Commit migrated from https://github.com/mono/mono/commit/
fce0e64de9a96694d99f14069c7655ad429af01b
Ryan Lucia [Fri, 4 Oct 2019 17:41:56 +0000 (13:41 -0400)]
[reflection] Only duplicate MonoMarshalSpec strings for custom types (mono/mono#17175)
* [reflection] only duplicate MonoMarshalSpec strings for custom types
* Add test
Commit migrated from https://github.com/mono/mono/commit/
05217395db99f0d02a6737ed0491fa65db96632d
Egor Bogatov [Fri, 4 Oct 2019 15:27:01 +0000 (18:27 +0300)]
[llvm] Propogate --enable-llvm-asserts to llvm/build.mk (mono/mono#17149)
* fix Enable llvm asserts
* fix chmod
Commit migrated from https://github.com/mono/mono/commit/
26754eecff93d568f4531e31c7c1bce3202645b1
Vlad Brezae [Fri, 4 Oct 2019 11:20:52 +0000 (14:20 +0300)]
[interp] Improve copy propagation (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
d1b3ee2e3234657044bc5d0f4a9facf0fa06599c
Johan Lorensson [Fri, 4 Oct 2019 07:16:05 +0000 (09:16 +0200)]
Always do copy_stack_data on entering GC safe/unsafe mode. (mono/mono#17150)
Commit migrated from https://github.com/mono/mono/commit/
2aa7adb269c795b721a9fcbac98969efb5b4a006
Aleksey Kliger (λgeek) [Fri, 4 Oct 2019 05:17:49 +0000 (01:17 -0400)]
[merp] Don't overrun buffer in copy_summary_string_safe … (mono/mono#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'
Commit migrated from https://github.com/mono/mono/commit/
ea2a460cf68b6d16a3b379842e91c0bdf942ca16
Vlad Brezae [Thu, 3 Oct 2019 19:29:55 +0000 (22:29 +0300)]
[arm] Fix fetching of method addresses (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
8c1ef74bb125bf49d6b1e3f2e80ac235adb27bd8
dotnet-maestro[bot] [Thu, 3 Oct 2019 18:45:29 +0000 (20:45 +0200)]
[master] Update dependencies from dotnet/corefx (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
06c3637681e4dc2d450c5f0296203493cc536387
Alexander Köplinger [Thu, 3 Oct 2019 16:45:14 +0000 (18:45 +0200)]
[netcore] Update .gitignore
Commit migrated from https://github.com/mono/mono/commit/
43ccc6c26b07fcd4ed41df6d70248c9c3d961e20
Alexander Köplinger [Thu, 3 Oct 2019 16:44:00 +0000 (18:44 +0200)]
[netcore] Move ignored test to global ignore file instead of the Linux-specific
It affects all platform
Commit migrated from https://github.com/mono/mono/commit/
5bf18642ff9ab89832505c66af9e7a5b5a743dd7
Sam Patel [Thu, 3 Oct 2019 14:43:45 +0000 (10:43 -0400)]
Merge pull request mono/mono#17105 from naricc/naricc/UnitializedArray-Comment
Add a comment explaining why GC.AllocateUninitializedArray is not an icall
Commit migrated from https://github.com/mono/mono/commit/
83a5343d125bfd874a70633419ef18f8dca28c55
lateralusX [Thu, 3 Oct 2019 10:25:30 +0000 (12:25 +0200)]
Default --host in autogen.sh on cygwin when missing.
Commit migrated from https://github.com/mono/mono/commit/
aaa383b3e113b2416f9787d4eec6acabf7967d4f
Johan Lorensson [Thu, 3 Oct 2019 09:21:36 +0000 (11:21 +0200)]
Optional only build MSVC runtime using make file system on Windows. (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
55be8289ff1601824707bb2ef9d554b01123f713
Nathan Ricci [Wed, 2 Oct 2019 17:14:48 +0000 (13:14 -0400)]
Spelling corrections.
Commit migrated from https://github.com/mono/mono/commit/
d0461a9d8d662cc686b841d186a0379e6fca8fc7
Jo Shields [Wed, 2 Oct 2019 14:46:42 +0000 (10:46 -0400)]
Fix missing corerun/ directory in `make dist` tarballs (mono/mono#17126)
```
configure.ac:6695: error: required file 'netcore/corerun/Makefile.in' not found
Makefile.am:24: error: required directory ./netcore/corerun does not exist
```
Commit migrated from https://github.com/mono/mono/commit/
d8040ba86520ae584f36628bd7eece1558970f41
Jay Krell [Wed, 2 Oct 2019 10:59:45 +0000 (03:59 -0700)]
Some external_only/internal split, and inlining. (mono/mono#17012)
mono_type_get_type
mono_type_get_signature
mono_type_is_byref
mono_type_get_class
mono_type_get_array_type
Commit migrated from https://github.com/mono/mono/commit/
6fb01aa269e7654db21f32c4d44df0d6e0a93e67
Jay Krell [Wed, 2 Oct 2019 09:51:59 +0000 (02:51 -0700)]
[jit amd64] Add const and remove x87. (mono/mono#16700)
Commit migrated from https://github.com/mono/mono/commit/
8d84b6fd38a00f41eb5d5ced1b4edc1136bb8c4b
Vlad Brezae [Wed, 2 Oct 2019 07:23:45 +0000 (10:23 +0300)]
[mini] Use clr memory model by default (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
0ce8c78e0c19b1a0f6b555bb367fd3d25b0f00ba
Alexis Christoforides [Wed, 2 Oct 2019 05:11:35 +0000 (01:11 -0400)]
[merp] Include any managed methods in the 'unmanaged_frames' portion … (mono/mono#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 mono/mono@
defe86b471f37e12fa66a104747cac932943dca1.
Commit migrated from https://github.com/mono/mono/commit/
10e9159eaa92364f03c8359c47e6129aba1f9bda
Kyle White [Wed, 2 Oct 2019 02:01:35 +0000 (22:01 -0400)]
[merp] Use macOS version not Darwin version in MERP reports (mono/mono#17130)
* Use macOS version not Darwin version in MERP
Fixes mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
0004522028ad30bfb7299a6e50cbab98a63ffeaf
Vlad Brezae [Tue, 1 Oct 2019 09:09:54 +0000 (12:09 +0300)]
[sgen] Fix allocator spelling (mono/mono#17111)
Commit migrated from https://github.com/mono/mono/commit/
f9ca01e3a5348f79f818116d2b4690ea9bb847d9
Marek Safar [Tue, 1 Oct 2019 08:11:29 +0000 (10:11 +0200)]
[netcore] Update coreclr tests package name
Commit migrated from https://github.com/mono/mono/commit/
e5f218786d5cf427a5bc1794c32df02a5f89bb46
Egor Bogatov [Tue, 1 Oct 2019 01:28:55 +0000 (04:28 +0300)]
Enable hw intrinsics in AOT mode (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
5537a7c2ba6fca532c8b4e380278766d659981c0
Vlad Brezae [Mon, 30 Sep 2019 18:15:42 +0000 (21:15 +0300)]
[sgen] Add stats for allocated gchandles (mono/mono#17074)
Commit migrated from https://github.com/mono/mono/commit/
eb887a8c74a4b7444154200638fc336d0d0f198f
Alexander Köplinger [Mon, 30 Sep 2019 13:32:18 +0000 (15:32 +0200)]
[netcore] Disable System.Drawing.Tests.IconTests.CorrectColorDepthExtracted test
It is broken on newer libgdiplus.
Commit migrated from https://github.com/mono/mono/commit/
7f37f76b6d75ed6236f6f33958784180e6f20446
Marek Safar [Fri, 27 Sep 2019 08:19:58 +0000 (10:19 +0200)]
[netcore] Add target for running coreclr tests
Commit migrated from https://github.com/mono/mono/commit/
f88da6cc14d6aa01048526e6f59f7cddafdce2cb
Nathan Ricci [Fri, 27 Sep 2019 18:48:00 +0000 (14:48 -0400)]
Updated comment in GC.cs about unitialized array.
Commit migrated from https://github.com/mono/mono/commit/
bc63dc68f80d075a544f5fe548abeb9127a60673
Vlad Brezae [Fri, 27 Sep 2019 09:36:04 +0000 (12:36 +0300)]
[mini] Expand clr-memory-model effect (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
194506d495a2e2b7b2fad5dbb655f404cecb2c04
Aleksey Kliger (λgeek) [Thu, 26 Sep 2019 21:30:37 +0000 (17:30 -0400)]
[runtime] Respect runtime_version in mono_init_internal (mono/mono#17085)
In mono/mono@
6d2c77fb3373971b4c615a70fe43f3622e3c91d8 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.
Commit migrated from https://github.com/mono/mono/commit/
1dc63ced73eefe7c19cbe51efd6b1b85026e8b0a
Alexander Köplinger [Thu, 26 Sep 2019 21:10:51 +0000 (23:10 +0200)]
Revert "Inline TLS access. (mono/mono#16882)" (mono/mono#17092)
Reverts mono/monomono/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'
```.
Commit migrated from https://github.com/mono/mono/commit/
bffd4c6b99213a0b154d7efac9b0581df67775e8
Vlad Brezae [Thu, 26 Sep 2019 19:38:59 +0000 (22:38 +0300)]
[sgen] Report roots from togglerefs (mono/mono#17063)
Commit migrated from https://github.com/mono/mono/commit/
bada36245443d57428e4048670f709d57b45cd69
Marek Safar [Thu, 26 Sep 2019 11:57:42 +0000 (13:57 +0200)]
[netcore] Correctly send exit code to the caller
Commit migrated from https://github.com/mono/mono/commit/
8da9eebcc6cc2f0dbdb75f88ee48ecb682b68771
Vlad Brezae [Thu, 26 Sep 2019 17:16:04 +0000 (20:16 +0300)]
[sgen] Fix heavy binary protocol build (mono/mono#17037)
[sgen] Fix heavy binary protocol build
Commit migrated from https://github.com/mono/mono/commit/
470e53f6b446f6adabb0ce4164b8540b9f65f09d
imhameed [Thu, 26 Sep 2019 16:29:54 +0000 (09:29 -0700)]
Merge pull request mono/mono#17031 from EgorBo/bmi-mulx
[LLVM] Implement Bmi2.MultiplyNoFlags
Commit migrated from https://github.com/mono/mono/commit/
5e30301ff32ec1a8c83519bab1464437655efe32
Alexis Christoforides [Mon, 23 Sep 2019 19:38:52 +0000 (15:38 -0400)]
[crashing] Remove Mono signal handlers when starting to handle a crash
Fixes https://github.com/mono/mono/issues/16803
Commit migrated from https://github.com/mono/mono/commit/
f52678864de6423da3274efb1131c24b0b450d1e
Alexis Christoforides [Thu, 26 Sep 2019 13:30:01 +0000 (09:30 -0400)]
[merp] Output native library module name when 'whitelist all' mode is enabled (mono/mono#16899)
Partially fixes https://github.com/mono/mono/issues/16689
Commit migrated from https://github.com/mono/mono/commit/
4727b2475f89cf7343edbd095647635c0b26f67a
Bernhard Urban [Thu, 26 Sep 2019 08:45:56 +0000 (10:45 +0200)]
[interp] always require GC Unsafe mode in exception checkpoint (mono/mono#17016)
[interp] always require GC Unsafe mode in exception checkpoint
Follow-up for https://github.com/mono/mono/pull/16955
/cc @BrzVlad
Commit migrated from https://github.com/mono/mono/commit/
c81b6f5ca9bbbf47b303322841b5821b780b14f2
Vlad Brezae [Thu, 19 Sep 2019 14:46:11 +0000 (17:46 +0300)]
[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/mono/mono@
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.
Commit migrated from https://github.com/mono/mono/commit/
f5bb650f784f7d9021178633e7da3b7984122b68
Egor Bogatov [Thu, 26 Sep 2019 07:51:36 +0000 (10:51 +0300)]
LLVM: Add comments (string metadata) for calls (mono/mono#16956)
* Add string metadata to all calls (comments)
* Update mini-llvm.c
* rename tramp_%d to full name too
Commit migrated from https://github.com/mono/mono/commit/
4a72dadb34f313d242908b086f204cd5346d0bbc
Thays Grazia [Wed, 25 Sep 2019 20:12:33 +0000 (17:12 -0300)]
[threading] embedded mono hangs (mono/mono#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 mono/mono#16192
Fixes mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
5b108b5726ec196f4b61d30f406919ce70211754
Jay Krell [Wed, 25 Sep 2019 18:40:38 +0000 (11:40 -0700)]
[Coop] Unconvert ves_icall_Mono_TlsProviderFactory_IsBtlsSupported. (mono/mono#16995)
Commit migrated from https://github.com/mono/mono/commit/
ed0fa35dc2909b346253ede7b10ce19a2566b511
Egor Bogatov [Wed, 25 Sep 2019 16:28:53 +0000 (19:28 +0300)]
[netcore] Disable annoying SourceLink warrnings (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
39ff579432fc6261469f9f0ce6304ca29a5ef141
EgorBo [Wed, 25 Sep 2019 11:58:53 +0000 (14:58 +0300)]
revise all X86 intrinsics
Commit migrated from https://github.com/mono/mono/commit/
2ceb062c9b3b250c8749ab28a976b23aedafccea
Jay Krell [Wed, 25 Sep 2019 10:30:27 +0000 (03:30 -0700)]
Fix comment about mono_thread_interruption_request_flag. (mono/mono#17036)
Fix https://github.com/mono/mono/pull/16906/files#r327660329.
Commit migrated from https://github.com/mono/mono/commit/
baa9adc06af08b9c7dcc1609553795f589a39240
EgorBo [Wed, 25 Sep 2019 01:04:38 +0000 (04:04 +0300)]
Implement Bmi2.MultiplyNoFlags
Commit migrated from https://github.com/mono/mono/commit/
ba471607a32e0117d83fd3ffd1f50f51d18ac5e6
Egor Bogatov [Tue, 24 Sep 2019 18:53:23 +0000 (21:53 +0300)]
LLVM: Intrinsify MathF.Round (mono/mono#16840)
* improve MathF.Round
* prefer vroundss
* enable round only for jit
Commit migrated from https://github.com/mono/mono/commit/
37e46aa9aeec213c94d991da55e16a78b5adf9de
Bernhard Urban [Tue, 24 Sep 2019 18:53:10 +0000 (20:53 +0200)]
[checked-build] update allowed thread states (mono/mono#16971)
Commit migrated from https://github.com/mono/mono/commit/
153b5def01ae036ad1b9318cc54973a10919f0a7
Egor Bogatov [Tue, 24 Sep 2019 18:45:32 +0000 (21:45 +0300)]
Add loop related optimizations to LLVM JIT (mono/mono#16436)
* Add loop-related optimizations
* Update llvm-jit.cpp
* Update llvm-jit.cpp
* Update llvm-jit.cpp
Commit migrated from https://github.com/mono/mono/commit/
8f8596761250d15d64a983d34f7de09645601d16
Egor Bogatov [Tue, 24 Sep 2019 18:44:03 +0000 (21:44 +0300)]
[netcore] Implement missing Bmi1/Bmi2 intrinsics (mono/mono#16919)
* Finalize BMI1
* cleanup
* Update simd-intrinsics-netcore.c
* Update simd-intrinsics-netcore.c
* fix LLVM-AOT
Commit migrated from https://github.com/mono/mono/commit/
ed622e91125b5846895d6dcca5366b1775b47d6d
Bernhard Urban [Tue, 24 Sep 2019 11:07:19 +0000 (13:07 +0200)]
[threads] clear small_id_key TLS when unregistering a thread (mono/mono#16973)
* [threads] clear small_id_key TLS when unregistering a thread
Fixes
```
* thread mono/mono#12, name = 'tid_a507', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1be66144)
* frame mono/mono#0: 0x1be66144 libsystem_c.dylib`__abort + 184
frame mono/mono#1: 0x1be6608c libsystem_c.dylib`abort + 152
frame mono/mono#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 mono/mono#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 mono/mono#4: 0x003abfb4 monotouchtest`monoeg_assertion_message(format=<unavailable>) at goutput.c:184:22 [opt]
frame mono/mono#5: 0x003904dc monotouchtest`mono_thread_small_id_free(id=<unavailable>) at hazard-pointer.c:0:2 [opt]
frame mono/mono#6: 0x003a0a74 monotouchtest`unregister_thread(arg=0x15c88400) at mono-threads.c:588:2 [opt]
frame mono/mono#7: 0x00336110 monotouchtest`mono_thread_detach_if_exiting at threads.c:1571:4 [opt]
frame mono/mono#8: 0x003e7a14 monotouchtest`::xamarin_release_trampoline(self=0x166452f0, sel="release") at trampolines.m:644:3
frame mono/mono#9: 0x001cdc40 monotouchtest`::-[__Xamarin_NSTimerActionDispatcher release](self=0x166452f0, _cmd="release") at registrar.m:83445:3
frame mono/mono#10: 0x1ce2ae68 Foundation`_timerRelease + 80
frame mono/mono#11: 0x1c31b56c CoreFoundation`CFRunLoopTimerInvalidate + 612
frame mono/mono#12: 0x1c31a554 CoreFoundation`__CFRunLoopTimerDeallocate + 32
frame mono/mono#13: 0x1c31dde4 CoreFoundation`_CFRelease + 220
frame mono/mono#14: 0x1c2be6e8 CoreFoundation`__CFArrayReleaseValues + 500
frame mono/mono#15: 0x1c2be4c4 CoreFoundation`CFArrayRemoveAllValues + 104
frame mono/mono#16: 0x1c31ff64 CoreFoundation`__CFSetApplyFunction_block_invoke + 24
frame mono/mono#17: 0x1c3b2e18 CoreFoundation`CFBasicHashApply + 116
frame mono/mono#18: 0x1c31ff10 CoreFoundation`CFSetApplyFunction + 160
frame mono/mono#19: 0x1c3152cc CoreFoundation`__CFRunLoopDeallocate + 204
frame mono/mono#20: 0x1c31dde4 CoreFoundation`_CFRelease + 220
frame mono/mono#21: 0x1c304a80 CoreFoundation`__CFTSDFinalize + 144
frame mono/mono#22: 0x1bfa324c libsystem_pthread.dylib`_pthread_tsd_cleanup + 644
frame mono/mono#23: 0x1bf9cc08 libsystem_pthread.dylib`_pthread_exit + 80
frame mono/mono#24: 0x1bf9af24 libsystem_pthread.dylib`pthread_exit + 36
frame mono/mono#25: 0x0039df84 monotouchtest`mono_threads_platform_exit(exit_code=<unavailable>) at mono-threads-posix.c:145:2 [opt]
frame mono/mono#26: 0x0033bb84 monotouchtest`start_wrapper(data=0x1609e1c0) at threads.c:1296:2 [opt]
frame mono/mono#27: 0x1bf9b914 libsystem_pthread.dylib`_pthread_body + 128
frame mono/mono#28: 0x1bf9b874 libsystem_pthread.dylib`_pthread_start + 44
frame mono/mono#29: 0x1bfa3b94 libsystem_pthread.dylib`thread_start + 4
```
* Update mono/utils/mono-threads.c
Co-Authored-By: Aleksey Kliger (λgeek) <akliger@gmail.com>
Commit migrated from https://github.com/mono/mono/commit/
749493d4b3a388b91bd454cc153000049b04b526
Thays Grazia [Mon, 23 Sep 2019 21:16:59 +0000 (18:16 -0300)]
[debugger] New way to filter exceptions to support VSWin features (mono/mono#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
Commit migrated from https://github.com/mono/mono/commit/
7e6d863686af20509f4a0dc7cd4fca351e295347
Alexander Köplinger [Mon, 23 Sep 2019 20:44:59 +0000 (22:44 +0200)]
Correctly check for HAVE_STAT_BIRTHTIME in configure.ac checks for System.Native (mono/mono#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/mono/mono@
8f5cef936491e8b20888bbf18d426482c890637c.
Fixes https://github.com/mono/mono/issues/16974
Commit migrated from https://github.com/mono/mono/commit/
9b98db9ca949bbb706a3d647662985347816d9f7
Alexis Christoforides [Mon, 23 Sep 2019 19:49:53 +0000 (15:49 -0400)]
[merp] Use function names even in 'private crashes' mode (mono/mono#16897)
Partially fixes https://github.com/mono/mono/issues/16689
Commit migrated from https://github.com/mono/mono/commit/
bc43f32c9d7eb5db32f580da85d14a98518b1d8b
Jay Krell [Mon, 23 Sep 2019 09:10:23 +0000 (02:10 -0700)]
[interp] Improve debuggability with enum. (mono/mono#16721)
Commit migrated from https://github.com/mono/mono/commit/
7497e4933c6fc0819f8f202829c26c410e4f0e5c
Thays Grazia [Sun, 22 Sep 2019 19:12:10 +0000 (16:12 -0300)]
[debugger] Crash when debugging iOS application that throws (mono/mono#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 mono/mono#16824
Commit migrated from https://github.com/mono/mono/commit/
1a277c31a095a1b5b8212ed6c0425fad7bb4a42b
EgorBo [Sat, 21 Sep 2019 18:05:13 +0000 (21:05 +0300)]
netcore: fix debug build
Commit migrated from https://github.com/mono/mono/commit/
6257369adcf940d81196c476fbbf6978cb008ada
Jay Krell [Sat, 21 Sep 2019 16:35:19 +0000 (09:35 -0700)]
Inline TLS access. (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
aca55a42aa5117f4406b68b1ac217063cc7ab3ec
Jay Krell [Sat, 21 Sep 2019 09:09:41 +0000 (02:09 -0700)]
Partially inline mono_method_signature_checked/internal. (mono/mono#16927)
* Inline common fast paths of mono_method_signature_checked and mono_method_signature_internal.
* PR: Restore profilers to use mainstream functions.
Commit migrated from https://github.com/mono/mono/commit/
b20c690e3e96c16a7a5c4ab580060db4ccf28d86
Bernhard Urban [Fri, 20 Sep 2019 22:02:20 +0000 (00:02 +0200)]
[arm64_32] fix pointer size in CallInfo (mono/mono#16970)
Note that in the output below `a`, `b`, etc. are NSObjects, so they are really passed as pointer.
Before:
```
* thread mono/mono#1, name = 'tid_303', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame mono/mono#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 mono/mono#1
* frame mono/mono#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 mono/mono#1: 0x04d9984c aWatchOSExtension`interp_to_native_trampoline + 156
frame mono/mono#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 mono/mono#3: 0x04f3bfa4 aWatchOSExtension`interp_exec_method_full(frame=0x05167d38, context=<unavailable>, clause_args=0x00000000, error=0x05168540) at interp.c:3290:5 [opt]
```
After:
```
* thread mono/mono#1, name = 'tid_303', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame mono/mono#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 }
```
Commit migrated from https://github.com/mono/mono/commit/
0f181a9dc4bc5d08e7876a726237c3d10e671b16
Jay Krell [Fri, 20 Sep 2019 21:58:16 +0000 (14:58 -0700)]
[Coop] ves_icall_property_info_get_default_value. (mono/mono#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.
Commit migrated from https://github.com/mono/mono/commit/
12d3dcecc6bdac25d485a90b6e077c1ec9d29bbe